mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
initial dojo generator. moving to dojo nightly build and checking in the widget libraries as well.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3488 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
16
source/web/scripts/ajax/src/text/Builder.js
Normal file
16
source/web/scripts/ajax/src/text/Builder.js
Normal file
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
Copyright (c) 2004-2006, The Dojo Foundation
|
||||
All Rights Reserved.
|
||||
|
||||
Licensed under the Academic Free License version 2.1 or above OR the
|
||||
modified BSD license. For more information on Dojo licensing, see:
|
||||
|
||||
http://dojotoolkit.org/community/licensing.shtml
|
||||
*/
|
||||
|
||||
dojo.provide("dojo.text.Builder");
|
||||
dojo.require("dojo.string.Builder");
|
||||
|
||||
dojo.deprecated("dojo.text.Builder", "use dojo.string.Builder instead", "0.4");
|
||||
|
||||
dojo.text.Builder = dojo.string.Builder;
|
15
source/web/scripts/ajax/src/text/String.js
Normal file
15
source/web/scripts/ajax/src/text/String.js
Normal file
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
Copyright (c) 2004-2006, The Dojo Foundation
|
||||
All Rights Reserved.
|
||||
|
||||
Licensed under the Academic Free License version 2.1 or above OR the
|
||||
modified BSD license. For more information on Dojo licensing, see:
|
||||
|
||||
http://dojotoolkit.org/community/licensing.shtml
|
||||
*/
|
||||
|
||||
dojo.deprecated("dojo.text.String", "replaced by dojo.string", "0.4");
|
||||
dojo.require("dojo.string");
|
||||
|
||||
dojo.text = dojo.string;
|
||||
dojo.provide("dojo.text.String");
|
15
source/web/scripts/ajax/src/text/Text.js
Normal file
15
source/web/scripts/ajax/src/text/Text.js
Normal file
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
Copyright (c) 2004-2006, The Dojo Foundation
|
||||
All Rights Reserved.
|
||||
|
||||
Licensed under the Academic Free License version 2.1 or above OR the
|
||||
modified BSD license. For more information on Dojo licensing, see:
|
||||
|
||||
http://dojotoolkit.org/community/licensing.shtml
|
||||
*/
|
||||
|
||||
dojo.deprecated("dojo.text.Text", "replaced by dojo.string", "0.4");
|
||||
dojo.require("dojo.string");
|
||||
|
||||
dojo.text = dojo.string;
|
||||
dojo.provide("dojo.text.Text");
|
7
source/web/scripts/ajax/src/text/__package__.js
Normal file
7
source/web/scripts/ajax/src/text/__package__.js
Normal file
@@ -0,0 +1,7 @@
|
||||
dojo.kwCompoundRequire({
|
||||
common: [
|
||||
"dojo.text.String",
|
||||
"dojo.text.Builder"
|
||||
]
|
||||
});
|
||||
dojo.provide("dojo.text.*");
|
71
source/web/scripts/ajax/src/text/textDirectory.js
Normal file
71
source/web/scripts/ajax/src/text/textDirectory.js
Normal file
@@ -0,0 +1,71 @@
|
||||
dojo.provide("dojo.text.textDirectory");
|
||||
dojo.provide("dojo.text.textDirectory.Property");
|
||||
dojo.provide("dojo.text.textDirectory.tokenise");
|
||||
dojo.require("dojo.string");
|
||||
|
||||
/* adapted from Paul Sowden's iCalendar work */
|
||||
|
||||
dojo.textDirectoryTokeniser = function () {}
|
||||
|
||||
/*
|
||||
* This class parses a single line from a text/directory file
|
||||
* and returns an object with four named values; name, group, params
|
||||
* and value. name, group and value are strings containing the original
|
||||
* tokens unaltered and values is an array containing name/value pairs
|
||||
* or a single name token packed into arrays.
|
||||
*/
|
||||
dojo.textDirectoryTokeniser.Property = function (line) {
|
||||
// split into name/value pair
|
||||
var left = dojo.string.trim(line.substring(0, line.indexOf(':')));
|
||||
var right = dojo.string.trim(line.substr(line.indexOf(':') + 1));
|
||||
|
||||
// seperate name and paramters
|
||||
var parameters = dojo.string.splitEscaped(left,';');
|
||||
this.name = parameters[0]
|
||||
parameters.splice(0, 1);
|
||||
|
||||
// parse paramters
|
||||
this.params = [];
|
||||
for (var i = 0; i < parameters.length; i++) {
|
||||
var arr = parameters[i].split("=");
|
||||
var key = dojo.string.trim(arr[0].toUpperCase());
|
||||
|
||||
if (arr.length == 1) { this.params.push([key]); continue; }
|
||||
|
||||
var values = dojo.string.splitEscaped(arr[1],',');
|
||||
for (var j = 0; j < values.length; j++) {
|
||||
if (dojo.string.trim(values[j]) != '') {
|
||||
this.params.push([key, dojo.string.trim(values[j])]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// seperate group
|
||||
if (this.name.indexOf('.') > 0) {
|
||||
var arr = this.name.split('.');
|
||||
this.group = arr[0];
|
||||
this.name = arr[1];
|
||||
}
|
||||
|
||||
// don't do any parsing, leave to implementation
|
||||
this.value = right;
|
||||
}
|
||||
|
||||
|
||||
// tokeniser, parses into an array of properties.
|
||||
dojo.textDirectoryTokeniser.tokenise = function (text) {
|
||||
// normlize to one propterty per line and parse
|
||||
var nText = dojo.string.normalizeNewlines(text,"\n");
|
||||
nText = nText.replace(/\n[ \t]/g, '');
|
||||
nText = nText.replace(/\x00/g, '');
|
||||
|
||||
var lines = nText.split("\n");
|
||||
var properties = []
|
||||
|
||||
for (var i = 0; i < lines.length; i++) {
|
||||
if (dojo.string.trim(lines[i]) == '') { continue; }
|
||||
var prop = new dojo.textDirectoryTokeniser.Property(lines[i]);
|
||||
properties.push(prop);
|
||||
}
|
||||
return properties;
|
||||
}
|
Reference in New Issue
Block a user