X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/6746dc89c47ed01b165cc1152533605f97eb8e8d..f562e4c6e5fac7bcb445985b99acbea4d706e6f0:/docs/output/Ext.util.Inflector.js diff --git a/docs/output/Ext.util.Inflector.js b/docs/output/Ext.util.Inflector.js index e2c6525f..5eee3b61 100644 --- a/docs/output/Ext.util.Inflector.js +++ b/docs/output/Ext.util.Inflector.js @@ -1,313 +1 @@ -Ext.data.JsonP.Ext_util_Inflector({ - "allMixins": [ - - ], - "deprecated": null, - "docauthor": null, - "members": { - "cfg": [ - - ], - "method": [ - { - "deprecated": null, - "alias": null, - "protected": false, - "tagname": "method", - "href": "Inflector.html#Ext-util-Inflector-method-classify", - "shortDoc": "Returns the correct Model name for a given string. ...", - "static": false, - "filename": "/mnt/ebs/nightly/git/SDK/platform/src/util/Inflector.js", - "private": false, - "params": [ - { - "type": "String", - "optional": false, - "doc": "
The word to classify
\n", - "name": "word" - } - ], - "name": "classify", - "owner": "Ext.util.Inflector", - "doc": "Returns the correct Model name for a given string. Mostly used internally by the data\npackage
\n", - "linenr": 237, - "return": { - "type": "String", - "doc": "The classified version of the word
\n" - }, - "html_filename": "Inflector.html" - }, - { - "deprecated": null, - "alias": null, - "protected": false, - "tagname": "method", - "href": "Inflector.html#Ext-util-Inflector-method-clearPlurals", - "shortDoc": "Removes all registered pluralization rules ...", - "static": false, - "filename": "/mnt/ebs/nightly/git/SDK/platform/src/util/Inflector.js", - "private": false, - "params": [ - - ], - "name": "clearPlurals", - "owner": "Ext.util.Inflector", - "doc": "Removes all registered pluralization rules
\n", - "linenr": 169, - "return": { - "type": "void", - "doc": "\n" - }, - "html_filename": "Inflector.html" - }, - { - "deprecated": null, - "alias": null, - "protected": false, - "tagname": "method", - "href": "Inflector.html#Ext-util-Inflector-method-clearSingulars", - "shortDoc": "Removes all registered singularization rules ...", - "static": false, - "filename": "/mnt/ebs/nightly/git/SDK/platform/src/util/Inflector.js", - "private": false, - "params": [ - - ], - "name": "clearSingulars", - "owner": "Ext.util.Inflector", - "doc": "Removes all registered singularization rules
\n", - "linenr": 162, - "return": { - "type": "void", - "doc": "\n" - }, - "html_filename": "Inflector.html" - }, - { - "deprecated": null, - "alias": null, - "protected": false, - "tagname": "method", - "href": "Inflector.html#Ext-util-Inflector-method-isTransnumeral", - "shortDoc": "Returns true if the given word is transnumeral (the word is its own singular and plural form - e.g. ...", - "static": false, - "filename": "/mnt/ebs/nightly/git/SDK/platform/src/util/Inflector.js", - "private": false, - "params": [ - { - "type": "String", - "optional": false, - "doc": "The word to test
\n", - "name": "word" - } - ], - "name": "isTransnumeral", - "owner": "Ext.util.Inflector", - "doc": "Returns true if the given word is transnumeral (the word is its own singular and plural form - e.g. sheep, fish)
\n", - "linenr": 176, - "return": { - "type": "Boolean", - "doc": "True if the word is transnumeral
\n" - }, - "html_filename": "Inflector.html" - }, - { - "deprecated": null, - "alias": null, - "protected": false, - "tagname": "method", - "href": "Inflector.html#Ext-util-Inflector-method-ordinalize", - "shortDoc": "Ordinalizes a given number by adding a prefix such as 'st', 'nd', 'rd' or 'th' based on the last digit of the\nnumber. ...", - "static": false, - "filename": "/mnt/ebs/nightly/git/SDK/platform/src/util/Inflector.js", - "private": false, - "params": [ - { - "type": "Number", - "optional": false, - "doc": "The number to ordinalize
\n", - "name": "number" - } - ], - "name": "ordinalize", - "owner": "Ext.util.Inflector", - "doc": "Ordinalizes a given number by adding a prefix such as 'st', 'nd', 'rd' or 'th' based on the last digit of the\nnumber. 21 -> 21st, 22 -> 22nd, 23 -> 23rd, 24 -> 24th etc
\n", - "linenr": 247, - "return": { - "type": "String", - "doc": "The ordinalized number
\n" - }, - "html_filename": "Inflector.html" - }, - { - "deprecated": null, - "alias": null, - "protected": false, - "tagname": "method", - "href": "Inflector.html#Ext-util-Inflector-method-plural", - "shortDoc": "Adds a new pluralization rule to the Inflector. ...", - "static": false, - "filename": "/mnt/ebs/nightly/git/SDK/platform/src/util/Inflector.js", - "private": false, - "params": [ - { - "type": "RegExp", - "optional": false, - "doc": "The matcher regex
\n", - "name": "matcher" - }, - { - "type": "String", - "optional": false, - "doc": "The replacement string, which can reference matches from the matcher argument
\n", - "name": "replacer" - } - ], - "name": "plural", - "owner": "Ext.util.Inflector", - "doc": "Adds a new pluralization rule to the Inflector. See the intro docs for more information
\n", - "linenr": 153, - "return": { - "type": "void", - "doc": "\n" - }, - "html_filename": "Inflector.html" - }, - { - "deprecated": null, - "alias": null, - "protected": false, - "tagname": "method", - "href": "Inflector.html#Ext-util-Inflector-method-pluralize", - "shortDoc": "Returns the pluralized form of a word (e.g. ...", - "static": false, - "filename": "/mnt/ebs/nightly/git/SDK/platform/src/util/Inflector.js", - "private": false, - "params": [ - { - "type": "String", - "optional": false, - "doc": "The word to pluralize
\n", - "name": "word" - } - ], - "name": "pluralize", - "owner": "Ext.util.Inflector", - "doc": "Returns the pluralized form of a word (e.g. Ext.util.Inflector.pluralize('word') returns 'words')
\n", - "linenr": 185, - "return": { - "type": "String", - "doc": "The pluralized form of the word
\n" - }, - "html_filename": "Inflector.html" - }, - { - "deprecated": null, - "alias": null, - "protected": false, - "tagname": "method", - "href": "Inflector.html#Ext-util-Inflector-method-singular", - "shortDoc": "Adds a new singularization rule to the Inflector. ...", - "static": false, - "filename": "/mnt/ebs/nightly/git/SDK/platform/src/util/Inflector.js", - "private": false, - "params": [ - { - "type": "RegExp", - "optional": false, - "doc": "The matcher regex
\n", - "name": "matcher" - }, - { - "type": "String", - "optional": false, - "doc": "The replacement string, which can reference matches from the matcher argument
\n", - "name": "replacer" - } - ], - "name": "singular", - "owner": "Ext.util.Inflector", - "doc": "Adds a new singularization rule to the Inflector. See the intro docs for more information
\n", - "linenr": 144, - "return": { - "type": "void", - "doc": "\n" - }, - "html_filename": "Inflector.html" - }, - { - "deprecated": null, - "alias": null, - "protected": false, - "tagname": "method", - "href": "Inflector.html#Ext-util-Inflector-method-singularize", - "shortDoc": "Returns the singularized form of a word (e.g. ...", - "static": false, - "filename": "/mnt/ebs/nightly/git/SDK/platform/src/util/Inflector.js", - "private": false, - "params": [ - { - "type": "String", - "optional": false, - "doc": "The word to singularize
\n", - "name": "word" - } - ], - "name": "singularize", - "owner": "Ext.util.Inflector", - "doc": "Returns the singularized form of a word (e.g. Ext.util.Inflector.singularize('words') returns 'word')
\n", - "linenr": 211, - "return": { - "type": "String", - "doc": "The singularized form of the word
\n" - }, - "html_filename": "Inflector.html" - } - ], - "property": [ - - ], - "cssVar": [ - - ], - "cssMixin": [ - - ], - "event": [ - - ] - }, - "singleton": true, - "alias": null, - "superclasses": [ - - ], - "protected": false, - "tagname": "class", - "mixins": [ - - ], - "href": "Inflector.html#Ext-util-Inflector", - "subclasses": [ - - ], - "static": false, - "author": null, - "component": false, - "filename": "/mnt/ebs/nightly/git/SDK/platform/src/util/Inflector.js", - "private": false, - "alternateClassNames": [ - - ], - "name": "Ext.util.Inflector", - "doc": "General purpose inflector class that pluralizes, singularizes and \nordinalizes words. Sample usage:
\n\n\n\n\n//turning singular words into plurals\nExt.util.Inflector.pluralize('word'); //'words'\nExt.util.Inflector.pluralize('person'); //'people'\nExt.util.Inflector.pluralize('sheep'); //'sheep'\n\n//turning plurals into singulars\nExt.util.Inflector.singularize('words'); //'word'\nExt.util.Inflector.singularize('people'); //'person'\nExt.util.Inflector.singularize('sheep'); //'sheep'\n\n//ordinalizing numbers\nExt.util.Inflector.ordinalize(11); //\"11th\"\nExt.util.Inflector.ordinalize(21); //\"21th\"\nExt.util.Inflector.ordinalize(1043); //\"1043rd\"\n
\n\n\n\n\nCustomization
\n\n\n\n\nThe Inflector comes with a default set of US English pluralization rules. These can be augmented with additional\nrules if the default rules do not meet your application's requirements, or swapped out entirely for other languages.\nHere is how we might add a rule that pluralizes \"ox\" to \"oxen\":
\n\n\n\n\nExt.util.Inflector.plural(/^(ox)$/i, \"$1en\");\n
\n\n\n\n\nEach rule consists of two items - a regular expression that matches one or more rules, and a replacement string.\nIn this case, the regular expression will only match the string \"ox\", and will replace that match with \"oxen\". \nHere's how we could add the inverse rule:
\n\n\n\n\nExt.util.Inflector.singular(/^(ox)en$/i, \"$1\");\n
\n\n\n\n\nNote that the ox/oxen rules are present by default.
\n\n", - "mixedInto": [ - - ], - "linenr": 1, - "xtypes": [ - - ], - "html_filename": "Inflector.html", - "extends": "Object" -}); \ No newline at end of file +Ext.data.JsonP.Ext_util_Inflector({"tagname":"class","html":"Hierarchy
Ext.BaseExt.util.InflectorFiles
General purpose inflector class that pluralizes, singularizes and\nordinalizes words. Sample usage:
\n\n//turning singular words into plurals\nExt.util.Inflector.pluralize('word'); //'words'\nExt.util.Inflector.pluralize('person'); //'people'\nExt.util.Inflector.pluralize('sheep'); //'sheep'\n\n//turning plurals into singulars\nExt.util.Inflector.singularize('words'); //'word'\nExt.util.Inflector.singularize('people'); //'person'\nExt.util.Inflector.singularize('sheep'); //'sheep'\n\n//ordinalizing numbers\nExt.util.Inflector.ordinalize(11); //\"11th\"\nExt.util.Inflector.ordinalize(21); //\"21th\"\nExt.util.Inflector.ordinalize(1043); //\"1043rd\"\n
\n\nThe Inflector comes with a default set of US English pluralization rules. These can be augmented with additional\nrules if the default rules do not meet your application's requirements, or swapped out entirely for other languages.\nHere is how we might add a rule that pluralizes \"ox\" to \"oxen\":
\n\nExt.util.Inflector.plural(/^(ox)$/i, \"$1en\");\n
\n\nEach rule consists of two items - a regular expression that matches one or more rules, and a replacement string. In\nthis case, the regular expression will only match the string \"ox\", and will replace that match with \"oxen\". Here's\nhow we could add the inverse rule:
\n\nExt.util.Inflector.singular(/^(ox)en$/i, \"$1\");\n
\n\nNote that the ox/oxen rules are present by default.
\nGet the reference to the current class from which this object was instantiated. Unlike statics,\nthis.self
is scope-dependent and it's meant to be used for dynamic inheritance. See statics\nfor a detailed comparison
Ext.define('My.Cat', {\n statics: {\n speciesName: 'Cat' // My.Cat.speciesName = 'Cat'\n },\n\n constructor: function() {\n alert(this.self.speciesName); / dependent on 'this'\n\n return this;\n },\n\n clone: function() {\n return new this.self();\n }\n});\n\n\nExt.define('My.SnowLeopard', {\n extend: 'My.Cat',\n statics: {\n speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard'\n }\n});\n\nvar cat = new My.Cat(); // alerts 'Cat'\nvar snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard'\n\nvar clone = snowLeopard.clone();\nalert(Ext.getClassName(clone)); // alerts 'My.SnowLeopard'\n
\nCall the original method that was previously overridden with override
\n\nExt.define('My.Cat', {\n constructor: function() {\n alert(\"I'm a cat!\");\n\n return this;\n }\n});\n\nMy.Cat.override({\n constructor: function() {\n alert(\"I'm going to be a cat!\");\n\n var instance = this.callOverridden();\n\n alert(\"Meeeeoooowwww\");\n\n return instance;\n }\n});\n\nvar kitty = new My.Cat(); // alerts \"I'm going to be a cat!\"\n // alerts \"I'm a cat!\"\n // alerts \"Meeeeoooowwww\"\n
\nThe arguments, either an array or the arguments
object
Returns the result after calling the overridden method
\nCall the parent's overridden method. For example:
\n\nExt.define('My.own.A', {\n constructor: function(test) {\n alert(test);\n }\n});\n\nExt.define('My.own.B', {\n extend: 'My.own.A',\n\n constructor: function(test) {\n alert(test);\n\n this.callParent([test + 1]);\n }\n});\n\nExt.define('My.own.C', {\n extend: 'My.own.B',\n\n constructor: function() {\n alert(\"Going to call parent's overriden constructor...\");\n\n this.callParent(arguments);\n }\n});\n\nvar a = new My.own.A(1); // alerts '1'\nvar b = new My.own.B(1); // alerts '1', then alerts '2'\nvar c = new My.own.C(2); // alerts \"Going to call parent's overriden constructor...\"\n // alerts '2', then alerts '3'\n
\nThe arguments, either an array or the arguments
object\nfrom the current method, for example: this.callParent(arguments)
Returns the result from the superclass' method
\nRemoves all registered pluralization rules
\nInitialize configuration for this class. a typical example:
\n\nExt.define('My.awesome.Class', {\n // The default config\n config: {\n name: 'Awesome',\n isAwesome: true\n },\n\n constructor: function(config) {\n this.initConfig(config);\n\n return this;\n }\n});\n\nvar awesome = new My.awesome.Class({\n name: 'Super Awesome'\n});\n\nalert(awesome.getName()); // 'Super Awesome'\n
\nmixins The mixin prototypes as key - value pairs
\nGet the reference to the class from which this object was instantiated. Note that unlike self,\nthis.statics()
is scope-independent and it always returns the class from which it was called, regardless of what\nthis
points to during run-time
Ext.define('My.Cat', {\n statics: {\n totalCreated: 0,\n speciesName: 'Cat' // My.Cat.speciesName = 'Cat'\n },\n\n constructor: function() {\n var statics = this.statics();\n\n alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to\n // equivalent to: My.Cat.speciesName\n\n alert(this.self.speciesName); // dependent on 'this'\n\n statics.totalCreated++;\n\n return this;\n },\n\n clone: function() {\n var cloned = new this.self; // dependent on 'this'\n\n cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName\n\n return cloned;\n }\n});\n\n\nExt.define('My.SnowLeopard', {\n extend: 'My.Cat',\n\n statics: {\n speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard'\n },\n\n constructor: function() {\n this.callParent();\n }\n});\n\nvar cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat'\n\nvar snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard'\n\nvar clone = snowLeopard.clone();\nalert(Ext.getClassName(clone)); // alerts 'My.SnowLeopard'\nalert(clone.groupName); // alerts 'Cat'\n\nalert(My.Cat.totalCreated); // alerts 3\n
\n