usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject [34/41] git commit: removing 2 more as-yet unused files
Date Tue, 11 Feb 2014 23:21:18 GMT
removing 2 more as-yet unused files


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/2ab8ec4d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/2ab8ec4d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/2ab8ec4d

Branch: refs/heads/master
Commit: 2ab8ec4d2f69bf4b35ddf5087c47009078b404c5
Parents: 0dc6c70
Author: ryan bridges <rbridges@apigee.com>
Authored: Tue Feb 11 11:15:32 2014 -0500
Committer: ryan bridges <rbridges@apigee.com>
Committed: Tue Feb 11 11:15:32 2014 -0500

----------------------------------------------------------------------
 sdks/html5-javascript/Gruntfile.js              |   2 -
 sdks/html5-javascript/lib/modules/util/Event.js |  33 -----
 .../lib/modules/util/Storable.js                |  88 -------------
 sdks/html5-javascript/usergrid.js               | 132 -------------------
 sdks/html5-javascript/usergrid.min.js           |   4 +-
 5 files changed, 2 insertions(+), 257 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2ab8ec4d/sdks/html5-javascript/Gruntfile.js
----------------------------------------------------------------------
diff --git a/sdks/html5-javascript/Gruntfile.js b/sdks/html5-javascript/Gruntfile.js
index cfa39e3..d48a950 100644
--- a/sdks/html5-javascript/Gruntfile.js
+++ b/sdks/html5-javascript/Gruntfile.js
@@ -1,10 +1,8 @@
 module.exports = function(grunt) {
 	var files = [
-        "lib/modules/util/Event.js",
         "lib/modules/util/Logger.js",
         "lib/modules/util/Promise.js",
         "lib/modules/util/Ajax.js",
-        "lib/modules/util/Storable.js",
         "lib/Usergrid.js",
 		"lib/modules/Client.js",
 		"lib/modules/Entity.js",

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2ab8ec4d/sdks/html5-javascript/lib/modules/util/Event.js
----------------------------------------------------------------------
diff --git a/sdks/html5-javascript/lib/modules/util/Event.js b/sdks/html5-javascript/lib/modules/util/Event.js
deleted file mode 100644
index 146d03e..0000000
--- a/sdks/html5-javascript/lib/modules/util/Event.js
+++ /dev/null
@@ -1,33 +0,0 @@
-var UsergridEventable	= function(){
-    throw Error("'UsergridEventable' is not intended to be invoked directly")
-}
-UsergridEventable.prototype	= {
-    bind	: function(event, fn){
-        this._events = this._events || {};
-        this._events[event] = this._events[event]	|| [];
-        this._events[event].push(fn);
-    },
-    unbind	: function(event, fn){
-        this._events = this._events || {};
-        if( event in this._events === false  )	return;
-        this._events[event].splice(this._events[event].indexOf(fn), 1);
-    },
-    trigger	: function(event /* , args... */){
-        this._events = this._events || {};
-        if( event in this._events === false  )	return;
-        for(var i = 0; i < this._events[event].length; i++){
-            this._events[event][i].apply(this, Array.prototype.slice.call(arguments, 1))
-        }
-    }
-};
-UsergridEventable.mixin	= function(destObject){
-    var props	= ['bind', 'unbind', 'trigger'];
-    for(var i = 0; i < props.length; i ++){
-        if(props[i] in destObject.prototype){
-            console.warn("overwriting '"+props[i]+"' on '"+destObject.name+"'.");
-            console.warn("the previous version can be found at '_"+props[i]+"' on '"+destObject.name+"'.");
-            destObject.prototype['_'+props[i]]=destObject.prototype[props[i]];
-        }
-        destObject.prototype[props[i]]	= UsergridEventable.prototype[props[i]];
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2ab8ec4d/sdks/html5-javascript/lib/modules/util/Storable.js
----------------------------------------------------------------------
diff --git a/sdks/html5-javascript/lib/modules/util/Storable.js b/sdks/html5-javascript/lib/modules/util/Storable.js
deleted file mode 100644
index 5c4da2e..0000000
--- a/sdks/html5-javascript/lib/modules/util/Storable.js
+++ /dev/null
@@ -1,88 +0,0 @@
-function UsergridStorable(storage, keyPrefix){
-    //throw Error("'UsergridStorable' is not intended to be invoked directly")
-}
-UsergridStorable.prototype.setStorage = function(storage) {
-    if(!(storage instanceof Storage)){
-        console.warn("parameter passed to 'setStorage' is not a browser Storage interface.
using sessionStorage");
-        storage=sessionStorage;
-    }
-    return this._storage=storage;
-};
-UsergridStorable.prototype.getStorage = function() {
-    if(!(this._storage instanceof Storage)){
-        console.warn("parameter passed to 'setStorage' is not a browser Storage interface.
using sessionStorage");
-        this._storage=sessionStorage;
-    }
-    return this._storage;
-};
-UsergridStorable.prototype.getStorageKey = function(key) {
-    if(!this._keyPrefix)this._keyPrefix='usergrid_js_sdk_';
-    return this._keyPrefix+key;
-};
-UsergridStorable.prototype.get=function(key){
-    var value;
-    if(arguments.length>1){
-        key=[].slice.call(arguments).reduce(function(p,c,i,a){
-            if(c instanceof Array){
-                p= p.concat(c);
-            }else{
-                p.push(c);
-            }
-            return p;
-        },[]);
-    }
-    if(this._storage instanceof Storage){
-        if(key instanceof Array){
-            var self=this;
-            value=key.map(function(k){return self.get(k)});
-        }else if("undefined" !== typeof key){
-            this[key]=JSON.parse(this.getStorage().getItem(this.getStorageKey(key)));
-            value=this[key];
-        }
-    }
-    return value;
-}
-UsergridStorable.prototype.set=function(key, value){
-    if(this._storage instanceof Storage){
-        if(value){
-            this[key]=JSON.stringify(value);
-            this.getStorage().setItem(this.getStorageKey(key),this[key]);
-        }else{
-            delete this[key];
-            this.getStorage().removeItem(this.getStorageKey(key));
-        }
-    }
-}
-/*
- *  A public method to store the OAuth token for later use - uses localstorage if available
- *
- *  @method setToken
- *  @public
- *  @params {string} token
- *  @return none
- */
-UsergridStorable.prototype.setToken = function (token) {
-    return this.set('token', token);
-};
-
-/*
- *  A public method to get the OAuth token
- *
- *  @method getToken
- *  @public
- *  @return {string} token
- */
-UsergridStorable.prototype.getToken = function () {
-    return this.get('token');
-};
-UsergridStorable.mixin	= function(destObject){
-    var props	= ['getStorage', 'setStorage', 'getStorageKey', 'get', 'set', 'getToken', 'setToken'];
-    for(var i = 0; i < props.length; i ++){
-        if(props[i] in destObject.prototype){
-            console.warn("overwriting '"+props[i]+"' on '"+destObject.name+"'.");
-            console.warn("the previous version can be found at '_"+props[i]+"' on '"+destObject.name+"'.");
-            destObject.prototype['_'+props[i]]=destObject.prototype[props[i]];
-        }
-        destObject.prototype[props[i]]	= UsergridStorable.prototype[props[i]];
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2ab8ec4d/sdks/html5-javascript/usergrid.js
----------------------------------------------------------------------
diff --git a/sdks/html5-javascript/usergrid.js b/sdks/html5-javascript/usergrid.js
index ff83f6c..b8debdf 100644
--- a/sdks/html5-javascript/usergrid.js
+++ b/sdks/html5-javascript/usergrid.js
@@ -1,40 +1,4 @@
 /*! usergrid@0.0.0 2014-02-11 */
-var UsergridEventable = function() {
-    throw Error("'UsergridEventable' is not intended to be invoked directly");
-};
-
-UsergridEventable.prototype = {
-    bind: function(event, fn) {
-        this._events = this._events || {};
-        this._events[event] = this._events[event] || [];
-        this._events[event].push(fn);
-    },
-    unbind: function(event, fn) {
-        this._events = this._events || {};
-        if (event in this._events === false) return;
-        this._events[event].splice(this._events[event].indexOf(fn), 1);
-    },
-    trigger: function(event) {
-        this._events = this._events || {};
-        if (event in this._events === false) return;
-        for (var i = 0; i < this._events[event].length; i++) {
-            this._events[event][i].apply(this, Array.prototype.slice.call(arguments, 1));
-        }
-    }
-};
-
-UsergridEventable.mixin = function(destObject) {
-    var props = [ "bind", "unbind", "trigger" ];
-    for (var i = 0; i < props.length; i++) {
-        if (props[i] in destObject.prototype) {
-            console.warn("overwriting '" + props[i] + "' on '" + destObject.name + "'.");
-            console.warn("the previous version can be found at '_" + props[i] + "' on '"
+ destObject.name + "'.");
-            destObject.prototype["_" + props[i]] = destObject.prototype[props[i]];
-        }
-        destObject.prototype[props[i]] = UsergridEventable.prototype[props[i]];
-    }
-};
-
 //Logger
 (function() {
     var name = "Logger", global = this, overwrittenName = global[name], exports;
@@ -253,102 +217,6 @@ UsergridEventable.mixin = function(destObject) {
     return global[name];
 })();
 
-function UsergridStorable(storage, keyPrefix) {}
-
-UsergridStorable.prototype.setStorage = function(storage) {
-    if (!(storage instanceof Storage)) {
-        console.warn("parameter passed to 'setStorage' is not a browser Storage interface.
using sessionStorage");
-        storage = sessionStorage;
-    }
-    return this._storage = storage;
-};
-
-UsergridStorable.prototype.getStorage = function() {
-    if (!(this._storage instanceof Storage)) {
-        console.warn("parameter passed to 'setStorage' is not a browser Storage interface.
using sessionStorage");
-        this._storage = sessionStorage;
-    }
-    return this._storage;
-};
-
-UsergridStorable.prototype.getStorageKey = function(key) {
-    if (!this._keyPrefix) this._keyPrefix = "usergrid_js_sdk_";
-    return this._keyPrefix + key;
-};
-
-UsergridStorable.prototype.get = function(key) {
-    var value;
-    if (arguments.length > 1) {
-        key = [].slice.call(arguments).reduce(function(p, c, i, a) {
-            if (c instanceof Array) {
-                p = p.concat(c);
-            } else {
-                p.push(c);
-            }
-            return p;
-        }, []);
-    }
-    if (this._storage instanceof Storage) {
-        if (key instanceof Array) {
-            var self = this;
-            value = key.map(function(k) {
-                return self.get(k);
-            });
-        } else if ("undefined" !== typeof key) {
-            this[key] = JSON.parse(this.getStorage().getItem(this.getStorageKey(key)));
-            value = this[key];
-        }
-    }
-    return value;
-};
-
-UsergridStorable.prototype.set = function(key, value) {
-    if (this._storage instanceof Storage) {
-        if (value) {
-            this[key] = JSON.stringify(value);
-            this.getStorage().setItem(this.getStorageKey(key), this[key]);
-        } else {
-            delete this[key];
-            this.getStorage().removeItem(this.getStorageKey(key));
-        }
-    }
-};
-
-/*
- *  A public method to store the OAuth token for later use - uses localstorage if available
- *
- *  @method setToken
- *  @public
- *  @params {string} token
- *  @return none
- */
-UsergridStorable.prototype.setToken = function(token) {
-    return this.set("token", token);
-};
-
-/*
- *  A public method to get the OAuth token
- *
- *  @method getToken
- *  @public
- *  @return {string} token
- */
-UsergridStorable.prototype.getToken = function() {
-    return this.get("token");
-};
-
-UsergridStorable.mixin = function(destObject) {
-    var props = [ "getStorage", "setStorage", "getStorageKey", "get", "set", "getToken",
"setToken" ];
-    for (var i = 0; i < props.length; i++) {
-        if (props[i] in destObject.prototype) {
-            console.warn("overwriting '" + props[i] + "' on '" + destObject.name + "'.");
-            console.warn("the previous version can be found at '_" + props[i] + "' on '"
+ destObject.name + "'.");
-            destObject.prototype["_" + props[i]] = destObject.prototype[props[i]];
-        }
-        destObject.prototype[props[i]] = UsergridStorable.prototype[props[i]];
-    }
-};
-
 /*
  *  This module is a collection of classes designed to make working with
  *  the Appigee App Services API as easy as possible.


Mime
View raw message