CodeMaid clean-up
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
|
||||
////////////////////////
|
||||
////////////////////////
|
||||
// GetElement
|
||||
//
|
||||
function GetElement(element) {
|
||||
@@ -53,7 +52,6 @@ function ElementToggleClass(element, className) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function escapeHTML(s) {
|
||||
return s.replace(/&/g, '&')
|
||||
.replace(/"/g, '"')
|
||||
@@ -67,7 +65,6 @@ function fixedEncodeURIComponent(str) {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
////////////////////////
|
||||
// localStorage polyfill
|
||||
//
|
||||
@@ -94,4 +91,4 @@ if (!window.localStorage) {
|
||||
hasOwnProperty: function (sKey) { return (new RegExp("(?:^|;\\s*)" + escape(sKey).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=")).test(document.cookie); }
|
||||
};
|
||||
window.localStorage.length = (document.cookie.match(/\=/g) || window.localStorage).length;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
|
||||
function SendRequest(url, data, onData, onError) {
|
||||
function SendRequest(url, data, onData, onError) {
|
||||
var xhr = new XMLHttpRequest();
|
||||
if (data) {
|
||||
url += "?" + GetDataQueryString(data);
|
||||
@@ -122,4 +121,4 @@ function SendForm(url, idForm, onData, onError) {
|
||||
xhr.setRequestHeader('Content-Type',
|
||||
'application/x-www-form-urlencoded');
|
||||
xhr.send(GetFormQueryString(idForm));
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
|
||||
var CosineInterpolation = function (f) {
|
||||
var CosineInterpolation = function (f) {
|
||||
return 1.0 - (Math.cos(f * Math.PI) + 1.0) / 2.0;
|
||||
};
|
||||
|
||||
@@ -84,7 +83,7 @@ Toolbox.prototype = {
|
||||
this.divToolbox.style.left = x + "px";
|
||||
this.divToolbox.style.top = y + "px";
|
||||
},
|
||||
SavePosition: function(){
|
||||
SavePosition: function () {
|
||||
var pos = { X: this.X, Y: this.Y };
|
||||
window.localStorage.setItem(this.StrKeyPosition, JSON.stringify(pos));
|
||||
},
|
||||
@@ -242,7 +241,7 @@ Card.prototype = {
|
||||
this.container.appendChild(this.divCard);
|
||||
this.cfg.Toolbox.ReInsertOnContainer();
|
||||
},
|
||||
RemoveFromContainer: function(){
|
||||
RemoveFromContainer: function () {
|
||||
this.container.removeChild(this.divCard);
|
||||
},
|
||||
MoveFrame: function () {
|
||||
@@ -537,11 +536,11 @@ Card.prototype = {
|
||||
document.removeEventListener("touchcancel", this.bindedTouchEnd, false);
|
||||
document.removeEventListener("touchmove", this.bindedTouchMove, false);
|
||||
|
||||
this.OnMove();
|
||||
this.OnMove();
|
||||
|
||||
return false;
|
||||
},
|
||||
EnterEditionMode: function(){
|
||||
EnterEditionMode: function () {
|
||||
this.divTitle.innerHTML = "";
|
||||
this.txtTitle.value = this.Title;
|
||||
this.divTitle.appendChild(this.txtTitle);
|
||||
@@ -556,7 +555,7 @@ Card.prototype = {
|
||||
this.divOverlay.style.display = "none";
|
||||
this.Editing = true;
|
||||
},
|
||||
ExitEditionMode: function(){
|
||||
ExitEditionMode: function () {
|
||||
this.divTitle.removeChild(this.txtTitle);
|
||||
this.divBody.removeChild(this.txtBody);
|
||||
this.divBody.removeChild(this.btnAcceptEdit);
|
||||
@@ -601,7 +600,7 @@ Card.prototype = {
|
||||
},
|
||||
btnDelete_Click: function (evt) {
|
||||
evt.preventDefault();
|
||||
if (this.IDCard==0 || confirm(this.cfg.Texts.ConfirmDelete)) {
|
||||
if (this.IDCard == 0 || confirm(this.cfg.Texts.ConfirmDelete)) {
|
||||
this.OnDelete();
|
||||
}
|
||||
return false;
|
||||
@@ -636,7 +635,7 @@ function RunCardBoard(cfg) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var ProcessCardCreateEvent = function(cardEvent){
|
||||
var ProcessCardCreateEvent = function (cardEvent) {
|
||||
var card = new Card(cfg, cardEvent.IDCard, cardEvent.Title, cardEvent.Body, cardEvent.X, cardEvent.Y);
|
||||
};
|
||||
|
||||
@@ -661,7 +660,7 @@ function RunCardBoard(cfg) {
|
||||
var RequestCardEventData = function () {
|
||||
var ReciveCardEventData = function (responseText) {
|
||||
cfg.Connected = true;
|
||||
|
||||
|
||||
var recvData = JSON.parse(responseText);
|
||||
if (recvData && recvData instanceof Array) {
|
||||
for (var i = 0, n = recvData.length; i < n; i++) {
|
||||
@@ -708,4 +707,4 @@ function RunCardBoard(cfg) {
|
||||
SendRequest(cfg.ServiceUrl, data, ReciveCardEventData, ErrorCardEventData);
|
||||
};
|
||||
RequestCardEventData();
|
||||
}
|
||||
}
|
||||
@@ -81,7 +81,6 @@
|
||||
|
||||
var RequestChatData = function () {
|
||||
var ReciveChatData = function (responseText) {
|
||||
|
||||
// Mark as connected
|
||||
if (cfg.Connected == false) {
|
||||
if (cfg.Minimized) {
|
||||
@@ -134,7 +133,6 @@
|
||||
}, 20);
|
||||
};
|
||||
var ErrorChatData = function () {
|
||||
|
||||
// Mark as disconnected
|
||||
cfg.lblTitle.innerHTML = cfg.Texts.Disconnected;
|
||||
cfg.lblTitle.className = "titleChatDisconnected";
|
||||
@@ -180,4 +178,4 @@ function SendChat(cfg) {
|
||||
|
||||
cfg.txtText.value = "";
|
||||
cfg.txtText.focus();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user