added explanations regarding the usage of these optional repositories and added docs for helma.Image
This commit is contained in:
parent
c17e1df282
commit
e4d04f1db0
25 changed files with 146 additions and 6 deletions
|
@ -16,6 +16,10 @@
|
|||
|
||||
/**
|
||||
* @fileoverview Adds useful methods to the JavaScript Array type.
|
||||
* <br /><br />
|
||||
* To use this optional module, its repository needs to be added to the
|
||||
* application, for example by calling app.addRepository('modules/core/Array.js')
|
||||
*
|
||||
* @addon
|
||||
*/
|
||||
|
||||
|
|
|
@ -16,6 +16,9 @@
|
|||
|
||||
/**
|
||||
* @fileoverview Adds useful methods to the JavaScript Date type.
|
||||
* <br /><br />
|
||||
* To use this optional module, its repository needs to be added to the
|
||||
* application, for example by calling app.addRepository('modules/core/Date.js')
|
||||
*/
|
||||
|
||||
Date.ONESECOND = 1000;
|
||||
|
|
|
@ -16,6 +16,9 @@
|
|||
|
||||
/**
|
||||
* @fileoverview Implements some useful macro filters.
|
||||
* <br /><br />
|
||||
* To use this optional module, its repository needs to be added to the
|
||||
* application, for example by calling app.addRepository('modules/core/Filters.js')
|
||||
*/
|
||||
|
||||
app.addRepository('modules/core/String.js');
|
||||
|
|
|
@ -14,6 +14,12 @@
|
|||
* $Date$
|
||||
*/
|
||||
|
||||
/**
|
||||
* @fileoverview Adds useful global macros.
|
||||
* <br /><br />
|
||||
* To use this optional module, its repository needs to be added to the
|
||||
* application, for example by calling app.addRepository('modules/core/Global.js')
|
||||
*/
|
||||
|
||||
app.addRepository("modules/core/String.js");
|
||||
|
||||
|
|
|
@ -14,6 +14,12 @@
|
|||
* $Date$
|
||||
*/
|
||||
|
||||
/**
|
||||
* @fileoverview Adds useful methods to Helma's built-in HopObject prototype.
|
||||
* <br /><br />
|
||||
* To use this optional module, its repository needs to be added to the
|
||||
* application, for example by calling app.addRepository('modules/core/HopObject.js')
|
||||
*/
|
||||
|
||||
app.addRepository("modules/core/Number.js");
|
||||
app.addRepository("modules/core/String.js");
|
||||
|
|
21
core/JSON.js
21
core/JSON.js
|
@ -14,6 +14,12 @@
|
|||
* $Date$
|
||||
*/
|
||||
|
||||
/**
|
||||
* @fileoverview Adds JSON methods to the Object, Array and String prototypes.
|
||||
* <br /><br />
|
||||
* To use this optional module, its repository needs to be added to the
|
||||
* application, for example by calling app.addRepository('modules/core/JSON.js')
|
||||
*/
|
||||
|
||||
/*
|
||||
json.js
|
||||
|
@ -49,6 +55,9 @@
|
|||
},
|
||||
|
||||
s = {
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
array: function (x) {
|
||||
var a = ['['], b, f, i, l = x.length, v;
|
||||
for (i = 0; i < l; i += 1) {
|
||||
|
@ -77,10 +86,16 @@
|
|||
return "null";
|
||||
},
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
number: function (x) {
|
||||
return isFinite(x) ? String(x) : 'null';
|
||||
},
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
object: function (x) {
|
||||
if (x) {
|
||||
if (x instanceof Array) {
|
||||
|
@ -107,6 +122,9 @@
|
|||
return 'null';
|
||||
},
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
string: function (x) {
|
||||
if (/["\\\x00-\x1f]/.test(x)) {
|
||||
x = x.replace(/([\x00-\x1f\\"])/g, function(a, b) {
|
||||
|
@ -127,6 +145,7 @@
|
|||
/**
|
||||
* This method produces a JSON text from an object.
|
||||
* The object must not contain any cyclical references.
|
||||
* @ignore
|
||||
*/
|
||||
Object.prototype.toJSON = function () {
|
||||
return s.object(this);
|
||||
|
@ -135,6 +154,7 @@
|
|||
/**
|
||||
* This method produces a JSON text from an array.
|
||||
* The array must not contain any cyclical references.
|
||||
* @ignore
|
||||
*/
|
||||
Array.prototype.toJSON = function () {
|
||||
return s.array(this);
|
||||
|
@ -149,6 +169,7 @@
|
|||
/**
|
||||
* This method parses a JSON text to produce an object or
|
||||
* array. It will return false if there is an error.
|
||||
* @ignore
|
||||
*/
|
||||
String.prototype.parseJSON = function () {
|
||||
try {
|
||||
|
|
|
@ -16,6 +16,9 @@
|
|||
|
||||
/**
|
||||
* @fileoverview Adds useful methods to the JavaScript Number type.
|
||||
* <br /><br />
|
||||
* To use this optional module, its repository needs to be added to the
|
||||
* application, for example by calling app.addRepository('modules/core/Number.js')
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -16,6 +16,9 @@
|
|||
|
||||
/**
|
||||
* @fileoverview Adds useful methods to the JavaScript Object type.
|
||||
* <br /><br />
|
||||
* To use this optional module, its repository needs to be added to the
|
||||
* application, for example by calling app.addRepository('modules/core/Object.js')
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -32,6 +32,9 @@ String.NULL = String.EMPTY; // to be deprecated?
|
|||
|
||||
/**
|
||||
* @fileoverview Adds useful methods to the JavaScript String type.
|
||||
* <br /><br />
|
||||
* To use this optional module, its repository needs to be added to the
|
||||
* application, for example by calling app.addRepository('modules/core/String.js')
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue