mirror of
https://github.com/Mibew/mibew.git
synced 2025-03-23 02:21:23 +03:00
Add all missed semicolons to JS app
Yes, I know about ASI and that the simicolons are not actually needed in most cases, but I belive the code looks better when semicolons are in places.
This commit is contained in:
parent
cb3bd91b76
commit
13dd999158
@ -119,7 +119,7 @@
|
|||||||
eventArgs = {
|
eventArgs = {
|
||||||
'messageData': messageData,
|
'messageData': messageData,
|
||||||
'model': false
|
'model': false
|
||||||
}
|
};
|
||||||
|
|
||||||
// Trigger event. See description of eventName and eventArgs
|
// Trigger event. See description of eventName and eventArgs
|
||||||
// above.
|
// above.
|
||||||
|
@ -59,7 +59,7 @@
|
|||||||
return {
|
return {
|
||||||
page: models.page.toJSON(),
|
page: models.page.toJSON(),
|
||||||
user: models.user.toJSON()
|
user: models.user.toJSON()
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -51,7 +51,7 @@
|
|||||||
serializeData: function() {
|
serializeData: function() {
|
||||||
return {
|
return {
|
||||||
page: Mibew.Objects.Models.page.toJSON()
|
page: Mibew.Objects.Models.page.toJSON()
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -50,7 +50,7 @@
|
|||||||
serializeData: function() {
|
serializeData: function() {
|
||||||
return {
|
return {
|
||||||
page: Mibew.Objects.Models.page.toJSON()
|
page: Mibew.Objects.Models.page.toJSON()
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -40,6 +40,6 @@ MibewAPIChatInteraction = function() {
|
|||||||
return [
|
return [
|
||||||
'result'
|
'result'
|
||||||
];
|
];
|
||||||
}
|
};
|
||||||
}
|
};
|
||||||
MibewAPIChatInteraction.prototype = new MibewAPIInteraction();
|
MibewAPIChatInteraction.prototype = new MibewAPIInteraction();
|
@ -48,7 +48,7 @@
|
|||||||
* Move to secure chat
|
* Move to secure chat
|
||||||
*/
|
*/
|
||||||
secure: function() {
|
secure: function() {
|
||||||
var link = this.model.get('link')
|
var link = this.model.get('link');
|
||||||
if (link) {
|
if (link) {
|
||||||
var style = Mibew.Objects.Models.page.get('style');
|
var style = Mibew.Objects.Models.page.get('style');
|
||||||
window.location.href = link.replace(/\&\;/g, '&')
|
window.location.href = link.replace(/\&\;/g, '&')
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
serializeData: function() {
|
serializeData: function() {
|
||||||
return {
|
return {
|
||||||
page: Mibew.Objects.Models.page.toJSON()
|
page: Mibew.Objects.Models.page.toJSON()
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -81,7 +81,7 @@
|
|||||||
|
|
||||||
// Update group id
|
// Update group id
|
||||||
if (this.model.get('groups')) {
|
if (this.model.get('groups')) {
|
||||||
values.groupId = this.ui.groupSelect.val()
|
values.groupId = this.ui.groupSelect.val();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update name
|
// Update name
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
serializeData: function() {
|
serializeData: function() {
|
||||||
return {
|
return {
|
||||||
page: Mibew.Objects.Models.page.toJSON()
|
page: Mibew.Objects.Models.page.toJSON()
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -58,7 +58,7 @@
|
|||||||
|
|
||||||
// Update group id
|
// Update group id
|
||||||
if (this.model.get('groups')) {
|
if (this.model.get('groups')) {
|
||||||
values.groupId = this.ui.groupSelect.val()
|
values.groupId = this.ui.groupSelect.val();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update name
|
// Update name
|
||||||
|
@ -60,7 +60,7 @@
|
|||||||
* @returns {String} Model type
|
* @returns {String} Model type
|
||||||
*/
|
*/
|
||||||
getModelType: function() {
|
getModelType: function() {
|
||||||
return 'SoundControl'
|
return 'SoundControl';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -53,7 +53,7 @@
|
|||||||
* @returns {String} Model type
|
* @returns {String} Model type
|
||||||
*/
|
*/
|
||||||
getModelType: function() {
|
getModelType: function() {
|
||||||
return 'StatusMessage'
|
return 'StatusMessage';
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -55,7 +55,7 @@
|
|||||||
* @returns {String} Model type
|
* @returns {String} Model type
|
||||||
*/
|
*/
|
||||||
getModelType: function() {
|
getModelType: function() {
|
||||||
return 'StatusTyping'
|
return 'StatusTyping';
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -225,7 +225,7 @@
|
|||||||
"user": (! user.get('isAgent'))
|
"user": (! user.get('isAgent'))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
];
|
||||||
},
|
},
|
||||||
function(args) {
|
function(args) {
|
||||||
// Check if there was an error
|
// Check if there was an error
|
||||||
@ -258,7 +258,7 @@
|
|||||||
// Restart server updater because module just started and there are no
|
// Restart server updater because module just started and there are no
|
||||||
// reasons to wait refresh time to get results of previous request
|
// reasons to wait refresh time to get results of previous request
|
||||||
Mibew.Objects.server.restartUpdater();
|
Mibew.Objects.server.restartUpdater();
|
||||||
})
|
});
|
||||||
|
|
||||||
// Add module finalizer
|
// Add module finalizer
|
||||||
chat.addFinalizer(function() {
|
chat.addFinalizer(function() {
|
||||||
|
@ -78,7 +78,7 @@
|
|||||||
"user": true
|
"user": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
];
|
||||||
},
|
},
|
||||||
function() {}
|
function() {}
|
||||||
)
|
)
|
||||||
@ -90,7 +90,7 @@
|
|||||||
// Restart server updater because module just started and there are no
|
// Restart server updater because module just started and there are no
|
||||||
// reasons to wait refresh time to get results of previous request
|
// reasons to wait refresh time to get results of previous request
|
||||||
Mibew.Objects.server.restartUpdater();
|
Mibew.Objects.server.restartUpdater();
|
||||||
})
|
});
|
||||||
|
|
||||||
// Add module finalizer
|
// Add module finalizer
|
||||||
invitation.addFinalizer(function() {
|
invitation.addFinalizer(function() {
|
||||||
|
@ -38,6 +38,6 @@
|
|||||||
// Just close the window.
|
// Just close the window.
|
||||||
window.close();
|
window.close();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
})(Mibew);
|
})(Mibew);
|
@ -62,7 +62,7 @@ var Mibew = Mibew || {};
|
|||||||
+ "path=/; "
|
+ "path=/; "
|
||||||
+ (domain ? ("domain=" + domain[1] + "; ") : '')
|
+ (domain ? ("domain=" + domain[1] + "; ") : '')
|
||||||
+ (expires ? ('expires=' + expires.toUTCString() + '; ') : '');
|
+ (expires ? ('expires=' + expires.toUTCString() + '; ') : '');
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Try to read cookie.
|
* Try to read cookie.
|
||||||
@ -82,7 +82,7 @@ var Mibew = Mibew || {};
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deletes cookie.
|
* Deletes cookie.
|
||||||
@ -91,7 +91,7 @@ var Mibew = Mibew || {};
|
|||||||
*/
|
*/
|
||||||
Mibew.Utils.deleteCookie = function(name) {
|
Mibew.Utils.deleteCookie = function(name) {
|
||||||
Mibew.Utils.createCookie(name, '', (new Date(0)));
|
Mibew.Utils.createCookie(name, '', (new Date(0)));
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets correct prototypes chain.
|
* Sets correct prototypes chain.
|
||||||
@ -119,7 +119,7 @@ var Mibew = Mibew || {};
|
|||||||
ctor.prototype = new Tmp();
|
ctor.prototype = new Tmp();
|
||||||
Tmp.prototype = null;
|
Tmp.prototype = null;
|
||||||
ctor.prototype.constructor = ctor;
|
ctor.prototype.constructor = ctor;
|
||||||
}
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -169,7 +169,7 @@ var Mibew = Mibew || {};
|
|||||||
document.getElementsByTagName('head')[0].appendChild(styleSheet);
|
document.getElementsByTagName('head')[0].appendChild(styleSheet);
|
||||||
|
|
||||||
return styleSheet;
|
return styleSheet;
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads JavaScript file and attach it to DOM.
|
* Loads JavaScript file and attach it to DOM.
|
||||||
@ -189,7 +189,7 @@ var Mibew = Mibew || {};
|
|||||||
document.getElementsByTagName('head')[0].appendChild(script);
|
document.getElementsByTagName('head')[0].appendChild(script);
|
||||||
|
|
||||||
return script;
|
return script;
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize a proper chat popup.
|
* Initialize a proper chat popup.
|
||||||
@ -205,7 +205,7 @@ var Mibew = Mibew || {};
|
|||||||
Popup = canUseIFrame ? Mibew.ChatPopup.IFrame : Mibew.ChatPopup.Window;
|
Popup = canUseIFrame ? Mibew.ChatPopup.IFrame : Mibew.ChatPopup.Window;
|
||||||
|
|
||||||
Mibew.Objects.ChatPopups[options.id] = new Popup(options);
|
Mibew.Objects.ChatPopups[options.id] = new Popup(options);
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A constructor for base (abstract) popup object.
|
* A constructor for base (abstract) popup object.
|
||||||
@ -260,7 +260,7 @@ var Mibew = Mibew || {};
|
|||||||
* @type {Boolean}
|
* @type {Boolean}
|
||||||
*/
|
*/
|
||||||
this.modSecurity = options.modSecurity || false;
|
this.modSecurity = options.modSecurity || false;
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Builds an URL that initializes a chat.
|
* Builds an URL that initializes a chat.
|
||||||
@ -279,7 +279,7 @@ var Mibew = Mibew || {};
|
|||||||
return this.url
|
return this.url
|
||||||
+ ((this.url.indexOf('?') === -1) ? '?' : '&') + 'url=' + encodeURIComponent(href)
|
+ ((this.url.indexOf('?') === -1) ? '?' : '&') + 'url=' + encodeURIComponent(href)
|
||||||
+ '&referrer=' + encodeURIComponent(referrer);
|
+ '&referrer=' + encodeURIComponent(referrer);
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs IFrame popup.
|
* Constructs IFrame popup.
|
||||||
@ -317,7 +317,7 @@ var Mibew = Mibew || {};
|
|||||||
// new page is visited.
|
// new page is visited.
|
||||||
this.open(openedChatUrl);
|
this.open(openedChatUrl);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
// Set correct prototype chain for IFrame popup.
|
// Set correct prototype chain for IFrame popup.
|
||||||
Mibew.Utils.inherits(Mibew.ChatPopup.IFrame, BasePopup);
|
Mibew.Utils.inherits(Mibew.ChatPopup.IFrame, BasePopup);
|
||||||
@ -386,7 +386,7 @@ var Mibew = Mibew || {};
|
|||||||
this.iframe.style.display = 'block';
|
this.iframe.style.display = 'block';
|
||||||
this.iframe.src = url || this.buildChatUrl();
|
this.iframe.src = url || this.buildChatUrl();
|
||||||
this.isOpened = true;
|
this.isOpened = true;
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Closes the popup.
|
* Closes the popup.
|
||||||
@ -401,7 +401,7 @@ var Mibew = Mibew || {};
|
|||||||
this.iframe.src = '';
|
this.iframe.src = '';
|
||||||
this.isOpened = false;
|
this.isOpened = false;
|
||||||
Mibew.Utils.deleteCookie('mibew-chat-frame-' + this.id);
|
Mibew.Utils.deleteCookie('mibew-chat-frame-' + this.id);
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs Window popup.
|
* Constructs Window popup.
|
||||||
@ -414,7 +414,7 @@ var Mibew = Mibew || {};
|
|||||||
BasePopup.call(this, options);
|
BasePopup.call(this, options);
|
||||||
|
|
||||||
this.window = null;
|
this.window = null;
|
||||||
}
|
};
|
||||||
|
|
||||||
// Set correct prototype chain for Window popup.
|
// Set correct prototype chain for Window popup.
|
||||||
Mibew.Utils.inherits(Mibew.ChatPopup.Window, BasePopup);
|
Mibew.Utils.inherits(Mibew.ChatPopup.Window, BasePopup);
|
||||||
@ -433,7 +433,7 @@ var Mibew = Mibew || {};
|
|||||||
);
|
);
|
||||||
this.window.focus();
|
this.window.focus();
|
||||||
this.window.opener = window;
|
this.window.opener = window;
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Closes the popup.
|
* Closes the popup.
|
||||||
@ -446,7 +446,7 @@ var Mibew = Mibew || {};
|
|||||||
|
|
||||||
this.window.close();
|
this.window.close();
|
||||||
this.window = null;
|
this.window = null;
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Builds window params string.
|
* Builds window params string.
|
||||||
@ -468,7 +468,7 @@ var Mibew = Mibew || {};
|
|||||||
'height=' + this.height.toString(),
|
'height=' + this.height.toString(),
|
||||||
'resizable=' + (this.resizable ? '1' : '0')
|
'resizable=' + (this.resizable ? '1' : '0')
|
||||||
].join(',');
|
].join(',');
|
||||||
}
|
};
|
||||||
|
|
||||||
// Attach a listener to window's "message" event to get the url of the chat
|
// Attach a listener to window's "message" event to get the url of the chat
|
||||||
// which is opened in iframe popup.
|
// which is opened in iframe popup.
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
} else {
|
} else {
|
||||||
return new ChildViewType(options);
|
return new ChildViewType(options);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @class Represents base collection view
|
* @class Represents base collection view
|
||||||
|
@ -26,7 +26,7 @@ var Mibew = {};
|
|||||||
// Use Backbone.Marionette with handlebars.js
|
// Use Backbone.Marionette with handlebars.js
|
||||||
Backbone.Marionette.TemplateCache.prototype.compileTemplate = function(rawTemplate) {
|
Backbone.Marionette.TemplateCache.prototype.compileTemplate = function(rawTemplate) {
|
||||||
return Handlebars.compile(rawTemplate);
|
return Handlebars.compile(rawTemplate);
|
||||||
}
|
};
|
||||||
|
|
||||||
// Use all handlebars template as partials too
|
// Use all handlebars template as partials too
|
||||||
// We does not use Handlebars.partials property because of it can be changed
|
// We does not use Handlebars.partials property because of it can be changed
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
return localized.replace(/\{([0-9]+)\}/g, function(match, index) {
|
return localized.replace(/\{([0-9]+)\}/g, function(match, index) {
|
||||||
return placeholders[parseInt(index)] || '';
|
return placeholders[parseInt(index)] || '';
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Store localization object. Can be call multiple times, localization
|
* Store localization object. Can be call multiple times, localization
|
||||||
@ -56,6 +56,6 @@
|
|||||||
*/
|
*/
|
||||||
Mibew.Localization.set = function(strs) {
|
Mibew.Localization.set = function(strs) {
|
||||||
_.extend(localStrings, strs);
|
_.extend(localStrings, strs);
|
||||||
}
|
};
|
||||||
|
|
||||||
})(Mibew, _);
|
})(Mibew, _);
|
@ -74,7 +74,7 @@
|
|||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
'class': classes.join(' ')
|
'class': classes.join(' ')
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -92,7 +92,7 @@
|
|||||||
* @type Object
|
* @type Object
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.functions = {}
|
this.functions = {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Id of the last registered function
|
* Id of the last registered function
|
||||||
@ -107,7 +107,7 @@
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.mibewAPI = new MibewAPI(new this.options['interactionType']());
|
this.mibewAPI = new MibewAPI(new this.options['interactionType']());
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Make call to the server
|
* Make call to the server
|
||||||
@ -148,7 +148,7 @@
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Call function at every request to build functions list
|
* Call function at every request to build functions list
|
||||||
@ -165,7 +165,7 @@
|
|||||||
callbackFunction: callbackFunction
|
callbackFunction: callbackFunction
|
||||||
};
|
};
|
||||||
return this.callPeriodicallyLastId;
|
return this.callPeriodicallyLastId;
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stop calling function at every request.
|
* Stop calling function at every request.
|
||||||
@ -177,7 +177,7 @@
|
|||||||
if (id in this.callPeriodically) {
|
if (id in this.callPeriodically) {
|
||||||
delete this.callPeriodically[id];
|
delete this.callPeriodically[id];
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generates unique request token
|
* Generates unique request token
|
||||||
@ -195,7 +195,7 @@
|
|||||||
// Check token uniqueness
|
// Check token uniqueness
|
||||||
} while(token in this.callbacks);
|
} while(token in this.callbacks);
|
||||||
return token;
|
return token;
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Process request
|
* Process request
|
||||||
@ -236,7 +236,7 @@
|
|||||||
delete this.callbacks[requestObject.token];
|
delete this.callbacks[requestObject.token];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Process function
|
* Process function
|
||||||
@ -266,7 +266,7 @@
|
|||||||
|
|
||||||
// Add function results to the execution context
|
// Add function results to the execution context
|
||||||
context.storeFunctionResults(functionObject, results);
|
context.storeFunctionResults(functionObject, results);
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send the request to the server
|
* Send the request to the server
|
||||||
@ -291,14 +291,14 @@
|
|||||||
success: _.bind(self.receiveResponse, self),
|
success: _.bind(self.receiveResponse, self),
|
||||||
error: _.bind(self.onError, self)
|
error: _.bind(self.onError, self)
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Start automatic updater
|
* Start automatic updater
|
||||||
*/
|
*/
|
||||||
Mibew.Server.prototype.runUpdater = function() {
|
Mibew.Server.prototype.runUpdater = function() {
|
||||||
this.update();
|
this.update();
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Call Mibew.Server.update after specified timeout
|
* Call Mibew.Server.update after specified timeout
|
||||||
@ -310,7 +310,7 @@
|
|||||||
_.bind(this.update, this),
|
_.bind(this.update, this),
|
||||||
time * 1000
|
time * 1000
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Restarts the automatic updater
|
* Restarts the automatic updater
|
||||||
@ -326,7 +326,7 @@
|
|||||||
}
|
}
|
||||||
// Restart updater. Try to reconnect after a while
|
// Restart updater. Try to reconnect after a while
|
||||||
this.updateAfter(this.options.reconnectPause);
|
this.updateAfter(this.options.reconnectPause);
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send request to server
|
* Send request to server
|
||||||
@ -360,7 +360,7 @@
|
|||||||
// Handle errors
|
// Handle errors
|
||||||
this.options.onUpdateError(e);
|
this.options.onUpdateError(e);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Process response from the Server
|
* Process response from the Server
|
||||||
@ -385,7 +385,7 @@
|
|||||||
} finally {
|
} finally {
|
||||||
this.updateAfter(this.options.requestsFrequency);
|
this.updateAfter(this.options.requestsFrequency);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add function that can be called by the Server
|
* Add function that can be called by the Server
|
||||||
@ -401,7 +401,7 @@
|
|||||||
}
|
}
|
||||||
this.functions[functionName][this.functionsLastId] = handler;
|
this.functions[functionName][this.functionsLastId] = handler;
|
||||||
return this.functionsLastId;
|
return this.functionsLastId;
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove function that can be called by Server
|
* Remove function that can be called by Server
|
||||||
@ -421,7 +421,7 @@
|
|||||||
delete this.functions[i];
|
delete this.functions[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Call on AJAX errors
|
* Call on AJAX errors
|
||||||
@ -440,6 +440,6 @@
|
|||||||
this.options.onTransportError();
|
this.options.onTransportError();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
})(Mibew, MibewAPI, $, _);
|
})(Mibew, MibewAPI, $, _);
|
@ -36,7 +36,7 @@
|
|||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
return str.substring(0, 1).toUpperCase() + str.substring(1);
|
return str.substring(0, 1).toUpperCase() + str.substring(1);
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cast string in camel case to dash format.
|
* Cast string in camel case to dash format.
|
||||||
@ -61,7 +61,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
return parts.join('-');
|
return parts.join('-');
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if email address valid or not.
|
* Check if email address valid or not.
|
||||||
@ -99,7 +99,7 @@
|
|||||||
// The regular exprassion is base on RFC 2822. It's not fully compatible
|
// The regular exprassion is base on RFC 2822. It's not fully compatible
|
||||||
// with RFC but is sutabe for most real cases.
|
// with RFC but is sutabe for most real cases.
|
||||||
return /^(([a-zA-Z0-9!#$%&'*+\-/=?\^_`{|}~]+(\.[a-zA-Z0-9!#$%&'*+\-/=?\^_`{|}~]+)*)|(\".+\"))$/.test(localPart);
|
return /^(([a-zA-Z0-9!#$%&'*+\-/=?\^_`{|}~]+(\.[a-zA-Z0-9!#$%&'*+\-/=?\^_`{|}~]+)*)|(\".+\"))$/.test(localPart);
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Play .wav or .mp3 sound file
|
* Play .wav or .mp3 sound file
|
||||||
@ -121,7 +121,7 @@
|
|||||||
audioTag.attr('data-file', file);
|
audioTag.attr('data-file', file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Builds params string for window.open method.
|
* Builds params string for window.open method.
|
||||||
@ -150,7 +150,7 @@
|
|||||||
'height=' + allOptions.height,
|
'height=' + allOptions.height,
|
||||||
'resizable=' + (allOptions.resizable ? '1' : '0')
|
'resizable=' + (allOptions.resizable ? '1' : '0')
|
||||||
].join(',');
|
].join(',');
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets default options for Vex dialogs.
|
* Sets default options for Vex dialogs.
|
||||||
@ -170,7 +170,7 @@
|
|||||||
*/
|
*/
|
||||||
var isVexOpened = function () {
|
var isVexOpened = function () {
|
||||||
return (vex.getAllVexes().length > 0);
|
return (vex.getAllVexes().length > 0);
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Alerts a message.
|
* Alerts a message.
|
||||||
@ -183,7 +183,7 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
vex.dialog.alert({message: message});
|
vex.dialog.alert({message: message});
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Requires user confirmation.
|
* Requires user confirmation.
|
||||||
@ -198,7 +198,7 @@
|
|||||||
message: message,
|
message: message,
|
||||||
callback: callback
|
callback: callback
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Requests some info from the user.
|
* Requests some info from the user.
|
||||||
@ -213,6 +213,6 @@
|
|||||||
message: message,
|
message: message,
|
||||||
callback: callback
|
callback: callback
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
})(Mibew, jQuery, _, vex, validator);
|
})(Mibew, jQuery, _, vex, validator);
|
@ -104,7 +104,7 @@ MibewAPI.prototype.checkFunction = function(functionObject, filterReservedFuncti
|
|||||||
functionObject["function"] + "' function"
|
functionObject["function"] + "' function"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validate request
|
* Validate request
|
||||||
@ -138,7 +138,7 @@ MibewAPI.prototype.checkRequest = function(requestObject) {
|
|||||||
for (var i = 0; i < requestObject.functions.length; i++) {
|
for (var i = 0; i < requestObject.functions.length; i++) {
|
||||||
this.checkFunction(requestObject.functions[i]);
|
this.checkFunction(requestObject.functions[i]);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validate package.
|
* Validate package.
|
||||||
@ -181,7 +181,7 @@ MibewAPI.prototype.checkPackage = function (packageObject) {
|
|||||||
for (var i = 0; i < packageObject.requests.length; i++) {
|
for (var i = 0; i < packageObject.requests.length; i++) {
|
||||||
this.checkRequest(packageObject.requests[i]);
|
this.checkRequest(packageObject.requests[i]);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Search 'result' function in functionsList. If request contains more than
|
* Search 'result' function in functionsList. If request contains more than
|
||||||
@ -226,7 +226,7 @@ MibewAPI.prototype.getResultFunction = function(functionsList, existence){
|
|||||||
throw new Error("There is 'result' function in functions list");
|
throw new Error("There is 'result' function in functions list");
|
||||||
}
|
}
|
||||||
return resultFunction;
|
return resultFunction;
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Builds result package
|
* Builds result package
|
||||||
@ -252,8 +252,8 @@ MibewAPI.prototype.buildResult = function(resultArguments, token) {
|
|||||||
'arguments' : mergedArguments
|
'arguments' : mergedArguments
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
};
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Encodes package
|
* Encodes package
|
||||||
@ -269,7 +269,7 @@ MibewAPI.prototype.encodePackage = function(requests) {
|
|||||||
packageObject.async = true;
|
packageObject.async = true;
|
||||||
packageObject.requests = requests;
|
packageObject.requests = requests;
|
||||||
return encodeURIComponent(JSON.stringify(packageObject)).replace(/\%20/gi, '+');
|
return encodeURIComponent(JSON.stringify(packageObject)).replace(/\%20/gi, '+');
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Decodes package and validate package structure
|
* Decodes package and validate package structure
|
||||||
@ -284,7 +284,7 @@ MibewAPI.prototype.decodePackage = function(encodedPackage){
|
|||||||
var decodedPackage = JSON.parse(decodeURIComponent(encodedPackage.replace(/\+/gi, ' ')));
|
var decodedPackage = JSON.parse(decodeURIComponent(encodedPackage.replace(/\+/gi, ' ')));
|
||||||
this.checkPackage(decodedPackage);
|
this.checkPackage(decodedPackage);
|
||||||
return decodedPackage;
|
return decodedPackage;
|
||||||
}
|
};
|
||||||
/**
|
/**
|
||||||
* End of MibewAPI Class
|
* End of MibewAPI Class
|
||||||
*/
|
*/
|
||||||
@ -322,7 +322,7 @@ function MibewAPIInteraction(){
|
|||||||
*/
|
*/
|
||||||
this.mandatoryArguments = function() {
|
this.mandatoryArguments = function() {
|
||||||
return {};
|
return {};
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns reserved (system) functions' names
|
* Returns reserved (system) functions' names
|
||||||
@ -366,7 +366,7 @@ MibewAPIInteraction.prototype.getMandatoryArguments = function(functionName) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return mandatoryArguments;
|
return mandatoryArguments;
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns default values of mandatory arguments for the functionName function
|
* Returns default values of mandatory arguments for the functionName function
|
||||||
@ -397,7 +397,7 @@ MibewAPIInteraction.prototype.getMandatoryArgumentsDefaults = function(functionN
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return mandatoryArguments;
|
return mandatoryArguments;
|
||||||
}
|
};
|
||||||
/**
|
/**
|
||||||
* End of MibewAPIInteraction class
|
* End of MibewAPIInteraction class
|
||||||
*/
|
*/
|
||||||
@ -473,7 +473,7 @@ MibewAPIExecutionContext.prototype.getArgumentsList = function(functionObject) {
|
|||||||
argumentsList[variableName] = this.functionsResults[funcNum - 1][referenceTo];
|
argumentsList[variableName] = this.functionsResults[funcNum - 1][referenceTo];
|
||||||
}
|
}
|
||||||
return argumentsList;
|
return argumentsList;
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns requets results
|
* Returns requets results
|
||||||
@ -482,7 +482,7 @@ MibewAPIExecutionContext.prototype.getArgumentsList = function(functionObject) {
|
|||||||
*/
|
*/
|
||||||
MibewAPIExecutionContext.prototype.getResults = function(){
|
MibewAPIExecutionContext.prototype.getResults = function(){
|
||||||
return this.returnValues;
|
return this.returnValues;
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stores functions results in execution context and add values to request
|
* Stores functions results in execution context and add values to request
|
||||||
@ -519,7 +519,7 @@ MibewAPIExecutionContext.prototype.storeFunctionResults = function(functionObjec
|
|||||||
}
|
}
|
||||||
// Store function results in execution context
|
// Store function results in execution context
|
||||||
this.functionsResults.push(results);
|
this.functionsResults.push(results);
|
||||||
}
|
};
|
||||||
/**
|
/**
|
||||||
* End of MibewAPIExecutionContext class
|
* End of MibewAPIExecutionContext class
|
||||||
*/
|
*/
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
Mibew.Utils.alert(Mibew.Localization.trans('Network problems detected. Please refresh the page.'));
|
Mibew.Utils.alert(Mibew.Localization.trans('Network problems detected. Please refresh the page.'));
|
||||||
badRequestsCount = 0;
|
badRequestsCount = 0;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
// Create application instance
|
// Create application instance
|
||||||
var App = new Backbone.Marionette.Application();
|
var App = new Backbone.Marionette.Application();
|
||||||
|
@ -84,7 +84,7 @@
|
|||||||
return {
|
return {
|
||||||
tagName: page.get('threadTag'),
|
tagName: page.get('threadTag'),
|
||||||
collection: model.get('controls')
|
collection: model.get('controls')
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -172,7 +172,7 @@
|
|||||||
var queueCode = this.getQueueCode(thread) || 'Z';
|
var queueCode = this.getQueueCode(thread) || 'Z';
|
||||||
sort.field = queueCode.toString()
|
sort.field = queueCode.toString()
|
||||||
+ '_'
|
+ '_'
|
||||||
+ thread.get('waitingTime').toString()
|
+ thread.get('waitingTime').toString();
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -202,7 +202,7 @@
|
|||||||
Mibew.Utils.alert(
|
Mibew.Utils.alert(
|
||||||
Mibew.Localization.trans('A new visitor is waiting for an answer.')
|
Mibew.Localization.trans('A new visitor is waiting for an answer.')
|
||||||
);
|
);
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@
|
|||||||
return {
|
return {
|
||||||
tagName: page.get('visitorTag'),
|
tagName: page.get('visitorTag'),
|
||||||
collection: model.get('controls')
|
collection: model.get('controls')
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -90,7 +90,7 @@
|
|||||||
// Create default sort field
|
// Create default sort field
|
||||||
var sort = {
|
var sort = {
|
||||||
field: thread.get('waitingTime').toString()
|
field: thread.get('waitingTime').toString()
|
||||||
}
|
};
|
||||||
|
|
||||||
// Trigger event to provide an ability to change sorting order
|
// Trigger event to provide an ability to change sorting order
|
||||||
this.trigger('sort:field', thread, sort);
|
this.trigger('sort:field', thread, sort);
|
||||||
|
@ -77,7 +77,7 @@
|
|||||||
// Create default sort field
|
// Create default sort field
|
||||||
var sort = {
|
var sort = {
|
||||||
field: visitor.get('firstTime').toString()
|
field: visitor.get('firstTime').toString()
|
||||||
}
|
};
|
||||||
|
|
||||||
// Trigger event to provide an ability to change sorting order
|
// Trigger event to provide an ability to change sorting order
|
||||||
this.trigger('sort:field', visitor, sort);
|
this.trigger('sort:field', visitor, sort);
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
|
|
||||||
newWindow.focus();
|
newWindow.focus();
|
||||||
newWindow.opener = window;
|
newWindow.opener = window;
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update time in timers
|
* Update time in timers
|
||||||
@ -73,6 +73,6 @@
|
|||||||
// Build result string
|
// Build result string
|
||||||
$(this).html(result.join(':'));
|
$(this).html(result.join(':'));
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
})(Mibew, jQuery);
|
})(Mibew, jQuery);
|
@ -33,12 +33,12 @@ MibewAPIUsersInteraction = function() {
|
|||||||
'errorCode': 0
|
'errorCode': 0
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
};
|
||||||
|
|
||||||
this.getReservedFunctionsNames = function() {
|
this.getReservedFunctionsNames = function() {
|
||||||
return [
|
return [
|
||||||
'result'
|
'result'
|
||||||
];
|
];
|
||||||
}
|
};
|
||||||
}
|
};
|
||||||
MibewAPIUsersInteraction.prototype = new MibewAPIInteraction();
|
MibewAPIUsersInteraction.prototype = new MibewAPIInteraction();
|
@ -96,7 +96,7 @@
|
|||||||
* @returns {Object} Template data
|
* @returns {Object} Template data
|
||||||
*/
|
*/
|
||||||
serializeData: function() {
|
serializeData: function() {
|
||||||
var thread = this.model
|
var thread = this.model;
|
||||||
var page = Mibew.Objects.Models.page;
|
var page = Mibew.Objects.Models.page;
|
||||||
var data = thread.toJSON();
|
var data = thread.toJSON();
|
||||||
data.stateDesc = this.stateToDesc(thread.get('state'));
|
data.stateDesc = this.stateToDesc(thread.get('state'));
|
||||||
@ -105,7 +105,7 @@
|
|||||||
if (data.firstMessage) {
|
if (data.firstMessage) {
|
||||||
data.firstMessagePreview = data.firstMessage.length > 30
|
data.firstMessagePreview = data.firstMessage.length > 30
|
||||||
? data.firstMessage.substring(0,30) + '...'
|
? data.firstMessage.substring(0,30) + '...'
|
||||||
: data.firstMessage
|
: data.firstMessage;
|
||||||
}
|
}
|
||||||
return data;
|
return data;
|
||||||
},
|
},
|
||||||
|
@ -148,7 +148,7 @@
|
|||||||
* @param {Function} Mibew.Models.Control or inherited constructor
|
* @param {Function} Mibew.Models.Control or inherited constructor
|
||||||
*/
|
*/
|
||||||
addControl: function(control) {
|
addControl: function(control) {
|
||||||
controlsConstructors.push(control)
|
controlsConstructors.push(control);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -134,7 +134,7 @@
|
|||||||
* @param {Function} Mibew.Models.Control or inherited constructor
|
* @param {Function} Mibew.Models.Control or inherited constructor
|
||||||
*/
|
*/
|
||||||
addControl: function(control) {
|
addControl: function(control) {
|
||||||
controlsConstructors.push(control)
|
controlsConstructors.push(control);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -99,7 +99,7 @@ var Mibew = Mibew || {};
|
|||||||
|
|
||||||
// Load additional styles
|
// Load additional styles
|
||||||
Mibew.Utils.loadStyleSheet(options.inviteStyle);
|
Mibew.Utils.loadStyleSheet(options.inviteStyle);
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Make request to the server.
|
* Make request to the server.
|
||||||
@ -130,7 +130,7 @@ var Mibew = Mibew || {};
|
|||||||
|
|
||||||
// Clean up request data
|
// Clean up request data
|
||||||
this.dataToSend = {};
|
this.dataToSend = {};
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build GET request params list
|
* Build GET request params list
|
||||||
@ -146,7 +146,7 @@ var Mibew = Mibew || {};
|
|||||||
query.push(index + '=' + this.dataToSend[index]);
|
query.push(index + '=' + this.dataToSend[index]);
|
||||||
}
|
}
|
||||||
return query.join('&');
|
return query.join('&');
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send arbitrary data to the Server as GET params
|
* Send arbitrary data to the Server as GET params
|
||||||
@ -176,7 +176,7 @@ var Mibew = Mibew || {};
|
|||||||
|
|
||||||
this.dataToSend[index] = value;
|
this.dataToSend[index] = value;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse server response. Called as JSONP callback function
|
* Parse server response. Called as JSONP callback function
|
||||||
@ -236,12 +236,10 @@ var Mibew = Mibew || {};
|
|||||||
this.cleanUpAfterRequest();
|
this.cleanUpAfterRequest();
|
||||||
|
|
||||||
// Make new request after timeout
|
// Make new request after timeout
|
||||||
window.setTimeout(
|
window.setTimeout(function() {
|
||||||
function() {
|
context.makeRequest();
|
||||||
context.makeRequest();
|
}, this.requestTimeout);
|
||||||
},
|
};
|
||||||
this.requestTimeout);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove dynamically loaded request script from DOM
|
* Remove dynamically loaded request script from DOM
|
||||||
@ -250,7 +248,7 @@ var Mibew = Mibew || {};
|
|||||||
Mibew.Widget.prototype.cleanUpAfterRequest = function() {
|
Mibew.Widget.prototype.cleanUpAfterRequest = function() {
|
||||||
document.getElementsByTagName('head')[0]
|
document.getElementsByTagName('head')[0]
|
||||||
.removeChild(document.getElementById('mibew-response-script'));
|
.removeChild(document.getElementById('mibew-response-script'));
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load script and add handler for script onLoad event
|
* Load script and add handler for script onLoad event
|
||||||
@ -266,14 +264,14 @@ var Mibew = Mibew || {};
|
|||||||
// Check if script loaded
|
// Check if script loaded
|
||||||
script.onload = function(){
|
script.onload = function(){
|
||||||
context.scriptReady(id);
|
context.scriptReady(id);
|
||||||
}
|
};
|
||||||
// Do it in crossbrowser way
|
// Do it in crossbrowser way
|
||||||
script.onreadystatechange = function(){
|
script.onreadystatechange = function(){
|
||||||
if (this.readyState == 'complete' || this.readyState == 'loaded') {
|
if (this.readyState == 'complete' || this.readyState == 'loaded') {
|
||||||
context.scriptReady(id);
|
context.scriptReady(id);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Event listener for script onLoad event. Run handlers which have no
|
* Event listener for script onLoad event. Run handlers which have no
|
||||||
@ -291,7 +289,7 @@ var Mibew = Mibew || {};
|
|||||||
delete this.handlers[handlerName];
|
delete this.handlers[handlerName];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if handler can be run
|
* Check if handler can be run
|
||||||
@ -305,7 +303,7 @@ var Mibew = Mibew || {};
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper function which create new widget object, store it into
|
* Helper function which create new widget object, store it into
|
||||||
@ -314,7 +312,7 @@ var Mibew = Mibew || {};
|
|||||||
Mibew.Widget.init = function(options) {
|
Mibew.Widget.init = function(options) {
|
||||||
Mibew.Objects.widget = new Mibew.Widget(options);
|
Mibew.Objects.widget = new Mibew.Widget(options);
|
||||||
Mibew.Objects.widget.makeRequest();
|
Mibew.Objects.widget.makeRequest();
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @namespace Holds invitation stuff
|
* @namespace Holds invitation stuff
|
||||||
@ -380,7 +378,7 @@ var Mibew = Mibew || {};
|
|||||||
if (invitationdiv) {
|
if (invitationdiv) {
|
||||||
invitationdiv.innerHTML = popuptext;
|
invitationdiv.innerHTML = popuptext;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display invitation popup
|
* Display invitation popup
|
||||||
@ -391,7 +389,7 @@ var Mibew = Mibew || {};
|
|||||||
Mibew.Invitation.trigger('show');
|
Mibew.Invitation.trigger('show');
|
||||||
invitationPopup.style.display = 'block';
|
invitationPopup.style.display = 'block';
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hide invitation popup and remove it from DOM
|
* Hide invitation popup and remove it from DOM
|
||||||
@ -402,7 +400,7 @@ var Mibew = Mibew || {};
|
|||||||
Mibew.Invitation.trigger('hide');
|
Mibew.Invitation.trigger('hide');
|
||||||
invitationPopup.parentNode.removeChild(invitationPopup);
|
invitationPopup.parentNode.removeChild(invitationPopup);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Accept invitation and open chat window
|
* Accept invitation and open chat window
|
||||||
@ -413,7 +411,7 @@ var Mibew = Mibew || {};
|
|||||||
document.getElementById('mibew-agent-button').onclick();
|
document.getElementById('mibew-agent-button').onclick();
|
||||||
Mibew.Invitation.hide();
|
Mibew.Invitation.hide();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Visitor rejects invitation
|
* Visitor rejects invitation
|
||||||
@ -422,7 +420,7 @@ var Mibew = Mibew || {};
|
|||||||
Mibew.Invitation.trigger('reject');
|
Mibew.Invitation.trigger('reject');
|
||||||
Mibew.Objects.widget.sendToServer({'invitation_rejected': 1});
|
Mibew.Objects.widget.sendToServer({'invitation_rejected': 1});
|
||||||
Mibew.Invitation.hide();
|
Mibew.Invitation.hide();
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Contains callbacks for invitation events.
|
* Contains callbacks for invitation events.
|
||||||
@ -451,7 +449,7 @@ var Mibew = Mibew || {};
|
|||||||
}
|
}
|
||||||
|
|
||||||
invitaionEventsCallbacks[event].push(callback);
|
invitaionEventsCallbacks[event].push(callback);
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Triggers invitation event.
|
* Triggers invitation event.
|
||||||
@ -476,7 +474,7 @@ var Mibew = Mibew || {};
|
|||||||
for(var i = 0, length = callbacks.length; i < length; i++) {
|
for(var i = 0, length = callbacks.length; i < length; i++) {
|
||||||
callbacks[i](data);
|
callbacks[i](data);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @namespace Holds functions that can be called by the Core
|
* @namespace Holds functions that can be called by the Core
|
||||||
@ -492,7 +490,7 @@ var Mibew = Mibew || {};
|
|||||||
Mibew.Objects.widget.visitorCookieName,
|
Mibew.Objects.widget.visitorCookieName,
|
||||||
response.user.id
|
response.user.id
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show invitation popup
|
* Show invitation popup
|
||||||
@ -500,13 +498,13 @@ var Mibew = Mibew || {};
|
|||||||
*/
|
*/
|
||||||
Mibew.APIFunctions.invitationCreate = function(data) {
|
Mibew.APIFunctions.invitationCreate = function(data) {
|
||||||
Mibew.Invitation.create(data.invitation);
|
Mibew.Invitation.create(data.invitation);
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Close invitation popup
|
* Close invitation popup
|
||||||
*/
|
*/
|
||||||
Mibew.APIFunctions.invitationClose = function() {
|
Mibew.APIFunctions.invitationClose = function() {
|
||||||
Mibew.Invitation.hide();
|
Mibew.Invitation.hide();
|
||||||
}
|
};
|
||||||
|
|
||||||
})(Mibew);
|
})(Mibew);
|
||||||
|
Loading…
Reference in New Issue
Block a user