From 1c5685d68f1b73270fb814fe04cbb490eb90ba5f Mon Sep 17 00:00:00 2001 From: mensonge Date: Fri, 14 Nov 2008 15:39:19 +0000 Subject: Minor fix: Remove DOJO library (60Mo) replaced by link to Google CDN (online DOJO library) git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@159 b3834d28-1941-0410-a4f8-b48e95affb8f --- includes/js/dojox/storage/AirDBStorageProvider.js | 252 - .../storage/AirEncryptedLocalStorageProvider.js | 221 - .../js/dojox/storage/AirFileStorageProvider.js | 232 - includes/js/dojox/storage/FlashStorageProvider.js | 346 - includes/js/dojox/storage/GearsStorageProvider.js | 320 - includes/js/dojox/storage/Provider.js | 331 - includes/js/dojox/storage/README | 76 - includes/js/dojox/storage/Storage.as | 399 -- includes/js/dojox/storage/Storage.swf | Bin 3256 -> 0 bytes includes/js/dojox/storage/WhatWGStorageProvider.js | 278 - includes/js/dojox/storage/_common.js | 20 - includes/js/dojox/storage/buildFlashStorage.sh | 4 - includes/js/dojox/storage/demos/helloworld.html | 90 - includes/js/dojox/storage/manager.js | 261 - includes/js/dojox/storage/storage_dialog.fla | Bin 344064 -> 0 bytes .../js/dojox/storage/tests/resources/testBook.txt | 7104 -------------------- .../js/dojox/storage/tests/resources/testXML.xml | 203 - includes/js/dojox/storage/tests/test_storage.html | 189 - includes/js/dojox/storage/tests/test_storage.js | 493 -- 19 files changed, 10819 deletions(-) delete mode 100644 includes/js/dojox/storage/AirDBStorageProvider.js delete mode 100644 includes/js/dojox/storage/AirEncryptedLocalStorageProvider.js delete mode 100644 includes/js/dojox/storage/AirFileStorageProvider.js delete mode 100644 includes/js/dojox/storage/FlashStorageProvider.js delete mode 100644 includes/js/dojox/storage/GearsStorageProvider.js delete mode 100644 includes/js/dojox/storage/Provider.js delete mode 100644 includes/js/dojox/storage/README delete mode 100644 includes/js/dojox/storage/Storage.as delete mode 100644 includes/js/dojox/storage/Storage.swf delete mode 100644 includes/js/dojox/storage/WhatWGStorageProvider.js delete mode 100644 includes/js/dojox/storage/_common.js delete mode 100644 includes/js/dojox/storage/buildFlashStorage.sh delete mode 100644 includes/js/dojox/storage/demos/helloworld.html delete mode 100644 includes/js/dojox/storage/manager.js delete mode 100644 includes/js/dojox/storage/storage_dialog.fla delete mode 100644 includes/js/dojox/storage/tests/resources/testBook.txt delete mode 100644 includes/js/dojox/storage/tests/resources/testXML.xml delete mode 100644 includes/js/dojox/storage/tests/test_storage.html delete mode 100644 includes/js/dojox/storage/tests/test_storage.js (limited to 'includes/js/dojox/storage') diff --git a/includes/js/dojox/storage/AirDBStorageProvider.js b/includes/js/dojox/storage/AirDBStorageProvider.js deleted file mode 100644 index a846b94..0000000 --- a/includes/js/dojox/storage/AirDBStorageProvider.js +++ /dev/null @@ -1,252 +0,0 @@ -if(!dojo._hasResource["dojox.storage.AirDBStorageProvider"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["dojox.storage.AirDBStorageProvider"] = true; -dojo.provide("dojox.storage.AirDBStorageProvider"); -dojo.require("dojox.storage.manager"); -dojo.require("dojox.storage.Provider"); - -if (dojo.isAIR) { - (function(){ - - if (!air) { - var air = {}; - } - air.File = window.runtime.flash.filesystem.File; - air.SQLConnection = window.runtime.flash.data.SQLConnection; - air.SQLStatement = window.runtime.flash.data.SQLStatement; - - // summary: - // Storage provider that uses features in the Adobe AIR runtime to achieve - // permanent storage - dojo.declare("dojox.storage.AirDBStorageProvider", [ dojox.storage.Provider ], { - DATABASE_FILE: "dojo.db", - TABLE_NAME: "__DOJO_STORAGE", - initialized: false, - - _db: null, - - initialize: function(){ - this.initialized = false; - - // need to initialize our storage database - try{ - this._db = new air.SQLConnection(); - this._db.open(air.File.applicationStorageDirectory.resolvePath(this.DATABASE_FILE)); - - this._sql("CREATE TABLE IF NOT EXISTS " + this.TABLE_NAME + "(namespace TEXT, key TEXT, value TEXT)"); - this._sql("CREATE UNIQUE INDEX IF NOT EXISTS namespace_key_index ON " + this.TABLE_NAME + " (namespace, key)"); - - this.initialized = true; - }catch(e){ - console.debug("dojox.storage.AirDBStorageProvider.initialize:", e); - } - - // indicate that this storage provider is now loaded - dojox.storage.manager.loaded(); - }, - - _sql: function(query, params){ - var stmt = new air.SQLStatement(); - stmt.sqlConnection = this._db; - stmt.text = query; - if (params){ - for (var param in params){ - stmt.parameters[param] = params[param]; - } - } - stmt.execute(); - return stmt.getResult(); - }, - - _beginTransaction: function(){ - this._db.begin(); - }, - - _commitTransaction: function(){ - this._db.commit(); - }, - - isAvailable: function(){ - return true; - }, - - put: function(key, value, resultsHandler, namespace){ - if(this.isValidKey(key) == false){ - throw new Error("Invalid key given: " + key); - } - namespace = namespace||this.DEFAULT_NAMESPACE; - if(this.isValidKey(namespace) == false){ - throw new Error("Invalid namespace given: " + namespace); - } - - // try to store the value - try{ - this._sql("DELETE FROM " + this.TABLE_NAME + " WHERE namespace = :namespace AND key = :key", - { ":namespace":namespace, ":key":key }); - this._sql("INSERT INTO " + this.TABLE_NAME + " VALUES (:namespace, :key, :value)", - { ":namespace":namespace, ":key":key, ":value":value }); - }catch(e){ - // indicate we failed - console.debug("dojox.storage.AirDBStorageProvider.put:", e); - resultsHandler(this.FAILED, key, e.toString()); - return; - } - - if(resultsHandler){ - resultsHandler(this.SUCCESS, key, null); - } - }, - - get: function(key, namespace){ - if(this.isValidKey(key) == false){ - throw new Error("Invalid key given: " + key); - } - namespace = namespace||this.DEFAULT_NAMESPACE; - - var results = this._sql("SELECT * FROM " + this.TABLE_NAME + " WHERE namespace = :namespace AND key = :key", - { ":namespace":namespace, ":key":key }); - - if(results.data && results.data.length){ - return results.data[0].value; - } - - return null; - }, - - getNamespaces: function(){ - var results = [ this.DEFAULT_NAMESPACE ]; - var rs = this._sql("SELECT namespace FROM " + this.TABLE_NAME + " DESC GROUP BY namespace"); - if (rs.data){ - for(var i = 0; i < rs.data.length; i++){ - if(rs.data[i].namespace != this.DEFAULT_NAMESPACE){ - results.push(rs.data[i].namespace); - } - } - } - return results; - }, - - getKeys: function(namespace){ - namespace = namespace||this.DEFAULT_NAMESPACE; - if(this.isValidKey(namespace) == false){ - throw new Error("Invalid namespace given: " + namespace); - } - - var results = []; - var rs = this._sql("SELECT key FROM " + this.TABLE_NAME + " WHERE namespace = :namespace", { ":namespace":namespace }); - if (rs.data){ - for(var i = 0; i < rs.data.length; i++){ - results.push(rs.data[i].key); - } - } - return results; - }, - - clear: function(namespace){ - if(this.isValidKey(namespace) == false){ - throw new Error("Invalid namespace given: " + namespace); - } - this._sql("DELETE FROM " + this.TABLE_NAME + " WHERE namespace = :namespace", { ":namespace":namespace }); - }, - - remove: function(key, namespace){ - namespace = namespace||this.DEFAULT_NAMESPACE; - this._sql("DELETE FROM " + this.TABLE_NAME + " WHERE namespace = :namespace AND key = :key", - { ":namespace":namespace, ":key":key }); - }, - - putMultiple: function(keys, values, resultsHandler, namespace) { - if(this.isValidKeyArray(keys) === false - || ! values instanceof Array - || keys.length != values.length){ - throw new Error("Invalid arguments: keys = [" + keys + "], values = [" + values + "]"); - } - - if(namespace == null || typeof namespace == "undefined"){ - namespace = this.DEFAULT_NAMESPACE; - } - - if(this.isValidKey(namespace) == false){ - throw new Error("Invalid namespace given: " + namespace); - } - - this._statusHandler = resultsHandler; - - // try to store the value - try{ - this._beginTransaction(); - for(var i=0;i 0 : Wait until 'newDelay' ms have passed without any "put" request to flush - // -1 : Do not automatically flush - setFlushDelay: function(newDelay){ - if(newDelay === null || typeof newDelay === "undefined" || isNaN(newDelay)){ - throw new Error("Invalid argunment: " + newDelay); - } - - dojox.flash.comm.setFlushDelay(String(newDelay)); - }, - - getFlushDelay: function(){ - return Number(dojox.flash.comm.getFlushDelay()); - }, - - flush: function(namespace){ - //FIXME: is this test necessary? Just use !namespace - if(namespace == null || typeof namespace == "undefined"){ - namespace = dojox.storage.DEFAULT_NAMESPACE; - } - dojox.flash.comm.flush(namespace); - }, - - isAvailable: function(){ - return (this._available = !dojo.config["disableFlashStorage"]); - }, - - put: function(key, value, resultsHandler, namespace){ - if(!this.isValidKey(key)){ - throw new Error("Invalid key given: " + key); - } - - if(!namespace){ - namespace = dojox.storage.DEFAULT_NAMESPACE; - } - - if(!this.isValidKey(namespace)){ - throw new Error("Invalid namespace given: " + namespace); - } - - this._statusHandler = resultsHandler; - - // serialize the value; - // handle strings differently so they have better performance - if(dojo.isString(value)){ - value = "string:" + value; - }else{ - value = dojo.toJson(value); - } - - dojox.flash.comm.put(key, value, namespace); - }, - - putMultiple: function(keys, values, resultsHandler, namespace){ - if(!this.isValidKeyArray(keys) || ! values instanceof Array - || keys.length != values.length){ - throw new Error("Invalid arguments: keys = [" + keys + "], values = [" + values + "]"); - } - - if(!namespace){ - namespace = dojox.storage.DEFAULT_NAMESPACE; - } - - if(!this.isValidKey(namespace)){ - throw new Error("Invalid namespace given: " + namespace); - } - - this._statusHandler = resultsHandler; - - // Convert the arguments on strings we can pass along to Flash - var metaKey = keys.join(","); - var lengths = []; - for(var i=0;i