From 346921fe85dd0673164d7b8b908796a021a37c94 Mon Sep 17 00:00:00 2001 From: Bill Keese Date: Mon, 25 Jun 2012 08:53:42 +0000 Subject: [PATCH] dojox/[r-v]*: api doc formatting fixes, refs #13101 !strict. --- rpc/JsonRest.js | 21 ++++++----- rpc/OfflineRest.js | 14 ++++---- rpc/Rest.js | 42 +++++++++++----------- rpc/Service.js | 13 ++++--- rpc/tests/stores/JsonRestStore.js | 22 ++++++------ secure/capability.js | 14 ++++---- secure/fromJson.js | 18 +++++----- secure/sandbox.js | 58 +++++++++++++++---------------- sketch/Figure.js | 8 ++--- socket/Reconnect.js | 4 +-- sql/_crypto.js | 27 +++++++------- storage/Provider.js | 29 +++++++++------- storage/manager.js | 29 +++++++++------- string/BidiEngine.js | 12 +++---- string/Builder.js | 23 ++++++------ string/sprintf.js | 4 +-- testing/DocTest.js | 23 ++++++------ timing/Sequence.js | 14 ++++---- timing/_base.js | 33 +++++++++++------- timing/doLater.js | 35 +++++++++---------- treemap/DrillDownUp.js | 10 +++--- treemap/GroupLabel.js | 2 +- treemap/Keyboard.js | 2 +- treemap/ScaledLabel.js | 2 +- uuid/_base.js | 12 +++---- uuid/generateTimeBasedUuid.js | 2 +- validate/_base.js | 2 +- validate/check.js | 2 +- validate/creditCard.js | 2 +- validate/regexp.js | 8 +++-- validate/us.js | 4 +-- 31 files changed, 257 insertions(+), 234 deletions(-) diff --git a/rpc/JsonRest.js b/rpc/JsonRest.js index e7764b1c3..ed73e0879 100644 --- a/rpc/JsonRest.js +++ b/rpc/JsonRest.js @@ -281,13 +281,13 @@ define("dojox/rpc/JsonRest", ["dojo", "dojox", "dojox/json/ref", "dojox/rpc/Rest deleteObject: function(object){ // summary: // deletes an object - // object: - // object to delete + // object: + // object to delete this.changing(object,true); }, getConstructor: function(/*Function|String*/service, schema){ // summary: - // Creates or gets a constructor for objects from this service + // Creates or gets a constructor for objects from this service if(typeof service == 'string'){ var servicePath = service; service = new dojox.rpc.Rest(service,true); @@ -299,8 +299,7 @@ define("dojox/rpc/JsonRest", ["dojo", "dojox", "dojox/json/ref", "dojox/rpc/Rest service._constructor = function(data){ // summary: // creates a new object for this table - // - // data: + // data: // object to mixed in var self = this; var args = arguments; @@ -363,8 +362,8 @@ define("dojox/rpc/JsonRest", ["dojo", "dojox", "dojox/json/ref", "dojox/rpc/Rest getServiceAndId: function(/*String*/absoluteId){ // summary: // Returns the REST service and the local id for the given absolute id. The result - // is returned as an object with a service property and an id property - // absoluteId: + // is returned as an object with a service property and an id property + // absoluteId: // This is the absolute id of the object var serviceName = ''; @@ -382,13 +381,13 @@ define("dojox/rpc/JsonRest", ["dojo", "dojox", "dojox/json/ref", "dojox/rpc/Rest services:{}, schemas:{}, registerService: function(/*Function*/ service, /*String*/ servicePath, /*Object?*/ schema){ - // summary: + // summary: // Registers a service for as a JsonRest service, mapping it to a path and schema - // service: + // service: // This is the service to register - // servicePath: + // servicePath: // This is the path that is used for all the ids for the objects returned by service - // schema: + // schema: // This is a JSON Schema object to associate with objects returned by this service servicePath = service.servicePath = servicePath || service.servicePath; service._schema = jr.schemas[servicePath] = schema || service._schema || {}; diff --git a/rpc/OfflineRest.js b/rpc/OfflineRest.js index c7ebd0f3d..58c93ca4a 100644 --- a/rpc/OfflineRest.js +++ b/rpc/OfflineRest.js @@ -1,7 +1,5 @@ define("dojox/rpc/OfflineRest", ["dojo", "dojox", "dojox/data/ClientFilter", "dojox/rpc/Rest", "dojox/storage"], function(dojo, dojox) { -// summary: -// Makes the REST service be able to store changes in local -// storage so it can be used offline automatically. + var Rest = dojox.rpc.Rest; var namespace = "dojox_rpc_OfflineRest"; var loaded; @@ -53,6 +51,10 @@ define("dojox/rpc/OfflineRest", ["dojo", "dojox", "dojox/data/ClientFilter", "do var syncId = setInterval(sync,15000); dojo.connect(document, "ononline", sync); OfflineRest = dojox.rpc.OfflineRest = { + // summary: + // Makes the REST service be able to store changes in local + // storage so it can be used offline automatically. + turnOffAutoSync: function(){ clearInterval(syncId); }, @@ -64,9 +66,9 @@ define("dojox/rpc/OfflineRest", ["dojo", "dojox", "dojox/data/ClientFilter", "do addStore: function(/*data-store*/store,/*query?*/baseQuery){ // summary: // Adds a store to the monitored store for local storage - // store: + // store: // Store to add - // baseQuery: + // baseQuery: // This is the base query to should be used to load the items for // the store. Generally you want to load all the items that should be // available when offline. @@ -252,5 +254,5 @@ define("dojox/rpc/OfflineRest", ["dojo", "dojox", "dojox/data/ClientFilter", "do dojo.connect(index,"onLoad",saveObject); dojo.connect(index,"onUpdate",saveObject); - return dojox.rpc.OfflineRest; + return OfflineRest; }); diff --git a/rpc/Rest.js b/rpc/Rest.js index c74107f98..21aa9bd8d 100644 --- a/rpc/Rest.js +++ b/rpc/Rest.js @@ -2,24 +2,6 @@ define("dojox/rpc/Rest", ["dojo", "dojox"], function(dojo, dojox) { // Note: This doesn't require dojox.rpc.Service, and if you want it you must require it // yourself, and you must load it prior to dojox.rpc.Rest. -// summary: -// This provides a HTTP REST service with full range REST verbs include PUT,POST, and DELETE. -// description: -// A normal GET query is done by using the service directly: -// | var restService = dojox.rpc.Rest("Project"); -// | restService("4"); -// This will do a GET for the URL "/Project/4". -// | restService.put("4","new content"); -// This will do a PUT to the URL "/Project/4" with the content of "new content". -// You can also use the SMD service to generate a REST service: -// | var services = dojox.rpc.Service({services: {myRestService: {transport: "REST",... -// | services.myRestService("parameters"); -// -// The modifying methods can be called as sub-methods of the rest service method like: -// | services.myRestService.put("parameters","data to put in resource"); -// | services.myRestService.post("parameters","data to post to the resource"); -// | services.myRestService['delete']("parameters"); - dojo.getObject("rpc.Rest", true, dojox); if(dojox.rpc && dojox.rpc.transportRegistry){ @@ -64,7 +46,23 @@ define("dojox/rpc/Rest", ["dojo", "dojox"], function(dojo, dojox) { } drr = dojox.rpc.Rest = function(/*String*/path, /*Boolean?*/isJson, /*Object?*/schema, /*Function?*/getRequest){ // summary: - // Creates a REST service using the provided path. + // This provides a HTTP REST service with full range REST verbs include PUT,POST, and DELETE. + // description: + // A normal GET query is done by using the service directly: + // | var restService = dojox.rpc.Rest("Project"); + // | restService("4"); + // This will do a GET for the URL "/Project/4". + // | restService.put("4","new content"); + // This will do a PUT to the URL "/Project/4" with the content of "new content". + // You can also use the SMD service to generate a REST service: + // | var services = dojox.rpc.Service({services: {myRestService: {transport: "REST",... + // | services.myRestService("parameters"); + // + // The modifying methods can be called as sub-methods of the rest service method like: + // | services.myRestService.put("parameters","data to put in resource"); + // | services.myRestService.post("parameters","data to post to the resource"); + // | services.myRestService['delete']("parameters"); + var service; // it should be in the form /Table/ service = function(id, args){ @@ -74,8 +72,8 @@ define("dojox/rpc/Rest", ["dojo", "dojox"], function(dojo, dojox) { service._schema = schema; // cache: // This is an object that provides indexing service - // This can be overriden to take advantage of more complex referencing/indexing - // schemes + // This can be overriden to take advantage of more complex referencing/indexing + // schemes service.cache = { serialize: isJson ? ((dojox.json && dojox.json.ref) || dojo).toJson : function(result){ return result; @@ -142,5 +140,5 @@ define("dojox/rpc/Rest", ["dojo", "dojox"], function(dojo, dojox) { return index(dojo.xhrGet(service._getRequest(id, args)), service, (args.start >= 0 || args.count >= 0), id); }; - return dojox.rpc.Rest; + return drr; }); diff --git a/rpc/Service.js b/rpc/Service.js index 79564b5b0..e8bb82a9e 100644 --- a/rpc/Service.js +++ b/rpc/Service.js @@ -5,8 +5,11 @@ dojo.declare("dojox.rpc.Service", null, { // summary: // Take a string as a url to retrieve an smd or an object that is an smd or partial smd to use // as a definition for the service - // - // smd: object + // description: + // dojox.rpc.Service must be loaded prior to any plugin services like dojox.rpc.Rest + // dojox.rpc.JsonRpc in order for them to register themselves, otherwise you get + // a "No match found" error. + // smd: object // Takes a number of properties as kwArgs for defining the service. It also // accepts a string. When passed a string, it is treated as a url from // which it should synchronously retrieve an smd file. Otherwise it is a kwArgs @@ -16,11 +19,7 @@ dojo.declare("dojox.rpc.Service", null, { // matches those defined in the smd. smdString allows a developer to pass // a jsonString directly, which will be converted into an object or alternatively // smdObject is accepts an smdObject directly. - // - // description: - // dojox.rpc.Service must be loaded prior to any plugin services like dojox.rpc.Rest - // dojox.rpc.JsonRpc in order for them to register themselves, otherwise you get - // a "No match found" error. + var url; var self = this; function processSmd(smd){ diff --git a/rpc/tests/stores/JsonRestStore.js b/rpc/tests/stores/JsonRestStore.js index 9e39a50b7..33aa31be2 100644 --- a/rpc/tests/stores/JsonRestStore.js +++ b/rpc/tests/stores/JsonRestStore.js @@ -5,7 +5,7 @@ dojo.require("dojo.data.api.Read"); dojo.require("dojox.rpc.Service"); dojox.rpc.tests.stores.JsonRestStore.error = function(t, d, errData){ - // summary: + // summary: // The error callback function to be used for all of the tests. d.errback(errData); } @@ -18,7 +18,7 @@ doh.register("dojox.rpc.tests.stores.JsonRestStore", name: "Fetch some items", timeout: 10000, //10 seconds. runTest: function(t) { - // summary: + // summary: // Simple test of a basic fetch on JsonRestStore of a simple query. var d = new doh.Deferred(); jsonStore.fetch({query:"query", @@ -34,7 +34,7 @@ doh.register("dojox.rpc.tests.stores.JsonRestStore", name: "fetch by id", timeout: 10000, //10 seconds. runTest: function(t) { - // summary: + // summary: // Simple test of a basic fetch on JsonRestStore of a single item. var d = new doh.Deferred(); jsonStore.fetch({query:"obj1", @@ -53,7 +53,7 @@ doh.register("dojox.rpc.tests.stores.JsonRestStore", name: "Modify,save, check by id", timeout: 10000, //10 seconds. runTest: function(t) { - // summary: + // summary: // Fetch an item from a query, modify and save it, and check to see if it was modified correctly var d = new doh.Deferred(); jsonStore.fetch({query:"query", @@ -82,7 +82,7 @@ doh.register("dojox.rpc.tests.stores.JsonRestStore", name: "Post, delete, and put", timeout: 10000, //10 seconds. runTest: function(t) { - // summary: + // summary: // append/post an item, delete it, sort the lists, resort the list, saving each time. var d = new doh.Deferred(); jsonStore.fetch({query:"obj1", @@ -108,7 +108,7 @@ doh.register("dojox.rpc.tests.stores.JsonRestStore", name: "Revert", timeout: 10000, //10 seconds. runTest: function(t) { - // summary: + // summary: // append/post an item, delete it, sort the lists, resort the list, saving each time. var d = new doh.Deferred(); jsonStore.fetch({query:"obj1", @@ -133,7 +133,7 @@ doh.register("dojox.rpc.tests.stores.JsonRestStore", name: "Lazy loading", timeout: 10000, //10 seconds. runTest: function(t) { - // summary: + // summary: // test lazy loading var d = new doh.Deferred(); jsonStore.fetch({query:"query", @@ -153,7 +153,7 @@ doh.register("dojox.rpc.tests.stores.JsonRestStore", name: "Array manipulation", timeout: 10000, //10 seconds. runTest: function(t) { - // summary: + // summary: // test array manipulation var d = new doh.Deferred(); jsonStore.fetch({query:"obj1", @@ -177,7 +177,7 @@ doh.register("dojox.rpc.tests.stores.JsonRestStore", name: "ReadAPI: Fetch_20_Streaming", timeout: 10000, //10 seconds. Json can sometimes be slow. runTest: function(t) { - // summary: + // summary: // fetching with paging var d = new doh.Deferred(); @@ -206,9 +206,9 @@ doh.register("dojox.rpc.tests.stores.JsonRestStore", } }, function testReadAPI_functionConformance(t){ - // summary: + // summary: // Simple test read API conformance. Checks to see all declared functions are actual functions on the instances. - // description: + // description: // Simple test read API conformance. Checks to see all declared functions are actual functions on the instances. var readApi = new dojo.data.api.Read(); diff --git a/secure/capability.js b/secure/capability.js index 35cbdd694..1bbb51b77 100644 --- a/secure/capability.js +++ b/secure/capability.js @@ -8,21 +8,21 @@ dojox.secure.capability = { "throw", "true", "try", "typeof", "var", "void", "while"], validate : function(/*string*/script,/*Array*/safeLibraries,/*Object*/safeGlobals) { // summary: - // pass in the text of a script. If it passes and it can be eval'ed, it should be safe. - // Note that this does not do full syntax checking, it relies on eval to reject invalid scripts. - // There are also known false rejections: - // Nesting vars inside blocks will not declare the variable for the outer block + // pass in the text of a script. If it passes and it can be eval'ed, it should be safe. + // Note that this does not do full syntax checking, it relies on eval to reject invalid scripts. + // There are also known false rejections: + // Nesting vars inside blocks will not declare the variable for the outer block // Named functions are not treated as declaration so they are generally not allowed unless the name is declared with a var. // Var declaration that involve multiple comma delimited variable assignments are not accepted // // script: - // the script to execute + // the script to execute // // safeLibraries: - // The safe libraries that can be called (the functions can not be access/modified by the untrusted code, only called) + // The safe libraries that can be called (the functions can not be access/modified by the untrusted code, only called) // // safeGlobals: - // These globals can be freely interacted with by the untrusted code + // These globals can be freely interacted with by the untrusted code var keywords = this.keywords; diff --git a/secure/fromJson.js b/secure/fromJson.js index e5ab8d72a..367fbdc4a 100644 --- a/secure/fromJson.js +++ b/secure/fromJson.js @@ -7,9 +7,9 @@ dojo.provide("dojox.secure.fromJson"); dojox.secure.fromJson = typeof JSON != "undefined" ? JSON.parse : -// summary: +// summary: // Parses a string of well-formed JSON text. -// description: +// description: // Parses a string of well-formed JSON text. If the input is not well-formed, // then behavior is undefined, but it is // deterministic and is guaranteed not to modify any object other than its @@ -28,19 +28,19 @@ dojox.secure.fromJson = typeof JSON != "undefined" ? JSON.parse : // looks like JSON, but that executes arbitrary javascript. // // To configure dojox.secure.fromJson as the JSON parser for all Dojo -// JSON parsing, simply do: +// JSON parsing, simply do: // | dojo.require("dojox.secure.fromJson"); // | dojo.fromJson = dojox.secure.fromJson; // or alternately you could configure dojox.secure.fromJson to only handle -// XHR responses: +// XHR responses: // | dojo._contentHandlers.json = function(xhr){ // | return dojox.secure.fromJson.fromJson(xhr.responseText); // | }; // -// json: String -// per RFC 4627 -// optReviver: Function (this:Object, string, *) -// optional function +// json: String +// per RFC 4627 +// optReviver: Function (this:Object, string, *) +// optional function // that reworks JSON objects post-parse per Chapter 15.12 of EcmaScript3.1. // If supplied, the function is called with a string key, and a value. // The value is the property of 'this'. The reviver should return @@ -57,7 +57,7 @@ dojox.secure.fromJson = typeof JSON != "undefined" ? JSON.parse : // If the reviver returns {@code undefined} then the property named by key // will be deleted from its container. // {@code this} is bound to the object containing the specified property. -// returns: {Object|Array} +// returns: Object|Array (function () { var number = '(?:-?\\b(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?\\b)'; diff --git a/secure/sandbox.js b/secure/sandbox.js index 033abe2d3..4a0bff425 100644 --- a/secure/sandbox.js +++ b/secure/sandbox.js @@ -37,18 +37,18 @@ dojo.require("dojo._base.url"); return dojo.xhrGet.apply(dojo,arguments); }; dojox.secure.sandbox = function(element) { - // summary: + // summary: // Creates a secure sandbox from which scripts and HTML can be loaded that // will only be able to access the provided element and it's descendants, the // rest of the DOM and JS environment will not be accessible to the sandboxed // scripts and HTML. // - // element: + // element: // The DOM element to use as the container for the sandbox // - // description: + // description: // This function will create and return a sandbox object (see dojox.secure.__Sandbox) - // for the provided element. + // for the provided element. var wrap = dojox.secure.DOM(element); element = wrap(element); var document = element.ownerDocument; @@ -124,32 +124,32 @@ dojo.require("dojo._base.url"); } function Class(/*Function*/superclass, /*Object*/properties, /*Object*/classProperties) { // summary: - // A safe class constructor + // A safe class constructor // // superclass: - // There may be zero or more superclass arguments. The constructed class - // will inherit from any provided superclasses, protypically from the first, - // via mixin for the subsequent. Later arguments - // will override properties/methods from earlier arguments + // There may be zero or more superclass arguments. The constructed class + // will inherit from any provided superclasses, protypically from the first, + // via mixin for the subsequent. Later arguments + // will override properties/methods from earlier arguments // // properties: - // The constructed - // "class" will also have the methods/properties defined in this argument. + // The constructed + // "class" will also have the methods/properties defined in this argument. // These methods may utilize the this operator, and they - // are only the code that has access to this. Inner functions - // are also prohibited from using this. + // are only the code that has access to this. Inner functions + // are also prohibited from using this. // - // If no superclasses are provided, this object will be the prototype of the - // constructed class (no copying - // will be done). Consequently you can "beget" by calling new (Class(obj)). - // All methods are "bound", each call results in |this| safety checking call. + // If no superclasses are provided, this object will be the prototype of the + // constructed class (no copying + // will be done). Consequently you can "beget" by calling new (Class(obj)). + // All methods are "bound", each call results in |this| safety checking call. // // classProperties: - // This properties will be copied to the new class function. + // This properties will be copied to the new class function. // - // Note that neither dojo.declare nor dojo.extend are acceptable class constructors as - // they are completely unsecure. This class constructor is conceptually based on declare - // but also somewhat influenced by base2, prototype, YUI, resig's patterns, etc. + // Note that neither dojo.declare nor dojo.extend are acceptable class constructors as + // they are completely unsecure. This class constructor is conceptually based on declare + // but also somewhat influenced by base2, prototype, YUI, resig's patterns, etc. // // example: // | var Car = Class({drive:function(speed) { ... } ); // create a Car class with a "drive" method @@ -252,11 +252,11 @@ dojo.require("dojo._base.url"); }; return /*===== dojo.declare("dojox.secure.__Sandbox", null, =====*/ { // dojox.secure.__Sandbox loadJS : function(url){ - // summary: - // Loads the script from the given URL using XHR (assuming - // a plugin system is in place for cross-site requests) within the sandbox + // summary: + // Loads the script from the given URL using XHR (assuming + // a plugin system is in place for cross-site requests) within the sandbox // - // url: + // url: // The url of the script to load wrap.rootUrl = url; return xhrGet({url:url,secure:true}).addCallback(function(result) { @@ -264,12 +264,12 @@ dojo.require("dojo._base.url"); }); }, loadHTML : function(url){ - // summary: + // summary: // Loads the web page from the provided URL using XHR (assuming the // plugin system is in place) within the sandbox. All scripts within the web // page will also be sandboxed. // - // url: + // url: // The url of the web page to load wrap.rootUrl = url; @@ -278,10 +278,10 @@ dojo.require("dojo._base.url"); }); }, evaluate : function(script){ - // summary: + // summary: // Evaluates the given script within the sandbox // - // script: + // script: // The JavaScript text to evaluate return wrap.evaluate(script); } diff --git a/sketch/Figure.js b/sketch/Figure.js index 6c9f001a5..07e972072 100644 --- a/sketch/Figure.js +++ b/sketch/Figure.js @@ -232,10 +232,10 @@ define([ this._ctool=t; }; //gridSize: int - // if it is greater than 0, all new shapes placed on the drawing will have coordinates - // snapped to the gridSize. For example, if gridSize is set to 10, all coordinates - // (only including coordinates which specifies the x/y position of shape are affected - // by this parameter) will be dividable by 10 + // if it is greater than 0, all new shapes placed on the drawing will have coordinates + // snapped to the gridSize. For example, if gridSize is set to 10, all coordinates + // (only including coordinates which specifies the x/y position of shape are affected + // by this parameter) will be dividable by 10 p.gridSize=0; p._calCol=function(v){ return this.gridSize?(Math.round(v/this.gridSize)*this.gridSize):v; diff --git a/socket/Reconnect.js b/socket/Reconnect.js index fa932a6df..6ae4ad258 100644 --- a/socket/Reconnect.js +++ b/socket/Reconnect.js @@ -3,10 +3,10 @@ dojo.provide("dojox.socket.Reconnect"); dojox.socket.Reconnect = function(socket, options){ // summary: // Provides auto-reconnection to a websocket after it has been closed - // socket: + // socket: // Socket to add reconnection support to. // returns: - // An object that implements the WebSocket API + // An object that implements the WebSocket API // example: // You can use the Reconnect module: // | dojo.require("dojox.socket"); diff --git a/sql/_crypto.js b/sql/_crypto.js index bf29f82d6..d8775464d 100644 --- a/sql/_crypto.js +++ b/sql/_crypto.js @@ -1,20 +1,21 @@ dojo.provide("dojox.sql._crypto"); dojo.mixin(dojox.sql._crypto, { - // summary: dojox.sql cryptography code + // summary: + // dojox.sql cryptography code // description: - // Taken from http://www.movable-type.co.uk/scripts/aes.html by - // Chris Veness (CLA signed); adapted for Dojo and Google Gears Worker Pool - // by Brad Neuberg, bkn3@columbia.edu - // + // Taken from http://www.movable-type.co.uk/scripts/aes.html by + // Chris Veness (CLA signed); adapted for Dojo and Google Gears Worker Pool + // by Brad Neuberg, bkn3@columbia.edu + // _POOL_SIZE: - // Size of worker pool to create to help with crypto + // Size of worker pool to create to help with crypto _POOL_SIZE: 100, encrypt: function(plaintext, password, callback){ // summary: - // Use Corrected Block TEA to encrypt plaintext using password - // (note plaintext & password must be strings not string objects). - // Results will be returned to the 'callback' asychronously. + // Use Corrected Block TEA to encrypt plaintext using password + // (note plaintext & password must be strings not string objects). + // Results will be returned to the 'callback' asychronously. this._initWorkerPool(); var msg ={plaintext: plaintext, password: password}; @@ -26,9 +27,9 @@ dojo.mixin(dojox.sql._crypto, { decrypt: function(ciphertext, password, callback){ // summary: - // Use Corrected Block TEA to decrypt ciphertext using password - // (note ciphertext & password must be strings not string objects). - // Results will be returned to the 'callback' asychronously. + // Use Corrected Block TEA to decrypt ciphertext using password + // (note ciphertext & password must be strings not string objects). + // Results will be returned to the 'callback' asychronously. this._initWorkerPool(); var msg = {ciphertext: ciphertext, password: password}; @@ -83,7 +84,7 @@ dojo.mixin(dojox.sql._crypto, { // return results callback(msg); - } + }; var workerInit = "function _workerInit(){" + "gearsWorkerPool.onmessage = " diff --git a/storage/Provider.js b/storage/Provider.js index 564651a7e..a2092efff 100644 --- a/storage/Provider.js +++ b/storage/Provider.js @@ -1,7 +1,8 @@ dojo.provide("dojox.storage.Provider"); dojo.declare("dojox.storage.Provider", null, { - // summary: A singleton for working with dojox.storage. + // summary: + // A singleton for working with dojox.storage. // description: // dojox.storage exposes the current available storage provider on this // platform. It gives you methods such as dojox.storage.put(), @@ -17,6 +18,7 @@ dojo.declare("dojox.storage.Provider", null, { // You should avoid initialization in storage provider subclass's // constructor; instead, perform initialization in your initialize() // method. + constructor: function(){ }, @@ -125,7 +127,7 @@ dojo.declare("dojox.storage.Provider", null, { // The third argument in the call back is an optional message that // details possible error messages that might have occurred during // the storage process. - // namespace: + // namespace: // Optional string namespace that this value will be placed into; // if left off, the value will be placed into dojox.storage.DEFAULT_NAMESPACE @@ -138,7 +140,7 @@ dojo.declare("dojox.storage.Provider", null, { // not in the storage system. // key: // A string key to get the value of. - // namespace: + // namespace: // Optional string namespace that this value will be retrieved from; // if left off, the value will be retrieved from dojox.storage.DEFAULT_NAMESPACE // returns: @@ -147,7 +149,8 @@ dojo.declare("dojox.storage.Provider", null, { }, hasKey: function(/*string*/ key, /*string?*/ namespace){ - // summary: Determines whether the storage has the given key. + // summary: + // Determines whether the storage has the given key. return !!this.get(key, namespace); // Boolean }, @@ -247,7 +250,7 @@ dojo.declare("dojox.storage.Provider", null, { // The third argument in the call back is an optional message that // details possible error messages that might have occurred during // the storage process. - // namespace: + // namespace: // Optional string namespace that this value will be placed into; // if left off, the value will be placed into dojox.storage.DEFAULT_NAMESPACE @@ -292,7 +295,7 @@ dojo.declare("dojox.storage.Provider", null, { } // JAC: This could be optimized by running the key validity test - // directly over a joined string + // directly over a joined string return !dojo.some(keys, function(key){ return !this.isValidKey(key); }, this); // Boolean @@ -305,13 +308,15 @@ dojo.declare("dojox.storage.Provider", null, { }, showSettingsUI: function(){ - // summary: If this provider has a settings UI, determined - // by calling hasSettingsUI(), it is shown. + // summary: + // If this provider has a settings UI, determined + // by calling hasSettingsUI(), it is shown. console.warn("dojox.storage.showSettingsUI not implemented"); }, hideSettingsUI: function(){ - // summary: If this provider has a settings UI, hides it. + // summary: + // If this provider has a settings UI, hides it. console.warn("dojox.storage.hideSettingsUI not implemented"); }, @@ -339,9 +344,9 @@ dojo.declare("dojox.storage.Provider", null, { // to cache these resources to ensure the machinery // used by this storage provider is available offline. // What is returned is an array of URLs. - // Note that Dojo Offline uses Gears as its native - // storage provider, and does not support using other - // kinds of storage providers while offline anymore. + // Note that Dojo Offline uses Gears as its native + // storage provider, and does not support using other + // kinds of storage providers while offline anymore. return []; } diff --git a/storage/manager.js b/storage/manager.js index 573a8ea07..e81b9b9c4 100644 --- a/storage/manager.js +++ b/storage/manager.js @@ -3,24 +3,25 @@ dojo.provide("dojox.storage.manager"); // FIXME: refactor this to use an AdapterRegistry dojox.storage.manager = new function(){ - // summary: A singleton class in charge of the dojox.storage system + // summary: + // A singleton class in charge of the dojox.storage system // description: // Initializes the storage systems and figures out the best available // storage options on this platform. // currentProvider: Object - // The storage provider that was automagically chosen to do storage - // on this platform, such as dojox.storage.FlashStorageProvider. + // The storage provider that was automagically chosen to do storage + // on this platform, such as dojox.storage.FlashStorageProvider. this.currentProvider = null; // available: Boolean - // Whether storage of some kind is available. + // Whether storage of some kind is available. this.available = false; - // providers: Array - // Array of all the static provider instances, useful if you want to - // loop through and see what providers have been registered. - this.providers = []; + // providers: Array + // Array of all the static provider instances, useful if you want to + // loop through and see what providers have been registered. + this.providers = []; this._initialized = false; @@ -122,7 +123,8 @@ dojox.storage.manager = new function(){ }; this.isAvailable = function(){ /*Boolean*/ - // summary: Returns whether any storage options are available. + // summary: + // Returns whether any storage options are available. return this.available; }; @@ -145,7 +147,8 @@ dojox.storage.manager = new function(){ }; this.removeOnLoad = function(func){ /* void */ - // summary: Removes the given onLoad listener + // summary: + // Removes the given onLoad listener for(var i = 0; i < this._onLoadListeners.length; i++){ if(func == this._onLoadListeners[i]){ this._onLoadListeners.splice(i, 1); @@ -173,7 +176,8 @@ dojox.storage.manager = new function(){ }; this.supportsProvider = function(/*string*/ storageClass){ /* Boolean */ - // summary: Determines if this platform supports the given storage provider. + // summary: + // Determines if this platform supports the given storage provider. // description: // Example- // dojox.storage.manager.supportsProvider( @@ -193,7 +197,8 @@ dojox.storage.manager = new function(){ }; this.getProvider = function(){ /* Object */ - // summary: Gets the current provider + // summary: + // Gets the current provider return this.currentProvider; }; diff --git a/string/BidiEngine.js b/string/BidiEngine.js index 3d3625aeb..e06b79bf7 100644 --- a/string/BidiEngine.js +++ b/string/BidiEngine.js @@ -182,7 +182,7 @@ declare("dojox.string.BidiEngine", null, { } }, checkContextual: function(/*String*/text){ - // summary: + // summary: // Determine the base direction of a bidi text according // to its first strong directional character. // text: @@ -235,12 +235,12 @@ declare("dojox.string.BidiEngine", null, { function doBidiReorder(/*String*/text, /*String*/inFormat, /*String*/outFormat, /*String*/swap){ - // summary: + // summary: // Reorder the source text according to the bidi attributes // of source and result. - // text: + // text: // The text to reorder. - // inFormat: + // inFormat: // Ordering scheme and base direction of the source text. // Can be "LLTR", "LRTL", "LCLR", "LCRL", "VLTR", "VRTL", // "VCLR", "VCRL". @@ -252,11 +252,11 @@ function doBidiReorder(/*String*/text, /*String*/inFormat, // "CRL" means contextual direction defaulting to RTL if // there is no strong letter. // The initial value is "LLTR", if none, the initial value is used. - // outFormat: + // outFormat: // Required ordering scheme and base direction of the // result. Has the same format as inFormat. // If none, the initial value "VLTR" is used. - // swap: + // swap: // Symmetric swapping attributes of source and result. // The allowed values can be "YN", "NY", "YY" and "NN". // The first letter reflects the symmetric swapping attribute diff --git a/string/Builder.js b/string/Builder.js index 4ceb9c555..702f36ebc 100644 --- a/string/Builder.js +++ b/string/Builder.js @@ -2,19 +2,20 @@ define(["dojo/_base/lang"], function(lang){ lang.getObject("string", true, dojox).Builder = function(/*String?*/str){ - // summary: + // summary: // A fast buffer for creating large strings. - // - // length: Number - // The current length of the internal string. // N.B. the public nature of the internal buffer is no longer // needed because the IE-specific fork is no longer needed--TRT. var b = ""; + + // length: Number + // The current length of the internal string. this.length = 0; this.append = function(/* String... */s){ - // summary: Append all arguments to the end of the buffer + // summary: + // Append all arguments to the end of the buffer if(arguments.length>1){ /* This is a loop unroll was designed specifically for Firefox; @@ -68,13 +69,13 @@ define(["dojo/_base/lang"], }; this.concat = function(/*String...*/s){ - // summary: + // summary: // Alias for append. return this.append.apply(this, arguments); // dojox.string.Builder }; this.appendArray = function(/*Array*/strings) { - // summary: + // summary: // Append an array of items to the internal buffer. // Changed from String.prototype.concat.apply because of IE. @@ -82,7 +83,7 @@ define(["dojo/_base/lang"], }; this.clear = function(){ - // summary: + // summary: // Remove all characters from the buffer. b = ""; this.length = 0; @@ -98,7 +99,7 @@ define(["dojo/_base/lang"], }; this.remove = function(/* Number */start, /* Number? */len){ - // summary: + // summary: // Remove len characters starting at index start. If len // is not provided, the end of the string is assumed. if(len===undefined){ len = b.length; } @@ -109,7 +110,7 @@ define(["dojo/_base/lang"], }; this.insert = function(/* Number */index, /* String */str){ - // summary: + // summary: // Insert string str starting at index. if(index == 0){ b = str + b; @@ -121,7 +122,7 @@ define(["dojo/_base/lang"], }; this.toString = function(){ - // summary: + // summary: // Return the string representation of the internal buffer. return b; // String }; diff --git a/string/sprintf.js b/string/sprintf.js index 7da4fc35e..68ece3df3 100644 --- a/string/sprintf.js +++ b/string/sprintf.js @@ -304,8 +304,8 @@ define([ throw new Error("format argument '" + token.arg + "' not a float; parseFloat returned " + f); } // C99 says that for 'f': - // infinity -> '[-]inf' or '[-]infinity' ('[-]INF' or '[-]INFINITY' for 'F') - // NaN -> a string starting with 'nan' ('NAN' for 'F') + // infinity -> '[-]inf' or '[-]infinity' ('[-]INF' or '[-]INFINITY' for 'F') + // NaN -> a string starting with 'nan' ('NAN' for 'F') // this is not commonly implemented though. //return '' + f; f = 0; diff --git a/testing/DocTest.js b/testing/DocTest.js index 27de03413..81e2e093b 100644 --- a/testing/DocTest.js +++ b/testing/DocTest.js @@ -4,9 +4,9 @@ dojo.declare( "dojox.testing.DocTest", null, { - // summary: + // summary: // This class executes doctests. - // description: + // description: // DocTests are tests that are defined inside the comment. // A doctest looks as if it was copied from the shell (which it mostly is). // A doctest is executed when the following conditions match: @@ -56,9 +56,10 @@ dojo.declare( errors: [], getTests:function(/*String*/moduleName){ - // summary: Extract the tests from the given module or string. + // summary: + // Extract the tests from the given module or string. // examples: - // >>> dojo.isArray(new dojox.testing.DocTest().getTests("dojox.testing.DocTest")) // Use the module name to extract the tests from. + // >>> dojo.isArray(new dojox.testing.DocTest().getTests("dojox.testing.DocTest")) // Use the module name to extract the tests from. // true var path = dojo.moduleUrl(moduleName).path; // TODO: @@ -79,8 +80,10 @@ dojo.declare( }, _getTestsFromString:function(/*String*/data, /*Boolean*/insideComments){ - // summary: Parse the given string for tests. - // insideComments: Boolean, if false "data" contains only the pure tests, comments already stripped. + // summary: + // Parse the given string for tests. + // insideComments: Boolean + // if false "data" contains only the pure tests, comments already stripped. var trim = dojo.hitch(dojo.string, "trim"); var lines = data.split("\n"); var len = lines.length; @@ -149,9 +152,9 @@ dojo.declare( }, run: function(moduleName){ - // summary: + // summary: // Run the doctests in the module given. - // example: + // example: // doctest = new dojox.testing.DocTest(); // doctest.run("dojox.testing.DocTest"); // doctest.errors should finally be an empty array. @@ -186,10 +189,10 @@ dojo.declare( }, _run: function(/*Array*/tests){ - // summary: + // summary: // Each element in the array contains the test in the first element, // and the expected result in the second element. - // tests: + // tests: // Make sure that the types are compared properly. There used to be // the bug that a return value false was compared to "false" which // made the test fail. This is fixed and should be verified by the diff --git a/timing/Sequence.js b/timing/Sequence.js index abc01169b..1d003027e 100644 --- a/timing/Sequence.js +++ b/timing/Sequence.js @@ -44,8 +44,8 @@ define([ }, go: function(/* Array */defs, /* Function|Array? */doneFunction){ - // summary: Run the passed sequence definition - // + // summary: + // Run the passed sequence definition // defs: Array // The sequence of actions // doneFunction: Function|Array? @@ -73,7 +73,8 @@ define([ }, _go: function(){ - // summary: Execute one task of this._defsResolved. + // summary: + // Execute one task of this._defsResolved. // if _running was set to false stop the sequence, this is the // case when i.e. stop() was called. @@ -127,7 +128,8 @@ define([ }, goOn: function(){ - // summary: This method just provides a hook from the outside, so that + // summary: + // This method just provides a hook from the outside, so that // an interrupted sequence can be continued. if(this._goOnPause){ setTimeout(dojo.hitch(this, "_go"), this._goOnPause); @@ -136,8 +138,8 @@ define([ }, stop: function(){ - // summary: Stop the currently running sequence. - // + // summary: + // Stop the currently running sequence. // description: // This can only interrupt the sequence not the last function that // had been started. If the last function was i.e. a slideshow diff --git a/timing/_base.js b/timing/_base.js index 3a7ffc732..ec02cabfb 100644 --- a/timing/_base.js +++ b/timing/_base.js @@ -3,9 +3,11 @@ define(["dojo/_base/kernel", "dojo/_base/lang"], function(dojo){ dojo.getObject("timing", true, dojox); dojox.timing.Timer = function(/*int*/ interval){ - // summary: Timer object executes an "onTick()" method repeatedly at a specified interval. - // repeatedly at a given interval. - // interval: Interval between function calls, in milliseconds. + // summary: + // Timer object executes an "onTick()" method repeatedly at a specified interval. + // repeatedly at a given interval. + // interval: + // Interval between function calls, in milliseconds. this.timer = null; this.isRunning = false; this.interval = interval; @@ -16,12 +18,15 @@ define(["dojo/_base/kernel", "dojo/_base/lang"], function(dojo){ dojo.extend(dojox.timing.Timer, { onTick: function(){ - // summary: Method called every time the interval passes. Override to do something useful. + // summary: + // Method called every time the interval passes. Override to do something useful. }, setInterval: function(interval){ - // summary: Reset the interval of a timer, whether running or not. - // interval: New interval, in milliseconds. + // summary: + // Reset the interval of a timer, whether running or not. + // interval: + // New interval, in milliseconds. if (this.isRunning){ window.clearInterval(this.timer); } @@ -32,10 +37,12 @@ define(["dojo/_base/kernel", "dojo/_base/lang"], function(dojo){ }, start: function(){ - // summary: Start the timer ticking. - // description: Calls the "onStart()" handler, if defined. - // Note that the onTick() function is not called right away, - // only after first interval passes. + // summary: + // Start the timer ticking. + // description: + // Calls the "onStart()" handler, if defined. + // Note that the onTick() function is not called right away, + // only after first interval passes. if (typeof this.onStart == "function"){ this.onStart(); } @@ -44,8 +51,10 @@ define(["dojo/_base/kernel", "dojo/_base/lang"], function(dojo){ }, stop: function(){ - // summary: Stop the timer. - // description: Calls the "onStop()" handler, if defined. + // summary: + // Stop the timer. + // description: + // Calls the "onStop()" handler, if defined. if (typeof this.onStop == "function"){ this.onStop(); } diff --git a/timing/doLater.js b/timing/doLater.js index 61b23eec8..3762e1c0f 100644 --- a/timing/doLater.js +++ b/timing/doLater.js @@ -1,8 +1,6 @@ define(["./_base"], function(dxt){ dojo.experimental("dojox.timing.doLater"); -/*===== -var dxt = dojox.timing; -=====*/ + dxt.doLater = function(/*anything*/conditional,/*Object ?*/context, /* Number ? */interval){ // summary: // Check if a parameter is ready, and if not, @@ -11,26 +9,25 @@ var dxt = dojox.timing; // It thens calls the caller with original // arguments, using the supplied context or // window. - // description: + // description: // dojox.timing.doLater(conditional) is testing if the call // should be done later. So it returns // true if the param is false. - // arguments: - // conditional: anything - // Can be a property that eventually gets set, or - // an expression, method... anything that can be - // evaluated. - // context: Object - // The namespace where the call originated. - // Defaults to global and anonymous functions - // interval: Number - // Poll time to check conditional in Milliseconds + // conditional: anything + // Can be a property that eventually gets set, or + // an expression, method... anything that can be + // evaluated. + // context: Object + // The namespace where the call originated. + // Defaults to global and anonymous functions + // interval: Number + // Poll time to check conditional in Milliseconds // example: - // | setTimeout(function(){ - // | if(dojox.timing.doLater(app.ready)){return;} - // | console.log("Code is ready! anonymous.function SUCCESS") - // | },700); - // + // | setTimeout(function(){ + // | if(dojox.timing.doLater(app.ready)){return;} + // | console.log("Code is ready! anonymous.function SUCCESS") + // | },700); + if(conditional){ return false; } // Boolean var callback = dxt.doLater.caller, args = dxt.doLater.caller.arguments; diff --git a/treemap/DrillDownUp.js b/treemap/DrillDownUp.js index 109314e9a..f3881e40c 100644 --- a/treemap/DrillDownUp.js +++ b/treemap/DrillDownUp.js @@ -3,7 +3,7 @@ define(["dojo/_base/lang", "dojo/_base/event", "dojo/_base/declare", "dojo/dom-g function(lang, event, declare, domGeom, domConstruct, domStyle, fx, tap){ return declare("dojox.treemap.DrillDownUp", null, { - // summary: + // summary: // Specializes TreeMap to support drill down and up operations. postCreate: function(){ @@ -38,9 +38,9 @@ define(["dojo/_base/lang", "dojo/_base/event", "dojo/_base/declare", "dojo/dom-g }, drillUp: function(renderer){ - // summary: + // summary: // Drill up from the given renderer. - // renderer: DomNode + // renderer: DomNode // The item renderer. var item = renderer.item; @@ -82,9 +82,9 @@ define(["dojo/_base/lang", "dojo/_base/event", "dojo/_base/declare", "dojo/dom-g }, drillDown: function(renderer){ - // summary: + // summary: // Drill up from the given renderer. - // renderer: DomNode + // renderer: DomNode // The item renderer. var box = domGeom.getMarginBox(this.domNode); var item = renderer.item; diff --git a/treemap/GroupLabel.js b/treemap/GroupLabel.js index 5c102c59d..9a57bc894 100644 --- a/treemap/GroupLabel.js +++ b/treemap/GroupLabel.js @@ -2,7 +2,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "dojo/dom-style"], function(declare, domConstruct, domStyle) { return declare("dojox.treemap.GroupLabel", null, { - // summary: + // summary: // Specializes TreeMap to remove leaf labels and display group labels centered on group // content instead of display them in headers. diff --git a/treemap/Keyboard.js b/treemap/Keyboard.js index 7e42d1b19..1cfb1d037 100644 --- a/treemap/Keyboard.js +++ b/treemap/Keyboard.js @@ -3,7 +3,7 @@ define(["dojo/_base/array", "dojo/_base/lang", "dojo/_base/event", "dojo/_base/d function(arr, lang, event, declare, on, keys, domAttr, utils, _FocusMixin){ return declare("dojox.treemap.Keyboard", _FocusMixin, { - // summary: + // summary: // Specializes TreeMap to support keyboard navigation and accessibility. // tabIndex: Integer diff --git a/treemap/ScaledLabel.js b/treemap/ScaledLabel.js index 95fa30be4..9ec8ec539 100644 --- a/treemap/ScaledLabel.js +++ b/treemap/ScaledLabel.js @@ -2,7 +2,7 @@ define(["dojo/_base/declare", "dojo/dom-geometry", "dojo/dom-construct", "dojo/d function(declare, domGeom, domConstruct, domStyle) { return declare("dojox.treemap.ScaledLabel", null, { - // summary: + // summary: // Specializes TreeMap to display scaled leaf labels instead of constant size labels. onRendererUpdated: function(evt){ diff --git a/uuid/_base.js b/uuid/_base.js index 2ea4d57f1..29cbc299c 100644 --- a/uuid/_base.js +++ b/uuid/_base.js @@ -82,9 +82,9 @@ dojox.uuid.getVariant = function(/*String*/ uuidString){ // dojox.uuid.assert(variant == dojox.uuid.variant.DCE); // example: // | "3b12f1df-5232-4804-897e-917bf397618a" - // | ^ - // | | - // | (variant "10__" == DCE) + // | ^ + // | | + // | (variant "10__" == DCE) if(!dojox.uuid._ourVariantLookupTable){ var variant = dojox.uuid.variant; var lookupTable = []; @@ -134,9 +134,9 @@ dojox.uuid.getVersion = function(/*String*/ uuidString){ uuidString = uuidString.toString(); // "b4308fb0-86cd-11da-a72b-0800200c9a66" - // ^ - // | - // (version 1 == TIME_BASED) + // ^ + // | + // (version 1 == TIME_BASED) var versionCharacter = uuidString.charAt(14); var HEX_RADIX = 16; var versionNumber = parseInt(versionCharacter, HEX_RADIX); diff --git a/uuid/generateTimeBasedUuid.js b/uuid/generateTimeBasedUuid.js index cb4c1a175..f47ce9f1e 100644 --- a/uuid/generateTimeBasedUuid.js +++ b/uuid/generateTimeBasedUuid.js @@ -52,7 +52,7 @@ dojox.uuid.generateTimeBasedUuid._generator = new function(){ this.GREGORIAN_CHANGE_OFFSET_IN_HOURS = 3394248; // Number of seconds between October 15, 1582 and January 1, 1970: - // dojox.uuid.generateTimeBasedUuid.GREGORIAN_CHANGE_OFFSET_IN_SECONDS = 12219292800; + // dojox.uuid.generateTimeBasedUuid.GREGORIAN_CHANGE_OFFSET_IN_SECONDS = 12219292800; // -------------------------------------------------- // Private variables: diff --git a/validate/_base.js b/validate/_base.js index 876247c09..bee1f5de6 100644 --- a/validate/_base.js +++ b/validate/_base.js @@ -93,7 +93,7 @@ validate.isNumberFormat = function(value, flags){ // | // returns true: // | dojox.validate.isNumberFormat("123-45", { format:"###-##" }); // example: - // Check Multiple formats: + // Check Multiple formats: // | dojox.validate.isNumberFormat("123-45", { // | format:["### ##","###-##","## ###"] // | }); diff --git a/validate/check.js b/validate/check.js index 465976e7e..1ad466bcd 100644 --- a/validate/check.js +++ b/validate/check.js @@ -306,7 +306,7 @@ validate.evaluateConstraint=function(profile, /*Array*/constraint, fieldName, el // | } // // This function evaluates a single array function in the format of: - // [functionName, argument1, argument2, etc] + // [functionName, argument1, argument2, etc] // // The function will be parsed out and evaluated against the incoming parameters. // profile: diff --git a/validate/creditCard.js b/validate/creditCard.js index a23d7e5f6..f22e9a119 100644 --- a/validate/creditCard.js +++ b/validate/creditCard.js @@ -90,7 +90,7 @@ validate.isValidCreditCardNumber = function(value, ccType){ validate.isValidCvv = function(/* String|Int */value, /* String */ccType) { // summary: - // Validate the security code (CCV) for a passed credit-card type. + // Validate the security code (CCV) for a passed credit-card type. if(!lang.isString(value)){ value = String(value); diff --git a/validate/regexp.js b/validate/regexp.js index 4f2d427ce..d0c1d484e 100644 --- a/validate/regexp.js +++ b/validate/regexp.js @@ -198,7 +198,7 @@ dxregexp = dojox.validate.regexp = { // Use this method for phone numbers, social security numbers, zip-codes, etc. // The RE can match one format or one of multiple formats. // - // Format + // Format // - # Stands for a digit, 0-9. // - ? Stands for an optional digit, 0-9 or nothing. // - All other characters must appear literally in the expression. @@ -234,12 +234,14 @@ dxregexp = dojox.validate.regexp = { ca: { postalCode: function(){ - // summary: String regular Express to match Canadain Postal Codes + // summary: + // String regular Express to match Canadain Postal Codes return "([A-Z][0-9][A-Z] [0-9][A-Z][0-9])"; }, province: function(){ - // summary: a regular expression to match Canadian Province Abbreviations + // summary: + // a regular expression to match Canadian Province Abbreviations return "(AB|BC|MB|NB|NL|NS|NT|NU|ON|PE|QC|SK|YT)"; } diff --git a/validate/us.js b/validate/us.js index dbee1d568..c24cd65f3 100644 --- a/validate/us.js +++ b/validate/us.js @@ -8,8 +8,8 @@ us.isState = function(value, flags){ // value: String // A two character string // flags: Object? - // flags.allowTerritories Allow Guam, Puerto Rico, etc. Default is true. - // flags.allowMilitary Allow military 'states', e.g. Armed Forces Europe (AE). Default is true. + // - flags.allowTerritories Allow Guam, Puerto Rico, etc. Default is true. + // - flags.allowMilitary Allow military 'states', e.g. Armed Forces Europe (AE). Default is true. var re = new RegExp("^" + xregexp.us.state(flags) + "$", "i"); return re.test(value); // Boolean