* <script type="text/javascript">
*/
// usage:
-//imports['String.js'].load(String);
-if (imports) {
- load = false; // declare global for gnome langs.
-}
-(function () {
-
+//String = imports.String.String;
+XObject = imports.XObject.XObject;
- var string = {
+String = XObject.extend(String,
+ {
/** @scope String */
}
- };
+ }
+);
/**
* Utility function that allows you to easily switch a string between two alternating values. The passed value
* @return {String} The new value
*/
- var stringPrototype = {
+XObject.extend(String.prototype, {
+
toggle : function(value, other){
return this == value ? other : value;
},
return this;
}
- };
-
-
- if (imports) {
- load = function(ar) {
- String = ar;
- imports.lang.copyPropertiesNoOverwrite(string,ar);
- imports.lang.copyPropertiesNoOverwrite(stringPrototype,ar.prototype);
- };
- } else {
- // non imports version.
- for(i in stringPrototype) {
- if (!String.prototype[i]) {
- String.prototype[i] = stringPrototype[i];
- }
- }
- for(i in string) {
- if (!String[i]) {
- String[i] = string[i];
- }
- }
- }
-})();
\ No newline at end of file
+
+});
\ No newline at end of file