{"dojo.storage._":{"meta":{"requires":{"common":["dojo.storage"],"browser":["dojo.storage.browser"]}}},"dojo.storage.browser":{"meta":{"requires":{"common":["dojo.storage","dojo.flash","dojo.json","dojo.uri.*"]},"functions":{"dojo.storage.browser.FileStorageProvider":{"meta":{"summary":"Storage provider that uses the native file system as a storage back end, across Internet Explorer, Firefox, Safari, and Opera.","src":"\t\/\/ summary:\n\t\/\/\t\tStorage provider that uses the native file system as\n\t\/\/\t\ta storage back end, across Internet Explorer, Firefox,\n\t\/\/\t\tSafari, and Opera.\n\t\/\/ description: \n\t\/\/\t\tThis storage provider will autodetect if access\n\t\/\/\t\tto the native file system is available. This is\n\t\/\/\t\tonly available if a page is loaded through a file:\/\/\n\t\/\/\t\tor chrome:\/\/ URL. \n\t\/\/\t\t\n\t\/\/\t\tWe support three different browsers for native file storage:\n\t\/\/\t\t\t* Firefox - Uses XPCOM\n\t\/\/\t\t\t* Internet Explorer - Uses ActiveX\n\t\/\/\t\t\t* Safari\/Opera - Uses Java and LiveConnect\n\t\/\/\n\t\/\/\t\tThis storage provider saves all files in the same directory\n\t\/\/\t\tas the HTML file it is invoked from. Each key\n\t\/\/\t\tis a separate file, with the file's contents being\n\t\/\/\t\tthe value for that key and the filename being the\n\t\/\/\t\tkey plus \".txt\". A special file named __dojoAllKeys.txt is also\n\t\/\/\t\tcreated, which is a list of all the keys available.\n\t\/\/\n\t\/\/\t\tThe technique to create this storage provider was learned\n\t\/\/\t\tby studying TiddlyWiki (http:\/\/tiddlywiki.com). \n\t\/\/\t\tThanks for figuring out how to do this Jeremy Ruston!\n\t\/\/\n\t\/\/\t\tTODO: Automagically create a directory named .dojo_storage in\n\t\/\/\t\tthe user's home directory, cross-platform, and then create a\n\t\/\/\t\tsubdirectory based off the HTML filename of this page, such as\n\t\/\/\t\tmyapp.html\/ to store all of our key files into. Saving the files\n\t\/\/\t\tinto the same directry as the HTML file is dangerous and messy,\n\t\/\/\t\tand might not be allowed based on directory permissioning for some\n\t\/\/\t\tscenarios.\n\t\/\/\n\t\/\/\t\tAuthors of this storage provider-\t\n\t\/\/\t\t\tBrad Neuberg, bkn3@columbia.edu ","description":"This storage provider will autodetect if access to the native file system is available. This is only available if a page is loaded through a file: \/\/ or chrome: \/\/ URL. We support three different browsers for native file storage: * Firefox - Uses XPCOM * Internet Explorer - Uses ActiveX * Safari\/Opera - Uses Java and LiveConnect This storage provider saves all files in the same directory as the HTML file it is invoked from. Each key is a separate file, with the file's contents being the value for that key and the filename being the key plus \".txt\". A special file named __dojoAllKeys.txt is also created, which is a list of all the keys available. The technique to create this storage provider was learned by studying TiddlyWiki (http: \/\/ tiddlywiki.com). Thanks for figuring out how to do this Jeremy Ruston! TODO: Automagically create a directory named .dojo_storage in the user's home directory, cross-platform, and then create a subdirectory based off the HTML filename of this page, such as myapp.html\/ to store all of our key files into. Saving the files into the same directry as the HTML file is dangerous and messy, and might not be allowed based on directory permissioning for some scenarios. Authors of this storage provider- Brad Neuberg, bkn3@columbia.edu","prototype_chain":["dojo.storage"],"prototype_variables":["namespace","initialized","_available","_statusHandler","_keyIndex"],"instance_variables":["initialized","_available","_statusHandler","_keyIndex"]}},"dojo.storage.browser.WhatWGStorageProvider":{"meta":{"summary":"Storage provider that uses WHAT Working Group features in Firefox 2 to achieve permanent storage.","src":"\t\/\/ summary:\n\t\/\/\t\tStorage provider that uses WHAT Working Group features in Firefox 2 \n\t\/\/\t\tto achieve permanent storage.\n\t\/\/ description: \n\t\/\/\t\tThe WHAT WG storage API is documented at \n\t\/\/\t\thttp:\/\/www.whatwg.org\/specs\/web-apps\/current-work\/#scs-client-side\n\t\/\/\n\t\/\/\t\tYou can disable this storage provider with the following djConfig\n\t\/\/\t\tvariable:\n\t\/\/\t\tvar djConfig = { disableWhatWGStorage: true };\n\t\/\/\t\t\n\t\/\/\t\tAuthors of this storage provider-\t\n\t\/\/\t\t\tJB Boisseau, jb.boisseau@eutech-ssii.com\n\t\/\/\t\t\tBrad Neuberg, bkn3@columbia.edu ","description":"The WHAT WG storage API is documented at http: \/\/ www.whatwg.org\/specs\/web-apps\/current-work\/#scs-client-side You can disable this storage provider with the following djConfig variable: var djConfig = { disableWhatWGStorage: true }; Authors of this storage provider- JB Boisseau, jb.boisseau@eutech-ssii.com Brad Neuberg, bkn3@columbia.edu","prototype_chain":["dojo.storage"],"prototype_variables":["namespace","initialized","_domain","_available","_statusHandler"],"instance_variables":["_domain","initialized","_available","_statusHandler"]}},"dojo.storage.browser.FlashStorageProvider":{"meta":{"summary":"Storage provider that uses features in Flash to achieve permanent storage","src":"\t\/\/ summary: Storage provider that uses features in Flash to achieve permanent storage\n\t\/\/ description:\n\t\/\/\t\tAuthors of this storage provider-\n\t\/\/\t\t\tBrad Neuberg, bkn3@columbia.edu\t","description":"Authors of this storage provider- Brad Neuberg, bkn3@columbia.edu","prototype_chain":["dojo.storage"],"prototype_variables":["namespace","initialized","_available","_statusHandler"],"instance_variables":["_available","_statusHandler","_initialized"]}},"dojo.storage.browser.FileStorageProvider.initialize":{"meta":{"summary":"","src":" \tif(djConfig[\"disableFileStorage\"] == true){\n\t\t\treturn;\n\t\t}\n\t\t\/\/ write out applet if Java is needed\n\t\t\/\/ for file operations\n\t\t\/*\n\t\tif(this._isAvailableJava()){\n\t\t\tthis._writeApplet();\n\t\t}*\/\n\t\t\/\/ load our keys\n\t\tthis._loadKeyIndex();\n\t\t\/\/ indicate that this storage provider is now loaded\n\t\tthis.initialized = true;\n\t\tdojo.storage.manager.loaded();\t","prototype":"dojo.storage.browser.FileStorageProvider"}},"dojo.storage.browser.FileStorageProvider.isAvailable":{"meta":{"summary":"","src":" \tthis._available = false;\n\t\tvar protocol = window.location.protocol;\n\t\tif(protocol.indexOf(\"file\") != -1 || protocol.indexOf(\"chrome\") != -1){\n\t\t\t\/\/ try each of the file access types\n\t\t\tthis._available = this._isAvailableXPCOM();\n\t\t\tif(this._available == false){\n\t\t\t\tthis._available = this._isAvailableActiveX();\n\t\t\t}\n\t\t\t\/*if(this._available == false){\n\t\t\t\tthis._available = this._isAvailableJava();\n\t\t\t}*\/\n\t\t}\n\t\treturn this._available;","prototype":"dojo.storage.browser.FileStorageProvider"}},"dojo.storage.browser.FileStorageProvider.put":{"meta":{"summary":"","parameters":{"key":{"type":""},"value":{"type":""},"resultsHandler":{"type":""}},"src":" \tif(this.isValidKey(key) == false){\n\t\t\tdojo.raise(\"Invalid key given: \" + key);\n\t\t}\t\t\t\n\t\tthis._statusHandler = resultsHandler;\n\t\t\/\/ try to save the value\tas a file\n\t\ttry{\n\t\t\tthis._save(key, value);\n\t\t\t\/\/ indicate we succeeded\n\t\t\tresultsHandler.call(null, dojo.storage.SUCCESS, key);\n\t\t}catch(e){\n\t\t\t\/\/ indicate we failed\n\t\t\tthis._statusHandler.call(null, dojo.storage.FAILED, \n\t\t\t\t\t\t\t\t\tkey, e.toString());\n\t\t}","call_chain":["resultsHandler","this._statusHandler"],"prototype":"dojo.storage.browser.FileStorageProvider"}},"dojo.storage.browser.FileStorageProvider.get":{"meta":{"summary":"","parameters":{"key":{"type":""}},"src":" \tif(this.isValidKey(key) == false){\n\t\t\tdojo.raise(\"Invalid key given: \" + key);\n\t\t}\n\t\t\/\/ FIXME: what to do with underlying file exceptions?\n\t\t\/\/ pass to caller?\n\t\tvar results = this._load(key);\n\t\treturn results;","prototype":"dojo.storage.browser.FileStorageProvider"}},"dojo.storage.browser.FileStorageProvider.getKeys":{"meta":{"summary":"","src":" \treturn this._keyIndex;","prototype":"dojo.storage.browser.FileStorageProvider"}},"dojo.storage.browser.FileStorageProvider.hasKey":{"meta":{"summary":"","parameters":{"key":{"type":""}},"src":" \tif(this.isValidKey(key) == false){\n\t\t\tdojo.raise(\"Invalid key given: \" + key);\n\t\t}\t\n\t\t\/\/ reload the index in case someone hand edited\n\t\t\/\/ it in the file system\n\t\tthis._loadKeyIndex();\n\t\t\/\/ make sure this key exists\n\t\tvar exists = false;\n\t\tfor(var i = 0; i < this._keyIndex.length; i++){\n\t\t\tif(this._keyIndex[i] == key){\n\t\t\t\texists = true;\n\t\t\t}\t\n\t\t}\n\t\treturn exists;","prototype":"dojo.storage.browser.FileStorageProvider"}},"dojo.storage.browser.FileStorageProvider.clear":{"meta":{"summary":"","src":" \tthis._loadKeyIndex();\n\t\t\/\/ make a copy of the keyIndex, since we will be changing\n\t\t\/\/ it while looping\n\t\tvar keyIndex = new Array();\n\t\tfor(var i = 0; i < this._keyIndex.length; i++){\n\t\t\tkeyIndex[keyIndex.length] = new String(this._keyIndex[i]);\t\n\t\t}\n\t\t\/\/ now wipe everything out\n\t\tfor(var i = 0; i < keyIndex.length; i++){\n\t\t\tthis.remove(keyIndex[i]);\t\n\t\t}","prototype":"dojo.storage.browser.FileStorageProvider"}},"dojo.storage.browser.FileStorageProvider.remove":{"meta":{"summary":"","parameters":{"key":{"type":""}},"src":" \tif(this.isValidKey(key) == false){\n\t\t\tdojo.raise(\"Invalid key given: \" + key);\n\t\t}\n\t\t\/\/ first, remove the key from the index\n\t\t\/\/ load the index in case it has been changed\n\t\t\/\/ by hand in the file system\n\t\tthis._loadKeyIndex();\n\t\t\/\/ find and delete this key\n\t\tfor(var i = 0; i < this._keyIndex.length; i++){\n\t\t\tif(this._keyIndex[i] == key){\n\t\t\t\tthis._keyIndex.splice(i, 1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\/\/ resave the index\n\t\tthis._save(dojo.storage.browser.FileStorageProvider._KEY_INDEX_FILENAME,\n\t\t\t\t\tthis._keyIndex,\n\t\t\t\t\tfalse);\n\t\t\/\/ now delete the underlying key's file\n\t\t\/\/ the filename for this key entry\n\t\tvar fullPath = this._getPagePath() + key + \".txt\";\n\t\tif(this._isAvailableXPCOM()){\n\t\t\tthis._removeXPCOM(fullPath);\n\t\t}else if(this._isAvailableActiveX()){\n\t\t\tthis._removeActiveX(fullPath);\n\t\t} \/*else if(this._isAvailableJava()){\n\t\t\tthis._removeJava(fullPath);\n\t\t}*\/","prototype":"dojo.storage.browser.FileStorageProvider"}},"dojo.storage.browser.FileStorageProvider.isPermanent":{"meta":{"summary":"","src":" \treturn true;","prototype":"dojo.storage.browser.FileStorageProvider"}},"dojo.storage.browser.FileStorageProvider.getMaximumSize":{"meta":{"summary":"","src":" \treturn dojo.storage.SIZE_NO_LIMIT;","prototype":"dojo.storage.browser.FileStorageProvider"}},"dojo.storage.browser.FileStorageProvider.hasSettingsUI":{"meta":{"summary":"","src":" \treturn false;","prototype":"dojo.storage.browser.FileStorageProvider"}},"dojo.storage.browser.FileStorageProvider.showSettingsUI":{"meta":{"summary":"","src":" \tdojo.raise(this.getType() + \" does not support a storage settings user-interface\");","prototype":"dojo.storage.browser.FileStorageProvider"}},"dojo.storage.browser.FileStorageProvider.hideSettingsUI":{"meta":{"summary":"","src":" \tdojo.raise(this.getType() + \" does not support a storage settings user-interface\");","prototype":"dojo.storage.browser.FileStorageProvider"}},"dojo.storage.browser.FileStorageProvider.getType":{"meta":{"summary":"","src":" \treturn \"dojo.storage.browser.FileStorageProvider\";","prototype":"dojo.storage.browser.FileStorageProvider"}},"dojo.storage.browser.FileStorageProvider._save":{"meta":{"summary":"","parameters":{"key":{"type":""},"value":{"type":""},"updateKeyIndex":{"type":""}},"src":" \tif(typeof updateKeyIndex == \"undefined\"){\n\t\t\tupdateKeyIndex = true;\t\n\t\t}\n\t\t\/\/ serialize the value;\n\t\t\/\/ handle strings differently so they have better performance;\n\t\t\/\/ add a comment at the top of the JSON so we can differentiate\n\t\t\/\/ JSONed script blocks from a giant string for better\n\t\t\/\/ performance\n\t\tif(dojo.lang.isString(value) == false){\n\t\t\tvalue = dojo.json.serialize(value);\n\t\t\tvalue = \"\/* JavaScript *\/\\n\" + value + \"\\n\\n\";\n\t\t}\n\t\t\/\/ the filename for this key\/value entry\n\t\tvar fullPath = this._getPagePath() + key + \".txt\";\n\t\tif(this._isAvailableXPCOM()){\n\t\t\tthis._saveFileXPCOM(fullPath, value);\t\n\t\t}else if(this._isAvailableActiveX()){\n\t\t\tthis._saveFileActiveX(fullPath, value);\n\t\t} \/*else if(this._isAvailableJava()){\n\t\t\tthis._saveFileJava(fullPath, value);\n\t\t}*\/\n\t\tif(updateKeyIndex){\n\t\t\tthis._updateKeyIndex(key);\n\t\t}","prototype":"dojo.storage.browser.FileStorageProvider"}},"dojo.storage.browser.FileStorageProvider._load":{"meta":{"summary":"","parameters":{"key":{"type":""}},"src":" \tvar fullPath = this._getPagePath() + key + \".txt\";\n\t\tvar results = null;\n\t\tif(this._isAvailableXPCOM()){\n\t\t\tresults = this._loadFileXPCOM(fullPath);\t\n\t\t}else if(this._isAvailableActiveX()){\n\t\t\tresults = this._loadFileActiveX(fullPath);\n\t\t}else if(this._isAvailableJava()){\n\t\t\tresults = this._loadFileJava(fullPath);\n\t\t}\n\t\tif(results == null){\n\t\t\treturn null;\n\t\t}\n\t\t\/\/ destringify the content back into a \n\t\t\/\/ real JavaScript object;\n\t\t\/\/ handle strings differently so they have better performance\n\t\tif(!dojo.lang.isUndefined(results) && results != null \n\t\t\t && \/^\\\/\\* JavaScript \\*\\\/\/.test(results)){\n\t\t\tresults = dojo.json.evalJson(results);\n\t\t}\n\t\treturn results;","prototype":"dojo.storage.browser.FileStorageProvider"}},"dojo.storage.browser.FileStorageProvider._updateKeyIndex":{"meta":{"summary":"","parameters":{"key":{"type":""}},"src":" \tthis._loadKeyIndex();\n\t\t\/\/ now add our new key if it's not there yet\n\t\tvar alreadyAdded = false;\n\t\tfor(var i = 0; i < this._keyIndex.length; i++){\n\t\t\tif(this._keyIndex[i] == key){\n\t\t\t\talreadyAdded = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif(alreadyAdded == false){\n\t\t\tthis._keyIndex[this._keyIndex.length] = key;\n\t\t}\n\t\tthis._save(dojo.storage.browser.FileStorageProvider._KEY_INDEX_FILENAME,\n\t\t\t\t\tthis._keyIndex,\n\t\t\t\t\tfalse);","prototype":"dojo.storage.browser.FileStorageProvider"}},"dojo.storage.browser.FileStorageProvider._loadKeyIndex":{"meta":{"summary":"","src":" \tvar indexContents = this._load(\n\t\t\t\t\t\t\t\tdojo.storage.browser.FileStorageProvider._KEY_INDEX_FILENAME);\n\t\t\/\/ turn the file from a JSONed array back into\n\t\t\/\/ a real object\n\t\tif(indexContents == null){\n\t\t\tthis._keyIndex = new Array();\n\t\t}else{\n\t\t\tthis._keyIndex = indexContents;\n\t\t}","prototype":"dojo.storage.browser.FileStorageProvider"}},"dojo.storage.browser.FileStorageProvider._saveFileXPCOM":{"meta":{"summary":"","parameters":{"filename":{"type":""},"value":{"type":""}},"src":" \ttry{\n\t\t\t\/\/ indicate we are a privileged code block\n\t\t\tnetscape.security.PrivilegeManager.enablePrivilege(\"UniversalXPConnect\");\n\t\t\t\/\/ get the file to work with\n\t\t\tvar f = Components.classes[\"@mozilla.org\/file\/local;1\"]\n\t\t\t\t\t\t.createInstance(Components.interfaces.nsILocalFile);\n\t\t\tf.initWithPath(filename);\n\t\t\t\/\/ open an output stream\n\t\t\tvar ouputStream = Components.classes[\"@mozilla.org\/network\/file-output-stream;1\"]\n\t\t\t\t\t\t.createInstance(Components.interfaces.nsIFileOutputStream);\n\t\t\t\/\/ void init(nsIFile file, int ioFlags, int perm, int behaviorFlags)\n\t\t\t\/\/ \t\tArguments:\n    \t\t\t\/\/\t\t\tfile: - file to write to\n\t\t\t\/\/\t\t    ioFlags: - file open flags \n\t\t\t\/\/\t\t\t\t0x20 = PR_TRUNCATE - If the file exists, its length is truncated to 0\n\t\t\t\/\/ \t\t\t\t0x04 = R_RDWR - Read and Write access\n\t\t\t\/\/\t\t\t\t0x08 = PR_CREATE_FILE - Create file if it doesn't exist\n\t\t\t\/\/\t\t    perm: - file mode bits (Applied on Unix only)\n\t\t\t\/\/\t\t\t\t00400   Read by owner.\n\t\t\t\/\/\t\t    \t\t00200   Write by owner.\n\t\t\t\/\/\t\t    behaviorFlags: flags specifying various behaviors of the \n\t\t\t\/\/\t\t\t\tclass (currently none supported)\n\t\t\t\/\/ FIXME: BUG: We don't work on Parallels when we are on Windows trying\n\t\t\t\/\/ to update a SMB share on a Mac; .allKeys.txt gets zeroed out\n\t\t\touputStream.init(f, 0x20 | 0x04 | 0x08, 00400 + 00200, null);\n\t\t\touputStream.write(value, value.length);\n\t\t\touputStream.close();\n\t\t}catch(e){\n\t\t\tvar msg = e.toString();\n\t\t\tif(e.name && e.message){\n\t\t\t\tmsg = e.name + \": \" + e.message;\n\t\t\t}\n\t\t\tdojo.raise(\"dojo.storage.browser.FileStorageProvider._saveFileXPCOM(): \" + msg);\n\t\t}","prototype":"dojo.storage.browser.FileStorageProvider"}},"dojo.storage.browser.FileStorageProvider._loadFileXPCOM":{"meta":{"summary":"","parameters":{"filename":{"type":""}},"src":" \ttry{\n\t\t\t\/\/ indicate we are a privileged code block\n\t\t\tnetscape.security.PrivilegeManager.enablePrivilege(\"UniversalXPConnect\");\n\t\t\t\/\/ get the file to work with\n\t\t\tvar f = Components.classes[\"@mozilla.org\/file\/local;1\"]\n\t\t\t\t\t\t.createInstance(Components.interfaces.nsILocalFile);\n\t\t\tf.initWithPath(filename);\n\t\t\tif(f.exists() == false){\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tvar inp = Components.classes[\"@mozilla.org\/network\/file-input-stream;1\"]\n\t\t\t\t\t\t.createInstance(Components.interfaces.nsIFileInputStream);\n\t\t\t\/\/ void init(nsIFile file, int ioFlags, int perm, int behaviorFlags)\n\t\t\t\/\/\tArguments:\n\t\t\t\/\/\t    file: file to read from\n\t\t\t\/\/\t    ioFlags: file open flags\n\t\t\t\/\/\t\t\t0x01 = PR_RDONLY - Open for reading only\n\t\t\t\/\/\t    perm: file mode bits\n\t\t\t\/\/\t\t\t00004 = Read by others (applied on UNIX only)\n\t\t\t\/\/\t    behaviorFlags: flags specifying various behaviors of the class\n\t\t\tinp.init(f, 0x01, 00004, null);\n\t\t\tvar inputStream = Components.classes[\"@mozilla.org\/scriptableinputstream;1\"]\n\t\t\t\t\t\t\t\t.createInstance(Components.interfaces.nsIScriptableInputStream);\n\t\t\tinputStream.init(inp);\n\t\t\tvar results = inputStream.read(inputStream.available());\n\t\t\treturn results;\n\t\t}catch(e){\n\t\t\tvar msg = e.toString();\n\t\t\tif(e.name && e.message){\n\t\t\t\tmsg = e.name + \": \" + e.message;\n\t\t\t}\n\t\t\tdojo.raise(\"dojo.storage.browser.FileStorageProvider._loadFileXPCOM(): \" + msg);\n\t\t}\n\t\treturn null;","prototype":"dojo.storage.browser.FileStorageProvider"}},"dojo.storage.browser.FileStorageProvider._saveFileActiveX":{"meta":{"summary":"","parameters":{"filename":{"type":""},"value":{"type":""}},"src":" \ttry{\n\t\t\tvar fileSystem = new ActiveXObject(\"Scripting.FileSystemObject\");\n\t\t\t\/\/ object.OpenTextFile(filename[, iomode[, create[, format]]])\n\t\t\t\/\/\n\t\t\t\/\/\tArguments\n\t\t\t\/\/\t\tfilename - String expression that identifies the file to open.\n\t\t\t\/\/\t\tiomode - Can be one of three constants: ForReading (1), \n\t\t\t\/\/\t\t\t\tForWriting (2), or ForAppending (8).\n\t\t\t\/\/\t\tcreate - Boolean value that indicates whether a new file \n\t\t\t\/\/\t\t\t\tcan be created if the specified filename doesn't exist. \n\t\t\t\/\/\t\t\t\tThe value is True if a new file is created, False if it isn't created. \n\t\t\t\/\/\t\t\t\tIf omitted, a new file isn't created.\n\t\t\t\/\/\t\tformat - One of three Tristate values used to indicate the format of the \n\t\t\t\/\/\t\topened file. If omitted, the file is opened as ASCII. \n\t\t\tvar f = fileSystem.OpenTextFile(filename, 2 \/* ForWriting *\/, \n\t\t\t\t\t\t\t\t\t\t\ttrue \/* Create File *\/);\n\t\t\tf.Write(value);\n\t\t\tf.Close();\n\t\t}catch(e){\n\t\t\tvar msg = e.toString();\n\t\t\tif(e.name && e.message){\n\t\t\t\tmsg = e.name + \": \" + e.message;\n\t\t\t}\n\t\t\tdojo.raise(\"dojo.storage.browser.FileStorageProvider._saveFileActiveX(): \" + msg);\n\t\t}","prototype":"dojo.storage.browser.FileStorageProvider"}},"dojo.storage.browser.FileStorageProvider._loadFileActiveX":{"meta":{"summary":"","parameters":{"filename":{"type":""}},"src":" \ttry{\n\t\t\tvar fileSystem = new ActiveXObject(\"Scripting.FileSystemObject\");\n\t\t\tif(fileSystem.FileExists(filename) == false){\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t\/\/ object.OpenTextFile(filename[, iomode[, create[, format]]])\n\t\t\t\/\/\n\t\t\t\/\/\tArguments\n\t\t\t\/\/\t\tfilename - String expression that identifies the file to open.\n\t\t\t\/\/\t\tiomode - Can be one of three constants: ForReading (1), \n\t\t\t\/\/\t\t\t\tForWriting (2), or ForAppending (8).\n\t\t\t\/\/\t\tcreate - Boolean value that indicates whether a new file \n\t\t\t\/\/\t\t\t\tcan be created if the specified filename doesn't exist. \n\t\t\t\/\/\t\t\t\tThe value is True if a new file is created, False if it isn't created. \n\t\t\t\/\/\t\t\t\tIf omitted, a new file isn't created.\n\t\t\t\/\/\t\tformat - One of three Tristate values used to indicate the format of the \n\t\t\t\/\/\t\topened file. If omitted, the file is opened as ASCII. \n\t\t\tvar f = fileSystem.OpenTextFile(filename, 1 \/* ForReading *\/);\n\t\t\tvar results = f.ReadAll();\n\t\t\tf.Close();\n\t\t\treturn results;\n\t\t}catch(e){\n\t\t\tvar msg = e.toString();\n\t\t\tif(e.name && e.message){\n\t\t\t\tmsg = e.name + \": \" + e.message;\n\t\t\t}\n\t\t\tdojo.raise(\"dojo.storage.browser.FileStorageProvider._loadFileActiveX(): \" + msg);\n\t\t}","prototype":"dojo.storage.browser.FileStorageProvider"}},"dojo.storage.browser.FileStorageProvider._saveFileJava":{"meta":{"summary":"","parameters":{"filename":{"type":""},"value":{"type":""}},"src":" \ttry{\n\t\t\tvar applet = dojo.byId(dojo.storage.browser.FileStorageProvider._APPLET_ID);\n\t\t\tapplet.save(filename, value);\n\t\t}catch(e){\n\t\t\tvar msg = e.toString();\n\t\t\tif(e.name && e.message){\n\t\t\t\tmsg = e.name + \": \" + e.message;\n\t\t\t}\n\t\t\tdojo.raise(\"dojo.storage.browser.FileStorageProvider._saveFileJava(): \" + msg);\n\t\t}","prototype":"dojo.storage.browser.FileStorageProvider"}},"dojo.storage.browser.FileStorageProvider._loadFileJava":{"meta":{"summary":"","parameters":{"filename":{"type":""}},"src":" \ttry{\n\t\t\tvar applet = dojo.byId(dojo.storage.browser.FileStorageProvider._APPLET_ID);\n\t\t\tvar results = applet.load(filename);\n\t\t\treturn results;\n\t\t}catch(e){\n\t\t\tvar msg = e.toString();\n\t\t\tif(e.name && e.message){\n\t\t\t\tmsg = e.name + \": \" + e.message;\n\t\t\t}\n\t\t\tdojo.raise(\"dojo.storage.browser.FileStorageProvider._loadFileJava(): \" + msg);\n\t\t}","prototype":"dojo.storage.browser.FileStorageProvider"}},"dojo.storage.browser.FileStorageProvider._isAvailableActiveX":{"meta":{"summary":"","src":" \ttry{\n\t\t\tif(window.ActiveXObject){\n\t\t\t\tvar fileSystem = new window.ActiveXObject(\"Scripting.FileSystemObject\");\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}catch(e){\n\t\t\tdojo.debug(e);\n\t\t}\n\t\treturn false;","prototype":"dojo.storage.browser.FileStorageProvider"}},"dojo.storage.browser.FileStorageProvider._isAvailableXPCOM":{"meta":{"summary":"","src":" \ttry{\n\t\t\tif(window.Components){\n\t\t\t\tnetscape.security.PrivilegeManager.enablePrivilege(\"UniversalXPConnect\");\n\t\t\t\tComponents.classes[\"@mozilla.org\/file\/local;1\"]\n\t\t\t\t\t.createInstance(Components.interfaces.nsILocalFile);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}catch(e){\n\t\t\tdojo.debug(e);\n\t\t}\n\t\treturn false;","prototype":"dojo.storage.browser.FileStorageProvider"}},"dojo.storage.browser.FileStorageProvider._isAvailableJava":{"meta":{"summary":"","src":" \ttry{\n\t\t\tif(dojo.render.html.safari == true || dojo.render.html.opera == true()){\n\t\t\t\tif(navigator.javaEnabled() == true){\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}catch(e){\n\t\t\tdojo.debug(e);\n\t\t}\n\t\treturn false;","prototype":"dojo.storage.browser.FileStorageProvider"}},"dojo.storage.browser.FileStorageProvider._getPagePath":{"meta":{"summary":"","src":" \tvar path = window.location.pathname;\n\t\t\/\/ strip off any potential filename\n\t\t\/\/ FIXME: it is very difficult to truly differentiate\n\t\t\/\/ a directory from a filename; we just assume that if it\n\t\t\/\/ ends with .html or .htm that it is a filename\n\t\tif(\/\\.html?$\/i.test(path)){\n\t\t\tpath = path.replace(\/(?:\\\/|\\\\)?[^\\.\\\/\\\\]*\\.html?$\/, \"\");\n\t\t}\n\t\tif(\/^\\\/?[a-z]+\\:\/i.test(path)){ \/\/ Windows disk name, such as a:\n\t\t\t\/\/ Mozilla adds a leading slash\n\t\t\tpath = path.replace(\/^\\\/?\/, \"\");\n\t\t\t\/\/ convert slashes to Windows back slashes\n\t\t\tpath = path.replace(\/\\\/\/g, \"\\\\\"); \n\t\t}else if(\/^[\\\/\\\\]{2,3}[^\\\/]\/.test(path)){ \/\/ SMB share, such as \\\\foobar\\someshare\\dir\n\t\t\t\/\/ strip off leading slashes\n\t\t\t\/\/ Mozilla adds three slashes, so optionally slice that off as well\n\t\t\tpath = path.replace(\/^[\\\/\\\\]{2,3}\/, \"\");\n\t\t\t\/\/ convert slashes to Windows back slashes\n\t\t\tpath = path.replace(\/\\\/\/g, \"\\\\\");\n\t\t\t\/\/ add leading slashes back on \n\t\t\tpath = \"\\\\\\\\\" + path; \/* becomes just \\\\ *\/\n\t\t}\n\t\t\/\/ end the path with a slash\n\t\tif(\/\\\/$\/.test(path) == false \n\t\t\t&& \/\\\\$\/.test(path) == false){\n\t\t\t\/\/ add slash or backslash?\n\t\t\tif(\/\\\/\/.test(path)){\n\t\t\t\tpath += \"\/\";\n\t\t\t}else{\n\t\t\t\tpath += \"\\\\\";\n\t\t\t}\n\t\t}\n\t\t\/\/ some platforms will escape these values\n\t\tpath = unescape(path);\n\t\treturn path;","prototype":"dojo.storage.browser.FileStorageProvider"}},"dojo.storage.browser.FileStorageProvider._removeXPCOM":{"meta":{"summary":"","parameters":{"filename":{"type":""}},"src":" \ttry{\n\t\t\t\/\/ indicate we are a privileged code block\n\t\t\tnetscape.security.PrivilegeManager.enablePrivilege(\"UniversalXPConnect\");\n\t\t\t\/\/ get the file to work with\n\t\t\tvar f = Components.classes[\"@mozilla.org\/file\/local;1\"]\n\t\t\t\t\t\t.createInstance(Components.interfaces.nsILocalFile);\n\t\t\tf.initWithPath(filename);\n\t\t\tif(f.exists() == false || f.isDirectory()){\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(f.isFile()){\n\t\t\t\tf.remove(false); \/\/ false = don't recursively delete\t\n\t\t\t}\n\t\t}catch(e){\n\t\t\t\/\/ FIXME: Should we be raising an exception on a \n\t\t\t\/\/ dojo.storage.remove()?\n\t\t\tdojo.raise(\"dojo.storage.browser.FileStorageProvider.remove(): \" + e.toString());\n\t\t}\t","prototype":"dojo.storage.browser.FileStorageProvider"}},"dojo.storage.browser.FileStorageProvider._removeActiveX":{"meta":{"summary":"","parameters":{"filename":{"type":""}},"src":" \ttry{\n\t\t\tvar fileSystem = new ActiveXObject(\"Scripting.FileSystemObject\");\n\t\t\tfileSystem.DeleteFile(filename);\n\t\t}catch(e){\n\t\t\t\/\/ FIXME: Should we be raising an exception on a \n\t\t\t\/\/ dojo.storage.remove()?\n\t\t\tdojo.raise(\"dojo.storage.browser.FileStorageProvider.remove(): \" + e.toString());\n\t\t}\t","prototype":"dojo.storage.browser.FileStorageProvider"}},"dojo.storage.browser.FileStorageProvider._removeJava":{"meta":{"summary":"","parameters":{"filename":{"type":""}},"src":" \ttry{\n\t\t\tvar applet = dojo.byId(dojo.storage.browser.FileStorageProvider._APPLET_ID);\n\t\t\tapplet.remove(filename);\n\t\t}catch(e){\n\t\t\tvar msg = e.toString();\n\t\t\tif(e.name && e.message){\n\t\t\t\tmsg = e.name + \": \" + e.message;\n\t\t\t}\n\t\t\tdojo.raise(\"dojo.storage.browser.FileStorageProvider._removeJava(): \" + msg);\n\t\t}","prototype":"dojo.storage.browser.FileStorageProvider"}},"dojo.storage.browser.FileStorageProvider._writeApplet":{"meta":{"summary":"","src":" \tvar archive = dojo.uri.dojoUri(\"DojoFileStorageProvider.jar\").toString();\n\t\tvar tag = \"<applet \"\n\t\t\t\t\t+ \"id='\" + dojo.storage.browser.FileStorageProvider._APPLET_ID + \"' \"\n\t\t\t\t\t+ \"style='position: absolute; top: -500px; left: -500px; width: 1px; height: 1px;' \"\n\t\t\t\t\t+ \"code='DojoFileStorageProvider.class' \"\n\t\t\t\t\t+ \"archive='\" + archive + \"' \"\n\t\t\t\t\t+ \"width='1' \"\n\t\t\t\t\t+ \"height='1' \"\n\t\t\t\t\t+ \">\"\n\t\t\t\t\t+ \"<\/applet>\";\n\t\tdocument.writeln(tag);","prototype":"dojo.storage.browser.FileStorageProvider"}},"dojo.storage.browser.WhatWGStorageProvider.initialize":{"meta":{"summary":"","src":" \tif(djConfig[\"disableWhatWGStorage\"] == true){\n\t\t\treturn;\n\t\t}\n\t\t\/\/ get current domain\n\t\tthis._domain = location.hostname;\n\t\t\/\/ indicate that this storage provider is now loaded\n\t\tthis.initialized = true;\n\t\tdojo.storage.manager.loaded();\t","prototype":"dojo.storage.browser.WhatWGStorageProvider"}},"dojo.storage.browser.WhatWGStorageProvider.isAvailable":{"meta":{"summary":"","src":" \ttry{\n\t\t\tvar myStorage = globalStorage[location.hostname];\n\t\t}catch(e){\n\t\t\tthis._available = false;\n\t\t\treturn this._available;\n\t\t}\n\t\tthis._available = true;\t\n\t\treturn this._available;","prototype":"dojo.storage.browser.WhatWGStorageProvider"}},"dojo.storage.browser.WhatWGStorageProvider.put":{"meta":{"summary":"","parameters":{"key":{"type":""},"value":{"type":""},"resultsHandler":{"type":""}},"src":" \tif(this.isValidKey(key) == false){\n\t\t\tdojo.raise(\"Invalid key given: \" + key);\n\t\t}\t\t\t\n\t\tthis._statusHandler = resultsHandler;\n\t\t\/\/ serialize the value;\n\t\t\/\/ handle strings differently so they have better performance\n\t\tif(dojo.lang.isString(value)){\n\t\t\tvalue = \"string:\" + value;\n\t\t}else{\n\t\t\tvalue = dojo.json.serialize(value);\n\t\t}\n\t\t\/\/ register for successful storage events\n\t\twindow.addEventListener(\"storage\", function(evt){\n\t\t\t\/\/ indicate we succeeded\n\t\t\tresultsHandler.call(null, dojo.storage.SUCCESS, key);\n\t\t}, false);\n\t\t\/\/ try to store the value\t\n\t\ttry{\n\t\t\tvar myStorage = globalStorage[this._domain];\n\t\t\tmyStorage.setItem(key,value);\n\t\t}catch(e){\n\t\t\t\/\/ indicate we failed\n\t\t\tthis._statusHandler.call(null, dojo.storage.FAILED, \n\t\t\t\t\t\t\t\t\tkey, e.toString());\n\t\t}","call_chain":["resultsHandler","this._statusHandler"],"prototype":"dojo.storage.browser.WhatWGStorageProvider"}},"dojo.storage.browser.WhatWGStorageProvider.get":{"meta":{"summary":"","parameters":{"key":{"type":""}},"src":" \tif(this.isValidKey(key) == false){\n\t\t\tdojo.raise(\"Invalid key given: \" + key);\n\t\t}\n\t\tvar myStorage = globalStorage[this._domain];\n\t\tvar results = myStorage.getItem(key);\n\t\tif(results == null){\n\t\t\treturn null;\n\t\t}\n\t\tresults = results.value;\n\t\t\/\/ destringify the content back into a \n\t\t\/\/ real JavaScript object;\n\t\t\/\/ handle strings differently so they have better performance\n\t\tif(!dojo.lang.isUndefined(results) && results != null \n\t\t\t && \/^string:\/.test(results)){\n\t\t\tresults = results.substring(\"string:\".length);\n\t\t}else{\n\t\t\tresults = dojo.json.evalJson(results);\n\t\t}\n\t\treturn results;","prototype":"dojo.storage.browser.WhatWGStorageProvider"}},"dojo.storage.browser.WhatWGStorageProvider.getKeys":{"meta":{"summary":"","src":" \tvar myStorage = globalStorage[this._domain];\n\t\tvar keysArray = new Array();\n\t\tfor(i=0; i<myStorage.length;i++){\n\t\t\tkeysArray[i] = myStorage.key(i);\n\t\t}\n\t\treturn keysArray;","prototype":"dojo.storage.browser.WhatWGStorageProvider"}},"dojo.storage.browser.WhatWGStorageProvider.clear":{"meta":{"summary":"","src":" \tvar myStorage = globalStorage[this._domain];\n\t\tvar keys = new Array();\n\t\tfor(var i = 0; i < myStorage.length; i++){\n\t\t\tkeys[keys.length] = myStorage.key(i);\n\t\t}\n\t\tfor(var i = 0; i < keys.length; i++){\n\t\t\tmyStorage.removeItem(keys[i]);\n\t\t}","prototype":"dojo.storage.browser.WhatWGStorageProvider"}},"dojo.storage.browser.WhatWGStorageProvider.remove":{"meta":{"summary":"","parameters":{"key":{"type":""}},"src":" \tvar myStorage = globalStorage[this._domain];\n\t\tmyStorage.removeItem(key);","prototype":"dojo.storage.browser.WhatWGStorageProvider"}},"dojo.storage.browser.WhatWGStorageProvider.isPermanent":{"meta":{"summary":"","src":" \treturn true;","prototype":"dojo.storage.browser.WhatWGStorageProvider"}},"dojo.storage.browser.WhatWGStorageProvider.getMaximumSize":{"meta":{"summary":"","src":" \treturn dojo.storage.SIZE_NO_LIMIT;","prototype":"dojo.storage.browser.WhatWGStorageProvider"}},"dojo.storage.browser.WhatWGStorageProvider.hasSettingsUI":{"meta":{"summary":"","src":" \treturn false;","prototype":"dojo.storage.browser.WhatWGStorageProvider"}},"dojo.storage.browser.WhatWGStorageProvider.showSettingsUI":{"meta":{"summary":"","src":" \tdojo.raise(this.getType() + \" does not support a storage settings user-interface\");","prototype":"dojo.storage.browser.WhatWGStorageProvider"}},"dojo.storage.browser.WhatWGStorageProvider.hideSettingsUI":{"meta":{"summary":"","src":" \tdojo.raise(this.getType() + \" does not support a storage settings user-interface\");","prototype":"dojo.storage.browser.WhatWGStorageProvider"}},"dojo.storage.browser.WhatWGStorageProvider.getType":{"meta":{"summary":"","src":" \treturn \"dojo.storage.browser.WhatWGProvider\";","prototype":"dojo.storage.browser.WhatWGStorageProvider"}},"dojo.storage.browser.FlashStorageProvider.initialize":{"meta":{"summary":"","src":" \tif(djConfig[\"disableFlashStorage\"] == true){\n\t\t\treturn;\n\t\t}\n\t\t\/\/ initialize our Flash\n\t\tvar loadedListener = function(){\n\t\t\tdojo.storage._flashLoaded();\n\t\t}\n\t\tdojo.flash.addLoadedListener(loadedListener);\n\t\tvar swfloc6 = dojo.uri.dojoUri(\"Storage_version6.swf\").toString();\n\t\tvar swfloc8 = dojo.uri.dojoUri(\"Storage_version8.swf\").toString();\n\t\tdojo.flash.setSwf({flash6: swfloc6, flash8: swfloc8, visible: false});","prototype":"dojo.storage.browser.FlashStorageProvider"}},"dojo.storage.browser.FlashStorageProvider.isAvailable":{"meta":{"summary":"","src":" \tif(djConfig[\"disableFlashStorage\"] == true){\n\t\t\tthis._available = false;\n\t\t}else{\n\t\t\tthis._available = true;\n\t\t}\n\t\treturn this._available;","prototype":"dojo.storage.browser.FlashStorageProvider"}},"dojo.storage.browser.FlashStorageProvider.put":{"meta":{"summary":"","parameters":{"key":{"type":""},"value":{"type":""},"resultsHandler":{"type":""}},"src":" \tif(this.isValidKey(key) == false){\n\t\t\tdojo.raise(\"Invalid key given: \" + key);\n\t\t}\n\t\tthis._statusHandler = resultsHandler;\n\t\t\/\/ serialize the value;\n\t\t\/\/ handle strings differently so they have better performance\n\t\tif(dojo.lang.isString(value)){\n\t\t\tvalue = \"string:\" + value;\n\t\t}else{\n\t\t\tvalue = dojo.json.serialize(value);\n\t\t}\n\t\tdojo.flash.comm.put(key, value, this.namespace);","prototype":"dojo.storage.browser.FlashStorageProvider"}},"dojo.storage.browser.FlashStorageProvider.get":{"meta":{"summary":"","parameters":{"key":{"type":""}},"src":" \tif(this.isValidKey(key) == false){\n\t\t\tdojo.raise(\"Invalid key given: \" + key);\n\t\t}\n\t\tvar results = dojo.flash.comm.get(key, this.namespace);\n\t\tif(results == \"\"){\n\t\t\treturn null;\n\t\t}\n\t\t\/\/ destringify the content back into a \n\t\t\/\/ real JavaScript object;\n\t\t\/\/ handle strings differently so they have better performance\n\t\tif(!dojo.lang.isUndefined(results) && results != null \n\t\t\t && \/^string:\/.test(results)){\n\t\t\tresults = results.substring(\"string:\".length);\n\t\t}else{\n\t\t\tresults = dojo.json.evalJson(results);\n\t\t}\n\t\treturn results;","prototype":"dojo.storage.browser.FlashStorageProvider"}},"dojo.storage.browser.FlashStorageProvider.getKeys":{"meta":{"summary":"","src":" \tvar results = dojo.flash.comm.getKeys(this.namespace);\n\t\tif(results == \"\"){\n\t\t\treturn [];\n\t\t}\n\t\t\/\/ the results are returned comma seperated; split them\n\t\treturn results.split(\",\");","prototype":"dojo.storage.browser.FlashStorageProvider"}},"dojo.storage.browser.FlashStorageProvider.clear":{"meta":{"summary":"","src":" \tdojo.flash.comm.clear(this.namespace);","prototype":"dojo.storage.browser.FlashStorageProvider"}},"dojo.storage.browser.FlashStorageProvider.remove":{"meta":{"summary":"Note- This one method is not implemented on the FlashStorageProvider yet","parameters":{"key":{"type":""}},"src":" \tdojo.unimplemented(\"dojo.storage.browser.FlashStorageProvider.remove\");","prototype":"dojo.storage.browser.FlashStorageProvider"}},"dojo.storage.browser.FlashStorageProvider.isPermanent":{"meta":{"summary":"","src":" \treturn true;","prototype":"dojo.storage.browser.FlashStorageProvider"}},"dojo.storage.browser.FlashStorageProvider.getMaximumSize":{"meta":{"summary":"","src":" \treturn dojo.storage.SIZE_NO_LIMIT;","prototype":"dojo.storage.browser.FlashStorageProvider"}},"dojo.storage.browser.FlashStorageProvider.hasSettingsUI":{"meta":{"summary":"","src":" \treturn true;","prototype":"dojo.storage.browser.FlashStorageProvider"}},"dojo.storage.browser.FlashStorageProvider.showSettingsUI":{"meta":{"summary":"","src":" \tdojo.flash.comm.showSettings();\n\t\tdojo.flash.obj.setVisible(true);\n\t\tdojo.flash.obj.center();","prototype":"dojo.storage.browser.FlashStorageProvider"}},"dojo.storage.browser.FlashStorageProvider.hideSettingsUI":{"meta":{"summary":"","src":" \tdojo.flash.obj.setVisible(false);\n\t\t\/\/ call anyone who wants to know the dialog is\n\t\t\/\/ now hidden\n\t\tif(dojo.storage.onHideSettingsUI != null &&\n\t\t\t!dojo.lang.isUndefined(dojo.storage.onHideSettingsUI)){\n\t\t\tdojo.storage.onHideSettingsUI.call(null);\t\n\t\t}","call_chain":["dojo.storage.onHideSettingsUI"],"prototype":"dojo.storage.browser.FlashStorageProvider"}},"dojo.storage.browser.FlashStorageProvider.getType":{"meta":{"summary":"","src":" \treturn \"dojo.storage.browser.FlashStorageProvider\";","prototype":"dojo.storage.browser.FlashStorageProvider"}},"dojo.storage.browser.FlashStorageProvider._flashLoaded":{"meta":{"summary":"","src":" \tthis._initialized = true;\n\t\t\/\/ indicate that this storage provider is now loaded\n\t\tdojo.storage.manager.loaded();","prototype":"dojo.storage.browser.FlashStorageProvider"}},"dojo.storage.browser.FlashStorageProvider._onStatus":{"meta":{"summary":"","parameters":{"statusResult":{"type":""},"key":{"type":""}},"src":" \tvar ds = dojo.storage;\n\t\tvar dfo = dojo.flash.obj;\n\t\tif(statusResult == ds.PENDING){\n\t\t\tdfo.center();\n\t\t\tdfo.setVisible(true);\n\t\t}else{\n\t\t\tdfo.setVisible(false);\n\t\t}\n\t\tif((!dj_undef(\"_statusHandler\", ds))&&(ds._statusHandler != null)){\n\t\t\tds._statusHandler.call(null, statusResult, key);\t\t\n\t\t}","call_chain":["ds._statusHandler"],"prototype":"dojo.storage.browser.FlashStorageProvider"}}}}},"dojo.storage":{"meta":{"requires":{"common":["dojo.lang.*","dojo.event.*"]},"functions":{"dojo.storage":{"meta":{"initialized":true,"summary":"A singleton for working with Dojo Storage.","src":"\t\/\/ summary: A singleton for working with Dojo Storage.\n\t\/\/ description:\n\t\/\/\tdojo.storage exposes the current available storage\n\t\/\/\tprovider on this platform. It gives you methods such\n\t\/\/\tas dojo.storage.put(), dojo.storage.get(), etc.\n\t\/\/  \n\t\/\/  \tFor more details on Dojo Storage, see the primary\n\t\/\/\tdocumentation page at\n\t\/\/\thttp:\/\/manual.dojotoolkit.org\/storage.html\n\t\/\/\n\t\/\/\tNote for storage provider developers who are creating\n\t\/\/\tsubclasses-\n\t\/\/\tThis is the base class for all storage providers\n\t\/\/\tSpecific kinds of Storage Providers should subclass this\n\t\/\/\tand implement these methods. You should avoid initialization\n\t\/\/\tstorage provider subclass's constructor; instead, perform \n\t\/\/\tinitialization in your initialize() method. \t","description":"dojo.storage exposes the current available storage provider on this platform. It gives you methods such as dojo.storage.put(), dojo.storage.get(), etc. For more details on Dojo Storage, see the primary documentation page at http: \/\/ manual.dojotoolkit.org\/storage.html Note for storage provider developers who are creating subclasses- This is the base class for all storage providers Specific kinds of Storage Providers should subclass this and implement these methods. You should avoid initialization storage provider subclass's constructor; instead, perform initialization in your initialize() method."}},"dojo.storage.manager":{"meta":{"initialized":true,"summary":"A singleton class in charge of the Dojo Storage system","src":" this.currentProvider = null;\n\t\/\/ available: Boolean\n\t\/\/\tWhether storage of some kind is available\n\tthis.available = false;\n\tthis._initialized = false;\n\tthis._providers = [];\n\t\/\/ namespace: String\n\t\/\/\tAn optional namespace value that can be used by a single application\n\t\/\/\tto partition storage into seperate units - not well supported yet.\n\tthis.namespace = \"default\";\n\tthis.initialize = function(){\n\t\t\/\/ summary: \n\t\t\/\/\t\tInitializes the storage system and autodetects the best storage\n\t\t\/\/\t\tprovider we can provide on this platform\n\t\tthis.autodetect();\n\t};\n\tthis.register = function(\/*string*\/ name, \/*Object*\/ instance) {\n\t\t\/\/ summary:\n\t\t\/\/\t\tRegisters the existence of a new storage provider; used by\n\t\t\/\/\t\tsubclasses to inform the manager of their existence. The\n\t\t\/\/\t\tstorage manager will select storage providers based on \n\t\t\/\/\t\ttheir ordering, so the order in which you call this method\n\t\t\/\/\t\tmatters. \n\t\t\/\/ name:\n\t\t\/\/\t\tThe full class name of this provider, such as\n\t\t\/\/\t\t\"dojo.storage.browser.FlashStorageProvider\".\n\t\t\/\/ instance:\n\t\t\/\/\t\tAn instance of this provider, which we will use to call\n\t\t\/\/\t\tisAvailable() on. \n\t\tthis._providers[this._providers.length] = instance;\n\t\tthis._providers[name] = instance;\n\t};\n\tthis.setProvider = function(storageClass){\n\t\t\/\/ summary:\n\t\t\/\/\t\tInstructs the storageManager to use the given storage class for\n\t\t\/\/\t\tall storage requests.\n\t\t\/\/ description:\n\t\t\/\/\t\tExample-\n\t\t\/\/\t\t\tdojo.storage.setProvider(\n\t\t\/\/\t\t\t\tdojo.storage.browser.IEStorageProvider)\n\t};\n\tthis.autodetect = function(){\n\t\t\/\/ summary:\n\t\t\/\/\t\tAutodetects the best possible persistent storage provider\n\t\t\/\/\t\tavailable on this platform. \n\t\tif(this._initialized == true){ \/\/ already finished\n\t\t\treturn;\n\t\t}\n\t\t\/\/ go through each provider, seeing if it can be used\n\t\tvar providerToUse = null;\n\t\tfor(var i = 0; i < this._providers.length; i++){\n\t\t\tproviderToUse = this._providers[i];\n\t\t\t\/\/ a flag to force the storage manager to use a particular \n\t\t\t\/\/ storage provider type, such as \n\t\t\t\/\/ djConfig = {forceStorageProvider: \"dojo.storage.browser.WhatWGStorageProvider\"};\n\t\t\tif(dojo.lang.isUndefined(djConfig[\"forceStorageProvider\"]) == false\n\t\t\t\t&& providerToUse.getType() == djConfig[\"forceStorageProvider\"]){\n\t\t\t\t\/\/ still call isAvailable for this provider, since this helps some\n\t\t\t\t\/\/ providers internally figure out if they are available\n\t\t\t\tproviderToUse.isAvailable();\n\t\t\t\tbreak;\n\t\t\t}else if(dojo.lang.isUndefined(djConfig[\"forceStorageProvider\"]) == true\n\t\t\t\t\t\t&& providerToUse.isAvailable()){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\t\n\t\tif(providerToUse == null){ \/\/ no provider available\n\t\t\tthis._initialized = true;\n\t\t\tthis.available = false;\n\t\t\tthis.currentProvider = null;\n\t\t\tdojo.raise(\"No storage provider found for this platform\");\n\t\t}\n\t\t\/\/ create this provider and copy over it's properties\n\t\tthis.currentProvider = providerToUse;\n\t  \tfor(var i in providerToUse){\n\t  \t\tdojo.storage[i] = providerToUse[i];\n\t\t}\n\t\tdojo.storage.manager = this;\n\t\t\/\/ have the provider initialize itself\n\t\tdojo.storage.initialize();\n\t\tthis._initialized = true;\n\t\tthis.available = true;\n\t};\n\tthis.isAvailable = function(){ \/*Boolean*\/\n\t\t\/\/ summary: Returns whether any storage options are available.\n\t\treturn this.available;\n\t};\n\tthis.isInitialized = function(){ \/*Boolean*\/\n\t \t\/\/ summary:\n\t\t\/\/\t\tReturns whether the storage system is initialized and ready to\n\t\t\/\/\t\tbe used. \n\t\t\/\/ FIXME: This should REALLY not be in here, but it fixes a tricky\n\t\t\/\/ Flash timing bug\n\t\tif(this.currentProvider.getType() == \"dojo.storage.browser.FlashStorageProvider\"\n\t\t\t&& dojo.flash.ready == false){\n\t\t\treturn false;\n\t\t}else{\n\t\t\treturn this._initialized;\n\t\t}\n\t};\n\tthis.supportsProvider = function(\/*string*\/ storageClass){ \/* Boolean *\/\n\t\t\/\/ summary: Determines if this platform supports the given storage provider.\n\t\t\/\/ description:\n\t\t\/\/\t\tExample-\n\t\t\/\/\t\t\tdojo.storage.manager.supportsProvider(\n\t\t\/\/\t\t\t\t\"dojo.storage.browser.InternetExplorerStorageProvider\");\n\t\t\/\/ construct this class dynamically\n\t\ttry{\n\t\t\t\/\/ dynamically call the given providers class level isAvailable()\n\t\t\t\/\/ method\n\t\t\tvar provider = eval(\"new \" + storageClass + \"()\");\n\t\t\tvar results = provider.isAvailable();\n\t\t\tif(results == null || typeof results == \"undefined\")\n\t\t\t\treturn false;\n\t\t\treturn results;\n\t\t}catch (exception){\n\t\t\treturn false;\n\t\t}\n\t};\n\tthis.getProvider = function(){ \/* Object *\/\n\t\t\/\/ summary: Gets the current provider\n\t\treturn this.currentProvider;\n\t};\n\tthis.loaded = function(){\n\t\t\/\/ summary:\n\t\t\/\/\t\tThe storage provider should call this method when it is loaded\n\t\t\/\/\t\tand ready to be used. Clients who will use the provider will\n\t\t\/\/\t\tconnect to this method to know when they can use the storage\n\t\t\/\/\t\tsystem.\n\t\t\/\/ description:\n\t\t\/\/\t\tExample-\n\t\t\/\/\t\t\tif(dojo.storage.manager.isInitialized() == false){ \n\t\t\/\/\t\t\t\tdojo.event.connect(dojo.storage.manager, \"loaded\", TestStorage, \n\t    \/\/\t\t\t\tTestStorage.initialize);\n\t\t\/\/\t\t\t}else{\n\t\t\/\/\t\t\t\tdojo.event.connect(dojo, \"loaded\", TestStorage, TestStorage.initialize);\n\t\t\/\/\t\t\t}\n\t};","instance_variables":["currentProvider","available","_initialized","_providers","namespace","initialize","register","setProvider","autodetect","isAvailable","isInitialized","supportsProvider","getProvider","loaded"],"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 dojo.storage.browser.FlashStorageProvider."}},"dojo.storage.manager.initialize":{"meta":{"summary":"Initializes the storage system and autodetects the best storage provider we can provide on this platform","src":" \tthis.autodetect();","instance":"dojo.storage.manager"}},"dojo.storage.manager.register":{"meta":{"summary":"Registers the existence of a new storage provider; used by subclasses to inform the manager of their existence. The storage manager will select storage providers based on their ordering, so the order in which you call this method matters.","parameters":{"name":{"type":"string"},"instance":{"type":"Object"}},"src":" \tthis._providers[this._providers.length] = instance;\n\t\tthis._providers[name] = instance;","instance":"dojo.storage.manager"},"extra":{"parameters":{"name":{"type":"The","summary":"full class name of this provider, such as \"dojo.storage.browser.FlashStorageProvider\"."},"instance":{"type":"An","summary":"instance of this provider, which we will use to call isAvailable() on."}}}},"dojo.storage.manager.setProvider":{"meta":{"summary":"Instructs the storageManager to use the given storage class for all storage requests.","parameters":{"storageClass":{"type":""}},"src":"\t\t\/\/ summary:\n\t\t\/\/\t\tInstructs the storageManager to use the given storage class for\n\t\t\/\/\t\tall storage requests.\n\t\t\/\/ description:\n\t\t\/\/\t\tExample-\n\t\t\/\/\t\t\tdojo.storage.setProvider(\n\t\t\/\/\t\t\t\tdojo.storage.browser.IEStorageProvider)","description":"Example- dojo.storage.setProvider( dojo.storage.browser.IEStorageProvider)","instance":"dojo.storage.manager"}},"dojo.storage.manager.autodetect":{"meta":{"summary":"Autodetects the best possible persistent storage provider available on this platform.","src":" \tif(this._initialized == true){ \/\/ already finished\n\t\t\treturn;\n\t\t}\n\t\t\/\/ go through each provider, seeing if it can be used\n\t\tvar providerToUse = null;\n\t\tfor(var i = 0; i < this._providers.length; i++){\n\t\t\tproviderToUse = this._providers[i];\n\t\t\t\/\/ a flag to force the storage manager to use a particular \n\t\t\t\/\/ storage provider type, such as \n\t\t\t\/\/ djConfig = {forceStorageProvider: \"dojo.storage.browser.WhatWGStorageProvider\"};\n\t\t\tif(dojo.lang.isUndefined(djConfig[\"forceStorageProvider\"]) == false\n\t\t\t\t&& providerToUse.getType() == djConfig[\"forceStorageProvider\"]){\n\t\t\t\t\/\/ still call isAvailable for this provider, since this helps some\n\t\t\t\t\/\/ providers internally figure out if they are available\n\t\t\t\tproviderToUse.isAvailable();\n\t\t\t\tbreak;\n\t\t\t}else if(dojo.lang.isUndefined(djConfig[\"forceStorageProvider\"]) == true\n\t\t\t\t\t\t&& providerToUse.isAvailable()){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\t\n\t\tif(providerToUse == null){ \/\/ no provider available\n\t\t\tthis._initialized = true;\n\t\t\tthis.available = false;\n\t\t\tthis.currentProvider = null;\n\t\t\tdojo.raise(\"No storage provider found for this platform\");\n\t\t}\n\t\t\/\/ create this provider and copy over it's properties\n\t\tthis.currentProvider = providerToUse;\n\t  \tfor(var i in providerToUse){\n\t  \t\tdojo.storage[i] = providerToUse[i];\n\t\t}\n\t\tdojo.storage.manager = this;\n\t\t\/\/ have the provider initialize itself\n\t\tdojo.storage.initialize();\n\t\tthis._initialized = true;\n\t\tthis.available = true;","instance":"dojo.storage.manager"}},"dojo.storage.manager.isAvailable":{"meta":{"summary":"Boolean Returns whether any storage options are available.","src":" \treturn this.available;","instance":"dojo.storage.manager"}},"dojo.storage.manager.isInitialized":{"meta":{"summary":"Boolean Returns whether the storage system is initialized and ready to be used.","src":"\t\t\/\/ FIXME: This should REALLY not be in here, but it fixes a tricky\n\t\t\/\/ Flash timing bug\n\t\tif(this.currentProvider.getType() == \"dojo.storage.browser.FlashStorageProvider\"\n\t\t\t&& dojo.flash.ready == false){\n\t\t\treturn false;\n\t\t}else{\n\t\t\treturn this._initialized;\n\t\t}","instance":"dojo.storage.manager"}},"dojo.storage.manager.supportsProvider":{"meta":{"summary":"Boolean Determines if this platform supports the given storage provider.","parameters":{"storageClass":{"type":"string"}},"src":"\t\t\/\/ construct this class dynamically\n\t\ttry{\n\t\t\t\/\/ dynamically call the given providers class level isAvailable()\n\t\t\t\/\/ method\n\t\t\tvar provider = eval(\"new \" + storageClass + \"()\");\n\t\t\tvar results = provider.isAvailable();\n\t\t\tif(results == null || typeof results == \"undefined\")\n\t\t\t\treturn false;\n\t\t\treturn results;\n\t\t}catch (exception){\n\t\t\treturn false;\n\t\t}","description":"Example- dojo.storage.manager.supportsProvider( \"dojo.storage.browser.InternetExplorerStorageProvider\");","instance":"dojo.storage.manager"}},"dojo.storage.manager.getProvider":{"meta":{"summary":"Object Gets the current provider","src":" \treturn this.currentProvider;","instance":"dojo.storage.manager"}},"dojo.storage.manager.loaded":{"meta":{"summary":"The storage provider should call this method when it is loaded and ready to be used. Clients who will use the provider will connect to this method to know when they can use the storage system.","src":"\t\t\/\/ summary:\n\t\t\/\/\t\tThe storage provider should call this method when it is loaded\n\t\t\/\/\t\tand ready to be used. Clients who will use the provider will\n\t\t\/\/\t\tconnect to this method to know when they can use the storage\n\t\t\/\/\t\tsystem.\n\t\t\/\/ description:\n\t\t\/\/\t\tExample-\n\t\t\/\/\t\t\tif(dojo.storage.manager.isInitialized() == false){ \n\t\t\/\/\t\t\t\tdojo.event.connect(dojo.storage.manager, \"loaded\", TestStorage, \n\t    \/\/\t\t\t\tTestStorage.initialize);\n\t\t\/\/\t\t\t}else{\n\t\t\/\/\t\t\t\tdojo.event.connect(dojo, \"loaded\", TestStorage, TestStorage.initialize);\n\t\t\/\/\t\t\t}","description":"Example- if(dojo.storage.manager.isInitialized() == false){ dojo.event.connect(dojo.storage.manager, \"loaded\", TestStorage, TestStorage.initialize); }else{ dojo.event.connect(dojo, \"loaded\", TestStorage, TestStorage.initialize); }","instance":"dojo.storage.manager"}}}}}}