Merge branch 'master' of https://github.com/jonatkins/ingress-intel-total-conversion
This commit is contained in:
commit
4c85482c80
@ -43,7 +43,7 @@ window.plugin.sync.dialogHTML = null;
|
|||||||
window.plugin.sync.authorizer = null;
|
window.plugin.sync.authorizer = null;
|
||||||
|
|
||||||
// Store registered CollaborativeMap
|
// Store registered CollaborativeMap
|
||||||
window.plugin.sync.registerdPluginsFields = null;
|
window.plugin.sync.registeredPluginsFields = null;
|
||||||
window.plugin.sync.logger = null;
|
window.plugin.sync.logger = null;
|
||||||
|
|
||||||
// Other plugin call this function to push update to Google Realtime API
|
// Other plugin call this function to push update to Google Realtime API
|
||||||
@ -51,7 +51,7 @@ window.plugin.sync.logger = null;
|
|||||||
// plugin.sync.updateMap('keys', 'keysdata', ['guid1', 'guid2', 'guid3'])
|
// plugin.sync.updateMap('keys', 'keysdata', ['guid1', 'guid2', 'guid3'])
|
||||||
// Which will push plugin.keys.keysdata['guid1'] etc. to Google Realtime API
|
// Which will push plugin.keys.keysdata['guid1'] etc. to Google Realtime API
|
||||||
window.plugin.sync.updateMap = function(pluginName, fieldName, keyArray) {
|
window.plugin.sync.updateMap = function(pluginName, fieldName, keyArray) {
|
||||||
var registeredMap = plugin.sync.registerdPluginsFields.get(pluginName, fieldName);
|
var registeredMap = plugin.sync.registeredPluginsFields.get(pluginName, fieldName);
|
||||||
if(!registeredMap) return false;
|
if(!registeredMap) return false;
|
||||||
registeredMap.updateMap(keyArray);
|
registeredMap.updateMap(keyArray);
|
||||||
}
|
}
|
||||||
@ -79,7 +79,7 @@ window.plugin.sync.registerMapForSync = function(pluginName, fieldName, callback
|
|||||||
'authorizer': plugin.sync.authorizer,
|
'authorizer': plugin.sync.authorizer,
|
||||||
'uuid': plugin.sync.uuid};
|
'uuid': plugin.sync.uuid};
|
||||||
registeredMap = new plugin.sync.RegisteredMap(options);
|
registeredMap = new plugin.sync.RegisteredMap(options);
|
||||||
plugin.sync.registerdPluginsFields.add(registeredMap);
|
plugin.sync.registeredPluginsFields.add(registeredMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -264,16 +264,16 @@ window.plugin.sync.RegisteredMap.prototype.stopSync = function() {
|
|||||||
this.lastUpdateUUID = null;
|
this.lastUpdateUUID = null;
|
||||||
this.initializing = false;
|
this.initializing = false;
|
||||||
this.initialized = false;
|
this.initialized = false;
|
||||||
plugin.sync.registerdPluginsFields.addToWaitingInitialize(this.pluginName, this.fieldName);
|
plugin.sync.registeredPluginsFields.addToWaitingInitialize(this.pluginName, this.fieldName);
|
||||||
}
|
}
|
||||||
//// end RegisteredMap
|
//// end RegisteredMap
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//// RegisterdPluginsFields
|
//// RegisteredPluginsFields
|
||||||
// Store RegisteredMap and handle initialization of RegisteredMap
|
// Store RegisteredMap and handle initialization of RegisteredMap
|
||||||
window.plugin.sync.RegisterdPluginsFields = function(options) {
|
window.plugin.sync.RegisteredPluginsFields = function(options) {
|
||||||
this.authorizer = options['authorizer'];
|
this.authorizer = options['authorizer'];
|
||||||
this.pluginsfields = {};
|
this.pluginsfields = {};
|
||||||
this.waitingInitialize = {};
|
this.waitingInitialize = {};
|
||||||
@ -287,7 +287,7 @@ window.plugin.sync.RegisterdPluginsFields = function(options) {
|
|||||||
this.authorizer.addAuthCallback(this.initializeRegistered);
|
this.authorizer.addAuthCallback(this.initializeRegistered);
|
||||||
}
|
}
|
||||||
|
|
||||||
window.plugin.sync.RegisterdPluginsFields.prototype.add = function(registeredMap) {
|
window.plugin.sync.RegisteredPluginsFields.prototype.add = function(registeredMap) {
|
||||||
var pluginName, fieldName;
|
var pluginName, fieldName;
|
||||||
pluginName = registeredMap.pluginName;
|
pluginName = registeredMap.pluginName;
|
||||||
fieldName = registeredMap.fieldName;
|
fieldName = registeredMap.fieldName;
|
||||||
@ -301,7 +301,7 @@ window.plugin.sync.RegisterdPluginsFields.prototype.add = function(registeredMap
|
|||||||
this.initializeWorker();
|
this.initializeWorker();
|
||||||
}
|
}
|
||||||
|
|
||||||
window.plugin.sync.RegisterdPluginsFields.prototype.addToWaitingInitialize = function(pluginName, fieldName) {
|
window.plugin.sync.RegisteredPluginsFields.prototype.addToWaitingInitialize = function(pluginName, fieldName) {
|
||||||
var registeredMap, _this;
|
var registeredMap, _this;
|
||||||
_this = this;
|
_this = this;
|
||||||
|
|
||||||
@ -314,12 +314,12 @@ window.plugin.sync.RegisterdPluginsFields.prototype.addToWaitingInitialize = fun
|
|||||||
plugin.sync.logger.log('Retry in 10 sec.: ' + pluginName + '[' + fieldName + ']');
|
plugin.sync.logger.log('Retry in 10 sec.: ' + pluginName + '[' + fieldName + ']');
|
||||||
}
|
}
|
||||||
|
|
||||||
window.plugin.sync.RegisterdPluginsFields.prototype.get = function(pluginName, fieldName) {
|
window.plugin.sync.RegisteredPluginsFields.prototype.get = function(pluginName, fieldName) {
|
||||||
if(!this.pluginsfields[pluginName]) return;
|
if(!this.pluginsfields[pluginName]) return;
|
||||||
return this.pluginsfields[pluginName][fieldName];
|
return this.pluginsfields[pluginName][fieldName];
|
||||||
}
|
}
|
||||||
|
|
||||||
window.plugin.sync.RegisterdPluginsFields.prototype.initializeRegistered = function() {
|
window.plugin.sync.RegisteredPluginsFields.prototype.initializeRegistered = function() {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
if(this.authorizer.isAuthed()) {
|
if(this.authorizer.isAuthed()) {
|
||||||
$.each(this.waitingInitialize, function(key, map) {
|
$.each(this.waitingInitialize, function(key, map) {
|
||||||
@ -330,7 +330,7 @@ window.plugin.sync.RegisterdPluginsFields.prototype.initializeRegistered = funct
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
window.plugin.sync.RegisterdPluginsFields.prototype.cleanWaitingInitialize = function() {
|
window.plugin.sync.RegisteredPluginsFields.prototype.cleanWaitingInitialize = function() {
|
||||||
var newWaitingInitialize, _this;
|
var newWaitingInitialize, _this;
|
||||||
_this = this;
|
_this = this;
|
||||||
|
|
||||||
@ -343,7 +343,7 @@ window.plugin.sync.RegisterdPluginsFields.prototype.cleanWaitingInitialize = fun
|
|||||||
this.waitingInitialize = newWaitingInitialize;
|
this.waitingInitialize = newWaitingInitialize;
|
||||||
}
|
}
|
||||||
|
|
||||||
window.plugin.sync.RegisterdPluginsFields.prototype.initializeWorker = function() {
|
window.plugin.sync.RegisteredPluginsFields.prototype.initializeWorker = function() {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
|
|
||||||
this.cleanWaitingInitialize();
|
this.cleanWaitingInitialize();
|
||||||
@ -355,7 +355,7 @@ window.plugin.sync.RegisterdPluginsFields.prototype.initializeWorker = function(
|
|||||||
this.timer = setTimeout(function() {_this.initializeWorker()}, 10000);
|
this.timer = setTimeout(function() {_this.initializeWorker()}, 10000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//// end RegisterdPluginsFields
|
//// end RegisteredPluginsFields
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -691,7 +691,7 @@ window.plugin.sync.toggleAuthButton = function() {
|
|||||||
window.plugin.sync.toggleDialogLink = function() {
|
window.plugin.sync.toggleDialogLink = function() {
|
||||||
var authed, anyFail;
|
var authed, anyFail;
|
||||||
authed = plugin.sync.authorizer.isAuthed();
|
authed = plugin.sync.authorizer.isAuthed();
|
||||||
anyFail = plugin.sync.registerdPluginsFields.anyFail;
|
anyFail = plugin.sync.registeredPluginsFields.anyFail;
|
||||||
|
|
||||||
$('#sync-show-dialog').toggleClass('sync-show-dialog-error', !authed || anyFail);
|
$('#sync-show-dialog').toggleClass('sync-show-dialog-error', !authed || anyFail);
|
||||||
}
|
}
|
||||||
@ -742,7 +742,7 @@ var setup = function() {
|
|||||||
window.plugin.sync.authorizer = new window.plugin.sync.Authorizer({
|
window.plugin.sync.authorizer = new window.plugin.sync.Authorizer({
|
||||||
'authCallback': [plugin.sync.toggleAuthButton, plugin.sync.toggleDialogLink]
|
'authCallback': [plugin.sync.toggleAuthButton, plugin.sync.toggleDialogLink]
|
||||||
});
|
});
|
||||||
window.plugin.sync.registerdPluginsFields = new window.plugin.sync.RegisterdPluginsFields({
|
window.plugin.sync.registeredPluginsFields = new window.plugin.sync.RegisteredPluginsFields({
|
||||||
'authorizer': window.plugin.sync.authorizer
|
'authorizer': window.plugin.sync.authorizer
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user