Add JS files
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -5,6 +5,7 @@
|
||||
!.gitignore
|
||||
!*.php
|
||||
!*.html
|
||||
!*.js
|
||||
|
||||
# ...even if they are in subdirectories
|
||||
!*/
|
||||
|
||||
1018
import/EcmPriceBooks/Email.js
Normal file
1018
import/EcmPriceBooks/Email.js
Normal file
File diff suppressed because it is too large
Load Diff
480
import/EcmPriceBooks/advajax.js
Normal file
480
import/EcmPriceBooks/advajax.js
Normal file
@@ -0,0 +1,480 @@
|
||||
/*
|
||||
* AdvancedAJAX 1.1.2
|
||||
* (c) 2005-2006 Lukasz Lach
|
||||
* mail: anakin@php5.pl
|
||||
* www: http://advajax.anakin.us/
|
||||
* http://anakin.us/
|
||||
* http://creativecommons.org/licenses/LGPL/2.1/
|
||||
*
|
||||
*/
|
||||
|
||||
function advAJAX() {
|
||||
|
||||
var obj = new Object();
|
||||
|
||||
obj.url = window.location.href;
|
||||
obj.method = "GET";
|
||||
obj.parameters = new Object();
|
||||
obj.jsonParameters = new Object();
|
||||
obj.headers = new Object();
|
||||
obj.async = true;
|
||||
obj.mimeType = "text/xml";
|
||||
obj.username = null;
|
||||
obj.password = null;
|
||||
obj.form = null;
|
||||
obj.disableForm = true;
|
||||
|
||||
obj.unique = true;
|
||||
obj.uniqueParameter = "_uniqid";
|
||||
|
||||
obj.requestDone = false;
|
||||
obj.queryString = "";
|
||||
obj.responseText = null;
|
||||
obj.responseXML = null;
|
||||
obj.status = null;
|
||||
obj.statusText = null;
|
||||
obj.aborted = false;
|
||||
obj.timeout = 0;
|
||||
obj.retryCount = 0;
|
||||
obj.retryDelay = 1000;
|
||||
obj.tag = null;
|
||||
obj.group = null;
|
||||
obj.progressTimerInterval = 50;
|
||||
|
||||
obj.xmlHttpRequest = null;
|
||||
|
||||
obj.onInitialization = null;
|
||||
obj.onFinalization = null;
|
||||
obj.onReadyStateChange = null;
|
||||
obj.onLoading = null;
|
||||
obj.onLoaded = null;
|
||||
obj.onInteractive = null;
|
||||
obj.onComplete = null;
|
||||
obj.onProgress = null;
|
||||
obj.onSuccess = null;
|
||||
obj.onFatalError = null;
|
||||
obj.onError = null;
|
||||
obj.onTimeout = null;
|
||||
obj.onRetryDelay = null;
|
||||
obj.onRetry = null;
|
||||
obj.onGroupEnter = null;
|
||||
obj.onGroupLeave = null;
|
||||
|
||||
obj.createXmlHttpRequest = function() {
|
||||
|
||||
if (typeof XMLHttpRequest != "undefined")
|
||||
return new XMLHttpRequest();
|
||||
var xhrVersion = [ "MSXML2.XMLHttp.5.0", "MSXML2.XMLHttp.4.0","MSXML2.XMLHttp.3.0",
|
||||
"MSXML2.XMLHttp","Microsoft.XMLHttp" ];
|
||||
for (var i = 0; i < xhrVersion.length; i++) {
|
||||
try {
|
||||
var xhrObj = new ActiveXObject(xhrVersion[i]);
|
||||
return xhrObj;
|
||||
} catch (e) { }
|
||||
}
|
||||
obj.raiseEvent("FatalError");
|
||||
return null;
|
||||
};
|
||||
|
||||
obj._oldResponseLength = null;
|
||||
obj._progressTimer = null;
|
||||
obj._progressStarted = navigator.userAgent.indexOf('Opera') == -1;
|
||||
obj._onProgress = function() {
|
||||
|
||||
if (typeof obj.onProgress == "function" &&
|
||||
typeof obj.xmlHttpRequest.getResponseHeader == "function") {
|
||||
var contentLength = obj.xmlHttpRequest.getResponseHeader("Content-length");
|
||||
if (contentLength != null && contentLength != '') {
|
||||
var responseLength = obj.xmlHttpRequest.responseText.length;
|
||||
if (responseLength != obj._oldResponseLength) {
|
||||
obj.raiseEvent("Progress", obj, responseLength, contentLength);
|
||||
obj._oldResponseLength = obj.xmlHttpRequest.responseText.length;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (obj._progressStarted) return;
|
||||
obj._progressStarted = true;
|
||||
var _obj = this;
|
||||
this.__onProgress = function() {
|
||||
obj._onProgress();
|
||||
obj._progressTimer = window.setTimeout(_obj.__onProgress, obj.progressTimerInterval);
|
||||
}
|
||||
_obj.__onProgress();
|
||||
}
|
||||
|
||||
obj._onInitializationHandled = false;
|
||||
obj._initObject = function() {
|
||||
|
||||
if (obj.xmlHttpRequest != null) {
|
||||
delete obj.xmlHttpRequest["onreadystatechange"];
|
||||
obj.xmlHttpRequest = null;
|
||||
}
|
||||
if ((obj.xmlHttpRequest = obj.createXmlHttpRequest()) == null)
|
||||
return null;
|
||||
if (typeof obj.xmlHttpRequest.overrideMimeType != "undefined")
|
||||
obj.xmlHttpRequest.overrideMimeType(obj.mimeType);
|
||||
obj.xmlHttpRequest.onreadystatechange = function() {
|
||||
|
||||
if (obj == null || obj.xmlHttpRequest == null)
|
||||
return;
|
||||
obj.raiseEvent("ReadyStateChange", obj, obj.xmlHttpRequest.readyState);
|
||||
obj._onProgress();
|
||||
switch (obj.xmlHttpRequest.readyState) {
|
||||
case 1: obj._onLoading(); break;
|
||||
case 2: obj._onLoaded(); break;
|
||||
case 3: obj._onInteractive(); break;
|
||||
case 4: obj._onComplete(); break;
|
||||
}
|
||||
};
|
||||
obj._onLoadingHandled =
|
||||
obj._onLoadedHandled =
|
||||
obj._onInteractiveHandled =
|
||||
obj._onCompleteHandled = false;
|
||||
};
|
||||
|
||||
obj._onLoading = function() {
|
||||
|
||||
if (obj._onLoadingHandled)
|
||||
return;
|
||||
if (!obj._retry && obj.group != null) {
|
||||
if (typeof advAJAX._groupData[obj.group] == "undefined")
|
||||
advAJAX._groupData[obj.group] = 0;
|
||||
advAJAX._groupData[obj.group]++;
|
||||
if (typeof obj.onGroupEnter == "function" && advAJAX._groupData[obj.group] == 1)
|
||||
obj.onGroupEnter(obj);
|
||||
}
|
||||
obj.raiseEvent("Loading", obj);
|
||||
obj._onLoadingHandled = true;
|
||||
};
|
||||
obj._onLoaded = function() {
|
||||
|
||||
if (obj._onLoadedHandled)
|
||||
return;
|
||||
obj.raiseEvent("Loaded", obj);
|
||||
obj._onLoadedHandled = true;
|
||||
};
|
||||
obj._onInteractive = function() {
|
||||
|
||||
if (obj._onInteractiveHandled)
|
||||
return;
|
||||
obj.raiseEvent("Interactive", obj);
|
||||
obj._onInteractiveHandled = true;
|
||||
if (!obj._progressStarted)
|
||||
obj._onProgress();
|
||||
};
|
||||
obj._onComplete = function() {
|
||||
|
||||
if (obj._onCompleteHandled || obj.aborted)
|
||||
return;
|
||||
if (obj._progressStarted) {
|
||||
window.clearInterval(obj._progressTimer);
|
||||
obj._progressStarted = false;
|
||||
}
|
||||
obj.requestDone = true;
|
||||
with (obj.xmlHttpRequest) {
|
||||
obj.responseText = responseText;
|
||||
obj.responseXML = responseXML;
|
||||
if (typeof status != "undefined")
|
||||
obj.status = status;
|
||||
if (typeof statusText != "undefined")
|
||||
obj.statusText = statusText;
|
||||
}
|
||||
obj.raiseEvent("Complete", obj);
|
||||
obj._onCompleteHandled = true;
|
||||
if (obj.status == 200)
|
||||
obj.raiseEvent("Success", obj); else
|
||||
obj.raiseEvent("Error", obj);
|
||||
delete obj.xmlHttpRequest['onreadystatechange'];
|
||||
obj.xmlHttpRequest = null;
|
||||
if (obj.disableForm)
|
||||
obj.switchForm(true);
|
||||
obj._groupLeave();
|
||||
obj.raiseEvent("Finalization", obj);
|
||||
};
|
||||
|
||||
obj._groupLeave = function() {
|
||||
|
||||
if (obj.group != null) {
|
||||
advAJAX._groupData[obj.group]--;
|
||||
if (advAJAX._groupData[obj.group] == 0)
|
||||
obj.raiseEvent("GroupLeave", obj);
|
||||
}
|
||||
};
|
||||
|
||||
obj._retry = false;
|
||||
obj._retryNo = 0;
|
||||
obj._onTimeout = function() {
|
||||
|
||||
if (obj == null || obj.xmlHttpRequest == null || obj._onCompleteHandled)
|
||||
return;
|
||||
obj.aborted = true;
|
||||
obj.xmlHttpRequest.abort();
|
||||
obj.raiseEvent("Timeout", obj);
|
||||
obj._retry = true;
|
||||
if (obj._retryNo != obj.retryCount) {
|
||||
obj._initObject();
|
||||
if (obj.retryDelay > 0) {
|
||||
obj.raiseEvent("RetryDelay", obj);
|
||||
startTime = new Date().getTime();
|
||||
while (new Date().getTime() - startTime < obj.retryDelay);
|
||||
}
|
||||
obj._retryNo++;
|
||||
obj.raiseEvent("Retry", obj, obj._retryNo);
|
||||
obj.run();
|
||||
} else {
|
||||
delete obj.xmlHttpRequest["onreadystatechange"];
|
||||
obj.xmlHttpRequest = null;
|
||||
if (obj.disableForm)
|
||||
obj.switchForm(true);
|
||||
obj._groupLeave();
|
||||
obj.raiseEvent("Finalization", obj);
|
||||
}
|
||||
};
|
||||
|
||||
obj.run = function() {
|
||||
|
||||
obj._initObject();
|
||||
if (obj.xmlHttpRequest == null)
|
||||
return false;
|
||||
obj.aborted = false;
|
||||
if (!obj._onInitializationHandled) {
|
||||
obj.raiseEvent("Initialization", obj);
|
||||
obj._onInitializationHandled = true;
|
||||
}
|
||||
if (obj.method == "GET" && obj.unique)
|
||||
obj.parameters[encodeURIComponent(obj.uniqueParameter)] =
|
||||
new Date().getTime().toString().substr(5) + Math.floor(Math.random() * 100).toString();
|
||||
if (!obj._retry) {
|
||||
for (var a in obj.parameters) {
|
||||
if (obj.queryString.length > 0)
|
||||
obj.queryString += "&";
|
||||
if (typeof obj.parameters[a] != "object")
|
||||
obj.queryString += encodeURIComponent(a) + "=" + encodeURIComponent(obj.parameters[a]); else {
|
||||
for (var i = 0; i < obj.parameters[a].length; i++)
|
||||
obj.queryString += encodeURIComponent(a) + "=" + encodeURIComponent(obj.parameters[a][i]) + "&";
|
||||
obj.queryString = obj.queryString.slice(0, -1);
|
||||
}
|
||||
}
|
||||
for (var a in obj.jsonParameters) {
|
||||
var useJson = typeof [].toJSONString == 'function';
|
||||
if (obj.queryString.length > 0)
|
||||
obj.queryString += "&";
|
||||
obj.queryString += encodeURIComponent(a) + "=";
|
||||
if (useJson)
|
||||
obj.queryString += encodeURIComponent(obj.jsonParameters[a].toJSONString()); else
|
||||
obj.queryString += encodeURIComponent(obj.jsonParameters[a]);
|
||||
}
|
||||
if (obj.method == "GET" && obj.queryString.length > 0)
|
||||
obj.url += (obj.url.indexOf("?") != -1 ? "&" : "?") + obj.queryString;
|
||||
}
|
||||
if (obj.disableForm)
|
||||
obj.switchForm(false);
|
||||
try {
|
||||
obj.xmlHttpRequest.open(obj.method, obj.url, obj.async, obj.username || '', obj.password || '');
|
||||
} catch (e) {
|
||||
obj.raiseEvent("FatalError", obj, e);
|
||||
return;
|
||||
}
|
||||
if (obj.timeout > 0)
|
||||
setTimeout(obj._onTimeout, obj.timeout);
|
||||
if (typeof obj.xmlHttpRequest.setRequestHeader != "undefined")
|
||||
for (var a in obj.headers)
|
||||
obj.xmlHttpRequest.setRequestHeader(encodeURIComponent(a), encodeURIComponent(obj.headers[a]));
|
||||
if (obj.method == "POST" && typeof obj.xmlHttpRequest.setRequestHeader != "undefined") {
|
||||
obj.xmlHttpRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
||||
obj.xmlHttpRequest.send(obj.queryString);
|
||||
} else if (obj.method == "GET")
|
||||
obj.xmlHttpRequest.send('');
|
||||
};
|
||||
|
||||
obj.handleArguments = function(args) {
|
||||
|
||||
if (typeof args.form == "object" && args.form != null) {
|
||||
obj.form = args.form;
|
||||
obj.appendForm();
|
||||
}
|
||||
for (a in args) {
|
||||
if (typeof obj[a] == "undefined")
|
||||
obj.parameters[a] = args[a]; else {
|
||||
if (a != "parameters" && a != "headers")
|
||||
obj[a] = args[a]; else
|
||||
for (b in args[a])
|
||||
obj[a][b] = args[a][b];
|
||||
}
|
||||
}
|
||||
obj.method = obj.method.toUpperCase();
|
||||
};
|
||||
|
||||
obj.switchForm = function(enable) {
|
||||
|
||||
if (typeof obj.form != "object" || obj.form == null)
|
||||
return;
|
||||
with (obj.form)
|
||||
for (var nr = 0; nr < elements.length; nr++)
|
||||
if (!enable) {
|
||||
if (elements[nr]["disabled"])
|
||||
elements[nr]["_disabled"] = true; else
|
||||
elements[nr]["disabled"] = "disabled";
|
||||
} else
|
||||
if (typeof elements[nr]["_disabled"] == "undefined")
|
||||
elements[nr].removeAttribute("disabled");
|
||||
};
|
||||
|
||||
obj.appendForm = function() {
|
||||
|
||||
with (obj.form) {
|
||||
obj.method = getAttribute("method").toUpperCase();
|
||||
obj.url = getAttribute("action");
|
||||
for (var nr = 0; nr < elements.length; nr++) {
|
||||
var e = elements[nr];
|
||||
if (e.disabled)
|
||||
continue;
|
||||
switch (e.type) {
|
||||
case "text":
|
||||
case "password":
|
||||
case "hidden":
|
||||
case "textarea":
|
||||
obj.addParameter(e.name, e.value);
|
||||
break;
|
||||
case "select-one":
|
||||
if (e.selectedIndex >= 0)
|
||||
obj.addParameter(e.name, e.options[e.selectedIndex].value);
|
||||
break;
|
||||
case "select-multiple":
|
||||
for (var nr2 = 0; nr2 < e.options.length; nr2++)
|
||||
if (e.options[nr2].selected)
|
||||
obj.addParameter(e.name, e.options[nr2].value);
|
||||
break;
|
||||
case "checkbox":
|
||||
case "radio":
|
||||
if (e.checked)
|
||||
obj.addParameter(e.name, e.value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
obj.addParameter = function(name, value) {
|
||||
if (typeof obj.parameters[name] == "undefined")
|
||||
obj.parameters[name] = value; else
|
||||
if (typeof obj.parameters[name] != "object")
|
||||
obj.parameters[name] = [ obj.parameters[name], value ]; else
|
||||
obj.parameters[name][obj.parameters[name].length] = value;
|
||||
};
|
||||
obj.delParameter = function(name) {
|
||||
|
||||
delete obj.parameters[name];
|
||||
};
|
||||
obj.raiseEvent = function(name) {
|
||||
var args = [];
|
||||
for (var i = 1; i < arguments.length; i++)
|
||||
args.push(arguments[i]);
|
||||
if (typeof obj["on" + name] == "function")
|
||||
obj["on" + name].apply(null, args);
|
||||
if (name == "FatalError")
|
||||
obj.raiseEvent("Finalization", obj);
|
||||
}
|
||||
|
||||
if (typeof advAJAX._defaultParameters != "undefined")
|
||||
obj.handleArguments(advAJAX._defaultParameters);
|
||||
return obj;
|
||||
}
|
||||
|
||||
advAJAX.get = function(args) {
|
||||
|
||||
return advAJAX.handleRequest("GET", args);
|
||||
};
|
||||
|
||||
advAJAX.post = function(args) {
|
||||
|
||||
return advAJAX.handleRequest("POST", args);
|
||||
};
|
||||
|
||||
advAJAX.head = function(args) {
|
||||
|
||||
return advAJAX.handleRequest("HEAD", args);
|
||||
};
|
||||
|
||||
advAJAX.submit = function(form, args) {
|
||||
|
||||
if (typeof args == "undefined" || args == null)
|
||||
return -1;
|
||||
if (typeof form != "object" || form == null)
|
||||
return -2;
|
||||
var request = new advAJAX();
|
||||
args["form"] = form;
|
||||
request.handleArguments(args);
|
||||
return request.run();
|
||||
};
|
||||
|
||||
advAJAX.assign = function(form, args) {
|
||||
|
||||
if (typeof args == "undefined" || args == null)
|
||||
return -1;
|
||||
if (typeof form != "object" || form == null)
|
||||
return -2;
|
||||
if (typeof form["onsubmit"] == "function")
|
||||
form["_onsubmit"] = form["onsubmit"];
|
||||
form["advajax_args"] = args;
|
||||
form["onsubmit"] = function() {
|
||||
if (typeof this["_onsubmit"] != "undefined" && this["_onsubmit"]() === false)
|
||||
return false;
|
||||
if (advAJAX.submit(this, this["advajax_args"]) == false)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
advAJAX.download = function(targetObj, url) {
|
||||
|
||||
if (typeof targetObj == "string")
|
||||
targetObj = document.getElementById(targetObj);
|
||||
if (!targetObj)
|
||||
return -1;
|
||||
advAJAX.get({
|
||||
url: url,
|
||||
onSuccess : function(obj) {
|
||||
targetObj.innerHTML = obj.responseText;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
advAJAX.scan = function() {
|
||||
|
||||
var obj = document.getElementsByTagName("a");
|
||||
for (var i = 0; i < obj.length;) {
|
||||
if (obj[i].getAttribute("rel") == "advancedajax" && obj[i].getAttribute("href") !== null) {
|
||||
var url = obj[i].getAttribute("href");
|
||||
var div = document.createElement("div");
|
||||
div.innerHTML = obj[i].innerHTML;
|
||||
div.className = obj[i].className;
|
||||
var parent = obj[i].parentNode;
|
||||
parent.insertBefore(div, obj[i]);
|
||||
parent.removeChild(obj[i]);
|
||||
advAJAX.download(div, url);
|
||||
} else i++;
|
||||
}
|
||||
};
|
||||
|
||||
advAJAX.handleRequest = function(requestType, args) {
|
||||
|
||||
if (typeof args == "undefined" || args == null)
|
||||
return -1;
|
||||
var request = new advAJAX();
|
||||
window.advajax_obj = request;
|
||||
request.method = requestType;
|
||||
request.handleArguments(args);
|
||||
return request.run();
|
||||
};
|
||||
|
||||
advAJAX._defaultParameters = new Object();
|
||||
advAJAX.setDefaultParameters = function(args) {
|
||||
|
||||
advAJAX._defaultParameters = new Object();
|
||||
for (a in args)
|
||||
advAJAX._defaultParameters[a] = args[a];
|
||||
};
|
||||
|
||||
advAJAX._groupData = new Object();
|
||||
2
import/EcmPriceBooks/mintajax.js
Normal file
2
import/EcmPriceBooks/mintajax.js
Normal file
File diff suppressed because one or more lines are too long
5308
import/EcmPriceBooks/moo1.2.js
Normal file
5308
import/EcmPriceBooks/moo1.2.js
Normal file
File diff suppressed because it is too large
Load Diff
70
include/ECM/EcmDeleteDocument/EcmDeleteDocument.js
Executable file
70
include/ECM/EcmDeleteDocument/EcmDeleteDocument.js
Executable file
@@ -0,0 +1,70 @@
|
||||
var deleteDocumentAjax = function(container) {
|
||||
|
||||
var params = new Array;
|
||||
var r = confirm('Czy na pewno chcesz usunąć ten dokument?');
|
||||
if (r == true) {
|
||||
params[0] = $("#form :input[name='module']").val();
|
||||
params[1] = $("input[name='record']").val();
|
||||
jQuery.ajax({
|
||||
type : 'POST',
|
||||
url : 'index.php?entryPoint=HandleEcmAjax',
|
||||
data : {
|
||||
ecmclass : 'EcmDeleteDocument',
|
||||
job : 'deleteDocument',
|
||||
params : utf8_to_b64(JSON.stringifyNoSecurity(params)),
|
||||
},
|
||||
dataType : 'json',
|
||||
async : false,
|
||||
success : function(response) {
|
||||
if(response==1){
|
||||
$('#sendreturn').html('Usunięte!');
|
||||
$('#sendreturn').show();
|
||||
window.location = 'index.php?module='+params[0]+'&action=ListView';
|
||||
} else {
|
||||
$('#sendreturn').html('Błąd');
|
||||
$('#sendreturn').show();
|
||||
}
|
||||
return;
|
||||
},
|
||||
error : function(xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError);
|
||||
}
|
||||
});
|
||||
}
|
||||
// $('#div_send').hide();
|
||||
}
|
||||
var cancelDocumentAjax = function(container) {
|
||||
|
||||
var params = new Array;
|
||||
var r = confirm('Czy na pewno chcesz anulować ten dokument?');
|
||||
if (r == true) {
|
||||
params[0] = $("#form :input[name='module']").val();
|
||||
params[1] = $("input[name='record']").val();
|
||||
jQuery.ajax({
|
||||
type : 'POST',
|
||||
url : 'index.php?entryPoint=HandleEcmAjax',
|
||||
data : {
|
||||
ecmclass : 'EcmDeleteDocument',
|
||||
job : 'cancelDocument',
|
||||
params : utf8_to_b64(JSON.stringifyNoSecurity(params)),
|
||||
},
|
||||
dataType : 'json',
|
||||
async : false,
|
||||
success : function(response) {
|
||||
if(response==1){
|
||||
$('#sendreturn').html('Anulowane!');
|
||||
$('#sendreturn').show();
|
||||
window.location = 'index.php?module='+params[0]+'&action=ListView';
|
||||
} else {
|
||||
$('#sendreturn').html('Błąd');
|
||||
$('#sendreturn').show();
|
||||
}
|
||||
return;
|
||||
},
|
||||
error : function(xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError);
|
||||
}
|
||||
});
|
||||
}
|
||||
// $('#div_send').hide();
|
||||
}
|
||||
124
include/ECM/EcmDocumentNumberGenerator/EcmDocumentNumberGenerator.js
Executable file
124
include/ECM/EcmDocumentNumberGenerator/EcmDocumentNumberGenerator.js
Executable file
@@ -0,0 +1,124 @@
|
||||
var EcmDocumentNumberGenerator_getNumberTemplate = function(field_name, module) {
|
||||
var params = new Array;
|
||||
params[0] = module;
|
||||
console.log('t');
|
||||
// AJAX call
|
||||
jQuery.ajax({
|
||||
type : 'POST',
|
||||
url : 'index.php?entryPoint=HandleEcmAjax',
|
||||
data : {
|
||||
ecmclass : 'EcmDocumentNumberGenerator',
|
||||
job : 'getNumberTemplate',
|
||||
params : utf8_to_b64(JSON.stringifyNoSecurity(params)),
|
||||
},
|
||||
dataType : 'json',
|
||||
async : false,
|
||||
success : function(response) {
|
||||
$('#'+field_name).val(response);
|
||||
if (response == "") {
|
||||
$('#'+field_name).attr('readonly', false);
|
||||
} else {
|
||||
$('#'+field_name).attr('readonly', 'readonly');
|
||||
$('#'+field_name).css('background-color', '#888888');
|
||||
}
|
||||
return;
|
||||
},
|
||||
error : function(xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var EcmDocumentNumberGenerator_getNormalNumber = function(field_name, module, stock_id) {
|
||||
|
||||
var params = new Array;
|
||||
params[0] = module;
|
||||
params[1] = stock_id;
|
||||
|
||||
// AJAX call
|
||||
jQuery.ajax({
|
||||
type : 'POST',
|
||||
url : 'index.php?entryPoint=HandleEcmAjax',
|
||||
data : {
|
||||
ecmclass : 'EcmDocumentNumberGenerator',
|
||||
job : 'getNormalNumber',
|
||||
params : utf8_to_b64(JSON.stringifyNoSecurity(params)),
|
||||
},
|
||||
dataType : 'json',
|
||||
async : false,
|
||||
success : function(response) {
|
||||
$('#'+field_name).val(response);
|
||||
return;
|
||||
},
|
||||
error : function(xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var EcmDocumentNumberGenerator_getCorrectNumber = function(field_name, module, stock_id) {
|
||||
|
||||
var params = new Array;
|
||||
params[0] = module;
|
||||
params[1] = stock_id;
|
||||
|
||||
// AJAX call
|
||||
jQuery.ajax({
|
||||
type : 'POST',
|
||||
url : 'index.php?entryPoint=HandleEcmAjax',
|
||||
data : {
|
||||
ecmclass : 'EcmDocumentNumberGenerator',
|
||||
job : 'getCorrectNumber',
|
||||
params : utf8_to_b64(JSON.stringifyNoSecurity(params)),
|
||||
},
|
||||
dataType : 'json',
|
||||
async : false,
|
||||
success : function(response) {
|
||||
$('#'+field_name).val(response);
|
||||
return;
|
||||
},
|
||||
error : function(xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var EcmDocumentNumberGenerator_getNumber = function(field_name, module, stock_id) {
|
||||
|
||||
var params = new Array;
|
||||
params[0] = module;
|
||||
params[1] = stock_id;
|
||||
|
||||
// AJAX call
|
||||
jQuery.ajax({
|
||||
type : 'POST',
|
||||
url : 'index.php?entryPoint=HandleEcmAjax',
|
||||
data : {
|
||||
ecmclass : 'EcmDocumentNumberGenerator',
|
||||
job : 'getNumber',
|
||||
params : utf8_to_b64(JSON.stringifyNoSecurity(params)),
|
||||
},
|
||||
dataType : 'json',
|
||||
async : false,
|
||||
success : function(response) {
|
||||
$('#'+field_name).val(response);
|
||||
return;
|
||||
},
|
||||
error : function(xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function utf8_to_b64( str ) {
|
||||
return window.btoa(unescape(encodeURIComponent( str )));
|
||||
}
|
||||
|
||||
function b64_to_utf8( str ) {
|
||||
return decodeURIComponent(escape(window.atob( str )));
|
||||
}
|
||||
|
||||
|
||||
var cl = function(m) {
|
||||
console.log(m);
|
||||
}
|
||||
205
include/ECM/EcmDropdownEditor/EcmDropdownEditor.js
Executable file
205
include/ECM/EcmDropdownEditor/EcmDropdownEditor.js
Executable file
@@ -0,0 +1,205 @@
|
||||
var EcmDropdownEditor_show = function(container) {
|
||||
|
||||
var div = $('[name='+container+']');
|
||||
var module = $('form[name=EditView]').find('input[name=module]').val();
|
||||
|
||||
var params = new Array;
|
||||
params[0] = module;
|
||||
params[1] = container;
|
||||
|
||||
// AJAX call
|
||||
jQuery.ajax({
|
||||
type : 'POST',
|
||||
url : 'index.php?entryPoint=HandleEcmAjax',
|
||||
data : {
|
||||
ecmclass : 'EcmDropdownEditor',
|
||||
job : 'getEditView',
|
||||
params : utf8_to_b64(JSON.stringifyNoSecurity(params)),
|
||||
},
|
||||
dataType : 'json',
|
||||
async : false,
|
||||
success : function(response) {
|
||||
div.html(response[0]);
|
||||
div.show();
|
||||
return;
|
||||
},
|
||||
error : function(xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError);
|
||||
}
|
||||
});
|
||||
|
||||
div.show();
|
||||
}
|
||||
|
||||
var EcmDropdownEditor_addOption = function(key) {
|
||||
// AJAX call
|
||||
jQuery.ajax({
|
||||
type : 'POST',
|
||||
url : 'index.php?entryPoint=HandleEcmAjax',
|
||||
data : {
|
||||
ecmclass : 'EcmDropdownEditor',
|
||||
job : 'getOptionTemplate',
|
||||
},
|
||||
dataType : 'json',
|
||||
async : false,
|
||||
success : function(response) {
|
||||
var optDiv = jQuery.parseHTML(response[0]);
|
||||
jQuery(response[0]).insertBefore(
|
||||
jQuery('[name=' + key + ']').find('span'));
|
||||
return;
|
||||
},
|
||||
error : function(xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var EcmDropdownEditor_save = function(dom, container) {
|
||||
if (!EcmDropdownEditor_validate(dom)) {
|
||||
return false;
|
||||
}
|
||||
var doms = EcmDropdownEditor_parseArrays(dom);
|
||||
var params = new Array;
|
||||
params[0] = dom; //name of list
|
||||
params[1] = doms;//list of values
|
||||
// AJAX call
|
||||
jQuery.ajax({
|
||||
type : 'POST',
|
||||
url : 'index.php?entryPoint=HandleEcmAjax',
|
||||
data : {
|
||||
ecmclass : 'EcmDropdownEditor',
|
||||
job : 'saveDom',
|
||||
params : utf8_to_b64(JSON.stringifyNoSecurity(params)),
|
||||
},
|
||||
dataType : 'json',
|
||||
async : false,
|
||||
success : function(response) {
|
||||
var div = $('[name='+container+']');
|
||||
div.hide();
|
||||
EcmDropdownEditor_refreshField(container);
|
||||
return;
|
||||
},
|
||||
error : function(xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var EcmDropdownEditor_refreshField = function(container) {
|
||||
|
||||
var module = $('form[name=EditView]').find('input[name=module]').val();
|
||||
|
||||
var params = new Array;
|
||||
params[0] = module;//list of values
|
||||
params[1] = container;//list of values
|
||||
// AJAX call
|
||||
jQuery.ajax({
|
||||
type : 'POST',
|
||||
url : 'index.php?entryPoint=HandleEcmAjax',
|
||||
data : {
|
||||
ecmclass : 'EcmDropdownEditor',
|
||||
job : 'refreshField',
|
||||
params : utf8_to_b64(JSON.stringifyNoSecurity(params)),
|
||||
},
|
||||
dataType : 'json',
|
||||
async : false,
|
||||
success : function(response) {
|
||||
var tmp = container.split("___");
|
||||
$('form[name=EditView]').find('select[name='+tmp[0]+']').html(response[0]);
|
||||
return;
|
||||
},
|
||||
error : function(xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var EcmDropdownEditor_cancel = function(container) {
|
||||
var div = $('[name='+container+']');
|
||||
div.html('');
|
||||
div.hide();
|
||||
}
|
||||
|
||||
var EcmDropdownEditor_parseArrays = function(dom) {
|
||||
var normal = {};
|
||||
var options = jQuery('[name=' + dom + ']').children('div');
|
||||
jQuery.each(options, function(key, val) {
|
||||
//check normal inputs
|
||||
var optionKey = jQuery(val).attr('name');
|
||||
console.log(val);
|
||||
var values = jQuery(val).children('input:not([name$=ext])');
|
||||
jQuery.each(values, function(key2, val2) {
|
||||
name = jQuery(val2).attr('name');
|
||||
if (!normal[name])
|
||||
normal[name] = {};
|
||||
normal[name][optionKey] = jQuery(val2).val();
|
||||
});
|
||||
});
|
||||
return normal;
|
||||
}
|
||||
|
||||
var EcmDropdownEditor_validate = function(dom) {
|
||||
var error = false;
|
||||
// get all options in DIV name = dom
|
||||
var options = jQuery('[name=' + dom + ']').children('div');
|
||||
// loop throw options looking for errors
|
||||
jQuery.each(options, function(key, val) {
|
||||
// check empty options
|
||||
var empty = true;
|
||||
var values = jQuery(val).children('input');
|
||||
jQuery.each(values, function(key2, val2) {
|
||||
valInput = jQuery(val2).val();
|
||||
valInput = valInput.trim();
|
||||
if (valInput.length != 0)
|
||||
empty = false;
|
||||
});
|
||||
if (empty)
|
||||
jQuery(val).remove(); // delete empty option
|
||||
values = null;
|
||||
//check normal inputs
|
||||
values = jQuery(val).children('input:not([name$=ext])');
|
||||
jQuery.each(values, function(key2, val2) {
|
||||
valInput = jQuery(val2).val();
|
||||
valInput = valInput.trim();
|
||||
if (valInput.length == 0) {
|
||||
jQuery(val2).addClass('dropdowneditor_error');
|
||||
error = true;
|
||||
} else
|
||||
jQuery(val2).removeClass('dropdowneditor_error');
|
||||
});
|
||||
});
|
||||
if (error) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
var EcmDropdownEditor_moveElementUp = function(el) {
|
||||
var parent = jQuery(el).parent();
|
||||
var prev = parent.prev();
|
||||
if (prev.length == 0)
|
||||
return;
|
||||
parent.insertBefore(prev);
|
||||
}
|
||||
|
||||
var EcmDropdownEditor_moveElementDown = function(el) {
|
||||
var parent = jQuery(el).parent();
|
||||
var next = parent.next();
|
||||
if (next.length == 0)
|
||||
return;
|
||||
parent.insertAfter(next);
|
||||
}
|
||||
|
||||
//helper
|
||||
function utf8_to_b64( str ) {
|
||||
return window.btoa(unescape(encodeURIComponent( str )));
|
||||
}
|
||||
|
||||
function b64_to_utf8( str ) {
|
||||
return decodeURIComponent(escape(window.atob( str )));
|
||||
}
|
||||
|
||||
|
||||
var cl = function(m) {
|
||||
console.log(m);
|
||||
}
|
||||
32
include/ECM/EcmMultiPdf/EcmMultiPdf.js
Executable file
32
include/ECM/EcmMultiPdf/EcmMultiPdf.js
Executable file
@@ -0,0 +1,32 @@
|
||||
var EcmMultiPdf_create = function(documents, outputName) {
|
||||
// fill params
|
||||
var params = new Array();
|
||||
params[0] = documents;
|
||||
|
||||
if (!(typeof outputName === 'undefined')) {
|
||||
if ((outputName.toUpperCase().substring((outputName.length) - 4,
|
||||
outputName.length)) != '.PDF')
|
||||
outputName += '.pdf';
|
||||
params[2] = outputName;
|
||||
}
|
||||
|
||||
|
||||
// AJAX call
|
||||
jQuery.ajax({
|
||||
type : 'POST',
|
||||
url : 'index.php?entryPoint=HandleEcmAjax',
|
||||
data : {
|
||||
ecmclass : 'EcmMultiPdf',
|
||||
job : 'create',
|
||||
params : btoa(JSON.stringify(params)),
|
||||
},
|
||||
dataType : 'json',
|
||||
success : function(response) {
|
||||
$.unblockUI();
|
||||
if (Number.isInteger(response[0]))
|
||||
alert('ERROR '+response[0]);
|
||||
else
|
||||
window.open(response[0]);
|
||||
},
|
||||
});
|
||||
}
|
||||
295
include/ECM/EcmNotifications/EcmNotifications.js
Executable file
295
include/ECM/EcmNotifications/EcmNotifications.js
Executable file
@@ -0,0 +1,295 @@
|
||||
// where our WebSockets logic will go later
|
||||
var socket, host;
|
||||
var notification_count = 0;
|
||||
var notification_array=new Array();
|
||||
var ajaxnotifications_url = "index.php?module=Schedulers&action=EcmNotificationAjax&to_pdf=1";
|
||||
var audiotypes = {
|
||||
"mp3" : "audio/mpeg",
|
||||
"mp4" : "audio/mp4",
|
||||
"ogg" : "audio/ogg",
|
||||
"wav" : "audio/wav"
|
||||
}
|
||||
|
||||
function ss_soundbits(sound) {
|
||||
var audio_element = document.createElement('audio')
|
||||
if (audio_element.canPlayType) {
|
||||
for (var i = 0; i < arguments.length; i++) {
|
||||
var source_element = document.createElement('source')
|
||||
source_element.setAttribute('src', arguments[i])
|
||||
if (arguments[i].match(/\.(\w+)$/i))
|
||||
source_element.setAttribute('type', audiotypes[RegExp.$1])
|
||||
audio_element.appendChild(source_element)
|
||||
}
|
||||
audio_element.load()
|
||||
audio_element.playclip = function() {
|
||||
audio_element.pause()
|
||||
audio_element.currentTime = 0
|
||||
audio_element.play()
|
||||
}
|
||||
return audio_element
|
||||
}
|
||||
}
|
||||
var clicksound = ss_soundbits(
|
||||
'include/ECM/EcmNotifications/sounds/bell_ring.ogg',
|
||||
"include/ECM/EcmNotifications/sounds/bell_ring.mp3")
|
||||
host = "wss://system.saas-systems.pl:444";
|
||||
function connect() {
|
||||
try {
|
||||
socket = new WebSocket(host);
|
||||
|
||||
addMessage("Socket State: " + socket.readyState);
|
||||
|
||||
socket.onopen = function() {
|
||||
addMessage("Socket Status: " + socket.readyState + " (open)");
|
||||
}
|
||||
|
||||
socket.onclose = function() {
|
||||
socket.close();
|
||||
}
|
||||
|
||||
socket.onmessage = function(msg) {
|
||||
|
||||
DrawMessage(msg.data);
|
||||
}
|
||||
} catch (exception) {
|
||||
addMessage("Error: " + exception);
|
||||
}
|
||||
}
|
||||
|
||||
function addMessage(msg) {
|
||||
$("#chat-log").append("<p>" + msg + "</p>");
|
||||
}
|
||||
|
||||
|
||||
|
||||
function DrawNotificationDiv(){
|
||||
var html='';
|
||||
|
||||
var toggle="if($('#notification_list').css('display')=='none'){$('#notification_list').show();}else{$('#notification_list').hide();}";
|
||||
if(notification_array.length>1){
|
||||
html='<a href="#" onclick="'+toggle+'">Masz <span style="color:red;">'+notification_array.length+'</span> nowe przypomnienia!</a>';
|
||||
}
|
||||
if(notification_array.length==0){
|
||||
html='<p>Brak nowych przypomnień.</p>';
|
||||
}
|
||||
if(notification_array.length==1) {
|
||||
html='<a href="#" onclick="'+toggle+'">Masz <span style="color:red;">1</span> nowe przypomnienie!</a>';
|
||||
}
|
||||
var div_header='<div id="notification_list" style="border: 1px solid #cccccc;background:#e6e6e6;padding:5px;position:absolute;display:none;">';
|
||||
for(var i=0;i<notification_array.length;i++){
|
||||
div_header+='<p><a href="#" onclick="createDialog(\''+i+'\');$(\'#notification_list\').hide();">Temat: '+notification_array[i].name+'</a></p><br>';
|
||||
}
|
||||
div_header+='</div>';
|
||||
$("#notification-Div").html(html+div_header);
|
||||
|
||||
|
||||
}
|
||||
|
||||
function makeid()
|
||||
{
|
||||
var text = "";
|
||||
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
||||
|
||||
for( var i=0; i < 5; i++ )
|
||||
text += possible.charAt(Math.floor(Math.random() * possible.length));
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
function leaveSelect(id){
|
||||
var html='<select id="leaveSel_'+id+'">';
|
||||
html+='<option value="1">5 minut</option>';
|
||||
html+='<option value="2">10 minut</option>';
|
||||
html+='<option value="3">15 minut</option>';
|
||||
html+='<option value="4">1 godzinię</option>';
|
||||
html+='<option value="5">2 godziny</option>';
|
||||
html+='<option value="6">3 godziny</option>';
|
||||
html+='<option value="7">1 dzien</option>';
|
||||
html+='<option value="8">2 dni</option>';
|
||||
html+='<option value="9">3 dni</option>';
|
||||
html+='</select>';
|
||||
return html;
|
||||
}
|
||||
|
||||
function dialogContent(obj,id){
|
||||
if(obj.date_start === null){
|
||||
obj.date_start='brak';
|
||||
}
|
||||
var toggle="if($('#leave_"+obj.id+"').css('display')=='none'){$('#leave_"+obj.id+"').show();}else{$('#leave_"+obj.id+"').hide();}";
|
||||
var html='<table><tr><td>Temat:</td><td><b>'+obj.name+'</b></td></tr>';
|
||||
html+='<tr><td>Data rozpoczęcia:</td><td><b>'+obj.date_start.substr(0,16)+'</b></td></tr>';
|
||||
html+='<tr><td>Opis:</td><td>'+obj.description+'</td></tr></table>';
|
||||
html+='<input type="button" value="Odłóż" name="button1" onclick="'+toggle+'" class="button" title="Odłóż"><br>';
|
||||
html+='<div id="leave_'+obj.id+'" style="display:none;"><table><tr><td>Na:</td><td>'+leaveSelect(obj.id)+'</td></tr></table>';
|
||||
html+='<br><input type="button" value="Zapisz" name="button1" onclick="saveNotification(\''+obj.id+'\',\''+id+'\');" class="button" title="Zapisz"></div>';
|
||||
return html;
|
||||
}
|
||||
|
||||
function saveNotification(id,index){
|
||||
var params = {
|
||||
job : 'changeNotificationDate',
|
||||
id : id,
|
||||
flag : $('#leaveSel_'+id+' :selected').val(),
|
||||
};
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : ajaxnotifications_url,
|
||||
dataType : "json",
|
||||
success : function(data) {
|
||||
if (data != '-1')
|
||||
|
||||
$( "#dialog_"+id ).dialog( "close" );
|
||||
|
||||
notification_array.splice(index, 1);
|
||||
send(id);
|
||||
DrawNotificationDiv();
|
||||
},
|
||||
data : params
|
||||
});
|
||||
}
|
||||
function showLeavedNotifications(data){
|
||||
for( var i=0; i < data.length; i++ ){
|
||||
createDialog(data[i]);
|
||||
}
|
||||
}
|
||||
|
||||
function getLeaveadNotifications(){
|
||||
|
||||
var params = {
|
||||
job : 'getLeaveadNotifications',
|
||||
user_id : $('#current_user_id').val(),
|
||||
};
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : ajaxnotifications_url,
|
||||
dataType : "json",
|
||||
success : function(data) {
|
||||
if (data != '-1'){
|
||||
notification_array=data;
|
||||
DrawNotificationDiv();
|
||||
}
|
||||
},
|
||||
data : params
|
||||
});
|
||||
}
|
||||
|
||||
function createDialog(obj){
|
||||
var id=obj;
|
||||
var obj=notification_array[obj];
|
||||
var div_id=makeid();
|
||||
|
||||
$( "#notification-Dialog" ).html('<div id="dialog_'+obj.id+'"></div>');
|
||||
$( "#dialog_"+obj.id).html(dialogContent(obj,id));
|
||||
$( "#dialog_"+obj.id).dialog({
|
||||
title: "Nowe przypomnienie o: "+obj.name.substr(0,15)+'...',
|
||||
open: function() { // open event handler
|
||||
$(this) // the element being dialogged
|
||||
.parent() // get the dialog widget element
|
||||
.find(".ui-dialog-titlebar-close") // find the close button for this dialog
|
||||
.hide(); // hide it
|
||||
},
|
||||
modal: true,
|
||||
buttons: {
|
||||
'Przyjąłem': function() {
|
||||
$( this ).dialog( "close" );
|
||||
},
|
||||
},
|
||||
beforeClose: function( event, ui ) {
|
||||
var params = {
|
||||
job : 'updateNotificationStatus',
|
||||
id : obj.id,
|
||||
flag : '2',
|
||||
};
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : ajaxnotifications_url,
|
||||
dataType : "json",
|
||||
success : function(data) {
|
||||
if (data != '-1')
|
||||
console.log(data);
|
||||
notification_array.splice(id, 1);
|
||||
send(obj.id);
|
||||
DrawNotificationDiv();
|
||||
},
|
||||
data : params
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
function srt(desc) {
|
||||
return function(a,b){
|
||||
return desc ? ~~(a < b) : ~~(a > b);
|
||||
};
|
||||
}
|
||||
|
||||
function checkExist(id){
|
||||
for(i=0;i<notification_array.length;i++){
|
||||
if(notification_array[i].id==id){
|
||||
notification_array.splice(i, 1);
|
||||
$( "#dialog_"+id ).dialog( "close" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function DrawMessage(msg) {
|
||||
|
||||
if (msg != '') {
|
||||
if(msg.length==36){
|
||||
// usuwanie nieaktualnych
|
||||
checkExist(msg);
|
||||
|
||||
DrawNotificationDiv();
|
||||
}
|
||||
var obj = JSON.parse(msg);
|
||||
|
||||
if (obj.assigned_user_id == $('#current_user_id').val()) {
|
||||
// dodawanie nowych
|
||||
clicksound.playclip();
|
||||
|
||||
checkExist(obj.id);
|
||||
|
||||
notification_array.unshift(obj);
|
||||
|
||||
// notification_array.push(obj);
|
||||
|
||||
DrawNotificationDiv();
|
||||
//createDialog(obj);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
// if(obj.)
|
||||
}
|
||||
function send(id) {
|
||||
var text = $("#message").val();
|
||||
if (text == '') {
|
||||
addMessage("Please Enter a Message");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
socket.send(id);
|
||||
addMessage("Sent: " + text)
|
||||
} catch (exception) {
|
||||
addMessage("Failed To Send")
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
$('#message').keypress(function(event) {
|
||||
if (event.keyCode == '13') {
|
||||
send();
|
||||
}
|
||||
});
|
||||
|
||||
$("#disconnect").click(function() {
|
||||
socket.close()
|
||||
});
|
||||
$( document ).ready(function() {
|
||||
connect();
|
||||
getLeaveadNotifications();
|
||||
|
||||
});
|
||||
196
include/ECM/EcmNumberFunctions.js
Executable file
196
include/ECM/EcmNumberFunctions.js
Executable file
@@ -0,0 +1,196 @@
|
||||
function UnformatNumber(number) {
|
||||
if (!number)
|
||||
number = 0;
|
||||
// make string..
|
||||
number = number + '';
|
||||
// remove 1000 sep
|
||||
while (number.indexOf('.') != -1)
|
||||
number = number.replace('.', '');
|
||||
// change ',' to '.'
|
||||
number = number.replace(',', '.');
|
||||
return parseFloat(number);
|
||||
}
|
||||
|
||||
function FormatNumber(number, precision) {
|
||||
if (!number) number = 0;
|
||||
var precision = precision == 0 || precision ? precision : 2;
|
||||
// make string..
|
||||
number = number + '';
|
||||
var minus = false;
|
||||
if (number.charAt(0) == '-') {
|
||||
minus = true;
|
||||
number = number.slice(1);
|
||||
}
|
||||
number = number.replace(',', '.');
|
||||
// round
|
||||
number = toFixed(number, precision);
|
||||
//Non numeric value
|
||||
if (number == 'NaN.NaN') return '0,00';
|
||||
if (number == 'Infinity') return '0,00';
|
||||
// add 1000 sep
|
||||
var tmp = number.split(".");
|
||||
var c = '';
|
||||
for (var i = tmp[0].length; i != -1; i--) {
|
||||
c += tmp[0].charAt(i);
|
||||
if ((tmp[0].length - i) == 0 || i == 0)
|
||||
continue;
|
||||
if ((tmp[0].length - i) % 3 == 0)
|
||||
c += '.';
|
||||
}
|
||||
// reverse c
|
||||
c = c.split("").reverse().join("");
|
||||
if (minus)
|
||||
c = '-' + c;
|
||||
return precision == 0 ? c : c + ',' + tmp[1];
|
||||
}
|
||||
|
||||
function FormatNumber2(number, precision) {
|
||||
if (!number) number = 0;
|
||||
var precision = precision == 0 || precision ? precision : 2;
|
||||
// make string..
|
||||
number = number + '';
|
||||
var minus = false;
|
||||
if (number.charAt(0) == '-') {
|
||||
minus = true;
|
||||
number = number.slice(1);
|
||||
}
|
||||
number = number.replace(',', '.');
|
||||
// round
|
||||
number = toFixed(number, precision);
|
||||
//Non numeric value
|
||||
if (number == 'NaN.NaN') return '0,00';
|
||||
if (number == 'Infinity') return '0,00';
|
||||
var tmp = number.split(".");
|
||||
var c = '';
|
||||
for (var i = tmp[0].length; i != -1; i--) {
|
||||
c += tmp[0].charAt(i);
|
||||
if ((tmp[0].length - i) == 0 || i == 0)
|
||||
continue;
|
||||
if ((tmp[0].length - i) % 3 == 0)
|
||||
c += '';
|
||||
}
|
||||
// reverse c
|
||||
c = c.split("").reverse().join("");
|
||||
if (minus)
|
||||
c = '-' + c;
|
||||
return precision == 0 ? c : c + ',' + tmp[1];
|
||||
}
|
||||
|
||||
function QuantityFormat(number,precision){
|
||||
if (!number) number = 0;
|
||||
var precision = precision == 0 || precision ? precision : 2;
|
||||
// make string..
|
||||
number = number + '';
|
||||
var minus = false;
|
||||
if (number.charAt(0) == '-') {
|
||||
minus = true;
|
||||
number = number.slice(1);
|
||||
}
|
||||
number = number.replace(',', '.');
|
||||
// round
|
||||
number = toFixed(number, precision);
|
||||
//Non numeric value
|
||||
if (number == 'NaN.NaN') return '0.000000';
|
||||
if (number == 'Infinity') return '0.000000';
|
||||
// add 1000 sep
|
||||
var tmp = number.split(".");
|
||||
var c = '';
|
||||
for (var i = tmp[0].length; i != -1; i--) {
|
||||
c += tmp[0].charAt(i);
|
||||
if ((tmp[0].length - i) == 0 || i == 0)
|
||||
continue;
|
||||
if ((tmp[0].length - i) % 3 == 0)
|
||||
c += '';
|
||||
}
|
||||
// reverse c
|
||||
c = c.split("").reverse().join("");
|
||||
if (minus)
|
||||
c = '-' + c;
|
||||
return precision == 0 ? c : c + '.' + tmp[1];
|
||||
}
|
||||
|
||||
function toFixed(value, precision) {
|
||||
var X = String(value);
|
||||
var precyzja = typeof precision !== 'undefined' ? parseInt(precision) : 2;
|
||||
precyzja = isNaN(precyzja) ? 2 : precyzja;
|
||||
var wynik = null;
|
||||
if (X.indexOf('.') >= 0) {
|
||||
var tab = X.split('.');
|
||||
if (tab[1].length >= (precyzja + 1)) {
|
||||
if (parseInt(tab[1][precyzja]) < 5) {
|
||||
tab[1] = tab[1].slice(0, precyzja);
|
||||
} else {
|
||||
tab[1] = tab[1].slice(0, precyzja);
|
||||
var tmp = parseInt(tab[1]);
|
||||
tmp = tmp + 1;
|
||||
tab[1] = String(tmp);
|
||||
if (tab[1].length > precyzja) {
|
||||
tmp = '';
|
||||
while (tmp.length < precyzja) {
|
||||
tmp += '0';
|
||||
}
|
||||
tab[1] = tmp;
|
||||
tmp = parseInt(tab[0]);
|
||||
tmp = tmp + 1;
|
||||
tab[0] = String(tmp);
|
||||
}
|
||||
|
||||
if (tab[1].length < precyzja) {
|
||||
tmp = '';
|
||||
while (tmp.length < precyzja - 1) {
|
||||
tmp += '0';
|
||||
}
|
||||
tab[1] = String(tmp) + String(tab[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
wynik = parseFloat(tab[0] + '.' + tab[1]).toFixed(precyzja);
|
||||
} else {
|
||||
wynik = parseFloat(X).toFixed(precyzja);
|
||||
}
|
||||
|
||||
return wynik;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
this is not number function !!@#$%^
|
||||
*/
|
||||
function checkIsTheSameContractor(){
|
||||
var error=false;
|
||||
var val='';
|
||||
$("input:checkbox[name='mass[]']:checked").each(function() {
|
||||
|
||||
if(val==''){
|
||||
|
||||
val=$("#mass_"+$(this).val()).val();
|
||||
if($("#mass_inv_"+$(this).val()).val()!=''){
|
||||
error=true;
|
||||
}
|
||||
} else {
|
||||
if( $("#mass_"+$(this).val()).val()!=val){
|
||||
error=true;
|
||||
}
|
||||
val=$("#mass_"+$(this).val()).val();
|
||||
if($("#mass_inv_"+$(this).val()).val()!=''){
|
||||
error=true;
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
return error;
|
||||
|
||||
}
|
||||
|
||||
function gotoInvoice(){
|
||||
var error=false;
|
||||
var val='';
|
||||
var ids=new Array();
|
||||
$("input:checkbox[name='mass[]']:checked").each(function() {
|
||||
$(this).val();
|
||||
ids.push( $(this).val());
|
||||
|
||||
});
|
||||
|
||||
window.open("index.php?module=EcmInvoiceOuts&action=EditView&isWZ=true&record="+ids.join('@'));
|
||||
}
|
||||
82
include/ECM/EcmPreviewPDF/EcmPreviewPDF.js
Executable file
82
include/ECM/EcmPreviewPDF/EcmPreviewPDF.js
Executable file
@@ -0,0 +1,82 @@
|
||||
// JavaScript Document
|
||||
|
||||
var pDivName = 'PreviewPDF_div';
|
||||
function EcmPreviewPDF(link,options) {
|
||||
if(typeof(options)!="object") options = new Object();
|
||||
if(!options.zoom) options.zoom = 100;
|
||||
if(!options.toolbar) options.toolbar = 0;
|
||||
|
||||
var div = document.getElementById(pDivName);
|
||||
if(!div) {
|
||||
div = document.createElement('div');
|
||||
div_tmp = '<div id=\'PreviewPDF_div\' style="display:none;position:absolute;left:0;top:0;background-color:#000000;width:100%;z-index:999;height:100%;background-image: url(\'include/ECM/EcmPreviewPDF/template/bar_pdf.gif\');background-repeat: repeat-x"><div style="height:23px;font-size:25px;color:white;"><div style="position:absolute;left:5;top:3;"></div><img style="position:absolute;right:2;top:0;cursor:pointer;" src="include/ECM/EcmPreviewPDF/template/x_pdf1.gif" onMouseOver="this.src=\'include/ECM/EcmPreviewPDF/template/x_pdf2.gif\';" onMouseOut="this.src=\'include/ECM/EcmPreviewPDF/template/x_pdf1.gif\';" onmousedown="this.src=\'include/ECM/EcmPreviewPDF/template/x_pdf3.gif\';" onmouseup="this.src=\'include/ECM/EcmPreviewPDF/template/x_pdf1.gif\';" onClick="HidePDF();" /></div><div id=\'PreviewPDF_div_pdf\'></div></div>';
|
||||
div.innerHTML = div_tmp;
|
||||
div = div.firstChild;
|
||||
document.body.appendChild(div);
|
||||
}
|
||||
if(div) {
|
||||
DisplayOther(false);
|
||||
div.style.display = '';
|
||||
var div_pdf = document.getElementById('PreviewPDF_div_pdf');
|
||||
var h_pdf = (div.offsetHeight-div.firstChild.offsetHeight);
|
||||
if(div_pdf) {
|
||||
div_pdf.innerHTML = "<iframe id=\"PreviewPDF_iframe_pdf\" name=\"PreviewPDF_iframe_pdf\" style='overflow-x: hidden;border:none;width:100%;height:"+h_pdf+"px;' frameborder='no' src='"+link+"#toolbar="+options.toolbar+"&zoom="+options.zoom+"'>Yours browser not accept iframes!</iframe>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function HidePDF() {
|
||||
var div = document.getElementById(pDivName);
|
||||
if(div) {
|
||||
DisplayOther(true);
|
||||
div.style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
function HidePDFIframe() {
|
||||
var div = parent.document.getElementById(pDivName);
|
||||
if(div) {
|
||||
DisplayOtherIframe(true);
|
||||
div.style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function DisplayOther(disp) {
|
||||
if(disp) display = ''; else display = 'none';
|
||||
for(var i = 0; i < document.body.childNodes.length; i++) {
|
||||
var node = document.body.childNodes[i];
|
||||
if(node && node.style) {
|
||||
if(disp) {
|
||||
if(node.setOldDisplay_pdf) {
|
||||
node.style.display = node.oldDisplay_pdf;
|
||||
node.setOldDisplay_pdf = false;
|
||||
}
|
||||
} else {
|
||||
node.oldDisplay_pdf = node.style.display;
|
||||
node.setOldDisplay_pdf = true;
|
||||
node.style.display = display;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function DisplayOtherIframe(disp) {
|
||||
if(disp) display = ''; else display = 'none';
|
||||
for(var i = 0; i < parent.document.body.childNodes.length; i++) {
|
||||
var node = parent.document.body.childNodes[i];
|
||||
if(node && node.style) {
|
||||
if(disp) {
|
||||
if(node.setOldDisplay_pdf) {
|
||||
node.style.display = node.oldDisplay_pdf;
|
||||
node.setOldDisplay_pdf = false;
|
||||
}
|
||||
} else {
|
||||
node.oldDisplay_pdf = node.style.display;
|
||||
node.setOldDisplay_pdf = true;
|
||||
node.style.display = display;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function HideMenu(){
|
||||
}
|
||||
82
include/ECM/EcmSendPdfButton/EcmSendPdfButton.js
Executable file
82
include/ECM/EcmSendPdfButton/EcmSendPdfButton.js
Executable file
@@ -0,0 +1,82 @@
|
||||
$(document).ready(function() {
|
||||
$('#addr_email').scombobox({
|
||||
fullMatch : false,
|
||||
invalidAsValue: true
|
||||
// when fullMatch is true
|
||||
// then highligh is also true by default
|
||||
});
|
||||
$('#addr_email').css('width','250px');
|
||||
$('.scombobox-display').css('width','250px');
|
||||
|
||||
});
|
||||
|
||||
var sendMailAjax = function(pdf_opt) {
|
||||
|
||||
var params = new Array;
|
||||
params[0] = $("#form :input[name='module']").val();
|
||||
params[1] = $("input[name='record']").val();
|
||||
params[2] = $(".scombobox-display").val();
|
||||
params[3] = $("#textarea").val();
|
||||
params[4] = pdf_opt;
|
||||
$(".loading_panel").css("display", "block");
|
||||
|
||||
jQuery.ajax({
|
||||
type : 'POST',
|
||||
url : 'index.php?entryPoint=HandleEcmAjax',
|
||||
data : {
|
||||
ecmclass : 'EcmSendPdfButton',
|
||||
job : 'sendEmailAjaxWithDocument',
|
||||
params : utf8_to_b64(JSON.stringifyNoSecurity(params)),
|
||||
},
|
||||
dataType : 'json',
|
||||
async : false,
|
||||
success : function(response) {
|
||||
console.log(response);
|
||||
if(response==1){
|
||||
$('#sendreturn').html('Wiadomość email została wysłana!');
|
||||
$('#sendreturn').show();
|
||||
} else {
|
||||
$('#sendreturn').html('<p style="color:red;">Wiadomość email NIE została wysłana!</p>');
|
||||
$('#sendreturn').show();
|
||||
}
|
||||
return;
|
||||
},
|
||||
error : function(xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError);
|
||||
}
|
||||
});
|
||||
$(".loading_panel").css("display", "none");
|
||||
$('#div_send').hide();
|
||||
}
|
||||
/*
|
||||
function sendMailAjax() {
|
||||
var ajax_url = "index.php?module=EcmSales&action=javahelper&to_pdf=1";
|
||||
$(".loading_panel").css("display", "block");
|
||||
var params = {
|
||||
job : 'SendMail',
|
||||
id : id,
|
||||
modulee : modulee,
|
||||
parent_id : parent_id,
|
||||
};
|
||||
$
|
||||
.ajax({
|
||||
type : "POST",
|
||||
url : ajax_url,
|
||||
dataType : "json",
|
||||
async : false,
|
||||
success : function(data) {
|
||||
if (data != '-1') {
|
||||
|
||||
$("#sendreturn").text(
|
||||
'Email z dokumentem został wysłany!');
|
||||
$("#sendreturn").show();
|
||||
} else {
|
||||
$("#sendreturn").text(
|
||||
'Email z dokumentem nie został wysłany!');
|
||||
$("#sendreturn").show();
|
||||
}
|
||||
},
|
||||
data : params
|
||||
});
|
||||
$(".loading_panel").css("display", "none");
|
||||
}*/
|
||||
1118
include/ECM/SearchProductTable.js
Normal file
1118
include/ECM/SearchProductTable.js
Normal file
File diff suppressed because it is too large
Load Diff
1361
include/ECM/comboselectbox.js
Executable file
1361
include/ECM/comboselectbox.js
Executable file
File diff suppressed because it is too large
Load Diff
8
include/ECM/loadEcmJsFiles.js
Executable file
8
include/ECM/loadEcmJsFiles.js
Executable file
@@ -0,0 +1,8 @@
|
||||
var scripts = new Array();
|
||||
var jsPath = 'include/ECM/';
|
||||
scripts.push('EcmMultiPdf/EcmMultiPdf.js');
|
||||
scripts.push('EcmDropdownEditor/EcmDropdownEditor.js');
|
||||
|
||||
$.each(scripts, function(k,v) {
|
||||
$.getScript(jsPath+v, function(){});
|
||||
} );
|
||||
233
include/ECM/open_flash_chart/js/swfobject.js
Executable file
233
include/ECM/open_flash_chart/js/swfobject.js
Executable file
@@ -0,0 +1,233 @@
|
||||
/**
|
||||
* SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
|
||||
*
|
||||
* SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
*
|
||||
*/
|
||||
if(typeof deconcept == "undefined") var deconcept = new Object();
|
||||
if(typeof deconcept.util == "undefined") deconcept.util = new Object();
|
||||
if(typeof deconcept.SWFObjectUtil == "undefined") deconcept.SWFObjectUtil = new Object();
|
||||
deconcept.SWFObject = function(swf, id, w, h, ver, c, quality, xiRedirectUrl, redirectUrl, detectKey) {
|
||||
if (!document.getElementById) { return; }
|
||||
this.DETECT_KEY = detectKey ? detectKey : 'detectflash';
|
||||
this.skipDetect = deconcept.util.getRequestParameter(this.DETECT_KEY);
|
||||
this.params = new Object();
|
||||
this.variables = new Object();
|
||||
this.attributes = new Array();
|
||||
if(swf) { this.setAttribute('swf', swf); }
|
||||
if(id) { this.setAttribute('id', id); }
|
||||
if(w) { this.setAttribute('width', w); }
|
||||
if(h) { this.setAttribute('height', h); }
|
||||
if(ver) { this.setAttribute('version', new deconcept.PlayerVersion(ver.toString().split("."))); }
|
||||
this.installedVer = deconcept.SWFObjectUtil.getPlayerVersion();
|
||||
if (!window.opera && document.all && this.installedVer.major > 7) {
|
||||
// only add the onunload cleanup if the Flash Player version supports External Interface and we are in IE
|
||||
deconcept.SWFObject.doPrepUnload = true;
|
||||
}
|
||||
if(c) { this.addParam('bgcolor', c); }
|
||||
var q = quality ? quality : 'high';
|
||||
this.addParam('quality', q);
|
||||
this.setAttribute('useExpressInstall', false);
|
||||
this.setAttribute('doExpressInstall', false);
|
||||
var xir = (xiRedirectUrl) ? xiRedirectUrl : window.location;
|
||||
this.setAttribute('xiRedirectUrl', xir);
|
||||
this.setAttribute('redirectUrl', '');
|
||||
if(redirectUrl) { this.setAttribute('redirectUrl', redirectUrl); }
|
||||
}
|
||||
deconcept.SWFObject.prototype = {
|
||||
useExpressInstall: function(path) {
|
||||
this.xiSWFPath = !path ? "expressinstall.swf" : path;
|
||||
this.setAttribute('useExpressInstall', true);
|
||||
},
|
||||
setAttribute: function(name, value){
|
||||
this.attributes[name] = value;
|
||||
},
|
||||
getAttribute: function(name){
|
||||
return this.attributes[name];
|
||||
},
|
||||
addParam: function(name, value){
|
||||
this.params[name] = value;
|
||||
},
|
||||
getParams: function(){
|
||||
return this.params;
|
||||
},
|
||||
addVariable: function(name, value){
|
||||
this.variables[name] = value;
|
||||
},
|
||||
getVariable: function(name){
|
||||
return this.variables[name];
|
||||
},
|
||||
getVariables: function(){
|
||||
return this.variables;
|
||||
},
|
||||
getVariablePairs: function(){
|
||||
var variablePairs = new Array();
|
||||
var key;
|
||||
var variables = this.getVariables();
|
||||
for(key in variables){
|
||||
variablePairs[variablePairs.length] = key +"="+ variables[key];
|
||||
}
|
||||
return variablePairs;
|
||||
},
|
||||
getSWFHTML: function() {
|
||||
var swfNode = "";
|
||||
if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { // netscape plugin architecture
|
||||
if (this.getAttribute("doExpressInstall")) {
|
||||
this.addVariable("MMplayerType", "PlugIn");
|
||||
this.setAttribute('swf', this.xiSWFPath);
|
||||
}
|
||||
swfNode = '<embed type="application/x-shockwave-flash" src="'+ this.getAttribute('swf') +'" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'" style="'+ this.getAttribute('style') +'"';
|
||||
swfNode += ' id="'+ this.getAttribute('id') +'" name="'+ this.getAttribute('id') +'" ';
|
||||
var params = this.getParams();
|
||||
for(var key in params){ swfNode += [key] +'="'+ params[key] +'" '; }
|
||||
var pairs = this.getVariablePairs().join("&");
|
||||
if (pairs.length > 0){ swfNode += 'flashvars="'+ pairs +'"'; }
|
||||
swfNode += '/>';
|
||||
} else { // PC IE
|
||||
if (this.getAttribute("doExpressInstall")) {
|
||||
this.addVariable("MMplayerType", "ActiveX");
|
||||
this.setAttribute('swf', this.xiSWFPath);
|
||||
}
|
||||
swfNode = '<object id="'+ this.getAttribute('id') +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'" style="'+ this.getAttribute('style') +'">';
|
||||
swfNode += '<param name="movie" value="'+ this.getAttribute('swf') +'" />';
|
||||
var params = this.getParams();
|
||||
for(var key in params) {
|
||||
swfNode += '<param name="'+ key +'" value="'+ params[key] +'" />';
|
||||
}
|
||||
var pairs = this.getVariablePairs().join("&");
|
||||
if(pairs.length > 0) {swfNode += '<param name="flashvars" value="'+ pairs +'" />';}
|
||||
swfNode += "</object>";
|
||||
}
|
||||
return swfNode;
|
||||
},
|
||||
write: function(elementId){
|
||||
if(this.getAttribute('useExpressInstall')) {
|
||||
// check to see if we need to do an express install
|
||||
var expressInstallReqVer = new deconcept.PlayerVersion([6,0,65]);
|
||||
if (this.installedVer.versionIsValid(expressInstallReqVer) && !this.installedVer.versionIsValid(this.getAttribute('version'))) {
|
||||
this.setAttribute('doExpressInstall', true);
|
||||
this.addVariable("MMredirectURL", escape(this.getAttribute('xiRedirectUrl')));
|
||||
document.title = document.title.slice(0, 47) + " - Flash Player Installation";
|
||||
this.addVariable("MMdoctitle", document.title);
|
||||
}
|
||||
}
|
||||
if(this.skipDetect || this.getAttribute('doExpressInstall') || this.installedVer.versionIsValid(this.getAttribute('version'))){
|
||||
var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId;
|
||||
n.innerHTML = this.getSWFHTML();
|
||||
return true;
|
||||
}else{
|
||||
if(this.getAttribute('redirectUrl') != "") {
|
||||
document.location.replace(this.getAttribute('redirectUrl'));
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/* ---- detection functions ---- */
|
||||
deconcept.SWFObjectUtil.getPlayerVersion = function(){
|
||||
var PlayerVersion = new deconcept.PlayerVersion([0,0,0]);
|
||||
if(navigator.plugins && navigator.mimeTypes.length){
|
||||
var x = navigator.plugins["Shockwave Flash"];
|
||||
if(x && x.description) {
|
||||
PlayerVersion = new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split("."));
|
||||
}
|
||||
}else if (navigator.userAgent && navigator.userAgent.indexOf("Windows CE") >= 0){ // if Windows CE
|
||||
var axo = 1;
|
||||
var counter = 3;
|
||||
while(axo) {
|
||||
try {
|
||||
counter++;
|
||||
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+ counter);
|
||||
// document.write("player v: "+ counter);
|
||||
PlayerVersion = new deconcept.PlayerVersion([counter,0,0]);
|
||||
} catch (e) {
|
||||
axo = null;
|
||||
}
|
||||
}
|
||||
} else { // Win IE (non mobile)
|
||||
// do minor version lookup in IE, but avoid fp6 crashing issues
|
||||
// see http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/
|
||||
try{
|
||||
var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
|
||||
}catch(e){
|
||||
try {
|
||||
var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
|
||||
PlayerVersion = new deconcept.PlayerVersion([6,0,21]);
|
||||
axo.AllowScriptAccess = "always"; // error if player version < 6.0.47 (thanks to Michael Williams @ Adobe for this code)
|
||||
} catch(e) {
|
||||
if (PlayerVersion.major == 6) {
|
||||
return PlayerVersion;
|
||||
}
|
||||
}
|
||||
try {
|
||||
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
|
||||
} catch(e) {}
|
||||
}
|
||||
if (axo != null) {
|
||||
PlayerVersion = new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
|
||||
}
|
||||
}
|
||||
return PlayerVersion;
|
||||
}
|
||||
deconcept.PlayerVersion = function(arrVersion){
|
||||
this.major = arrVersion[0] != null ? parseInt(arrVersion[0]) : 0;
|
||||
this.minor = arrVersion[1] != null ? parseInt(arrVersion[1]) : 0;
|
||||
this.rev = arrVersion[2] != null ? parseInt(arrVersion[2]) : 0;
|
||||
}
|
||||
deconcept.PlayerVersion.prototype.versionIsValid = function(fv){
|
||||
if(this.major < fv.major) return false;
|
||||
if(this.major > fv.major) return true;
|
||||
if(this.minor < fv.minor) return false;
|
||||
if(this.minor > fv.minor) return true;
|
||||
if(this.rev < fv.rev) return false;
|
||||
return true;
|
||||
}
|
||||
/* ---- get value of query string param ---- */
|
||||
deconcept.util = {
|
||||
getRequestParameter: function(param) {
|
||||
var q = document.location.search || document.location.hash;
|
||||
if (param == null) { return q; }
|
||||
if(q) {
|
||||
var pairs = q.substring(1).split("&");
|
||||
for (var i=0; i < pairs.length; i++) {
|
||||
if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
|
||||
return pairs[i].substring((pairs[i].indexOf("=")+1));
|
||||
}
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
/* fix for video streaming bug */
|
||||
deconcept.SWFObjectUtil.cleanupSWFs = function() {
|
||||
var objects = document.getElementsByTagName("OBJECT");
|
||||
for (var i = objects.length - 1; i >= 0; i--) {
|
||||
objects[i].style.display = 'none';
|
||||
for (var x in objects[i]) {
|
||||
if (typeof objects[i][x] == 'function') {
|
||||
objects[i][x] = function(){};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// fixes bug in some fp9 versions see http://blog.deconcept.com/2006/07/28/swfobject-143-released/
|
||||
if (deconcept.SWFObject.doPrepUnload) {
|
||||
if (!deconcept.unloadSet) {
|
||||
deconcept.SWFObjectUtil.prepUnload = function() {
|
||||
__flash_unloadHandler = function(){};
|
||||
__flash_savedUnloadHandler = function(){};
|
||||
window.attachEvent("onunload", deconcept.SWFObjectUtil.cleanupSWFs);
|
||||
}
|
||||
window.attachEvent("onbeforeunload", deconcept.SWFObjectUtil.prepUnload);
|
||||
deconcept.unloadSet = true;
|
||||
}
|
||||
}
|
||||
/* add document.getElementById if needed (mobile IE < 5) */
|
||||
if (!document.getElementById && document.all) { document.getElementById = function(id) { return document.all[id]; }}
|
||||
|
||||
/* add some aliases for ease of use/backwards compatibility */
|
||||
var getQueryParamValue = deconcept.util.getRequestParameter;
|
||||
var FlashObject = deconcept.SWFObject; // for legacy support
|
||||
var SWFObject = deconcept.SWFObject;
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
38
include/ECM/open_flash_chart2/js-ofc-library/ofc.js
Executable file
38
include/ECM/open_flash_chart2/js-ofc-library/ofc.js
Executable file
@@ -0,0 +1,38 @@
|
||||
function findSWF(movieName) {
|
||||
if (navigator.appName.indexOf("Microsoft")!= -1) {
|
||||
return window[movieName];
|
||||
} else {
|
||||
return document[movieName];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param index as integer.
|
||||
*
|
||||
* Returns a CLONE of the chart with one of the elements removed
|
||||
*/
|
||||
function chart_remove_element(chart, index)
|
||||
{
|
||||
|
||||
// global_showing_old_data = !global_showing_old_data;
|
||||
|
||||
// clone the chart
|
||||
var modified_chart = {};
|
||||
jQuery.extend(modified_chart, chart);
|
||||
|
||||
// remove the old data from the chart:
|
||||
var element = modified_chart.elements[1];
|
||||
var elements = new Array();
|
||||
var c=0;
|
||||
for(i=0; i<modified_chart.elements.length; i++)
|
||||
{
|
||||
if(i!=index)
|
||||
{
|
||||
elements[c] = modified_chart.elements[i];
|
||||
c++;
|
||||
}
|
||||
}
|
||||
modified_chart.elements = elements;
|
||||
return modified_chart;
|
||||
}
|
||||
271
include/ECM/open_flash_chart2/js-ofc-library/open_flash_chart.js
Executable file
271
include/ECM/open_flash_chart2/js-ofc-library/open_flash_chart.js
Executable file
@@ -0,0 +1,271 @@
|
||||
function ofc_chart() {
|
||||
this.elements = [];
|
||||
|
||||
this.set_title = function(title) {
|
||||
this.title = title;
|
||||
};
|
||||
this.add_element = function(new_element) {
|
||||
this.elements.push(new_element);
|
||||
};
|
||||
|
||||
this.set_x_axis = function(axis) {
|
||||
this.x_axis = axis;
|
||||
};
|
||||
|
||||
this.set_y_axis = function(axis) {
|
||||
this.y_axis = axis;
|
||||
};
|
||||
}
|
||||
|
||||
function ofc_element(type) {
|
||||
this.type = type;
|
||||
this.values = [];
|
||||
|
||||
this.set_values = function(values) {
|
||||
this.values = values;
|
||||
};
|
||||
|
||||
this.set_key = function(text, size) {
|
||||
this.text = text;
|
||||
this['font-size'] = size;
|
||||
};
|
||||
|
||||
this.set_colour = function(colour) {
|
||||
this.colour = colour;
|
||||
};
|
||||
}
|
||||
|
||||
function ofc_line() {
|
||||
ofc_element.apply(this, ['line']);
|
||||
}
|
||||
ofc_line.prototype = new ofc_element();
|
||||
|
||||
function ofc_bar() {
|
||||
ofc_element.apply(this, ['bar']);
|
||||
}
|
||||
ofc_bar.prototype = new ofc_element();
|
||||
|
||||
function ofc_scatter(colour) {
|
||||
ofc_element.apply(this, ['scatter']);
|
||||
this.set_colour(colour);
|
||||
|
||||
this.set_default_dot_style = function(dot_style) {
|
||||
this['dot-style'] = dot_style;
|
||||
};
|
||||
}
|
||||
ofc_scatter.prototype = new ofc_element();
|
||||
|
||||
function ofc_scatter_line(colour) {
|
||||
ofc_element.apply(this, ['scatter_line']);
|
||||
this.set_colour(colour);
|
||||
|
||||
this.set_default_dot_style = function(dot_style) {
|
||||
this['dot-style'] = dot_style;
|
||||
};
|
||||
|
||||
this.set_step_horizontal = function() {
|
||||
this.stepgraph = 'horizontal';
|
||||
};
|
||||
|
||||
this.set_step_vertical = function() {
|
||||
this.stepgraph = 'vertical';
|
||||
};
|
||||
}
|
||||
ofc_scatter_line.prototype = new ofc_element();
|
||||
|
||||
function ofc_title(text, style) {
|
||||
this.text = text;
|
||||
this.style = style;
|
||||
}
|
||||
|
||||
function ofc_axis() {
|
||||
this.set_range = function(min, max) {
|
||||
this.min = min;
|
||||
this.max = max;
|
||||
};
|
||||
|
||||
this.set_steps = function(steps) {
|
||||
this.steps = steps;
|
||||
};
|
||||
|
||||
this.set_stroke = function(stroke) {
|
||||
this.stroke = stroke;
|
||||
};
|
||||
|
||||
this.set_colour = function(colour) {
|
||||
this.colour = colour;
|
||||
};
|
||||
|
||||
this.set_grid_colour = function(grid_colour) {
|
||||
this['grid-colour'] = grid_colour;
|
||||
};
|
||||
|
||||
this.set_offset = function(offset) {
|
||||
this.offset = offset;
|
||||
};
|
||||
}
|
||||
|
||||
function ofc_x_axis() {
|
||||
this.set_tick_height = function(tick_height) {
|
||||
this['tick-height'] = tick_height;
|
||||
};
|
||||
|
||||
this.set_3d = function(threeD) {
|
||||
this['3d'] = threeD;
|
||||
};
|
||||
}
|
||||
ofc_x_axis.prototype = new ofc_axis();
|
||||
|
||||
function ofc_y_axis() {
|
||||
this.set_tick_length = function(tick_length) {
|
||||
this['tick-length'] = tick_length;
|
||||
};
|
||||
|
||||
this.set_grid_visible = function(grid_visible) {
|
||||
this['grid-visible'] = grid_visible;
|
||||
};
|
||||
|
||||
this.set_visible = function(visible) {
|
||||
this.visible = visible;
|
||||
};
|
||||
}
|
||||
ofc_y_axis.prototype = new ofc_axis();
|
||||
|
||||
function ofc_scatter_value(xVal, yVal, dot_size) {
|
||||
this.x = xVal || 0;
|
||||
this.y = yVal || 0;
|
||||
this['dot-size'] = dot_size;
|
||||
}
|
||||
|
||||
function ofc_dot_base(type, value) {
|
||||
this.type = type;
|
||||
this.value = value;
|
||||
|
||||
this.position = function position(xVal, yVal) {
|
||||
this.x = xVal;
|
||||
this.y = yVal;
|
||||
};
|
||||
}
|
||||
|
||||
function ofc_dot(value) {
|
||||
ofc_dot_base.apply(this, ['dot', value]);
|
||||
}
|
||||
ofc_dot.prototype = new ofc_dot();
|
||||
|
||||
function ofc_hollow_dot(value) {
|
||||
ofc_dot_base.apply(this, ['hollow-dot', value]);
|
||||
}
|
||||
ofc_hollow_dot.prototype = new ofc_dot_base();
|
||||
|
||||
function ofc_solid_dot(value) {
|
||||
ofc_dot_base.apply(this, ['solid-dot', value]);
|
||||
}
|
||||
ofc_solid_dot.prototype = new ofc_dot();
|
||||
|
||||
function ofc_star(value) {
|
||||
ofc_dot_base.apply(this, ['star', value]);
|
||||
}
|
||||
ofc_star.prototype = new ofc_dot_base();
|
||||
|
||||
function ofc_bow(value) {
|
||||
ofc_dot_base.apply(this, ['bow', value]);
|
||||
}
|
||||
ofc_bow.prototype = new ofc_dot_base();
|
||||
|
||||
function ofc_anchor(value) {
|
||||
ofc_dot_base.apply(this, ['anchor', value]);
|
||||
}
|
||||
ofc_anchor.prototype = new ofc_dot_base();
|
||||
|
||||
function ofc_pie() {
|
||||
ofc_element.apply(this, ['pie']);
|
||||
|
||||
this.add_animation = function(animation) {
|
||||
if (!this.animate) {
|
||||
this.animate = [];
|
||||
}
|
||||
this.animate.push(animation);
|
||||
};
|
||||
|
||||
this.set_alpha = function(alpha) {
|
||||
this.alpha = alpha;
|
||||
};
|
||||
|
||||
this.set_colours = function(colours) {
|
||||
this.colours = colours;
|
||||
};
|
||||
|
||||
this.set_start_angle = function(start_angle) {
|
||||
this['start-angle'] = start_angle;
|
||||
};
|
||||
|
||||
this.set_tooltip = function(tip) {
|
||||
this.tip = tip;
|
||||
};
|
||||
|
||||
this.set_gradient_fill = function() {
|
||||
this['gradient-fill'] = true;
|
||||
};
|
||||
|
||||
this.set_label_colour = function (label_colour) {
|
||||
this['label-colour'] = label_colour;
|
||||
};
|
||||
|
||||
this.set_no_labels = function() {
|
||||
this['no-labels'] = true;
|
||||
};
|
||||
|
||||
this.on_click = function(event) {
|
||||
this['on-click'] = event;
|
||||
};
|
||||
|
||||
this.radius = function(radius) {
|
||||
this.radius = radius;
|
||||
};
|
||||
}
|
||||
ofc_pie.prototype = new ofc_element();
|
||||
|
||||
function ofc_pie_value(value, label) {
|
||||
this.value = value;
|
||||
this.label = label;
|
||||
|
||||
this.set_colour = function(colour) {
|
||||
this.colour = colour;
|
||||
};
|
||||
|
||||
this.set_label = function(label, label_colour, font_size) {
|
||||
this.label = label;
|
||||
this['label-colour'] = label_colour;
|
||||
this['font-size'] = font_size;
|
||||
};
|
||||
|
||||
this.set_tooltip = function(tip) {
|
||||
this.tip = tip;
|
||||
};
|
||||
|
||||
this.on_click = function(event) {
|
||||
this['on-click'] = event;
|
||||
};
|
||||
|
||||
this.add_animation = function(animation) {
|
||||
if (!this.animate) {
|
||||
this.animate = [];
|
||||
}
|
||||
this.animate.push(animation);
|
||||
};
|
||||
}
|
||||
|
||||
function ofc_base_pie_animation(type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
function ofc_pie_fade() {
|
||||
ofc_base_pie_animation.apply(this, ['fade']);
|
||||
}
|
||||
ofc_pie_fade.prototype = new ofc_base_pie_animation();
|
||||
|
||||
function ofc_pie_bounce(distance) {
|
||||
ofc_base_pie_animation.apply(this, ['bounce']);
|
||||
this.distance = distance;
|
||||
}
|
||||
ofc_pie_bounce.prototype = new ofc_base_pie_animation();
|
||||
1
include/ECM/open_flash_chart2/js-ofc-library/open_flash_chart.min.js
vendored
Executable file
1
include/ECM/open_flash_chart2/js-ofc-library/open_flash_chart.min.js
vendored
Executable file
@@ -0,0 +1 @@
|
||||
function ofc_chart(){this.elements=[];this.set_title=function(a){this.title=a};this.add_element=function(a){this.elements.push(a)};this.set_x_axis=function(a){this.x_axis=a};this.set_y_axis=function(a){this.y_axis=a}}function ofc_element(a){this.type=a;this.values=[];this.set_values=function(b){this.values=b};this.set_key=function(c,b){this.text=c;this["font-size"]=b};this.set_colour=function(b){this.colour=b}}function ofc_line(){ofc_element.apply(this,["line"])}ofc_line.prototype=new ofc_element();function ofc_bar(){ofc_element.apply(this,["bar"])}ofc_bar.prototype=new ofc_element();function ofc_scatter(a){ofc_element.apply(this,["scatter"]);this.set_colour(a);this.set_default_dot_style=function(b){this["dot-style"]=b}}ofc_scatter.prototype=new ofc_element();function ofc_scatter_line(a){ofc_element.apply(this,["scatter_line"]);this.set_colour(a);this.set_default_dot_style=function(b){this["dot-style"]=b};this.set_step_horizontal=function(){this.stepgraph="horizontal"};this.set_step_vertical=function(){this.stepgraph="vertical"}}ofc_scatter_line.prototype=new ofc_element();function ofc_title(b,a){this.text=b;this.style=a}function ofc_axis(){this.set_range=function(b,a){this.min=b;this.max=a};this.set_steps=function(a){this.steps=a};this.set_stroke=function(a){this.stroke=a};this.set_colour=function(a){this.colour=a};this.set_grid_colour=function(a){this["grid-colour"]=a};this.set_offset=function(a){this.offset=a}}function ofc_x_axis(){this.set_tick_height=function(a){this["tick-height"]=a};this.set_3d=function(a){this["3d"]=a}}ofc_x_axis.prototype=new ofc_axis();function ofc_y_axis(){this.set_tick_length=function(a){this["tick-length"]=a};this.set_grid_visible=function(a){this["grid-visible"]=a};this.set_visible=function(a){this.visible=a}}ofc_y_axis.prototype=new ofc_axis();function ofc_scatter_value(b,a,c){this.x=b||0;this.y=a||0;this["dot-size"]=c}function ofc_dot_base(b,c){this.type=b;this.value=c;this.position=function a(e,d){this.x=e;this.y=d}}function ofc_dot(a){ofc_dot_base.apply(this,["dot",a])}ofc_dot.prototype=new ofc_dot();function ofc_hollow_dot(a){ofc_dot_base.apply(this,["hollow-dot",a])}ofc_hollow_dot.prototype=new ofc_dot_base();function ofc_solid_dot(a){ofc_dot_base.apply(this,["solid-dot",a])}ofc_solid_dot.prototype=new ofc_dot();function ofc_star(a){ofc_dot_base.apply(this,["star",a])}ofc_star.prototype=new ofc_dot_base();function ofc_bow(a){ofc_dot_base.apply(this,["bow",a])}ofc_bow.prototype=new ofc_dot_base();function ofc_anchor(a){ofc_dot_base.apply(this,["anchor",a])}ofc_anchor.prototype=new ofc_dot_base();function ofc_pie(){ofc_element.apply(this,["pie"]);this.add_animation=function(a){if(!this.animate){this.animate=[]}this.animate.push(a)};this.set_alpha=function(a){this.alpha=a};this.set_colours=function(a){this.colours=a};this.set_start_angle=function(a){this["start-angle"]=a};this.set_tooltip=function(a){this.tip=a};this.set_gradient_fill=function(){this["gradient-fill"]=true};this.set_label_colour=function(a){this["label-colour"]=a};this.set_no_labels=function(){this["no-labels"]=true};this.on_click=function(a){this["on-click"]=a};this.radius=function(a){this.radius=a}}ofc_pie.prototype=new ofc_element();function ofc_pie_value(b,a){this.value=b;this.label=a;this.set_colour=function(c){this.colour=c};this.set_label=function(e,d,c){this.label=e;this["label-colour"]=d;this["font-size"]=c};this.set_tooltip=function(c){this.tip=c};this.on_click=function(c){this["on-click"]=c};this.add_animation=function(c){if(!this.animate){this.animate=[]}this.animate.push(c)}}function ofc_base_pie_animation(a){this.type=a}function ofc_pie_fade(){ofc_base_pie_animation.apply(this,["fade"])}ofc_pie_fade.prototype=new ofc_base_pie_animation();function ofc_pie_bounce(a){ofc_base_pie_animation.apply(this,["bounce"]);this.distance=a}ofc_pie_bounce.prototype=new ofc_base_pie_animation();
|
||||
461
include/ECM/open_flash_chart2/js/json/json2.js
Executable file
461
include/ECM/open_flash_chart2/js/json/json2.js
Executable file
@@ -0,0 +1,461 @@
|
||||
/*
|
||||
http://www.JSON.org/json2.js
|
||||
2008-03-24
|
||||
|
||||
Public Domain.
|
||||
|
||||
NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
|
||||
|
||||
See http://www.JSON.org/js.html
|
||||
|
||||
This file creates a global JSON object containing three methods: stringify,
|
||||
parse, and quote.
|
||||
|
||||
|
||||
JSON.stringify(value, replacer, space)
|
||||
value any JavaScript value, usually an object or array.
|
||||
|
||||
replacer an optional parameter that determines how object
|
||||
values are stringified for objects without a toJSON
|
||||
method. It can be a function or an array.
|
||||
|
||||
space an optional parameter that specifies the indentation
|
||||
of nested structures. If it is omitted, the text will
|
||||
be packed without extra whitespace. If it is a number,
|
||||
it will specify the number of spaces to indent at each
|
||||
level. If it is a string (such as '\t'), it contains the
|
||||
characters used to indent at each level.
|
||||
|
||||
This method produces a JSON text from a JavaScript value.
|
||||
|
||||
When an object value is found, if the object contains a toJSON
|
||||
method, its toJSON method will be called and the result will be
|
||||
stringified. A toJSON method does not serialize: it returns the
|
||||
value represented by the name/value pair that should be serialized,
|
||||
or undefined if nothing should be serialized. The toJSON method will
|
||||
be passed the key associated with the value, and this will be bound
|
||||
to the object holding the key.
|
||||
|
||||
This is the toJSON method added to Dates:
|
||||
|
||||
function toJSON(key) {
|
||||
return this.getUTCFullYear() + '-' +
|
||||
f(this.getUTCMonth() + 1) + '-' +
|
||||
f(this.getUTCDate()) + 'T' +
|
||||
f(this.getUTCHours()) + ':' +
|
||||
f(this.getUTCMinutes()) + ':' +
|
||||
f(this.getUTCSeconds()) + 'Z';
|
||||
}
|
||||
|
||||
You can provide an optional replacer method. It will be passed the
|
||||
key and value of each member, with this bound to the containing
|
||||
object. The value that is returned from your method will be
|
||||
serialized. If your method returns undefined, then the member will
|
||||
be excluded from the serialization.
|
||||
|
||||
If no replacer parameter is provided, then a default replacer
|
||||
will be used:
|
||||
|
||||
function replacer(key, value) {
|
||||
return Object.hasOwnProperty.call(this, key) ?
|
||||
value : undefined;
|
||||
}
|
||||
|
||||
The default replacer is passed the key and value for each item in
|
||||
the structure. It excludes inherited members.
|
||||
|
||||
If the replacer parameter is an array, then it will be used to
|
||||
select the members to be serialized. It filters the results such
|
||||
that only members with keys listed in the replacer array are
|
||||
stringified.
|
||||
|
||||
Values that do not have JSON representaions, such as undefined or
|
||||
functions, will not be serialized. Such values in objects will be
|
||||
dropped; in arrays they will be replaced with null. You can use
|
||||
a replacer function to replace those with JSON values.
|
||||
JSON.stringify(undefined) returns undefined.
|
||||
|
||||
The optional space parameter produces a stringification of the value
|
||||
that is filled with line breaks and indentation to make it easier to
|
||||
read.
|
||||
|
||||
If the space parameter is a non-empty string, then that string will
|
||||
be used for indentation. If the space parameter is a number, then
|
||||
then indentation will be that many spaces.
|
||||
|
||||
Example:
|
||||
|
||||
text = JSON.stringify(['e', {pluribus: 'unum'}]);
|
||||
// text is '["e",{"pluribus":"unum"}]'
|
||||
|
||||
|
||||
text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
|
||||
// text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
|
||||
|
||||
|
||||
JSON.parse(text, reviver)
|
||||
This method parses a JSON text to produce an object or array.
|
||||
It can throw a SyntaxError exception.
|
||||
|
||||
The optional reviver parameter is a function that can filter and
|
||||
transform the results. It receives each of the keys and values,
|
||||
and its return value is used instead of the original value.
|
||||
If it returns what it received, then the structure is not modified.
|
||||
If it returns undefined then the member is deleted.
|
||||
|
||||
Example:
|
||||
|
||||
// Parse the text. Values that look like ISO date strings will
|
||||
// be converted to Date objects.
|
||||
|
||||
myData = JSON.parse(text, function (key, value) {
|
||||
var a;
|
||||
if (typeof value === 'string') {
|
||||
a =
|
||||
/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
|
||||
if (a) {
|
||||
return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
|
||||
+a[5], +a[6]));
|
||||
}
|
||||
}
|
||||
return value;
|
||||
});
|
||||
|
||||
|
||||
JSON.quote(text)
|
||||
This method wraps a string in quotes, escaping some characters
|
||||
as needed.
|
||||
|
||||
|
||||
This is a reference implementation. You are free to copy, modify, or
|
||||
redistribute.
|
||||
|
||||
USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD THIRD PARTY
|
||||
CODE INTO YOUR PAGES.
|
||||
*/
|
||||
|
||||
/*jslint regexp: true, forin: true, evil: true */
|
||||
|
||||
/*global JSON */
|
||||
|
||||
/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
|
||||
call, charCodeAt, floor, getUTCDate, getUTCFullYear, getUTCHours,
|
||||
getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join, length,
|
||||
parse, propertyIsEnumerable, prototype, push, quote, replace, stringify,
|
||||
test, toJSON, toString
|
||||
*/
|
||||
|
||||
if (!this.JSON) {
|
||||
|
||||
// Create a JSON object only if one does not already exist. We create the
|
||||
// object in a closure to avoid global variables.
|
||||
|
||||
JSON = function () {
|
||||
|
||||
function f(n) { // Format integers to have at least two digits.
|
||||
return n < 10 ? '0' + n : n;
|
||||
}
|
||||
|
||||
Date.prototype.toJSON = function () {
|
||||
|
||||
// Eventually, this method will be based on the date.toISOString method.
|
||||
|
||||
return this.getUTCFullYear() + '-' +
|
||||
f(this.getUTCMonth() + 1) + '-' +
|
||||
f(this.getUTCDate()) + 'T' +
|
||||
f(this.getUTCHours()) + ':' +
|
||||
f(this.getUTCMinutes()) + ':' +
|
||||
f(this.getUTCSeconds()) + 'Z';
|
||||
};
|
||||
|
||||
|
||||
var escapeable = /["\\\x00-\x1f\x7f-\x9f]/g,
|
||||
gap,
|
||||
indent,
|
||||
meta = { // table of character substitutions
|
||||
'\b': '\\b',
|
||||
'\t': '\\t',
|
||||
'\n': '\\n',
|
||||
'\f': '\\f',
|
||||
'\r': '\\r',
|
||||
'"' : '\\"',
|
||||
'\\': '\\\\'
|
||||
},
|
||||
rep;
|
||||
|
||||
|
||||
function quote(string) {
|
||||
|
||||
// If the string contains no control characters, no quote characters, and no
|
||||
// backslash characters, then we can safely slap some quotes around it.
|
||||
// Otherwise we must also replace the offending characters with safe escape
|
||||
// sequences.
|
||||
|
||||
return escapeable.test(string) ?
|
||||
'"' + string.replace(escapeable, function (a) {
|
||||
var c = meta[a];
|
||||
if (typeof c === 'string') {
|
||||
return c;
|
||||
}
|
||||
c = a.charCodeAt();
|
||||
return '\\u00' + Math.floor(c / 16).toString(16) +
|
||||
(c % 16).toString(16);
|
||||
}) + '"' :
|
||||
'"' + string + '"';
|
||||
}
|
||||
|
||||
|
||||
function str(key, holder) {
|
||||
|
||||
// Produce a string from holder[key].
|
||||
|
||||
var i, // The loop counter.
|
||||
k, // The member key.
|
||||
v, // The member value.
|
||||
length,
|
||||
mind = gap,
|
||||
partial,
|
||||
value = holder[key];
|
||||
|
||||
// If the value has a toJSON method, call it to obtain a replacement value.
|
||||
|
||||
if (value && typeof value === 'object' &&
|
||||
typeof value.toJSON === 'function') {
|
||||
value = value.toJSON(key);
|
||||
}
|
||||
|
||||
// If we were called with a replacer function, then call the replacer to
|
||||
// obtain a replacement value.
|
||||
|
||||
if (typeof rep === 'function') {
|
||||
value = rep.call(holder, key, value);
|
||||
}
|
||||
|
||||
// What happens next depends on the value's type.
|
||||
|
||||
switch (typeof value) {
|
||||
case 'string':
|
||||
return quote(value);
|
||||
|
||||
case 'number':
|
||||
|
||||
// JSON numbers must be finite. Encode non-finite numbers as null.
|
||||
|
||||
return isFinite(value) ? String(value) : 'null';
|
||||
|
||||
case 'boolean':
|
||||
case 'null':
|
||||
|
||||
// If the value is a boolean or null, convert it to a string. Note:
|
||||
// typeof null does not produce 'null'. The case is included here in
|
||||
// the remote chance that this gets fixed someday.
|
||||
|
||||
return String(value);
|
||||
|
||||
// If the type is 'object', we might be dealing with an object or an array or
|
||||
// null.
|
||||
|
||||
case 'object':
|
||||
|
||||
// Due to a specification blunder in ECMAScript, typeof null is 'object',
|
||||
// so watch out for that case.
|
||||
|
||||
if (!value) {
|
||||
return 'null';
|
||||
}
|
||||
|
||||
// Make an array to hold the partial results of stringifying this object value.
|
||||
|
||||
gap += indent;
|
||||
partial = [];
|
||||
|
||||
// If the object has a dontEnum length property, we'll treat it as an array.
|
||||
|
||||
if (typeof value.length === 'number' &&
|
||||
!(value.propertyIsEnumerable('length'))) {
|
||||
|
||||
// The object is an array. Stringify every element. Use null as a placeholder
|
||||
// for non-JSON values.
|
||||
|
||||
length = value.length;
|
||||
for (i = 0; i < length; i += 1) {
|
||||
partial[i] = str(i, value) || 'null';
|
||||
}
|
||||
|
||||
// Join all of the elements together, separated with commas, and wrap them in
|
||||
// brackets.
|
||||
|
||||
v = partial.length === 0 ? '[]' :
|
||||
gap ? '[\n' + gap + partial.join(',\n' + gap) +
|
||||
'\n' + mind + ']' :
|
||||
'[' + partial.join(',') + ']';
|
||||
gap = mind;
|
||||
return v;
|
||||
}
|
||||
|
||||
// If the replacer is an array, use it to select the members to be stringified.
|
||||
|
||||
if (typeof rep === 'object') {
|
||||
length = rep.length;
|
||||
for (i = 0; i < length; i += 1) {
|
||||
k = rep[i];
|
||||
if (typeof k === 'string') {
|
||||
v = str(k, value, rep);
|
||||
if (v) {
|
||||
partial.push(quote(k) + (gap ? ': ' : ':') + v);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
// Otherwise, iterate through all of the keys in the object.
|
||||
|
||||
for (k in value) {
|
||||
v = str(k, value, rep);
|
||||
if (v) {
|
||||
partial.push(quote(k) + (gap ? ': ' : ':') + v);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Join all of the member texts together, separated with commas,
|
||||
// and wrap them in braces.
|
||||
|
||||
v = partial.length === 0 ? '{}' :
|
||||
gap ? '{\n' + gap + partial.join(',\n' + gap) +
|
||||
'\n' + mind + '}' :
|
||||
'{' + partial.join(',') + '}';
|
||||
gap = mind;
|
||||
return v;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Return the JSON object containing the stringify, parse, and quote methods.
|
||||
|
||||
return {
|
||||
stringify: function (value, replacer, space) {
|
||||
|
||||
// The stringify method takes a value and an optional replacer, and an optional
|
||||
// space parameter, and returns a JSON text. The replacer can be a function
|
||||
// that can replace values, or an array of strings that will select the keys.
|
||||
// A default replacer method can be provided. Use of the space parameter can
|
||||
// produce text that is more easily readable.
|
||||
|
||||
var i;
|
||||
gap = '';
|
||||
indent = '';
|
||||
if (space) {
|
||||
|
||||
// If the space parameter is a number, make an indent string containing that
|
||||
// many spaces.
|
||||
|
||||
if (typeof space === 'number') {
|
||||
for (i = 0; i < space; i += 1) {
|
||||
indent += ' ';
|
||||
}
|
||||
|
||||
// If the space parameter is a string, it will be used as the indent string.
|
||||
|
||||
} else if (typeof space === 'string') {
|
||||
indent = space;
|
||||
}
|
||||
}
|
||||
|
||||
// If there is no replacer parameter, use the default replacer.
|
||||
|
||||
if (!replacer) {
|
||||
rep = function (key, value) {
|
||||
if (!Object.hasOwnProperty.call(this, key)) {
|
||||
return undefined;
|
||||
}
|
||||
return value;
|
||||
};
|
||||
|
||||
// The replacer can be a function or an array. Otherwise, throw an error.
|
||||
|
||||
} else if (typeof replacer === 'function' ||
|
||||
(typeof replacer === 'object' &&
|
||||
typeof replacer.length === 'number')) {
|
||||
rep = replacer;
|
||||
} else {
|
||||
throw new Error('JSON.stringify');
|
||||
}
|
||||
|
||||
// Make a fake root object containing our value under the key of ''.
|
||||
// Return the result of stringifying the value.
|
||||
|
||||
return str('', {'': value});
|
||||
},
|
||||
|
||||
|
||||
parse: function (text, reviver) {
|
||||
|
||||
// The parse method takes a text and an optional reviver function, and returns
|
||||
// a JavaScript value if the text is a valid JSON text.
|
||||
|
||||
var j;
|
||||
|
||||
function walk(holder, key) {
|
||||
|
||||
// The walk method is used to recursively walk the resulting structure so
|
||||
// that modifications can be made.
|
||||
|
||||
var k, v, value = holder[key];
|
||||
if (value && typeof value === 'object') {
|
||||
for (k in value) {
|
||||
if (Object.hasOwnProperty.call(value, k)) {
|
||||
v = walk(value, k);
|
||||
if (v !== undefined) {
|
||||
value[k] = v;
|
||||
} else {
|
||||
delete value[k];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return reviver.call(holder, key, value);
|
||||
}
|
||||
|
||||
|
||||
// Parsing happens in three stages. In the first stage, we run the text against
|
||||
// regular expressions that look for non-JSON patterns. We are especially
|
||||
// concerned with '()' and 'new' because they can cause invocation, and '='
|
||||
// because it can cause mutation. But just to be safe, we want to reject all
|
||||
// unexpected forms.
|
||||
|
||||
// We split the first stage into 4 regexp operations in order to work around
|
||||
// crippling inefficiencies in IE's and Safari's regexp engines. First we
|
||||
// replace all backslash pairs with '@' (a non-JSON character). Second, we
|
||||
// replace all simple value tokens with ']' characters. Third, we delete all
|
||||
// open brackets that follow a colon or comma or that begin the text. Finally,
|
||||
// we look to see that the remaining characters are only whitespace or ']' or
|
||||
// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
|
||||
|
||||
if (/^[\],:{}\s]*$/.test(text.replace(/\\["\\\/bfnrtu]/g, '@').
|
||||
replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']').
|
||||
replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
|
||||
|
||||
// In the second stage we use the eval function to compile the text into a
|
||||
// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
|
||||
// in JavaScript: it can begin a block or an object literal. We wrap the text
|
||||
// in parens to eliminate the ambiguity.
|
||||
|
||||
j = eval('(' + text + ')');
|
||||
|
||||
// In the optional third stage, we recursively walk the new structure, passing
|
||||
// each name/value pair to a reviver function for possible transformation.
|
||||
|
||||
return typeof reviver === 'function' ?
|
||||
walk({'': j}, '') : j;
|
||||
}
|
||||
|
||||
// If the text is not JSON parseable, then a SyntaxError is thrown.
|
||||
|
||||
throw new SyntaxError('JSON.parse');
|
||||
},
|
||||
|
||||
quote: quote
|
||||
};
|
||||
}();
|
||||
}
|
||||
5
include/ECM/open_flash_chart2/js/swfobject.js
Executable file
5
include/ECM/open_flash_chart2/js/swfobject.js
Executable file
File diff suppressed because one or more lines are too long
32
include/ECM/open_flash_chart2/perl-ofc-library/jquery-1.2.6.min.js
vendored
Executable file
32
include/ECM/open_flash_chart2/perl-ofc-library/jquery-1.2.6.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
461
include/ECM/open_flash_chart2/perl-ofc-library/json/json2.js
Executable file
461
include/ECM/open_flash_chart2/perl-ofc-library/json/json2.js
Executable file
@@ -0,0 +1,461 @@
|
||||
/*
|
||||
http://www.JSON.org/json2.js
|
||||
2008-03-24
|
||||
|
||||
Public Domain.
|
||||
|
||||
NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
|
||||
|
||||
See http://www.JSON.org/js.html
|
||||
|
||||
This file creates a global JSON object containing three methods: stringify,
|
||||
parse, and quote.
|
||||
|
||||
|
||||
JSON.stringify(value, replacer, space)
|
||||
value any JavaScript value, usually an object or array.
|
||||
|
||||
replacer an optional parameter that determines how object
|
||||
values are stringified for objects without a toJSON
|
||||
method. It can be a function or an array.
|
||||
|
||||
space an optional parameter that specifies the indentation
|
||||
of nested structures. If it is omitted, the text will
|
||||
be packed without extra whitespace. If it is a number,
|
||||
it will specify the number of spaces to indent at each
|
||||
level. If it is a string (such as '\t'), it contains the
|
||||
characters used to indent at each level.
|
||||
|
||||
This method produces a JSON text from a JavaScript value.
|
||||
|
||||
When an object value is found, if the object contains a toJSON
|
||||
method, its toJSON method will be called and the result will be
|
||||
stringified. A toJSON method does not serialize: it returns the
|
||||
value represented by the name/value pair that should be serialized,
|
||||
or undefined if nothing should be serialized. The toJSON method will
|
||||
be passed the key associated with the value, and this will be bound
|
||||
to the object holding the key.
|
||||
|
||||
This is the toJSON method added to Dates:
|
||||
|
||||
function toJSON(key) {
|
||||
return this.getUTCFullYear() + '-' +
|
||||
f(this.getUTCMonth() + 1) + '-' +
|
||||
f(this.getUTCDate()) + 'T' +
|
||||
f(this.getUTCHours()) + ':' +
|
||||
f(this.getUTCMinutes()) + ':' +
|
||||
f(this.getUTCSeconds()) + 'Z';
|
||||
}
|
||||
|
||||
You can provide an optional replacer method. It will be passed the
|
||||
key and value of each member, with this bound to the containing
|
||||
object. The value that is returned from your method will be
|
||||
serialized. If your method returns undefined, then the member will
|
||||
be excluded from the serialization.
|
||||
|
||||
If no replacer parameter is provided, then a default replacer
|
||||
will be used:
|
||||
|
||||
function replacer(key, value) {
|
||||
return Object.hasOwnProperty.call(this, key) ?
|
||||
value : undefined;
|
||||
}
|
||||
|
||||
The default replacer is passed the key and value for each item in
|
||||
the structure. It excludes inherited members.
|
||||
|
||||
If the replacer parameter is an array, then it will be used to
|
||||
select the members to be serialized. It filters the results such
|
||||
that only members with keys listed in the replacer array are
|
||||
stringified.
|
||||
|
||||
Values that do not have JSON representaions, such as undefined or
|
||||
functions, will not be serialized. Such values in objects will be
|
||||
dropped; in arrays they will be replaced with null. You can use
|
||||
a replacer function to replace those with JSON values.
|
||||
JSON.stringify(undefined) returns undefined.
|
||||
|
||||
The optional space parameter produces a stringification of the value
|
||||
that is filled with line breaks and indentation to make it easier to
|
||||
read.
|
||||
|
||||
If the space parameter is a non-empty string, then that string will
|
||||
be used for indentation. If the space parameter is a number, then
|
||||
then indentation will be that many spaces.
|
||||
|
||||
Example:
|
||||
|
||||
text = JSON.stringify(['e', {pluribus: 'unum'}]);
|
||||
// text is '["e",{"pluribus":"unum"}]'
|
||||
|
||||
|
||||
text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
|
||||
// text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
|
||||
|
||||
|
||||
JSON.parse(text, reviver)
|
||||
This method parses a JSON text to produce an object or array.
|
||||
It can throw a SyntaxError exception.
|
||||
|
||||
The optional reviver parameter is a function that can filter and
|
||||
transform the results. It receives each of the keys and values,
|
||||
and its return value is used instead of the original value.
|
||||
If it returns what it received, then the structure is not modified.
|
||||
If it returns undefined then the member is deleted.
|
||||
|
||||
Example:
|
||||
|
||||
// Parse the text. Values that look like ISO date strings will
|
||||
// be converted to Date objects.
|
||||
|
||||
myData = JSON.parse(text, function (key, value) {
|
||||
var a;
|
||||
if (typeof value === 'string') {
|
||||
a =
|
||||
/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
|
||||
if (a) {
|
||||
return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
|
||||
+a[5], +a[6]));
|
||||
}
|
||||
}
|
||||
return value;
|
||||
});
|
||||
|
||||
|
||||
JSON.quote(text)
|
||||
This method wraps a string in quotes, escaping some characters
|
||||
as needed.
|
||||
|
||||
|
||||
This is a reference implementation. You are free to copy, modify, or
|
||||
redistribute.
|
||||
|
||||
USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD THIRD PARTY
|
||||
CODE INTO YOUR PAGES.
|
||||
*/
|
||||
|
||||
/*jslint regexp: true, forin: true, evil: true */
|
||||
|
||||
/*global JSON */
|
||||
|
||||
/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
|
||||
call, charCodeAt, floor, getUTCDate, getUTCFullYear, getUTCHours,
|
||||
getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join, length,
|
||||
parse, propertyIsEnumerable, prototype, push, quote, replace, stringify,
|
||||
test, toJSON, toString
|
||||
*/
|
||||
|
||||
if (!this.JSON) {
|
||||
|
||||
// Create a JSON object only if one does not already exist. We create the
|
||||
// object in a closure to avoid global variables.
|
||||
|
||||
JSON = function () {
|
||||
|
||||
function f(n) { // Format integers to have at least two digits.
|
||||
return n < 10 ? '0' + n : n;
|
||||
}
|
||||
|
||||
Date.prototype.toJSON = function () {
|
||||
|
||||
// Eventually, this method will be based on the date.toISOString method.
|
||||
|
||||
return this.getUTCFullYear() + '-' +
|
||||
f(this.getUTCMonth() + 1) + '-' +
|
||||
f(this.getUTCDate()) + 'T' +
|
||||
f(this.getUTCHours()) + ':' +
|
||||
f(this.getUTCMinutes()) + ':' +
|
||||
f(this.getUTCSeconds()) + 'Z';
|
||||
};
|
||||
|
||||
|
||||
var escapeable = /["\\\x00-\x1f\x7f-\x9f]/g,
|
||||
gap,
|
||||
indent,
|
||||
meta = { // table of character substitutions
|
||||
'\b': '\\b',
|
||||
'\t': '\\t',
|
||||
'\n': '\\n',
|
||||
'\f': '\\f',
|
||||
'\r': '\\r',
|
||||
'"' : '\\"',
|
||||
'\\': '\\\\'
|
||||
},
|
||||
rep;
|
||||
|
||||
|
||||
function quote(string) {
|
||||
|
||||
// If the string contains no control characters, no quote characters, and no
|
||||
// backslash characters, then we can safely slap some quotes around it.
|
||||
// Otherwise we must also replace the offending characters with safe escape
|
||||
// sequences.
|
||||
|
||||
return escapeable.test(string) ?
|
||||
'"' + string.replace(escapeable, function (a) {
|
||||
var c = meta[a];
|
||||
if (typeof c === 'string') {
|
||||
return c;
|
||||
}
|
||||
c = a.charCodeAt();
|
||||
return '\\u00' + Math.floor(c / 16).toString(16) +
|
||||
(c % 16).toString(16);
|
||||
}) + '"' :
|
||||
'"' + string + '"';
|
||||
}
|
||||
|
||||
|
||||
function str(key, holder) {
|
||||
|
||||
// Produce a string from holder[key].
|
||||
|
||||
var i, // The loop counter.
|
||||
k, // The member key.
|
||||
v, // The member value.
|
||||
length,
|
||||
mind = gap,
|
||||
partial,
|
||||
value = holder[key];
|
||||
|
||||
// If the value has a toJSON method, call it to obtain a replacement value.
|
||||
|
||||
if (value && typeof value === 'object' &&
|
||||
typeof value.toJSON === 'function') {
|
||||
value = value.toJSON(key);
|
||||
}
|
||||
|
||||
// If we were called with a replacer function, then call the replacer to
|
||||
// obtain a replacement value.
|
||||
|
||||
if (typeof rep === 'function') {
|
||||
value = rep.call(holder, key, value);
|
||||
}
|
||||
|
||||
// What happens next depends on the value's type.
|
||||
|
||||
switch (typeof value) {
|
||||
case 'string':
|
||||
return quote(value);
|
||||
|
||||
case 'number':
|
||||
|
||||
// JSON numbers must be finite. Encode non-finite numbers as null.
|
||||
|
||||
return isFinite(value) ? String(value) : 'null';
|
||||
|
||||
case 'boolean':
|
||||
case 'null':
|
||||
|
||||
// If the value is a boolean or null, convert it to a string. Note:
|
||||
// typeof null does not produce 'null'. The case is included here in
|
||||
// the remote chance that this gets fixed someday.
|
||||
|
||||
return String(value);
|
||||
|
||||
// If the type is 'object', we might be dealing with an object or an array or
|
||||
// null.
|
||||
|
||||
case 'object':
|
||||
|
||||
// Due to a specification blunder in ECMAScript, typeof null is 'object',
|
||||
// so watch out for that case.
|
||||
|
||||
if (!value) {
|
||||
return 'null';
|
||||
}
|
||||
|
||||
// Make an array to hold the partial results of stringifying this object value.
|
||||
|
||||
gap += indent;
|
||||
partial = [];
|
||||
|
||||
// If the object has a dontEnum length property, we'll treat it as an array.
|
||||
|
||||
if (typeof value.length === 'number' &&
|
||||
!(value.propertyIsEnumerable('length'))) {
|
||||
|
||||
// The object is an array. Stringify every element. Use null as a placeholder
|
||||
// for non-JSON values.
|
||||
|
||||
length = value.length;
|
||||
for (i = 0; i < length; i += 1) {
|
||||
partial[i] = str(i, value) || 'null';
|
||||
}
|
||||
|
||||
// Join all of the elements together, separated with commas, and wrap them in
|
||||
// brackets.
|
||||
|
||||
v = partial.length === 0 ? '[]' :
|
||||
gap ? '[\n' + gap + partial.join(',\n' + gap) +
|
||||
'\n' + mind + ']' :
|
||||
'[' + partial.join(',') + ']';
|
||||
gap = mind;
|
||||
return v;
|
||||
}
|
||||
|
||||
// If the replacer is an array, use it to select the members to be stringified.
|
||||
|
||||
if (typeof rep === 'object') {
|
||||
length = rep.length;
|
||||
for (i = 0; i < length; i += 1) {
|
||||
k = rep[i];
|
||||
if (typeof k === 'string') {
|
||||
v = str(k, value, rep);
|
||||
if (v) {
|
||||
partial.push(quote(k) + (gap ? ': ' : ':') + v);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
// Otherwise, iterate through all of the keys in the object.
|
||||
|
||||
for (k in value) {
|
||||
v = str(k, value, rep);
|
||||
if (v) {
|
||||
partial.push(quote(k) + (gap ? ': ' : ':') + v);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Join all of the member texts together, separated with commas,
|
||||
// and wrap them in braces.
|
||||
|
||||
v = partial.length === 0 ? '{}' :
|
||||
gap ? '{\n' + gap + partial.join(',\n' + gap) +
|
||||
'\n' + mind + '}' :
|
||||
'{' + partial.join(',') + '}';
|
||||
gap = mind;
|
||||
return v;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Return the JSON object containing the stringify, parse, and quote methods.
|
||||
|
||||
return {
|
||||
stringify: function (value, replacer, space) {
|
||||
|
||||
// The stringify method takes a value and an optional replacer, and an optional
|
||||
// space parameter, and returns a JSON text. The replacer can be a function
|
||||
// that can replace values, or an array of strings that will select the keys.
|
||||
// A default replacer method can be provided. Use of the space parameter can
|
||||
// produce text that is more easily readable.
|
||||
|
||||
var i;
|
||||
gap = '';
|
||||
indent = '';
|
||||
if (space) {
|
||||
|
||||
// If the space parameter is a number, make an indent string containing that
|
||||
// many spaces.
|
||||
|
||||
if (typeof space === 'number') {
|
||||
for (i = 0; i < space; i += 1) {
|
||||
indent += ' ';
|
||||
}
|
||||
|
||||
// If the space parameter is a string, it will be used as the indent string.
|
||||
|
||||
} else if (typeof space === 'string') {
|
||||
indent = space;
|
||||
}
|
||||
}
|
||||
|
||||
// If there is no replacer parameter, use the default replacer.
|
||||
|
||||
if (!replacer) {
|
||||
rep = function (key, value) {
|
||||
if (!Object.hasOwnProperty.call(this, key)) {
|
||||
return undefined;
|
||||
}
|
||||
return value;
|
||||
};
|
||||
|
||||
// The replacer can be a function or an array. Otherwise, throw an error.
|
||||
|
||||
} else if (typeof replacer === 'function' ||
|
||||
(typeof replacer === 'object' &&
|
||||
typeof replacer.length === 'number')) {
|
||||
rep = replacer;
|
||||
} else {
|
||||
throw new Error('JSON.stringify');
|
||||
}
|
||||
|
||||
// Make a fake root object containing our value under the key of ''.
|
||||
// Return the result of stringifying the value.
|
||||
|
||||
return str('', {'': value});
|
||||
},
|
||||
|
||||
|
||||
parse: function (text, reviver) {
|
||||
|
||||
// The parse method takes a text and an optional reviver function, and returns
|
||||
// a JavaScript value if the text is a valid JSON text.
|
||||
|
||||
var j;
|
||||
|
||||
function walk(holder, key) {
|
||||
|
||||
// The walk method is used to recursively walk the resulting structure so
|
||||
// that modifications can be made.
|
||||
|
||||
var k, v, value = holder[key];
|
||||
if (value && typeof value === 'object') {
|
||||
for (k in value) {
|
||||
if (Object.hasOwnProperty.call(value, k)) {
|
||||
v = walk(value, k);
|
||||
if (v !== undefined) {
|
||||
value[k] = v;
|
||||
} else {
|
||||
delete value[k];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return reviver.call(holder, key, value);
|
||||
}
|
||||
|
||||
|
||||
// Parsing happens in three stages. In the first stage, we run the text against
|
||||
// regular expressions that look for non-JSON patterns. We are especially
|
||||
// concerned with '()' and 'new' because they can cause invocation, and '='
|
||||
// because it can cause mutation. But just to be safe, we want to reject all
|
||||
// unexpected forms.
|
||||
|
||||
// We split the first stage into 4 regexp operations in order to work around
|
||||
// crippling inefficiencies in IE's and Safari's regexp engines. First we
|
||||
// replace all backslash pairs with '@' (a non-JSON character). Second, we
|
||||
// replace all simple value tokens with ']' characters. Third, we delete all
|
||||
// open brackets that follow a colon or comma or that begin the text. Finally,
|
||||
// we look to see that the remaining characters are only whitespace or ']' or
|
||||
// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
|
||||
|
||||
if (/^[\],:{}\s]*$/.test(text.replace(/\\["\\\/bfnrtu]/g, '@').
|
||||
replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']').
|
||||
replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
|
||||
|
||||
// In the second stage we use the eval function to compile the text into a
|
||||
// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
|
||||
// in JavaScript: it can begin a block or an object literal. We wrap the text
|
||||
// in parens to eliminate the ambiguity.
|
||||
|
||||
j = eval('(' + text + ')');
|
||||
|
||||
// In the optional third stage, we recursively walk the new structure, passing
|
||||
// each name/value pair to a reviver function for possible transformation.
|
||||
|
||||
return typeof reviver === 'function' ?
|
||||
walk({'': j}, '') : j;
|
||||
}
|
||||
|
||||
// If the text is not JSON parseable, then a SyntaxError is thrown.
|
||||
|
||||
throw new SyntaxError('JSON.parse');
|
||||
},
|
||||
|
||||
quote: quote
|
||||
};
|
||||
}();
|
||||
}
|
||||
5
include/ECM/open_flash_chart2/perl-ofc-library/swfobject.js
Executable file
5
include/ECM/open_flash_chart2/perl-ofc-library/swfobject.js
Executable file
File diff suppressed because one or more lines are too long
5
include/ECM/open_flash_chart2/python-ofc-library/static/swfobject.js
Executable file
5
include/ECM/open_flash_chart2/python-ofc-library/static/swfobject.js
Executable file
File diff suppressed because one or more lines are too long
9
include/ECM/stopEnter.js
Executable file
9
include/ECM/stopEnter.js
Executable file
@@ -0,0 +1,9 @@
|
||||
//MZ 2013-02-23
|
||||
//disable ENTER on EditView forms
|
||||
function stopRKey(evt) {
|
||||
var evt = (evt) ? evt : ((event) ? event : null);
|
||||
var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
|
||||
if ((evt.keyCode == 13) && (node.type=="text")) {return false;}
|
||||
}
|
||||
console.log('chce');
|
||||
document.onkeypress = stopRKey;
|
||||
73
include/ECM/tablenavigator.js
Executable file
73
include/ECM/tablenavigator.js
Executable file
@@ -0,0 +1,73 @@
|
||||
(function ($) {
|
||||
$.fn.enableCellNavigation = function () {
|
||||
|
||||
var arrow = { left: 37, up: 38, right: 39, down: 40 };
|
||||
|
||||
// select all on focus
|
||||
this.find('input').keydown(function (e) {
|
||||
|
||||
// shortcut for key other than arrow keys
|
||||
if ($.inArray(e.which, [arrow.left, arrow.up, arrow.right, arrow.down]) < 0) { return; }
|
||||
|
||||
var input = e.target;
|
||||
var td = $(e.target).closest('td');
|
||||
var moveTo = null;
|
||||
|
||||
switch (e.which) {
|
||||
|
||||
case arrow.left: {
|
||||
if (input.selectionStart == 0) {
|
||||
var $myDiv = $("[id^=ui-id-]");
|
||||
moveTo = td.prev('td:has(input,textarea)');
|
||||
}
|
||||
break;
|
||||
}
|
||||
case arrow.right: {
|
||||
if (input.selectionEnd == input.value.length) {
|
||||
var $myDiv = $("[id^=ui-id-]");
|
||||
moveTo = td.next('td:has(input,textarea)');
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case arrow.up:
|
||||
case arrow.down: {
|
||||
|
||||
var tr = td.closest('tr');
|
||||
var pos = td[0].cellIndex;
|
||||
|
||||
var moveToRow = null;
|
||||
if (e.which == arrow.down) {
|
||||
var $myDiv = $("[id^=ui-id-]");
|
||||
moveToRow = tr.next('tr');
|
||||
}
|
||||
else if (e.which == arrow.up) {
|
||||
var $myDiv = $("[id^=ui-id-]");
|
||||
moveToRow = tr.prev('tr');
|
||||
}
|
||||
|
||||
if (moveToRow.length) {
|
||||
moveTo = $(moveToRow[0].cells[pos]);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
//sprawdza czy wyswietla sie pole autocomplete, jeśli tak to blokuje poruszanie po tabelce
|
||||
if (moveTo && moveTo.length && $myDiv.css('display') != 'block') {
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
moveTo.find('input,textarea').each(function (i, input) {
|
||||
input.focus();
|
||||
input.select();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
};
|
||||
})(jQuery);
|
||||
|
||||
44
include/JSON.js
Executable file
44
include/JSON.js
Executable file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
Copyright (c) 2005 JSON.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The Software shall be used for Good, not Evil.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
json.js
|
||||
|
||||
The global object JSON contains two methods.
|
||||
|
||||
JSON.stringify(value) takes a JavaScript value and produces a JSON text.
|
||||
The value must not be cyclical.
|
||||
|
||||
JSON.parse(text) takes a JSON text and produces a JavaScript value. It will
|
||||
return false if there is an error.
|
||||
|
||||
2008-10-10: New regular expressions copied in from the new json2.js file on http://json.org (released into the public domain), work better on Safari and IE for more complicated datasets
|
||||
*/
|
||||
var JSON=function(){var m={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},s={array:function(x){var a=['['],b,f,i,l=x.length,v;for(i=0;i<l;i+=1){v=x[i];f=s[typeof v];if(f){v=f(v);if(typeof v=='string'){if(b){a[a.length]=',';}
|
||||
a[a.length]=v;b=true;}}}
|
||||
a[a.length]=']';return a.join('');},'boolean':function(x){return String(x);},'null':function(x){return"null";},number:function(x){return isFinite(x)?String(x):'null';},object:function(x){if(x){if(x instanceof Array){return s.array(x);}
|
||||
var a=['{'],b,f,i,v;for(i in x){if(!x.hasOwnProperty||x.hasOwnProperty(i)){v=x[i];f=s[typeof v];if(f){v=f(v);if(typeof v=='string'){if(b){a[a.length]=',';}
|
||||
a.push(s.string(i),':',v);b=true;}}}}
|
||||
a[a.length]='}';return a.join('');}
|
||||
return'null';},string:function(x){var unicode=new String;for(var i=0;i<x.length;i++){var temp=x.charCodeAt(i).toString(16);while(temp.length<4){temp="0"+temp;}
|
||||
unicode+='\\u'+temp;}
|
||||
return'"'+unicode+'"';}};return{stringify:function(v){var f=s[typeof v];if(f){v=f(v);if(typeof v==='string'){var securityEnvelope="{asynchronous_key:'"+asynchronous_key+"', jsonObject:"+v+"}";return securityEnvelope;}}
|
||||
return;},destringify:function(str){},stringifyNoSecurity:function(v){var f=s[typeof v];if(f){v=f(v);if(typeof v==='string'){return v;}}
|
||||
return;},destringify:function(str){},parse:function(text){text=text.replace(/^\s*|\s*$/,'');if(text.substr){if(text.substr(0,11)=="while(1);/*"){text=text.substr(11);text=text.substr(0,(text.length-2));}}
|
||||
try{if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){return eval('('+text+')');}else{return false;}}catch(e){return false;}},parseNoSecurity:function(text){try{if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){return eval('('+text+')');}else{return false;}}catch(e){return false;}}};}();
|
||||
674
include/MySugar/javascript/MySugar.js
Executable file
674
include/MySugar/javascript/MySugar.js
Executable file
@@ -0,0 +1,674 @@
|
||||
/*******************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by SugarCRM,
|
||||
* Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by
|
||||
* the Free Software Foundation with the addition of the following permission
|
||||
* added to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED
|
||||
* WORK IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE
|
||||
* WARRANTY OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program; if not, see http://www.gnu.org/licenses or write to
|
||||
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License
|
||||
* version 3, these Appropriate Legal Notices must retain the display of the
|
||||
* "Powered by SugarCRM" logo. If the display of the logo is not reasonably
|
||||
* feasible for technical reasons, the Appropriate Legal Notices must display
|
||||
* the words "Powered by SugarCRM".
|
||||
******************************************************************************/
|
||||
SUGAR.mySugar = function() {
|
||||
var originalLayout = null;
|
||||
var configureDashletId = null;
|
||||
var currentDashlet = null;
|
||||
var leftColumnInnerHTML = null;
|
||||
var leftColObj = null;
|
||||
var maxCount;
|
||||
var warningLang;
|
||||
var activeTab = activePage;
|
||||
var current_user = current_user_id;
|
||||
var module = moduleName;
|
||||
var charts = new Object();
|
||||
if (module == 'Dashboard') {
|
||||
cookiePageIndex = current_user + "_activeDashboardPage";
|
||||
} else {
|
||||
cookiePageIndex = current_user + "_activePage";
|
||||
}
|
||||
var homepage_dd;
|
||||
return {
|
||||
clearChartsArray : function() {
|
||||
charts[activeTab] = new Object();
|
||||
},
|
||||
addToChartsArray : function(name, xmlFile, width, height, styleSheet,
|
||||
colorScheme, langFile) {
|
||||
if (charts[activeTab] == null) {
|
||||
charts[activeTab] = new Object();
|
||||
}
|
||||
charts[activeTab][name] = new Object();
|
||||
charts[activeTab][name]['name'] = name;
|
||||
charts[activeTab][name]['xmlFile'] = xmlFile;
|
||||
charts[activeTab][name]['width'] = width;
|
||||
charts[activeTab][name]['height'] = height;
|
||||
charts[activeTab][name]['styleSheet'] = styleSheet;
|
||||
charts[activeTab][name]['colorScheme'] = colorScheme;
|
||||
charts[activeTab][name]['langFile'] = langFile;
|
||||
},
|
||||
loadSugarChart : function(name, xmlFile, width, height, styleSheet,
|
||||
colorScheme, langFile) {
|
||||
loadChartSWF(name, xmlFile, width, height, styleSheet, colorScheme,
|
||||
langFile);
|
||||
},
|
||||
loadSugarCharts : function() {
|
||||
for (id in charts[activeTab]) {
|
||||
if (id != 'undefined') {
|
||||
SUGAR.mySugar.loadSugarChart(charts[activeTab][id]['name'],
|
||||
charts[activeTab][id]['xmlFile'],
|
||||
charts[activeTab][id]['width'],
|
||||
charts[activeTab][id]['height'],
|
||||
charts[activeTab][id]['styleSheet'],
|
||||
charts[activeTab][id]['colorScheme'],
|
||||
charts[activeTab][id]['langFile']);
|
||||
}
|
||||
}
|
||||
},
|
||||
getLayout : function(asString) {
|
||||
columns = new Array();
|
||||
for (je = 0; je < 3; je++) {
|
||||
dashlets = document.getElementById('col_' + activeTab + '_'
|
||||
+ je);
|
||||
if (dashlets != null) {
|
||||
dashletIds = new Array();
|
||||
for (wp = 0; wp < dashlets.childNodes.length; wp++) {
|
||||
if (typeof dashlets.childNodes[wp].id != 'undefined'
|
||||
&& dashlets.childNodes[wp].id
|
||||
.match(/dashlet_[\w-]*/)) {
|
||||
dashletIds.push(dashlets.childNodes[wp].id.replace(
|
||||
/dashlet_/, ''));
|
||||
}
|
||||
}
|
||||
if (asString)
|
||||
columns[je] = dashletIds.join(',');
|
||||
else
|
||||
columns[je] = dashletIds;
|
||||
}
|
||||
}
|
||||
if (asString)
|
||||
return columns.join('|');
|
||||
else
|
||||
return columns;
|
||||
},
|
||||
onDrag : function(e, id) {
|
||||
originalLayout = SUGAR.mySugar.getLayout(true);
|
||||
},
|
||||
onDrop : function(e, id) {
|
||||
newLayout = SUGAR.mySugar.getLayout(true);
|
||||
if (originalLayout != newLayout) {
|
||||
SUGAR.mySugar.saveLayout(newLayout);
|
||||
SUGAR.mySugar.loadSugarCharts();
|
||||
}
|
||||
},
|
||||
saveLayout : function(order) {
|
||||
ajaxStatus.showStatus(SUGAR.language.get('app_strings',
|
||||
'LBL_SAVING_LAYOUT'));
|
||||
var success = function(data) {
|
||||
ajaxStatus.showStatus(SUGAR.language.get('app_strings',
|
||||
'LBL_SAVED_LAYOUT'));
|
||||
window.setTimeout('ajaxStatus.hideStatus()', 2000);
|
||||
}
|
||||
url = 'index.php?to_pdf=1&module=' + module
|
||||
+ '&action=DynamicAction&DynamicAction=saveLayout&layout='
|
||||
+ order + '&selectedPage=' + activeTab;
|
||||
var cObj = YAHOO.util.Connect.asyncRequest('GET', url, {
|
||||
success : success,
|
||||
failure : success
|
||||
});
|
||||
},
|
||||
uncoverPage : function(id) {
|
||||
if (!SUGAR.isIE) {
|
||||
document.getElementById('dlg_c').style.display = 'none';
|
||||
}
|
||||
configureDlg.hide();
|
||||
if (document.getElementById('dashletType') == null) {
|
||||
dashletType = '';
|
||||
} else {
|
||||
dashletType = document.getElementById('dashletType').value;
|
||||
}
|
||||
SUGAR.mySugar.retrieveDashlet(SUGAR.mySugar.configureDashletId,
|
||||
dashletType);
|
||||
},
|
||||
configureDashlet : function(id) {
|
||||
ajaxStatus.showStatus(SUGAR.language.get('app_strings',
|
||||
'LBL_LOADING'));
|
||||
configureDlg = new YAHOO.widget.SimpleDialog("dlg", {
|
||||
visible : false,
|
||||
width : "510",
|
||||
effect : [ {
|
||||
effect : YAHOO.widget.ContainerEffect.SLIDE,
|
||||
duration : 0.5
|
||||
}, {
|
||||
effect : YAHOO.widget.ContainerEffect.FADE,
|
||||
duration : 0.5
|
||||
} ],
|
||||
fixedcenter : true,
|
||||
modal : true,
|
||||
draggable : false
|
||||
});
|
||||
fillInConfigureDiv = function(data) {
|
||||
ajaxStatus.hideStatus();
|
||||
try {
|
||||
eval(data.responseText);
|
||||
} catch (e) {
|
||||
result = new Array();
|
||||
result['header'] = 'error';
|
||||
result['body'] = 'There was an error handling this request.';
|
||||
}
|
||||
configureDlg.setHeader(result['header']);
|
||||
configureDlg.setBody(result['body']);
|
||||
var listeners = new YAHOO.util.KeyListener(document, {
|
||||
keys : 27
|
||||
}, {
|
||||
fn : function() {
|
||||
this.hide();
|
||||
},
|
||||
scope : configureDlg,
|
||||
correctScope : true
|
||||
});
|
||||
configureDlg.cfg.queueProperty("keylisteners", listeners);
|
||||
configureDlg.render(document.body);
|
||||
configureDlg.show();
|
||||
configureDlg.configFixedCenter(null, false);
|
||||
SUGAR.util.evalScript(result['body']);
|
||||
}
|
||||
SUGAR.mySugar.configureDashletId = id;
|
||||
var cObj = YAHOO.util.Connect
|
||||
.asyncRequest(
|
||||
'GET',
|
||||
'index.php?to_pdf=1&module='
|
||||
+ module
|
||||
+ '&action=DynamicAction&DynamicAction=configureDashlet&id='
|
||||
+ id, {
|
||||
success : fillInConfigureDiv,
|
||||
failure : fillInConfigureDiv
|
||||
}, null);
|
||||
},
|
||||
getFileDashlet : function(id, url, callback, dynamic) {
|
||||
var ids=Array();
|
||||
val=$('#dashlet_entire_'+id).find('input[id=transaction_checkbox]:checked');
|
||||
var type=$('#bankType_'+id).val();
|
||||
if(Object.keys(val).length>4){
|
||||
val.each(function( index ) {
|
||||
|
||||
ids.push( $( this ).val() );
|
||||
});
|
||||
ids.toString(',');
|
||||
|
||||
var params = {
|
||||
job : 'createCsvFile',
|
||||
ids : ids,
|
||||
bank: type,
|
||||
};
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : 'index.php?module=EcmPaymentStates&action=javahelper&to_pdf=1',
|
||||
dataType : "json",
|
||||
async : false,
|
||||
success : function(data) {
|
||||
window.open(data,'_blank');
|
||||
},
|
||||
data : params
|
||||
});
|
||||
} else {
|
||||
alert("Proszę zaznaczyć choć jedno pole!");
|
||||
|
||||
}
|
||||
$( '#bankcsv_'+id ).dialog('close');
|
||||
|
||||
return false;
|
||||
},
|
||||
retrieveDashlet : function(id, url, callback, dynamic) {
|
||||
ajaxStatus.showStatus(SUGAR.language.get('app_strings',
|
||||
'LBL_LOADING'));
|
||||
if (!url) {
|
||||
url = 'index.php?action=DynamicAction&DynamicAction=displayDashlet&module='
|
||||
+ module + '&to_pdf=1&id=' + id;
|
||||
is_chart_dashlet = false;
|
||||
} else if (url == 'predefined_chart') {
|
||||
url = 'index.php?action=DynamicAction&DynamicAction=displayDashlet&module='
|
||||
+ module + '&to_pdf=1&id=' + id;
|
||||
scriptUrl = 'index.php?action=DynamicAction&DynamicAction=getPredefinedChartScript&module='
|
||||
+ module + '&to_pdf=1&id=' + id;
|
||||
is_chart_dashlet = true;
|
||||
}
|
||||
if (dynamic) {
|
||||
url += '&dynamic=true';
|
||||
}
|
||||
var fillInDashlet = function(data) {
|
||||
ajaxStatus.hideStatus();
|
||||
if (data) {
|
||||
SUGAR.mySugar.currentDashlet.innerHTML = data.responseText;
|
||||
}
|
||||
SUGAR.util.evalScript(data.responseText);
|
||||
if (callback)
|
||||
callback();
|
||||
var processChartScript = function(scriptData) {
|
||||
SUGAR.util.evalScript(scriptData.responseText);
|
||||
SUGAR.mySugar.loadSugarChart(charts[activeTab][id]['name'],
|
||||
charts[activeTab][id]['xmlFile'],
|
||||
charts[activeTab][id]['width'],
|
||||
charts[activeTab][id]['height'],
|
||||
charts[activeTab][id]['styleSheet'],
|
||||
charts[activeTab][id]['colorScheme'],
|
||||
charts[activeTab][id]['langFile']);
|
||||
}
|
||||
if (typeof (is_chart_dashlet) == 'undefined') {
|
||||
is_chart_dashlet = false;
|
||||
}
|
||||
if (is_chart_dashlet) {
|
||||
var chartScriptObj = YAHOO.util.Connect.asyncRequest('GET',
|
||||
scriptUrl, {
|
||||
success : processChartScript,
|
||||
failure : processChartScript
|
||||
}, null);
|
||||
}
|
||||
}
|
||||
SUGAR.mySugar.currentDashlet = document
|
||||
.getElementById('dashlet_entire_' + id);
|
||||
var cObj = YAHOO.util.Connect.asyncRequest('GET', url, {
|
||||
success : fillInDashlet,
|
||||
failure : fillInDashlet
|
||||
}, null);
|
||||
return false;
|
||||
},
|
||||
setChooser : function() {
|
||||
var displayColumnsDef = new Array();
|
||||
var hideTabsDef = new Array();
|
||||
var left_td = document.getElementById('display_tabs_td');
|
||||
var right_td = document.getElementById('hide_tabs_td');
|
||||
var displayTabs = left_td.getElementsByTagName('select')[0];
|
||||
var hideTabs = right_td.getElementsByTagName('select')[0];
|
||||
for (i = 0; i < displayTabs.options.length; i++) {
|
||||
displayColumnsDef.push(displayTabs.options[i].value);
|
||||
}
|
||||
if (typeof hideTabs != 'undefined') {
|
||||
for (i = 0; i < hideTabs.options.length; i++) {
|
||||
hideTabsDef.push(hideTabs.options[i].value);
|
||||
}
|
||||
}
|
||||
document.getElementById('displayColumnsDef').value = displayColumnsDef
|
||||
.join('|');
|
||||
document.getElementById('hideTabsDef').value = hideTabsDef
|
||||
.join('|');
|
||||
},
|
||||
deleteDashlet : function(id) {
|
||||
if (confirm(SUGAR.language.get('app_strings',
|
||||
'LBL_REMOVE_DASHLET_CONFIRM'))) {
|
||||
ajaxStatus.showStatus(SUGAR.language.get('app_strings',
|
||||
'LBL_REMOVING_DASHLET'));
|
||||
del = function() {
|
||||
var success = function(data) {
|
||||
dashlet = document.getElementById('dashlet_' + id);
|
||||
dashlet.parentNode.removeChild(dashlet);
|
||||
ajaxStatus.showStatus(SUGAR.language.get('app_strings',
|
||||
'LBL_REMOVED_DASHLET'));
|
||||
window.setTimeout('ajaxStatus.hideStatus()', 2000);
|
||||
}
|
||||
var cObj = YAHOO.util.Connect
|
||||
.asyncRequest(
|
||||
'GET',
|
||||
'index.php?to_pdf=1&module='
|
||||
+ module
|
||||
+ '&action=DynamicAction&DynamicAction=deleteDashlet&activePage='
|
||||
+ activeTab + '&id=' + id, {
|
||||
success : success,
|
||||
failure : success
|
||||
}, null);
|
||||
}
|
||||
var anim = new YAHOO.util.Anim('dashlet_entire_' + id, {
|
||||
height : {
|
||||
to : 1
|
||||
}
|
||||
}, .5);
|
||||
anim.onComplete.subscribe(del);
|
||||
document.getElementById('dashlet_entire_' + id).style.overflow = 'hidden';
|
||||
anim.animate();
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
addDashlet : function(id, type, type_module) {
|
||||
ajaxStatus.hideStatus();
|
||||
columns = SUGAR.mySugar.getLayout();
|
||||
var num_dashlets = columns[0].length;
|
||||
if (typeof columns[1] == undefined) {
|
||||
num_dashlets = num_dashlets + columns[1].length;
|
||||
}
|
||||
if ((num_dashlets) >= SUGAR.mySugar.maxCount) {
|
||||
alert(SUGAR.language.get('app_strings',
|
||||
'LBL_MAX_DASHLETS_REACHED'));
|
||||
return;
|
||||
}
|
||||
ajaxStatus.showStatus(SUGAR.language.get('app_strings',
|
||||
'LBL_ADDING_DASHLET'));
|
||||
var success = function(data) {
|
||||
colZero = document.getElementById('col_' + activeTab + '_0');
|
||||
newDashlet = document.createElement('li');
|
||||
newDashlet.id = 'dashlet_' + data.responseText;
|
||||
newDashlet.className = 'noBullet active';
|
||||
newDashlet.innerHTML = '<div style="position: absolute; top: -1000px; overflow: hidden;" id="dashlet_entire_'
|
||||
+ data.responseText + '"></div>';
|
||||
colZero.insertBefore(newDashlet, colZero.firstChild);
|
||||
var finishRetrieve = function() {
|
||||
dashletEntire = document.getElementById('dashlet_entire_'
|
||||
+ data.responseText);
|
||||
dd = new ygDDList('dashlet_' + data.responseText);
|
||||
dd.setHandleElId('dashlet_header_' + data.responseText);
|
||||
dd.onMouseDown = SUGAR.mySugar.onDrag;
|
||||
dd.onDragDrop = SUGAR.mySugar.onDrop;
|
||||
ajaxStatus.showStatus(SUGAR.language.get('app_strings',
|
||||
'LBL_ADDED_DASHLET'));
|
||||
dashletRegion = YAHOO.util.Dom.getRegion(dashletEntire);
|
||||
dashletEntire.style.position = 'relative';
|
||||
dashletEntire.style.height = '1px';
|
||||
dashletEntire.style.top = '0px';
|
||||
dashletEntire.className = 'dashletPanel';
|
||||
var anim = new YAHOO.util.Anim('dashlet_entire_'
|
||||
+ data.responseText, {
|
||||
height : {
|
||||
to : dashletRegion.bottom - dashletRegion.top
|
||||
}
|
||||
}, .5);
|
||||
anim.onComplete.subscribe(function() {
|
||||
document.getElementById('dashlet_entire_'
|
||||
+ data.responseText).style.height = '100%';
|
||||
});
|
||||
anim.animate();
|
||||
window.setTimeout('ajaxStatus.hideStatus()', 2000);
|
||||
}
|
||||
if (type == 'module' || type == 'web') {
|
||||
url = null;
|
||||
type = 'module';
|
||||
} else if (type == 'predefined_chart') {
|
||||
url = 'predefined_chart';
|
||||
type = 'predefined_chart';
|
||||
} else if (type == 'chart') {
|
||||
url = 'chart';
|
||||
type = 'chart';
|
||||
}
|
||||
SUGAR.mySugar.retrieveDashlet(data.responseText, url,
|
||||
finishRetrieve, true);
|
||||
newLayout = SUGAR.mySugar.getLayout(true);
|
||||
SUGAR.mySugar.saveLayout(newLayout);
|
||||
}
|
||||
var cObj = YAHOO.util.Connect
|
||||
.asyncRequest(
|
||||
'GET',
|
||||
'index.php?to_pdf=1&module='
|
||||
+ module
|
||||
+ '&action=DynamicAction&DynamicAction=addDashlet&activeTab='
|
||||
+ activeTab + '&id=' + id + '&type=' + type
|
||||
+ '&type_module=' + type_module, {
|
||||
success : success,
|
||||
failure : success
|
||||
}, null);
|
||||
return false;
|
||||
},
|
||||
showDashletsDialog : function() {
|
||||
columns = SUGAR.mySugar.getLayout();
|
||||
var num_dashlets = 0;
|
||||
var i = 0;
|
||||
for (i = 0; i < 3; i++) {
|
||||
if (typeof columns[i] != "undefined") {
|
||||
num_dashlets = num_dashlets + columns[i].length;
|
||||
}
|
||||
}
|
||||
if ((num_dashlets) >= SUGAR.mySugar.maxCount) {
|
||||
alert(SUGAR.language.get('app_strings',
|
||||
'LBL_MAX_DASHLETS_REACHED'));
|
||||
return;
|
||||
}
|
||||
ajaxStatus.showStatus(SUGAR.language.get('app_strings',
|
||||
'LBL_LOADING'));
|
||||
var success = function(data) {
|
||||
eval(data.responseText);
|
||||
dashletsListDiv = document.getElementById('dashletsList');
|
||||
dashletsListDiv.innerHTML = response['html'];
|
||||
document.getElementById('dashletsDialog_c').style.display = '';
|
||||
SUGAR.mySugar.dashletsDialog.show();
|
||||
eval(response['script']);
|
||||
ajaxStatus.hideStatus();
|
||||
}
|
||||
var cObj = YAHOO.util.Connect
|
||||
.asyncRequest(
|
||||
'GET',
|
||||
'index.php?to_pdf=true&module='
|
||||
+ module
|
||||
+ '&action=DynamicAction&DynamicAction=dashletsDialog',
|
||||
{
|
||||
success : success,
|
||||
failure : success
|
||||
});
|
||||
return false;
|
||||
},
|
||||
closeDashletsDialog : function() {
|
||||
SUGAR.mySugar.dashletsDialog.hide();
|
||||
window
|
||||
.setTimeout(
|
||||
"document.getElementById('dashletsDialog_c').style.display = 'none';",
|
||||
2000);
|
||||
},
|
||||
toggleDashletCategories : function(category) {
|
||||
document.getElementById('search_string').value = '';
|
||||
document.getElementById('searchResults').innerHTML = '';
|
||||
var moduleTab = document.getElementById('moduleCategory');
|
||||
var moduleTabAnchor = document
|
||||
.getElementById('moduleCategoryAnchor');
|
||||
var moduleListDiv = document.getElementById('moduleDashlets');
|
||||
var chartTab = document.getElementById('chartCategory');
|
||||
var chartTabAnchor = document.getElementById('chartCategoryAnchor');
|
||||
var chartListDiv = document.getElementById('chartDashlets');
|
||||
var toolsTab = document.getElementById('toolsCategory');
|
||||
var toolsTabAnchor = document.getElementById('toolsCategoryAnchor');
|
||||
var toolsListDiv = document.getElementById('toolsDashlets');
|
||||
var webTab = document.getElementById('webCategory');
|
||||
var webTabAnchor = document.getElementById('webCategoryAnchor');
|
||||
var webListDiv = document.getElementById('webDashlets');
|
||||
switch (category) {
|
||||
case 'module':
|
||||
moduleTab.className = 'active';
|
||||
moduleTabAnchor.className = 'current';
|
||||
moduleListDiv.style.display = '';
|
||||
chartTab.className = '';
|
||||
chartTabAnchor.className = '';
|
||||
chartListDiv.style.display = 'none';
|
||||
toolsTab.className = '';
|
||||
toolsTabAnchor.className = '';
|
||||
toolsListDiv.style.display = 'none';
|
||||
webTab.className = '';
|
||||
webTabAnchor.className = '';
|
||||
webListDiv.style.display = 'none';
|
||||
break;
|
||||
case 'chart':
|
||||
moduleTab.className = '';
|
||||
moduleTabAnchor.className = '';
|
||||
moduleListDiv.style.display = 'none';
|
||||
chartTab.className = 'active';
|
||||
chartTabAnchor.className = 'current';
|
||||
chartListDiv.style.display = '';
|
||||
toolsTab.className = '';
|
||||
toolsTabAnchor.className = '';
|
||||
toolsListDiv.style.display = 'none';
|
||||
webTab.className = '';
|
||||
webTabAnchor.className = '';
|
||||
webListDiv.style.display = 'none';
|
||||
break;
|
||||
case 'tools':
|
||||
moduleTab.className = '';
|
||||
moduleTabAnchor.className = '';
|
||||
moduleListDiv.style.display = 'none';
|
||||
chartTab.className = '';
|
||||
chartTabAnchor.className = '';
|
||||
chartListDiv.style.display = 'none';
|
||||
toolsTab.className = 'active';
|
||||
toolsTabAnchor.className = 'current';
|
||||
toolsListDiv.style.display = '';
|
||||
webTab.className = '';
|
||||
webTabAnchor.className = '';
|
||||
webListDiv.style.display = 'none';
|
||||
break;
|
||||
case 'web':
|
||||
moduleTab.className = '';
|
||||
moduleTabAnchor.className = '';
|
||||
moduleListDiv.style.display = 'none';
|
||||
chartTab.className = '';
|
||||
chartTabAnchor.className = '';
|
||||
chartListDiv.style.display = 'none';
|
||||
toolsTab.className = '';
|
||||
toolsTabAnchor.className = '';
|
||||
toolsListDiv.style.display = 'none';
|
||||
webTab.className = 'active';
|
||||
webTabAnchor.className = 'current';
|
||||
webListDiv.style.display = '';
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
document.getElementById('search_category').value = category;
|
||||
},
|
||||
searchDashlets : function(searchStr, searchCategory) {
|
||||
var moduleTab = document.getElementById('moduleCategory');
|
||||
var moduleTabAnchor = document
|
||||
.getElementById('moduleCategoryAnchor');
|
||||
var moduleListDiv = document.getElementById('moduleDashlets');
|
||||
var chartTab = document.getElementById('chartCategory');
|
||||
var chartTabAnchor = document.getElementById('chartCategoryAnchor');
|
||||
var chartListDiv = document.getElementById('chartDashlets');
|
||||
var toolsTab = document.getElementById('toolsCategory');
|
||||
var toolsTabAnchor = document.getElementById('toolsCategoryAnchor');
|
||||
var toolsListDiv = document.getElementById('toolsDashlets');
|
||||
if (moduleTab != null && chartTab != null && toolsTab != null) {
|
||||
moduleListDiv.style.display = 'none';
|
||||
chartListDiv.style.display = 'none';
|
||||
toolsListDiv.style.display = 'none';
|
||||
} else {
|
||||
chartListDiv.style.display = 'none';
|
||||
}
|
||||
var searchResultsDiv = document.getElementById('searchResults');
|
||||
searchResultsDiv.style.display = '';
|
||||
var success = function(data) {
|
||||
eval(data.responseText);
|
||||
searchResultsDiv.innerHTML = response['html'];
|
||||
}
|
||||
var cObj = YAHOO.util.Connect
|
||||
.asyncRequest(
|
||||
'GET',
|
||||
'index.php?to_pdf=true&module='
|
||||
+ module
|
||||
+ '&action=DynamicAction&DynamicAction=searchDashlets&search='
|
||||
+ searchStr + '&category=' + searchCategory,
|
||||
{
|
||||
success : success,
|
||||
failure : success
|
||||
});
|
||||
return false;
|
||||
},
|
||||
collapseList : function(chartList) {
|
||||
document.getElementById(chartList + 'List').style.display = 'none';
|
||||
document.getElementById(chartList + 'ExpCol').innerHTML = '<a href="#" onClick="javascript:SUGAR.mySugar.expandList(\''
|
||||
+ chartList
|
||||
+ '\');"><img border="0" src="'
|
||||
+ SUGAR.themes.image_server
|
||||
+ 'index.php?entryPoint=getImage&themeName='
|
||||
+ SUGAR.themes.theme_name
|
||||
+ '&imageName=advanced_search.gif" align="absmiddle" />';
|
||||
},
|
||||
expandList : function(chartList) {
|
||||
document.getElementById(chartList + 'List').style.display = '';
|
||||
document.getElementById(chartList + 'ExpCol').innerHTML = '<a href="#" onClick="javascript:SUGAR.mySugar.collapseList(\''
|
||||
+ chartList
|
||||
+ '\');"><img border="0" src="'
|
||||
+ SUGAR.themes.image_server
|
||||
+ 'index.php?entryPoint=getImage&themeName='
|
||||
+ SUGAR.themes.theme_name
|
||||
+ '&imageName=basic_search.gif" align="absmiddle" />';
|
||||
},
|
||||
collapseReportList : function(reportChartList) {
|
||||
document.getElementById(reportChartList
|
||||
+ 'ReportsChartDashletsList').style.display = 'none';
|
||||
document.getElementById(reportChartList + 'ExpCol').innerHTML = '<a href="#" onClick="javascript:SUGAR.mySugar.expandReportList(\''
|
||||
+ reportChartList
|
||||
+ '\');"><img border="0" src="'
|
||||
+ SUGAR.themes.image_server
|
||||
+ 'index.php?entryPoint=getImage&themeName='
|
||||
+ SUGAR.themes.theme_name
|
||||
+ '&imageName=ProjectPlus.gif" align="absmiddle" />';
|
||||
},
|
||||
expandReportList : function(reportChartList) {
|
||||
document.getElementById(reportChartList
|
||||
+ 'ReportsChartDashletsList').style.display = '';
|
||||
document.getElementById(reportChartList + 'ExpCol').innerHTML = '<a href="#" onClick="javascript:SUGAR.mySugar.collapseReportList(\''
|
||||
+ reportChartList
|
||||
+ '\');"><img border="0" src="'
|
||||
+ SUGAR.themes.image_server
|
||||
+ 'index.php?entryPoint=getImage&themeName='
|
||||
+ SUGAR.themes.theme_name
|
||||
+ '&imageName=ProjectMinus.gif" align="absmiddle" />';
|
||||
},
|
||||
clearSearch : function() {
|
||||
document.getElementById('search_string').value = '';
|
||||
var moduleTab = document.getElementById('moduleCategory');
|
||||
var moduleTabAnchor = document
|
||||
.getElementById('moduleCategoryAnchor');
|
||||
var moduleListDiv = document.getElementById('moduleDashlets');
|
||||
document.getElementById('searchResults').innerHTML = '';
|
||||
if (moduleTab != null) {
|
||||
SUGAR.mySugar.toggleDashletCategories('module');
|
||||
} else {
|
||||
document.getElementById('searchResults').style.display = 'none';
|
||||
document.getElementById('chartDashlets').style.display = '';
|
||||
}
|
||||
},
|
||||
doneAddDashlets : function() {
|
||||
SUGAR.mySugar.dashletsDialog.hide();
|
||||
return false;
|
||||
},
|
||||
renderDashletsDialog : function() {
|
||||
SUGAR.mySugar.dashletsDialog = new YAHOO.widget.Dialog(
|
||||
"dashletsDialog", {
|
||||
width : "480px",
|
||||
height : "520px",
|
||||
fixedcenter : true,
|
||||
draggable : false,
|
||||
visible : false,
|
||||
modal : true,
|
||||
close : false
|
||||
});
|
||||
var listeners = new YAHOO.util.KeyListener(document, {
|
||||
keys : 27
|
||||
}, {
|
||||
fn : function() {
|
||||
SUGAR.mySugar.closeDashletsDialog();
|
||||
}
|
||||
});
|
||||
SUGAR.mySugar.dashletsDialog.cfg.queueProperty("keylisteners",
|
||||
listeners);
|
||||
document.getElementById('dashletsDialog').style.display = '';
|
||||
SUGAR.mySugar.dashletsDialog.render();
|
||||
document.getElementById('dashletsDialog_c').style.display = 'none';
|
||||
}
|
||||
};
|
||||
}();
|
||||
121
include/SubPanel/SubPanelTiles.js
Executable file
121
include/SubPanel/SubPanelTiles.js
Executable file
@@ -0,0 +1,121 @@
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
var request_id=0;var current_child_field='';var current_subpanel_url='';var child_field_loaded=new Object();var request_map=new Object();function get_module_name()
|
||||
{if(typeof(window.document.forms['DetailView'])=='undefined'){return'';}else{if(typeof(window.document.forms['DetailView'].elements['subpanel_parent_module'])!='undefined'&&window.document.forms['DetailView'].elements['subpanel_parent_module'].value!=''){return window.document.forms['DetailView'].elements['subpanel_parent_module'].value;}
|
||||
return window.document.forms['DetailView'].elements['module'].value;}}
|
||||
function subp_nav(m,i,a,t,r){if(t.href.search(/#/)<0){return;}
|
||||
if(a=='d'){a='DetailView';}else{a='EditView';}
|
||||
url="index.php?module="+m+"&action="+a+"&record="+i+"&parent_module="+get_module_name()+"&parent_id="+get_record_id()+"&return_module="+get_module_name()+"&return_id="+get_record_id()+"&return_action=DetailView";if(r)
|
||||
{url+="&return_relationship="+r;}
|
||||
t.href=url;}
|
||||
function sub_p_rem(sp,lf,li,rp){return_url="index.php?module="+get_module_name()+"&action=SubPanelViewer&subpanel="+sp+"&record="+get_record_id()+"&sugar_body_only=1&inline=1";remove_url="index.php?module="+get_module_name()
|
||||
+"&action=DeleteRelationship"
|
||||
+"&record="+get_record_id()
|
||||
+"&linked_field="+lf
|
||||
+"&linked_id="+li
|
||||
+"&return_url="+escape(escape(return_url))
|
||||
+"&refresh_page="+rp;showSubPanel(sp,remove_url,true);}
|
||||
function sp_rem_conf(){return confirm(SUGAR.language.get('app_strings','NTC_REMOVE_CONFIRMATION'))}
|
||||
function get_record_id()
|
||||
{return window.document.forms['DetailView'].elements['record'].value;}
|
||||
function get_layout_def_key()
|
||||
{if(typeof(window.document.forms['DetailView'].elements['layout_def_key'])=='undefined')return'';return window.document.forms['DetailView'].elements['layout_def_key'].value;}
|
||||
function save_finished(args)
|
||||
{var child_field=request_map[args.request_id];delete(child_field_loaded[child_field]);showSubPanel(child_field);}
|
||||
function set_return_and_save_background(popup_reply_data)
|
||||
{var form_name=popup_reply_data.form_name;var name_to_value_array=popup_reply_data.name_to_value_array;var passthru_data=popup_reply_data.passthru_data;var query_array=new Array();if(name_to_value_array!='undefined'){for(var the_key in name_to_value_array)
|
||||
{if(the_key=='toJSON')
|
||||
{}
|
||||
else
|
||||
{query_array.push(the_key+"="+name_to_value_array[the_key]);}}}
|
||||
var selection_list=popup_reply_data.selection_list;if(selection_list!='undefined'){for(var the_key in selection_list)
|
||||
{query_array.push('subpanel_id[]='+selection_list[the_key])}}
|
||||
var module=get_module_name();var id=get_record_id();query_array.push('value=DetailView');query_array.push('module='+module);query_array.push('http_method=get');query_array.push('return_module='+module);query_array.push('return_id='+id);query_array.push('record='+id);query_array.push('isDuplicate=false');query_array.push('action=Save2');query_array.push('inline=1');var refresh_page=escape(passthru_data['refresh_page']);for(prop in passthru_data){if(prop=='link_field_name'){query_array.push('subpanel_field_name='+escape(passthru_data[prop]));}else{if(prop=='module_name'){query_array.push('subpanel_module_name='+escape(passthru_data[prop]));}else{query_array.push(prop+'='+escape(passthru_data[prop]));}}}
|
||||
var query_string=query_array.join('&');request_map[request_id]=passthru_data['child_field'];var returnstuff=http_fetch_sync('index.php',query_string);request_id++;got_data(returnstuff,true);if(refresh_page==1){document.location.reload(true);}}
|
||||
function got_data(args,inline)
|
||||
{var list_subpanel=document.getElementById('list_subpanel_'+request_map[args.request_id].toLowerCase());if(list_subpanel!=null){var subpanel=document.getElementById('subpanel_'+request_map[args.request_id].toLowerCase());var child_field=request_map[args.request_id].toLowerCase();if(inline){buttonHTML='';trEls=list_subpanel.getElementsByTagName('tr');if(trEls&&trEls.length>0){for(x in trEls){if(trEls[x]&&trEls[x].className=='pagination'){tableEls=trEls[x].getElementsByTagName('table');tdEls=tableEls[0].getElementsByTagName('td');span=tdEls[0].getElementsByTagName('span');if(span){buttonHTML=span[0].innerHTML;}
|
||||
break;}}}
|
||||
child_field_loaded[child_field]=2;list_subpanel.innerHTML='';list_subpanel.innerHTML=args.responseText;if(buttonHTML!=''){list_subpanel=document.getElementById('list_subpanel_'+request_map[args.request_id].toLowerCase());trEls=list_subpanel.getElementsByTagName('tr');for(x in trEls){if(trEls[x]&&trEls[x].className=='pagination'){tableEls=trEls[x].getElementsByTagName('table');tdEls=tableEls[0].getElementsByTagName('td');span=tdEls[0].getElementsByTagName('span');span[0].innerHTML=buttonHTML;break;}}}}else{child_field_loaded[child_field]=1;subpanel.innerHTML='';subpanel.innerHTML=args.responseText;var inlineTable=subpanel.getElementsByTagName('table');inlineTable=inlineTable[1];inlineTable=subpanel.removeChild(inlineTable);var listDiv=document.createElement('div');listDiv.id='list_subpanel_'+request_map[args.request_id].toLowerCase();subpanel.appendChild(listDiv);listDiv.appendChild(inlineTable);}
|
||||
subpanel.style.display='';set_div_cookie(subpanel.cookie_name,'');if(current_child_field!=''&&child_field!=current_child_field)
|
||||
{}
|
||||
current_child_field=child_field;}}
|
||||
function showSubPanel(child_field,url,force_load,layout_def_key)
|
||||
{var inline=1;if(typeof(force_load)=='undefined'||force_load==null)
|
||||
{force_load=false;}
|
||||
if(force_load||typeof(child_field_loaded[child_field])=='undefined')
|
||||
{request_map[request_id]=child_field;if(typeof(url)=='undefined'||url==null)
|
||||
{var module=get_module_name();var id=get_record_id();if(typeof(layout_def_key)=='undefined'||layout_def_key==null){layout_def_key=get_layout_def_key();}
|
||||
url='index.php?sugar_body_only=1&module='+module+'&subpanel='+child_field+'&action=SubPanelViewer&inline='+inline+'&record='+id+'&layout_def_key='+layout_def_key;}
|
||||
if(url.indexOf('http://')!=0&&url.indexOf('https://')!=0)
|
||||
{url=''+url;}
|
||||
current_subpanel_url=url;var returnstuff=http_fetch_sync(url+'&inline='+inline+'&ajaxSubpanel=true');request_id++;got_data(returnstuff,inline);}
|
||||
else
|
||||
{var subpanel=document.getElementById('subpanel_'+child_field);subpanel.style.display='';set_div_cookie(subpanel.cookie_name,'');if(current_child_field!=''&&child_field!=current_child_field)
|
||||
{hideSubPanel(current_child_field);}
|
||||
current_child_field=child_field;}
|
||||
if(typeof(url)!='undefined'&&url!=null&&url.indexOf('refresh_page=1')>0){document.location.reload();}}
|
||||
function markSubPanelLoaded(child_field){child_field_loaded[child_field]=2;}
|
||||
function hideSubPanel(child_field)
|
||||
{var subpanel=document.getElementById('subpanel_'+child_field);subpanel.style.display='none';set_div_cookie(subpanel.cookie_name,'none');}
|
||||
var sub_cookie_name=get_module_name()+'_divs';var temp=Get_Cookie(sub_cookie_name);var div_cookies=new Array();if(temp&&typeof(temp)!='undefined'){div_cookies=get_sub_cookies(temp);}
|
||||
function set_div_cookie(name,display){div_cookies[name]=display;Set_Cookie(sub_cookie_name,subs_to_cookie(div_cookies),3000,false,false,false);}
|
||||
function local_open_popup(name,width,height,arg1,arg2,arg3,params)
|
||||
{return open_popup(name,width,height,arg1,arg2,arg3,params);}
|
||||
SUGAR.subpanelUtils=function(){var originalLayout=null;var subpanelContents={};var subpanelLocked={};return{getLayout:function(asString,ignoreHidden){subpanels=document.getElementById('subpanel_list');subpanelIds=new Array();for(wp=0;wp<subpanels.childNodes.length;wp++){if(typeof subpanels.childNodes[wp].id!='undefined'&&subpanels.childNodes[wp].id.match(/whole_subpanel_[\w-]*/)&&(typeof ignoreHidden=='undefined'||subpanels.childNodes[wp].style.display!='none')){subpanelIds.push(subpanels.childNodes[wp].id.replace(/whole_subpanel_/,''));}}
|
||||
if(asString)return subpanelIds.join(',');else return subpanelIds;},onDrag:function(e,id){originalLayout=SUGAR.subpanelUtils.getLayout(true,true);},onDrop:function(e,id){newLayout=SUGAR.subpanelUtils.getLayout(true,true);if(originalLayout!=newLayout){SUGAR.subpanelUtils.saveLayout(newLayout);}},saveLayout:function(order){ajaxStatus.showStatus(SUGAR.language.get('app_strings','LBL_SAVING_LAYOUT'));if(typeof SUGAR.subpanelUtils.currentSubpanelGroup!='undefined'){var orderList=SUGAR.subpanelUtils.getLayout(false,true);var currentGroup=SUGAR.subpanelUtils.currentSubpanelGroup;}
|
||||
var success=function(data){ajaxStatus.showStatus(SUGAR.language.get('app_strings','LBL_SAVED_LAYOUT'));window.setTimeout('ajaxStatus.hideStatus()',2000);if(typeof SUGAR.subpanelUtils.currentSubpanelGroup!='undefined'){SUGAR.subpanelUtils.reorderSubpanelSubtabs(currentGroup,orderList);}}
|
||||
url='index.php?module=Home&action=SaveSubpanelLayout&layout='+order+'&layoutModule='+currentModule;if(typeof SUGAR.subpanelUtils.currentSubpanelGroup!='undefined'){url=url+'&layoutGroup='+encodeURI(SUGAR.subpanelUtils.currentSubpanelGroup);}
|
||||
var cObj=YAHOO.util.Connect.asyncRequest('GET',url,{success:success,failure:success});},inlineSave:function(theForm,buttonName){ajaxStatus.showStatus(SUGAR.language.get('app_strings','LBL_SAVING'));var success=function(data){var element=document.getElementById(buttonName);do{element=element.parentNode;}while(element.className!='quickcreate'&&element.parentNode);if(element.className=='quickcreate'){var subpanel=element.id.slice(9,-7);SUGAR.subpanelUtils.cancelCreate(buttonName);var module=get_module_name();var id=get_record_id();var layout_def_key=get_layout_def_key();try{eval('result = '+data.responseText);}catch(err){}
|
||||
if(typeof(result)!='undefined'&&result!=null&&typeof(result['status'])!='undefined'&&result['status']!=null&&result['status']=='dupe'){document.location.href="index.php?"+result['get'].replace(/&/gi,'&').replace(/</gi,'<').replace(/>/gi,'>').replace(/'/gi,'\'').replace(/"/gi,'"').replace(/\r\n/gi,'\n');return;}else{showSubPanel(subpanel,null,true);ajaxStatus.showStatus(SUGAR.language.get('app_strings','LBL_SAVED'));window.setTimeout('ajaxStatus.hideStatus()',1000);if(reloadpage)window.location.reload(false);}}}
|
||||
var reloadpage=false;if((buttonName=='Meetings_subpanel_save_button'||buttonName=='Calls_subpanel_save_button')&&document.getElementById(theForm).status[document.getElementById(theForm).status.selectedIndex].value=='Held'){reloadpage=true;}
|
||||
YAHOO.util.Connect.setForm(theForm,true,true);var cObj=YAHOO.util.Connect.asyncRequest('POST','index.php',{success:success,failure:success,upload:success});return false;},sendAndRetrieve:function(theForm,theDiv,loadingStr){function success(data){theDivObj=document.getElementById(theDiv);subpanelContents[theDiv]=new Array();subpanelContents[theDiv]['list']=theDivObj;subpanelContents[theDiv]['newDiv']=document.createElement('div');dataToDOMAvail=false;subpanelContents[theDiv]['newDiv'].innerHTML='<script type="text/javascript">dataToDOMAvail=true;</script>'+data.responseText;subpanelContents[theDiv]['newDiv'].id=theDiv+'_newDiv';subpanelContents[theDiv]['newDiv'].className='quickcreate';theDivObj.style.display='none';theDivObj.parentNode.insertBefore(subpanelContents[theDiv]['newDiv'],theDivObj);if(!dataToDOMAvail){SUGAR.util.evalScript(data.responseText);}
|
||||
subpanelLocked[theDiv]=false;setTimeout("enableQS(false)",500);ajaxStatus.hideStatus();}
|
||||
if(typeof subpanelLocked[theDiv]!='undefined'&&subpanelLocked[theDiv])return false;subpanelLocked[theDiv]=true;if(typeof loadingStr=='undefined')loadingStr=SUGAR.language.get('app_strings','LBL_LOADING');ajaxStatus.showStatus(loadingStr);YAHOO.util.Connect.setForm(theForm);var cObj=YAHOO.util.Connect.asyncRequest('POST','index.php',{success:success,failure:success});return false;},cancelCreate:function(buttonName){var element=document.getElementById(buttonName);do{element=element.parentNode;}while(element.className!='quickcreate'&&element.parentNode);var theDiv=element.id.substr(0,element.id.length-7);if(typeof(subpanelContents[theDiv])=='undefined')
|
||||
return false;subpanelContents[theDiv]['newDiv'].parentNode.removeChild(subpanelContents[theDiv]['newDiv']);subpanelContents[theDiv]['list'].style.display='';return false;},loadSubpanelGroupFromMore:function(group){SUGAR.subpanelUtils.updateSubpanelMoreTab(group);SUGAR.subpanelUtils.loadSubpanelGroup(group);},updateSubpanelMoreTab:function(group){var moreTab=document.getElementById(SUGAR.subpanelUtils.subpanelMoreTab+'_sp_tab');moreTab.id=group+'_sp_tab';moreTab.getElementsByTagName('a')[0].innerHTML=group;moreTab.getElementsByTagName('a')[0].href="javascript:SUGAR.subpanelUtils.loadSubpanelGroup('"+group+"');";var menuLink=document.getElementById(group+'_sp_mm');menuLink.id=SUGAR.subpanelUtils.subpanelMoreTab+'_sp_mm';menuLink.href="javascript:SUGAR.subpanelUtils.loadSubpanelGroupFromMore('"+SUGAR.subpanelUtils.subpanelMoreTab+"');";menuLink.innerHTML=SUGAR.subpanelUtils.subpanelMoreTab;SUGAR.subpanelUtils.subpanelMoreTab=group;},loadSubpanelGroup:function(group){if(group==SUGAR.subpanelUtils.currentSubpanelGroup)return;if(SUGAR.subpanelUtils.loadedGroups[group]){SUGAR.subpanelUtils.updateSubpanel(group);}else{SUGAR.subpanelUtils.loadedGroups.push(group);var needed=Array();for(group_sp in SUGAR.subpanelUtils.subpanelGroups[group]){if(typeof(SUGAR.subpanelUtils.subpanelGroups[group][group_sp])=='string'&&!document.getElementById('whole_subpanel_'+SUGAR.subpanelUtils.subpanelGroups[group][group_sp])){needed.push(SUGAR.subpanelUtils.subpanelGroups[group][group_sp]);}}
|
||||
var success=function(){SUGAR.subpanelUtils.updateSubpanelEventHandlers(needed);SUGAR.subpanelUtils.updateSubpanels(group);};if(needed.length){ajaxStatus.showStatus(SUGAR.language.get('app_strings','LBL_LOADING'));SUGAR.util.retrieveAndFill(SUGAR.subpanelUtils.requestUrl+needed.join(','),'subpanel_list',null,success,null,true);}else{SUGAR.subpanelUtils.updateSubpanels(group);}}
|
||||
SUGAR.subpanelUtils.setGroupCookie(group);},updateSubpanels:function(group){var sp_list=document.getElementById('subpanel_list');for(sp in sp_list.childNodes){if(sp_list.childNodes[sp].id){sp_list.childNodes[sp].style.display='none';}}
|
||||
for(group_sp in SUGAR.subpanelUtils.subpanelGroups[group]){if(typeof(SUGAR.subpanelUtils.subpanelGroups[group][group_sp])!='string')continue;var cur=document.getElementById('whole_subpanel_'+SUGAR.subpanelUtils.subpanelGroups[group][group_sp]);cur.style.display='block';try{YAHOO.util.DDM.swapNode(cur,sp_list.getElementsByTagName('LI')[group_sp]);}catch(e){}}
|
||||
SUGAR.subpanelUtils.updateSubpanelTabs(group);},updateSubpanelTabs:function(group){if(SUGAR.subpanelUtils.showLinks){SUGAR.subpanelUtils.updateSubpanelSubtabs(group);document.getElementById('subpanelSubTabs').innerHTML=SUGAR.subpanelUtils.subpanelSubTabs[group];}
|
||||
oldTab=document.getElementById(SUGAR.subpanelUtils.currentSubpanelGroup+'_sp_tab');if(oldTab){oldTab.className='';oldTab.getElementsByTagName('a')[0].className='';}
|
||||
mainTab=document.getElementById(group+'_sp_tab');mainTab.className='active';mainTab.getElementsByTagName('a')[0].className='current';SUGAR.subpanelUtils.currentSubpanelGroup=group;ajaxStatus.hideStatus();},updateSubpanelEventHandlers:function(){if(SubpanelInitTabNames){SubpanelInitTabNames(SUGAR.subpanelUtils.getLayout(false));}},reorderSubpanelSubtabs:function(group,order){SUGAR.subpanelUtils.subpanelGroups[group]=order;if(SUGAR.subpanelUtils.showLinks==1){SUGAR.subpanelUtils.updateSubpanelSubtabs(group);if(SUGAR.subpanelUtils.currentSubpanelGroup==group){document.getElementById('subpanelSubTabs').innerHTML=SUGAR.subpanelUtils.subpanelSubTabs[group];}}},updateSubpanelSubtabs:function(group){var notFirst=0;var preMore=SUGAR.subpanelUtils.subpanelGroups[group].slice(0,SUGAR.subpanelUtils.subpanelMaxSubtabs);SUGAR.subpanelUtils.subpanelSubTabs[group]='<table border="0" cellpadding="0" cellspacing="0" height="20" width="100%" class="subTabs"><tr>';for(var sp_key=0;sp_key<preMore.length;sp_key++){if(notFirst!=0){SUGAR.subpanelUtils.subpanelSubTabs[group]+='<td width="1"> | </td>';}else{notFirst=1;}
|
||||
SUGAR.subpanelUtils.subpanelSubTabs[group]+='<td nowrap="nowrap"><a href="#'+preMore[sp_key]+'" class="subTabLink">'+SUGAR.subpanelUtils.subpanelTitles[preMore[sp_key]]+'</a></td>';}
|
||||
if(document.getElementById('MoreSub'+group+'PanelMenu')){SUGAR.subpanelUtils.subpanelSubTabs[group]+='<td nowrap="nowrap"> | <span class="subTabMore" id="MoreSub'+group+'PanelHandle" style="margin-left:2px; cursor: pointer; cursor: hand;" align="absmiddle" onmouseover="SUGAR.subpanelUtils.menu.tbspButtonMouseOver(this.id,\'\',\'\',0);">>></span></td>';}
|
||||
SUGAR.subpanelUtils.subpanelSubTabs[group]+='<td width="100%"> </td></tr></table>';var postMore=SUGAR.subpanelUtils.subpanelGroups[group].slice(SUGAR.subpanelUtils.subpanelMaxSubtabs);var subpanelMenu=document.getElementById('MoreSub'+group+'PanelMenu');if(postMore&&subpanelMenu){subpanelMenu.innerHTML='';for(var sp_key=0;sp_key<postMore.length;sp_key++){subpanelMenu.innerHTML+='<a href="#'+postMore[sp_key]+'" class="menuItem" parentid="MoreSub'+group+'PanelMenu" onmouseover="hiliteItem(this,\'yes\'); closeSubMenus(this);" onmouseout="unhiliteItem(this);">'+SUGAR.subpanelUtils.subpanelTitles[postMore[sp_key]]+'</a>';}
|
||||
subpanelMenu+='</div>';}},setGroupCookie:function(group){Set_Cookie(SUGAR.subpanelUtils.tabCookieName,group,3000,false,false,false);}};}();SUGAR.subpanelUtils.menu=function(){return{tbspButtonMouseOver:function(id,top,left,leftOffset){closeMenusDelay=eraseTimeout(closeMenusDelay);if(openMenusDelay==null){openMenusDelay=window.setTimeout("SUGAR.subpanelUtils.menu.spShowMenu('"+id+"','"+top+"','"+left+"','"+leftOffset+"')",delayTime);}},spShowMenu:function(id,top,left,leftOffset){openMenusDelay=eraseTimeout(openMenusDelay);var menuName=id.replace(/Handle/i,'Menu');var menu=getLayer(menuName);if(currentMenu){closeAllMenus();}
|
||||
SUGAR.subpanelUtils.menu.spPopupMenu(id,menu,top,left,leftOffset);},spPopupMenu:function(handleID,menu,top,left,leftOffset){var bw=checkBrowserWidth();var menuName=handleID.replace(/Handle/i,'Menu');var menuWidth=120;var imgWidth=document.getElementById(handleID).width;if(menu){var menuHandle=getLayer(handleID);var p=menuHandle;if(left==""){var left=0;while(p&&p.tagName.toUpperCase()!='BODY'){left+=p.offsetLeft;p=p.offsetParent;}
|
||||
left+=parseInt(leftOffset);}
|
||||
if(top==""){var top=0;p=menuHandle;top+=p.offsetHeight;while(p&&p.tagName.toUpperCase()!='BODY'){top+=p.offsetTop;p=p.offsetParent;}}
|
||||
if(left+menuWidth>bw){left=left-menuWidth+imgWidth;}
|
||||
setMenuVisible(menu,left,top,false);}}};}();
|
||||
52
include/SugarDependentDropdown/javascript/SugarDependentDropdown.js
Executable file
52
include/SugarDependentDropdown/javascript/SugarDependentDropdown.js
Executable file
@@ -0,0 +1,52 @@
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
SUGAR.dependentDropdown={currentAction:null,debugMode:false}
|
||||
SUGAR.dependentDropdown.handleDependentDropdown=function(el){}
|
||||
SUGAR.dependentDropdown.generateElement=function(focusElement,elementRow,index,elementIndex){if(SUGAR.dependentDropdown.debugMode)SUGAR.dependentDropdown.utils.debugStack('generateElement');var tmp=null;if(focusElement){var sandbox=SUGAR.dependentDropdown.utils.generateElementContainer(focusElement,elementRow,index,elementIndex);if(focusElement.label){focusLabel={tag:'span',cls:'routingLabel',html:" "+focusElement.label+" "}
|
||||
switch(focusElement.label_pos){case"top":focusLabel.html=focusElement.label+"<br />";break;case"bottom":focusLabel.html="<br />"+focusElement.label;break;}
|
||||
if(focusElement.label_pos=='left'||focusElement.label_pos=='top'){YAHOO.ext.DomHelper.append(sandbox,focusLabel);}}
|
||||
switch(focusElement.type){case'input':if(typeof(focusElement.values)=='string'){focusElement.values=eval(focusElement.values);}
|
||||
var preselect=SUGAR.dependentDropdown.utils.getPreselectKey(focusElement.name);if(preselect.match(/::/))
|
||||
preselect='';tmp=YAHOO.ext.DomHelper.append(sandbox,{tag:'input',id:focusElement.grouping+"::"+index+":::"+elementIndex+":-:"+focusElement.id,name:focusElement.grouping+"::"+index+"::"+focusElement.name,cls:'input',onchange:focusElement.onchange,value:preselect},true);var newElement=tmp.dom;break;case'select':tmp=YAHOO.ext.DomHelper.append(sandbox,{tag:'select',id:focusElement.grouping+"::"+index+":::"+elementIndex+":-:"+focusElement.id,name:focusElement.grouping+"::"+index+"::"+focusElement.name,cls:'input',onchange:focusElement.onchange},true);var newElement=tmp.dom;if(typeof(focusElement.values)=='string'){focusElement.values=eval(focusElement.values);}
|
||||
var preselect=SUGAR.dependentDropdown.utils.getPreselectKey(focusElement.name);var i=0;for(var key in focusElement.values){var selected=(preselect==key)?true:false;newElement.options[i]=new Option(focusElement.values[key],key,selected);if(selected){newElement.options[i].selected=true;}
|
||||
i++;}
|
||||
break;case'none':break;case'checkbox':alert('implement checkbox pls');break;case'multiple':alert('implement multiple pls');break;default:if(SUGAR.dependentDropdown.dropdowns.debugMode){alert("Improper type defined: [ "+focusElement.type+"]");}
|
||||
return;break;}
|
||||
if(focusElement.label){if(focusElement.label_pos=='right'||focusElement.label_pos=='bottom'){YAHOO.ext.DomHelper.append(sandbox,focusLabel);}}
|
||||
try{newElement.onchange();}catch(e){if(SUGAR.dependentDropdown.dropdowns.debugMode){debugger;}}}else{}}
|
||||
SUGAR.dependentDropdown.utils={generateElementContainer:function(focusElement,elementRow,index,elementIndex){var oldElement=document.getElementById('elementContainer'+focusElement.grouping+"::"+index+":::"+elementIndex);if(oldElement){SUGAR.dependentDropdown.utils.removeChildren(oldElement);}
|
||||
var tmp=YAHOO.ext.DomHelper.append(elementRow,{tag:'span',id:'elementContainer'+focusElement.grouping+"::"+index+":::"+elementIndex},true);return tmp.dom;},getPreselectKey:function(elementName){try{if(SUGAR.dependentDropdown.currentAction.action[elementName]){return SUGAR.dependentDropdown.currentAction.action[elementName];}else{return'';}}catch(e){if(SUGAR.dependentDropdown.dropdowns.debugMode){}
|
||||
return'';}},debugStack:function(func){if(!SUGAR.dependentDropdown._stack){SUGAR.dependentDropdown._stack=new Array();}
|
||||
SUGAR.dependentDropdown._stack.push(func);},removeChildren:function(el){for(i=el.childNodes.length-1;i>=0;i--){if(el.childNodes[i]){el.removeChild(el.childNodes[i]);}}}}
|
||||
69
include/SugarEmailAddress/SugarEmailAddress.js
Executable file
69
include/SugarEmailAddress/SugarEmailAddress.js
Executable file
@@ -0,0 +1,69 @@
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
(function(){if(SUGAR.EmailAddressWidget)return;var Dom=YAHOO.util.Dom;SUGAR.EmailAddressWidget=function(module){if(!SUGAR.EmailAddressWidget.count[module])SUGAR.EmailAddressWidget.count[module]=0;this.count=SUGAR.EmailAddressWidget.count[module];SUGAR.EmailAddressWidget.count[module]++;this.module=module;this.id=this.module+this.count;if(document.getElementById(module+'_email_widget_id'))
|
||||
document.getElementById(module+'_email_widget_id').value=this.id;SUGAR.EmailAddressWidget.instances[this.id]=this;}
|
||||
SUGAR.EmailAddressWidget.instances={};SUGAR.EmailAddressWidget.count={};SUGAR.EmailAddressWidget.prototype={emailTemplate:'<tr id="emailAddressRow">'+'<td nowrap="NOWRAP"><input type="text" name="emailAddress{$index}" id="emailAddress0" size="30"/></td>'+'<td><span> </span><img id="removeButton0" name="0" src="index.php?entryPoint=getImage&themeName=Sugar&imageName=delete_inline.gif"/></td>'+'<td align="center"><input type="radio" name="emailAddressPrimaryFlag" id="emailAddressPrimaryFlag0" value="emailAddress0" enabled="true" checked="true"/></td>'+'<td align="center"><input type="checkbox" name="emailAddressOptOutFlag[]" id="emailAddressOptOutFlag0" value="emailAddress0" enabled="true"/></td>'+'<td align="center"><input type="checkbox" name="emailAddressInvalidFlag[]" id="emailAddressInvalidFlag0" value="emailAddress0" enabled="true"/></td>'+'<td><input type="hidden" name="emailAddressVerifiedFlag0" id="emailAddressVerifiedFlag0" value="true"/></td>'+'<td><input type="hidden" name="emailAddressVerifiedValue0" id="emailAddressVerifiedValue0" value=""/></td></tr>',numberEmailAddresses:0,replyToFlagObject:new Object(),verifying:false,enterPressed:false,tabPressed:false,emailView:"",emailIsRequired:false,prefillEmailAddresses:function(tableId,o){for(i=0;i<o.length;i++){o[i].email_address=o[i].email_address.replace(''',"'");this.addEmailAddress(tableId,o[i].email_address,o[i].primary_address,o[i].reply_to_address,o[i].opt_out,o[i].invalid_email);}},retrieveEmailAddress:function(event){var callbackFunction=function success(data){var vals=YAHOO.lang.JSON.parse(data.responseText);var target=vals.target;event=this.getEvent(event);if(vals.email){var email=vals.email;if(email!=''&&/\d+$/.test(target)){var matches=target.match(/\d+$/);var targetNumber=matches[0];var optOutEl=Dom.get(this.id+'emailAddressOptOutFlag'+targetNumber);if(optOutEl){optOutEl.checked=email['opt_out']==1?true:false;}
|
||||
var invalidEl=Dom.get(this.id+'emailAddressInvalidFlag'+targetNumber);if(invalidEl){invalidEl.checked=email['invalid_email']==1?true:false;}}}
|
||||
var index=/[a-z]*\d?emailAddress(\d+)/i.exec(target)[1];var verifyElementFlag=Dom.get(this.id+'emailAddressVerifiedFlag'+index);if(verifyElementFlag.parentNode.childNodes.length>1){verifyElementFlag.parentNode.removeChild(verifyElementFlag.parentNode.lastChild);}
|
||||
var verifiedTextNode=document.createElement('span');verifiedTextNode.innerHTML='';verifyElementFlag.parentNode.appendChild(verifiedTextNode);verifyElementFlag.value="true";this.verifyElementValue=Dom.get(this.id+'emailAddressVerifiedValue'+index);this.verifyElementValue.value=Dom.get(this.id+'emailAddress'+index).value;this.verifying=false;var savePressed=false;if(event){var elm=document.activeElement||event.explicitOriginalTarget;if(typeof elm.type!='undefined'&&/submit|button/.test(elm.type.toLowerCase())){savePressed=true;}}
|
||||
if(savePressed||this.enterPressed){setTimeout("SUGAR.EmailAddressWidget.instances."+this.id+".forceSubmit()",2100);}else if(this.tabPressed){Dom.get(this.id+'emailAddressPrimaryFlag'+index).focus();}}
|
||||
var event=this.getEvent(event);var targetEl=this.getEventElement(event);var index=/[a-z]*\d?emailAddress(\d+)/i.exec(targetEl.id)[1];var verifyElementFlag=Dom.get(this.id+'emailAddressVerifiedFlag'+index);this.verifyElementValue=Dom.get(this.id+'emailAddressVerifiedValue'+index);verifyElementFlag.value=(trim(targetEl.value)==''||targetEl.value==this.verifyElementValue.value)?"true":"false"
|
||||
if(verifyElementFlag.parentNode.childNodes.length>1){verifyElementFlag.parentNode.removeChild(verifyElementFlag.parentNode.lastChild);}
|
||||
if(/emailAddress\d+$/.test(targetEl.id)&&isValidEmail(targetEl.value)&&!this.verifying&&verifyElementFlag.value=="false"){verifiedTextNode=document.createElement('span');verifyElementFlag.parentNode.appendChild(verifiedTextNode);verifiedTextNode.innerHTML=SUGAR.language.get('app_strings','LBL_VERIFY_EMAIL_ADDRESS');this.verifying=true;var cObj=YAHOO.util.Connect.asyncRequest('GET','index.php?&module=Contacts&action=RetrieveEmail&target='+targetEl.id+'&email='+targetEl.value,{success:callbackFunction,failure:callbackFunction,scope:this});}},handleKeyDown:function(event){var e=this.getEvent(event);var eL=this.getEventElement(e);if((kc=e["keyCode"])){this.enterPressed=(kc==13)?true:false;this.tabPressed=(kc==9)?true:false;if(this.enterPressed||this.tabPressed){this.retrieveEmailAddress(e);if(this.enterPressed);this.freezeEvent(e);}}},getEvent:function(event){return(event?event:window.event);},getEventElement:function(e){return(e.srcElement?e.srcElement:(e.target?e.target:e.currentTarget));},freezeEvent:function(e){if(e.preventDefault)e.preventDefault();e.returnValue=false;e.cancelBubble=true;if(e.stopPropagation)e.stopPropagation();return false;},addEmailAddress:function(tableId,address,primaryFlag,replyToFlag,optOutFlag,invalidFlag){if(this.addInProgress)
|
||||
return;this.addInProgress=true;if(!address)
|
||||
address="";var insertInto=Dom.get(tableId);var parentObj=insertInto.parentNode;var newContent=document.createElement("input");var nav=new String(navigator.appVersion);var newContentPrimaryFlag;if(SUGAR.isIE){newContentPrimaryFlag=document.createElement("<input name='emailAddressPrimaryFlag' />");}else{newContentPrimaryFlag=document.createElement("input");}
|
||||
var newContentReplyToFlag=document.createElement("input");var newContentOptOutFlag=document.createElement("input");var newContentInvalidFlag=document.createElement("input");var newContentVerifiedFlag=document.createElement("input");var newContentVerifiedValue=document.createElement("input");var removeButton=document.createElement("img");var tbody=document.createElement("tbody");var tr=document.createElement("tr");var td1=document.createElement("td");var td2=document.createElement("td");var td3=document.createElement("td");var td4=document.createElement("td");var td5=document.createElement("td");var td6=document.createElement("td");var td7=document.createElement("td");var td8=document.createElement("td");newContent.setAttribute("type","text");newContent.setAttribute("style","width: 250px;");newContent.setAttribute("name",this.id+"emailAddress"+this.numberEmailAddresses);newContent.setAttribute("id",this.id+"emailAddress"+this.numberEmailAddresses);newContent.setAttribute("size","30");if(address!=''){newContent.setAttribute("value",address);}
|
||||
removeButton.setAttribute("id",this.id+"removeButton"+this.numberEmailAddresses);removeButton.setAttribute("class","id-ff-remove");removeButton.setAttribute("name",this.numberEmailAddresses);removeButton.eaw=this;removeButton.setAttribute("src","index.php?entryPoint=getImage&themeName="+SUGAR.themes.theme_name+"&imageName=id-ff-remove.png");removeButton.onclick=function(){this.eaw.removeEmailAddress(this.name);};newContentPrimaryFlag.setAttribute("type","radio");newContentPrimaryFlag.setAttribute("name",this.id+"emailAddressPrimaryFlag");newContentPrimaryFlag.setAttribute("id",this.id+"emailAddressPrimaryFlag"+this.numberEmailAddresses);newContentPrimaryFlag.setAttribute("value",this.id+"emailAddress"+this.numberEmailAddresses);newContentPrimaryFlag.setAttribute("enabled","true");newContentReplyToFlag.setAttribute("type","radio");newContentReplyToFlag.setAttribute("name",this.id+"emailAddressReplyToFlag");newContentReplyToFlag.setAttribute("id",this.id+"emailAddressReplyToFlag"+this.numberEmailAddresses);newContentReplyToFlag.setAttribute("value",this.id+"emailAddress"+this.numberEmailAddresses);newContentReplyToFlag.setAttribute("enabled","true");newContentReplyToFlag.eaw=this;newContentReplyToFlag['onclick']=function(){var form=document.forms[this.eaw.emailView];if(!form){form=document.forms['editContactForm'];}
|
||||
var nav=new String(navigator.appVersion);if(nav.match(/MSIE/gim)){for(i=0;i<form.elements.length;i++){var id=new String(form.elements[i].id);if(id.match(/emailAddressReplyToFlag/gim)&&form.elements[i].type=='radio'&&id!=this.eaw.id){form.elements[i].checked=false;}}}
|
||||
for(i=0;i<form.elements.length;i++){var id=new String(form.elements[i].id);if(id.match(/emailAddressReplyToFlag/gim)&&form.elements[i].type=='radio'&&id!=this.eaw.id){this.eaw.replyToFlagObject[this.eaw.id]=false;}}
|
||||
if(this.eaw.replyToFlagObject[this.id]){this.eaw.replyToFlagObject[this.id]=false;this.checked=false;}else{this.eaw.replyToFlagObject[this.id]=true;this.checked=true;}}
|
||||
newContentOptOutFlag.setAttribute("type","checkbox");newContentOptOutFlag.setAttribute("name",this.id+"emailAddressOptOutFlag[]");newContentOptOutFlag.setAttribute("id",this.id+"emailAddressOptOutFlag"+this.numberEmailAddresses);newContentOptOutFlag.setAttribute("value",this.id+"emailAddress"+this.numberEmailAddresses);newContentOptOutFlag.setAttribute("enabled","true");newContentOptOutFlag.eaw=this;newContentOptOutFlag['onClick']=function(){this.eaw.toggleCheckbox(this)};newContentInvalidFlag.setAttribute("type","checkbox");newContentInvalidFlag.setAttribute("name",this.id+"emailAddressInvalidFlag[]");newContentInvalidFlag.setAttribute("id",this.id+"emailAddressInvalidFlag"+this.numberEmailAddresses);newContentInvalidFlag.setAttribute("value",this.id+"emailAddress"+this.numberEmailAddresses);newContentInvalidFlag.setAttribute("enabled","true");newContentInvalidFlag.eaw=this;newContentInvalidFlag['onClick']=function(){this.eaw.toggleCheckbox(this)};newContentVerifiedFlag.setAttribute("type","hidden");newContentVerifiedFlag.setAttribute("name",this.id+"emailAddressVerifiedFlag"+this.numberEmailAddresses);newContentVerifiedFlag.setAttribute("id",this.id+"emailAddressVerifiedFlag"+this.numberEmailAddresses);newContentVerifiedFlag.setAttribute("value","true");newContentVerifiedValue.setAttribute("type","hidden");newContentVerifiedValue.setAttribute("name",this.id+"emailAddressVerifiedValue"+this.numberEmailAddresses);newContentVerifiedValue.setAttribute("id",this.id+"emailAddressVerifiedValue"+this.numberEmailAddresses);newContentVerifiedValue.setAttribute("value",address);this.emailView=(this.emailView=='')?'EditView':this.emailView;addToValidateVerified(this.emailView,this.id+"emailAddressVerifiedFlag"+this.numberEmailAddresses,'bool',false,SUGAR.language.get('app_strings','LBL_VERIFY_EMAIL_ADDRESS'));tr.setAttribute("id",this.id+"emailAddressRow"+this.numberEmailAddresses);td1.setAttribute("nowrap","NOWRAP");td3.setAttribute("align","center");td4.setAttribute("align","center");td5.setAttribute("align","center");td6.setAttribute("align","center");td1.appendChild(newContent);td1.appendChild(document.createTextNode(" "));spanNode=document.createElement('span');spanNode.innerHTML=' ';td2.appendChild(spanNode);if(this.numberEmailAddresses!=0||typeof(this.emailIsRequired)=="undefined"||!this.emailIsRequired)
|
||||
td2.appendChild(removeButton);td3.appendChild(newContentPrimaryFlag);td4.appendChild(newContentReplyToFlag);td5.appendChild(newContentOptOutFlag);td6.appendChild(newContentInvalidFlag);td7.appendChild(newContentVerifiedFlag);td8.appendChild(newContentVerifiedValue);tr.appendChild(td1);tr.appendChild(td2);tr.appendChild(td3);if(typeof(this.module)!='undefined'&&this.module=='Users'){tr.appendChild(td4);}else{tr.appendChild(td5);tr.appendChild(td6);}
|
||||
tr.appendChild(td7);tr.appendChild(td8);tbody.appendChild(tr);insertInto.appendChild(tbody);parentObj.insertBefore(Dom.get('targetBody'),insertInto);if(primaryFlag=='1'||(this.numberEmailAddresses==0)){newContentPrimaryFlag.setAttribute("checked",'true');}
|
||||
if(replyToFlag=='1'){newContentReplyToFlag.setAttribute("checked","true");}
|
||||
if(replyToFlag=='1'){this.replyToFlagObject[newContentReplyToFlag.id]=true;}else{this.replyToFlagObject[newContentReplyToFlag.id]=false;}
|
||||
if(optOutFlag=='1'){newContentOptOutFlag.setAttribute("checked",'true');}
|
||||
if(invalidFlag=='1'){newContentInvalidFlag.setAttribute("checked","true");}
|
||||
newContent.eaw=this;newContent.onblur=function(e){this.eaw.retrieveEmailAddress(e)};newContent.onkeydown=function(e){this.eaw.handleKeyDown(e)};addToValidate(this.emailView,this.id+'emailAddress'+this.numberEmailAddresses,'email',this.emailIsRequired,SUGAR.language.get('app_strings','LBL_EMAIL_ADDRESS_BOOK_EMAIL_ADDR'));this.numberEmailAddresses++;this.addInProgress=false;},removeEmailAddress:function(index){removeFromValidate(this.emailView,this.id+'emailAddress'+index);var oNodeToRemove=Dom.get(this.id+'emailAddressRow'+index);oNodeToRemove.parentNode.removeChild(oNodeToRemove);var removedIndex=parseInt(index);if(this.numberEmailAddresses!=removedIndex){for(var x=removedIndex+1;x<this.numberEmailAddresses;x++){Dom.get(this.id+'emailAddress'+x).setAttribute("name",this.id+"emailAddress"+(x-1));Dom.get(this.id+'emailAddress'+x).setAttribute("id",this.id+"emailAddress"+(x-1));if(Dom.get(this.id+'emailAddressInvalidFlag'+x)){Dom.get(this.id+'emailAddressInvalidFlag'+x).setAttribute("id",this.id+"emailAddressInvalidFlag"+(x-1));}
|
||||
if(Dom.get(this.id+'emailAddressOptOutFlag'+x)){Dom.get(this.id+'emailAddressOptOutFlag'+x).setAttribute("id",this.id+"emailAddressOptOutFlag"+(x-1));}
|
||||
if(Dom.get(this.id+'emailAddressPrimaryFlag'+x)){Dom.get(this.id+'emailAddressPrimaryFlag'+x).setAttribute("id",this.id+"emailAddressPrimaryFlag"+(x-1));}
|
||||
Dom.get(this.id+'emailAddressVerifiedValue'+x).setAttribute("id",this.id+"emailAddressVerifiedValue"+(x-1));Dom.get(this.id+'emailAddressVerifiedFlag'+x).setAttribute("id",this.id+"emailAddressVerifiedFlag"+(x-1));var rButton=Dom.get(this.id+'removeButton'+x);rButton.setAttribute("name",(x-1));rButton.setAttribute("id",this.id+"removeButton"+(x-1));Dom.get(this.id+'emailAddressRow'+x).setAttribute("id",this.id+'emailAddressRow'+(x-1));}}
|
||||
this.numberEmailAddresses--;if(this.numberEmailAddresses==0){return;}
|
||||
var primaryFound=false;for(x=0;x<this.numberEmailAddresses;x++){if(Dom.get(this.id+'emailAddressPrimaryFlag'+x).checked){primaryFound=true;}}
|
||||
if(!primaryFound){Dom.get(this.id+'emailAddressPrimaryFlag0').checked=true;Dom.get(this.id+'emailAddressPrimaryFlag0').value=this.id+'emailAddress0';}},toggleCheckbox:function(el)
|
||||
{var form=document.forms[this.emailView];if(!form){form=document.forms['editContactForm'];}
|
||||
if(SUGAR.isIE){for(i=0;i<form.elements.length;i++){var id=new String(form.elements[i].id);if(id.match(/emailAddressInvalidFlag/gim)&&form.elements[i].type=='checkbox'&&id!=el.id){form.elements[i].checked=false;}}
|
||||
el.checked=true;}},forceSubmit:function(){var theForm=Dom.get(this.emailView);if(theForm){theForm.action.value='Save';if(!check_form(this.emailView)){return false;}
|
||||
if(this.emailView=='EditView'){theForm.submit();}else if(this.emailView=='QuickCreate'){SUGAR.subpanelUtils.inlineSave(theForm.id,theForm.module.value.toLowerCase());}}}};emailAddressWidgetLoaded=true;})();
|
||||
41
include/SugarFields/Fields/Address/SugarFieldAddress.js
Executable file
41
include/SugarFields/Fields/Address/SugarFieldAddress.js
Executable file
@@ -0,0 +1,41 @@
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
var elems=new Array("address_street","address_city","address_state","address_postalcode","address_country");var tHasText=false;var originalBgColor='#FFFFFF';var Dom=YAHOO.util.Dom;function TestCheckboxReady(id){YAHOO.util.Event.onAvailable(id,this.handleOnAvailable,this);}
|
||||
TestCheckboxReady.prototype.handleOnAvailable=function(me){for(x in elems){f=fromKey+"_"+elems[x];t=toKey+"_"+elems[x];e1=document.getElementById(t);e2=document.getElementById(f);if(e1!=null&&typeof e1!="undefined"&&e2!=null&&typeof e2!="undefined"){if(!tHasText&&trim(e1.value)!=""){tHasText=true;}
|
||||
if(e1.value!=e2.value){document.getElementById(this.id).checked=false;break;}
|
||||
originalBgColor=e1.style.backgroundColor;}}
|
||||
if(!tHasText){document.getElementById(this.id).checked=false;}else{syncFields(fromKey,toKey);}}
|
||||
function writeToSyncField(e){fromEl=YAHOO.util.Event.getTarget(e,true);if(typeof fromEl!="undefined"){toEl=document.getElementById(fromEl.id.replace(fromKey,toKey));toEl.value=fromEl.value;}}
|
||||
function syncFields(fromKey,toKey){for(x in elems){f=fromKey+"_"+elems[x];e2=document.getElementById(f);t=toKey+"_"+elems[x];e1=document.getElementById(t);if(e1!=null&&typeof e1!="undefined"&&e2!=null&&typeof e2!="undefined"){if(!document.getElementById(toKey+'_checkbox').checked){Dom.setStyle(e1,'backgroundColor',originalBgColor);e1.removeAttribute('readOnly');YAHOO.util.Event.removeListener(e2,'keyup');}else{e1.value=e2.value;Dom.setStyle(e1,'backgroundColor','#DCDCDC');e1.setAttribute('readOnly',true);YAHOO.util.Event.addListener(e2,'keyup',writeToSyncField);}}}}
|
||||
65
include/SugarFields/Fields/Collection/SugarFieldCollection.js
Executable file
65
include/SugarFields/Fields/Collection/SugarFieldCollection.js
Executable file
@@ -0,0 +1,65 @@
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
if(typeof(SUGAR.collection)=="undefined"){SUGAR.collection=function(form_name,field_name,module,popupData){this.more_status=false;this.form=form_name;this.field=field_name;this.field_element_name=this.form+'_'+this.field;this.module=module;this.fields_count=0;this.extra_fields_count=0;this.first=true;this.primary_field="";this.cloneField=new Array();this.sqs_clone="";this.secondaries_values=new Array();this.update_fields=new Object();this.show_more_image=true;};SUGAR.collection.prototype={remove:function(num){radio_els=this.get_radios();if(radio_els.length==1){div_el=document.getElementById(this.field_element_name+'_input_div_'+num);input_els=div_el.getElementsByTagName('input');input_els[0].value='';input_els[1].value='';if(this.primary_field){div_el=document.getElementById(this.field_element_name+'_radio_div_'+num);radio_els=div_el.getElementsByTagName('input');radio_els[0].checked=false;}}else{div_el=document.getElementById(this.field_element_name+'_input_div_'+num);tr_to_remove=document.getElementById('lineFields_'+this.field_element_name+'_'+num);div_el.parentNode.parentNode.parentNode.removeChild(tr_to_remove);var radios=this.get_radios();div_id='lineFields_'+this.field_element_name+'_'+num;if(typeof sqs_objects[div_id.replace("_field_","_")]!='undefined'){delete(sqs_objects[div_id.replace("_field_","_")]);}
|
||||
var checked=false;for(var k=0;k<radios.length;k++){if(radios[k].checked){checked=true;}}
|
||||
var primary_checked=document.forms[this.form].elements[this.field+"_allowed_to_check"];var allowed_to_check=true;if(primary_checked&&primary_checked.value=='false'){allowed_to_check=false;}
|
||||
if(/EditView/.test(this.form)&&!checked&&typeof radios[0]!='undefined'&&allowed_to_check){radios[0].checked=true;this.changePrimary(true);this.js_more();this.js_more();}
|
||||
if(radios.length==1){this.more_status=false;document.getElementById('more_'+this.field_element_name).style.display='none';this.show_arrow_label(false);this.js_more();}else{this.js_more();this.js_more();}}},get_radios:function(){return YAHOO.util.Selector.query('input[name^=primary]',document.getElementById(this.field_element_name+'_table'));},add:function(values){this.fields_count++;var Field0=this.init_clone(values);this.cloneField[1].appendChild(Field0);enableQS(true);this.changePrimary(false);if(document.getElementById('more_'+this.field_element_name)&&document.getElementById('more_'+this.field_element_name).style.display=='none'){document.getElementById('more_'+this.field_element_name).style.display='';}
|
||||
if(!this.is_expanded()){this.js_more();this.show_arrow_label(true);}},add_secondaries:function(){clone_id=this.form+'_'+this.field+'_collection_0';if(typeof sqs_objects=='undefined'||typeof sqs_objects[clone_id]=='undefined'){setTimeout('collection["'+this.field_element_name+'"].add_secondaries();',1000);}else if(typeof document.getElementById(this.form+'_'+this.field+'_collection_0')=='undefined'){setTimeout('collection["'+this.field_element_name+'"].add_secondaries();',1000);}else{if(!this.create_clone())return;enableQS();this.changePrimary(true);for(key in this.secondaries_values){if(isInteger(key)){this.add(this.secondaries_values[key]);}}
|
||||
this.js_more();this.js_more();}},init_clone:function(values){if(typeof this.cloneField[0]=='undefined'){return;}
|
||||
if(typeof values=="undefined"){values=new Array();values['name']="";values['id']="";}
|
||||
var count=this.fields_count;Field0=this.cloneField[0].cloneNode(true);Field0.id="lineFields_"+this.field_element_name+"_"+count;for(var ii=0;ii<Field0.childNodes.length;ii++){if(typeof(Field0.childNodes[ii].tagName)!='undefined'&&Field0.childNodes[ii].tagName=="TD"){for(var jj=0;jj<Field0.childNodes[ii].childNodes.length;jj++){currentNode=Field0.childNodes[ii].childNodes[jj];this.process_node(Field0.childNodes[ii],currentNode,values);}}}
|
||||
return Field0;},process_node:function(parentNode,currentNode,values){if(parentNode.className=='td_extra_field'){if(parentNode.id){parentNode.id='';}
|
||||
var toreplace=this.field+"_collection_extra_0";var re=new RegExp(toreplace,'g');parentNode.innerHTML=parentNode.innerHTML.replace(re,this.field+"_collection_extra_"+this.fields_count);}else if(currentNode.tagName&¤tNode.tagName=='SPAN'){currentNode.id=/_input/.test(currentNode.id)?this.field_element_name+'_input_div_'+this.fields_count:this.field_element_name+'_radio_div_'+this.fields_count;input_els=currentNode.getElementsByTagName('input');for(x in input_els){if(input_els[x].tagName&&input_els[x].tagName=='INPUT'){this.process_node(parentNode,input_els[x],values);}}}else if(currentNode.name){var toreplace=this.field+"_collection_0";var re=new RegExp(toreplace,'g');var name=currentNode.name;var new_name=name.replace(re,this.field+"_collection_"+this.fields_count);switch(name){case toreplace:sqs_id=this.form+'_'+new_name;if(typeof this.sqs_clone!='undefined'){var sqs_clone=YAHOO.lang.JSON.stringify(this.sqs_clone);eval('sqs_objects[sqs_id]='+sqs_clone);for(var pop_field in sqs_objects[sqs_id]['populate_list']){if(typeof sqs_objects[sqs_id]['populate_list'][pop_field]=='string'){sqs_objects[sqs_id]['populate_list'][pop_field]=sqs_objects[sqs_id]['populate_list'][pop_field].replace(RegExp('_0','g'),"_"+this.fields_count);}}
|
||||
for(var req_field in sqs_objects[sqs_id]['required_list']){if(typeof sqs_objects[sqs_id]['required_list'][req_field]=='string'){sqs_objects[sqs_id]['required_list'][req_field]=sqs_objects[sqs_id]['required_list'][req_field].replace(RegExp('_0','g'),"_"+this.fields_count);}}}
|
||||
currentNode.name=new_name;currentNode.id=new_name;currentNode.value=values['name'];break;case"id_"+toreplace:currentNode.name=new_name.replace(RegExp('_0','g'),"_"+this.fields_count);currentNode.id=new_name.replace(RegExp('_0','g'),"_"+this.fields_count);currentNode.value=values['id'];break;case"btn_"+toreplace:currentNode.name=new_name;currentNode.attributes['onclick'].value=currentNode.attributes['onclick'].value.replace(re,this.field+"_collection_"+this.fields_count);currentNode.attributes['onclick'].value=currentNode.attributes['onclick'].value.replace(RegExp(this.field+"_collection_extra_0",'g'),this.field+"_collection_extra_"+this.fields_count);break;case"allow_new_value_"+toreplace:currentNode.name=new_name;currentNode.id=new_name;break;case"remove_"+toreplace:currentNode.name=new_name;currentNode.id=new_name;currentNode.setAttribute('collection_id',this.field_element_name);currentNode.setAttribute('remove_id',this.fields_count);currentNode.onclick=function(){collection[this.getAttribute('collection_id')].remove(this.getAttribute('remove_id'));};break;case"primary_"+this.field+"_collection":currentNode.id=new_name;currentNode.value=this.fields_count;currentNode.checked=false;currentNode.setAttribute('defaultChecked','');break;default:break;}}},js_more:function(val){if(this.show_more_image){var more_=document.getElementById('more_img_'+this.field_element_name);var arrow=document.getElementById('arrow_'+this.field);var radios=this.get_radios();if(this.more_status==false){more_.src="index.php?entryPoint=getImage&themeName="+SUGAR.themes.theme_name+"&imageName=advanced_search.gif";this.more_status=true;var hidden_count=0;for(var k=0;k<radios.length;k++){if(radios[k].type&&radios[k].type=='radio'){if(radios[k].checked){radios[k].parentNode.parentNode.parentNode.style.display='';}else{radios[k].parentNode.parentNode.parentNode.style.display='none';hidden_count++;}}}
|
||||
if(hidden_count==radios.length){radios[0].parentNode.parentNode.parentNode.style.display='';}
|
||||
arrow.value='hide';}else{more_.src="index.php?entryPoint=getImage&themeName="+SUGAR.themes.theme_name+"&imageName=basic_search.gif";this.more_status=false;for(var k=0;k<radios.length;k++){if(isInteger(k)){radios[k].parentNode.parentNode.parentNode.style.display='';}}
|
||||
arrow.value='show';}
|
||||
var more_div=document.getElementById('more_div_'+this.field_element_name);if(more_div){more_div.innerHTML=arrow.value=='show'?SUGAR.language.get('app_strings','LBL_HIDE'):SUGAR.language.get('app_strings','LBL_SHOW');}}},create_clone:function(){var oneField=document.getElementById('lineFields_'+this.field_element_name+'_0');if(oneField==null||typeof(oneField)=='undefined')return false;this.cloneField[0]=oneField.cloneNode(true);this.cloneField[1]=oneField.parentNode;this.more_status=true;clone_id=this.form+'_'+this.field+'_collection_0';if(typeof sqs_objects[clone_id]!='undefined'){var clone=YAHOO.lang.JSON.stringify(sqs_objects[clone_id]);eval('this.sqs_clone='+clone);return true;}
|
||||
return false;},validateTemSet:function(formname,fieldname){table_element_id=formname+'_'+fieldname+'_table';if(document.getElementById(table_element_id)){input_elements=YAHOO.util.Selector.query('input[type=radio]',document.getElementById(table_element_id));has_primary=false;primary_field_id=fieldname+'_collection_0';for(t in input_elements){primary_field_id=fieldname+'_collection_'+input_elements[t].value;if(input_elements[t].type&&input_elements[t].type=='radio'&&input_elements[t].checked==true){if(document.forms[formname].elements[primary_field_id].value!=''){has_primary=true;}
|
||||
break;}}
|
||||
if(!has_primary){return false;}
|
||||
return true;}
|
||||
return true;},getTeamIdsfromUI:function(formname,fieldname){$team_ids=new Array();table_element_id=formname+'_'+fieldname+'_table';if(document.getElementById(table_element_id)){input_elements=YAHOO.util.Selector.query('input[type=hidden]',document.getElementById(table_element_id));for(t in input_elements){if(input_elements[t].id.match("id_"+fieldname+"_collection_")!=null){$team_ids.push(input_elements[t].value);}}}
|
||||
return $team_ids;},getPrimaryTeamidsFromUI:function(formname,fieldname){table_element_id=formname+'_'+fieldname+'_table';if(document.getElementById(table_element_id)){input_elements=YAHOO.util.Selector.query('input[type=radio]',document.getElementById(table_element_id));for(t in input_elements){primary_field_id='id_'+document.forms[formname][fieldname].name+'_collection_'+input_elements[t].value;if(input_elements[t].type&&input_elements[t].type=='radio'&&input_elements[t].checked==true){if(document.forms[formname].elements[primary_field_id].value!=''){return document.forms[formname].elements[primary_field_id].value;}}}}
|
||||
return'';},changePrimary:function(noAdd){var old_primary=this.primary_field;var radios=this.get_radios();for(var k=0;k<radios.length;k++){var qs_id=radios[k].id.replace('primary_','');if(radios[k].checked){this.primary_field=qs_id;}else{qs_id=qs_id+'_'+k;}
|
||||
qs_id=this.form+'_'+qs_id;if(typeof sqs_objects[qs_id]!='undefined'&&sqs_objects[qs_id]['primary_field_list']){for(var ii=0;ii<sqs_objects[qs_id]['primary_field_list'].length;ii++){if(radios[k].checked&&qs_id!=old_primary){sqs_objects[qs_id]['field_list'].push(sqs_objects[qs_id]['primary_field_list'][ii]);sqs_objects[qs_id]['populate_list'].push(sqs_objects[qs_id]['primary_populate_list'][ii]);}else if(old_primary==qs_id&&!radios[k].checked){sqs_objects[qs_id]['field_list'].pop();sqs_objects[qs_id]['populate_list'].pop();}}}}
|
||||
if(noAdd){enableQS(false);}
|
||||
this.first=false;},js_more_detail:function(id){var more_img=document.getElementById('more_img_'+id);if(more_img.style.display=='inline'){more_img.src="index.php?entryPoint=getImage&themeName="+SUGAR.themes.theme_name+"&imageName=advanced_search.gif";}else{more_img.src="index.php?entryPoint=getImage&themeName="+SUGAR.themes.theme_name+"&imageName=basic_search.gif";}},replace_first:function(values){for(var i=0;i<=this.fields_count;i++){div_el=document.getElementById(this.field_element_name+'_input_div_'+i);if(div_el){var name_field=document.forms[this.form].elements[this.field+"_collection_"+i];var id_field=document.forms[this.form].elements["id_"+this.field+"_collection_"+i];name_field.value=values['name'];id_field.value=values['id'];break;}}},clean_up:function(){var divsToClean=new Array();var isFirstFieldEmpty=false;var divCount=0;for(var i=0;i<=this.fields_count;i++){div_el=document.getElementById(this.field_element_name+'_input_div_'+i);if(div_el){input_els=div_el.getElementsByTagName('input');for(x in input_els){if(input_els[x].id&&input_els[x].id==(this.field+'_collection_'+i)&&trim(input_els[x].value)==''){if(divCount==0){isFirstFieldEmpty=true;}else{divsToClean.push(i);}}}
|
||||
divCount++;}}
|
||||
for(var j=0;j<divsToClean.length;j++){this.remove(divsToClean[j]);}
|
||||
return isFirstFieldEmpty;},show_arrow_label:function(show){var more_div=document.getElementById('more_div_'+this.field_element_name);if(more_div){more_div.style.display=show?'':'none';}},is_expanded:function(){var more_div=document.getElementById('more_div_'+this.field_element_name);if(more_div){return more_div.style.display=='';}
|
||||
return false;}}}
|
||||
50
include/SugarFields/Fields/Datetimecombo/Datetimecombo.js
Executable file
50
include/SugarFields/Fields/Datetimecombo/Datetimecombo.js
Executable file
@@ -0,0 +1,50 @@
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
function Datetimecombo(datetime,field,timeformat,tabindex,showCheckbox,checked,allowEmptyHM){this.datetime=datetime;this.allowEmptyHM=allowEmptyHM;if(typeof this.datetime=="undefined"||datetime==''||trim(datetime).length<10){this.datetime="";var d=new Date();var month=d.getMonth();var date=d.getDate();var year=d.getYear();var hours=d.getHours();var minutes=d.getMinutes();}
|
||||
this.fieldname=field;this.hrs=parseInt(datetime.substring(11,13),10);this.mins=parseInt(datetime.substring(14,16),10);if(this.mins>0&&this.mins<15){this.mins=15;}else if(this.mins>15&&this.mins<30){this.mins=30;}else if(this.mins>30&&this.mins<45){this.mins=45;}else if(this.mins>45){this.hrs+=1;this.mins=0;}
|
||||
this.timeformat=timeformat;this.tabindex=tabindex==null||isNaN(tabindex)?1:tabindex;this.timeseparator=this.timeformat.substring(2,3);this.has12Hours=/^11/.test(this.timeformat);this.hasMeridiem=/am|pm/i.test(this.timeformat);if(this.hasMeridiem){this.pm=/pm/.test(this.timeformat);}
|
||||
this.meridiem=this.hasMeridiem?trim(this.datetime.substring(16)):'';this.datetime=this.datetime.substr(0,10);this.showCheckbox=showCheckbox;this.checked=checked;document.getElementById(this.fieldname+'_date').value=this.datetime;}
|
||||
Datetimecombo.prototype.jsscript=function(callback){text='\nfunction update_'+this.fieldname+'(calendar) {';text+='\nif(calendar != null) {';text+='\ncalendar.onUpdateTime();';text+='\ncalendar.onSetTime();';text+='\ncalendar.hide();';text+='\n}'
|
||||
text+='\nd = document.getElementById("'+this.fieldname+'_date").value;';text+='\nh = document.getElementById("'+this.fieldname+'_hours").value;';text+='\nm = document.getElementById("'+this.fieldname+'_minutes").value;';text+='\nnewdate = d + " " + h + "'+this.timeseparator+'" + m;';if(this.hasMeridiem){text+='\nif(typeof document.getElementById("'+this.fieldname+'_meridiem") != "undefined") {';text+='\n newdate += document.getElementById("'+this.fieldname+'_meridiem").value;';text+='\n}';}
|
||||
text+='\nif(trim(newdate) =="'+this.timeseparator+'") newdate="";';text+='\ndocument.getElementById("'+this.fieldname+'").value = newdate;';text+='\n'+callback;text+='\n}';return text;}
|
||||
Datetimecombo.prototype.html=function(callback){var text='<select class="datetimecombo_time" size="1" id="'+this.fieldname+'_hours" name="'+this.fieldname+'_hours" tabindex="'+this.tabindex+'" onchange="combo_'+this.fieldname+'.update(); '+callback+'">';var h1=this.has12Hours?1:0;var h2=this.has12Hours?12:23;if(this.allowEmptyHM){text+='<option></option>';}
|
||||
for(i=h1;i<=h2;i++){val=i<10?"0"+i:i;text+='<option value="'+val+'" '+(i==this.hrs?"SELECTED":"")+'>'+val+'</option>';}
|
||||
text+='\n</select> ';text+=this.timeseparator;text+='\n <select class="datetimecombo_time" size="1" id="'+this.fieldname+'_minutes" name="'+this.fieldname+'_minutes" tabindex="'+this.tabindex+'" onchange="combo_'+this.fieldname+'.update(); '+callback+'">';if(this.allowEmptyHM){text+='\n<option></option>';}
|
||||
text+='\n<option value="00" '+(this.mins==0?"SELECTED":"")+'>00</option>';text+='\n<option value="15" '+(this.mins==15?"SELECTED":"")+'>15</option>';text+='\n<option value="30" '+(this.mins==30?"SELECTED":"")+'>30</option>';text+='\n<option value="45" '+(this.mins==45?"SELECTED":"")+'>45</option>';text+='\n</select>';if(this.hasMeridiem){text+='\n ';text+='\n<select class="datetimecombo_time" size="1" id="'+this.fieldname+'_meridiem" tabindex="'+this.tabindex+'" onchange="combo_'+this.fieldname+'.update(); '+callback+'">';if(this.allowEmptyHM){text+='\n<option></option>';}
|
||||
text+='\n<option value="'+(this.pm?"am":"AM")+'" '+(/am/i.test(this.meridiem)?"SELECTED":"")+'>'+(this.pm?"am":"AM")+'</option>';text+='\n<option value="'+(this.pm?"pm":"PM")+'" '+(/pm/i.test(this.meridiem)?"SELECTED":"")+'>'+(this.pm?"pm":"PM")+'</option>';text+='\n</select>';}
|
||||
if(this.showCheckbox){text+='\n<input style="visibility:hidden;" type="checkbox" name="'+this.fieldname+'_flag" id="'+this.fieldname+'_flag" tabindex="'+this.tabindex+'" onchange="combo_'+this.fieldname+'.update(); '+callback+'" '+(this.checked?'CHECKED':'')+'>';}
|
||||
return text;};Datetimecombo.prototype.update=function(){id=this.fieldname+'_date';d=window.document.getElementById(id).value;id=this.fieldname+'_hours';h=window.document.getElementById(id).value;id=this.fieldname+'_minutes';m=window.document.getElementById(id).value;newdate=d+' '+h+this.timeseparator+m;if(this.hasMeridiem){ampm=document.getElementById(this.fieldname+"_meridiem").value;newdate+=ampm;}
|
||||
if(trim(newdate)==""+this.timeseparator+""){newdate='';}
|
||||
document.getElementById(this.fieldname).value=newdate;if(this.showCheckbox){flag=this.fieldname+'_flag';date=this.fieldname+'_date';hours=this.fieldname+'_hours';mins=this.fieldname+'_minutes';if(document.getElementById(flag).checked){document.getElementById(flag).value=1;document.getElementById(this.fieldname).value='';document.getElementById(date).disabled=true;document.getElementById(hours).disabled=true;document.getElementById(mins).disabled=true;}else{document.getElementById(flag).value=0;document.getElementById(date).disabled=false;document.getElementById(hours).disabled=false;document.getElementById(mins).disabled=false;}}};
|
||||
1279
include/SugarFields/Fields/File/jquery.form.js
Executable file
1279
include/SugarFields/Fields/File/jquery.form.js
Executable file
File diff suppressed because it is too large
Load Diff
75
include/asterisk/calendar/cal.js
Executable file
75
include/asterisk/calendar/cal.js
Executable file
@@ -0,0 +1,75 @@
|
||||
function GetDowStart() {return 0;}function GetDateFmt() {return "mmddyy";}function GetDateSep() {return "/";}
|
||||
function ShowCalendar(eP,eD,eDP,dmin,dmax)
|
||||
{
|
||||
SCal(eP,eD,eDP,dmin,dmax);
|
||||
}
|
||||
function ShowCalSimp(fm,eD,eDP,dmin,dmax){
|
||||
if(!dmin)dmin='3/1/2005';if(!dmax)dmax='1/25/2006';
|
||||
if(fm){SetNextFocus(objNext(fm,eD));SetPrevFocus(objPrev(fm,eD));}
|
||||
SCal(eD,eD,eDP,dmin,dmax);
|
||||
}
|
||||
|
||||
var zz, zv, d, fTSR;
|
||||
d = new Date();
|
||||
fTSR=0;
|
||||
zv = d.getTime();
|
||||
zz = "&zz="+zv;
|
||||
|
||||
var gBF=false;
|
||||
function GoTo(u){window.top.location = u + zz;}
|
||||
function Go(u){window.top.location = u;}
|
||||
|
||||
function BF(){gBF=true;}
|
||||
|
||||
function Foci(o){if(!gBF && IsVis(o)){o.focus();}}
|
||||
|
||||
function IsVis(o)
|
||||
{
|
||||
if(!o || o.type=="hidden")
|
||||
return false;
|
||||
|
||||
while(o && o.style && o.style.display!='none')
|
||||
{
|
||||
o = o.parentNode;
|
||||
}
|
||||
return !o || !o.style;
|
||||
}
|
||||
|
||||
|
||||
function TEK(a,evt){
|
||||
var keycode;
|
||||
if (window.event){ keycode = window.event.keyCode; evt = window.event;}
|
||||
else if(evt) {keycode = evt.which;}
|
||||
else {return true;}
|
||||
if(13==keycode){evt.cancelBubble = true; evt.returnValue = false; eval(a);}
|
||||
}
|
||||
|
||||
function getObj(objID)
|
||||
{
|
||||
if (document.getElementById) {return document.getElementById(objID);}
|
||||
else if (document.all) {return document.all[objID];}
|
||||
else if (document.layers) {return document.layers[objID];}
|
||||
}
|
||||
|
||||
function objNext(f,d)
|
||||
{
|
||||
var fFnd=false,el=f.elements,i=0;
|
||||
for(;i < el.length;i++)
|
||||
{
|
||||
if('hidden'!=el[i].type && false==el[i].disabled && IsVis(el[i]) && fFnd)return el[i];
|
||||
if(d.id==el[i].id)fFnd=true;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function objPrev(f,d)
|
||||
{
|
||||
var fFnd=false,el=f.elements,i=el.length - 1;
|
||||
for(;i >= 0;i--)
|
||||
{
|
||||
if('hidden'!=el[i].type && false==el[i].disabled && IsVis(el[i]) && fFnd)return el[i];
|
||||
if(d.id==el[i].id)fFnd=true;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function DoNothing() {return false;}
|
||||
159
include/asterisk/calendar/calx.js
Executable file
159
include/asterisk/calendar/calx.js
Executable file
@@ -0,0 +1,159 @@
|
||||
var cF=null;var cW=null;var g_tid=0;var g_cP,g_eD,g_eDP,g_dmin,g_dmax;
|
||||
var nextFocus;var g_fNoCal=false;
|
||||
|
||||
function getEventObj(e){if(!e)e=window.event;return e;}
|
||||
|
||||
function stopBubble(e){e=getEventObj(e);e.cancelBubble=true;if(e.stopPropagation)e.stopPropagation();}
|
||||
|
||||
function CB(){stopBubble(event);}
|
||||
|
||||
function SCal(cP,eD,eDP,dmin,dmax){
|
||||
clearTimeout(g_tid);
|
||||
if(g_fNoCal){
|
||||
g_fNoCal=false;
|
||||
return;
|
||||
}
|
||||
if(g_calShown && eD==g_eD)
|
||||
return;
|
||||
g_calShown = true;
|
||||
g_calCB = null;
|
||||
g_cP=cP;
|
||||
g_eD=eD;
|
||||
g_eDP=eDP;
|
||||
g_dmin=dmin;
|
||||
g_dmax=dmax;
|
||||
WaitCal();
|
||||
}
|
||||
function CancelCal(){clearTimeout(g_tid);if(!cF)cF=getObj('CalFrame');cF.style.visibility="hidden";g_calShown=false;}
|
||||
function WaitCal()
|
||||
{
|
||||
if(!cW)cW=frames['CalFrame'];
|
||||
|
||||
if(null==cW||null==cW.g_fCL||false==cW.g_fCL){
|
||||
g_tid=setTimeout("WaitCal()", 200);
|
||||
}
|
||||
else{
|
||||
if(!cF)cF=getObj('CalFrame');
|
||||
cF.style.visibility="hidden";
|
||||
setTimeout("DoCal()",1);
|
||||
}
|
||||
}
|
||||
function DoCal(){PosCal(g_cP);
|
||||
if(!cW)cW=frames['CalFrame'];
|
||||
cW.DoCal(g_eD,g_eDP,g_dmin,g_dmax);}
|
||||
|
||||
function getScrollTop()
|
||||
{
|
||||
if(document.documentElement.scrollTop) return document.documentElement.scrollTop;
|
||||
if(document.body.scrollTop) return document.body.scrollTop;
|
||||
if(window.pageYOffset) return window.pageYOffset;
|
||||
return 0;
|
||||
}
|
||||
|
||||
function getWinHeight()
|
||||
{
|
||||
if(window.innerHeight) return window.innerHeight;
|
||||
if(document.documentElement.clientHeight) return document.documentElement.clientHeight;
|
||||
if(document.body.clientHeight) return document.body.clientHeight;
|
||||
return 0;
|
||||
}
|
||||
|
||||
function PosCal(cP)
|
||||
{
|
||||
var dB=document.body;var eL=0;var eT=0;
|
||||
if(!cF)
|
||||
cF=getObj('CalFrame');
|
||||
for(var p=cP;p&&p.tagName!='BODY';p=p.offsetParent){
|
||||
/*
|
||||
eL+=p.offsetLeft;
|
||||
eT+=p.offsetTop;
|
||||
*/
|
||||
|
||||
eL+=p.offsetLeft;
|
||||
eT+=p.offsetTop;
|
||||
}
|
||||
|
||||
var eH=cP.offsetHeight;
|
||||
var dH=parseInt(cF.style.height);
|
||||
var sT=getScrollTop();
|
||||
|
||||
if(eT-dH>=sT&&eT+eH+dH>getWinHeight()+sT)
|
||||
eT-=dH;
|
||||
else
|
||||
eT+=eH;
|
||||
|
||||
/*static fixed position for now */
|
||||
cF.style.left = 200+'px';
|
||||
cF.style.top = 50+'px';
|
||||
|
||||
/*positioning px here
|
||||
var eH=cP.offsetHeight;
|
||||
var dH=parseInt(cF.style.height);
|
||||
var sT=getScrollTop();
|
||||
if(eT-dH>=sT&&eT+eH+dH>getWinHeight()+sT)
|
||||
eT-=dH;
|
||||
else eT+=eH;
|
||||
cF.style.left=eL+'px';
|
||||
cF.style.top=eT+'px';
|
||||
*/
|
||||
}
|
||||
|
||||
function SetNextFocus(e){nextFocus=e;if(nextFocus)nextFocus.onfocus=CancelCal;}
|
||||
function SetPrevFocus(e){if(e)e.onfocus=CancelCal;}
|
||||
|
||||
function FGoNextFocus(){if(nextFocus){nextFocus.focus();return true;}return false;}
|
||||
|
||||
function CalSetFocus(e){if(e){g_fNoCal=true;e.focus();setTimeout("EndCalFocus()", 200);}}
|
||||
function EndCalFocus(){g_fNoCal=false;}
|
||||
|
||||
function CalDateSet(eInp,d,m,y,giveFocus)
|
||||
{
|
||||
var ds=GetDateSep();
|
||||
var fmt=GetDateFmt();
|
||||
|
||||
if(fmt=="mmddyy")eInp.value=m+ds+d+ds+y;
|
||||
else if(fmt=="ddmmyy")eInp.value=d+ds+m+ds+y;
|
||||
else eInp.value=y+ds+m+ds+d;
|
||||
if(!giveFocus)
|
||||
CalSetFocus(eInp);
|
||||
}
|
||||
|
||||
var g_calShown = false;
|
||||
function SetCalShown(fcshown){g_calShown=fcshown;}
|
||||
|
||||
var g_calCB;
|
||||
function CalendarCallback(){if(g_calCB)g_calCB();}
|
||||
function SetCalendarCallback(cb){g_calCB=cb;}
|
||||
|
||||
|
||||
function GetInputDate(t)
|
||||
{
|
||||
if(!t.length) return null;
|
||||
t=t.replace(/\s+/g,"");
|
||||
if(t.match(/[^-|\d|\.|\/]/)) return null;
|
||||
var rgt=t.split(/-|\.|\//);
|
||||
for(var i=0;i<rgt.length;i++) rgt[i]=parseInt(rgt[i],10);
|
||||
if(!rgt[1]) return null;
|
||||
var m,d,y;
|
||||
var fmt=GetDateFmt();
|
||||
if(fmt=="yymmdd")
|
||||
{
|
||||
if(!rgt[2]) return null;
|
||||
m=rgt[1];d=rgt[2];y=rgt[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
if(fmt=="mmddyy"){m=rgt[0];d=rgt[1];}
|
||||
else{m=rgt[1];d=rgt[0];}//fmt=="ddmmyy"
|
||||
if(rgt[2])y=rgt[2];
|
||||
else y=DefYr(m-1,d);
|
||||
}
|
||||
m-=1;if(y<100)y+=2000;
|
||||
if(y<1601||y>4500||m<0||m>11||d<1||d>GetMonthCount(m,y))return null;
|
||||
return new Date(y,m,d);
|
||||
}
|
||||
|
||||
var rM=new Array(12);rM[0]=rM[2]=rM[4]=rM[6]=rM[7]=rM[9]=rM[11]=31;rM[3]=rM[5]=rM[8]=rM[10]=30;rM[1]=28;
|
||||
function GetMonthCount(m,y){var c=rM[m];if((1==m)&&IsLY(y))c++;return c;}
|
||||
function IsLY(y){if(0==y%4&&((y%100!=0)||(y%400==0)))return true;else return false;}
|
||||
function DefYr(m,d){var dt=new Date();var yC=(dt.getYear()<1000)?1900+dt.getYear():dt.getYear();if(m<dt.getMonth()||(m==dt.getMonth()&&d<dt.getDate()))yC++;return yC;}
|
||||
152
include/asterisk/calendar/d.js
Executable file
152
include/asterisk/calendar/d.js
Executable file
@@ -0,0 +1,152 @@
|
||||
var pwid = '';
|
||||
var cwid = '';
|
||||
var bB = true;
|
||||
var bFlex = false;
|
||||
|
||||
var FCity = '';
|
||||
var TCity = '';
|
||||
var FTLA = '';
|
||||
var TTLA = '';
|
||||
var TCityId = '6022969';
|
||||
|
||||
var FDate = 'mm/dd/yy';
|
||||
var TDate = 'mm/dd/yy';
|
||||
var MDate = '';
|
||||
var CalS = '';
|
||||
var CalE = '';
|
||||
|
||||
var FTime = '362';
|
||||
var TTime = '362';
|
||||
|
||||
var rooms = 1;
|
||||
var minR = 1;
|
||||
var maxR = 9;
|
||||
var minA = 0;
|
||||
var maxA = 6;
|
||||
var minS = 0;
|
||||
var maxS = 6;
|
||||
var minC = 0;
|
||||
var maxC = 6;
|
||||
|
||||
var nR = 1;
|
||||
var aRA;
|
||||
var aRS;
|
||||
var aRC;
|
||||
var aRCA;
|
||||
var Inf = 'l';
|
||||
|
||||
var TL = '';
|
||||
var CCl = 'NoPreference';
|
||||
var SText = 'Search for flights';
|
||||
|
||||
var tl = '';
|
||||
var ti = '';
|
||||
var te = '';
|
||||
var nm = 12;
|
||||
|
||||
var arrColors = new Array('Red', 'Lime', 'Yellow', 'Aqua', 'Blue', 'Green', 'White','Silver', 'Teal', 'Orange', 'Pink');
|
||||
var arrMN = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July','August', 'September', 'October', 'November', 'December');
|
||||
var arrCC = new Array('NoPreference|No Preference','Economy|Economy','Compact|Compact','Midsize|Midsize','Standard|Standard','FullSize|Full Size','Premium|Premium','Luxury|Luxury','Convertible|Convertible','Minivan|Minivan','SUV|Sport Utility Vehicle','SportsCar|Sports Car');
|
||||
var arrSR = new Array('0|Show all','10|1 Star or more','20|2 Stars or more','30|3 Stars or more','40|4 Stars or more','50|5 Stars');
|
||||
var arrFD = new Array('|-Select from the list-','ATL|Atlanta, GA (ATL-Hartsfield Intl.)','AUS|Austin, TX (AUS-Austin-Bergstrom International Airport)','BWI|Baltimore, MD (BWI-Baltimore Washington)','BOS|Boston, MA (BOS-Logan Intl.)','CLT|Charlotte, NC (CLT-Douglas Intl.)','ORD|Chicago, IL (ORD-O\'Hare)','CLE|Cleveland, OH (CLE-Hopkins Intl.)','CMH|Columbus, OH (CMH-Port Columbus Intl.)','DFW|Dallas, TX (DFW-Dallas-Fort Worth Intl.)','DEN|Denver, CO (DEN-Denver Intl.)','DTW|Detroit, MI (DTW-Wayne County)','FLL|Fort Lauderdale, FL (FLL)','RSW|Fort Myers, FL (RSW-Southwest Florida Regional)','BDL|Hartford, CT (BDL-Bradley Intl.)','HNL|Honolulu, Oahu, HI (HNL-Honolulu Intl.)','IAH|Houston, TX (IAH-Bush Intercontinental)','IND|Indianapolis, IN (IND-Indianapolis Intl.)','JAX|Jacksonville, FL (JAX-Jacksonville Intl.)','MCI|Kansas City, MO (MCI-Kansas City Intl.)','LAS|Las Vegas, NV (LAS-McCarran Intl.)','LAX|Los Angeles, CA (LAX-Los Angeles Intl.)','MIA|Miami, FL (MIA-Miami Intl.)','MSP|Minneapolis, MN (MSP-Minneapolis-St. Paul Intl.)','BNA|Nashville, TN (BNA)','MSY|New Orleans, LA (MSY-New Orleans Intl.)','JFK|New York, NY (JFK-Kennedy)','LGA|New York, NY (LGA-LaGuardia)','EWR|Newark, NJ (EWR-Newark International Airport)','OAK|Oakland, CA (OAK-Oakland Intl.)','SNA|Orange County, CA (SNA-John Wayne Intl.)','MCO|Orlando, FL (MCO-Orlando Intl.)','PHL|Philadelphia, PA (PHL-Philadelphia Intl.)','PHX|Phoenix, AZ (PHX-Sky Harbor Intl.)','PIT|Pittsburgh, PA (PIT-Greater Pittsburgh Intl.)','PDX|Portland, OR (PDX-Portland Intl.)','RDU|Raleigh, NC (RDU-Raleigh Durham Intl.)','RNO|Reno, NV (RNO-Reno-Tahoe International)','SLC|Salt Lake City, UT (SLC-Salt Lake City Intl.)','SAT|San Antonio, TX (SAT-San Antonio Intl.)','SAN|San Diego, CA (SAN-Lindbergh Field)','SFO|San Francisco, CA (SFO-San Francisco Intl.)','SJC|San Jose, CA (SJC-San Jose Intl.)','SEA|Seattle, WA (SEA-Seattle Tacoma)','STL|St. Louis, MO (STL-Lambert-St. Louis Intl.)','TPA|Tampa, FL (TPA-Tampa Intl.)','DCA|Washington, DC (DCA-Ronald Reagan National)','IAD|Washington, DC (IAD-Dulles)','PBI|West Palm Beach, FL (PBI-Palm Beach Intl.)');
|
||||
var arrTL = new Array('0,1,10|1 - 10 nights','1,0,0|Weekend','0,2,4|2 - 4 nights','0,3,5|3 - 5 nights','0,5,7|5 - 7 nights','0,7,10|7 - 10 nights','0,1,1|1 night','0,2,2|2 nights','0,3,3|3 nights','0,4,4|4 nights','0,5,5|5 nights','0,6,6|6 nights','0,7,7|7 nights','0,8,8|8 nights','0,9,9|9 nights','0,10,10|10 nights');
|
||||
var arrTD = new Array('6023185|Africa','203|Alaska','6023099|Asia','6023738|Australia-South Pacific','13|Bahamas','20|Bermuda','6023742|Canada-New England-NY','6022969|Caribbean','6023743|Caribbean-Eastern','6023744|Caribbean-Southern','6023745|Caribbean-Western','6022967|Europe','213|Hawaii','500010|India-Indian Ocean','6023183|Mediterranean','117|Mexico','6023182|Middle East','500001|North America','6023756|North Pacific','-2|Nowhere (no port stops)','6023753|Panama Canal','6023117|South America','-3|Transatlantic','-4|Transpacific','-5|World');
|
||||
//var arrST = new Array('|- Any State -','AL|AL-Alabama','AK|AK-Alaska','AZ|AZ-Arizona','AR|AR-Arkansas','CA|CA-California','CO|CO-Colorado','CT|CT-Connecticut','DE|DE-Delaware','DC|DC-District of Columbia','FL|FL-Florida','GA|GA-Georgia','HI|HI-Hawaii','ID|ID-Idaho','IL|IL-Illinois','IN|IN-Indiana','IA|IA-Iowa','KS|KS-Kansas','KY|KY-Kentucky','LA|LA-Louisiana','ME|ME-Maine','MD|MD-Maryland','MA|MA-Massachusetts','MI|MI-Michigan','MN|MN-Minnesota','MS|MS-Mississippi','MO|MO-Missouri','MT|MT-Montana','NE|NE-Nebraska','NV|NV-Nevada','NH|NH-New Hampshire','NJ|NJ-New Jersey','NM|NM-New Mexico','NY|NY-New York','NC|NC-North Carolina','ND|ND-North Dakota','OH|OH-Ohio','OK|OK-Oklahoma','OR|OR-Oregon','PA|PA-Pennsylvania','RI|RI-Rhode Island','SC|SC-South Carolina','SD|SD-South Dakota','TN|TN-Tennessee','TX|TX-Texas','UT|UT-Utah','VT|VT-Vermont','VA|VA-Virginia','WA|WA-Washington','WV|WV-West Virginia','WI|WI-Wisconsin','WY|WY-Wyoming');
|
||||
var arrST = new Array('|--','AL|AL','AK|AK','AZ|AZ','AR|AR','CA|CA','CO|CO','CT|CT','DE|DE','DC|DC','FL|FL','GA|GA','HI|HI','ID|ID','IL|IL','IN|IN','IA|IA','KS|KS','KY|KY','LA|LA','ME|ME','MD|MD','MA|MA','MI|MI','MN|MN','MS|MS','MO|MO','MT|MT','NE|NE','NV|NV','NH|NH','NJ|NJ','NM|NM','NY|NY','NC|NC','ND|ND','OH|OH','OK|OK','OR|OR','PA|PA','RI|RI','SC|SC','SD|SD','TN|TN','TX|TX','UT|UT','VT|VT','VA|VA','WA|WA','WV|WV','WI|WI','WY|WY');
|
||||
//var arrT1 = new Array('12AM|12:00 AM','1AM|1:00 AM','2AM|2:00 AM','3AM|3:00 AM','4AM|4:00 AM','5AM|5:00 AM','6AM|6:00 AM','7AM|7:00 AM','8AM|8:00 AM','9AM|9:00 AM','10AM|10:00 AM','11AM|11:00 AM','12PM|12:00 PM','1PM|1:00 PM','2PM|2:00 PM','3PM|3:00 PM','4PM|4:00 PM','5PM|5:00 PM','6PM|6:00 PM','7PM|7:00 PM','8PM|8:00 PM','9PM|9:00 PM','10PM|10:00 PM','11PM|11:00 PM','361|Morning','362|Any','721|Noon','1081|Evening');
|
||||
var arrT1 = new Array('362|Any','12AM|12 AM','1AM|1 AM','2AM|2 AM','3AM|3 AM','4AM|4 AM','5AM|5 AM','6AM|6 AM','7AM|7 AM','8AM|8 AM','9AM|9 AM','10AM|10 AM','11AM|11 AM','12PM|12 PM','1PM|1 PM','2PM|2 PM','3PM|3 PM','4PM|4 PM','5PM|5 PM','6PM|6 PM','7PM|7 PM','8PM|8 PM','9PM|9 PM','10PM|10 PM','11PM|11 PM','361|Morn.','721|Noon','1081|Eve.');
|
||||
//var arrT2 = new Array('361|Morning','362|Any','721|Noon','1081|Evening');
|
||||
|
||||
var nextFocus = null;
|
||||
|
||||
function GetDefault(E)
|
||||
{
|
||||
var t = '';
|
||||
var d = '2';
|
||||
var a = new Array();
|
||||
|
||||
switch (E)
|
||||
{
|
||||
case 'A':if(cwid == '1' || cwid == '7'){d = '1';}for (var i = minR; i < (maxR + 1); i++){if (i != maxR){t = t + d + ',';}else{t = t + d;}}return t;break;
|
||||
case 'S':for (var i = minR; i < (maxR + 1); i++){if (i != maxR){t = t + '0,';}else{t = t + '0';}}return t;break;
|
||||
case 'C':for (var i = minR; i < (maxR + 1); i++){if (i != maxR){t = t + '0,';}else{t = t + '0';}}return t;break;
|
||||
case 'CA':
|
||||
for (var i = 1; i < (maxC + 1); i++){if (i != maxC){t = t + '-1,';} else{t = t + '-1';}};
|
||||
for (var i = 0; i < maxR; i++){a[i] = t.split(',');}return a;break;
|
||||
case 'FT':return '362||11AM|361|361|11AM|362||';break;
|
||||
case 'TT':return '362||11AM|1081|1081|11AM|362||';break;
|
||||
}
|
||||
}
|
||||
|
||||
function RemG(el)
|
||||
{
|
||||
var n = el.id.substr(3);
|
||||
switch (el.id.substr(0,3))
|
||||
{
|
||||
case 'fcy':FCity = el.value;DE('FCity').value = FCity;break;
|
||||
case 'tcy':if(n == ''){TCity = el.value;DE('TCity').value = TCity;}break;
|
||||
case 'tci':TCityId = el.value;DE('TCityId').value = TCityId;break;
|
||||
case 'fct':FTLA = el.value;DE('FTLA').value = FTLA;break;
|
||||
case 'tct':TTLA = el.value;DE('TTLA').value = TTLA;break;
|
||||
case 'fdt':FDate = el.value;DE('FDate').value = FDate;break;
|
||||
case 'tdt':TDate = el.value;DE('TDate').value = TDate;break;
|
||||
case 'mon':MDate = el.value;DE('MDate').value = MDate;break;
|
||||
case 'ftt':FTime = el.value;DE('FTime').value = FTime;break;
|
||||
case 'ttt':TTime = el.value;DE('TTime').value = TTime;break;
|
||||
case 'trl':TL = el.value;DE('TL').value = TL;break;
|
||||
case 'ccl':CCl = el.value;DE('CarC').value = CCl;break;
|
||||
case 'rrr':nR = el.options[el.selectedIndex].value;DE('nR').value = nR;break;
|
||||
case 'rad':aRA[n - 1] = el.options[el.selectedIndex].value;DE('aRA').value = aRA.join('|');break;
|
||||
case 'rse':aRS[n - 1] = el.options[el.selectedIndex].value;DE('aRS').value = aRS.join('|');break;
|
||||
case 'rch':aRC[n - 1] = el.options[el.selectedIndex].value;DE('aRC').value = aRC.join('|');break;
|
||||
case 'rca':n = n.split('_');aRCA[n[0] - 1][n[1] - 1] = el.options[el.selectedIndex].value;DE('aRCA').value = aRCA.join('|');break;
|
||||
case 'rIS':if (el.checked){Inf = 's';}DE('Inf').value = Inf;break;
|
||||
case 'rIL':if (el.checked){Inf = 'l';}DE('Inf').value = Inf;break;
|
||||
}
|
||||
}
|
||||
|
||||
function GetSavedValuesG()
|
||||
{
|
||||
var v;
|
||||
v = DE('FCity').value;if (v != '') {FCity = v;}
|
||||
v = DE('TCity').value;if (v != '') {TCity = v;}
|
||||
v = DE('TCityId').value;if (v != '') {TCityId = v;}
|
||||
v = DE('FTLA').value;if (v != '') {FTLA = v;}
|
||||
v = DE('TTLA').value;if (v != '') {TTLA = v;}
|
||||
v = DE('FDate').value;if (v != '') {FDate = v;}
|
||||
v = DE('TDate').value;if (v != '') {TDate = v;}
|
||||
v = DE('MDate').value;if (v != '') {MDate = v;}
|
||||
v = DE('FTime').value;if (v != '') {FTime = v;}
|
||||
v = DE('TTime').value;if (v != '') {TTime = v;}
|
||||
v = DE('CarC').value;if (v != '') {CCl = v;}
|
||||
v = DE('nR').value;if (v != '') {nR = v;}
|
||||
v = DE('aRA').value;if (v != '') {aRA = v.split('|');}
|
||||
v = DE('aRS').value;if (v != '') {aRS = v.split('|');}
|
||||
v = DE('aRC').value;if (v != '') {aRC = v.split('|');}
|
||||
v = DE('aRCA').value;if (v != '') {aRCA = v.split('|');for (var j = 0; j < aRCA.length; j++){aRCA[j] = aRCA[j].split(',');}}
|
||||
v = DE('Inf').value;if (v != '') {Inf = v;}
|
||||
CalS = DE('CalS').value;
|
||||
CalE = DE('CalE').value;
|
||||
|
||||
var sdt = new Date(CalS);
|
||||
var edt = new Date(CalE);
|
||||
var j = 0;
|
||||
var sm = sdt.getMonth() + 1;
|
||||
var em = 12;
|
||||
if(sdt.getYear() == edt.getYear())
|
||||
{
|
||||
em = edt.getMonth() + 1;
|
||||
}
|
||||
for (var i = sm;i <= em;i++)
|
||||
{
|
||||
j = j + 1;
|
||||
}
|
||||
if(edt.getYear() > sdt.getYear())
|
||||
{
|
||||
for (var i = 1;i <= edt.getMonth() + 1;i++)
|
||||
{
|
||||
j = j + 1;
|
||||
}
|
||||
}
|
||||
if(j > 0){nm = j;}
|
||||
}
|
||||
801
include/asterisk/calendar/e.js
Executable file
801
include/asterisk/calendar/e.js
Executable file
@@ -0,0 +1,801 @@
|
||||
function I()
|
||||
{
|
||||
//CancelCal();
|
||||
if(DE('r1')!=null){if(DE('r1').checked){hw('1');return;}}
|
||||
if(DE('r2')!=null){if(DE('r2').checked){hw('2');return;}}
|
||||
if(DE('r3')!=null){if(DE('r3').checked){hw('3');return;}}
|
||||
if(DE('r4')!=null){if(DE('r4').checked){hw('4');return;}}
|
||||
if(DE('r5')!=null){if(DE('r5').checked){hw('5');return;}}
|
||||
if(DE('r6')!=null){if(DE('r6').checked){hw('6');return;}}
|
||||
if(DE('r7')!=null){if(DE('r7').checked){hw('7');return;}}
|
||||
if(DE('r8')!=null){if(DE('r8').checked){hw('8');return;}}
|
||||
if(DE('r9')!=null){if(DE('r9').checked){hw('9');return;}}
|
||||
var b = DE('BundleType').value;
|
||||
if(b=='3'){hw('4');return;}
|
||||
if(b=='7'){hw('5');return;}
|
||||
if(b=='6'){hw('6');return;}
|
||||
if(b=='5'){hw('7');return;}
|
||||
//hw('');
|
||||
}
|
||||
|
||||
function SO()
|
||||
{
|
||||
var p = '';
|
||||
if(typeof(bPageHasDCCoreOffer) != 'undefined')
|
||||
{
|
||||
if(bPageHasDCCoreOffer)
|
||||
{
|
||||
switch (cwid)
|
||||
{
|
||||
case '1':case '7':p = 'Flight';break;
|
||||
case '2':p = 'Hotel';break;
|
||||
case '3':p = 'Car';break;
|
||||
case '4':case '5':case '6':p = 'Package';break;
|
||||
case '8':p = 'Cruise';break;
|
||||
case '9':p = 'Activity';break;
|
||||
}
|
||||
setOffer(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function GetFields(t)
|
||||
{
|
||||
sb.Reset();
|
||||
switch (t)
|
||||
{
|
||||
case 'F':
|
||||
case 'FH':
|
||||
case 'FHC':
|
||||
case 'FC':
|
||||
sb.Concat('<div class="bl1">');
|
||||
sb.Concat('<div class="flmed">' + GetGL('fcy','Leaving from:') + '<br/>' + GetCy(t,'F') + '</div>');
|
||||
sb.Concat('<div class="frmed">' + GetGL('tcy','Going to:') + '<br/>' + GetCy(t,'T') + '</div>');
|
||||
sb.Concat('</div>');
|
||||
sb.Concat('<div class="bl1">');
|
||||
sb.Concat('<div class="flmed">');
|
||||
sb.Concat('<div class="fl">' + GetGL('fdt','Departing:') + '<br/>' + GetDt(t,'F') + '</div>');
|
||||
sb.Concat('<div class="fr">' + GetGL('ftt','Time:') + '<br/>' + GetT(t,'F') + '</div>');
|
||||
sb.Concat('</div>');
|
||||
sb.Concat('<div class="frmed">');
|
||||
sb.Concat('<div class="fl">' + GetGL('tdt','Returning:') + '<br/>' + GetDt(t,'T') + '</div>');
|
||||
sb.Concat('<div class="fr">' + GetGL('ttt','Time:') + '<br/>' + GetT(t,'T') + '</div>');
|
||||
sb.Concat('</div>');
|
||||
sb.Concat('</div>');
|
||||
break;
|
||||
case 'FL':
|
||||
tl = 'Don\'t see the city you\'re looking for?';
|
||||
ti = tl;
|
||||
te = 'Flexible-date searches are currently available only for our most popular routes. You can still search for flights in the usual way by putting in your departure and return dates.';
|
||||
sb.Concat('<div class="bl1">' + GetGL('fct','Leaving from:') + '<br/>' + GetDD('fct',arrFD,FTLA,'large','',' onchange="Rem(this);"') + '</div>');
|
||||
sb.Concat('<div class="bl1">' + GetGL('tct','Going to:') + '<br/>' + GetDD('tct',arrFD,TTLA,'large','',' onchange="Rem(this);"') + '</div>');
|
||||
sb.Concat('<div class="bl1" style="padding-bottom:12px;">' + GetTT(tl,ti,te,0,'','',true) + '</div>');
|
||||
sb.Concat('<div class="bl1">');
|
||||
sb.Concat('<div class="flmed">' + GetGL('mon','Departure month:') + '<br/>' + GetM(nm,MDate,'','',' onchange="Rem(this);"') + '</div>');
|
||||
sb.Concat('<div class="frmed">' + GetGL('trl','Trip length:') + '<br/>' + GetDD('trl',arrTL,TL,'','',' onchange="Rem(this);"') + '</div>');
|
||||
sb.Concat('</div>');
|
||||
sb.Concat('<div class="clearer"></div>');
|
||||
break;
|
||||
case 'H':
|
||||
sb.Concat('<div class="bl1">' + GetGL('tcy','Destination:') + '<br/>' + GetCy(t,'T') + '</div>');
|
||||
sb.Concat('<div class="bl1">');
|
||||
sb.Concat('<div class="flmed">' + GetGL('fdt','Check-in:') + '<br/>' + GetDt(t,'F') + '</div>');
|
||||
sb.Concat('<div class="frmed">' + GetGL('tdt','Check-out:') + '<br/>' + GetDt(t,'T') + '</div>');
|
||||
sb.Concat('</div>');
|
||||
break;
|
||||
case 'C':
|
||||
sb.Concat('<div class="bl1">');
|
||||
sb.Concat('<div class="flmed">' + GetGL('tcy','Pick-up location:') + '<br/>' + GetCy(t,'T') + '</div>');
|
||||
sb.Concat('<div class="frmed">' + GetGL('ccl','Car type:') + '<br/>' + GetDD('ccl',arrCC,CCl,'','',' onchange="Rem(this);"') + '</div>');
|
||||
sb.Concat('</div>');
|
||||
sb.Concat('<div class="bl1">');
|
||||
sb.Concat('<div class="flmed">');
|
||||
sb.Concat('<div class="fl">' + GetGL('fdt','Pick-up:') + '<br/>' + GetDt(t,'F') + '</div>');
|
||||
sb.Concat('<div class="fr">' + GetGL('ftt','Time:') + '<br/>' + GetT(t,'F') + '</div>');
|
||||
sb.Concat('</div>');
|
||||
sb.Concat('<div class="frmed">');
|
||||
sb.Concat('<div class="fl">' + GetGL('tdt','Drop-off:') + '<br/>' + GetDt(t,'T') + '</div>');
|
||||
sb.Concat('<div class="fr">' + GetGL('ttt','Time:') + '<br/>' + GetT(t,'T') + '</div>');
|
||||
sb.Concat('</div>');
|
||||
sb.Concat('</div>');
|
||||
break;
|
||||
case 'HC':
|
||||
sb.Concat('<div class="bl1">' + GetGL('tcy','Destination:') + '<br/>' + GetCy('H','T') + '</div>');
|
||||
sb.Concat('<div class="bl1">');
|
||||
sb.Concat('<div class="flmed">');
|
||||
sb.Concat('<div class="fl">' + GetGL('fdt','Check-in:') + '<br/>' + GetDt(t,'F') + '</div>');
|
||||
sb.Concat('<div class="fr">' + GetGL('ftt','Pick-up:') + '<br/>' + GetT('C','F') + '</div>');
|
||||
sb.Concat('</div>');
|
||||
sb.Concat('<div class="frmed">');
|
||||
sb.Concat('<div class="fl">' + GetGL('tdt','Check-out:') + '<br/>' + GetDt(t,'T') + '</div>');
|
||||
sb.Concat('<div class="fr">' + GetGL('ttt','Drop-off:') + '<br/>' + GetT('C','T') + '</div>');
|
||||
sb.Concat('</div>');
|
||||
sb.Concat('</div>');
|
||||
break;
|
||||
case 'Cr':
|
||||
sb.Concat('<div class="bl1" style="padding-bottom:10px;">');
|
||||
sb.Concat('<b>Note:</b> Cruise air and hotel stays are offered after you select the cruise.');
|
||||
sb.Concat('</div>');
|
||||
sb.Concat('<div class="bl1">' + GetGL('tci','Select a top destination:') + '<br/>' + GetDD('tci',arrTD,TCityId,'large','',' onchange="Rem(this);"') + '</div>');
|
||||
sb.Concat('<div class="bl1">' + GetGL('mon','Departing in:') + '<br/>' + GetM(18,MDate,'','',' onchange="Rem(this);"') + '</div>');
|
||||
break;
|
||||
}
|
||||
sb.Concat('<div class="clearer"></div>');
|
||||
return sb.GetValue();
|
||||
}
|
||||
|
||||
function GetM(n,d,c,s,j)
|
||||
{
|
||||
var dt = new Date();
|
||||
var y = dt.getFullYear();
|
||||
var dd = d;
|
||||
var c1 = 'class="med" ';
|
||||
var s1 = '';
|
||||
if(c != ''){c1 = 'class="' + c + '" ';}
|
||||
if(s != ''){s1 = 'style="' + s + '" ';}
|
||||
if (dd == '' && n == 18)
|
||||
{
|
||||
var nextMonth = new Date(dt.setMonth(dt.getMonth() + 1,1));
|
||||
dd = nextMonth.getMonth() + '-' + nextMonth.getFullYear();
|
||||
}
|
||||
dt = new Date();
|
||||
var t = '<select id="mon" name="mon" ' + c1 + s1 + j +'>';
|
||||
if (n == 18){t = t + '<option value="1/1/4501">All dates</option>';}
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
if (dt.getFullYear() == y){t = t + '<option value="' + dt.getMonth() + '-' + dt.getFullYear() +'">' + arrMN[dt.getMonth()] + '</option>';}
|
||||
else{t = t + '<option value="' + dt.getMonth() + '-' + dt.getFullYear() +'">' + arrMN[dt.getMonth()] + ' ' + dt.getFullYear() + '</option>';}
|
||||
dt.setMonth(dt.getMonth() + 1,1);
|
||||
}
|
||||
t = t + '</select>';
|
||||
return t.replace('value="' + dd + '"','value="' + dd + '" selected="selected"');
|
||||
}
|
||||
|
||||
function SetCC()
|
||||
{
|
||||
var d = DE('divCC');
|
||||
if (d != null)
|
||||
{
|
||||
if (cwid == '7'){SH(d,1);d.innerHTML = '<div class="bl1">' + GetGL('ccl','Car type:') + '<br/>' + GetDD('ccl',arrCC,CCl,'','',' onchange="Rem(this);"') + '</div><div class="clearer"></div>';}
|
||||
else{SH(d,0);}
|
||||
}
|
||||
}
|
||||
|
||||
function GetR(j)
|
||||
{
|
||||
var t = '';
|
||||
var tt = '';
|
||||
rooms = GetRC();
|
||||
t = t + '<select id="rrr" name="rrr"' + j + '>';
|
||||
for (i = minR; i < (maxR + 1); i++)
|
||||
{
|
||||
tt = i == 9 ? '+' : '';
|
||||
if (i == rooms){t = t + '<option value=' + i + ' selected>' + i + tt + '</option>';}
|
||||
else {t = t + '<option value=' + i + '>' + i + tt +'</option>';}
|
||||
}
|
||||
t = t + '</select>';
|
||||
return t;
|
||||
}
|
||||
|
||||
function GetA(r,s,j)
|
||||
{
|
||||
var t = '';
|
||||
var nA = parseInt(aRA[r - 1]);
|
||||
if (s==false)
|
||||
{
|
||||
var nS = parseInt(aRS[r - 1]);
|
||||
if ((nA + nS) <= maxA){nA = nA + nS;}
|
||||
}
|
||||
if (nA > maxA){nA = 1;}
|
||||
var ddName = 'rad' + r;
|
||||
t = t + '<select id="' + ddName + '" name="' + ddName + '"' + j + '>';
|
||||
for (i = minA; i < (maxA + 1); i++)
|
||||
{
|
||||
if (i == nA){t = t + '<option value=' + i + ' selected>' + i + '</option>';}
|
||||
else{t = t + '<option value=' + i + '>' + i + '</option>';}
|
||||
}
|
||||
t = t + '</select>';
|
||||
return t;
|
||||
}
|
||||
|
||||
function GetS(r,j)
|
||||
{
|
||||
var t = '';
|
||||
var ddName = 'rse' + r;
|
||||
t = t + '<select id="' + ddName + '" name="' + ddName + '"' + j + '>';
|
||||
|
||||
for (i = minS; i < (maxS + 1); i++)
|
||||
{
|
||||
if (i == aRS[r - 1]){t = t + '<option value=' + i + ' selected>' + i + '</option>';}
|
||||
else{t = t + '<option value=' + i + '>' + i + '</option>';}
|
||||
}
|
||||
t = t + '</select>';
|
||||
return t;
|
||||
}
|
||||
|
||||
function GetC(r,j)
|
||||
{
|
||||
var t = '';
|
||||
var s = '';
|
||||
if(aRC[r - 1] > maxC){s = maxC;}else{s = aRC[r - 1];}
|
||||
var ddName = 'rch' + r;
|
||||
t = t + '<select id="' + ddName + '" name="' + ddName + '"' + j + '>';
|
||||
for (i = minC; i < (maxC + 1); i++)
|
||||
{
|
||||
if (i == s){t = t + '<option value=' + i + ' selected>' + i + '</option>';}
|
||||
else{t = t + '<option value=' + i + '>' + i + '</option>';}
|
||||
}
|
||||
t = t + '</select>';
|
||||
return t;
|
||||
}
|
||||
|
||||
function GetCA(r,c,j)
|
||||
{
|
||||
var t = '';
|
||||
var ddName = 'rca' + r + '_' + c;
|
||||
t = t + '<select id="' + ddName + '" name="' + ddName + '" ' + j + '>';
|
||||
if (aRCA[r - 1][c - 1] == -1){t = t + '<option value="-1" selected>-?-</option>';}
|
||||
else{t = t + '<option value="-1">-?-</option>';}
|
||||
if (aRCA[r - 1][c - 1] == 0){t = t + '<option value="0" selected><1</option>';}
|
||||
else{t = t + '<option value="0"><1</option>';}
|
||||
for (i = 1; i < 19; i++)
|
||||
{
|
||||
if (i == aRCA[r - 1][c - 1]){t = t + '<option value=' + i + ' selected>' + i + '</option>';}
|
||||
else{t = t + '<option value=' + i + '>' + i + '</option>';}
|
||||
}
|
||||
t = t + '</select>';
|
||||
return t;
|
||||
}
|
||||
|
||||
function SetRASC(n,s)
|
||||
{
|
||||
var h = '';
|
||||
var t = '(19+)';
|
||||
if(s){t = '(19-64)'};
|
||||
|
||||
if(DE('aRA').value == ''){aRA = GetDefault('A').split(',');}
|
||||
if(DE('aRS').value == ''){aRS = GetDefault('S').split(',');}
|
||||
if(DE('aRC').value == ''){aRC = GetDefault('C').split(',');}
|
||||
if(DE('aRCA').value == ''){aRCA = GetDefault('CA');}
|
||||
|
||||
rooms = GetRC();
|
||||
|
||||
if ((cwid == '4') || (cwid == '5') || (cwid == '6')){maxC = 5;} else{maxC = 6;}
|
||||
if (cwid == '2')
|
||||
{
|
||||
if (rooms == 9){maxA = 99; minA = 9;maxC = 99;}
|
||||
else {maxA = 14; minA = 1;}
|
||||
}
|
||||
else
|
||||
{
|
||||
maxA = 6;
|
||||
}
|
||||
|
||||
sb.Reset();
|
||||
if (n == 1)
|
||||
{
|
||||
sb.Concat('<div class="bl1">');
|
||||
sb.Concat('<div class="flrasc">' + GetGL('rad1','Adults ' + t + ':') + '<br/>' + GetA(1,s,' onchange="Rem(this);"') + '</div>');
|
||||
sb.Concat('<div class="flrasc">' + GetGL('rse1','Seniors (65+):') + '<br/>' + GetS(1,' onchange="Rem(this);"') + '</div>');
|
||||
sb.Concat('<div class="flrasc">' + GetGL('rch1','Children (0-18):') + '<br/>' + GetC(1,' onchange="Rem(this);SetCA(' + n + ',' + s + ');"') + '</div>');
|
||||
sb.Concat('</div>');
|
||||
sb.Concat('<div class="clearer"></div>');
|
||||
}
|
||||
else if (n == 2)
|
||||
{
|
||||
for (var j = 1; j < (parseInt(rooms) + 1); j++)
|
||||
{
|
||||
if (j == 1)
|
||||
{
|
||||
sb.Concat('<div class="bl1">');
|
||||
sb.Concat('<div class="flrasc1"><br/>' + GetGL('rrr','Rooms:') + '<br/>' + GetR(' onfocus="HCal();" onchange="Rem(this);SetRASC(' + n + ',' + s + ');"') + '</div>');
|
||||
if (rooms == 1 || rooms == 9)
|
||||
{
|
||||
sb.Concat('<div class="flrasc2"> </div>');
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.Concat('<div class="flrasc2"><br/><br/>Room ' + j + '</div>');
|
||||
}
|
||||
sb.Concat('<div class="flrasc1">' + GetGL('rad1','Adults <br/>' + t + ':') + '<br/>' + GetA(j,s,' onchange="Rem(this);"') + '</div>');
|
||||
if(s)
|
||||
{
|
||||
sb.Concat('<div class="flrasc1">' + GetGL('rse1','Seniors <br/>(65+):') + '<br/>' + GetS(j,' onchange="Rem(this);"') + '</div>');
|
||||
}
|
||||
sb.Concat('<div class="flrasc3">' + GetGL('rch1','Children <br/>(0-18):') + '<br/>' + GetC(j,' onchange="Rem(this);SetCA(' + n + ',' + s + ');"') + '</div>');
|
||||
sb.Concat('</div>');
|
||||
if(rooms == 9) {break;}
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.Concat('<div class="bl1">');
|
||||
sb.Concat('<div class="flrasc1"> </div>');
|
||||
sb.Concat('<div class="flrasc2">Room ' + j + '</div>');
|
||||
sb.Concat('<div class="flrasc1">' + GetA(j,s,' onchange="Rem(this);"') + '</div>');
|
||||
if(s)
|
||||
{
|
||||
sb.Concat('<div class="flrasc1">' + GetS(j,' onchange="Rem(this);"') + '</div>');
|
||||
}
|
||||
sb.Concat('<div class="flrasc3">' + GetC(j,' onchange="Rem(this);SetCA(' + n + ',' + s + ');"') + '</div>');
|
||||
sb.Concat('</div>');
|
||||
}
|
||||
}
|
||||
sb.Concat('<div class="clearer"></div>');
|
||||
}
|
||||
h = sb.GetValue();
|
||||
var d = DE('divRASC');
|
||||
if (d != null)
|
||||
{
|
||||
if (h != ''){SH(d,1);d.innerHTML = h;}
|
||||
else{SH(d,0);}
|
||||
}
|
||||
if (rooms == 9)
|
||||
{
|
||||
SH(DE('divCA'),0);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetCA(n,s);
|
||||
}
|
||||
if (cwid==2){SetST(cwid);}
|
||||
}
|
||||
|
||||
function SetCA(n,s)
|
||||
{
|
||||
sb.Reset();
|
||||
var h = '';
|
||||
var nC = 0;
|
||||
var ddC;
|
||||
var i;
|
||||
var j;
|
||||
var cat = 1;
|
||||
var CA = false;
|
||||
var cu = '';
|
||||
rooms = GetRC();
|
||||
|
||||
if (rooms == '9'){return;}
|
||||
if (n > 0)
|
||||
{
|
||||
for (i = 1; i < (parseInt(rooms) + 1); i++)
|
||||
{
|
||||
ddC = DE('rch' + i);
|
||||
if (ddC != null){nC = parseInt(ddC.options[ddC.selectedIndex].value);if (nC > 0){CA = true;break;}}
|
||||
}
|
||||
}
|
||||
if (CA)
|
||||
{
|
||||
if (n == 1){cat = 0;}
|
||||
if (s){cu = 'ChildUpdate();';}
|
||||
sb.Concat('<div class="bl3">' + GetCAText(cat) + '</div>');
|
||||
if(n == 1)
|
||||
{
|
||||
ddC = DE('rch1');
|
||||
nC = parseInt(ddC.options[ddC.selectedIndex].value);
|
||||
sb.Concat('<div class="bl1">');
|
||||
for (i = 1; i < (nC + 1); i++)
|
||||
{
|
||||
sb.Concat('<div class="flca1">' + GetGL('rca1_' + i,'Child ' + i + ':') + '<br/>' + GetCA(1,i,' onchange="Rem(this);' + cu + '"') + '</div>');
|
||||
}
|
||||
sb.Concat('</div>');
|
||||
sb.Concat(GetInfantHTML());
|
||||
}
|
||||
else if(n == 2)
|
||||
{
|
||||
for (j = 1; j < (parseInt(rooms) + 1); j++)
|
||||
{
|
||||
ddC = DE('rch' + j);
|
||||
if (ddC != null)
|
||||
{
|
||||
nC = parseInt(ddC.options[ddC.selectedIndex].value);
|
||||
if (nC > 0)
|
||||
{
|
||||
sb.Concat('<div class="bl1">');
|
||||
sb.Concat('<div class="flca"><br/>Room ' + j + '</div>');
|
||||
sb.Concat('<div class="flca2">');
|
||||
for (i = 1; i < (nC + 1); i++)
|
||||
{
|
||||
sb.Concat('<div class="flca1">' + GetGL('rca' + j + '_' + i,'Child ' + i + ':') + '<br/>' + GetCA(j,i,' onchange="Rem(this);' + cu + '"') + '</div>');
|
||||
}
|
||||
sb.Concat('</div>');
|
||||
sb.Concat('</div>');
|
||||
sb.Concat('<div class="clearer"></div>');
|
||||
}
|
||||
}
|
||||
}
|
||||
sb.Concat(GetInfantHTML());
|
||||
}
|
||||
sb.Concat('<div class="clearer"></div>');
|
||||
sb.Concat('<div class="clearer"></div>');
|
||||
}
|
||||
h = sb.GetValue();
|
||||
var d = DE('divCA');
|
||||
if (d != null)
|
||||
{
|
||||
if (h != ''){SH(d,1);d.innerHTML = h;if(s){ChildUpdate()};}
|
||||
else{SH(d,0);}
|
||||
}
|
||||
}
|
||||
|
||||
function GetRC()
|
||||
{
|
||||
if(nR > maxR){return maxR;}else{return nR;}
|
||||
}
|
||||
|
||||
function GetCAText(n)
|
||||
{
|
||||
var t = new Array('We will search for any applicable airfare discounts.<br><a href="/pub/agent.dll?qscr=hgen&rhtx=HTX_FLTSRCH_RT&hfnm=h_FW_default.htx#travs">Airline age rules and unaccompanied minors</a>', 'Discounts may be offered to children of certain ages.');
|
||||
return '<b>Specify ages of children at time of travel:</b><br>' + t[n];
|
||||
}
|
||||
|
||||
function GetInfantHTML()
|
||||
{
|
||||
var t = '';
|
||||
var Check1 = '';
|
||||
var Check2 = '';
|
||||
if (Inf == 'l'){Check2 = 'checked="checked"';}
|
||||
if (Inf == 's'){Check1 = 'checked="checked"';}
|
||||
var cl = 'chkFF';
|
||||
if (document.all){cl = 'chkIE'}
|
||||
t = t + '<div id="divHBWinf" class="bl2" style="display:none;padding-top:8px;">';
|
||||
t = t + '<b>Infants (under 2):</b><br/>';
|
||||
t = t + '<input id="rIL" name="infs" type="radio" value="2" ' + Check2 + ' onclick="Rem(this);" class="' + cl + '" /><label for="rIL">laps</label> ';
|
||||
t = t + '<input id="rIS" name="infs" type="radio" value="1" ' + Check1 + ' onclick="Rem(this);" class="' + cl + '" /><label for="rIS">seats</label>';
|
||||
//t = t + '<input id="rIL" type="radio" value="2" name="infs" ' + Check2 + ' onclick="Rem(this);" />laps';
|
||||
//t = t + '<input id="rIS" type="radio" value="1" name="infs" ' + Check1 + ' onclick="Rem(this);" />seats';
|
||||
t = t + '</div>';
|
||||
return t;
|
||||
}
|
||||
|
||||
function ChildUpdate()
|
||||
{
|
||||
var bI = false;
|
||||
var nCA = -1;
|
||||
for (var i = 1; i < (maxR + 1); i++)
|
||||
{
|
||||
for (var j = 1; j < (maxC + 1); j++)
|
||||
{
|
||||
dd = DE('rca' + i + '_' + j);
|
||||
if (dd != null)
|
||||
{
|
||||
nCA = dd.options[dd.selectedIndex].value;
|
||||
if ((nCA == 0) || (nCA == 1)){bI = true;break;}
|
||||
}
|
||||
}
|
||||
if (bI){break;}
|
||||
}
|
||||
dd = DE('divHBWinf');
|
||||
if (dd != null)
|
||||
{
|
||||
if (bI){SH(dd,1);}
|
||||
else{SH(dd,0);}
|
||||
}
|
||||
}
|
||||
|
||||
function SetSearchType()
|
||||
{
|
||||
var b = DE('BundleType');
|
||||
if (cwid == '1'){b.value = 1;}
|
||||
if (cwid == '2'){b.value = 2;}
|
||||
if (cwid == '3'){b.value = 4;}
|
||||
if (cwid == '4'){b.value = 3;}
|
||||
if (cwid == '5'){b.value = 7;}
|
||||
if (cwid == '6'){b.value = 6;}
|
||||
if (cwid == '7'){b.value = 5;}
|
||||
if (cwid == '8'){b.value = 8;}
|
||||
if (cwid == '9'){b.value = 9;}
|
||||
}
|
||||
|
||||
function SetSTG()
|
||||
{
|
||||
sb.Reset();
|
||||
sb.Concat('<div style="float:right;">');
|
||||
sb.Concat('<div style="clear:both;">');
|
||||
sb.Concat('<div style="float:left;">');
|
||||
sb.Concat('<div class="wizBtnLB" onclick="SF();" onmouseover="stmo(\'' + SText + '\');">');
|
||||
sb.Concat('<div class="wizBtnRB">');
|
||||
sb.Concat('<div class="wizBtnMB">' + SText + '</div>');
|
||||
sb.Concat('</div></div></div></div>');
|
||||
//if(SText == "Search for flights" && (!DE('flx') || !DE('flx').checked))
|
||||
if(cwid == '1' && !bFlex)
|
||||
{
|
||||
sb.Concat('<div style="clear:both;">');
|
||||
sb.Concat('<div style="float:left;margin-top:8px;">');
|
||||
sb.Concat('<div class="wizBtnLB" onclick="SFBundle(3);" onmouseover="stmo(\'Search for flights \+ hotels \');">');
|
||||
sb.Concat('<div class="wizBtnRB">');
|
||||
sb.Concat('<div class="wizBtnMB">Search for flights + hotels</div>');
|
||||
sb.Concat('</div></div></div></div>');
|
||||
}
|
||||
sb.Concat('</div>');
|
||||
sb.Concat('<div class="clearer"></div>');
|
||||
|
||||
SetIH('divWst',sb.GetValue());
|
||||
}
|
||||
|
||||
function stmo(wst){window.status = wst;}
|
||||
|
||||
function SetTeleMessage()
|
||||
{
|
||||
var tele = DE('divTele');
|
||||
switch (cwid)
|
||||
{
|
||||
case '1':case '2':case '3':case '7':case '8':case '9':SH(tele,0);break;
|
||||
case '4':case '5':case '6':SH(tele,1);break;
|
||||
}
|
||||
}
|
||||
|
||||
function GetGI(i,d,c,s,j,m)
|
||||
{
|
||||
var c1 = 'class="med" ';
|
||||
var s1 = '';
|
||||
var m1 = 'maxlength="255"';
|
||||
if(document.all){s1 = 'margin-top:-1px;margin-bottom:-1px;';}
|
||||
if(c != ''){c1 = 'class="' + c + '" ';}
|
||||
if(s != '' || s1 != ''){s1 = 'style="' + s + s1 + '" ';}
|
||||
if(m != ''){m1 = 'maxlength="' + m + '" ';}
|
||||
return '<input id="' + i + '" name="' + i + '" value="' + d + '" type="text" ' + m1 + c1 + s1 + j + ' />';
|
||||
}
|
||||
|
||||
function GetGL(i,t){return '<label for="' + i +'" style="cursor:default;">' + t + '</label>';}
|
||||
|
||||
function GetDD(i,a,d,c,s,j)
|
||||
{
|
||||
var a1;
|
||||
var d1 = '';
|
||||
var c1 = 'class="med" ';
|
||||
var s1 = '';
|
||||
if(c != ''){c1 = 'class="' + c + '" ';}
|
||||
if(s != ''){s1 = 'style="' + s + '" ';}
|
||||
for (var k = 0; k < a.length; k++)
|
||||
{
|
||||
a1 = a[k].split('|');
|
||||
d1 = d1 + '<option value="' + a1[0] + '">' + a1[1] + '</option>';
|
||||
}
|
||||
d1 = '<select id="' + i + '" name="' + i + '" ' + c1 + s1 + j + '>' + d1 + '</select>';
|
||||
return d1.replace('value="' + d + '"','selected="selected" value="' + d + '"');
|
||||
}
|
||||
|
||||
function GetCB(i,v,t,d,c,s,j)
|
||||
{
|
||||
var chk = '';
|
||||
var v1 = '';
|
||||
var c1 = 'class="med" ';
|
||||
var c2 = 'class="chkFF" ';
|
||||
if(document.all){c2 = 'class="chkIE" ';}
|
||||
var s1 = '';
|
||||
if(v != ''){v1 = 'value="' + v + '" ';}
|
||||
if(c != ''){c1 = 'class="' + c + '" ';}
|
||||
if(s != ''){s1 = 'style="' + s + '" ';}
|
||||
if(d == '1'){chk = 'checked="checked" ';}
|
||||
//return '<label ' + c1 + '><input id="' + i + '" name="' + i.substr(0,3) + '" type="checkbox" ' + v1 + chk + s1 + j + ' />' + t + '</label>';
|
||||
|
||||
return '<input id="' + i + '" name="' + i.substr(0,3) + '" type="checkbox" ' + v1 + chk + c2 + s1 + j + ' /><label for="' + i +'" ' + c1 + '>' + t + '</label>';
|
||||
}
|
||||
|
||||
function GetCy(t,n)
|
||||
{
|
||||
var c = '';
|
||||
if(t == 'H'){c = 'large';}
|
||||
if (n == 'F'){return GetGI('fcy',FCity,c,'',' autocomplete="off" onblur="Rem(this);" onfocus="HCal();this.select();"','100');}
|
||||
else if (n == 'T'){return GetGI('tcy',TCity,c,'',' autocomplete="off" onblur="Rem(this);" onfocus="HCal();this.select();"','100');}
|
||||
}
|
||||
|
||||
function GetDt(t,n)
|
||||
{
|
||||
var c = 'small';
|
||||
if(t == 'H'){c = '';}
|
||||
if (n == 'F'){return GetGI('fdt',FDate,c,'',' onblur="Rem(this);UpdDt(this);" onclick="event.cancelBubble=true;SC(this);" onfocus="SC(this);"','12');}
|
||||
else if (n == 'T'){return GetGI('tdt',TDate,c,'',' onblur="Rem(this);" onclick="event.cancelBubble=true;SC(this);" onfocus="SC(this);"','12');}
|
||||
}
|
||||
|
||||
function UpdDt(e)
|
||||
{
|
||||
switch(e.id)
|
||||
{
|
||||
case "fdt":
|
||||
var f = DE('fdt');
|
||||
var t = DE('tdt');
|
||||
break;
|
||||
case "pfd":
|
||||
var f = DE('pfd');
|
||||
var t = DE('ptd');
|
||||
break;
|
||||
default:
|
||||
var f = null;
|
||||
var t = null;
|
||||
break;
|
||||
}
|
||||
|
||||
if(null!=f&&null!=t&&null!=GetInputDate(f.value)&&(null==GetInputDate(t.value)||GetInputDate(f.value)>GetInputDate(t.value))){t.value=f.value;}
|
||||
}
|
||||
|
||||
function GetT(t,n)
|
||||
{
|
||||
var d = FTime;
|
||||
var a = arrT1;
|
||||
if(n == 'T'){d = TTime;}
|
||||
if(t == 'C'){a = arrT1.slice(0,25).slice(1,25);if((d.indexOf('AM') < 0 && d.indexOf('PM') < 0) || d == '0AM'){d = '11AM';}}
|
||||
if (n == 'F'){return GetDD('ftt',a,d,'small','',' onchange="Rem(this);" onfocus="HCal();"');}
|
||||
else if (n == 'T'){return GetDD('ttt',a,d,'small','',' onchange="Rem(this);" onfocus="HCal();"');}
|
||||
}
|
||||
|
||||
function sd(e,c)
|
||||
{
|
||||
var t = '';
|
||||
if(c != ''){t = ' class="' + c + '"';}
|
||||
return '<div' + t + '>' + e + '</div>';
|
||||
}
|
||||
|
||||
function SetIH(id,v){var e = DE(id);e.innerHTML = '';e.innerHTML = v;}
|
||||
|
||||
function Trim(s)
|
||||
{
|
||||
var st = s.toString();
|
||||
while(st.charAt(0) == ' '){st = st.substring(1);}
|
||||
while(st.charAt(st.length - 1) == ' '){st = st.substring(0,st.length-2);}
|
||||
return st;
|
||||
}
|
||||
|
||||
function DE(el){return document.getElementById(el);}
|
||||
|
||||
function SH(e,s){if(s){e.style.display = 'block';}else{e.style.display = 'none';}}
|
||||
|
||||
var aS = new Array();
|
||||
function SB(){this.Concat = Concat;this.GetValue = GetValue;this.Reset = Reset;}
|
||||
function Concat(StringToConcat){this.aS[this.aS.length] = StringToConcat;}
|
||||
function GetValue(){return this.aS.join('');}
|
||||
function Reset(){this.aS = null;this.aS = new Array();}
|
||||
|
||||
function SC(el)
|
||||
{
|
||||
if (DE('CalFrame') == null){return;}
|
||||
var id = el.id;
|
||||
var n = el.id.substr(3);
|
||||
if (id.substr(0,3) == 'fdt')
|
||||
{
|
||||
el.select();
|
||||
if(n == ''){
|
||||
ShowCalendar(el,el,null,CalS,CalE);
|
||||
}
|
||||
else if(n == '2'){
|
||||
ShowCalendar(el,el,DE('fdt'),CalS,CalE);
|
||||
}
|
||||
else{
|
||||
ShowCalendar(el,el,DE('fdt' + (n - 1)),CalS,CalE);
|
||||
}
|
||||
}
|
||||
if (id.substr(0,3) == 'tdt'){
|
||||
el.select();
|
||||
ShowCalendar(el,el,DE('fdt'),CalS,CalE);
|
||||
}
|
||||
if (id.substr(0,3) == 'pfd'){
|
||||
el.select();
|
||||
ShowCalendar(el,el,DE('fdt'),CalS,CalE);
|
||||
}
|
||||
if (id.substr(0,3) == 'ptd'){
|
||||
el.select();
|
||||
ShowCalendar(el,el,DE('pfd'),CalS,CalE);
|
||||
}
|
||||
}
|
||||
|
||||
function HCal(e)
|
||||
{
|
||||
var c = DE('CalFrame');
|
||||
//if (c!=null){SH(c,false);}
|
||||
if (c!=null){CancelCal();}
|
||||
var d;
|
||||
d = DE('fdt');
|
||||
if (d!=null){d.value = d.value;}
|
||||
d = DE('tdt');
|
||||
if (d!=null){d.value = d.value;}
|
||||
}
|
||||
|
||||
function SrvyCheck()
|
||||
{
|
||||
var aWiz = {'1':'1','2':'4','3':'3','4':'9','5':'9','6':'9','7':'9','8':'6','9':'28'};
|
||||
var aRate = {'1':58,'2':159,'3':1491,'4':331,'5':331,'6':331,'7':331,'8':2500,'9':500};
|
||||
QualifiedForSurvey(aWiz[cwid], true, 45, aRate[cwid]);
|
||||
return;
|
||||
}
|
||||
|
||||
function SFBundle(bundleId)
|
||||
{
|
||||
DE("BundleType").value = bundleId;
|
||||
SF();
|
||||
}
|
||||
|
||||
function SF()
|
||||
{
|
||||
SrvyCheck();
|
||||
MacIEHack();
|
||||
document.Wiz.submit();
|
||||
}
|
||||
|
||||
function enter(e){var k;if(e.keyCode){k=e.keyCode;}if(e.which){k=e.which;}if(k=='13'){e.cancelBubble=true;SF();}}
|
||||
|
||||
function GetTT(tl,ti,te,w,bc,i,f)
|
||||
{
|
||||
var w1 = 250;
|
||||
var bc1 = '666666';
|
||||
var i1 = '/eta/tip_icon.gif';
|
||||
var i2 = '';
|
||||
if(f){i2 = '<img src="/eta/tip_icon.gif" alt="" style="margin-right:3px;" />';}
|
||||
|
||||
if(w != ''){w1 = w;}
|
||||
if(bc != ''){bc1 = bc;}
|
||||
if(i != ''){i1 = i;}
|
||||
|
||||
return i2 + '<a href="#" onmouseover="stmo(\'' + tl.replace(/\'/g,'\\\'') + '\');return true;" onmouseout="stmo(\'\');return true;" onclick="event.cancelBubble=true;STT(this,\'' + ti.replace(/\'/g,'\\\'') + '\',\'' + te.replace(/\'/g,'\\\'') + '\',' + w1 + ',\'' + bc1 + '\',\'' + i1 + '\');return false;">' + tl + '</a>';
|
||||
}
|
||||
|
||||
function MacIEHack()
|
||||
{
|
||||
var dd;
|
||||
var nc = 0;
|
||||
var ua = navigator.userAgent;
|
||||
if(ua.indexOf('MSIE') > -1 && ua.indexOf('Mac') > -1)
|
||||
{
|
||||
switch (cwid)
|
||||
{
|
||||
case '1':case '7':case '2':case '4':case '5':case '6':
|
||||
aRA = GetDefault('A').split(',');
|
||||
aRS = GetDefault('S').split(',');
|
||||
aRC = GetDefault('C').split(',');
|
||||
aRCA = GetDefault('CA');
|
||||
for(var i = 1; i <= nR; i++)
|
||||
{
|
||||
dd = DE('rad' + i);
|
||||
aRA[i-1] = dd.options[dd.selectedIndex].value;
|
||||
dd = DE('rse' + i);
|
||||
if(dd!=null){aRS[i-1] = dd.options[dd.selectedIndex].value;}
|
||||
dd = DE('rch' + i);
|
||||
nc = dd.options[dd.selectedIndex].value;
|
||||
aRC[i-1] = nc;
|
||||
if (nc > 0)
|
||||
{
|
||||
for (var j = 1; j <= nc; j++)
|
||||
{
|
||||
dd = DE('rca' + i + '_' + j);
|
||||
aRCA[i-1][j-1] = dd.options[dd.selectedIndex].value;
|
||||
}
|
||||
}
|
||||
}
|
||||
DE('aRA').value = aRA.join('|');
|
||||
DE('aRS').value = aRS.join('|');
|
||||
DE('aRC').value = aRC.join('|');
|
||||
DE('aRCA').value = aRCA.join('|');
|
||||
break;
|
||||
case '3':case '8':case '9':
|
||||
break;
|
||||
}
|
||||
if(cwid!='2'&&cwid!='8'&&cwid!='9')
|
||||
{
|
||||
dd=DE('ftt');DE('FTime').value=dd.options[dd.selectedIndex].value;
|
||||
dd=DE('ttt');DE('TTime').value=dd.options[dd.selectedIndex].value;
|
||||
}
|
||||
if(cwid=='8'){dd=DE('mon');DE('MDate').value=dd.options[dd.selectedIndex].value;}
|
||||
}
|
||||
}
|
||||
|
||||
function ecsf(){document.ec.submit();}
|
||||
function ece(e){var k;if(e.keyCode){k=e.keyCode;}if(e.which){k=e.which;}if(k=='13'){e.cancelBubble=true;ecsf();}}
|
||||
|
||||
function getObj(objID)
|
||||
{
|
||||
if (document.getElementById) {return document.getElementById(objID);}
|
||||
else if (document.all) {return document.all[objID];}
|
||||
else if (document.layers) {return document.layers[objID];}
|
||||
}
|
||||
|
||||
var g_rgFreeEventElements=new Array();
|
||||
g_rgFreeEventElements[0] = window;
|
||||
function AddFreeEventElement(elm){FreeEventsOnUnLoad(); g_rgFreeEventElements[g_rgFreeEventElements.length]=elm;}
|
||||
var g_clearElementProps = ['onmouseover','onmouseout','onmousedown','onmouseup','onmousemove','onclick','onkeypress','onkeydown','onkeyup','onblur','onfocus',];
|
||||
var g_fFreeEventOnUnLoad = false;
|
||||
function FreeEventsOnUnLoad()
|
||||
{
|
||||
if (!g_fFreeEventOnUnLoad)
|
||||
{
|
||||
if (window.attachEvent){window.attachEvent("onunload", function(){var el;for(var d = g_rgFreeEventElements.length;d--;){el = g_rgFreeEventElements[d];for(var c = g_clearElementProps.length;c--;){el[g_clearElementProps[c]] = null;}}});}
|
||||
g_fFreeEventOnUnLoad=true;
|
||||
}
|
||||
}
|
||||
246
include/asterisk/calendar/homw.js
Executable file
246
include/asterisk/calendar/homw.js
Executable file
@@ -0,0 +1,246 @@
|
||||
//var bC = true;
|
||||
//window.onload = I;
|
||||
|
||||
function hw(id)
|
||||
{
|
||||
if (id == pwid){return};
|
||||
//if (pwid=='9'&&(parseInt(aRS[0])==0&&parseInt(aRA[0])==0)){aRA = GetDefault('A').split(',');};
|
||||
cwid = id;
|
||||
DE('r' + id).checked = true;
|
||||
SO();
|
||||
SetSearchType();
|
||||
// SetST(cwid);
|
||||
SetMOT(cwid);
|
||||
SetTeleMessage();
|
||||
BuildFields();
|
||||
pwid = cwid;
|
||||
SetST(cwid);
|
||||
//DE('e').style.display = 'none';
|
||||
}
|
||||
|
||||
function BuildFields()
|
||||
{
|
||||
switch (pwid){case '4':case '5':switch (cwid){case '4':case '5':if(!bB){pwid = cwid;return;};break;}break;}
|
||||
if (bB){GetSavedValues();}
|
||||
bB = false;
|
||||
SetIH('divWFields',GetFieldsHTML());
|
||||
BuildRASC();
|
||||
SetCC();
|
||||
}
|
||||
function BuildRASC()
|
||||
{
|
||||
switch (pwid){case '1':case '4':case '5':switch (cwid){case '1':case '4':case '5':if (bB){return ''};break;}break;}
|
||||
var n = 0;
|
||||
switch (cwid)
|
||||
{
|
||||
case '1':case '7':n = 1;break;
|
||||
case '2':case '4':case '5':case '6':n = 2;break;
|
||||
case '3':case '8':n = 0;break;
|
||||
default:n = 0;break;
|
||||
}
|
||||
var s = true;
|
||||
if (cwid == '2' || cwid == '6'){s = false;minA = 1;}else{minA = 0;}
|
||||
if (cwid == '2'){maxR = 9;}else{maxR = 3;}
|
||||
SetRASC(n,s);
|
||||
}
|
||||
|
||||
function GetFieldsHTML()
|
||||
{
|
||||
var t = '';
|
||||
switch (cwid)
|
||||
{
|
||||
case '1':case '4':case '5':case '7':t = GetFields('F');break;
|
||||
case '2':t = GetFields('H');break;
|
||||
case '3':t = GetFields('C');break;
|
||||
case '6':t = GetFields('HC');break;
|
||||
case '8':t = GetFields('Cr');break;
|
||||
default:t = '';break;
|
||||
}
|
||||
return t;
|
||||
}
|
||||
|
||||
function GetSavedValues()
|
||||
{
|
||||
GetSavedValuesG();
|
||||
}
|
||||
|
||||
function Rem(el)
|
||||
{
|
||||
RemG(el);
|
||||
}
|
||||
|
||||
function SetMOT(id)
|
||||
{
|
||||
var s2 = '';
|
||||
switch (id)
|
||||
{
|
||||
case '1':
|
||||
s2 = 'Additional options: <br><a href="#" onmouseover="window.status=\'Flight search\';return(true);" onmouseout="window.status=\'\'" onclick="SetOtherOptsURL(1);return(false);">' + GetOtherOptionsText(1) + '</a>, <a href="#" onmouseover="window.status=\'Flight search\';return(true);" onmouseout="window.status=\'\'" onclick="SetOtherOptsURL(2);return(false);">' + GetOtherOptionsText(2) + '</a>';
|
||||
break;
|
||||
case '2':
|
||||
s2 = 'Additional options: <br><a href="#" onmouseover="window.status=\'Hotel search\';return(true);" onmouseout="window.status=\'\'" onclick="SetOtherOptsURL(1);return(false);">' + GetOtherOptionsText(1) + '</a>';
|
||||
break;
|
||||
case '3':
|
||||
s2 = 'Additional options: <br><a href="#" onmouseover="window.status=\'Car search\';return(true);" onmouseout="window.status=\'\'" onclick="SetOtherOptsURL(1);return(false);">' + GetOtherOptionsText(1) + '</a>';
|
||||
break;
|
||||
case '4':
|
||||
s2 = 'Additional options: <br><a href="#" onmouseover="window.status=\'Package search\';return(true);" onmouseout="window.status=\'\'" onclick="SetOtherOptsURL(1);return(false)">' + GetOtherOptionsText(1) + '</a>';
|
||||
break;
|
||||
case '5':
|
||||
s2 = 'Additional options: <br><a href="#" onmouseover="window.status=\'Package search\';return(true);" onmouseout="window.status=\'\'" onclick="SetOtherOptsURL(1);return(false)">' + GetOtherOptionsText(1) + '</a>';
|
||||
break;
|
||||
case '6':
|
||||
s2 = 'Additional options: <br><a href="#" onmouseover="window.status=\'Package search\';return(true);" onmouseout="window.status=\'\'" onclick="SetOtherOptsURL(1);return(false)">' + GetOtherOptionsText(1) + '</a>';
|
||||
break;
|
||||
case '7':s2 = '';break;
|
||||
case '8':
|
||||
s2 = 'Additional options: <br><a href="#" onmouseover="window.status=\'Cruise search\';return(true);" onmouseout="window.status=\'\'" onclick="SetOtherOptsURL(1);return(false)">' + GetOtherOptionsText(1) + '</a>';
|
||||
break;
|
||||
case '9':s2 = '';break;
|
||||
}
|
||||
if(s2 == ''){SH(DE('divO1'),0);}else{SH(DE('divO1'),1);SetIH('divO1',s2);}
|
||||
}
|
||||
|
||||
function GetOtherOptionsText(n)
|
||||
{
|
||||
var s = '';
|
||||
switch (cwid)
|
||||
{
|
||||
case '1':if(n==1){s = 'Flexible dates';}if(n==2){s = 'One way trips...';}break;
|
||||
case '2':s = 'Hotel name, hotel class...';break;
|
||||
case '3':s = 'One-way rentals, in-city rentals...';break;
|
||||
case '4':case '5':case '6':s = 'Multiple destinations...';break;
|
||||
case '7':s = '';break;
|
||||
case '8':s = 'Cruise line, length, star rating ...';break;
|
||||
case '9':s = '';break;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
function SetOtherOptsURL(n)
|
||||
{
|
||||
var URL;
|
||||
var DestId;
|
||||
URL = 'TCity=' + TCity + '&FDate=' + FDate + '&TDate=' + TDate;
|
||||
switch (cwid)
|
||||
{
|
||||
case '1':case '4':case '5':case '7':URL = 'FCity=' + FCity + '&' + URL + '&FTime=' + FTime + '&TTime=' + TTime;break;
|
||||
case '2':break;
|
||||
case '3':case '6':URL = URL + '&FTime=' + FTime + '&TTime=' + TTime;break;
|
||||
case '8':URL = 'TCityId=' + TCityId + '&MDate=' + MDate;break;
|
||||
default:break;
|
||||
}
|
||||
switch (cwid)
|
||||
{
|
||||
case '4':URL = URL + '&wt=FH';break;
|
||||
case '5':URL = URL + '&wt=FHC';break;
|
||||
case '6':URL = URL + '&wt=HC';break;
|
||||
default:break;
|
||||
}
|
||||
URL = URL + GetRASCCAString();
|
||||
switch (cwid)
|
||||
{
|
||||
case '1':
|
||||
URL = '/daily/flights/default.asp?' + URL;
|
||||
if(n==1){URL = URL + '&flex=1';}
|
||||
//if(n==2){URL = URL + '&st=2';}
|
||||
break;
|
||||
case '2':
|
||||
URL = '/daily/hotels/default.asp?' + URL;
|
||||
break;
|
||||
case '3':
|
||||
URL = '/daily/cars/default.asp?' + URL + '&CCl=' + CCl;;
|
||||
break;
|
||||
case '4':
|
||||
case '5':
|
||||
case '6':
|
||||
URL = '/daily/packages/default.asp?' + URL;
|
||||
break;
|
||||
case '7':
|
||||
URL = '/daily/flights/default.asp?' + URL + '&CCl=' + CCl;;
|
||||
break;
|
||||
case '8':
|
||||
URL = '/daily/cruise/default.asp?' + URL;
|
||||
break;
|
||||
}
|
||||
document.location.href = URL + '&ao=1';
|
||||
}
|
||||
|
||||
function SetST(id)
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case '1':SText = 'Search for flights';break;
|
||||
case '2':SText = rooms == 9 ? 'Request 9+ hotel rooms' : 'Search for hotel';break;
|
||||
case '3':SText = 'Search for cars';break;
|
||||
case '4':SText = 'Search for flights + hotels';break;
|
||||
case '5':SText = 'Search for flights + hotels + cars';break;
|
||||
case '6':SText = 'Search for hotels + cars';break;
|
||||
case '7':SText = 'Search for flights + cars';break;
|
||||
case '8':SText = 'Search for cruises';break;
|
||||
case '9':SText = 'Search for activities';break;
|
||||
}
|
||||
SetSTG();
|
||||
}
|
||||
|
||||
function GetRASCCAString()
|
||||
{
|
||||
var k = '';
|
||||
switch (cwid)
|
||||
{
|
||||
case '1':
|
||||
case '7':
|
||||
k = k + '&NumRoom=1';
|
||||
k = k + '&NumAdult=' + aRA[0];
|
||||
k = k + '&NumSenior=' + aRS[0];
|
||||
if (aRC[0] > 0)
|
||||
{
|
||||
k = k + '&NumChild=' + aRC[0];
|
||||
for (var i = 0; i < aRC[0]; i++)
|
||||
{
|
||||
k = k + '&Child' + (i + 1) + 'Age=' + aRCA[0][i];
|
||||
}
|
||||
if (Inf == 's'){k = k + '&InfantInSeat=1';}
|
||||
else{k = k + '&InfantInSeat=2';}
|
||||
}
|
||||
break;
|
||||
case '2':
|
||||
case '4':
|
||||
case '5':
|
||||
case '6':
|
||||
k = k + '&NumRoom=' + nR;
|
||||
for (var i = 0; i < nR; i++)
|
||||
{
|
||||
if (nR == 1){k = k + '&NumAdult=' + aRA[i];k = k + '&NumSenior=' + aRS[i];}
|
||||
else{k = k + '&NumAdult' + (i + 1) + '=' + aRA[i];k = k + '&NumSenior' + (i + 1) + '=' + aRS[i];}
|
||||
if (aRC[i] > 0)
|
||||
{
|
||||
if (nR == 1){k = k + '&NumChild=' + aRC[i];}
|
||||
else{k = k + '&NumChild' + (i + 1) + '=' + aRC[i];}
|
||||
for (var j = 0; j < aRC[i]; j++)
|
||||
{
|
||||
if (i == 0){k = k + '&Child' + (j + 1) + 'Age=' + aRCA[i][j];}
|
||||
else{k = k + '&Rm' + (i + 1) + 'Child' + (j + 1) + 'Age=' + aRCA[i][j];}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Inf == 's'){k = k + '&InfantInSeat=1';}
|
||||
else{k = k + '&InfantInSeat=2';}
|
||||
break;
|
||||
case '8':break;
|
||||
}
|
||||
return k;
|
||||
}
|
||||
|
||||
function GetCruiseDatesString()
|
||||
{
|
||||
var k = '';
|
||||
if (MDate == '1/1/4501'){k = '&sdat=1/1/4501';}
|
||||
else
|
||||
{
|
||||
var aD = MDate.split('-');
|
||||
var cd = new Date();
|
||||
if ((aD[0]==cd.getMonth()) && (aD[1]==cd.getFullYear())){k = k + '&sdat=' + (cd.getMonth() + 1) + '/' + cd.getDate() + '/' + cd.getFullYear();}
|
||||
else{k = k + '&sdat=' + (parseInt(aD[0]) + 1) + '/1/' + aD[1];}
|
||||
}
|
||||
return k;
|
||||
}
|
||||
86
include/asterisk/calendar/launcher.js
Executable file
86
include/asterisk/calendar/launcher.js
Executable file
@@ -0,0 +1,86 @@
|
||||
var openedWin = null;
|
||||
var wpercent = 100;
|
||||
|
||||
function launch(){
|
||||
var args = launch.arguments
|
||||
var url = args[0]
|
||||
var width = args[1]
|
||||
var height = args[2]
|
||||
|
||||
if (!url || !width || !height) {
|
||||
alert("Error");
|
||||
} else {
|
||||
var scr_w = screen.availWidth
|
||||
var scr_h = screen.availHeight
|
||||
var target_w = 0
|
||||
var target_h = 0
|
||||
wpercent = 100
|
||||
|
||||
if(width >= scr_w || height >= scr_h){
|
||||
if((width+8) >= (height+27)){
|
||||
target_w = scr_w - 8 //target width is screen width - 8
|
||||
wpercent = Math.floor((target_w * 100)/width) //get percentage scaled down
|
||||
target_h = Math.floor((height * wpercent)/100) - 27 //scale height to percentage then subtract standard title bar height
|
||||
wpercent = Math.floor((target_h * 100)/height) //re-adjust percentage
|
||||
target_w = Math.floor((width * wpercent)/100) //scale width to new percentage
|
||||
width = target_w
|
||||
height = target_h
|
||||
}else if((height+27) > (width+8)){
|
||||
target_h = scr_h - 27
|
||||
wpercent = Math.floor((target_h * 100)/height)
|
||||
target_w = Math.floor((width * wpercent)/100) - 8
|
||||
wpercent = Math.floor((target_w * 100)/width)
|
||||
target_h = Math.floor((height * wpercent)/100)
|
||||
width = target_w
|
||||
height = target_h
|
||||
}
|
||||
}
|
||||
_launch(url, width, height, args[3], args[4], args[5], args[6], args[7], args[8], args[9]);
|
||||
}
|
||||
}
|
||||
|
||||
function _launch(){
|
||||
closeChild()
|
||||
|
||||
var args = _launch.arguments
|
||||
var url = args[0]
|
||||
var width = args[1]
|
||||
var height = args[2]
|
||||
var resizable = args[3] ? "yes" : "no"
|
||||
var scrollbars = args[4] ? "yes" : "no"
|
||||
var toolbar = args[5] ? "yes" : "no"
|
||||
var menubar = args[6] ? "yes" : "no"
|
||||
var status = args[7] ? "yes" : "no"
|
||||
var address = args[8] ? "yes" : "no"
|
||||
var directories = args[9] ? "yes" : "no"
|
||||
|
||||
var NewX = Math.max(0, Math.floor((screen.availWidth-(width+8))/2));
|
||||
var NewY = Math.max(0, Math.floor((screen.availHeight-(height+27))/2));
|
||||
|
||||
var params = ''
|
||||
|
||||
params += "width="+width // 1
|
||||
params += ",height="+height // 2
|
||||
params += ",screenx="+NewX
|
||||
params += ",screeny="+NewY
|
||||
params += ",left="+NewX
|
||||
params += ",top="+NewY
|
||||
params += ",resizable="+resizable // 3
|
||||
params += ",scrollbars="+scrollbars // 4
|
||||
params += ",toolbar="+toolbar // 5
|
||||
params += ",menubar="+menubar // 6
|
||||
params += ",status="+status // 7
|
||||
params += ",location="+address // 8
|
||||
params += ",directories="+directories // 9
|
||||
|
||||
openedWin = window.open(url, "demodashboard", params);
|
||||
}
|
||||
|
||||
function closeChild () {
|
||||
if (openedWin != null) {
|
||||
if (!openedWin.closed) {
|
||||
openedWin.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
onunload = closeChild;
|
||||
42
include/connectors/formatters/default/company_detail.js
Executable file
42
include/connectors/formatters/default/company_detail.js
Executable file
@@ -0,0 +1,42 @@
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
function CompanyDetailsDialog(div_id,text,x,y)
|
||||
{this.div_id=div_id;this.text=text;this.width=300;this.header='';this.footer='';this.x=x;this.y=y;}
|
||||
function header(header)
|
||||
{this.header=header;}
|
||||
function footer(footer)
|
||||
{this.footer=footer;}
|
||||
function display(){dialog=new YAHOO.widget.SimpleDialog(this.div_id,{width:this.width,visible:true,draggable:true,close:true,text:this.text,constraintoviewport:true,x:this.x,y:this.y});dialog.setHeader(this.header);dialog.setBody(this.text);dialog.setFooter(this.footer);dialog.render(document.body);dialog.show();}
|
||||
CompanyDetailsDialog.prototype.setHeader=header;CompanyDetailsDialog.prototype.setFooter=footer;CompanyDetailsDialog.prototype.display=display;
|
||||
10
include/jQuery/ckeditor/adapters/jquery.js
vendored
Executable file
10
include/jQuery/ckeditor/adapters/jquery.js
vendored
Executable file
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.md or http://ckeditor.com/license
|
||||
*/
|
||||
(function(a){CKEDITOR.config.jqueryOverrideVal="undefined"==typeof CKEDITOR.config.jqueryOverrideVal?!0:CKEDITOR.config.jqueryOverrideVal;"undefined"!=typeof a&&(a.extend(a.fn,{ckeditorGet:function(){var a=this.eq(0).data("ckeditorInstance");if(!a)throw"CKEditor is not initialized yet, use ckeditor() with a callback.";return a},ckeditor:function(g,d){if(!CKEDITOR.env.isCompatible)throw Error("The environment is incompatible.");if(!a.isFunction(g))var k=d,d=g,g=k;var i=[],d=d||{};this.each(function(){var b=
|
||||
a(this),c=b.data("ckeditorInstance"),f=b.data("_ckeditorInstanceLock"),h=this,j=new a.Deferred;i.push(j.promise());if(c&&!f)g&&g.apply(c,[this]),j.resolve();else if(f)c.once("instanceReady",function(){setTimeout(function(){c.element?(c.element.$==h&&g&&g.apply(c,[h]),j.resolve()):setTimeout(arguments.callee,100)},0)},null,null,9999);else{if(d.autoUpdateElement||"undefined"==typeof d.autoUpdateElement&&CKEDITOR.config.autoUpdateElement)d.autoUpdateElementJquery=!0;d.autoUpdateElement=!1;b.data("_ckeditorInstanceLock",
|
||||
!0);c=a(this).is("textarea")?CKEDITOR.replace(h,d):CKEDITOR.inline(h,d);b.data("ckeditorInstance",c);c.on("instanceReady",function(d){var e=d.editor;setTimeout(function(){if(e.element){d.removeListener();e.on("dataReady",function(){b.trigger("dataReady.ckeditor",[e])});e.on("setData",function(a){b.trigger("setData.ckeditor",[e,a.data])});e.on("getData",function(a){b.trigger("getData.ckeditor",[e,a.data])},999);e.on("destroy",function(){b.trigger("destroy.ckeditor",[e])});e.on("save",function(){a(h.form).submit();
|
||||
return!1},null,null,20);if(e.config.autoUpdateElementJquery&&b.is("textarea")&&a(h.form).length){var c=function(){b.ckeditor(function(){e.updateElement()})};a(h.form).submit(c);a(h.form).bind("form-pre-serialize",c);b.bind("destroy.ckeditor",function(){a(h.form).unbind("submit",c);a(h.form).unbind("form-pre-serialize",c)})}e.on("destroy",function(){b.removeData("ckeditorInstance")});b.removeData("_ckeditorInstanceLock");b.trigger("instanceReady.ckeditor",[e]);g&&g.apply(e,[h]);j.resolve()}else setTimeout(arguments.callee,
|
||||
100)},0)},null,null,9999)}});var f=new a.Deferred;this.promise=f.promise();a.when.apply(this,i).then(function(){f.resolve()});this.editor=this.eq(0).data("ckeditorInstance");return this}}),CKEDITOR.config.jqueryOverrideVal&&(a.fn.val=CKEDITOR.tools.override(a.fn.val,function(g){return function(d){if(arguments.length){var k=this,i=[],f=this.each(function(){var b=a(this),c=b.data("ckeditorInstance");if(b.is("textarea")&&c){var f=new a.Deferred;c.setData(d,function(){f.resolve()});i.push(f.promise());
|
||||
return!0}return g.call(b,d)});if(i.length){var b=new a.Deferred;a.when.apply(this,i).done(function(){b.resolveWith(k)});return b.promise()}return f}var f=a(this).eq(0),c=f.data("ckeditorInstance");return f.is("textarea")&&c?c.getData():g.call(f)}})))})(window.jQuery);
|
||||
133
include/jQuery/ckeditor/build-config.js
Executable file
133
include/jQuery/ckeditor/build-config.js
Executable file
@@ -0,0 +1,133 @@
|
||||
/**
|
||||
* @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
|
||||
* For licensing, see LICENSE.md or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
/**
|
||||
* This file was added automatically by CKEditor builder.
|
||||
* You may re-use it at any time to build CKEditor again.
|
||||
*
|
||||
* If you would like to build CKEditor online again
|
||||
* (for example to upgrade), visit one the following links:
|
||||
*
|
||||
* (1) http://ckeditor.com/builder
|
||||
* Visit online builder to build CKEditor from scratch.
|
||||
*
|
||||
* (2) http://ckeditor.com/builder/3fbd7430c5ae23bca5707ed2ab706bdf
|
||||
* Visit online builder to build CKEditor, starting with the same setup as before.
|
||||
*
|
||||
* (3) http://ckeditor.com/builder/download/3fbd7430c5ae23bca5707ed2ab706bdf
|
||||
* Straight download link to the latest version of CKEditor (Optimized) with the same setup as before.
|
||||
*
|
||||
* NOTE:
|
||||
* This file is not used by CKEditor, you may remove it.
|
||||
* Changing this file will not change your CKEditor configuration.
|
||||
*/
|
||||
|
||||
var CKBUILDER_CONFIG = {
|
||||
skin: 'moono',
|
||||
preset: 'basic',
|
||||
ignore: [
|
||||
'.bender',
|
||||
'bender.js',
|
||||
'bender-err.log',
|
||||
'bender-out.log',
|
||||
'dev',
|
||||
'.DS_Store',
|
||||
'.editorconfig',
|
||||
'.gitattributes',
|
||||
'.gitignore',
|
||||
'gruntfile.js',
|
||||
'.idea',
|
||||
'.jscsrc',
|
||||
'.jshintignore',
|
||||
'.jshintrc',
|
||||
'.mailmap',
|
||||
'node_modules',
|
||||
'package.json',
|
||||
'README.md',
|
||||
'tests'
|
||||
],
|
||||
plugins : {
|
||||
'about' : 1,
|
||||
'basicstyles' : 1,
|
||||
'clipboard' : 1,
|
||||
'enterkey' : 1,
|
||||
'entities' : 1,
|
||||
'floatingspace' : 1,
|
||||
'indentlist' : 1,
|
||||
'link' : 1,
|
||||
'list' : 1,
|
||||
'toolbar' : 1,
|
||||
'undo' : 1,
|
||||
'wysiwygarea' : 1
|
||||
},
|
||||
languages : {
|
||||
'af' : 1,
|
||||
'ar' : 1,
|
||||
'bg' : 1,
|
||||
'bn' : 1,
|
||||
'bs' : 1,
|
||||
'ca' : 1,
|
||||
'cs' : 1,
|
||||
'cy' : 1,
|
||||
'da' : 1,
|
||||
'de' : 1,
|
||||
'el' : 1,
|
||||
'en' : 1,
|
||||
'en-au' : 1,
|
||||
'en-ca' : 1,
|
||||
'en-gb' : 1,
|
||||
'eo' : 1,
|
||||
'es' : 1,
|
||||
'et' : 1,
|
||||
'eu' : 1,
|
||||
'fa' : 1,
|
||||
'fi' : 1,
|
||||
'fo' : 1,
|
||||
'fr' : 1,
|
||||
'fr-ca' : 1,
|
||||
'gl' : 1,
|
||||
'gu' : 1,
|
||||
'he' : 1,
|
||||
'hi' : 1,
|
||||
'hr' : 1,
|
||||
'hu' : 1,
|
||||
'id' : 1,
|
||||
'is' : 1,
|
||||
'it' : 1,
|
||||
'ja' : 1,
|
||||
'ka' : 1,
|
||||
'km' : 1,
|
||||
'ko' : 1,
|
||||
'ku' : 1,
|
||||
'lt' : 1,
|
||||
'lv' : 1,
|
||||
'mk' : 1,
|
||||
'mn' : 1,
|
||||
'ms' : 1,
|
||||
'nb' : 1,
|
||||
'nl' : 1,
|
||||
'no' : 1,
|
||||
'pl' : 1,
|
||||
'pt' : 1,
|
||||
'pt-br' : 1,
|
||||
'ro' : 1,
|
||||
'ru' : 1,
|
||||
'si' : 1,
|
||||
'sk' : 1,
|
||||
'sl' : 1,
|
||||
'sq' : 1,
|
||||
'sr' : 1,
|
||||
'sr-latn' : 1,
|
||||
'sv' : 1,
|
||||
'th' : 1,
|
||||
'tr' : 1,
|
||||
'tt' : 1,
|
||||
'ug' : 1,
|
||||
'uk' : 1,
|
||||
'vi' : 1,
|
||||
'zh' : 1,
|
||||
'zh-cn' : 1
|
||||
}
|
||||
};
|
||||
731
include/jQuery/ckeditor/ckeditor.js
vendored
Executable file
731
include/jQuery/ckeditor/ckeditor.js
vendored
Executable file
@@ -0,0 +1,731 @@
|
||||
/*
|
||||
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.md or http://ckeditor.com/license
|
||||
*/
|
||||
(function(){if(window.CKEDITOR&&window.CKEDITOR.dom)return;window.CKEDITOR||(window.CKEDITOR=function(){var a=/(^|.*[\\\/])ckeditor\.js(?:\?.*|;.*)?$/i,f={timestamp:"F0RD",version:"4.4.7",revision:"3a35b3d",rnd:Math.floor(900*Math.random())+100,_:{pending:[],basePathSrcPattern:a},status:"unloaded",basePath:function(){var e=window.CKEDITOR_BASEPATH||"";if(!e)for(var d=document.getElementsByTagName("script"),c=0;c<d.length;c++){var b=d[c].src.match(a);if(b){e=b[1];break}}-1==e.indexOf(":/")&&"//"!=e.slice(0,2)&&(e=0===e.indexOf("/")?location.href.match(/^.*?:\/\/[^\/]*/)[0]+
|
||||
e:location.href.match(/^[^\?]*\/(?:)/)[0]+e);if(!e)throw'The CKEditor installation path could not be automatically detected. Please set the global variable "CKEDITOR_BASEPATH" before creating editor instances.';return e}(),getUrl:function(a){-1==a.indexOf(":/")&&0!==a.indexOf("/")&&(a=this.basePath+a);this.timestamp&&("/"!=a.charAt(a.length-1)&&!/[&?]t=/.test(a))&&(a+=(0<=a.indexOf("?")?"&":"?")+"t="+this.timestamp);return a},domReady:function(){function a(){try{document.addEventListener?(document.removeEventListener("DOMContentLoaded",
|
||||
a,!1),d()):document.attachEvent&&"complete"===document.readyState&&(document.detachEvent("onreadystatechange",a),d())}catch(c){}}function d(){for(var a;a=c.shift();)a()}var c=[];return function(d){function b(){try{document.documentElement.doScroll("left")}catch(m){setTimeout(b,1);return}a()}c.push(d);"complete"===document.readyState&&setTimeout(a,1);if(1==c.length)if(document.addEventListener)document.addEventListener("DOMContentLoaded",a,!1),window.addEventListener("load",a,!1);else if(document.attachEvent){document.attachEvent("onreadystatechange",
|
||||
a);window.attachEvent("onload",a);d=!1;try{d=!window.frameElement}catch(f){}document.documentElement.doScroll&&d&&b()}}}()},b=window.CKEDITOR_GETURL;if(b){var c=f.getUrl;f.getUrl=function(a){return b.call(f,a)||c.call(f,a)}}return f}());
|
||||
CKEDITOR.event||(CKEDITOR.event=function(){},CKEDITOR.event.implementOn=function(a){var f=CKEDITOR.event.prototype,b;for(b in f)a[b]==null&&(a[b]=f[b])},CKEDITOR.event.prototype=function(){function a(a){var e=f(this);return e[a]||(e[a]=new b(a))}var f=function(a){a=a.getPrivate&&a.getPrivate()||a._||(a._={});return a.events||(a.events={})},b=function(a){this.name=a;this.listeners=[]};b.prototype={getListenerIndex:function(a){for(var e=0,d=this.listeners;e<d.length;e++)if(d[e].fn==a)return e;return-1}};
|
||||
return{define:function(b,e){var d=a.call(this,b);CKEDITOR.tools.extend(d,e,true)},on:function(b,e,d,f,k){function j(a,m,y,s){a={name:b,sender:this,editor:a,data:m,listenerData:f,stop:y,cancel:s,removeListener:g};return e.call(d,a)===false?false:a.data}function g(){y.removeListener(b,e)}var m=a.call(this,b);if(m.getListenerIndex(e)<0){m=m.listeners;d||(d=this);isNaN(k)&&(k=10);var y=this;j.fn=e;j.priority=k;for(var s=m.length-1;s>=0;s--)if(m[s].priority<=k){m.splice(s+1,0,j);return{removeListener:g}}m.unshift(j)}return{removeListener:g}},
|
||||
once:function(){var a=Array.prototype.slice.call(arguments),e=a[1];a[1]=function(a){a.removeListener();return e.apply(this,arguments)};return this.on.apply(this,a)},capture:function(){CKEDITOR.event.useCapture=1;var a=this.on.apply(this,arguments);CKEDITOR.event.useCapture=0;return a},fire:function(){var a=0,e=function(){a=1},d=0,b=function(){d=1};return function(k,j,g){var m=f(this)[k],k=a,y=d;a=d=0;if(m){var s=m.listeners;if(s.length)for(var s=s.slice(0),w,q=0;q<s.length;q++){if(m.errorProof)try{w=
|
||||
s[q].call(this,g,j,e,b)}catch(t){}else w=s[q].call(this,g,j,e,b);w===false?d=1:typeof w!="undefined"&&(j=w);if(a||d)break}}j=d?false:typeof j=="undefined"?true:j;a=k;d=y;return j}}(),fireOnce:function(a,e,d){e=this.fire(a,e,d);delete f(this)[a];return e},removeListener:function(a,e){var d=f(this)[a];if(d){var b=d.getListenerIndex(e);b>=0&&d.listeners.splice(b,1)}},removeAllListeners:function(){var a=f(this),e;for(e in a)delete a[e]},hasListeners:function(a){return(a=f(this)[a])&&a.listeners.length>
|
||||
0}}}());CKEDITOR.editor||(CKEDITOR.editor=function(){CKEDITOR._.pending.push([this,arguments]);CKEDITOR.event.call(this)},CKEDITOR.editor.prototype.fire=function(a,f){a in{instanceReady:1,loaded:1}&&(this[a]=true);return CKEDITOR.event.prototype.fire.call(this,a,f,this)},CKEDITOR.editor.prototype.fireOnce=function(a,f){a in{instanceReady:1,loaded:1}&&(this[a]=true);return CKEDITOR.event.prototype.fireOnce.call(this,a,f,this)},CKEDITOR.event.implementOn(CKEDITOR.editor.prototype));
|
||||
CKEDITOR.env||(CKEDITOR.env=function(){var a=navigator.userAgent.toLowerCase(),f={ie:a.indexOf("trident/")>-1,webkit:a.indexOf(" applewebkit/")>-1,air:a.indexOf(" adobeair/")>-1,mac:a.indexOf("macintosh")>-1,quirks:document.compatMode=="BackCompat"&&(!document.documentMode||document.documentMode<10),mobile:a.indexOf("mobile")>-1,iOS:/(ipad|iphone|ipod)/.test(a),isCustomDomain:function(){if(!this.ie)return false;var a=document.domain,d=window.location.hostname;return a!=d&&a!="["+d+"]"},secure:location.protocol==
|
||||
"https:"};f.gecko=navigator.product=="Gecko"&&!f.webkit&&!f.ie;if(f.webkit)a.indexOf("chrome")>-1?f.chrome=true:f.safari=true;var b=0;if(f.ie){b=f.quirks||!document.documentMode?parseFloat(a.match(/msie (\d+)/)[1]):document.documentMode;f.ie9Compat=b==9;f.ie8Compat=b==8;f.ie7Compat=b==7;f.ie6Compat=b<7||f.quirks}if(f.gecko){var c=a.match(/rv:([\d\.]+)/);if(c){c=c[1].split(".");b=c[0]*1E4+(c[1]||0)*100+(c[2]||0)*1}}f.air&&(b=parseFloat(a.match(/ adobeair\/(\d+)/)[1]));f.webkit&&(b=parseFloat(a.match(/ applewebkit\/(\d+)/)[1]));
|
||||
f.version=b;f.isCompatible=f.iOS&&b>=534||!f.mobile&&(f.ie&&b>6||f.gecko&&b>=2E4||f.air&&b>=1||f.webkit&&b>=522||false);f.hidpi=window.devicePixelRatio>=2;f.needsBrFiller=f.gecko||f.webkit||f.ie&&b>10;f.needsNbspFiller=f.ie&&b<11;f.cssClass="cke_browser_"+(f.ie?"ie":f.gecko?"gecko":f.webkit?"webkit":"unknown");if(f.quirks)f.cssClass=f.cssClass+" cke_browser_quirks";if(f.ie)f.cssClass=f.cssClass+(" cke_browser_ie"+(f.quirks?"6 cke_browser_iequirks":f.version));if(f.air)f.cssClass=f.cssClass+" cke_browser_air";
|
||||
if(f.iOS)f.cssClass=f.cssClass+" cke_browser_ios";if(f.hidpi)f.cssClass=f.cssClass+" cke_hidpi";return f}());
|
||||
"unloaded"==CKEDITOR.status&&function(){CKEDITOR.event.implementOn(CKEDITOR);CKEDITOR.loadFullCore=function(){if(CKEDITOR.status!="basic_ready")CKEDITOR.loadFullCore._load=1;else{delete CKEDITOR.loadFullCore;var a=document.createElement("script");a.type="text/javascript";a.src=CKEDITOR.basePath+"ckeditor.js";document.getElementsByTagName("head")[0].appendChild(a)}};CKEDITOR.loadFullCoreTimeout=0;CKEDITOR.add=function(a){(this._.pending||(this._.pending=[])).push(a)};(function(){CKEDITOR.domReady(function(){var a=
|
||||
CKEDITOR.loadFullCore,f=CKEDITOR.loadFullCoreTimeout;if(a){CKEDITOR.status="basic_ready";a&&a._load?a():f&&setTimeout(function(){CKEDITOR.loadFullCore&&CKEDITOR.loadFullCore()},f*1E3)}})})();CKEDITOR.status="basic_loaded"}();CKEDITOR.dom={};
|
||||
(function(){var a=[],f=CKEDITOR.env.gecko?"-moz-":CKEDITOR.env.webkit?"-webkit-":CKEDITOR.env.ie?"-ms-":"",b=/&/g,c=/>/g,e=/</g,d=/"/g,h=/&/g,k=/>/g,j=/</g,g=/"/g;CKEDITOR.on("reset",function(){a=[]});CKEDITOR.tools={arrayCompare:function(a,e){if(!a&&!e)return true;if(!a||!e||a.length!=e.length)return false;for(var d=0;d<a.length;d++)if(a[d]!=e[d])return false;return true},clone:function(a){var e;if(a&&a instanceof Array){e=[];for(var d=0;d<a.length;d++)e[d]=CKEDITOR.tools.clone(a[d]);
|
||||
return e}if(a===null||typeof a!="object"||a instanceof String||a instanceof Number||a instanceof Boolean||a instanceof Date||a instanceof RegExp||a.nodeType||a.window===a)return a;e=new a.constructor;for(d in a)e[d]=CKEDITOR.tools.clone(a[d]);return e},capitalize:function(a,e){return a.charAt(0).toUpperCase()+(e?a.slice(1):a.slice(1).toLowerCase())},extend:function(a){var e=arguments.length,d,b;if(typeof(d=arguments[e-1])=="boolean")e--;else if(typeof(d=arguments[e-2])=="boolean"){b=arguments[e-1];
|
||||
e=e-2}for(var c=1;c<e;c++){var f=arguments[c],i;for(i in f)if(d===true||a[i]==null)if(!b||i in b)a[i]=f[i]}return a},prototypedCopy:function(a){var e=function(){};e.prototype=a;return new e},copy:function(a){var e={},d;for(d in a)e[d]=a[d];return e},isArray:function(a){return Object.prototype.toString.call(a)=="[object Array]"},isEmpty:function(a){for(var e in a)if(a.hasOwnProperty(e))return false;return true},cssVendorPrefix:function(a,e,d){if(d)return f+a+":"+e+";"+a+":"+e;d={};d[a]=e;d[f+a]=e;
|
||||
return d},cssStyleToDomStyle:function(){var a=document.createElement("div").style,e=typeof a.cssFloat!="undefined"?"cssFloat":typeof a.styleFloat!="undefined"?"styleFloat":"float";return function(a){return a=="float"?e:a.replace(/-./g,function(a){return a.substr(1).toUpperCase()})}}(),buildStyleHtml:function(a){for(var a=[].concat(a),e,d=[],b=0;b<a.length;b++)if(e=a[b])/@import|[{}]/.test(e)?d.push("<style>"+e+"</style>"):d.push('<link type="text/css" rel=stylesheet href="'+e+'">');return d.join("")},
|
||||
htmlEncode:function(a){return(""+a).replace(b,"&").replace(c,">").replace(e,"<")},htmlDecode:function(a){return a.replace(h,"&").replace(k,">").replace(j,"<")},htmlEncodeAttr:function(a){return a.replace(d,""").replace(e,"<").replace(c,">")},htmlDecodeAttr:function(a){return a.replace(g,'"').replace(j,"<").replace(k,">")},getNextNumber:function(){var a=0;return function(){return++a}}(),getNextId:function(){return"cke_"+this.getNextNumber()},override:function(a,e){var d=e(a);d.prototype=
|
||||
a.prototype;return d},setTimeout:function(a,e,d,b,c){c||(c=window);d||(d=c);return c.setTimeout(function(){b?a.apply(d,[].concat(b)):a.apply(d)},e||0)},trim:function(){var a=/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g;return function(e){return e.replace(a,"")}}(),ltrim:function(){var a=/^[ \t\n\r]+/g;return function(e){return e.replace(a,"")}}(),rtrim:function(){var a=/[ \t\n\r]+$/g;return function(e){return e.replace(a,"")}}(),indexOf:function(a,e){if(typeof e=="function")for(var d=0,b=a.length;d<b;d++){if(e(a[d]))return d}else{if(a.indexOf)return a.indexOf(e);
|
||||
d=0;for(b=a.length;d<b;d++)if(a[d]===e)return d}return-1},search:function(a,e){var d=CKEDITOR.tools.indexOf(a,e);return d>=0?a[d]:null},bind:function(a,e){return function(){return a.apply(e,arguments)}},createClass:function(a){var e=a.$,d=a.base,b=a.privates||a._,c=a.proto,a=a.statics;!e&&(e=function(){d&&this.base.apply(this,arguments)});if(b)var f=e,e=function(){var a=this._||(this._={}),e;for(e in b){var d=b[e];a[e]=typeof d=="function"?CKEDITOR.tools.bind(d,this):d}f.apply(this,arguments)};if(d){e.prototype=
|
||||
this.prototypedCopy(d.prototype);e.prototype.constructor=e;e.base=d;e.baseProto=d.prototype;e.prototype.base=function(){this.base=d.prototype.base;d.apply(this,arguments);this.base=arguments.callee}}c&&this.extend(e.prototype,c,true);a&&this.extend(e,a,true);return e},addFunction:function(e,d){return a.push(function(){return e.apply(d||this,arguments)})-1},removeFunction:function(e){a[e]=null},callFunction:function(e){var d=a[e];return d&&d.apply(window,Array.prototype.slice.call(arguments,1))},cssLength:function(){var a=
|
||||
/^-?\d+\.?\d*px$/,e;return function(d){e=CKEDITOR.tools.trim(d+"")+"px";return a.test(e)?e:d||""}}(),convertToPx:function(){var a;return function(e){if(!a){a=CKEDITOR.dom.element.createFromHtml('<div style="position:absolute;left:-9999px;top:-9999px;margin:0px;padding:0px;border:0px;"></div>',CKEDITOR.document);CKEDITOR.document.getBody().append(a)}if(!/%$/.test(e)){a.setStyle("width",e);return a.$.clientWidth}return e}}(),repeat:function(a,e){return Array(e+1).join(a)},tryThese:function(){for(var a,
|
||||
e=0,d=arguments.length;e<d;e++){var b=arguments[e];try{a=b();break}catch(c){}}return a},genKey:function(){return Array.prototype.slice.call(arguments).join("-")},defer:function(a){return function(){var e=arguments,d=this;window.setTimeout(function(){a.apply(d,e)},0)}},normalizeCssText:function(a,e){var d=[],b,c=CKEDITOR.tools.parseCssText(a,true,e);for(b in c)d.push(b+":"+c[b]);d.sort();return d.length?d.join(";")+";":""},convertRgbToHex:function(a){return a.replace(/(?:rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\))/gi,
|
||||
function(a,e,d,b){a=[e,d,b];for(e=0;e<3;e++)a[e]=("0"+parseInt(a[e],10).toString(16)).slice(-2);return"#"+a.join("")})},parseCssText:function(a,e,d){var b={};if(d){d=new CKEDITOR.dom.element("span");d.setAttribute("style",a);a=CKEDITOR.tools.convertRgbToHex(d.getAttribute("style")||"")}if(!a||a==";")return b;a.replace(/"/g,'"').replace(/\s*([^:;\s]+)\s*:\s*([^;]+)\s*(?=;|$)/g,function(a,d,m){if(e){d=d.toLowerCase();d=="font-family"&&(m=m.toLowerCase().replace(/["']/g,"").replace(/\s*,\s*/g,","));
|
||||
m=CKEDITOR.tools.trim(m)}b[d]=m});return b},writeCssText:function(a,e){var d,b=[];for(d in a)b.push(d+":"+a[d]);e&&b.sort();return b.join("; ")},objectCompare:function(a,e,d){var b;if(!a&&!e)return true;if(!a||!e)return false;for(b in a)if(a[b]!=e[b])return false;if(!d)for(b in e)if(a[b]!=e[b])return false;return true},objectKeys:function(a){var e=[],d;for(d in a)e.push(d);return e},convertArrayToObject:function(a,e){var d={};arguments.length==1&&(e=true);for(var b=0,c=a.length;b<c;++b)d[a[b]]=e;
|
||||
return d},fixDomain:function(){for(var a;;)try{a=window.parent.document.domain;break}catch(e){a=a?a.replace(/.+?(?:\.|$)/,""):document.domain;if(!a)break;document.domain=a}return!!a},eventsBuffer:function(a,e){function d(){c=(new Date).getTime();b=false;e()}var b,c=0;return{input:function(){if(!b){var e=(new Date).getTime()-c;e<a?b=setTimeout(d,a-e):d()}},reset:function(){b&&clearTimeout(b);b=c=0}}},enableHtml5Elements:function(a,e){for(var d=["abbr","article","aside","audio","bdi","canvas","data",
|
||||
"datalist","details","figcaption","figure","footer","header","hgroup","mark","meter","nav","output","progress","section","summary","time","video"],b=d.length,c;b--;){c=a.createElement(d[b]);e&&a.appendChild(c)}},checkIfAnyArrayItemMatches:function(a,e){for(var d=0,b=a.length;d<b;++d)if(a[d].match(e))return true;return false},checkIfAnyObjectPropertyMatches:function(a,e){for(var d in a)if(d.match(e))return true;return false},transparentImageData:"data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw=="}})();
|
||||
CKEDITOR.dtd=function(){var a=CKEDITOR.tools.extend,f=function(a,e){for(var d=CKEDITOR.tools.clone(a),b=1;b<arguments.length;b++){var e=arguments[b],c;for(c in e)delete d[c]}return d},b={},c={},e={address:1,article:1,aside:1,blockquote:1,details:1,div:1,dl:1,fieldset:1,figure:1,footer:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,header:1,hgroup:1,hr:1,main:1,menu:1,nav:1,ol:1,p:1,pre:1,section:1,table:1,ul:1},d={command:1,link:1,meta:1,noscript:1,script:1,style:1},h={},k={"#":1},j={center:1,dir:1,noframes:1};
|
||||
a(b,{a:1,abbr:1,area:1,audio:1,b:1,bdi:1,bdo:1,br:1,button:1,canvas:1,cite:1,code:1,command:1,datalist:1,del:1,dfn:1,em:1,embed:1,i:1,iframe:1,img:1,input:1,ins:1,kbd:1,keygen:1,label:1,map:1,mark:1,meter:1,noscript:1,object:1,output:1,progress:1,q:1,ruby:1,s:1,samp:1,script:1,select:1,small:1,span:1,strong:1,sub:1,sup:1,textarea:1,time:1,u:1,"var":1,video:1,wbr:1},k,{acronym:1,applet:1,basefont:1,big:1,font:1,isindex:1,strike:1,style:1,tt:1});a(c,e,b,j);f={a:f(b,{a:1,button:1}),abbr:b,address:c,
|
||||
area:h,article:c,aside:c,audio:a({source:1,track:1},c),b:b,base:h,bdi:b,bdo:b,blockquote:c,body:c,br:h,button:f(b,{a:1,button:1}),canvas:b,caption:c,cite:b,code:b,col:h,colgroup:{col:1},command:h,datalist:a({option:1},b),dd:c,del:b,details:a({summary:1},c),dfn:b,div:c,dl:{dt:1,dd:1},dt:c,em:b,embed:h,fieldset:a({legend:1},c),figcaption:c,figure:a({figcaption:1},c),footer:c,form:c,h1:b,h2:b,h3:b,h4:b,h5:b,h6:b,head:a({title:1,base:1},d),header:c,hgroup:{h1:1,h2:1,h3:1,h4:1,h5:1,h6:1},hr:h,html:a({head:1,
|
||||
body:1},c,d),i:b,iframe:k,img:h,input:h,ins:b,kbd:b,keygen:h,label:b,legend:b,li:c,link:h,main:c,map:c,mark:b,menu:a({li:1},c),meta:h,meter:f(b,{meter:1}),nav:c,noscript:a({link:1,meta:1,style:1},b),object:a({param:1},b),ol:{li:1},optgroup:{option:1},option:k,output:b,p:b,param:h,pre:b,progress:f(b,{progress:1}),q:b,rp:b,rt:b,ruby:a({rp:1,rt:1},b),s:b,samp:b,script:k,section:c,select:{optgroup:1,option:1},small:b,source:h,span:b,strong:b,style:k,sub:b,summary:b,sup:b,table:{caption:1,colgroup:1,thead:1,
|
||||
tfoot:1,tbody:1,tr:1},tbody:{tr:1},td:c,textarea:k,tfoot:{tr:1},th:c,thead:{tr:1},time:f(b,{time:1}),title:k,tr:{th:1,td:1},track:h,u:b,ul:{li:1},"var":b,video:a({source:1,track:1},c),wbr:h,acronym:b,applet:a({param:1},c),basefont:h,big:b,center:c,dialog:h,dir:{li:1},font:b,isindex:h,noframes:c,strike:b,tt:b};a(f,{$block:a({audio:1,dd:1,dt:1,figcaption:1,li:1,video:1},e,j),$blockLimit:{article:1,aside:1,audio:1,body:1,caption:1,details:1,dir:1,div:1,dl:1,fieldset:1,figcaption:1,figure:1,footer:1,
|
||||
form:1,header:1,hgroup:1,main:1,menu:1,nav:1,ol:1,section:1,table:1,td:1,th:1,tr:1,ul:1,video:1},$cdata:{script:1,style:1},$editable:{address:1,article:1,aside:1,blockquote:1,body:1,details:1,div:1,fieldset:1,figcaption:1,footer:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,header:1,hgroup:1,main:1,nav:1,p:1,pre:1,section:1},$empty:{area:1,base:1,basefont:1,br:1,col:1,command:1,dialog:1,embed:1,hr:1,img:1,input:1,isindex:1,keygen:1,link:1,meta:1,param:1,source:1,track:1,wbr:1},$inline:b,$list:{dl:1,ol:1,
|
||||
ul:1},$listItem:{dd:1,dt:1,li:1},$nonBodyContent:a({body:1,head:1,html:1},f.head),$nonEditable:{applet:1,audio:1,button:1,embed:1,iframe:1,map:1,object:1,option:1,param:1,script:1,textarea:1,video:1},$object:{applet:1,audio:1,button:1,hr:1,iframe:1,img:1,input:1,object:1,select:1,table:1,textarea:1,video:1},$removeEmpty:{abbr:1,acronym:1,b:1,bdi:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,mark:1,meter:1,output:1,q:1,ruby:1,s:1,samp:1,small:1,span:1,strike:1,strong:1,
|
||||
sub:1,sup:1,time:1,tt:1,u:1,"var":1},$tabIndex:{a:1,area:1,button:1,input:1,object:1,select:1,textarea:1},$tableContent:{caption:1,col:1,colgroup:1,tbody:1,td:1,tfoot:1,th:1,thead:1,tr:1},$transparent:{a:1,audio:1,canvas:1,del:1,ins:1,map:1,noscript:1,object:1,video:1},$intermediate:{caption:1,colgroup:1,dd:1,dt:1,figcaption:1,legend:1,li:1,optgroup:1,option:1,rp:1,rt:1,summary:1,tbody:1,td:1,tfoot:1,th:1,thead:1,tr:1}});return f}();CKEDITOR.dom.event=function(a){this.$=a};
|
||||
CKEDITOR.dom.event.prototype={getKey:function(){return this.$.keyCode||this.$.which},getKeystroke:function(){var a=this.getKey();if(this.$.ctrlKey||this.$.metaKey)a=a+CKEDITOR.CTRL;this.$.shiftKey&&(a=a+CKEDITOR.SHIFT);this.$.altKey&&(a=a+CKEDITOR.ALT);return a},preventDefault:function(a){var f=this.$;f.preventDefault?f.preventDefault():f.returnValue=false;a&&this.stopPropagation()},stopPropagation:function(){var a=this.$;a.stopPropagation?a.stopPropagation():a.cancelBubble=true},getTarget:function(){var a=
|
||||
this.$.target||this.$.srcElement;return a?new CKEDITOR.dom.node(a):null},getPhase:function(){return this.$.eventPhase||2},getPageOffset:function(){var a=this.getTarget().getDocument().$;return{x:this.$.pageX||this.$.clientX+(a.documentElement.scrollLeft||a.body.scrollLeft),y:this.$.pageY||this.$.clientY+(a.documentElement.scrollTop||a.body.scrollTop)}}};CKEDITOR.CTRL=1114112;CKEDITOR.SHIFT=2228224;CKEDITOR.ALT=4456448;CKEDITOR.EVENT_PHASE_CAPTURING=1;CKEDITOR.EVENT_PHASE_AT_TARGET=2;
|
||||
CKEDITOR.EVENT_PHASE_BUBBLING=3;CKEDITOR.dom.domObject=function(a){if(a)this.$=a};
|
||||
CKEDITOR.dom.domObject.prototype=function(){var a=function(a,b){return function(c){typeof CKEDITOR!="undefined"&&a.fire(b,new CKEDITOR.dom.event(c))}};return{getPrivate:function(){var a;if(!(a=this.getCustomData("_")))this.setCustomData("_",a={});return a},on:function(f){var b=this.getCustomData("_cke_nativeListeners");if(!b){b={};this.setCustomData("_cke_nativeListeners",b)}if(!b[f]){b=b[f]=a(this,f);this.$.addEventListener?this.$.addEventListener(f,b,!!CKEDITOR.event.useCapture):this.$.attachEvent&&
|
||||
this.$.attachEvent("on"+f,b)}return CKEDITOR.event.prototype.on.apply(this,arguments)},removeListener:function(a){CKEDITOR.event.prototype.removeListener.apply(this,arguments);if(!this.hasListeners(a)){var b=this.getCustomData("_cke_nativeListeners"),c=b&&b[a];if(c){this.$.removeEventListener?this.$.removeEventListener(a,c,false):this.$.detachEvent&&this.$.detachEvent("on"+a,c);delete b[a]}}},removeAllListeners:function(){var a=this.getCustomData("_cke_nativeListeners"),b;for(b in a){var c=a[b];this.$.detachEvent?
|
||||
this.$.detachEvent("on"+b,c):this.$.removeEventListener&&this.$.removeEventListener(b,c,false);delete a[b]}CKEDITOR.event.prototype.removeAllListeners.call(this)}}}();
|
||||
(function(a){var f={};CKEDITOR.on("reset",function(){f={}});a.equals=function(a){try{return a&&a.$===this.$}catch(c){return false}};a.setCustomData=function(a,c){var e=this.getUniqueId();(f[e]||(f[e]={}))[a]=c;return this};a.getCustomData=function(a){var c=this.$["data-cke-expando"];return(c=c&&f[c])&&a in c?c[a]:null};a.removeCustomData=function(a){var c=this.$["data-cke-expando"],c=c&&f[c],e,d;if(c){e=c[a];d=a in c;delete c[a]}return d?e:null};a.clearCustomData=function(){this.removeAllListeners();
|
||||
var a=this.$["data-cke-expando"];a&&delete f[a]};a.getUniqueId=function(){return this.$["data-cke-expando"]||(this.$["data-cke-expando"]=CKEDITOR.tools.getNextNumber())};CKEDITOR.event.implementOn(a)})(CKEDITOR.dom.domObject.prototype);
|
||||
CKEDITOR.dom.node=function(a){return a?new CKEDITOR.dom[a.nodeType==CKEDITOR.NODE_DOCUMENT?"document":a.nodeType==CKEDITOR.NODE_ELEMENT?"element":a.nodeType==CKEDITOR.NODE_TEXT?"text":a.nodeType==CKEDITOR.NODE_COMMENT?"comment":a.nodeType==CKEDITOR.NODE_DOCUMENT_FRAGMENT?"documentFragment":"domObject"](a):this};CKEDITOR.dom.node.prototype=new CKEDITOR.dom.domObject;CKEDITOR.NODE_ELEMENT=1;CKEDITOR.NODE_DOCUMENT=9;CKEDITOR.NODE_TEXT=3;CKEDITOR.NODE_COMMENT=8;CKEDITOR.NODE_DOCUMENT_FRAGMENT=11;
|
||||
CKEDITOR.POSITION_IDENTICAL=0;CKEDITOR.POSITION_DISCONNECTED=1;CKEDITOR.POSITION_FOLLOWING=2;CKEDITOR.POSITION_PRECEDING=4;CKEDITOR.POSITION_IS_CONTAINED=8;CKEDITOR.POSITION_CONTAINS=16;
|
||||
CKEDITOR.tools.extend(CKEDITOR.dom.node.prototype,{appendTo:function(a,f){a.append(this,f);return a},clone:function(a,f){var b=this.$.cloneNode(a),c=function(e){e["data-cke-expando"]&&(e["data-cke-expando"]=false);if(e.nodeType==CKEDITOR.NODE_ELEMENT){f||e.removeAttribute("id",false);if(a)for(var e=e.childNodes,d=0;d<e.length;d++)c(e[d])}};c(b);return new CKEDITOR.dom.node(b)},hasPrevious:function(){return!!this.$.previousSibling},hasNext:function(){return!!this.$.nextSibling},insertAfter:function(a){a.$.parentNode.insertBefore(this.$,
|
||||
a.$.nextSibling);return a},insertBefore:function(a){a.$.parentNode.insertBefore(this.$,a.$);return a},insertBeforeMe:function(a){this.$.parentNode.insertBefore(a.$,this.$);return a},getAddress:function(a){for(var f=[],b=this.getDocument().$.documentElement,c=this.$;c&&c!=b;){var e=c.parentNode;e&&f.unshift(this.getIndex.call({$:c},a));c=e}return f},getDocument:function(){return new CKEDITOR.dom.document(this.$.ownerDocument||this.$.parentNode.ownerDocument)},getIndex:function(a){function f(a,e){var b=
|
||||
e?a.nextSibling:a.previousSibling;return!b||b.nodeType!=CKEDITOR.NODE_TEXT?null:b.nodeValue?b:f(b,e)}var b=this.$,c=-1,e;if(!this.$.parentNode||a&&b.nodeType==CKEDITOR.NODE_TEXT&&!b.nodeValue&&!f(b)&&!f(b,true))return-1;do if(!a||!(b!=this.$&&b.nodeType==CKEDITOR.NODE_TEXT&&(e||!b.nodeValue))){c++;e=b.nodeType==CKEDITOR.NODE_TEXT}while(b=b.previousSibling);return c},getNextSourceNode:function(a,f,b){if(b&&!b.call)var c=b,b=function(a){return!a.equals(c)};var a=!a&&this.getFirst&&this.getFirst(),e;
|
||||
if(!a){if(this.type==CKEDITOR.NODE_ELEMENT&&b&&b(this,true)===false)return null;a=this.getNext()}for(;!a&&(e=(e||this).getParent());){if(b&&b(e,true)===false)return null;a=e.getNext()}return!a||b&&b(a)===false?null:f&&f!=a.type?a.getNextSourceNode(false,f,b):a},getPreviousSourceNode:function(a,f,b){if(b&&!b.call)var c=b,b=function(a){return!a.equals(c)};var a=!a&&this.getLast&&this.getLast(),e;if(!a){if(this.type==CKEDITOR.NODE_ELEMENT&&b&&b(this,true)===false)return null;a=this.getPrevious()}for(;!a&&
|
||||
(e=(e||this).getParent());){if(b&&b(e,true)===false)return null;a=e.getPrevious()}return!a||b&&b(a)===false?null:f&&a.type!=f?a.getPreviousSourceNode(false,f,b):a},getPrevious:function(a){var f=this.$,b;do b=(f=f.previousSibling)&&f.nodeType!=10&&new CKEDITOR.dom.node(f);while(b&&a&&!a(b));return b},getNext:function(a){var f=this.$,b;do b=(f=f.nextSibling)&&new CKEDITOR.dom.node(f);while(b&&a&&!a(b));return b},getParent:function(a){var f=this.$.parentNode;return f&&(f.nodeType==CKEDITOR.NODE_ELEMENT||
|
||||
a&&f.nodeType==CKEDITOR.NODE_DOCUMENT_FRAGMENT)?new CKEDITOR.dom.node(f):null},getParents:function(a){var f=this,b=[];do b[a?"push":"unshift"](f);while(f=f.getParent());return b},getCommonAncestor:function(a){if(a.equals(this))return this;if(a.contains&&a.contains(this))return a;var f=this.contains?this:this.getParent();do if(f.contains(a))return f;while(f=f.getParent());return null},getPosition:function(a){var f=this.$,b=a.$;if(f.compareDocumentPosition)return f.compareDocumentPosition(b);if(f==
|
||||
b)return CKEDITOR.POSITION_IDENTICAL;if(this.type==CKEDITOR.NODE_ELEMENT&&a.type==CKEDITOR.NODE_ELEMENT){if(f.contains){if(f.contains(b))return CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_PRECEDING;if(b.contains(f))return CKEDITOR.POSITION_IS_CONTAINED+CKEDITOR.POSITION_FOLLOWING}if("sourceIndex"in f)return f.sourceIndex<0||b.sourceIndex<0?CKEDITOR.POSITION_DISCONNECTED:f.sourceIndex<b.sourceIndex?CKEDITOR.POSITION_PRECEDING:CKEDITOR.POSITION_FOLLOWING}for(var f=this.getAddress(),a=a.getAddress(),
|
||||
b=Math.min(f.length,a.length),c=0;c<=b-1;c++)if(f[c]!=a[c]){if(c<b)return f[c]<a[c]?CKEDITOR.POSITION_PRECEDING:CKEDITOR.POSITION_FOLLOWING;break}return f.length<a.length?CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_PRECEDING:CKEDITOR.POSITION_IS_CONTAINED+CKEDITOR.POSITION_FOLLOWING},getAscendant:function(a,f){var b=this.$,c,e;if(!f)b=b.parentNode;if(typeof a=="function"){e=true;c=a}else{e=false;c=function(e){e=typeof e.nodeName=="string"?e.nodeName.toLowerCase():"";return typeof a=="string"?e==
|
||||
a:e in a}}for(;b;){if(c(e?new CKEDITOR.dom.node(b):b))return new CKEDITOR.dom.node(b);try{b=b.parentNode}catch(d){b=null}}return null},hasAscendant:function(a,f){var b=this.$;if(!f)b=b.parentNode;for(;b;){if(b.nodeName&&b.nodeName.toLowerCase()==a)return true;b=b.parentNode}return false},move:function(a,f){a.append(this.remove(),f)},remove:function(a){var f=this.$,b=f.parentNode;if(b){if(a)for(;a=f.firstChild;)b.insertBefore(f.removeChild(a),f);b.removeChild(f)}return this},replace:function(a){this.insertBefore(a);
|
||||
a.remove()},trim:function(){this.ltrim();this.rtrim()},ltrim:function(){for(var a;this.getFirst&&(a=this.getFirst());){if(a.type==CKEDITOR.NODE_TEXT){var f=CKEDITOR.tools.ltrim(a.getText()),b=a.getLength();if(f){if(f.length<b){a.split(b-f.length);this.$.removeChild(this.$.firstChild)}}else{a.remove();continue}}break}},rtrim:function(){for(var a;this.getLast&&(a=this.getLast());){if(a.type==CKEDITOR.NODE_TEXT){var f=CKEDITOR.tools.rtrim(a.getText()),b=a.getLength();if(f){if(f.length<b){a.split(f.length);
|
||||
this.$.lastChild.parentNode.removeChild(this.$.lastChild)}}else{a.remove();continue}}break}if(CKEDITOR.env.needsBrFiller)(a=this.$.lastChild)&&(a.type==1&&a.nodeName.toLowerCase()=="br")&&a.parentNode.removeChild(a)},isReadOnly:function(){var a=this;this.type!=CKEDITOR.NODE_ELEMENT&&(a=this.getParent());if(a&&typeof a.$.isContentEditable!="undefined")return!(a.$.isContentEditable||a.data("cke-editable"));for(;a;){if(a.data("cke-editable"))break;if(a.getAttribute("contentEditable")=="false")return true;
|
||||
if(a.getAttribute("contentEditable")=="true")break;a=a.getParent()}return!a}});CKEDITOR.dom.window=function(a){CKEDITOR.dom.domObject.call(this,a)};CKEDITOR.dom.window.prototype=new CKEDITOR.dom.domObject;
|
||||
CKEDITOR.tools.extend(CKEDITOR.dom.window.prototype,{focus:function(){this.$.focus()},getViewPaneSize:function(){var a=this.$.document,f=a.compatMode=="CSS1Compat";return{width:(f?a.documentElement.clientWidth:a.body.clientWidth)||0,height:(f?a.documentElement.clientHeight:a.body.clientHeight)||0}},getScrollPosition:function(){var a=this.$;if("pageXOffset"in a)return{x:a.pageXOffset||0,y:a.pageYOffset||0};a=a.document;return{x:a.documentElement.scrollLeft||a.body.scrollLeft||0,y:a.documentElement.scrollTop||
|
||||
a.body.scrollTop||0}},getFrame:function(){var a=this.$.frameElement;return a?new CKEDITOR.dom.element.get(a):null}});CKEDITOR.dom.document=function(a){CKEDITOR.dom.domObject.call(this,a)};CKEDITOR.dom.document.prototype=new CKEDITOR.dom.domObject;
|
||||
CKEDITOR.tools.extend(CKEDITOR.dom.document.prototype,{type:CKEDITOR.NODE_DOCUMENT,appendStyleSheet:function(a){if(this.$.createStyleSheet)this.$.createStyleSheet(a);else{var f=new CKEDITOR.dom.element("link");f.setAttributes({rel:"stylesheet",type:"text/css",href:a});this.getHead().append(f)}},appendStyleText:function(a){if(this.$.createStyleSheet){var f=this.$.createStyleSheet("");f.cssText=a}else{var b=new CKEDITOR.dom.element("style",this);b.append(new CKEDITOR.dom.text(a,this));this.getHead().append(b)}return f||
|
||||
b.$.sheet},createElement:function(a,f){var b=new CKEDITOR.dom.element(a,this);if(f){f.attributes&&b.setAttributes(f.attributes);f.styles&&b.setStyles(f.styles)}return b},createText:function(a){return new CKEDITOR.dom.text(a,this)},focus:function(){this.getWindow().focus()},getActive:function(){var a;try{a=this.$.activeElement}catch(f){return null}return new CKEDITOR.dom.element(a)},getById:function(a){return(a=this.$.getElementById(a))?new CKEDITOR.dom.element(a):null},getByAddress:function(a,f){for(var b=
|
||||
this.$.documentElement,c=0;b&&c<a.length;c++){var e=a[c];if(f)for(var d=-1,h=0;h<b.childNodes.length;h++){var k=b.childNodes[h];if(!(f===true&&k.nodeType==3&&k.previousSibling&&k.previousSibling.nodeType==3)){d++;if(d==e){b=k;break}}}else b=b.childNodes[e]}return b?new CKEDITOR.dom.node(b):null},getElementsByTag:function(a,f){!(CKEDITOR.env.ie&&document.documentMode<=8)&&f&&(a=f+":"+a);return new CKEDITOR.dom.nodeList(this.$.getElementsByTagName(a))},getHead:function(){var a=this.$.getElementsByTagName("head")[0];
|
||||
return a=a?new CKEDITOR.dom.element(a):this.getDocumentElement().append(new CKEDITOR.dom.element("head"),true)},getBody:function(){return new CKEDITOR.dom.element(this.$.body)},getDocumentElement:function(){return new CKEDITOR.dom.element(this.$.documentElement)},getWindow:function(){return new CKEDITOR.dom.window(this.$.parentWindow||this.$.defaultView)},write:function(a){this.$.open("text/html","replace");CKEDITOR.env.ie&&(a=a.replace(/(?:^\s*<!DOCTYPE[^>]*?>)|^/i,'$&\n<script data-cke-temp="1">('+
|
||||
CKEDITOR.tools.fixDomain+")();<\/script>"));this.$.write(a);this.$.close()},find:function(a){return new CKEDITOR.dom.nodeList(this.$.querySelectorAll(a))},findOne:function(a){return(a=this.$.querySelector(a))?new CKEDITOR.dom.element(a):null},_getHtml5ShivFrag:function(){var a=this.getCustomData("html5ShivFrag");if(!a){a=this.$.createDocumentFragment();CKEDITOR.tools.enableHtml5Elements(a,true);this.setCustomData("html5ShivFrag",a)}return a}});CKEDITOR.dom.nodeList=function(a){this.$=a};
|
||||
CKEDITOR.dom.nodeList.prototype={count:function(){return this.$.length},getItem:function(a){if(a<0||a>=this.$.length)return null;return(a=this.$[a])?new CKEDITOR.dom.node(a):null}};CKEDITOR.dom.element=function(a,f){typeof a=="string"&&(a=(f?f.$:document).createElement(a));CKEDITOR.dom.domObject.call(this,a)};CKEDITOR.dom.element.get=function(a){return(a=typeof a=="string"?document.getElementById(a)||document.getElementsByName(a)[0]:a)&&(a.$?a:new CKEDITOR.dom.element(a))};
|
||||
CKEDITOR.dom.element.prototype=new CKEDITOR.dom.node;CKEDITOR.dom.element.createFromHtml=function(a,f){var b=new CKEDITOR.dom.element("div",f);b.setHtml(a);return b.getFirst().remove()};
|
||||
CKEDITOR.dom.element.setMarker=function(a,f,b,c){var e=f.getCustomData("list_marker_id")||f.setCustomData("list_marker_id",CKEDITOR.tools.getNextNumber()).getCustomData("list_marker_id"),d=f.getCustomData("list_marker_names")||f.setCustomData("list_marker_names",{}).getCustomData("list_marker_names");a[e]=f;d[b]=1;return f.setCustomData(b,c)};CKEDITOR.dom.element.clearAllMarkers=function(a){for(var f in a)CKEDITOR.dom.element.clearMarkers(a,a[f],1)};
|
||||
CKEDITOR.dom.element.clearMarkers=function(a,f,b){var c=f.getCustomData("list_marker_names"),e=f.getCustomData("list_marker_id"),d;for(d in c)f.removeCustomData(d);f.removeCustomData("list_marker_names");if(b){f.removeCustomData("list_marker_id");delete a[e]}};
|
||||
(function(){function a(a){var d=true;if(!a.$.id){a.$.id="cke_tmp_"+CKEDITOR.tools.getNextNumber();d=false}return function(){d||a.removeAttribute("id")}}function f(a,d){return"#"+a.$.id+" "+d.split(/,\s*/).join(", #"+a.$.id+" ")}function b(a){for(var d=0,b=0,f=c[a].length;b<f;b++)d=d+(parseInt(this.getComputedStyle(c[a][b])||0,10)||0);return d}CKEDITOR.tools.extend(CKEDITOR.dom.element.prototype,{type:CKEDITOR.NODE_ELEMENT,addClass:function(a){var d=this.$.className;d&&(RegExp("(?:^|\\s)"+a+"(?:\\s|$)",
|
||||
"").test(d)||(d=d+(" "+a)));this.$.className=d||a;return this},removeClass:function(a){var d=this.getAttribute("class");if(d){a=RegExp("(?:^|\\s+)"+a+"(?=\\s|$)","i");if(a.test(d))(d=d.replace(a,"").replace(/^\s+/,""))?this.setAttribute("class",d):this.removeAttribute("class")}return this},hasClass:function(a){return RegExp("(?:^|\\s+)"+a+"(?=\\s|$)","").test(this.getAttribute("class"))},append:function(a,d){typeof a=="string"&&(a=this.getDocument().createElement(a));d?this.$.insertBefore(a.$,this.$.firstChild):
|
||||
this.$.appendChild(a.$);return a},appendHtml:function(a){if(this.$.childNodes.length){var d=new CKEDITOR.dom.element("div",this.getDocument());d.setHtml(a);d.moveChildren(this)}else this.setHtml(a)},appendText:function(a){this.$.text!=null?this.$.text=this.$.text+a:this.append(new CKEDITOR.dom.text(a))},appendBogus:function(a){if(a||CKEDITOR.env.needsBrFiller){for(a=this.getLast();a&&a.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.rtrim(a.getText());)a=a.getPrevious();if(!a||!a.is||!a.is("br")){a=this.getDocument().createElement("br");
|
||||
CKEDITOR.env.gecko&&a.setAttribute("type","_moz");this.append(a)}}},breakParent:function(a){var d=new CKEDITOR.dom.range(this.getDocument());d.setStartAfter(this);d.setEndAfter(a);a=d.extractContents();d.insertNode(this.remove());a.insertAfterNode(this)},contains:CKEDITOR.env.ie||CKEDITOR.env.webkit?function(a){var d=this.$;return a.type!=CKEDITOR.NODE_ELEMENT?d.contains(a.getParent().$):d!=a.$&&d.contains(a.$)}:function(a){return!!(this.$.compareDocumentPosition(a.$)&16)},focus:function(){function a(){try{this.$.focus()}catch(e){}}
|
||||
return function(d){d?CKEDITOR.tools.setTimeout(a,100,this):a.call(this)}}(),getHtml:function(){var a=this.$.innerHTML;return CKEDITOR.env.ie?a.replace(/<\?[^>]*>/g,""):a},getOuterHtml:function(){if(this.$.outerHTML)return this.$.outerHTML.replace(/<\?[^>]*>/,"");var a=this.$.ownerDocument.createElement("div");a.appendChild(this.$.cloneNode(true));return a.innerHTML},getClientRect:function(){var a=CKEDITOR.tools.extend({},this.$.getBoundingClientRect());!a.width&&(a.width=a.right-a.left);!a.height&&
|
||||
(a.height=a.bottom-a.top);return a},setHtml:CKEDITOR.env.ie&&CKEDITOR.env.version<9?function(a){try{var d=this.$;if(this.getParent())return d.innerHTML=a;var b=this.getDocument()._getHtml5ShivFrag();b.appendChild(d);d.innerHTML=a;b.removeChild(d);return a}catch(c){this.$.innerHTML="";d=new CKEDITOR.dom.element("body",this.getDocument());d.$.innerHTML=a;for(d=d.getChildren();d.count();)this.append(d.getItem(0));return a}}:function(a){return this.$.innerHTML=a},setText:function(){var a=document.createElement("p");
|
||||
a.innerHTML="x";a=a.textContent;return function(d){this.$[a?"textContent":"innerText"]=d}}(),getAttribute:function(){var a=function(a){return this.$.getAttribute(a,2)};return CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(a){switch(a){case "class":a="className";break;case "http-equiv":a="httpEquiv";break;case "name":return this.$.name;case "tabindex":a=this.$.getAttribute(a,2);a!==0&&this.$.tabIndex===0&&(a=null);return a;case "checked":a=this.$.attributes.getNamedItem(a);
|
||||
return(a.specified?a.nodeValue:this.$.checked)?"checked":null;case "hspace":case "value":return this.$[a];case "style":return this.$.style.cssText;case "contenteditable":case "contentEditable":return this.$.attributes.getNamedItem("contentEditable").specified?this.$.getAttribute("contentEditable"):null}return this.$.getAttribute(a,2)}:a}(),getChildren:function(){return new CKEDITOR.dom.nodeList(this.$.childNodes)},getComputedStyle:CKEDITOR.env.ie?function(a){return this.$.currentStyle[CKEDITOR.tools.cssStyleToDomStyle(a)]}:
|
||||
function(a){var d=this.getWindow().$.getComputedStyle(this.$,null);return d?d.getPropertyValue(a):""},getDtd:function(){var a=CKEDITOR.dtd[this.getName()];this.getDtd=function(){return a};return a},getElementsByTag:CKEDITOR.dom.document.prototype.getElementsByTag,getTabIndex:CKEDITOR.env.ie?function(){var a=this.$.tabIndex;a===0&&(!CKEDITOR.dtd.$tabIndex[this.getName()]&&parseInt(this.getAttribute("tabindex"),10)!==0)&&(a=-1);return a}:CKEDITOR.env.webkit?function(){var a=this.$.tabIndex;if(a===void 0){a=
|
||||
parseInt(this.getAttribute("tabindex"),10);isNaN(a)&&(a=-1)}return a}:function(){return this.$.tabIndex},getText:function(){return this.$.textContent||this.$.innerText||""},getWindow:function(){return this.getDocument().getWindow()},getId:function(){return this.$.id||null},getNameAtt:function(){return this.$.name||null},getName:function(){var a=this.$.nodeName.toLowerCase();if(CKEDITOR.env.ie&&document.documentMode<=8){var d=this.$.scopeName;d!="HTML"&&(a=d.toLowerCase()+":"+a)}this.getName=function(){return a};
|
||||
return this.getName()},getValue:function(){return this.$.value},getFirst:function(a){var d=this.$.firstChild;(d=d&&new CKEDITOR.dom.node(d))&&(a&&!a(d))&&(d=d.getNext(a));return d},getLast:function(a){var d=this.$.lastChild;(d=d&&new CKEDITOR.dom.node(d))&&(a&&!a(d))&&(d=d.getPrevious(a));return d},getStyle:function(a){return this.$.style[CKEDITOR.tools.cssStyleToDomStyle(a)]},is:function(){var a=this.getName();if(typeof arguments[0]=="object")return!!arguments[0][a];for(var d=0;d<arguments.length;d++)if(arguments[d]==
|
||||
a)return true;return false},isEditable:function(a){var d=this.getName();if(this.isReadOnly()||this.getComputedStyle("display")=="none"||this.getComputedStyle("visibility")=="hidden"||CKEDITOR.dtd.$nonEditable[d]||CKEDITOR.dtd.$empty[d]||this.is("a")&&(this.data("cke-saved-name")||this.hasAttribute("name"))&&!this.getChildCount())return false;if(a!==false){a=CKEDITOR.dtd[d]||CKEDITOR.dtd.span;return!(!a||!a["#"])}return true},isIdentical:function(a){var d=this.clone(0,1),a=a.clone(0,1);d.removeAttributes(["_moz_dirty",
|
||||
"data-cke-expando","data-cke-saved-href","data-cke-saved-name"]);a.removeAttributes(["_moz_dirty","data-cke-expando","data-cke-saved-href","data-cke-saved-name"]);if(d.$.isEqualNode){d.$.style.cssText=CKEDITOR.tools.normalizeCssText(d.$.style.cssText);a.$.style.cssText=CKEDITOR.tools.normalizeCssText(a.$.style.cssText);return d.$.isEqualNode(a.$)}d=d.getOuterHtml();a=a.getOuterHtml();if(CKEDITOR.env.ie&&CKEDITOR.env.version<9&&this.is("a")){var b=this.getParent();if(b.type==CKEDITOR.NODE_ELEMENT){b=
|
||||
b.clone();b.setHtml(d);d=b.getHtml();b.setHtml(a);a=b.getHtml()}}return d==a},isVisible:function(){var a=(this.$.offsetHeight||this.$.offsetWidth)&&this.getComputedStyle("visibility")!="hidden",d,b;if(a&&CKEDITOR.env.webkit){d=this.getWindow();if(!d.equals(CKEDITOR.document.getWindow())&&(b=d.$.frameElement))a=(new CKEDITOR.dom.element(b)).isVisible()}return!!a},isEmptyInlineRemoveable:function(){if(!CKEDITOR.dtd.$removeEmpty[this.getName()])return false;for(var a=this.getChildren(),d=0,b=a.count();d<
|
||||
b;d++){var c=a.getItem(d);if(!(c.type==CKEDITOR.NODE_ELEMENT&&c.data("cke-bookmark"))&&(c.type==CKEDITOR.NODE_ELEMENT&&!c.isEmptyInlineRemoveable()||c.type==CKEDITOR.NODE_TEXT&&CKEDITOR.tools.trim(c.getText())))return false}return true},hasAttributes:CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(){for(var a=this.$.attributes,d=0;d<a.length;d++){var b=a[d];switch(b.nodeName){case "class":if(this.getAttribute("class"))return true;case "data-cke-expando":continue;default:if(b.specified)return true}}return false}:
|
||||
function(){var a=this.$.attributes,d=a.length,b={"data-cke-expando":1,_moz_dirty:1};return d>0&&(d>2||!b[a[0].nodeName]||d==2&&!b[a[1].nodeName])},hasAttribute:function(){function a(d){var e=this.$.attributes.getNamedItem(d);if(this.getName()=="input")switch(d){case "class":return this.$.className.length>0;case "checked":return!!this.$.checked;case "value":d=this.getAttribute("type");return d=="checkbox"||d=="radio"?this.$.value!="on":!!this.$.value}return!e?false:e.specified}return CKEDITOR.env.ie?
|
||||
CKEDITOR.env.version<8?function(d){return d=="name"?!!this.$.name:a.call(this,d)}:a:function(a){return!!this.$.attributes.getNamedItem(a)}}(),hide:function(){this.setStyle("display","none")},moveChildren:function(a,d){var b=this.$,a=a.$;if(b!=a){var c;if(d)for(;c=b.lastChild;)a.insertBefore(b.removeChild(c),a.firstChild);else for(;c=b.firstChild;)a.appendChild(b.removeChild(c))}},mergeSiblings:function(){function a(d,b,e){if(b&&b.type==CKEDITOR.NODE_ELEMENT){for(var c=[];b.data("cke-bookmark")||b.isEmptyInlineRemoveable();){c.push(b);
|
||||
b=e?b.getNext():b.getPrevious();if(!b||b.type!=CKEDITOR.NODE_ELEMENT)return}if(d.isIdentical(b)){for(var f=e?d.getLast():d.getFirst();c.length;)c.shift().move(d,!e);b.moveChildren(d,!e);b.remove();f&&f.type==CKEDITOR.NODE_ELEMENT&&f.mergeSiblings()}}}return function(d){if(d===false||CKEDITOR.dtd.$removeEmpty[this.getName()]||this.is("a")){a(this,this.getNext(),true);a(this,this.getPrevious())}}}(),show:function(){this.setStyles({display:"",visibility:""})},setAttribute:function(){var a=function(a,
|
||||
b){this.$.setAttribute(a,b);return this};return CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(d,b){d=="class"?this.$.className=b:d=="style"?this.$.style.cssText=b:d=="tabindex"?this.$.tabIndex=b:d=="checked"?this.$.checked=b:d=="contenteditable"?a.call(this,"contentEditable",b):a.apply(this,arguments);return this}:CKEDITOR.env.ie8Compat&&CKEDITOR.env.secure?function(d,b){if(d=="src"&&b.match(/^http:\/\//))try{a.apply(this,arguments)}catch(c){}else a.apply(this,arguments);
|
||||
return this}:a}(),setAttributes:function(a){for(var d in a)this.setAttribute(d,a[d]);return this},setValue:function(a){this.$.value=a;return this},removeAttribute:function(){var a=function(a){this.$.removeAttribute(a)};return CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(a){a=="class"?a="className":a=="tabindex"?a="tabIndex":a=="contenteditable"&&(a="contentEditable");this.$.removeAttribute(a)}:a}(),removeAttributes:function(a){if(CKEDITOR.tools.isArray(a))for(var b=0;b<
|
||||
a.length;b++)this.removeAttribute(a[b]);else for(b in a)a.hasOwnProperty(b)&&this.removeAttribute(b)},removeStyle:function(a){var b=this.$.style;if(!b.removeProperty&&(a=="border"||a=="margin"||a=="padding")){var c=["top","left","right","bottom"],f;a=="border"&&(f=["color","style","width"]);for(var b=[],j=0;j<c.length;j++)if(f)for(var g=0;g<f.length;g++)b.push([a,c[j],f[g]].join("-"));else b.push([a,c[j]].join("-"));for(a=0;a<b.length;a++)this.removeStyle(b[a])}else{b.removeProperty?b.removeProperty(a):
|
||||
b.removeAttribute(CKEDITOR.tools.cssStyleToDomStyle(a));this.$.style.cssText||this.removeAttribute("style")}},setStyle:function(a,b){this.$.style[CKEDITOR.tools.cssStyleToDomStyle(a)]=b;return this},setStyles:function(a){for(var b in a)this.setStyle(b,a[b]);return this},setOpacity:function(a){if(CKEDITOR.env.ie&&CKEDITOR.env.version<9){a=Math.round(a*100);this.setStyle("filter",a>=100?"":"progid:DXImageTransform.Microsoft.Alpha(opacity="+a+")")}else this.setStyle("opacity",a)},unselectable:function(){this.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select",
|
||||
"none"));if(CKEDITOR.env.ie){this.setAttribute("unselectable","on");for(var a,b=this.getElementsByTag("*"),c=0,f=b.count();c<f;c++){a=b.getItem(c);a.setAttribute("unselectable","on")}}},getPositionedAncestor:function(){for(var a=this;a.getName()!="html";){if(a.getComputedStyle("position")!="static")return a;a=a.getParent()}return null},getDocumentPosition:function(a){var b=0,c=0,f=this.getDocument(),j=f.getBody(),g=CKEDITOR.env.quirks;if(document.documentElement.getBoundingClientRect){var m=this.$.getBoundingClientRect(),
|
||||
y=f.$.documentElement,s=y.clientTop||j.$.clientTop||0,w=y.clientLeft||j.$.clientLeft||0,q=true;if(CKEDITOR.env.ie){q=f.getDocumentElement().contains(this);f=f.getBody().contains(this);q=g&&f||!g&&q}if(q){if(CKEDITOR.env.webkit){b=j.$.scrollLeft||y.scrollLeft;c=j.$.scrollTop||y.scrollTop}else{c=g?j.$:y;b=c.scrollLeft;c=c.scrollTop}b=m.left+b-w;c=m.top+c-s}}else{s=this;for(w=null;s&&!(s.getName()=="body"||s.getName()=="html");){b=b+(s.$.offsetLeft-s.$.scrollLeft);c=c+(s.$.offsetTop-s.$.scrollTop);if(!s.equals(this)){b=
|
||||
b+(s.$.clientLeft||0);c=c+(s.$.clientTop||0)}for(;w&&!w.equals(s);){b=b-w.$.scrollLeft;c=c-w.$.scrollTop;w=w.getParent()}w=s;s=(m=s.$.offsetParent)?new CKEDITOR.dom.element(m):null}}if(a){m=this.getWindow();s=a.getWindow();if(!m.equals(s)&&m.$.frameElement){a=(new CKEDITOR.dom.element(m.$.frameElement)).getDocumentPosition(a);b=b+a.x;c=c+a.y}}if(!document.documentElement.getBoundingClientRect&&CKEDITOR.env.gecko&&!g){b=b+(this.$.clientLeft?1:0);c=c+(this.$.clientTop?1:0)}return{x:b,y:c}},scrollIntoView:function(a){var b=
|
||||
this.getParent();if(b){do{(b.$.clientWidth&&b.$.clientWidth<b.$.scrollWidth||b.$.clientHeight&&b.$.clientHeight<b.$.scrollHeight)&&!b.is("body")&&this.scrollIntoParent(b,a,1);if(b.is("html")){var c=b.getWindow();try{var f=c.$.frameElement;f&&(b=new CKEDITOR.dom.element(f))}catch(j){}}}while(b=b.getParent())}},scrollIntoParent:function(a,b,c){var f,j,g,m;function y(b,d){if(/body|html/.test(a.getName()))a.getWindow().$.scrollBy(b,d);else{a.$.scrollLeft=a.$.scrollLeft+b;a.$.scrollTop=a.$.scrollTop+d}}
|
||||
function s(a,b){var d={x:0,y:0};if(!a.is(q?"body":"html")){var c=a.$.getBoundingClientRect();d.x=c.left;d.y=c.top}c=a.getWindow();if(!c.equals(b)){c=s(CKEDITOR.dom.element.get(c.$.frameElement),b);d.x=d.x+c.x;d.y=d.y+c.y}return d}function w(a,b){return parseInt(a.getComputedStyle("margin-"+b)||0,10)||0}!a&&(a=this.getWindow());g=a.getDocument();var q=g.$.compatMode=="BackCompat";a instanceof CKEDITOR.dom.window&&(a=q?g.getBody():g.getDocumentElement());g=a.getWindow();j=s(this,g);var t=s(a,g),i=this.$.offsetHeight;
|
||||
f=this.$.offsetWidth;var A=a.$.clientHeight,u=a.$.clientWidth;g=j.x-w(this,"left")-t.x||0;m=j.y-w(this,"top")-t.y||0;f=j.x+f+w(this,"right")-(t.x+u)||0;j=j.y+i+w(this,"bottom")-(t.y+A)||0;if(m<0||j>0)y(0,b===true?m:b===false?j:m<0?m:j);if(c&&(g<0||f>0))y(g<0?g:f,0)},setState:function(a,b,c){b=b||"cke";switch(a){case CKEDITOR.TRISTATE_ON:this.addClass(b+"_on");this.removeClass(b+"_off");this.removeClass(b+"_disabled");c&&this.setAttribute("aria-pressed",true);c&&this.removeAttribute("aria-disabled");
|
||||
break;case CKEDITOR.TRISTATE_DISABLED:this.addClass(b+"_disabled");this.removeClass(b+"_off");this.removeClass(b+"_on");c&&this.setAttribute("aria-disabled",true);c&&this.removeAttribute("aria-pressed");break;default:this.addClass(b+"_off");this.removeClass(b+"_on");this.removeClass(b+"_disabled");c&&this.removeAttribute("aria-pressed");c&&this.removeAttribute("aria-disabled")}},getFrameDocument:function(){var a=this.$;try{a.contentWindow.document}catch(b){a.src=a.src}return a&&new CKEDITOR.dom.document(a.contentWindow.document)},
|
||||
copyAttributes:function(a,b){for(var c=this.$.attributes,b=b||{},f=0;f<c.length;f++){var j=c[f],g=j.nodeName.toLowerCase(),m;if(!(g in b))if(g=="checked"&&(m=this.getAttribute(g)))a.setAttribute(g,m);else if(!CKEDITOR.env.ie||this.hasAttribute(g)){m=this.getAttribute(g);if(m===null)m=j.nodeValue;a.setAttribute(g,m)}}if(this.$.style.cssText!=="")a.$.style.cssText=this.$.style.cssText},renameNode:function(a){if(this.getName()!=a){var b=this.getDocument(),a=new CKEDITOR.dom.element(a,b);this.copyAttributes(a);
|
||||
this.moveChildren(a);this.getParent()&&this.$.parentNode.replaceChild(a.$,this.$);a.$["data-cke-expando"]=this.$["data-cke-expando"];this.$=a.$;delete this.getName}},getChild:function(){function a(b,c){var e=b.childNodes;if(c>=0&&c<e.length)return e[c]}return function(b){var c=this.$;if(b.slice)for(;b.length>0&&c;)c=a(c,b.shift());else c=a(c,b);return c?new CKEDITOR.dom.node(c):null}}(),getChildCount:function(){return this.$.childNodes.length},disableContextMenu:function(){this.on("contextmenu",function(a){a.data.getTarget().hasClass("cke_enable_context_menu")||
|
||||
a.data.preventDefault()})},getDirection:function(a){return a?this.getComputedStyle("direction")||this.getDirection()||this.getParent()&&this.getParent().getDirection(1)||this.getDocument().$.dir||"ltr":this.getStyle("direction")||this.getAttribute("dir")},data:function(a,b){a="data-"+a;if(b===void 0)return this.getAttribute(a);b===false?this.removeAttribute(a):this.setAttribute(a,b);return null},getEditor:function(){var a=CKEDITOR.instances,b,c;for(b in a){c=a[b];if(c.element.equals(this)&&c.elementMode!=
|
||||
CKEDITOR.ELEMENT_MODE_APPENDTO)return c}return null},find:function(b){var c=a(this),b=new CKEDITOR.dom.nodeList(this.$.querySelectorAll(f(this,b)));c();return b},findOne:function(b){var c=a(this),b=this.$.querySelector(f(this,b));c();return b?new CKEDITOR.dom.element(b):null},forEach:function(a,b,c){if(!c&&(!b||this.type==b))var f=a(this);if(f!==false)for(var c=this.getChildren(),j=0;j<c.count();j++){f=c.getItem(j);f.type==CKEDITOR.NODE_ELEMENT?f.forEach(a,b):(!b||f.type==b)&&a(f)}}});var c={width:["border-left-width",
|
||||
"border-right-width","padding-left","padding-right"],height:["border-top-width","border-bottom-width","padding-top","padding-bottom"]};CKEDITOR.dom.element.prototype.setSize=function(a,c,f){if(typeof c=="number"){if(f&&(!CKEDITOR.env.ie||!CKEDITOR.env.quirks))c=c-b.call(this,a);this.setStyle(a,c+"px")}};CKEDITOR.dom.element.prototype.getSize=function(a,c){var f=Math.max(this.$["offset"+CKEDITOR.tools.capitalize(a)],this.$["client"+CKEDITOR.tools.capitalize(a)])||0;c&&(f=f-b.call(this,a));return f}})();
|
||||
CKEDITOR.dom.documentFragment=function(a){a=a||CKEDITOR.document;this.$=a.type==CKEDITOR.NODE_DOCUMENT?a.$.createDocumentFragment():a};
|
||||
CKEDITOR.tools.extend(CKEDITOR.dom.documentFragment.prototype,CKEDITOR.dom.element.prototype,{type:CKEDITOR.NODE_DOCUMENT_FRAGMENT,insertAfterNode:function(a){a=a.$;a.parentNode.insertBefore(this.$,a.nextSibling)}},!0,{append:1,appendBogus:1,getFirst:1,getLast:1,getParent:1,getNext:1,getPrevious:1,appendTo:1,moveChildren:1,insertBefore:1,insertAfterNode:1,replace:1,trim:1,type:1,ltrim:1,rtrim:1,getDocument:1,getChildCount:1,getChild:1,getChildren:1});
|
||||
(function(){function a(a,b){var c=this.range;if(this._.end)return null;if(!this._.start){this._.start=1;if(c.collapsed){this.end();return null}c.optimize()}var d,e=c.startContainer;d=c.endContainer;var m=c.startOffset,f=c.endOffset,h,o=this.guard,l=this.type,p=a?"getPreviousSourceNode":"getNextSourceNode";if(!a&&!this._.guardLTR){var r=d.type==CKEDITOR.NODE_ELEMENT?d:d.getParent(),n=d.type==CKEDITOR.NODE_ELEMENT?d.getChild(f):d.getNext();this._.guardLTR=function(a,b){return(!b||!r.equals(a))&&(!n||
|
||||
!a.equals(n))&&(a.type!=CKEDITOR.NODE_ELEMENT||!b||!a.equals(c.root))}}if(a&&!this._.guardRTL){var g=e.type==CKEDITOR.NODE_ELEMENT?e:e.getParent(),C=e.type==CKEDITOR.NODE_ELEMENT?m?e.getChild(m-1):null:e.getPrevious();this._.guardRTL=function(a,b){return(!b||!g.equals(a))&&(!C||!a.equals(C))&&(a.type!=CKEDITOR.NODE_ELEMENT||!b||!a.equals(c.root))}}var j=a?this._.guardRTL:this._.guardLTR;h=o?function(a,b){return j(a,b)===false?false:o(a,b)}:j;if(this.current)d=this.current[p](false,l,h);else{if(a)d.type==
|
||||
CKEDITOR.NODE_ELEMENT&&(d=f>0?d.getChild(f-1):h(d,true)===false?null:d.getPreviousSourceNode(true,l,h));else{d=e;if(d.type==CKEDITOR.NODE_ELEMENT&&!(d=d.getChild(m)))d=h(e,true)===false?null:e.getNextSourceNode(true,l,h)}d&&h(d)===false&&(d=null)}for(;d&&!this._.end;){this.current=d;if(!this.evaluator||this.evaluator(d)!==false){if(!b)return d}else if(b&&this.evaluator)return false;d=d[p](false,l,h)}this.end();return this.current=null}function f(b){for(var c,d=null;c=a.call(this,b);)d=c;return d}
|
||||
function b(a){if(g(a))return false;if(a.type==CKEDITOR.NODE_TEXT)return true;if(a.type==CKEDITOR.NODE_ELEMENT){if(a.is(CKEDITOR.dtd.$inline)||a.is("hr")||a.getAttribute("contenteditable")=="false")return true;var b;if(b=!CKEDITOR.env.needsBrFiller)if(b=a.is(m))a:{b=0;for(var c=a.getChildCount();b<c;++b)if(!g(a.getChild(b))){b=false;break a}b=true}if(b)return true}return false}CKEDITOR.dom.walker=CKEDITOR.tools.createClass({$:function(a){this.range=a;this._={}},proto:{end:function(){this._.end=1},
|
||||
next:function(){return a.call(this)},previous:function(){return a.call(this,1)},checkForward:function(){return a.call(this,0,1)!==false},checkBackward:function(){return a.call(this,1,1)!==false},lastForward:function(){return f.call(this)},lastBackward:function(){return f.call(this,1)},reset:function(){delete this.current;this._={}}}});var c={block:1,"list-item":1,table:1,"table-row-group":1,"table-header-group":1,"table-footer-group":1,"table-row":1,"table-column-group":1,"table-column":1,"table-cell":1,
|
||||
"table-caption":1},e={absolute:1,fixed:1};CKEDITOR.dom.element.prototype.isBlockBoundary=function(a){return this.getComputedStyle("float")=="none"&&!(this.getComputedStyle("position")in e)&&c[this.getComputedStyle("display")]?true:!!(this.is(CKEDITOR.dtd.$block)||a&&this.is(a))};CKEDITOR.dom.walker.blockBoundary=function(a){return function(b){return!(b.type==CKEDITOR.NODE_ELEMENT&&b.isBlockBoundary(a))}};CKEDITOR.dom.walker.listItemBoundary=function(){return this.blockBoundary({br:1})};CKEDITOR.dom.walker.bookmark=
|
||||
function(a,b){function c(a){return a&&a.getName&&a.getName()=="span"&&a.data("cke-bookmark")}return function(d){var e,m;e=d&&d.type!=CKEDITOR.NODE_ELEMENT&&(m=d.getParent())&&c(m);e=a?e:e||c(d);return!!(b^e)}};CKEDITOR.dom.walker.whitespaces=function(a){return function(b){var c;b&&b.type==CKEDITOR.NODE_TEXT&&(c=!CKEDITOR.tools.trim(b.getText())||CKEDITOR.env.webkit&&b.getText()=="");return!!(a^c)}};CKEDITOR.dom.walker.invisible=function(a){var b=CKEDITOR.dom.walker.whitespaces(),c=CKEDITOR.env.webkit?
|
||||
1:0;return function(d){if(b(d))d=1;else{d.type==CKEDITOR.NODE_TEXT&&(d=d.getParent());d=d.$.offsetWidth<=c}return!!(a^d)}};CKEDITOR.dom.walker.nodeType=function(a,b){return function(c){return!!(b^c.type==a)}};CKEDITOR.dom.walker.bogus=function(a){function b(a){return!h(a)&&!k(a)}return function(c){var e=CKEDITOR.env.needsBrFiller?c.is&&c.is("br"):c.getText&&d.test(c.getText());if(e){e=c.getParent();c=c.getNext(b);e=e.isBlockBoundary()&&(!c||c.type==CKEDITOR.NODE_ELEMENT&&c.isBlockBoundary())}return!!(a^
|
||||
e)}};CKEDITOR.dom.walker.temp=function(a){return function(b){b.type!=CKEDITOR.NODE_ELEMENT&&(b=b.getParent());b=b&&b.hasAttribute("data-cke-temp");return!!(a^b)}};var d=/^[\t\r\n ]*(?: |\xa0)$/,h=CKEDITOR.dom.walker.whitespaces(),k=CKEDITOR.dom.walker.bookmark(),j=CKEDITOR.dom.walker.temp();CKEDITOR.dom.walker.ignored=function(a){return function(b){b=h(b)||k(b)||j(b);return!!(a^b)}};var g=CKEDITOR.dom.walker.ignored(),m=function(a){var b={},c;for(c in a)CKEDITOR.dtd[c]["#"]&&(b[c]=1);return b}(CKEDITOR.dtd.$block);
|
||||
CKEDITOR.dom.walker.editable=function(a){return function(c){return!!(a^b(c))}};CKEDITOR.dom.element.prototype.getBogus=function(){var a=this;do a=a.getPreviousSourceNode();while(k(a)||h(a)||a.type==CKEDITOR.NODE_ELEMENT&&a.is(CKEDITOR.dtd.$inline)&&!a.is(CKEDITOR.dtd.$empty));return a&&(CKEDITOR.env.needsBrFiller?a.is&&a.is("br"):a.getText&&d.test(a.getText()))?a:false}})();
|
||||
CKEDITOR.dom.range=function(a){this.endOffset=this.endContainer=this.startOffset=this.startContainer=null;this.collapsed=true;var f=a instanceof CKEDITOR.dom.document;this.document=f?a:a.getDocument();this.root=f?a.getBody():a};
|
||||
(function(){function a(){var a=false,b=CKEDITOR.dom.walker.whitespaces(),c=CKEDITOR.dom.walker.bookmark(true),e=CKEDITOR.dom.walker.bogus();return function(f){if(c(f)||b(f))return true;if(e(f)&&!a)return a=true;return f.type==CKEDITOR.NODE_TEXT&&(f.hasAscendant("pre")||CKEDITOR.tools.trim(f.getText()).length)||f.type==CKEDITOR.NODE_ELEMENT&&!f.is(d)?false:true}}function f(a){var b=CKEDITOR.dom.walker.whitespaces(),c=CKEDITOR.dom.walker.bookmark(1);return function(d){return c(d)||b(d)?true:!a&&h(d)||
|
||||
d.type==CKEDITOR.NODE_ELEMENT&&d.is(CKEDITOR.dtd.$removeEmpty)}}function b(a){return function(){var b;return this[a?"getPreviousNode":"getNextNode"](function(a){!b&&g(a)&&(b=a);return j(a)&&!(h(a)&&a.equals(b))})}}var c=function(a){a.collapsed=a.startContainer&&a.endContainer&&a.startContainer.equals(a.endContainer)&&a.startOffset==a.endOffset},e=function(a,b,c,d){a.optimizeBookmark();var e=a.startContainer,f=a.endContainer,i=a.startOffset,A=a.endOffset,h,o;if(f.type==CKEDITOR.NODE_TEXT)f=f.split(A);
|
||||
else if(f.getChildCount()>0)if(A>=f.getChildCount()){f=f.append(a.document.createText(""));o=true}else f=f.getChild(A);if(e.type==CKEDITOR.NODE_TEXT){e.split(i);e.equals(f)&&(f=e.getNext())}else if(i)if(i>=e.getChildCount()){e=e.append(a.document.createText(""));h=true}else e=e.getChild(i).getPrevious();else{e=e.append(a.document.createText(""),1);h=true}var i=e.getParents(),A=f.getParents(),l,p,r;for(l=0;l<i.length;l++){p=i[l];r=A[l];if(!p.equals(r))break}for(var n=c,g,C,j,F=l;F<i.length;F++){g=
|
||||
i[F];n&&!g.equals(e)&&(C=n.append(g.clone()));for(g=g.getNext();g;){if(g.equals(A[F])||g.equals(f))break;j=g.getNext();if(b==2)n.append(g.clone(true));else{g.remove();b==1&&n.append(g)}g=j}n&&(n=C)}n=c;for(c=l;c<A.length;c++){g=A[c];b>0&&!g.equals(f)&&(C=n.append(g.clone()));if(!i[c]||g.$.parentNode!=i[c].$.parentNode)for(g=g.getPrevious();g;){if(g.equals(i[c])||g.equals(e))break;j=g.getPrevious();if(b==2)n.$.insertBefore(g.$.cloneNode(true),n.$.firstChild);else{g.remove();b==1&&n.$.insertBefore(g.$,
|
||||
n.$.firstChild)}g=j}n&&(n=C)}if(b==2){p=a.startContainer;if(p.type==CKEDITOR.NODE_TEXT){p.$.data=p.$.data+p.$.nextSibling.data;p.$.parentNode.removeChild(p.$.nextSibling)}a=a.endContainer;if(a.type==CKEDITOR.NODE_TEXT&&a.$.nextSibling){a.$.data=a.$.data+a.$.nextSibling.data;a.$.parentNode.removeChild(a.$.nextSibling)}}else{if(p&&r&&(e.$.parentNode!=p.$.parentNode||f.$.parentNode!=r.$.parentNode)){b=r.getIndex();h&&r.$.parentNode==e.$.parentNode&&b--;if(d&&p.type==CKEDITOR.NODE_ELEMENT){d=CKEDITOR.dom.element.createFromHtml('<span data-cke-bookmark="1" style="display:none"> </span>',
|
||||
a.document);d.insertAfter(p);p.mergeSiblings(false);a.moveToBookmark({startNode:d})}else a.setStart(r.getParent(),b)}a.collapse(true)}h&&e.remove();o&&f.$.parentNode&&f.remove()},d={abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,"var":1},h=CKEDITOR.dom.walker.bogus(),k=/^[\t\r\n ]*(?: |\xa0)$/,j=CKEDITOR.dom.walker.editable(),g=CKEDITOR.dom.walker.ignored(true);CKEDITOR.dom.range.prototype=
|
||||
{clone:function(){var a=new CKEDITOR.dom.range(this.root);a._setStartContainer(this.startContainer);a.startOffset=this.startOffset;a._setEndContainer(this.endContainer);a.endOffset=this.endOffset;a.collapsed=this.collapsed;return a},collapse:function(a){if(a){this._setEndContainer(this.startContainer);this.endOffset=this.startOffset}else{this._setStartContainer(this.endContainer);this.startOffset=this.endOffset}this.collapsed=true},cloneContents:function(){var a=new CKEDITOR.dom.documentFragment(this.document);
|
||||
this.collapsed||e(this,2,a);return a},deleteContents:function(a){this.collapsed||e(this,0,null,a)},extractContents:function(a){var b=new CKEDITOR.dom.documentFragment(this.document);this.collapsed||e(this,1,b,a);return b},createBookmark:function(a){var b,c,d,e,f=this.collapsed;b=this.document.createElement("span");b.data("cke-bookmark",1);b.setStyle("display","none");b.setHtml(" ");if(a){d="cke_bm_"+CKEDITOR.tools.getNextNumber();b.setAttribute("id",d+(f?"C":"S"))}if(!f){c=b.clone();c.setHtml(" ");
|
||||
a&&c.setAttribute("id",d+"E");e=this.clone();e.collapse();e.insertNode(c)}e=this.clone();e.collapse(true);e.insertNode(b);if(c){this.setStartAfter(b);this.setEndBefore(c)}else this.moveToPosition(b,CKEDITOR.POSITION_AFTER_END);return{startNode:a?d+(f?"C":"S"):b,endNode:a?d+"E":c,serializable:a,collapsed:f}},createBookmark2:function(){function a(c){var d=c.container,e=c.offset,f;f=d;var m=e;f=f.type!=CKEDITOR.NODE_ELEMENT||m===0||m==f.getChildCount()?0:f.getChild(m-1).type==CKEDITOR.NODE_TEXT&&f.getChild(m).type==
|
||||
CKEDITOR.NODE_TEXT;if(f){d=d.getChild(e-1);e=d.getLength()}d.type==CKEDITOR.NODE_ELEMENT&&e>1&&(e=d.getChild(e-1).getIndex(true)+1);if(d.type==CKEDITOR.NODE_TEXT){f=d;for(m=0;(f=f.getPrevious())&&f.type==CKEDITOR.NODE_TEXT;)m=m+f.getLength();f=m;if(d.getText())e=e+f;else{m=d.getPrevious(b);if(f){e=f;d=m?m.getNext():d.getParent().getFirst()}else{d=d.getParent();e=m?m.getIndex(true)+1:0}}}c.container=d;c.offset=e}var b=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_TEXT,true);return function(b){var c=this.collapsed,
|
||||
d={container:this.startContainer,offset:this.startOffset},e={container:this.endContainer,offset:this.endOffset};if(b){a(d);c||a(e)}return{start:d.container.getAddress(b),end:c?null:e.container.getAddress(b),startOffset:d.offset,endOffset:e.offset,normalized:b,collapsed:c,is2:true}}}(),moveToBookmark:function(a){if(a.is2){var b=this.document.getByAddress(a.start,a.normalized),c=a.startOffset,d=a.end&&this.document.getByAddress(a.end,a.normalized),a=a.endOffset;this.setStart(b,c);d?this.setEnd(d,a):
|
||||
this.collapse(true)}else{b=(c=a.serializable)?this.document.getById(a.startNode):a.startNode;a=c?this.document.getById(a.endNode):a.endNode;this.setStartBefore(b);b.remove();if(a){this.setEndBefore(a);a.remove()}else this.collapse(true)}},getBoundaryNodes:function(){var a=this.startContainer,b=this.endContainer,c=this.startOffset,d=this.endOffset,e;if(a.type==CKEDITOR.NODE_ELEMENT){e=a.getChildCount();if(e>c)a=a.getChild(c);else if(e<1)a=a.getPreviousSourceNode();else{for(a=a.$;a.lastChild;)a=a.lastChild;
|
||||
a=new CKEDITOR.dom.node(a);a=a.getNextSourceNode()||a}}if(b.type==CKEDITOR.NODE_ELEMENT){e=b.getChildCount();if(e>d)b=b.getChild(d).getPreviousSourceNode(true);else if(e<1)b=b.getPreviousSourceNode();else{for(b=b.$;b.lastChild;)b=b.lastChild;b=new CKEDITOR.dom.node(b)}}a.getPosition(b)&CKEDITOR.POSITION_FOLLOWING&&(a=b);return{startNode:a,endNode:b}},getCommonAncestor:function(a,b){var c=this.startContainer,d=this.endContainer,c=c.equals(d)?a&&c.type==CKEDITOR.NODE_ELEMENT&&this.startOffset==this.endOffset-
|
||||
1?c.getChild(this.startOffset):c:c.getCommonAncestor(d);return b&&!c.is?c.getParent():c},optimize:function(){var a=this.startContainer,b=this.startOffset;a.type!=CKEDITOR.NODE_ELEMENT&&(b?b>=a.getLength()&&this.setStartAfter(a):this.setStartBefore(a));a=this.endContainer;b=this.endOffset;a.type!=CKEDITOR.NODE_ELEMENT&&(b?b>=a.getLength()&&this.setEndAfter(a):this.setEndBefore(a))},optimizeBookmark:function(){var a=this.startContainer,b=this.endContainer;a.is&&(a.is("span")&&a.data("cke-bookmark"))&&
|
||||
this.setStartAt(a,CKEDITOR.POSITION_BEFORE_START);b&&(b.is&&b.is("span")&&b.data("cke-bookmark"))&&this.setEndAt(b,CKEDITOR.POSITION_AFTER_END)},trim:function(a,b){var c=this.startContainer,d=this.startOffset,e=this.collapsed;if((!a||e)&&c&&c.type==CKEDITOR.NODE_TEXT){if(d)if(d>=c.getLength()){d=c.getIndex()+1;c=c.getParent()}else{var f=c.split(d),d=c.getIndex()+1,c=c.getParent();if(this.startContainer.equals(this.endContainer))this.setEnd(f,this.endOffset-this.startOffset);else if(c.equals(this.endContainer))this.endOffset=
|
||||
this.endOffset+1}else{d=c.getIndex();c=c.getParent()}this.setStart(c,d);if(e){this.collapse(true);return}}c=this.endContainer;d=this.endOffset;if(!b&&!e&&c&&c.type==CKEDITOR.NODE_TEXT){if(d){d>=c.getLength()||c.split(d);d=c.getIndex()+1}else d=c.getIndex();c=c.getParent();this.setEnd(c,d)}},enlarge:function(a,b){function c(a){return a&&a.type==CKEDITOR.NODE_ELEMENT&&a.hasAttribute("contenteditable")?null:a}var d=RegExp(/[^\s\ufeff]/);switch(a){case CKEDITOR.ENLARGE_INLINE:var e=1;case CKEDITOR.ENLARGE_ELEMENT:if(this.collapsed)break;
|
||||
var f=this.getCommonAncestor(),i=this.root,h,g,o,l,p,r=false,n,j;n=this.startContainer;var C=this.startOffset;if(n.type==CKEDITOR.NODE_TEXT){if(C){n=!CKEDITOR.tools.trim(n.substring(0,C)).length&&n;r=!!n}if(n&&!(l=n.getPrevious()))o=n.getParent()}else{C&&(l=n.getChild(C-1)||n.getLast());l||(o=n)}for(o=c(o);o||l;){if(o&&!l){!p&&o.equals(f)&&(p=true);if(e?o.isBlockBoundary():!i.contains(o))break;if(!r||o.getComputedStyle("display")!="inline"){r=false;p?h=o:this.setStartBefore(o)}l=o.getPrevious()}for(;l;){n=
|
||||
false;if(l.type==CKEDITOR.NODE_COMMENT)l=l.getPrevious();else{if(l.type==CKEDITOR.NODE_TEXT){j=l.getText();d.test(j)&&(l=null);n=/[\s\ufeff]$/.test(j)}else if((l.$.offsetWidth>(CKEDITOR.env.webkit?1:0)||b&&l.is("br"))&&!l.data("cke-bookmark"))if(r&&CKEDITOR.dtd.$removeEmpty[l.getName()]){j=l.getText();if(d.test(j))l=null;else for(var C=l.$.getElementsByTagName("*"),k=0,F;F=C[k++];)if(!CKEDITOR.dtd.$removeEmpty[F.nodeName.toLowerCase()]){l=null;break}l&&(n=!!j.length)}else l=null;n&&(r?p?h=o:o&&this.setStartBefore(o):
|
||||
r=true);if(l){n=l.getPrevious();if(!o&&!n){o=l;l=null;break}l=n}else o=null}}o&&(o=c(o.getParent()))}n=this.endContainer;C=this.endOffset;o=l=null;p=r=false;var K=function(a,b){var c=new CKEDITOR.dom.range(i);c.setStart(a,b);c.setEndAt(i,CKEDITOR.POSITION_BEFORE_END);var c=new CKEDITOR.dom.walker(c),e;for(c.guard=function(a){return!(a.type==CKEDITOR.NODE_ELEMENT&&a.isBlockBoundary())};e=c.next();){if(e.type!=CKEDITOR.NODE_TEXT)return false;j=e!=a?e.getText():e.substring(b);if(d.test(j))return false}return true};
|
||||
if(n.type==CKEDITOR.NODE_TEXT)if(CKEDITOR.tools.trim(n.substring(C)).length)r=true;else{r=!n.getLength();if(C==n.getLength()){if(!(l=n.getNext()))o=n.getParent()}else K(n,C)&&(o=n.getParent())}else(l=n.getChild(C))||(o=n);for(;o||l;){if(o&&!l){!p&&o.equals(f)&&(p=true);if(e?o.isBlockBoundary():!i.contains(o))break;if(!r||o.getComputedStyle("display")!="inline"){r=false;p?g=o:o&&this.setEndAfter(o)}l=o.getNext()}for(;l;){n=false;if(l.type==CKEDITOR.NODE_TEXT){j=l.getText();K(l,0)||(l=null);n=/^[\s\ufeff]/.test(j)}else if(l.type==
|
||||
CKEDITOR.NODE_ELEMENT){if((l.$.offsetWidth>0||b&&l.is("br"))&&!l.data("cke-bookmark"))if(r&&CKEDITOR.dtd.$removeEmpty[l.getName()]){j=l.getText();if(d.test(j))l=null;else{C=l.$.getElementsByTagName("*");for(k=0;F=C[k++];)if(!CKEDITOR.dtd.$removeEmpty[F.nodeName.toLowerCase()]){l=null;break}}l&&(n=!!j.length)}else l=null}else n=1;n&&r&&(p?g=o:this.setEndAfter(o));if(l){n=l.getNext();if(!o&&!n){o=l;l=null;break}l=n}else o=null}o&&(o=c(o.getParent()))}if(h&&g){f=h.contains(g)?g:h;this.setStartBefore(f);
|
||||
this.setEndAfter(f)}break;case CKEDITOR.ENLARGE_BLOCK_CONTENTS:case CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:o=new CKEDITOR.dom.range(this.root);i=this.root;o.setStartAt(i,CKEDITOR.POSITION_AFTER_START);o.setEnd(this.startContainer,this.startOffset);o=new CKEDITOR.dom.walker(o);var I,v,G=CKEDITOR.dom.walker.blockBoundary(a==CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS?{br:1}:null),z=null,B=function(a){if(a.type==CKEDITOR.NODE_ELEMENT&&a.getAttribute("contenteditable")=="false")if(z){if(z.equals(a)){z=null;return}}else z=
|
||||
a;else if(z)return;var b=G(a);b||(I=a);return b},e=function(a){var b=B(a);!b&&(a.is&&a.is("br"))&&(v=a);return b};o.guard=B;o=o.lastBackward();I=I||i;this.setStartAt(I,!I.is("br")&&(!o&&this.checkStartOfBlock()||o&&I.contains(o))?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_AFTER_END);if(a==CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS){o=this.clone();o=new CKEDITOR.dom.walker(o);var x=CKEDITOR.dom.walker.whitespaces(),E=CKEDITOR.dom.walker.bookmark();o.evaluator=function(a){return!x(a)&&!E(a)};if((o=o.previous())&&
|
||||
o.type==CKEDITOR.NODE_ELEMENT&&o.is("br"))break}o=this.clone();o.collapse();o.setEndAt(i,CKEDITOR.POSITION_BEFORE_END);o=new CKEDITOR.dom.walker(o);o.guard=a==CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS?e:B;I=z=v=null;o=o.lastForward();I=I||i;this.setEndAt(I,!o&&this.checkEndOfBlock()||o&&I.contains(o)?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_BEFORE_START);v&&this.setEndAfter(v)}},shrink:function(a,b,c){if(!this.collapsed){var a=a||CKEDITOR.SHRINK_TEXT,d=this.clone(),e=this.startContainer,f=this.endContainer,
|
||||
i=this.startOffset,h=this.endOffset,g=1,o=1;if(e&&e.type==CKEDITOR.NODE_TEXT)if(i)if(i>=e.getLength())d.setStartAfter(e);else{d.setStartBefore(e);g=0}else d.setStartBefore(e);if(f&&f.type==CKEDITOR.NODE_TEXT)if(h)if(h>=f.getLength())d.setEndAfter(f);else{d.setEndAfter(f);o=0}else d.setEndBefore(f);var d=new CKEDITOR.dom.walker(d),l=CKEDITOR.dom.walker.bookmark();d.evaluator=function(b){return b.type==(a==CKEDITOR.SHRINK_ELEMENT?CKEDITOR.NODE_ELEMENT:CKEDITOR.NODE_TEXT)};var p;d.guard=function(b,d){if(l(b))return true;
|
||||
if(a==CKEDITOR.SHRINK_ELEMENT&&b.type==CKEDITOR.NODE_TEXT||d&&b.equals(p)||c===false&&b.type==CKEDITOR.NODE_ELEMENT&&b.isBlockBoundary()||b.type==CKEDITOR.NODE_ELEMENT&&b.hasAttribute("contenteditable"))return false;!d&&b.type==CKEDITOR.NODE_ELEMENT&&(p=b);return true};if(g)(e=d[a==CKEDITOR.SHRINK_ELEMENT?"lastForward":"next"]())&&this.setStartAt(e,b?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_START);if(o){d.reset();(d=d[a==CKEDITOR.SHRINK_ELEMENT?"lastBackward":"previous"]())&&this.setEndAt(d,
|
||||
b?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_AFTER_END)}return!(!g&&!o)}},insertNode:function(a){this.optimizeBookmark();this.trim(false,true);var b=this.startContainer,c=b.getChild(this.startOffset);c?a.insertBefore(c):b.append(a);a.getParent()&&a.getParent().equals(this.endContainer)&&this.endOffset++;this.setStartBefore(a)},moveToPosition:function(a,b){this.setStartAt(a,b);this.collapse(true)},moveToRange:function(a){this.setStart(a.startContainer,a.startOffset);this.setEnd(a.endContainer,
|
||||
a.endOffset)},selectNodeContents:function(a){this.setStart(a,0);this.setEnd(a,a.type==CKEDITOR.NODE_TEXT?a.getLength():a.getChildCount())},setStart:function(a,b){if(a.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$empty[a.getName()]){b=a.getIndex();a=a.getParent()}this._setStartContainer(a);this.startOffset=b;if(!this.endContainer){this._setEndContainer(a);this.endOffset=b}c(this)},setEnd:function(a,b){if(a.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$empty[a.getName()]){b=a.getIndex()+1;a=a.getParent()}this._setEndContainer(a);
|
||||
this.endOffset=b;if(!this.startContainer){this._setStartContainer(a);this.startOffset=b}c(this)},setStartAfter:function(a){this.setStart(a.getParent(),a.getIndex()+1)},setStartBefore:function(a){this.setStart(a.getParent(),a.getIndex())},setEndAfter:function(a){this.setEnd(a.getParent(),a.getIndex()+1)},setEndBefore:function(a){this.setEnd(a.getParent(),a.getIndex())},setStartAt:function(a,b){switch(b){case CKEDITOR.POSITION_AFTER_START:this.setStart(a,0);break;case CKEDITOR.POSITION_BEFORE_END:a.type==
|
||||
CKEDITOR.NODE_TEXT?this.setStart(a,a.getLength()):this.setStart(a,a.getChildCount());break;case CKEDITOR.POSITION_BEFORE_START:this.setStartBefore(a);break;case CKEDITOR.POSITION_AFTER_END:this.setStartAfter(a)}c(this)},setEndAt:function(a,b){switch(b){case CKEDITOR.POSITION_AFTER_START:this.setEnd(a,0);break;case CKEDITOR.POSITION_BEFORE_END:a.type==CKEDITOR.NODE_TEXT?this.setEnd(a,a.getLength()):this.setEnd(a,a.getChildCount());break;case CKEDITOR.POSITION_BEFORE_START:this.setEndBefore(a);break;
|
||||
case CKEDITOR.POSITION_AFTER_END:this.setEndAfter(a)}c(this)},fixBlock:function(a,b){var c=this.createBookmark(),d=this.document.createElement(b);this.collapse(a);this.enlarge(CKEDITOR.ENLARGE_BLOCK_CONTENTS);this.extractContents().appendTo(d);d.trim();d.appendBogus();this.insertNode(d);this.moveToBookmark(c);return d},splitBlock:function(a){var b=new CKEDITOR.dom.elementPath(this.startContainer,this.root),c=new CKEDITOR.dom.elementPath(this.endContainer,this.root),d=b.block,e=c.block,f=null;if(!b.blockLimit.equals(c.blockLimit))return null;
|
||||
if(a!="br"){if(!d){d=this.fixBlock(true,a);e=(new CKEDITOR.dom.elementPath(this.endContainer,this.root)).block}e||(e=this.fixBlock(false,a))}a=d&&this.checkStartOfBlock();b=e&&this.checkEndOfBlock();this.deleteContents();if(d&&d.equals(e))if(b){f=new CKEDITOR.dom.elementPath(this.startContainer,this.root);this.moveToPosition(e,CKEDITOR.POSITION_AFTER_END);e=null}else if(a){f=new CKEDITOR.dom.elementPath(this.startContainer,this.root);this.moveToPosition(d,CKEDITOR.POSITION_BEFORE_START);d=null}else{e=
|
||||
this.splitElement(d);d.is("ul","ol")||d.appendBogus()}return{previousBlock:d,nextBlock:e,wasStartOfBlock:a,wasEndOfBlock:b,elementPath:f}},splitElement:function(a){if(!this.collapsed)return null;this.setEndAt(a,CKEDITOR.POSITION_BEFORE_END);var b=this.extractContents(),c=a.clone(false);b.appendTo(c);c.insertAfter(a);this.moveToPosition(a,CKEDITOR.POSITION_AFTER_END);return c},removeEmptyBlocksAtEnd:function(){function a(d){return function(a){return b(a)||(c(a)||a.type==CKEDITOR.NODE_ELEMENT&&a.isEmptyInlineRemoveable())||
|
||||
d.is("table")&&a.is("caption")?false:true}}var b=CKEDITOR.dom.walker.whitespaces(),c=CKEDITOR.dom.walker.bookmark(false);return function(b){for(var c=this.createBookmark(),d=this[b?"endPath":"startPath"](),e=d.block||d.blockLimit,f;e&&!e.equals(d.root)&&!e.getFirst(a(e));){f=e.getParent();this[b?"setEndAt":"setStartAt"](e,CKEDITOR.POSITION_AFTER_END);e.remove(1);e=f}this.moveToBookmark(c)}}(),startPath:function(){return new CKEDITOR.dom.elementPath(this.startContainer,this.root)},endPath:function(){return new CKEDITOR.dom.elementPath(this.endContainer,
|
||||
this.root)},checkBoundaryOfElement:function(a,b){var c=b==CKEDITOR.START,d=this.clone();d.collapse(c);d[c?"setStartAt":"setEndAt"](a,c?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_END);d=new CKEDITOR.dom.walker(d);d.evaluator=f(c);return d[c?"checkBackward":"checkForward"]()},checkStartOfBlock:function(){var b=this.startContainer,c=this.startOffset;if(CKEDITOR.env.ie&&c&&b.type==CKEDITOR.NODE_TEXT){b=CKEDITOR.tools.ltrim(b.substring(0,c));k.test(b)&&this.trim(0,1)}this.trim();b=new CKEDITOR.dom.elementPath(this.startContainer,
|
||||
this.root);c=this.clone();c.collapse(true);c.setStartAt(b.block||b.blockLimit,CKEDITOR.POSITION_AFTER_START);b=new CKEDITOR.dom.walker(c);b.evaluator=a();return b.checkBackward()},checkEndOfBlock:function(){var b=this.endContainer,c=this.endOffset;if(CKEDITOR.env.ie&&b.type==CKEDITOR.NODE_TEXT){b=CKEDITOR.tools.rtrim(b.substring(c));k.test(b)&&this.trim(1,0)}this.trim();b=new CKEDITOR.dom.elementPath(this.endContainer,this.root);c=this.clone();c.collapse(false);c.setEndAt(b.block||b.blockLimit,CKEDITOR.POSITION_BEFORE_END);
|
||||
b=new CKEDITOR.dom.walker(c);b.evaluator=a();return b.checkForward()},getPreviousNode:function(a,b,c){var d=this.clone();d.collapse(1);d.setStartAt(c||this.root,CKEDITOR.POSITION_AFTER_START);c=new CKEDITOR.dom.walker(d);c.evaluator=a;c.guard=b;return c.previous()},getNextNode:function(a,b,c){var d=this.clone();d.collapse();d.setEndAt(c||this.root,CKEDITOR.POSITION_BEFORE_END);c=new CKEDITOR.dom.walker(d);c.evaluator=a;c.guard=b;return c.next()},checkReadOnly:function(){function a(b,c){for(;b;){if(b.type==
|
||||
CKEDITOR.NODE_ELEMENT){if(b.getAttribute("contentEditable")=="false"&&!b.data("cke-editable"))return 0;if(b.is("html")||b.getAttribute("contentEditable")=="true"&&(b.contains(c)||b.equals(c)))break}b=b.getParent()}return 1}return function(){var b=this.startContainer,c=this.endContainer;return!(a(b,c)&&a(c,b))}}(),moveToElementEditablePosition:function(a,b){if(a.type==CKEDITOR.NODE_ELEMENT&&!a.isEditable(false)){this.moveToPosition(a,b?CKEDITOR.POSITION_AFTER_END:CKEDITOR.POSITION_BEFORE_START);return true}for(var c=
|
||||
0;a;){if(a.type==CKEDITOR.NODE_TEXT){b&&this.endContainer&&this.checkEndOfBlock()&&k.test(a.getText())?this.moveToPosition(a,CKEDITOR.POSITION_BEFORE_START):this.moveToPosition(a,b?CKEDITOR.POSITION_AFTER_END:CKEDITOR.POSITION_BEFORE_START);c=1;break}if(a.type==CKEDITOR.NODE_ELEMENT)if(a.isEditable()){this.moveToPosition(a,b?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_AFTER_START);c=1}else if(b&&a.is("br")&&this.endContainer&&this.checkEndOfBlock())this.moveToPosition(a,CKEDITOR.POSITION_BEFORE_START);
|
||||
else if(a.getAttribute("contenteditable")=="false"&&a.is(CKEDITOR.dtd.$block)){this.setStartBefore(a);this.setEndAfter(a);return true}var d=a,e=c,f=void 0;d.type==CKEDITOR.NODE_ELEMENT&&d.isEditable(false)&&(f=d[b?"getLast":"getFirst"](g));!e&&!f&&(f=d[b?"getPrevious":"getNext"](g));a=f}return!!c},moveToClosestEditablePosition:function(a,b){var c=new CKEDITOR.dom.range(this.root),d=0,e,f=[CKEDITOR.POSITION_AFTER_END,CKEDITOR.POSITION_BEFORE_START];c.moveToPosition(a,f[b?0:1]);if(a.is(CKEDITOR.dtd.$block)){if(e=
|
||||
c[b?"getNextEditableNode":"getPreviousEditableNode"]()){d=1;if(e.type==CKEDITOR.NODE_ELEMENT&&e.is(CKEDITOR.dtd.$block)&&e.getAttribute("contenteditable")=="false"){c.setStartAt(e,CKEDITOR.POSITION_BEFORE_START);c.setEndAt(e,CKEDITOR.POSITION_AFTER_END)}else c.moveToPosition(e,f[b?1:0])}}else d=1;d&&this.moveToRange(c);return!!d},moveToElementEditStart:function(a){return this.moveToElementEditablePosition(a)},moveToElementEditEnd:function(a){return this.moveToElementEditablePosition(a,true)},getEnclosedNode:function(){var a=
|
||||
this.clone();a.optimize();if(a.startContainer.type!=CKEDITOR.NODE_ELEMENT||a.endContainer.type!=CKEDITOR.NODE_ELEMENT)return null;var a=new CKEDITOR.dom.walker(a),b=CKEDITOR.dom.walker.bookmark(false,true),c=CKEDITOR.dom.walker.whitespaces(true);a.evaluator=function(a){return c(a)&&b(a)};var d=a.next();a.reset();return d&&d.equals(a.previous())?d:null},getTouchedStartNode:function(){var a=this.startContainer;return this.collapsed||a.type!=CKEDITOR.NODE_ELEMENT?a:a.getChild(this.startOffset)||a},getTouchedEndNode:function(){var a=
|
||||
this.endContainer;return this.collapsed||a.type!=CKEDITOR.NODE_ELEMENT?a:a.getChild(this.endOffset-1)||a},getNextEditableNode:b(),getPreviousEditableNode:b(1),scrollIntoView:function(){var a=new CKEDITOR.dom.element.createFromHtml("<span> </span>",this.document),b,c,d,e=this.clone();e.optimize();if(d=e.startContainer.type==CKEDITOR.NODE_TEXT){c=e.startContainer.getText();b=e.startContainer.split(e.startOffset);a.insertAfter(e.startContainer)}else e.insertNode(a);a.scrollIntoView();if(d){e.startContainer.setText(c);
|
||||
b.remove()}a.remove()},_setStartContainer:function(a){this.startContainer=a},_setEndContainer:function(a){this.endContainer=a}}})();CKEDITOR.POSITION_AFTER_START=1;CKEDITOR.POSITION_BEFORE_END=2;CKEDITOR.POSITION_BEFORE_START=3;CKEDITOR.POSITION_AFTER_END=4;CKEDITOR.ENLARGE_ELEMENT=1;CKEDITOR.ENLARGE_BLOCK_CONTENTS=2;CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS=3;CKEDITOR.ENLARGE_INLINE=4;CKEDITOR.START=1;CKEDITOR.END=2;CKEDITOR.SHRINK_ELEMENT=1;CKEDITOR.SHRINK_TEXT=2;"use strict";
|
||||
(function(){function a(a){if(!(arguments.length<1)){this.range=a;this.forceBrBreak=0;this.enlargeBr=1;this.enforceRealBlocks=0;this._||(this._={})}}function f(a){var b=[];a.forEach(function(a){if(a.getAttribute("contenteditable")=="true"){b.push(a);return false}},CKEDITOR.NODE_ELEMENT,true);return b}function b(a,c,d,e){a:{e==null&&(e=f(d));for(var h;h=e.shift();)if(h.getDtd().p){e={element:h,remaining:e};break a}e=null}if(!e)return 0;if((h=CKEDITOR.filter.instances[e.element.data("cke-filter")])&&
|
||||
!h.check(c))return b(a,c,d,e.remaining);c=new CKEDITOR.dom.range(e.element);c.selectNodeContents(e.element);c=c.createIterator();c.enlargeBr=a.enlargeBr;c.enforceRealBlocks=a.enforceRealBlocks;c.activeFilter=c.filter=h;a._.nestedEditable={element:e.element,container:d,remaining:e.remaining,iterator:c};return 1}function c(a,b,c){if(!b)return false;a=a.clone();a.collapse(!c);return a.checkBoundaryOfElement(b,c?CKEDITOR.START:CKEDITOR.END)}var e=/^[\r\n\t ]+$/,d=CKEDITOR.dom.walker.bookmark(false,true),
|
||||
h=CKEDITOR.dom.walker.whitespaces(true),k=function(a){return d(a)&&h(a)},j={dd:1,dt:1,li:1};a.prototype={getNextParagraph:function(a){var f,h,s,w,q,a=a||"p";if(this._.nestedEditable){if(f=this._.nestedEditable.iterator.getNextParagraph(a)){this.activeFilter=this._.nestedEditable.iterator.activeFilter;return f}this.activeFilter=this.filter;if(b(this,a,this._.nestedEditable.container,this._.nestedEditable.remaining)){this.activeFilter=this._.nestedEditable.iterator.activeFilter;return this._.nestedEditable.iterator.getNextParagraph(a)}this._.nestedEditable=
|
||||
null}if(!this.range.root.getDtd()[a])return null;if(!this._.started){var t=this.range.clone();h=t.startPath();var i=t.endPath(),A=!t.collapsed&&c(t,h.block),u=!t.collapsed&&c(t,i.block,1);t.shrink(CKEDITOR.SHRINK_ELEMENT,true);A&&t.setStartAt(h.block,CKEDITOR.POSITION_BEFORE_END);u&&t.setEndAt(i.block,CKEDITOR.POSITION_AFTER_START);h=t.endContainer.hasAscendant("pre",true)||t.startContainer.hasAscendant("pre",true);t.enlarge(this.forceBrBreak&&!h||!this.enlargeBr?CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:
|
||||
CKEDITOR.ENLARGE_BLOCK_CONTENTS);if(!t.collapsed){h=new CKEDITOR.dom.walker(t.clone());i=CKEDITOR.dom.walker.bookmark(true,true);h.evaluator=i;this._.nextNode=h.next();h=new CKEDITOR.dom.walker(t.clone());h.evaluator=i;h=h.previous();this._.lastNode=h.getNextSourceNode(true,null,t.root);if(this._.lastNode&&this._.lastNode.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.trim(this._.lastNode.getText())&&this._.lastNode.getParent().isBlockBoundary()){i=this.range.clone();i.moveToPosition(this._.lastNode,CKEDITOR.POSITION_AFTER_END);
|
||||
if(i.checkEndOfBlock()){i=new CKEDITOR.dom.elementPath(i.endContainer,i.root);this._.lastNode=(i.block||i.blockLimit).getNextSourceNode(true)}}if(!this._.lastNode||!t.root.contains(this._.lastNode)){this._.lastNode=this._.docEndMarker=t.document.createText("");this._.lastNode.insertAfter(h)}t=null}this._.started=1;h=t}i=this._.nextNode;t=this._.lastNode;for(this._.nextNode=null;i;){var A=0,u=i.hasAscendant("pre"),o=i.type!=CKEDITOR.NODE_ELEMENT,l=0;if(o)i.type==CKEDITOR.NODE_TEXT&&e.test(i.getText())&&
|
||||
(o=0);else{var p=i.getName();if(CKEDITOR.dtd.$block[p]&&i.getAttribute("contenteditable")=="false"){f=i;b(this,a,f);break}else if(i.isBlockBoundary(this.forceBrBreak&&!u&&{br:1})){if(p=="br")o=1;else if(!h&&!i.getChildCount()&&p!="hr"){f=i;s=i.equals(t);break}if(h){h.setEndAt(i,CKEDITOR.POSITION_BEFORE_START);if(p!="br")this._.nextNode=i}A=1}else{if(i.getFirst()){if(!h){h=this.range.clone();h.setStartAt(i,CKEDITOR.POSITION_BEFORE_START)}i=i.getFirst();continue}o=1}}if(o&&!h){h=this.range.clone();
|
||||
h.setStartAt(i,CKEDITOR.POSITION_BEFORE_START)}s=(!A||o)&&i.equals(t);if(h&&!A)for(;!i.getNext(k)&&!s;){p=i.getParent();if(p.isBlockBoundary(this.forceBrBreak&&!u&&{br:1})){A=1;o=0;s||p.equals(t);h.setEndAt(p,CKEDITOR.POSITION_BEFORE_END);break}i=p;o=1;s=i.equals(t);l=1}o&&h.setEndAt(i,CKEDITOR.POSITION_AFTER_END);i=this._getNextSourceNode(i,l,t);if((s=!i)||A&&h)break}if(!f){if(!h){this._.docEndMarker&&this._.docEndMarker.remove();return this._.nextNode=null}f=new CKEDITOR.dom.elementPath(h.startContainer,
|
||||
h.root);i=f.blockLimit;A={div:1,th:1,td:1};f=f.block;if(!f&&i&&!this.enforceRealBlocks&&A[i.getName()]&&h.checkStartOfBlock()&&h.checkEndOfBlock()&&!i.equals(h.root))f=i;else if(!f||this.enforceRealBlocks&&f.is(j)){f=this.range.document.createElement(a);h.extractContents().appendTo(f);f.trim();h.insertNode(f);w=q=true}else if(f.getName()!="li"){if(!h.checkStartOfBlock()||!h.checkEndOfBlock()){f=f.clone(false);h.extractContents().appendTo(f);f.trim();q=h.splitBlock();w=!q.wasStartOfBlock;q=!q.wasEndOfBlock;
|
||||
h.insertNode(f)}}else if(!s)this._.nextNode=f.equals(t)?null:this._getNextSourceNode(h.getBoundaryNodes().endNode,1,t)}if(w)(w=f.getPrevious())&&w.type==CKEDITOR.NODE_ELEMENT&&(w.getName()=="br"?w.remove():w.getLast()&&w.getLast().$.nodeName.toLowerCase()=="br"&&w.getLast().remove());if(q)(w=f.getLast())&&w.type==CKEDITOR.NODE_ELEMENT&&w.getName()=="br"&&(!CKEDITOR.env.needsBrFiller||w.getPrevious(d)||w.getNext(d))&&w.remove();if(!this._.nextNode)this._.nextNode=s||f.equals(t)||!t?null:this._getNextSourceNode(f,
|
||||
1,t);return f},_getNextSourceNode:function(a,b,c){function e(a){return!(a.equals(c)||a.equals(f))}for(var f=this.range.root,a=a.getNextSourceNode(b,null,e);!d(a);)a=a.getNextSourceNode(b,null,e);return a}};CKEDITOR.dom.range.prototype.createIterator=function(){return new a(this)}})();
|
||||
CKEDITOR.command=function(a,f){this.uiItems=[];this.exec=function(b){if(this.state==CKEDITOR.TRISTATE_DISABLED||!this.checkAllowed())return false;this.editorFocus&&a.focus();return this.fire("exec")===false?true:f.exec.call(this,a,b)!==false};this.refresh=function(a,b){if(!this.readOnly&&a.readOnly)return true;if(this.context&&!b.isContextFor(this.context)){this.disable();return true}if(!this.checkAllowed(true)){this.disable();return true}this.startDisabled||this.enable();this.modes&&!this.modes[a.mode]&&
|
||||
this.disable();return this.fire("refresh",{editor:a,path:b})===false?true:f.refresh&&f.refresh.apply(this,arguments)!==false};var b;this.checkAllowed=function(c){return!c&&typeof b=="boolean"?b:b=a.activeFilter.checkFeature(this)};CKEDITOR.tools.extend(this,f,{modes:{wysiwyg:1},editorFocus:1,contextSensitive:!!f.context,state:CKEDITOR.TRISTATE_DISABLED});CKEDITOR.event.call(this)};
|
||||
CKEDITOR.command.prototype={enable:function(){this.state==CKEDITOR.TRISTATE_DISABLED&&this.checkAllowed()&&this.setState(!this.preserveState||typeof this.previousState=="undefined"?CKEDITOR.TRISTATE_OFF:this.previousState)},disable:function(){this.setState(CKEDITOR.TRISTATE_DISABLED)},setState:function(a){if(this.state==a||a!=CKEDITOR.TRISTATE_DISABLED&&!this.checkAllowed())return false;this.previousState=this.state;this.state=a;this.fire("state");return true},toggleState:function(){this.state==CKEDITOR.TRISTATE_OFF?
|
||||
this.setState(CKEDITOR.TRISTATE_ON):this.state==CKEDITOR.TRISTATE_ON&&this.setState(CKEDITOR.TRISTATE_OFF)}};CKEDITOR.event.implementOn(CKEDITOR.command.prototype);CKEDITOR.ENTER_P=1;CKEDITOR.ENTER_BR=2;CKEDITOR.ENTER_DIV=3;
|
||||
CKEDITOR.config={customConfig:"config.js",autoUpdateElement:!0,language:"",defaultLanguage:"en",contentsLangDirection:"",enterMode:CKEDITOR.ENTER_P,forceEnterMode:!1,shiftEnterMode:CKEDITOR.ENTER_BR,docType:"<!DOCTYPE html>",bodyId:"",bodyClass:"",fullPage:!1,height:200,extraPlugins:"",removePlugins:"",protectedSource:[],tabIndex:0,width:"",baseFloatZIndex:1E4,blockedKeystrokes:[CKEDITOR.CTRL+66,CKEDITOR.CTRL+73,CKEDITOR.CTRL+85]};
|
||||
(function(){function a(a,b,c,d,e){var f,p,a=[];for(f in b){p=b[f];p=typeof p=="boolean"?{}:typeof p=="function"?{match:p}:K(p);if(f.charAt(0)!="$")p.elements=f;if(c)p.featureName=c.toLowerCase();var i=p;i.elements=h(i.elements,/\s+/)||null;i.propertiesOnly=i.propertiesOnly||i.elements===true;var l=/\s*,\s*/,r=void 0;for(r in z){i[r]=h(i[r],l)||null;var x=i,n=B[r],v=h(i[B[r]],l),q=i[r],E=[],g=true,o=void 0;v?g=false:v={};for(o in q)if(o.charAt(0)=="!"){o=o.slice(1);E.push(o);v[o]=true;g=false}for(;o=
|
||||
E.pop();){q[o]=q["!"+o];delete q["!"+o]}x[n]=(g?false:v)||null}i.match=i.match||null;d.push(p);a.push(p)}for(var b=e.elements,e=e.generic,C,c=0,d=a.length;c<d;++c){f=K(a[c]);p=f.classes===true||f.styles===true||f.attributes===true;i=f;r=n=l=void 0;for(l in z)i[l]=A(i[l]);x=true;for(r in B){l=B[r];n=i[l];v=[];q=void 0;for(q in n)q.indexOf("*")>-1?v.push(RegExp("^"+q.replace(/\*/g,".*")+"$")):v.push(q);n=v;if(n.length){i[l]=n;x=false}}i.nothingRequired=x;i.noProperties=!(i.attributes||i.classes||i.styles);
|
||||
if(f.elements===true||f.elements===null)e[p?"unshift":"push"](f);else{i=f.elements;delete f.elements;for(C in i)if(b[C])b[C][p?"unshift":"push"](f);else b[C]=[f]}}}function f(a,c,d,e){if(!a.match||a.match(c))if(e||k(a,c)){if(!a.propertiesOnly)d.valid=true;if(!d.allAttributes)d.allAttributes=b(a.attributes,c.attributes,d.validAttributes);if(!d.allStyles)d.allStyles=b(a.styles,c.styles,d.validStyles);if(!d.allClasses){a=a.classes;c=c.classes;e=d.validClasses;if(a)if(a===true)a=true;else{for(var f=0,
|
||||
p=c.length,i;f<p;++f){i=c[f];e[i]||(e[i]=a(i))}a=false}else a=false;d.allClasses=a}}}function b(a,b,c){if(!a)return false;if(a===true)return true;for(var d in b)c[d]||(c[d]=a(d));return false}function c(a,b,c){if(!a.match||a.match(b)){if(a.noProperties)return false;c.hadInvalidAttribute=e(a.attributes,b.attributes)||c.hadInvalidAttribute;c.hadInvalidStyle=e(a.styles,b.styles)||c.hadInvalidStyle;a=a.classes;b=b.classes;if(a){for(var d=false,f=a===true,p=b.length;p--;)if(f||a(b[p])){b.splice(p,1);d=
|
||||
true}a=d}else a=false;c.hadInvalidClass=a||c.hadInvalidClass}}function e(a,b){if(!a)return false;var c=false,d=a===true,e;for(e in b)if(d||a(e)){delete b[e];c=true}return c}function d(a,b,c){if(a.disabled||a.customConfig&&!c||!b)return false;a._.cachedChecks={};return true}function h(a,b){if(!a)return false;if(a===true)return a;if(typeof a=="string"){a=I(a);return a=="*"?true:CKEDITOR.tools.convertArrayToObject(a.split(b))}if(CKEDITOR.tools.isArray(a))return a.length?CKEDITOR.tools.convertArrayToObject(a):
|
||||
false;var c={},d=0,e;for(e in a){c[e]=a[e];d++}return d?c:false}function k(a,b){if(a.nothingRequired)return true;var c,d,e,f;if(e=a.requiredClasses){f=b.classes;for(c=0;c<e.length;++c){d=e[c];if(typeof d=="string"){if(CKEDITOR.tools.indexOf(f,d)==-1)return false}else if(!CKEDITOR.tools.checkIfAnyArrayItemMatches(f,d))return false}}return j(b.styles,a.requiredStyles)&&j(b.attributes,a.requiredAttributes)}function j(a,b){if(!b)return true;for(var c=0,d;c<b.length;++c){d=b[c];if(typeof d=="string"){if(!(d in
|
||||
a))return false}else if(!CKEDITOR.tools.checkIfAnyObjectPropertyMatches(a,d))return false}return true}function g(a){if(!a)return{};for(var a=a.split(/\s*,\s*/).sort(),b={};a.length;)b[a.shift()]=v;return b}function m(a){for(var b,c,d,e,f={},p=1,a=I(a);b=a.match(x);){if(c=b[2]){d=y(c,"styles");e=y(c,"attrs");c=y(c,"classes")}else d=e=c=null;f["$"+p++]={elements:b[1],classes:c,styles:d,attributes:e};a=a.slice(b[0].length)}return f}function y(a,b){var c=a.match(E[b]);return c?I(c[1]):null}function s(a){var b=
|
||||
a.styleBackup=a.attributes.style,c=a.classBackup=a.attributes["class"];if(!a.styles)a.styles=CKEDITOR.tools.parseCssText(b||"",1);if(!a.classes)a.classes=c?c.split(/\s+/):[]}function w(a,b,d,e){var l=0,r;if(e.toHtml)b.name=b.name.replace($,"$1");if(e.doCallbacks&&a.elementCallbacks){a:for(var x=a.elementCallbacks,h=0,n=x.length,v;h<n;++h)if(v=x[h](b)){r=v;break a}if(r)return r}if(e.doTransform)if(r=a._.transformations[b.name]){s(b);for(x=0;x<r.length;++x)p(a,b,r[x]);t(b)}if(e.doFilter){a:{x=b.name;
|
||||
h=a._;a=h.allowedRules.elements[x];r=h.allowedRules.generic;x=h.disallowedRules.elements[x];h=h.disallowedRules.generic;n=e.skipRequired;v={valid:false,validAttributes:{},validClasses:{},validStyles:{},allAttributes:false,allClasses:false,allStyles:false,hadInvalidAttribute:false,hadInvalidClass:false,hadInvalidStyle:false};var q,z;if(!a&&!r)a=null;else{s(b);if(x){q=0;for(z=x.length;q<z;++q)if(c(x[q],b,v)===false){a=null;break a}}if(h){q=0;for(z=h.length;q<z;++q)c(h[q],b,v)}if(a){q=0;for(z=a.length;q<
|
||||
z;++q)f(a[q],b,v,n)}if(r){q=0;for(z=r.length;q<z;++q)f(r[q],b,v,n)}a=v}}if(!a){d.push(b);return F}if(!a.valid){d.push(b);return F}z=a.validAttributes;var E=a.validStyles;r=a.validClasses;var x=b.attributes,A=b.styles,h=b.classes,n=b.classBackup,o=b.styleBackup,g,B,C=[];v=[];var j=/^data-cke-/;q=false;delete x.style;delete x["class"];delete b.classBackup;delete b.styleBackup;if(!a.allAttributes)for(g in x)if(!z[g])if(j.test(g)){if(g!=(B=g.replace(/^data-cke-saved-/,""))&&!z[B]){delete x[g];q=true}}else{delete x[g];
|
||||
q=true}if(!a.allStyles||a.hadInvalidStyle){for(g in A)a.allStyles||E[g]?C.push(g+":"+A[g]):q=true;if(C.length)x.style=C.sort().join("; ")}else if(o)x.style=o;if(!a.allClasses||a.hadInvalidClass){for(g=0;g<h.length;++g)(a.allClasses||r[h[g]])&&v.push(h[g]);v.length&&(x["class"]=v.sort().join(" "));n&&v.length<n.split(/\s+/).length&&(q=true)}else n&&(x["class"]=n);q&&(l=F);if(!e.skipFinalValidation&&!i(b)){d.push(b);return F}}if(e.toHtml)b.name=b.name.replace(aa,"cke:$1");return l}function q(a){var b=
|
||||
[],c;for(c in a)c.indexOf("*")>-1&&b.push(c.replace(/\*/g,".*"));return b.length?RegExp("^(?:"+b.join("|")+")$"):null}function t(a){var b=a.attributes,c;delete b.style;delete b["class"];if(c=CKEDITOR.tools.writeCssText(a.styles,true))b.style=c;a.classes.length&&(b["class"]=a.classes.sort().join(" "))}function i(a){switch(a.name){case "a":if(!a.children.length&&!a.attributes.name)return false;break;case "img":if(!a.attributes.src)return false}return true}function A(a){if(!a)return false;if(a===true)return true;
|
||||
var b=q(a);return function(c){return c in a||b&&c.match(b)}}function u(){return new CKEDITOR.htmlParser.element("br")}function o(a){return a.type==CKEDITOR.NODE_ELEMENT&&(a.name=="br"||L.$block[a.name])}function l(a,b,c){var d=a.name;if(L.$empty[d]||!a.children.length)if(d=="hr"&&b=="br")a.replaceWith(u());else{a.parent&&c.push({check:"it",el:a.parent});a.remove()}else if(L.$block[d]||d=="tr")if(b=="br"){if(a.previous&&!o(a.previous)){b=u();b.insertBefore(a)}if(a.next&&!o(a.next)){b=u();b.insertAfter(a)}a.replaceWithChildren()}else{var d=
|
||||
a.children,e;b:{e=L[b];for(var f=0,p=d.length,i;f<p;++f){i=d[f];if(i.type==CKEDITOR.NODE_ELEMENT&&!e[i.name]){e=false;break b}}e=true}if(e){a.name=b;a.attributes={};c.push({check:"parent-down",el:a})}else{e=a.parent;for(var f=e.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT||e.name=="body",l,r,p=d.length;p>0;){i=d[--p];if(f&&(i.type==CKEDITOR.NODE_TEXT||i.type==CKEDITOR.NODE_ELEMENT&&L.$inline[i.name])){if(!l){l=new CKEDITOR.htmlParser.element(b);l.insertAfter(a);c.push({check:"parent-down",el:l})}l.add(i,
|
||||
0)}else{l=null;r=L[e.name]||L.span;i.insertAfter(a);e.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT&&(i.type==CKEDITOR.NODE_ELEMENT&&!r[i.name])&&c.push({check:"el-up",el:i})}}a.remove()}}else if(d=="style")a.remove();else{a.parent&&c.push({check:"it",el:a.parent});a.replaceWithChildren()}}function p(a,b,c){var d,e;for(d=0;d<c.length;++d){e=c[d];if((!e.check||a.check(e.check,false))&&(!e.left||e.left(b))){e.right(b,ba);break}}}function r(a,b){var c=b.getDefinition(),d=c.attributes,e=c.styles,f,p,i,l;if(a.name!=
|
||||
c.element)return false;for(f in d)if(f=="class"){c=d[f].split(/\s+/);for(i=a.classes.join("|");l=c.pop();)if(i.indexOf(l)==-1)return false}else if(a.attributes[f]!=d[f])return false;for(p in e)if(a.styles[p]!=e[p])return false;return true}function n(a,b){var c,d;if(typeof a=="string")c=a;else if(a instanceof CKEDITOR.style)d=a;else{c=a[0];d=a[1]}return[{element:c,left:d,right:function(a,c){c.transform(a,b)}}]}function P(a){return function(b){return r(b,a)}}function C(a){return function(b,c){c[a](b)}}
|
||||
var L=CKEDITOR.dtd,F=1,K=CKEDITOR.tools.copy,I=CKEDITOR.tools.trim,v="cke-test",G=["","p","br","div"];CKEDITOR.FILTER_SKIP_TREE=2;CKEDITOR.filter=function(a){this.allowedContent=[];this.disallowedContent=[];this.elementCallbacks=null;this.disabled=false;this.editor=null;this.id=CKEDITOR.tools.getNextNumber();this._={allowedRules:{elements:{},generic:[]},disallowedRules:{elements:{},generic:[]},transformations:{},cachedTests:{}};CKEDITOR.filter.instances[this.id]=this;if(a instanceof CKEDITOR.editor){a=
|
||||
this.editor=a;this.customConfig=true;var b=a.config.allowedContent;if(b===true)this.disabled=true;else{if(!b)this.customConfig=false;this.allow(b,"config",1);this.allow(a.config.extraAllowedContent,"extra",1);this.allow(G[a.enterMode]+" "+G[a.shiftEnterMode],"default",1);this.disallow(a.config.disallowedContent)}}else{this.customConfig=false;this.allow(a,"default",1)}};CKEDITOR.filter.instances={};CKEDITOR.filter.prototype={allow:function(b,c,e){if(!d(this,b,e))return false;var f,p;if(typeof b=="string")b=
|
||||
m(b);else if(b instanceof CKEDITOR.style){if(b.toAllowedContentRules)return this.allow(b.toAllowedContentRules(this.editor),c,e);f=b.getDefinition();b={};e=f.attributes;b[f.element]=f={styles:f.styles,requiredStyles:f.styles&&CKEDITOR.tools.objectKeys(f.styles)};if(e){e=K(e);f.classes=e["class"]?e["class"].split(/\s+/):null;f.requiredClasses=f.classes;delete e["class"];f.attributes=e;f.requiredAttributes=e&&CKEDITOR.tools.objectKeys(e)}}else if(CKEDITOR.tools.isArray(b)){for(f=0;f<b.length;++f)p=
|
||||
this.allow(b[f],c,e);return p}a(this,b,c,this.allowedContent,this._.allowedRules);return true},applyTo:function(a,b,c,d){if(this.disabled)return false;var e=this,f=[],p=this.editor&&this.editor.config.protectedSource,r,x=false,h={doFilter:!c,doTransform:true,doCallbacks:true,toHtml:b};a.forEach(function(a){if(a.type==CKEDITOR.NODE_ELEMENT){if(a.attributes["data-cke-filter"]=="off")return false;if(!b||!(a.name=="span"&&~CKEDITOR.tools.objectKeys(a.attributes).join("|").indexOf("data-cke-"))){r=w(e,
|
||||
a,f,h);if(r&F)x=true;else if(r&2)return false}}else if(a.type==CKEDITOR.NODE_COMMENT&&a.value.match(/^\{cke_protected\}(?!\{C\})/)){var c;a:{var d=decodeURIComponent(a.value.replace(/^\{cke_protected\}/,""));c=[];var i,l,n;if(p)for(l=0;l<p.length;++l)if((n=d.match(p[l]))&&n[0].length==d.length){c=true;break a}d=CKEDITOR.htmlParser.fragment.fromHtml(d);d.children.length==1&&(i=d.children[0]).type==CKEDITOR.NODE_ELEMENT&&w(e,i,c,h);c=!c.length}c||f.push(a)}},null,true);f.length&&(x=true);for(var n,
|
||||
a=[],d=G[d||(this.editor?this.editor.enterMode:CKEDITOR.ENTER_P)],q;c=f.pop();)c.type==CKEDITOR.NODE_ELEMENT?l(c,d,a):c.remove();for(;n=a.pop();){c=n.el;if(c.parent){q=L[c.parent.name]||L.span;switch(n.check){case "it":L.$removeEmpty[c.name]&&!c.children.length?l(c,d,a):i(c)||l(c,d,a);break;case "el-up":c.parent.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT&&!q[c.name]&&l(c,d,a);break;case "parent-down":c.parent.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT&&!q[c.name]&&l(c.parent,d,a)}}}return x},checkFeature:function(a){if(this.disabled||
|
||||
!a)return true;a.toFeature&&(a=a.toFeature(this.editor));return!a.requiredContent||this.check(a.requiredContent)},disable:function(){this.disabled=true},disallow:function(b){if(!d(this,b,true))return false;typeof b=="string"&&(b=m(b));a(this,b,null,this.disallowedContent,this._.disallowedRules);return true},addContentForms:function(a){if(!this.disabled&&a){var b,c,d=[],e;for(b=0;b<a.length&&!e;++b){c=a[b];if((typeof c=="string"||c instanceof CKEDITOR.style)&&this.check(c))e=c}if(e){for(b=0;b<a.length;++b)d.push(n(a[b],
|
||||
e));this.addTransformations(d)}}},addElementCallback:function(a){if(!this.elementCallbacks)this.elementCallbacks=[];this.elementCallbacks.push(a)},addFeature:function(a){if(this.disabled||!a)return true;a.toFeature&&(a=a.toFeature(this.editor));this.allow(a.allowedContent,a.name);this.addTransformations(a.contentTransformations);this.addContentForms(a.contentForms);return a.requiredContent&&(this.customConfig||this.disallowedContent.length)?this.check(a.requiredContent):true},addTransformations:function(a){var b,
|
||||
c;if(!this.disabled&&a){var d=this._.transformations,e;for(e=0;e<a.length;++e){b=a[e];var f=void 0,p=void 0,i=void 0,l=void 0,r=void 0,x=void 0;c=[];for(p=0;p<b.length;++p){i=b[p];if(typeof i=="string"){i=i.split(/\s*:\s*/);l=i[0];r=null;x=i[1]}else{l=i.check;r=i.left;x=i.right}if(!f){f=i;f=f.element?f.element:l?l.match(/^([a-z0-9]+)/i)[0]:f.left.getDefinition().element}r instanceof CKEDITOR.style&&(r=P(r));c.push({check:l==f?null:l,left:r,right:typeof x=="string"?C(x):x})}b=f;d[b]||(d[b]=[]);d[b].push(c)}}},
|
||||
check:function(a,b,c){if(this.disabled)return true;if(CKEDITOR.tools.isArray(a)){for(var d=a.length;d--;)if(this.check(a[d],b,c))return true;return false}var e,f;if(typeof a=="string"){f=a+"<"+(b===false?"0":"1")+(c?"1":"0")+">";if(f in this._.cachedChecks)return this._.cachedChecks[f];d=m(a).$1;e=d.styles;var i=d.classes;d.name=d.elements;d.classes=i=i?i.split(/\s*,\s*/):[];d.styles=g(e);d.attributes=g(d.attributes);d.children=[];i.length&&(d.attributes["class"]=i.join(" "));if(e)d.attributes.style=
|
||||
CKEDITOR.tools.writeCssText(d.styles);e=d}else{d=a.getDefinition();e=d.styles;i=d.attributes||{};if(e){e=K(e);i.style=CKEDITOR.tools.writeCssText(e,true)}else e={};e={name:d.element,attributes:i,classes:i["class"]?i["class"].split(/\s+/):[],styles:e,children:[]}}var i=CKEDITOR.tools.clone(e),l=[],r;if(b!==false&&(r=this._.transformations[e.name])){for(d=0;d<r.length;++d)p(this,e,r[d]);t(e)}w(this,i,l,{doFilter:true,doTransform:b!==false,skipRequired:!c,skipFinalValidation:!c});b=l.length>0?false:
|
||||
CKEDITOR.tools.objectCompare(e.attributes,i.attributes,true)?true:false;typeof a=="string"&&(this._.cachedChecks[f]=b);return b},getAllowedEnterMode:function(){var a=["p","div","br"],b={p:CKEDITOR.ENTER_P,div:CKEDITOR.ENTER_DIV,br:CKEDITOR.ENTER_BR};return function(c,d){var e=a.slice(),f;if(this.check(G[c]))return c;for(d||(e=e.reverse());f=e.pop();)if(this.check(f))return b[f];return CKEDITOR.ENTER_BR}}(),destroy:function(){delete CKEDITOR.filter.instances[this.id];delete this._;delete this.allowedContent;
|
||||
delete this.disallowedContent}};var z={styles:1,attributes:1,classes:1},B={styles:"requiredStyles",attributes:"requiredAttributes",classes:"requiredClasses"},x=/^([a-z0-9\-*\s]+)((?:\s*\{[!\w\-,\s\*]+\}\s*|\s*\[[!\w\-,\s\*]+\]\s*|\s*\([!\w\-,\s\*]+\)\s*){0,3})(?:;\s*|$)/i,E={styles:/{([^}]+)}/,attrs:/\[([^\]]+)\]/,classes:/\(([^\)]+)\)/},$=/^cke:(object|embed|param)$/,aa=/^(object|embed|param)$/,ba=CKEDITOR.filter.transformationsTools={sizeToStyle:function(a){this.lengthToStyle(a,"width");this.lengthToStyle(a,
|
||||
"height")},sizeToAttribute:function(a){this.lengthToAttribute(a,"width");this.lengthToAttribute(a,"height")},lengthToStyle:function(a,b,c){c=c||b;if(!(c in a.styles)){var d=a.attributes[b];if(d){/^\d+$/.test(d)&&(d=d+"px");a.styles[c]=d}}delete a.attributes[b]},lengthToAttribute:function(a,b,c){c=c||b;if(!(c in a.attributes)){var d=a.styles[b],e=d&&d.match(/^(\d+)(?:\.\d*)?px$/);e?a.attributes[c]=e[1]:d==v&&(a.attributes[c]=v)}delete a.styles[b]},alignmentToStyle:function(a){if(!("float"in a.styles)){var b=
|
||||
a.attributes.align;if(b=="left"||b=="right")a.styles["float"]=b}delete a.attributes.align},alignmentToAttribute:function(a){if(!("align"in a.attributes)){var b=a.styles["float"];if(b=="left"||b=="right")a.attributes.align=b}delete a.styles["float"]},matchesStyle:r,transform:function(a,b){if(typeof b=="string")a.name=b;else{var c=b.getDefinition(),d=c.styles,e=c.attributes,f,i,p,l;a.name=c.element;for(f in e)if(f=="class"){c=a.classes.join("|");for(p=e[f].split(/\s+/);l=p.pop();)c.indexOf(l)==-1&&
|
||||
a.classes.push(l)}else a.attributes[f]=e[f];for(i in d)a.styles[i]=d[i]}}}})();
|
||||
(function(){CKEDITOR.focusManager=function(a){if(a.focusManager)return a.focusManager;this.hasFocus=false;this.currentActive=null;this._={editor:a};return this};CKEDITOR.focusManager._={blurDelay:200};CKEDITOR.focusManager.prototype={focus:function(a){this._.timer&&clearTimeout(this._.timer);if(a)this.currentActive=a;if(!this.hasFocus&&!this._.locked){(a=CKEDITOR.currentInstance)&&a.focusManager.blur(1);this.hasFocus=true;(a=this._.editor.container)&&a.addClass("cke_focus");this._.editor.fire("focus")}},
|
||||
lock:function(){this._.locked=1},unlock:function(){delete this._.locked},blur:function(a){function f(){if(this.hasFocus){this.hasFocus=false;var a=this._.editor.container;a&&a.removeClass("cke_focus");this._.editor.fire("blur")}}if(!this._.locked){this._.timer&&clearTimeout(this._.timer);var b=CKEDITOR.focusManager._.blurDelay;a||!b?f.call(this):this._.timer=CKEDITOR.tools.setTimeout(function(){delete this._.timer;f.call(this)},b,this)}},add:function(a,f){var b=a.getCustomData("focusmanager");if(!b||
|
||||
b!=this){b&&b.remove(a);var b="focus",c="blur";if(f)if(CKEDITOR.env.ie){b="focusin";c="focusout"}else CKEDITOR.event.useCapture=1;var e={blur:function(){a.equals(this.currentActive)&&this.blur()},focus:function(){this.focus(a)}};a.on(b,e.focus,this);a.on(c,e.blur,this);if(f)CKEDITOR.event.useCapture=0;a.setCustomData("focusmanager",this);a.setCustomData("focusmanager_handlers",e)}},remove:function(a){a.removeCustomData("focusmanager");var f=a.removeCustomData("focusmanager_handlers");a.removeListener("blur",
|
||||
f.blur);a.removeListener("focus",f.focus)}}})();CKEDITOR.keystrokeHandler=function(a){if(a.keystrokeHandler)return a.keystrokeHandler;this.keystrokes={};this.blockedKeystrokes={};this._={editor:a};return this};
|
||||
(function(){var a,f=function(b){var b=b.data,e=b.getKeystroke(),d=this.keystrokes[e],f=this._.editor;a=f.fire("key",{keyCode:e,domEvent:b})===false;if(!a){d&&(a=f.execCommand(d,{from:"keystrokeHandler"})!==false);a||(a=!!this.blockedKeystrokes[e])}a&&b.preventDefault(true);return!a},b=function(b){if(a){a=false;b.data.preventDefault(true)}};CKEDITOR.keystrokeHandler.prototype={attach:function(a){a.on("keydown",f,this);if(CKEDITOR.env.gecko&&CKEDITOR.env.mac)a.on("keypress",b,this)}}})();
|
||||
(function(){CKEDITOR.lang={languages:{af:1,ar:1,bg:1,bn:1,bs:1,ca:1,cs:1,cy:1,da:1,de:1,el:1,"en-au":1,"en-ca":1,"en-gb":1,en:1,eo:1,es:1,et:1,eu:1,fa:1,fi:1,fo:1,"fr-ca":1,fr:1,gl:1,gu:1,he:1,hi:1,hr:1,hu:1,id:1,is:1,it:1,ja:1,ka:1,km:1,ko:1,ku:1,lt:1,lv:1,mk:1,mn:1,ms:1,nb:1,nl:1,no:1,pl:1,"pt-br":1,pt:1,ro:1,ru:1,si:1,sk:1,sl:1,sq:1,"sr-latn":1,sr:1,sv:1,th:1,tr:1,tt:1,ug:1,uk:1,vi:1,"zh-cn":1,zh:1},rtl:{ar:1,fa:1,he:1,ku:1,ug:1},load:function(a,f,b){if(!a||!CKEDITOR.lang.languages[a])a=this.detect(f,
|
||||
a);var c=this,f=function(){c[a].dir=c.rtl[a]?"rtl":"ltr";b(a,c[a])};this[a]?f():CKEDITOR.scriptLoader.load(CKEDITOR.getUrl("lang/"+a+".js"),f,this)},detect:function(a,f){var b=this.languages,f=f||navigator.userLanguage||navigator.language||a,c=f.toLowerCase().match(/([a-z]+)(?:-([a-z]+))?/),e=c[1],c=c[2];b[e+"-"+c]?e=e+"-"+c:b[e]||(e=null);CKEDITOR.lang.detect=e?function(){return e}:function(a){return a};return e||a}}})();
|
||||
CKEDITOR.scriptLoader=function(){var a={},f={};return{load:function(b,c,e,d){var h=typeof b=="string";h&&(b=[b]);e||(e=CKEDITOR);var k=b.length,j=[],g=[],m=function(a){c&&(h?c.call(e,a):c.call(e,j,g))};if(k===0)m(true);else{var y=function(a,b){(b?j:g).push(a);if(--k<=0){d&&CKEDITOR.document.getDocumentElement().removeStyle("cursor");m(b)}},s=function(b,c){a[b]=1;var d=f[b];delete f[b];for(var e=0;e<d.length;e++)d[e](b,c)},w=function(b){if(a[b])y(b,true);else{var d=f[b]||(f[b]=[]);d.push(y);if(!(d.length>
|
||||
1)){var e=new CKEDITOR.dom.element("script");e.setAttributes({type:"text/javascript",src:b});if(c)if(CKEDITOR.env.ie&&CKEDITOR.env.version<11)e.$.onreadystatechange=function(){if(e.$.readyState=="loaded"||e.$.readyState=="complete"){e.$.onreadystatechange=null;s(b,true)}};else{e.$.onload=function(){setTimeout(function(){s(b,true)},0)};e.$.onerror=function(){s(b,false)}}e.appendTo(CKEDITOR.document.getHead())}}};d&&CKEDITOR.document.getDocumentElement().setStyle("cursor","wait");for(var q=0;q<k;q++)w(b[q])}},
|
||||
queue:function(){function a(){var b;(b=c[0])&&this.load(b.scriptUrl,b.callback,CKEDITOR,0)}var c=[];return function(e,d){var f=this;c.push({scriptUrl:e,callback:function(){d&&d.apply(this,arguments);c.shift();a.call(f)}});c.length==1&&a.call(this)}}()}}();CKEDITOR.resourceManager=function(a,f){this.basePath=a;this.fileName=f;this.registered={};this.loaded={};this.externals={};this._={waitingList:{}}};
|
||||
CKEDITOR.resourceManager.prototype={add:function(a,f){if(this.registered[a])throw'[CKEDITOR.resourceManager.add] The resource name "'+a+'" is already registered.';var b=this.registered[a]=f||{};b.name=a;b.path=this.getPath(a);CKEDITOR.fire(a+CKEDITOR.tools.capitalize(this.fileName)+"Ready",b);return this.get(a)},get:function(a){return this.registered[a]||null},getPath:function(a){var f=this.externals[a];return CKEDITOR.getUrl(f&&f.dir||this.basePath+a+"/")},getFilePath:function(a){var f=this.externals[a];
|
||||
return CKEDITOR.getUrl(this.getPath(a)+(f?f.file:this.fileName+".js"))},addExternal:function(a,f,b){for(var a=a.split(","),c=0;c<a.length;c++){var e=a[c];b||(f=f.replace(/[^\/]+$/,function(a){b=a;return""}));this.externals[e]={dir:f,file:b||this.fileName+".js"}}},load:function(a,f,b){CKEDITOR.tools.isArray(a)||(a=a?[a]:[]);for(var c=this.loaded,e=this.registered,d=[],h={},k={},j=0;j<a.length;j++){var g=a[j];if(g)if(!c[g]&&!e[g]){var m=this.getFilePath(g);d.push(m);m in h||(h[m]=[]);h[m].push(g)}else k[g]=
|
||||
this.get(g)}CKEDITOR.scriptLoader.load(d,function(a,d){if(d.length)throw'[CKEDITOR.resourceManager.load] Resource name "'+h[d[0]].join(",")+'" was not found at "'+d[0]+'".';for(var e=0;e<a.length;e++)for(var q=h[a[e]],g=0;g<q.length;g++){var i=q[g];k[i]=this.get(i);c[i]=1}f.call(b,k)},this)}};CKEDITOR.plugins=new CKEDITOR.resourceManager("plugins/","plugin");
|
||||
CKEDITOR.plugins.load=CKEDITOR.tools.override(CKEDITOR.plugins.load,function(a){var f={};return function(b,c,e){var d={},h=function(b){a.call(this,b,function(a){CKEDITOR.tools.extend(d,a);var b=[],m;for(m in a){var k=a[m],s=k&&k.requires;if(!f[m]){if(k.icons)for(var w=k.icons.split(","),q=w.length;q--;)CKEDITOR.skin.addIcon(w[q],k.path+"icons/"+(CKEDITOR.env.hidpi&&k.hidpi?"hidpi/":"")+w[q]+".png");f[m]=1}if(s){s.split&&(s=s.split(","));for(k=0;k<s.length;k++)d[s[k]]||b.push(s[k])}}if(b.length)h.call(this,
|
||||
b);else{for(m in d){k=d[m];if(k.onLoad&&!k.onLoad._called){k.onLoad()===false&&delete d[m];k.onLoad._called=1}}c&&c.call(e||window,d)}},this)};h.call(this,b)}});CKEDITOR.plugins.setLang=function(a,f,b){var c=this.get(a),a=c.langEntries||(c.langEntries={}),c=c.lang||(c.lang=[]);c.split&&(c=c.split(","));CKEDITOR.tools.indexOf(c,f)==-1&&c.push(f);a[f]=b};CKEDITOR.ui=function(a){if(a.ui)return a.ui;this.items={};this.instances={};this.editor=a;this._={handlers:{}};return this};
|
||||
CKEDITOR.ui.prototype={add:function(a,f,b){b.name=a.toLowerCase();var c=this.items[a]={type:f,command:b.command||null,args:Array.prototype.slice.call(arguments,2)};CKEDITOR.tools.extend(c,b)},get:function(a){return this.instances[a]},create:function(a){var f=this.items[a],b=f&&this._.handlers[f.type],c=f&&f.command&&this.editor.getCommand(f.command),b=b&&b.create.apply(this,f.args);this.instances[a]=b;c&&c.uiItems.push(b);if(b&&!b.type)b.type=f.type;return b},addHandler:function(a,f){this._.handlers[a]=
|
||||
f},space:function(a){return CKEDITOR.document.getById(this.spaceId(a))},spaceId:function(a){return this.editor.id+"_"+a}};CKEDITOR.event.implementOn(CKEDITOR.ui);
|
||||
(function(){function a(a,c,d){CKEDITOR.event.call(this);a=a&&CKEDITOR.tools.clone(a);if(c!==void 0){if(c instanceof CKEDITOR.dom.element){if(!d)throw Error("One of the element modes must be specified.");}else throw Error("Expect element of type CKEDITOR.dom.element.");if(CKEDITOR.env.ie&&CKEDITOR.env.quirks&&d==CKEDITOR.ELEMENT_MODE_INLINE)throw Error("Inline element mode is not supported on IE quirks.");if(!(d==CKEDITOR.ELEMENT_MODE_INLINE?c.is(CKEDITOR.dtd.$editable)||c.is("textarea"):d==CKEDITOR.ELEMENT_MODE_REPLACE?
|
||||
!c.is(CKEDITOR.dtd.$nonBodyContent):1))throw Error('The specified element mode is not supported on element: "'+c.getName()+'".');this.element=c;this.elementMode=d;this.name=this.elementMode!=CKEDITOR.ELEMENT_MODE_APPENDTO&&(c.getId()||c.getNameAtt())}else this.elementMode=CKEDITOR.ELEMENT_MODE_NONE;this._={};this.commands={};this.templates={};this.name=this.name||f();this.id=CKEDITOR.tools.getNextId();this.status="unloaded";this.config=CKEDITOR.tools.prototypedCopy(CKEDITOR.config);this.ui=new CKEDITOR.ui(this);
|
||||
this.focusManager=new CKEDITOR.focusManager(this);this.keystrokeHandler=new CKEDITOR.keystrokeHandler(this);this.on("readOnly",b);this.on("selectionChange",function(a){e(this,a.data.path)});this.on("activeFilterChange",function(){e(this,this.elementPath(),true)});this.on("mode",b);this.on("instanceReady",function(){this.config.startupFocus&&this.focus()});CKEDITOR.fire("instanceCreated",null,this);CKEDITOR.add(this);CKEDITOR.tools.setTimeout(function(){h(this,a)},0,this)}function f(){do var a="editor"+
|
||||
++s;while(CKEDITOR.instances[a]);return a}function b(){var a=this.commands,b;for(b in a)c(this,a[b])}function c(a,b){b[b.startDisabled?"disable":a.readOnly&&!b.readOnly?"disable":b.modes[a.mode]?"enable":"disable"]()}function e(a,b,c){if(b){var d,e,f=a.commands;for(e in f){d=f[e];(c||d.contextSensitive)&&d.refresh(a,b)}}}function d(a){var b=a.config.customConfig;if(!b)return false;var b=CKEDITOR.getUrl(b),c=w[b]||(w[b]={});if(c.fn){c.fn.call(a,a.config);(CKEDITOR.getUrl(a.config.customConfig)==b||
|
||||
!d(a))&&a.fireOnce("customConfigLoaded")}else CKEDITOR.scriptLoader.queue(b,function(){c.fn=CKEDITOR.editorConfig?CKEDITOR.editorConfig:function(){};d(a)});return true}function h(a,b){a.on("customConfigLoaded",function(){if(b){if(b.on)for(var c in b.on)a.on(c,b.on[c]);CKEDITOR.tools.extend(a.config,b,true);delete a.config.on}c=a.config;a.readOnly=!(!c.readOnly&&!(a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?a.element.is("textarea")?a.element.hasAttribute("disabled"):a.element.isReadOnly():a.elementMode==
|
||||
CKEDITOR.ELEMENT_MODE_REPLACE&&a.element.hasAttribute("disabled")));a.blockless=a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?!(a.element.is("textarea")||CKEDITOR.dtd[a.element.getName()].p):false;a.tabIndex=c.tabIndex||a.element&&a.element.getAttribute("tabindex")||0;a.activeEnterMode=a.enterMode=a.blockless?CKEDITOR.ENTER_BR:c.enterMode;a.activeShiftEnterMode=a.shiftEnterMode=a.blockless?CKEDITOR.ENTER_BR:c.shiftEnterMode;if(c.skin)CKEDITOR.skinName=c.skin;a.fireOnce("configLoaded");a.dataProcessor=
|
||||
new CKEDITOR.htmlDataProcessor(a);a.filter=a.activeFilter=new CKEDITOR.filter(a);k(a)});if(b&&b.customConfig!=null)a.config.customConfig=b.customConfig;d(a)||a.fireOnce("customConfigLoaded")}function k(a){CKEDITOR.skin.loadPart("editor",function(){j(a)})}function j(a){CKEDITOR.lang.load(a.config.language,a.config.defaultLanguage,function(b,c){var d=a.config.title;a.langCode=b;a.lang=CKEDITOR.tools.prototypedCopy(c);a.title=typeof d=="string"||d===false?d:[a.lang.editor,a.name].join(", ");if(!a.config.contentsLangDirection)a.config.contentsLangDirection=
|
||||
a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?a.element.getDirection(1):a.lang.dir;a.fire("langLoaded");g(a)})}function g(a){a.getStylesSet(function(b){a.once("loaded",function(){a.fire("stylesSet",{styles:b})},null,null,1);m(a)})}function m(a){var b=a.config,c=b.plugins,d=b.extraPlugins,e=b.removePlugins;if(d)var f=RegExp("(?:^|,)(?:"+d.replace(/\s*,\s*/g,"|")+")(?=,|$)","g"),c=c.replace(f,""),c=c+(","+d);if(e)var l=RegExp("(?:^|,)(?:"+e.replace(/\s*,\s*/g,"|")+")(?=,|$)","g"),c=c.replace(l,"");CKEDITOR.env.air&&
|
||||
(c=c+",adobeair");CKEDITOR.plugins.load(c.split(","),function(c){var d=[],e=[],f=[];a.plugins=c;for(var i in c){var h=c[i],g=h.lang,o=null,A=h.requires,v;CKEDITOR.tools.isArray(A)&&(A=A.join(","));if(A&&(v=A.match(l)))for(;A=v.pop();)CKEDITOR.tools.setTimeout(function(a,b){throw Error('Plugin "'+a.replace(",","")+'" cannot be removed from the plugins list, because it\'s required by "'+b+'" plugin.');},0,null,[A,i]);if(g&&!a.lang[i]){g.split&&(g=g.split(","));if(CKEDITOR.tools.indexOf(g,a.langCode)>=
|
||||
0)o=a.langCode;else{o=a.langCode.replace(/-.*/,"");o=o!=a.langCode&&CKEDITOR.tools.indexOf(g,o)>=0?o:CKEDITOR.tools.indexOf(g,"en")>=0?"en":g[0]}if(!h.langEntries||!h.langEntries[o])f.push(CKEDITOR.getUrl(h.path+"lang/"+o+".js"));else{a.lang[i]=h.langEntries[o];o=null}}e.push(o);d.push(h)}CKEDITOR.scriptLoader.load(f,function(){for(var c=["beforeInit","init","afterInit"],f=0;f<c.length;f++)for(var p=0;p<d.length;p++){var i=d[p];f===0&&(e[p]&&i.lang&&i.langEntries)&&(a.lang[i.name]=i.langEntries[e[p]]);
|
||||
if(i[c[f]])i[c[f]](a)}a.fireOnce("pluginsLoaded");b.keystrokes&&a.setKeystroke(a.config.keystrokes);for(p=0;p<a.config.blockedKeystrokes.length;p++)a.keystrokeHandler.blockedKeystrokes[a.config.blockedKeystrokes[p]]=1;a.status="loaded";a.fireOnce("loaded");CKEDITOR.fire("instanceLoaded",null,a)})})}function y(){var a=this.element;if(a&&this.elementMode!=CKEDITOR.ELEMENT_MODE_APPENDTO){var b=this.getData();this.config.htmlEncodeOutput&&(b=CKEDITOR.tools.htmlEncode(b));a.is("textarea")?a.setValue(b):
|
||||
a.setHtml(b);return true}return false}a.prototype=CKEDITOR.editor.prototype;CKEDITOR.editor=a;var s=0,w={};CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{addCommand:function(a,b){b.name=a.toLowerCase();var d=new CKEDITOR.command(this,b);this.mode&&c(this,d);return this.commands[a]=d},_attachToForm:function(){function a(d){b.updateElement();b._.required&&(!c.getValue()&&b.fire("required")===false)&&d.data.preventDefault()}var b=this,c=b.element,d=new CKEDITOR.dom.element(c.$.form);if(c.is("textarea")&&
|
||||
d){d.on("submit",a);if(d.$.submit&&d.$.submit.call&&d.$.submit.apply)d.$.submit=CKEDITOR.tools.override(d.$.submit,function(b){return function(){a();b.apply?b.apply(this):b()}});b.on("destroy",function(){d.removeListener("submit",a)})}},destroy:function(a){this.fire("beforeDestroy");!a&&y.call(this);this.editable(null);this.filter.destroy();delete this.filter;delete this.activeFilter;this.status="destroyed";this.fire("destroy");this.removeAllListeners();CKEDITOR.remove(this);CKEDITOR.fire("instanceDestroyed",
|
||||
null,this)},elementPath:function(a){if(!a){a=this.getSelection();if(!a)return null;a=a.getStartElement()}return a?new CKEDITOR.dom.elementPath(a,this.editable()):null},createRange:function(){var a=this.editable();return a?new CKEDITOR.dom.range(a):null},execCommand:function(a,b){var c=this.getCommand(a),d={name:a,commandData:b,command:c};if(c&&c.state!=CKEDITOR.TRISTATE_DISABLED&&this.fire("beforeCommandExec",d)!==false){d.returnValue=c.exec(d.commandData);if(!c.async&&this.fire("afterCommandExec",
|
||||
d)!==false)return d.returnValue}return false},getCommand:function(a){return this.commands[a]},getData:function(a){!a&&this.fire("beforeGetData");var b=this._.data;if(typeof b!="string")b=(b=this.element)&&this.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE?b.is("textarea")?b.getValue():b.getHtml():"";b={dataValue:b};!a&&this.fire("getData",b);return b.dataValue},getSnapshot:function(){var a=this.fire("getSnapshot");if(typeof a!="string"){var b=this.element;b&&this.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE&&
|
||||
(a=b.is("textarea")?b.getValue():b.getHtml())}return a},loadSnapshot:function(a){this.fire("loadSnapshot",a)},setData:function(a,b,c){var d=true,e=b;if(b&&typeof b=="object"){c=b.internal;e=b.callback;d=!b.noSnapshot}!c&&d&&this.fire("saveSnapshot");if(e||!c)this.once("dataReady",function(a){!c&&d&&this.fire("saveSnapshot");e&&e.call(a.editor)});a={dataValue:a};!c&&this.fire("setData",a);this._.data=a.dataValue;!c&&this.fire("afterSetData",a)},setReadOnly:function(a){a=a==null||a;if(this.readOnly!=
|
||||
a){this.readOnly=a;this.keystrokeHandler.blockedKeystrokes[8]=+a;this.editable().setReadOnly(a);this.fire("readOnly")}},insertHtml:function(a,b){this.fire("insertHtml",{dataValue:a,mode:b})},insertText:function(a){this.fire("insertText",a)},insertElement:function(a){this.fire("insertElement",a)},focus:function(){this.fire("beforeFocus")},checkDirty:function(){return this.status=="ready"&&this._.previousValue!==this.getSnapshot()},resetDirty:function(){this._.previousValue=this.getSnapshot()},updateElement:function(){return y.call(this)},
|
||||
setKeystroke:function(){for(var a=this.keystrokeHandler.keystrokes,b=CKEDITOR.tools.isArray(arguments[0])?arguments[0]:[[].slice.call(arguments,0)],c,d,e=b.length;e--;){c=b[e];d=0;if(CKEDITOR.tools.isArray(c)){d=c[1];c=c[0]}d?a[c]=d:delete a[c]}},addFeature:function(a){return this.filter.addFeature(a)},setActiveFilter:function(a){if(!a)a=this.filter;if(this.activeFilter!==a){this.activeFilter=a;this.fire("activeFilterChange");a===this.filter?this.setActiveEnterMode(null,null):this.setActiveEnterMode(a.getAllowedEnterMode(this.enterMode),
|
||||
a.getAllowedEnterMode(this.shiftEnterMode,true))}},setActiveEnterMode:function(a,b){a=a?this.blockless?CKEDITOR.ENTER_BR:a:this.enterMode;b=b?this.blockless?CKEDITOR.ENTER_BR:b:this.shiftEnterMode;if(this.activeEnterMode!=a||this.activeShiftEnterMode!=b){this.activeEnterMode=a;this.activeShiftEnterMode=b;this.fire("activeEnterModeChange")}}})})();CKEDITOR.ELEMENT_MODE_NONE=0;CKEDITOR.ELEMENT_MODE_REPLACE=1;CKEDITOR.ELEMENT_MODE_APPENDTO=2;CKEDITOR.ELEMENT_MODE_INLINE=3;
|
||||
CKEDITOR.htmlParser=function(){this._={htmlPartsRegex:/<(?:(?:\/([^>]+)>)|(?:!--([\S|\s]*?)--\>)|(?:([^\/\s>]+)((?:\s+[\w\-:.]+(?:\s*=\s*?(?:(?:"[^"]*")|(?:'[^']*')|[^\s"'\/>]+))?)*)[\S\s]*?(\/?)>))/g}};
|
||||
(function(){var a=/([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g,f={checked:1,compact:1,declare:1,defer:1,disabled:1,ismap:1,multiple:1,nohref:1,noresize:1,noshade:1,nowrap:1,readonly:1,selected:1};CKEDITOR.htmlParser.prototype={onTagOpen:function(){},onTagClose:function(){},onText:function(){},onCDATA:function(){},onComment:function(){},parse:function(b){for(var c,e,d=0,h;c=this._.htmlPartsRegex.exec(b);){e=c.index;if(e>d){d=b.substring(d,e);if(h)h.push(d);else this.onText(d)}d=
|
||||
this._.htmlPartsRegex.lastIndex;if(e=c[1]){e=e.toLowerCase();if(h&&CKEDITOR.dtd.$cdata[e]){this.onCDATA(h.join(""));h=null}if(!h){this.onTagClose(e);continue}}if(h)h.push(c[0]);else if(e=c[3]){e=e.toLowerCase();if(!/="/.test(e)){var k={},j,g=c[4];c=!!c[5];if(g)for(;j=a.exec(g);){var m=j[1].toLowerCase();j=j[2]||j[3]||j[4]||"";k[m]=!j&&f[m]?m:CKEDITOR.tools.htmlDecodeAttr(j)}this.onTagOpen(e,k,c);!h&&CKEDITOR.dtd.$cdata[e]&&(h=[])}}else if(e=c[2])this.onComment(e)}if(b.length>d)this.onText(b.substring(d,
|
||||
b.length))}}})();
|
||||
CKEDITOR.htmlParser.basicWriter=CKEDITOR.tools.createClass({$:function(){this._={output:[]}},proto:{openTag:function(a){this._.output.push("<",a)},openTagClose:function(a,f){f?this._.output.push(" />"):this._.output.push(">")},attribute:function(a,f){typeof f=="string"&&(f=CKEDITOR.tools.htmlEncodeAttr(f));this._.output.push(" ",a,'="',f,'"')},closeTag:function(a){this._.output.push("</",a,">")},text:function(a){this._.output.push(a)},comment:function(a){this._.output.push("<\!--",a,"--\>")},write:function(a){this._.output.push(a)},
|
||||
reset:function(){this._.output=[];this._.indent=false},getHtml:function(a){var f=this._.output.join("");a&&this.reset();return f}}});"use strict";
|
||||
(function(){CKEDITOR.htmlParser.node=function(){};CKEDITOR.htmlParser.node.prototype={remove:function(){var a=this.parent.children,f=CKEDITOR.tools.indexOf(a,this),b=this.previous,c=this.next;b&&(b.next=c);c&&(c.previous=b);a.splice(f,1);this.parent=null},replaceWith:function(a){var f=this.parent.children,b=CKEDITOR.tools.indexOf(f,this),c=a.previous=this.previous,e=a.next=this.next;c&&(c.next=a);e&&(e.previous=a);f[b]=a;a.parent=this.parent;this.parent=null},insertAfter:function(a){var f=a.parent.children,
|
||||
b=CKEDITOR.tools.indexOf(f,a),c=a.next;f.splice(b+1,0,this);this.next=a.next;this.previous=a;a.next=this;c&&(c.previous=this);this.parent=a.parent},insertBefore:function(a){var f=a.parent.children,b=CKEDITOR.tools.indexOf(f,a);f.splice(b,0,this);this.next=a;(this.previous=a.previous)&&(a.previous.next=this);a.previous=this;this.parent=a.parent},getAscendant:function(a){var f=typeof a=="function"?a:typeof a=="string"?function(b){return b.name==a}:function(b){return b.name in a},b=this.parent;for(;b&&
|
||||
b.type==CKEDITOR.NODE_ELEMENT;){if(f(b))return b;b=b.parent}return null},wrapWith:function(a){this.replaceWith(a);a.add(this);return a},getIndex:function(){return CKEDITOR.tools.indexOf(this.parent.children,this)},getFilterContext:function(a){return a||{}}}})();"use strict";CKEDITOR.htmlParser.comment=function(a){this.value=a;this._={isBlockLike:false}};
|
||||
CKEDITOR.htmlParser.comment.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_COMMENT,filter:function(a,f){var b=this.value;if(!(b=a.onComment(f,b,this))){this.remove();return false}if(typeof b!="string"){this.replaceWith(b);return false}this.value=b;return true},writeHtml:function(a,f){f&&this.filter(f);a.comment(this.value)}});"use strict";
|
||||
(function(){CKEDITOR.htmlParser.text=function(a){this.value=a;this._={isBlockLike:false}};CKEDITOR.htmlParser.text.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_TEXT,filter:function(a,f){if(!(this.value=a.onText(f,this.value,this))){this.remove();return false}},writeHtml:function(a,f){f&&this.filter(f);a.text(this.value)}})})();"use strict";
|
||||
(function(){CKEDITOR.htmlParser.cdata=function(a){this.value=a};CKEDITOR.htmlParser.cdata.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_TEXT,filter:function(){},writeHtml:function(a){a.write(this.value)}})})();"use strict";CKEDITOR.htmlParser.fragment=function(){this.children=[];this.parent=null;this._={isBlockLike:true,hasInlineStarted:false}};
|
||||
(function(){function a(a){return a.attributes["data-cke-survive"]?false:a.name=="a"&&a.attributes.href||CKEDITOR.dtd.$removeEmpty[a.name]}var f=CKEDITOR.tools.extend({table:1,ul:1,ol:1,dl:1},CKEDITOR.dtd.table,CKEDITOR.dtd.ul,CKEDITOR.dtd.ol,CKEDITOR.dtd.dl),b={ol:1,ul:1},c=CKEDITOR.tools.extend({},{html:1},CKEDITOR.dtd.html,CKEDITOR.dtd.body,CKEDITOR.dtd.head,{style:1,script:1}),e={ul:"li",ol:"li",dl:"dd",table:"tbody",tbody:"tr",thead:"tr",tfoot:"tr",tr:"td"};CKEDITOR.htmlParser.fragment.fromHtml=
|
||||
function(d,h,k){function j(a){var b;if(i.length>0)for(var c=0;c<i.length;c++){var d=i[c],e=d.name,f=CKEDITOR.dtd[e],l=u.name&&CKEDITOR.dtd[u.name];if((!l||l[e])&&(!a||!f||f[a]||!CKEDITOR.dtd[a])){if(!b){g();b=1}d=d.clone();d.parent=u;u=d;i.splice(c,1);c--}else if(e==u.name){y(u,u.parent,1);c--}}}function g(){for(;A.length;)y(A.shift(),u)}function m(a){if(a._.isBlockLike&&a.name!="pre"&&a.name!="textarea"){var b=a.children.length,c=a.children[b-1],d;if(c&&c.type==CKEDITOR.NODE_TEXT)(d=CKEDITOR.tools.rtrim(c.value))?
|
||||
c.value=d:a.children.length=b-1}}function y(b,c,d){var c=c||u||t,e=u;if(b.previous===void 0){if(s(c,b)){u=c;q.onTagOpen(k,{});b.returnPoint=c=u}m(b);(!a(b)||b.children.length)&&c.add(b);b.name=="pre"&&(l=false);b.name=="textarea"&&(o=false)}if(b.returnPoint){u=b.returnPoint;delete b.returnPoint}else u=d?c:e}function s(a,b){if((a==t||a.name=="body")&&k&&(!a.name||CKEDITOR.dtd[a.name][k])){var c,d;return(c=b.attributes&&(d=b.attributes["data-cke-real-element-type"])?d:b.name)&&c in CKEDITOR.dtd.$inline&&
|
||||
!(c in CKEDITOR.dtd.head)&&!b.isOrphan||b.type==CKEDITOR.NODE_TEXT}}function w(a,b){return a in CKEDITOR.dtd.$listItem||a in CKEDITOR.dtd.$tableContent?a==b||a=="dt"&&b=="dd"||a=="dd"&&b=="dt":false}var q=new CKEDITOR.htmlParser,t=h instanceof CKEDITOR.htmlParser.element?h:typeof h=="string"?new CKEDITOR.htmlParser.element(h):new CKEDITOR.htmlParser.fragment,i=[],A=[],u=t,o=t.name=="textarea",l=t.name=="pre";q.onTagOpen=function(d,e,h,m){e=new CKEDITOR.htmlParser.element(d,e);if(e.isUnknown&&h)e.isEmpty=
|
||||
true;e.isOptionalClose=m;if(a(e))i.push(e);else{if(d=="pre")l=true;else{if(d=="br"&&l){u.add(new CKEDITOR.htmlParser.text("\n"));return}d=="textarea"&&(o=true)}if(d=="br")A.push(e);else{for(;;){m=(h=u.name)?CKEDITOR.dtd[h]||(u._.isBlockLike?CKEDITOR.dtd.div:CKEDITOR.dtd.span):c;if(!e.isUnknown&&!u.isUnknown&&!m[d])if(u.isOptionalClose)q.onTagClose(h);else if(d in b&&h in b){h=u.children;(h=h[h.length-1])&&h.name=="li"||y(h=new CKEDITOR.htmlParser.element("li"),u);!e.returnPoint&&(e.returnPoint=u);
|
||||
u=h}else if(d in CKEDITOR.dtd.$listItem&&!w(d,h))q.onTagOpen(d=="li"?"ul":"dl",{},0,1);else if(h in f&&!w(d,h)){!e.returnPoint&&(e.returnPoint=u);u=u.parent}else{h in CKEDITOR.dtd.$inline&&i.unshift(u);if(u.parent)y(u,u.parent,1);else{e.isOrphan=1;break}}else break}j(d);g();e.parent=u;e.isEmpty?y(e):u=e}}};q.onTagClose=function(a){for(var b=i.length-1;b>=0;b--)if(a==i[b].name){i.splice(b,1);return}for(var c=[],d=[],e=u;e!=t&&e.name!=a;){e._.isBlockLike||d.unshift(e);c.push(e);e=e.returnPoint||e.parent}if(e!=
|
||||
t){for(b=0;b<c.length;b++){var f=c[b];y(f,f.parent)}u=e;e._.isBlockLike&&g();y(e,e.parent);if(e==u)u=u.parent;i=i.concat(d)}a=="body"&&(k=false)};q.onText=function(a){if((!u._.hasInlineStarted||A.length)&&!l&&!o){a=CKEDITOR.tools.ltrim(a);if(a.length===0)return}var b=u.name,d=b?CKEDITOR.dtd[b]||(u._.isBlockLike?CKEDITOR.dtd.div:CKEDITOR.dtd.span):c;if(!o&&!d["#"]&&b in f){q.onTagOpen(e[b]||"");q.onText(a)}else{g();j();!l&&!o&&(a=a.replace(/[\t\r\n ]{2,}|[\t\r\n]/g," "));a=new CKEDITOR.htmlParser.text(a);
|
||||
if(s(u,a))this.onTagOpen(k,{},0,1);u.add(a)}};q.onCDATA=function(a){u.add(new CKEDITOR.htmlParser.cdata(a))};q.onComment=function(a){g();j();u.add(new CKEDITOR.htmlParser.comment(a))};q.parse(d);for(g();u!=t;)y(u,u.parent,1);m(t);return t};CKEDITOR.htmlParser.fragment.prototype={type:CKEDITOR.NODE_DOCUMENT_FRAGMENT,add:function(a,b){isNaN(b)&&(b=this.children.length);var c=b>0?this.children[b-1]:null;if(c){if(a._.isBlockLike&&c.type==CKEDITOR.NODE_TEXT){c.value=CKEDITOR.tools.rtrim(c.value);if(c.value.length===
|
||||
0){this.children.pop();this.add(a);return}}c.next=a}a.previous=c;a.parent=this;this.children.splice(b,0,a);if(!this._.hasInlineStarted)this._.hasInlineStarted=a.type==CKEDITOR.NODE_TEXT||a.type==CKEDITOR.NODE_ELEMENT&&!a._.isBlockLike},filter:function(a,b){b=this.getFilterContext(b);a.onRoot(b,this);this.filterChildren(a,false,b)},filterChildren:function(a,b,c){if(this.childrenFilteredBy!=a.id){c=this.getFilterContext(c);if(b&&!this.parent)a.onRoot(c,this);this.childrenFilteredBy=a.id;for(b=0;b<this.children.length;b++)this.children[b].filter(a,
|
||||
c)===false&&b--}},writeHtml:function(a,b){b&&this.filter(b);this.writeChildrenHtml(a)},writeChildrenHtml:function(a,b,c){var e=this.getFilterContext();if(c&&!this.parent&&b)b.onRoot(e,this);b&&this.filterChildren(b,false,e);b=0;c=this.children;for(e=c.length;b<e;b++)c[b].writeHtml(a)},forEach:function(a,b,c){if(!c&&(!b||this.type==b))var e=a(this);if(e!==false)for(var c=this.children,f=0;f<c.length;f++){e=c[f];e.type==CKEDITOR.NODE_ELEMENT?e.forEach(a,b):(!b||e.type==b)&&a(e)}},getFilterContext:function(a){return a||
|
||||
{}}}})();"use strict";
|
||||
(function(){function a(){this.rules=[]}function f(b,c,e,d){var f,k;for(f in c){(k=b[f])||(k=b[f]=new a);k.add(c[f],e,d)}}CKEDITOR.htmlParser.filter=CKEDITOR.tools.createClass({$:function(b){this.id=CKEDITOR.tools.getNextNumber();this.elementNameRules=new a;this.attributeNameRules=new a;this.elementsRules={};this.attributesRules={};this.textRules=new a;this.commentRules=new a;this.rootRules=new a;b&&this.addRules(b,10)},proto:{addRules:function(a,c){var e;if(typeof c=="number")e=c;else if(c&&"priority"in
|
||||
c)e=c.priority;typeof e!="number"&&(e=10);typeof c!="object"&&(c={});a.elementNames&&this.elementNameRules.addMany(a.elementNames,e,c);a.attributeNames&&this.attributeNameRules.addMany(a.attributeNames,e,c);a.elements&&f(this.elementsRules,a.elements,e,c);a.attributes&&f(this.attributesRules,a.attributes,e,c);a.text&&this.textRules.add(a.text,e,c);a.comment&&this.commentRules.add(a.comment,e,c);a.root&&this.rootRules.add(a.root,e,c)},applyTo:function(a){a.filter(this)},onElementName:function(a,c){return this.elementNameRules.execOnName(a,
|
||||
c)},onAttributeName:function(a,c){return this.attributeNameRules.execOnName(a,c)},onText:function(a,c,e){return this.textRules.exec(a,c,e)},onComment:function(a,c,e){return this.commentRules.exec(a,c,e)},onRoot:function(a,c){return this.rootRules.exec(a,c)},onElement:function(a,c){for(var e=[this.elementsRules["^"],this.elementsRules[c.name],this.elementsRules.$],d,f=0;f<3;f++)if(d=e[f]){d=d.exec(a,c,this);if(d===false)return null;if(d&&d!=c)return this.onNode(a,d);if(c.parent&&!c.name)break}return c},
|
||||
onNode:function(a,c){var e=c.type;return e==CKEDITOR.NODE_ELEMENT?this.onElement(a,c):e==CKEDITOR.NODE_TEXT?new CKEDITOR.htmlParser.text(this.onText(a,c.value)):e==CKEDITOR.NODE_COMMENT?new CKEDITOR.htmlParser.comment(this.onComment(a,c.value)):null},onAttribute:function(a,c,e,d){return(e=this.attributesRules[e])?e.exec(a,d,c,this):d}}});CKEDITOR.htmlParser.filterRulesGroup=a;a.prototype={add:function(a,c,e){this.rules.splice(this.findIndex(c),0,{value:a,priority:c,options:e})},addMany:function(a,
|
||||
c,e){for(var d=[this.findIndex(c),0],f=0,k=a.length;f<k;f++)d.push({value:a[f],priority:c,options:e});this.rules.splice.apply(this.rules,d)},findIndex:function(a){for(var c=this.rules,e=c.length-1;e>=0&&a<c[e].priority;)e--;return e+1},exec:function(a,c){var e=c instanceof CKEDITOR.htmlParser.node||c instanceof CKEDITOR.htmlParser.fragment,d=Array.prototype.slice.call(arguments,1),f=this.rules,k=f.length,j,g,m,y;for(y=0;y<k;y++){if(e){j=c.type;g=c.name}m=f[y];if(!(a.nonEditable&&!m.options.applyToAll||
|
||||
a.nestedEditable&&m.options.excludeNestedEditable)){m=m.value.apply(null,d);if(m===false||e&&m&&(m.name!=g||m.type!=j))return m;m!=null&&(d[0]=c=m)}}return c},execOnName:function(a,c){for(var e=0,d=this.rules,f=d.length,k;c&&e<f;e++){k=d[e];!(a.nonEditable&&!k.options.applyToAll||a.nestedEditable&&k.options.excludeNestedEditable)&&(c=c.replace(k.value[0],k.value[1]))}return c}}})();
|
||||
(function(){function a(a,f){function p(a){return a||CKEDITOR.env.needsNbspFiller?new CKEDITOR.htmlParser.text(" "):new CKEDITOR.htmlParser.element("br",{"data-cke-bogus":1})}function r(a,e){return function(f){if(f.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT){var i=[],l=b(f),x,r;if(l)for(v(l,1)&&i.push(l);l;){if(d(l)&&(x=c(l))&&v(x))if((r=c(x))&&!d(r))i.push(x);else{p(g).insertAfter(x);x.remove()}l=l.previous}for(l=0;l<i.length;l++)i[l].remove();if(i=!a||(typeof e=="function"?e(f):e)!==false)if(!g&&!CKEDITOR.env.needsBrFiller&&
|
||||
f.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT)i=false;else if(!g&&!CKEDITOR.env.needsBrFiller&&(document.documentMode>7||f.name in CKEDITOR.dtd.tr||f.name in CKEDITOR.dtd.$listItem))i=false;else{i=b(f);i=!i||f.name=="form"&&i.name=="input"}i&&f.add(p(a))}}}function v(a,b){if((!g||CKEDITOR.env.needsBrFiller)&&a.type==CKEDITOR.NODE_ELEMENT&&a.name=="br"&&!a.attributes["data-cke-eol"])return true;var c;if(a.type==CKEDITOR.NODE_TEXT&&(c=a.value.match(i))){if(c.index){(new CKEDITOR.htmlParser.text(a.value.substring(0,
|
||||
c.index))).insertBefore(a);a.value=c[0]}if(!CKEDITOR.env.needsBrFiller&&g&&(!b||a.parent.name in z))return true;if(!g)if((c=a.previous)&&c.name=="br"||!c||d(c))return true}return false}var n={elements:{}},g=f=="html",z=CKEDITOR.tools.extend({},l),o;for(o in z)"#"in u[o]||delete z[o];for(o in z)n.elements[o]=r(g,a.config.fillEmptyBlocks);n.root=r(g,false);n.elements.br=function(a){return function(b){if(b.parent.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT){var f=b.attributes;if("data-cke-bogus"in f||"data-cke-eol"in
|
||||
f)delete f["data-cke-bogus"];else{for(f=b.next;f&&e(f);)f=f.next;var i=c(b);!f&&d(b.parent)?h(b.parent,p(a)):d(f)&&(i&&!d(i))&&p(a).insertBefore(f)}}}}(g);return n}function f(a,b){return a!=CKEDITOR.ENTER_BR&&b!==false?a==CKEDITOR.ENTER_DIV?"div":"p":false}function b(a){for(a=a.children[a.children.length-1];a&&e(a);)a=a.previous;return a}function c(a){for(a=a.previous;a&&e(a);)a=a.previous;return a}function e(a){return a.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.trim(a.value)||a.type==CKEDITOR.NODE_ELEMENT&&
|
||||
a.attributes["data-cke-bookmark"]}function d(a){return a&&(a.type==CKEDITOR.NODE_ELEMENT&&a.name in l||a.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT)}function h(a,b){var c=a.children[a.children.length-1];a.children.push(b);b.parent=a;if(c){c.next=b;b.previous=c}}function k(a){a=a.attributes;a.contenteditable!="false"&&(a["data-cke-editable"]=a.contenteditable?"true":1);a.contenteditable="false"}function j(a){a=a.attributes;switch(a["data-cke-editable"]){case "true":a.contenteditable="true";break;case "1":delete a.contenteditable}}
|
||||
function g(a){return a.replace(C,function(a,b,c){return"<"+b+c.replace(L,function(a,b){return F.test(b)&&c.indexOf("data-cke-saved-"+b)==-1?" data-cke-saved-"+a+" data-cke-"+CKEDITOR.rnd+"-"+a:a})+">"})}function m(a,b){return a.replace(b,function(a,b,c){a.indexOf("<textarea")===0&&(a=b+w(c).replace(/</g,"<").replace(/>/g,">")+"</textarea>");return"<cke:encoded>"+encodeURIComponent(a)+"</cke:encoded>"})}function y(a){return a.replace(v,function(a,b){return decodeURIComponent(b)})}function s(a){return a.replace(/<\!--(?!{cke_protected})[\s\S]+?--\>/g,
|
||||
function(a){return"<\!--"+A+"{C}"+encodeURIComponent(a).replace(/--/g,"%2D%2D")+"--\>"})}function w(a){return a.replace(/<\!--\{cke_protected\}\{C\}([\s\S]+?)--\>/g,function(a,b){return decodeURIComponent(b)})}function q(a,b){var c=b._.dataStore;return a.replace(/<\!--\{cke_protected\}([\s\S]+?)--\>/g,function(a,b){return decodeURIComponent(b)}).replace(/\{cke_protected_(\d+)\}/g,function(a,b){return c&&c[b]||""})}function t(a,b){for(var c=[],d=b.config.protectedSource,e=b._.dataStore||(b._.dataStore=
|
||||
{id:1}),f=/<\!--\{cke_temp(comment)?\}(\d*?)--\>/g,d=[/<script[\s\S]*?<\/script>/gi,/<noscript[\s\S]*?<\/noscript>/gi,/<meta[\s\S]*?\/?>/gi].concat(d),a=a.replace(/<\!--[\s\S]*?--\>/g,function(a){return"<\!--{cke_tempcomment}"+(c.push(a)-1)+"--\>"}),i=0;i<d.length;i++)a=a.replace(d[i],function(a){a=a.replace(f,function(a,b,d){return c[d]});return/cke_temp(comment)?/.test(a)?a:"<\!--{cke_temp}"+(c.push(a)-1)+"--\>"});a=a.replace(f,function(a,b,d){return"<\!--"+A+(b?"{C}":"")+encodeURIComponent(c[d]).replace(/--/g,
|
||||
"%2D%2D")+"--\>"});a=a.replace(/<\w+(?:\s+(?:(?:[^\s=>]+\s*=\s*(?:[^'"\s>]+|'[^']*'|"[^"]*"))|[^\s=>]+))+\s*>/g,function(a){return a.replace(/<\!--\{cke_protected\}([^>]*)--\>/g,function(a,b){e[e.id]=decodeURIComponent(b);return"{cke_protected_"+e.id++ +"}"})});return a=a.replace(/<(title|iframe|textarea)([^>]*)>([\s\S]*?)<\/\1>/g,function(a,c,d,e){return"<"+c+d+">"+q(w(e),b)+"</"+c+">"})}CKEDITOR.htmlDataProcessor=function(b){var c,d,e=this;this.editor=b;this.dataFilter=c=new CKEDITOR.htmlParser.filter;
|
||||
this.htmlFilter=d=new CKEDITOR.htmlParser.filter;this.writer=new CKEDITOR.htmlParser.basicWriter;c.addRules(p);c.addRules(r,{applyToAll:true});c.addRules(a(b,"data"),{applyToAll:true});d.addRules(n);d.addRules(P,{applyToAll:true});d.addRules(a(b,"html"),{applyToAll:true});b.on("toHtml",function(a){var a=a.data,c=a.dataValue,d,c=t(c,b),c=m(c,I),c=g(c),c=m(c,K),c=c.replace(G,"$1cke:$2"),c=c.replace(B,"<cke:$1$2></cke:$1>"),c=c.replace(/(<pre\b[^>]*>)(\r\n|\n)/g,"$1$2$2"),c=c.replace(/([^a-z0-9<\-])(on\w{3,})(?!>)/gi,
|
||||
"$1data-cke-"+CKEDITOR.rnd+"-$2");d=a.context||b.editable().getName();var e;if(CKEDITOR.env.ie&&CKEDITOR.env.version<9&&d=="pre"){d="div";c="<pre>"+c+"</pre>";e=1}d=b.document.createElement(d);d.setHtml("a"+c);c=d.getHtml().substr(1);c=c.replace(RegExp("data-cke-"+CKEDITOR.rnd+"-","ig"),"");e&&(c=c.replace(/^<pre>|<\/pre>$/gi,""));c=c.replace(z,"$1$2");c=y(c);c=w(c);d=a.fixForBody===false?false:f(a.enterMode,b.config.autoParagraph);c=CKEDITOR.htmlParser.fragment.fromHtml(c,a.context,d);if(d){e=c;
|
||||
if(!e.children.length&&CKEDITOR.dtd[e.name][d]){d=new CKEDITOR.htmlParser.element(d);e.add(d)}}a.dataValue=c},null,null,5);b.on("toHtml",function(a){a.data.filter.applyTo(a.data.dataValue,true,a.data.dontFilter,a.data.enterMode)&&b.fire("dataFiltered")},null,null,6);b.on("toHtml",function(a){a.data.dataValue.filterChildren(e.dataFilter,true)},null,null,10);b.on("toHtml",function(a){var a=a.data,b=a.dataValue,c=new CKEDITOR.htmlParser.basicWriter;b.writeChildrenHtml(c);b=c.getHtml(true);a.dataValue=
|
||||
s(b)},null,null,15);b.on("toDataFormat",function(a){var c=a.data.dataValue;a.data.enterMode!=CKEDITOR.ENTER_BR&&(c=c.replace(/^<br *\/?>/i,""));a.data.dataValue=CKEDITOR.htmlParser.fragment.fromHtml(c,a.data.context,f(a.data.enterMode,b.config.autoParagraph))},null,null,5);b.on("toDataFormat",function(a){a.data.dataValue.filterChildren(e.htmlFilter,true)},null,null,10);b.on("toDataFormat",function(a){a.data.filter.applyTo(a.data.dataValue,false,true)},null,null,11);b.on("toDataFormat",function(a){var c=
|
||||
a.data.dataValue,d=e.writer;d.reset();c.writeChildrenHtml(d);c=d.getHtml(true);c=w(c);c=q(c,b);a.data.dataValue=c},null,null,15)};CKEDITOR.htmlDataProcessor.prototype={toHtml:function(a,b,c,d){var e=this.editor,f,i,l;if(b&&typeof b=="object"){f=b.context;c=b.fixForBody;d=b.dontFilter;i=b.filter;l=b.enterMode}else f=b;!f&&f!==null&&(f=e.editable().getName());return e.fire("toHtml",{dataValue:a,context:f,fixForBody:c,dontFilter:d,filter:i||e.filter,enterMode:l||e.enterMode}).dataValue},toDataFormat:function(a,
|
||||
b){var c,d,e;if(b){c=b.context;d=b.filter;e=b.enterMode}!c&&c!==null&&(c=this.editor.editable().getName());return this.editor.fire("toDataFormat",{dataValue:a,filter:d||this.editor.filter,context:c,enterMode:e||this.editor.enterMode}).dataValue}};var i=/(?: |\xa0)$/,A="{cke_protected}",u=CKEDITOR.dtd,o=["caption","colgroup","col","thead","tfoot","tbody"],l=CKEDITOR.tools.extend({},u.$blockLimit,u.$block),p={elements:{input:k,textarea:k}},r={attributeNames:[[/^on/,"data-cke-pa-on"],[/^data-cke-expando$/,
|
||||
""]]},n={elements:{embed:function(a){var b=a.parent;if(b&&b.name=="object"){var c=b.attributes.width,b=b.attributes.height;if(c)a.attributes.width=c;if(b)a.attributes.height=b}},a:function(a){if(!a.children.length&&!a.attributes.name&&!a.attributes["data-cke-saved-name"])return false}}},P={elementNames:[[/^cke:/,""],[/^\?xml:namespace$/,""]],attributeNames:[[/^data-cke-(saved|pa)-/,""],[/^data-cke-.*/,""],["hidefocus",""]],elements:{$:function(a){var b=a.attributes;if(b){if(b["data-cke-temp"])return false;
|
||||
for(var c=["name","href","src"],d,e=0;e<c.length;e++){d="data-cke-saved-"+c[e];d in b&&delete b[c[e]]}}return a},table:function(a){a.children.slice(0).sort(function(a,b){var c,d;if(a.type==CKEDITOR.NODE_ELEMENT&&b.type==a.type){c=CKEDITOR.tools.indexOf(o,a.name);d=CKEDITOR.tools.indexOf(o,b.name)}if(!(c>-1&&d>-1&&c!=d)){c=a.parent?a.getIndex():-1;d=b.parent?b.getIndex():-1}return c>d?1:-1})},param:function(a){a.children=[];a.isEmpty=true;return a},span:function(a){a.attributes["class"]=="Apple-style-span"&&
|
||||
delete a.name},html:function(a){delete a.attributes.contenteditable;delete a.attributes["class"]},body:function(a){delete a.attributes.spellcheck;delete a.attributes.contenteditable},style:function(a){var b=a.children[0];if(b&&b.value)b.value=CKEDITOR.tools.trim(b.value);if(!a.attributes.type)a.attributes.type="text/css"},title:function(a){var b=a.children[0];!b&&h(a,b=new CKEDITOR.htmlParser.text);b.value=a.attributes["data-cke-title"]||""},input:j,textarea:j},attributes:{"class":function(a){return CKEDITOR.tools.ltrim(a.replace(/(?:^|\s+)cke_[^\s]*/g,
|
||||
""))||false}}};if(CKEDITOR.env.ie)P.attributes.style=function(a){return a.replace(/(^|;)([^\:]+)/g,function(a){return a.toLowerCase()})};var C=/<(a|area|img|input|source)\b([^>]*)>/gi,L=/([\w-]+)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi,F=/^(href|src|name)$/i,K=/(?:<style(?=[ >])[^>]*>[\s\S]*?<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,I=/(<textarea(?=[ >])[^>]*>)([\s\S]*?)(?:<\/textarea>)/gi,v=/<cke:encoded>([^<]*)<\/cke:encoded>/gi,G=/(<\/?)((?:object|embed|param|html|body|head|title)[^>]*>)/gi,
|
||||
z=/(<\/?)cke:((?:html|body|head|title)[^>]*>)/gi,B=/<cke:(param|embed)([^>]*?)\/?>(?!\s*<\/cke:\1)/gi})();"use strict";
|
||||
CKEDITOR.htmlParser.element=function(a,f){this.name=a;this.attributes=f||{};this.children=[];var b=a||"",c=b.match(/^cke:(.*)/);c&&(b=c[1]);b=!(!CKEDITOR.dtd.$nonBodyContent[b]&&!CKEDITOR.dtd.$block[b]&&!CKEDITOR.dtd.$listItem[b]&&!CKEDITOR.dtd.$tableContent[b]&&!(CKEDITOR.dtd.$nonEditable[b]||b=="br"));this.isEmpty=!!CKEDITOR.dtd.$empty[a];this.isUnknown=!CKEDITOR.dtd[a];this._={isBlockLike:b,hasInlineStarted:this.isEmpty||!b}};
|
||||
CKEDITOR.htmlParser.cssStyle=function(a){var f={};((a instanceof CKEDITOR.htmlParser.element?a.attributes.style:a)||"").replace(/"/g,'"').replace(/\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g,function(a,c,e){c=="font-family"&&(e=e.replace(/["']/g,""));f[c.toLowerCase()]=e});return{rules:f,populate:function(a){var c=this.toString();if(c)a instanceof CKEDITOR.dom.element?a.setAttribute("style",c):a instanceof CKEDITOR.htmlParser.element?a.attributes.style=c:a.style=c},toString:function(){var a=[],c;
|
||||
for(c in f)f[c]&&a.push(c,":",f[c],";");return a.join("")}}};
|
||||
(function(){function a(a){return function(b){return b.type==CKEDITOR.NODE_ELEMENT&&(typeof a=="string"?b.name==a:b.name in a)}}var f=function(a,b){a=a[0];b=b[0];return a<b?-1:a>b?1:0},b=CKEDITOR.htmlParser.fragment.prototype;CKEDITOR.htmlParser.element.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_ELEMENT,add:b.add,clone:function(){return new CKEDITOR.htmlParser.element(this.name,this.attributes)},filter:function(a,b){var d=this,f,k,b=d.getFilterContext(b);if(b.off)return true;
|
||||
if(!d.parent)a.onRoot(b,d);for(;;){f=d.name;if(!(k=a.onElementName(b,f))){this.remove();return false}d.name=k;if(!(d=a.onElement(b,d))){this.remove();return false}if(d!==this){this.replaceWith(d);return false}if(d.name==f)break;if(d.type!=CKEDITOR.NODE_ELEMENT){this.replaceWith(d);return false}if(!d.name){this.replaceWithChildren();return false}}f=d.attributes;var j,g;for(j in f){g=j;for(k=f[j];;)if(g=a.onAttributeName(b,j))if(g!=j){delete f[j];j=g}else break;else{delete f[j];break}g&&((k=a.onAttribute(b,
|
||||
d,g,k))===false?delete f[g]:f[g]=k)}d.isEmpty||this.filterChildren(a,false,b);return true},filterChildren:b.filterChildren,writeHtml:function(a,b){b&&this.filter(b);var d=this.name,h=[],k=this.attributes,j,g;a.openTag(d,k);for(j in k)h.push([j,k[j]]);a.sortAttributes&&h.sort(f);j=0;for(g=h.length;j<g;j++){k=h[j];a.attribute(k[0],k[1])}a.openTagClose(d,this.isEmpty);this.writeChildrenHtml(a);this.isEmpty||a.closeTag(d)},writeChildrenHtml:b.writeChildrenHtml,replaceWithChildren:function(){for(var a=
|
||||
this.children,b=a.length;b;)a[--b].insertAfter(this);this.remove()},forEach:b.forEach,getFirst:function(b){if(!b)return this.children.length?this.children[0]:null;typeof b!="function"&&(b=a(b));for(var e=0,d=this.children.length;e<d;++e)if(b(this.children[e]))return this.children[e];return null},getHtml:function(){var a=new CKEDITOR.htmlParser.basicWriter;this.writeChildrenHtml(a);return a.getHtml()},setHtml:function(a){for(var a=this.children=CKEDITOR.htmlParser.fragment.fromHtml(a).children,b=0,
|
||||
d=a.length;b<d;++b)a[b].parent=this},getOuterHtml:function(){var a=new CKEDITOR.htmlParser.basicWriter;this.writeHtml(a);return a.getHtml()},split:function(a){for(var b=this.children.splice(a,this.children.length-a),d=this.clone(),f=0;f<b.length;++f)b[f].parent=d;d.children=b;if(b[0])b[0].previous=null;if(a>0)this.children[a-1].next=null;this.parent.add(d,this.getIndex()+1);return d},addClass:function(a){if(!this.hasClass(a)){var b=this.attributes["class"]||"";this.attributes["class"]=b+(b?" ":"")+
|
||||
a}},removeClass:function(a){var b=this.attributes["class"];if(b)(b=CKEDITOR.tools.trim(b.replace(RegExp("(?:\\s+|^)"+a+"(?:\\s+|$)")," ")))?this.attributes["class"]=b:delete this.attributes["class"]},hasClass:function(a){var b=this.attributes["class"];return!b?false:RegExp("(?:^|\\s)"+a+"(?=\\s|$)").test(b)},getFilterContext:function(a){var b=[];a||(a={off:false,nonEditable:false,nestedEditable:false});!a.off&&this.attributes["data-cke-processor"]=="off"&&b.push("off",true);!a.nonEditable&&this.attributes.contenteditable==
|
||||
"false"?b.push("nonEditable",true):a.nonEditable&&(!a.nestedEditable&&this.attributes.contenteditable=="true")&&b.push("nestedEditable",true);if(b.length)for(var a=CKEDITOR.tools.copy(a),d=0;d<b.length;d=d+2)a[b[d]]=b[d+1];return a}},true)})();
|
||||
(function(){var a={},f=/{([^}]+)}/g,b=/([\\'])/g,c=/\n/g,e=/\r/g;CKEDITOR.template=function(d){if(a[d])this.output=a[d];else{var h=d.replace(b,"\\$1").replace(c,"\\n").replace(e,"\\r").replace(f,function(a,b){return"',data['"+b+"']==undefined?'{"+b+"}':data['"+b+"'],'"});this.output=a[d]=Function("data","buffer","return buffer?buffer.push('"+h+"'):['"+h+"'].join('');")}}})();delete CKEDITOR.loadFullCore;CKEDITOR.instances={};CKEDITOR.document=new CKEDITOR.dom.document(document);
|
||||
CKEDITOR.add=function(a){CKEDITOR.instances[a.name]=a;a.on("focus",function(){if(CKEDITOR.currentInstance!=a){CKEDITOR.currentInstance=a;CKEDITOR.fire("currentInstance")}});a.on("blur",function(){if(CKEDITOR.currentInstance==a){CKEDITOR.currentInstance=null;CKEDITOR.fire("currentInstance")}});CKEDITOR.fire("instance",null,a)};CKEDITOR.remove=function(a){delete CKEDITOR.instances[a.name]};
|
||||
(function(){var a={};CKEDITOR.addTemplate=function(f,b){var c=a[f];if(c)return c;c={name:f,source:b};CKEDITOR.fire("template",c);return a[f]=new CKEDITOR.template(c.source)};CKEDITOR.getTemplate=function(f){return a[f]}})();(function(){var a=[];CKEDITOR.addCss=function(f){a.push(f)};CKEDITOR.getCss=function(){return a.join("\n")}})();CKEDITOR.on("instanceDestroyed",function(){CKEDITOR.tools.isEmpty(this.instances)&&CKEDITOR.fire("reset")});CKEDITOR.TRISTATE_ON=1;CKEDITOR.TRISTATE_OFF=2;
|
||||
CKEDITOR.TRISTATE_DISABLED=0;
|
||||
(function(){CKEDITOR.inline=function(a,f){if(!CKEDITOR.env.isCompatible)return null;a=CKEDITOR.dom.element.get(a);if(a.getEditor())throw'The editor instance "'+a.getEditor().name+'" is already attached to the provided element.';var b=new CKEDITOR.editor(f,a,CKEDITOR.ELEMENT_MODE_INLINE),c=a.is("textarea")?a:null;if(c){b.setData(c.getValue(),null,true);a=CKEDITOR.dom.element.createFromHtml('<div contenteditable="'+!!b.readOnly+'" class="cke_textarea_inline">'+c.getValue()+"</div>",CKEDITOR.document);
|
||||
a.insertAfter(c);c.hide();c.$.form&&b._attachToForm()}else b.setData(a.getHtml(),null,true);b.on("loaded",function(){b.fire("uiReady");b.editable(a);b.container=a;b.setData(b.getData(1));b.resetDirty();b.fire("contentDom");b.mode="wysiwyg";b.fire("mode");b.status="ready";b.fireOnce("instanceReady");CKEDITOR.fire("instanceReady",null,b)},null,null,1E4);b.on("destroy",function(){if(c){b.container.clearCustomData();b.container.remove();c.show()}b.element.clearCustomData();delete b.element});return b};
|
||||
CKEDITOR.inlineAll=function(){var a,f,b;for(b in CKEDITOR.dtd.$editable)for(var c=CKEDITOR.document.getElementsByTag(b),e=0,d=c.count();e<d;e++){a=c.getItem(e);if(a.getAttribute("contenteditable")=="true"){f={element:a,config:{}};CKEDITOR.fire("inline",f)!==false&&CKEDITOR.inline(a,f.config)}}};CKEDITOR.domReady(function(){!CKEDITOR.disableAutoInline&&CKEDITOR.inlineAll()})})();CKEDITOR.replaceClass="ckeditor";
|
||||
(function(){function a(a,e,d,h){if(!CKEDITOR.env.isCompatible)return null;a=CKEDITOR.dom.element.get(a);if(a.getEditor())throw'The editor instance "'+a.getEditor().name+'" is already attached to the provided element.';var k=new CKEDITOR.editor(e,a,h);if(h==CKEDITOR.ELEMENT_MODE_REPLACE){a.setStyle("visibility","hidden");k._.required=a.hasAttribute("required");a.removeAttribute("required")}d&&k.setData(d,null,true);k.on("loaded",function(){b(k);h==CKEDITOR.ELEMENT_MODE_REPLACE&&(k.config.autoUpdateElement&&
|
||||
a.$.form)&&k._attachToForm();k.setMode(k.config.startupMode,function(){k.resetDirty();k.status="ready";k.fireOnce("instanceReady");CKEDITOR.fire("instanceReady",null,k)})});k.on("destroy",f);return k}function f(){var a=this.container,b=this.element;if(a){a.clearCustomData();a.remove()}if(b){b.clearCustomData();if(this.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE){b.show();this._.required&&b.setAttribute("required","required")}delete this.element}}function b(a){var b=a.name,d=a.element,f=a.elementMode,
|
||||
k=a.fire("uiSpace",{space:"top",html:""}).html,j=a.fire("uiSpace",{space:"bottom",html:""}).html,g=new CKEDITOR.template('<{outerEl} id="cke_{name}" class="{id} cke cke_reset cke_chrome cke_editor_{name} cke_{langDir} '+CKEDITOR.env.cssClass+'" dir="{langDir}" lang="{langCode}" role="application"'+(a.title?' aria-labelledby="cke_{name}_arialbl"':"")+">"+(a.title?'<span id="cke_{name}_arialbl" class="cke_voice_label">{voiceLabel}</span>':"")+'<{outerEl} class="cke_inner cke_reset" role="presentation">{topHtml}<{outerEl} id="{contentId}" class="cke_contents cke_reset" role="presentation"></{outerEl}>{bottomHtml}</{outerEl}></{outerEl}>'),
|
||||
b=CKEDITOR.dom.element.createFromHtml(g.output({id:a.id,name:b,langDir:a.lang.dir,langCode:a.langCode,voiceLabel:a.title,topHtml:k?'<span id="'+a.ui.spaceId("top")+'" class="cke_top cke_reset_all" role="presentation" style="height:auto">'+k+"</span>":"",contentId:a.ui.spaceId("contents"),bottomHtml:j?'<span id="'+a.ui.spaceId("bottom")+'" class="cke_bottom cke_reset_all" role="presentation">'+j+"</span>":"",outerEl:CKEDITOR.env.ie?"span":"div"}));if(f==CKEDITOR.ELEMENT_MODE_REPLACE){d.hide();b.insertAfter(d)}else d.append(b);
|
||||
a.container=b;k&&a.ui.space("top").unselectable();j&&a.ui.space("bottom").unselectable();d=a.config.width;f=a.config.height;d&&b.setStyle("width",CKEDITOR.tools.cssLength(d));f&&a.ui.space("contents").setStyle("height",CKEDITOR.tools.cssLength(f));b.disableContextMenu();CKEDITOR.env.webkit&&b.on("focus",function(){a.focus()});a.fireOnce("uiReady")}CKEDITOR.replace=function(b,e){return a(b,e,null,CKEDITOR.ELEMENT_MODE_REPLACE)};CKEDITOR.appendTo=function(b,e,d){return a(b,e,d,CKEDITOR.ELEMENT_MODE_APPENDTO)};
|
||||
CKEDITOR.replaceAll=function(){for(var a=document.getElementsByTagName("textarea"),b=0;b<a.length;b++){var d=null,f=a[b];if(f.name||f.id){if(typeof arguments[0]=="string"){if(!RegExp("(?:^|\\s)"+arguments[0]+"(?:$|\\s)").test(f.className))continue}else if(typeof arguments[0]=="function"){d={};if(arguments[0](f,d)===false)continue}this.replace(f,d)}}};CKEDITOR.editor.prototype.addMode=function(a,b){(this._.modes||(this._.modes={}))[a]=b};CKEDITOR.editor.prototype.setMode=function(a,b){var d=this,f=
|
||||
this._.modes;if(!(a==d.mode||!f||!f[a])){d.fire("beforeSetMode",a);if(d.mode){var k=d.checkDirty(),f=d._.previousModeData,j,g=0;d.fire("beforeModeUnload");d.editable(0);d._.previousMode=d.mode;d._.previousModeData=j=d.getData(1);if(d.mode=="source"&&f==j){d.fire("lockSnapshot",{forceUpdate:true});g=1}d.ui.space("contents").setHtml("");d.mode=""}else d._.previousModeData=d.getData(1);this._.modes[a](function(){d.mode=a;k!==void 0&&!k&&d.resetDirty();g?d.fire("unlockSnapshot"):a=="wysiwyg"&&d.fire("saveSnapshot");
|
||||
setTimeout(function(){d.fire("mode");b&&b.call(d)},0)})}};CKEDITOR.editor.prototype.resize=function(a,b,d,f){var k=this.container,j=this.ui.space("contents"),g=CKEDITOR.env.webkit&&this.document&&this.document.getWindow().$.frameElement,f=f?this.container.getFirst(function(a){return a.type==CKEDITOR.NODE_ELEMENT&&a.hasClass("cke_inner")}):k;f.setSize("width",a,true);g&&(g.style.width="1%");j.setStyle("height",Math.max(b-(d?0:(f.$.offsetHeight||0)-(j.$.clientHeight||0)),0)+"px");g&&(g.style.width=
|
||||
"100%");this.fire("resize")};CKEDITOR.editor.prototype.getResizable=function(a){return a?this.ui.space("contents"):this.container};CKEDITOR.domReady(function(){CKEDITOR.replaceClass&&CKEDITOR.replaceAll(CKEDITOR.replaceClass)})})();CKEDITOR.config.startupMode="wysiwyg";
|
||||
(function(){function a(a){var b=a.editor,d=a.data.path,e=d.blockLimit,l=a.data.selection,p=l.getRanges()[0],r;if(CKEDITOR.env.gecko||CKEDITOR.env.ie&&CKEDITOR.env.needsBrFiller)if(l=f(l,d)){l.appendBogus();r=CKEDITOR.env.ie}if(h(b,d.block,e)&&p.collapsed&&!p.getCommonAncestor().isReadOnly()){d=p.clone();d.enlarge(CKEDITOR.ENLARGE_BLOCK_CONTENTS);e=new CKEDITOR.dom.walker(d);e.guard=function(a){return!c(a)||a.type==CKEDITOR.NODE_COMMENT||a.isReadOnly()};if(!e.checkForward()||d.checkStartOfBlock()&&
|
||||
d.checkEndOfBlock()){b=p.fixBlock(true,b.activeEnterMode==CKEDITOR.ENTER_DIV?"div":"p");if(!CKEDITOR.env.needsBrFiller)(b=b.getFirst(c))&&(b.type==CKEDITOR.NODE_TEXT&&CKEDITOR.tools.trim(b.getText()).match(/^(?: |\xa0)$/))&&b.remove();r=1;a.cancel()}}r&&p.select()}function f(a,b){if(a.isFake)return 0;var d=b.block||b.blockLimit,e=d&&d.getLast(c);if(d&&d.isBlockBoundary()&&(!e||!(e.type==CKEDITOR.NODE_ELEMENT&&e.isBlockBoundary()))&&!d.is("pre")&&!d.getBogus())return d}function b(a){var b=a.data.getTarget();
|
||||
if(b.is("input")){b=b.getAttribute("type");(b=="submit"||b=="reset")&&a.data.preventDefault()}}function c(a){return s(a)&&w(a)}function e(a,b){return function(c){var d=CKEDITOR.dom.element.get(c.data.$.toElement||c.data.$.fromElement||c.data.$.relatedTarget);(!d||!b.equals(d)&&!b.contains(d))&&a.call(this,c)}}function d(a){function b(a){return function(b,e){e&&(b.type==CKEDITOR.NODE_ELEMENT&&b.is(f))&&(d=b);if(!e&&c(b)&&(!a||!m(b)))return false}}var d,e=a.getRanges()[0],a=a.root,f={table:1,ul:1,ol:1,
|
||||
dl:1};if(e.startPath().contains(f)){var p=e.clone();p.collapse(1);p.setStartAt(a,CKEDITOR.POSITION_AFTER_START);a=new CKEDITOR.dom.walker(p);a.guard=b();a.checkBackward();if(d){p=e.clone();p.collapse();p.setEndAt(d,CKEDITOR.POSITION_AFTER_END);a=new CKEDITOR.dom.walker(p);a.guard=b(true);d=false;a.checkForward();return d}}return null}function h(a,b,c){return a.config.autoParagraph!==false&&a.activeEnterMode!=CKEDITOR.ENTER_BR&&a.editable().equals(c)&&!b||b&&b.getAttribute("contenteditable")=="true"}
|
||||
function k(a){a.editor.focus();a.editor.fire("saveSnapshot")}function j(a){var b=a.editor;b.getSelection().scrollIntoView();setTimeout(function(){b.fire("saveSnapshot")},0)}function g(a,b,c){for(var d=a.getCommonAncestor(b),b=a=c?b:a;(a=a.getParent())&&!d.equals(a)&&a.getChildCount()==1;)b=a;b.remove()}CKEDITOR.editable=CKEDITOR.tools.createClass({base:CKEDITOR.dom.element,$:function(a,b){this.base(b.$||b);this.editor=a;this.status="unloaded";this.hasFocus=false;this.setup()},proto:{focus:function(){var a;
|
||||
if(CKEDITOR.env.webkit&&!this.hasFocus){a=this.editor._.previousActive||this.getDocument().getActive();if(this.contains(a)){a.focus();return}}try{this.$[CKEDITOR.env.ie&&this.getDocument().equals(CKEDITOR.document)?"setActive":"focus"]()}catch(b){if(!CKEDITOR.env.ie)throw b;}if(CKEDITOR.env.safari&&!this.isInline()){a=CKEDITOR.document.getActive();a.equals(this.getWindow().getFrame())||this.getWindow().focus()}},on:function(a,b){var c=Array.prototype.slice.call(arguments,0);if(CKEDITOR.env.ie&&/^focus|blur$/.exec(a)){a=
|
||||
a=="focus"?"focusin":"focusout";b=e(b,this);c[0]=a;c[1]=b}return CKEDITOR.dom.element.prototype.on.apply(this,c)},attachListener:function(a){!this._.listeners&&(this._.listeners=[]);var b=Array.prototype.slice.call(arguments,1),b=a.on.apply(a,b);this._.listeners.push(b);return b},clearListeners:function(){var a=this._.listeners;try{for(;a.length;)a.pop().removeListener()}catch(b){}},restoreAttrs:function(){var a=this._.attrChanges,b,c;for(c in a)if(a.hasOwnProperty(c)){b=a[c];b!==null?this.setAttribute(c,
|
||||
b):this.removeAttribute(c)}},attachClass:function(a){var b=this.getCustomData("classes");if(!this.hasClass(a)){!b&&(b=[]);b.push(a);this.setCustomData("classes",b);this.addClass(a)}},changeAttr:function(a,b){var c=this.getAttribute(a);if(b!==c){!this._.attrChanges&&(this._.attrChanges={});a in this._.attrChanges||(this._.attrChanges[a]=c);this.setAttribute(a,b)}},insertHtml:function(a,b){k(this);q(this,b||"html",a)},insertText:function(a){k(this);var b=this.editor,c=b.getSelection().getStartElement().hasAscendant("pre",
|
||||
true)?CKEDITOR.ENTER_BR:b.activeEnterMode,b=c==CKEDITOR.ENTER_BR,d=CKEDITOR.tools,a=d.htmlEncode(a.replace(/\r\n/g,"\n")),a=a.replace(/\t/g," "),c=c==CKEDITOR.ENTER_P?"p":"div";if(!b){var e=/\n{2}/g;if(e.test(a))var f="<"+c+">",r="</"+c+">",a=f+a.replace(e,function(){return r+f})+r}a=a.replace(/\n/g,"<br>");b||(a=a.replace(RegExp("<br>(?=</"+c+">)"),function(a){return d.repeat(a,2)}));a=a.replace(/^ | $/g," ");a=a.replace(/(>|\s) /g,function(a,b){return b+" "}).replace(/ (?=<)/g,
|
||||
" ");q(this,"text",a)},insertElement:function(a,b){b?this.insertElementIntoRange(a,b):this.insertElementIntoSelection(a)},insertElementIntoRange:function(a,b){var c=this.editor,d=c.config.enterMode,e=a.getName(),f=CKEDITOR.dtd.$block[e];if(b.checkReadOnly())return false;b.deleteContents(1);b.startContainer.type==CKEDITOR.NODE_ELEMENT&&b.startContainer.is({tr:1,table:1,tbody:1,thead:1,tfoot:1})&&t(b);var r,n;if(f)for(;(r=b.getCommonAncestor(0,1))&&(n=CKEDITOR.dtd[r.getName()])&&(!n||!n[e]);)if(r.getName()in
|
||||
CKEDITOR.dtd.span)b.splitElement(r);else if(b.checkStartOfBlock()&&b.checkEndOfBlock()){b.setStartBefore(r);b.collapse(true);r.remove()}else b.splitBlock(d==CKEDITOR.ENTER_DIV?"div":"p",c.editable());b.insertNode(a);return true},insertElementIntoSelection:function(a){k(this);var b=this.editor,d=b.activeEnterMode,b=b.getSelection(),e=b.getRanges()[0],f=a.getName(),f=CKEDITOR.dtd.$block[f];if(this.insertElementIntoRange(a,e)){e.moveToPosition(a,CKEDITOR.POSITION_AFTER_END);if(f)if((f=a.getNext(function(a){return c(a)&&
|
||||
!m(a)}))&&f.type==CKEDITOR.NODE_ELEMENT&&f.is(CKEDITOR.dtd.$block))f.getDtd()["#"]?e.moveToElementEditStart(f):e.moveToElementEditEnd(a);else if(!f&&d!=CKEDITOR.ENTER_BR){f=e.fixBlock(true,d==CKEDITOR.ENTER_DIV?"div":"p");e.moveToElementEditStart(f)}}b.selectRanges([e]);j(this)},setData:function(a,b){b||(a=this.editor.dataProcessor.toHtml(a));this.setHtml(a);this.fixInitialSelection();if(this.status=="unloaded")this.status="ready";this.editor.fire("dataReady")},getData:function(a){var b=this.getHtml();
|
||||
a||(b=this.editor.dataProcessor.toDataFormat(b));return b},setReadOnly:function(a){this.setAttribute("contenteditable",!a)},detach:function(){this.removeClass("cke_editable");this.status="detached";var a=this.editor;this._.detach();delete a.document;delete a.window},isInline:function(){return this.getDocument().equals(CKEDITOR.document)},fixInitialSelection:function(){function a(){var b=c.getDocument().$,d=b.getSelection(),e;if(d.anchorNode&&d.anchorNode==c.$)e=true;else if(CKEDITOR.env.webkit){var f=
|
||||
c.getDocument().getActive();f&&(f.equals(c)&&!d.anchorNode)&&(e=true)}if(e){e=new CKEDITOR.dom.range(c);e.moveToElementEditStart(c);b=b.createRange();b.setStart(e.startContainer.$,e.startOffset);b.collapse(true);d.removeAllRanges();d.addRange(b)}}function b(){var a=c.getDocument().$,d=a.selection,e=c.getDocument().getActive();if(d.type=="None"&&e.equals(c)){d=new CKEDITOR.dom.range(c);a=a.body.createTextRange();d.moveToElementEditStart(c);d=d.startContainer;d.type!=CKEDITOR.NODE_ELEMENT&&(d=d.getParent());
|
||||
a.moveToElementText(d.$);a.collapse(true);a.select()}}var c=this;if(CKEDITOR.env.ie&&(CKEDITOR.env.version<9||CKEDITOR.env.quirks)){if(this.hasFocus){this.focus();b()}}else if(this.hasFocus){this.focus();a()}else this.once("focus",function(){a()},null,null,-999)},setup:function(){var a=this.editor;this.attachListener(a,"beforeGetData",function(){var b=this.getData();this.is("textarea")||a.config.ignoreEmptyParagraph!==false&&(b=b.replace(y,function(a,b){return b}));a.setData(b,null,1)},this);this.attachListener(a,
|
||||
"getSnapshot",function(a){a.data=this.getData(1)},this);this.attachListener(a,"afterSetData",function(){this.setData(a.getData(1))},this);this.attachListener(a,"loadSnapshot",function(a){this.setData(a.data,1)},this);this.attachListener(a,"beforeFocus",function(){var b=a.getSelection();(b=b&&b.getNative())&&b.type=="Control"||this.focus()},this);this.attachListener(a,"insertHtml",function(a){this.insertHtml(a.data.dataValue,a.data.mode)},this);this.attachListener(a,"insertElement",function(a){this.insertElement(a.data)},
|
||||
this);this.attachListener(a,"insertText",function(a){this.insertText(a.data)},this);this.setReadOnly(a.readOnly);this.attachClass("cke_editable");this.attachClass(a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?"cke_editable_inline":a.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE||a.elementMode==CKEDITOR.ELEMENT_MODE_APPENDTO?"cke_editable_themed":"");this.attachClass("cke_contents_"+a.config.contentsLangDirection);a.keystrokeHandler.blockedKeystrokes[8]=+a.readOnly;a.keystrokeHandler.attach(this);this.on("blur",
|
||||
function(){this.hasFocus=false},null,null,-1);this.on("focus",function(){this.hasFocus=true},null,null,-1);a.focusManager.add(this);if(this.equals(CKEDITOR.document.getActive())){this.hasFocus=true;a.once("contentDom",function(){a.focusManager.focus(this)},this)}this.isInline()&&this.changeAttr("tabindex",a.tabIndex);if(!this.is("textarea")){a.document=this.getDocument();a.window=this.getWindow();var e=a.document;this.changeAttr("spellcheck",!a.config.disableNativeSpellChecker);var f=a.config.contentsLangDirection;
|
||||
this.getDirection(1)!=f&&this.changeAttr("dir",f);var h=CKEDITOR.getCss();if(h){f=e.getHead();if(!f.getCustomData("stylesheet")){h=e.appendStyleText(h);h=new CKEDITOR.dom.element(h.ownerNode||h.owningElement);f.setCustomData("stylesheet",h);h.data("cke-temp",1)}}f=e.getCustomData("stylesheet_ref")||0;e.setCustomData("stylesheet_ref",f+1);this.setCustomData("cke_includeReadonly",!a.config.disableReadonlyStyling);this.attachListener(this,"click",function(a){var a=a.data,b=(new CKEDITOR.dom.elementPath(a.getTarget(),
|
||||
this)).contains("a");b&&(a.$.button!=2&&b.isReadOnly())&&a.preventDefault()});var l={8:1,46:1};this.attachListener(a,"key",function(b){if(a.readOnly)return true;var c=b.data.domEvent.getKey(),e;if(c in l){var b=a.getSelection(),f,h=b.getRanges()[0],g=h.startPath(),o,m,j,c=c==8;if(CKEDITOR.env.ie&&CKEDITOR.env.version<11&&(f=b.getSelectedElement())||(f=d(b))){a.fire("saveSnapshot");h.moveToPosition(f,CKEDITOR.POSITION_BEFORE_START);f.remove();h.select();a.fire("saveSnapshot");e=1}else if(h.collapsed)if((o=
|
||||
g.block)&&(j=o[c?"getPrevious":"getNext"](s))&&j.type==CKEDITOR.NODE_ELEMENT&&j.is("table")&&h[c?"checkStartOfBlock":"checkEndOfBlock"]()){a.fire("saveSnapshot");h[c?"checkEndOfBlock":"checkStartOfBlock"]()&&o.remove();h["moveToElementEdit"+(c?"End":"Start")](j);h.select();a.fire("saveSnapshot");e=1}else if(g.blockLimit&&g.blockLimit.is("td")&&(m=g.blockLimit.getAscendant("table"))&&h.checkBoundaryOfElement(m,c?CKEDITOR.START:CKEDITOR.END)&&(j=m[c?"getPrevious":"getNext"](s))){a.fire("saveSnapshot");
|
||||
h["moveToElementEdit"+(c?"End":"Start")](j);h.checkStartOfBlock()&&h.checkEndOfBlock()?j.remove():h.select();a.fire("saveSnapshot");e=1}else if((m=g.contains(["td","th","caption"]))&&h.checkBoundaryOfElement(m,c?CKEDITOR.START:CKEDITOR.END))e=1}return!e});a.blockless&&(CKEDITOR.env.ie&&CKEDITOR.env.needsBrFiller)&&this.attachListener(this,"keyup",function(b){if(b.data.getKeystroke()in l&&!this.getFirst(c)){this.appendBogus();b=a.createRange();b.moveToPosition(this,CKEDITOR.POSITION_AFTER_START);b.select()}});
|
||||
this.attachListener(this,"dblclick",function(b){if(a.readOnly)return false;b={element:b.data.getTarget()};a.fire("doubleclick",b)});CKEDITOR.env.ie&&this.attachListener(this,"click",b);CKEDITOR.env.ie||this.attachListener(this,"mousedown",function(b){var c=b.data.getTarget();if(c.is("img","hr","input","textarea","select")&&!c.isReadOnly()){a.getSelection().selectElement(c);c.is("input","textarea","select")&&b.data.preventDefault()}});CKEDITOR.env.gecko&&this.attachListener(this,"mouseup",function(b){if(b.data.$.button==
|
||||
2){b=b.data.getTarget();if(!b.getOuterHtml().replace(y,"")){var c=a.createRange();c.moveToElementEditStart(b);c.select(true)}}});if(CKEDITOR.env.webkit){this.attachListener(this,"click",function(a){a.data.getTarget().is("input","select")&&a.data.preventDefault()});this.attachListener(this,"mouseup",function(a){a.data.getTarget().is("input","textarea")&&a.data.preventDefault()})}CKEDITOR.env.webkit&&this.attachListener(a,"key",function(b){b=b.data.domEvent.getKey();if(b in l){var c=b==8,d=a.getSelection().getRanges()[0],
|
||||
b=d.startPath();if(d.collapsed){var e;a:{var f=b.block;if(f)if(d[c?"checkStartOfBlock":"checkEndOfBlock"]())if(!d.moveToClosestEditablePosition(f,!c)||!d.collapsed)e=false;else{if(d.startContainer.type==CKEDITOR.NODE_ELEMENT){var h=d.startContainer.getChild(d.startOffset-(c?1:0));if(h&&h.type==CKEDITOR.NODE_ELEMENT&&h.is("hr")){a.fire("saveSnapshot");h.remove();e=true;break a}}if((d=d.startPath().block)&&(!d||!d.contains(f))){a.fire("saveSnapshot");var j;(j=(c?d:f).getBogus())&&j.remove();e=a.getSelection();
|
||||
j=e.createBookmarks();(c?f:d).moveChildren(c?d:f,false);b.lastElement.mergeSiblings();g(f,d,!c);e.selectBookmarks(j);e=true}}else e=false;else e=false}if(!e)return}else{c=d;e=b.block;j=c.endPath().block;if(!e||!j||e.equals(j))b=false;else{a.fire("saveSnapshot");(f=e.getBogus())&&f.remove();c.deleteContents();if(j.getParent()){j.moveChildren(e,false);b.lastElement.mergeSiblings();g(e,j,true)}c=a.getSelection().getRanges()[0];c.collapse(1);c.select();b=true}if(!b)return}a.getSelection().scrollIntoView();
|
||||
a.fire("saveSnapshot");return false}},this,null,100)}}},_:{detach:function(){this.editor.setData(this.editor.getData(),0,1);this.clearListeners();this.restoreAttrs();var a;if(a=this.removeCustomData("classes"))for(;a.length;)this.removeClass(a.pop());if(!this.is("textarea")){a=this.getDocument();var b=a.getHead();if(b.getCustomData("stylesheet")){var c=a.getCustomData("stylesheet_ref");if(--c)a.setCustomData("stylesheet_ref",c);else{a.removeCustomData("stylesheet_ref");b.removeCustomData("stylesheet").remove()}}}this.editor.fire("contentDomUnload");
|
||||
delete this.editor}}});CKEDITOR.editor.prototype.editable=function(a){var b=this._.editable;if(b&&a)return 0;if(arguments.length)b=this._.editable=a?a instanceof CKEDITOR.editable?a:new CKEDITOR.editable(this,a):(b&&b.detach(),null);return b};var m=CKEDITOR.dom.walker.bogus(),y=/(^|<body\b[^>]*>)\s*<(p|div|address|h\d|center|pre)[^>]*>\s*(?:<br[^>]*>| |\u00A0| )?\s*(:?<\/\2>)?\s*(?=$|<\/body>)/gi,s=CKEDITOR.dom.walker.whitespaces(true),w=CKEDITOR.dom.walker.bookmark(false,true);CKEDITOR.on("instanceLoaded",
|
||||
function(b){var c=b.editor;c.on("insertElement",function(a){a=a.data;if(a.type==CKEDITOR.NODE_ELEMENT&&(a.is("input")||a.is("textarea"))){a.getAttribute("contentEditable")!="false"&&a.data("cke-editable",a.hasAttribute("contenteditable")?"true":"1");a.setAttribute("contentEditable",false)}});c.on("selectionChange",function(b){if(!c.readOnly){var d=c.getSelection();if(d&&!d.isLocked){d=c.checkDirty();c.fire("lockSnapshot");a(b);c.fire("unlockSnapshot");!d&&c.resetDirty()}}})});CKEDITOR.on("instanceCreated",
|
||||
function(a){var b=a.editor;b.on("mode",function(){var a=b.editable();if(a&&a.isInline()){var c=b.title;a.changeAttr("role","textbox");a.changeAttr("aria-label",c);c&&a.changeAttr("title",c);var d=b.fire("ariaEditorHelpLabel",{}).label;if(d)if(c=this.ui.space(this.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?"top":"contents")){var e=CKEDITOR.tools.getNextId(),d=CKEDITOR.dom.element.createFromHtml('<span id="'+e+'" class="cke_voice_label">'+d+"</span>");c.append(d);a.changeAttr("aria-describedby",e)}}})});
|
||||
CKEDITOR.addCss(".cke_editable{cursor:text}.cke_editable img,.cke_editable input,.cke_editable textarea{cursor:default}");var q=function(){function a(b){return b.type==CKEDITOR.NODE_ELEMENT}function b(c,d){var e,f,l,p,h=[],g=d.range.startContainer;e=d.range.startPath();for(var g=r[g.getName()],n=0,j=c.getChildren(),m=j.count(),o=-1,C=-1,k=0,q=e.contains(r.$list);n<m;++n){e=j.getItem(n);if(a(e)){l=e.getName();if(q&&l in CKEDITOR.dtd.$list)h=h.concat(b(e,d));else{p=!!g[l];if(l=="br"&&e.data("cke-eol")&&
|
||||
(!n||n==m-1)){k=(f=n?h[n-1].node:j.getItem(n+1))&&(!a(f)||!f.is("br"));f=f&&a(f)&&r.$block[f.getName()]}o==-1&&!p&&(o=n);p||(C=n);h.push({isElement:1,isLineBreak:k,isBlock:e.isBlockBoundary(),hasBlockSibling:f,node:e,name:l,allowed:p});f=k=0}}else h.push({isElement:0,node:e,allowed:1})}if(o>-1)h[o].firstNotAllowed=1;if(C>-1)h[C].lastNotAllowed=1;return h}function d(b,c){var e=[],f=b.getChildren(),l=f.count(),p,h=0,g=r[c],n=!b.is(r.$inline)||b.is("br");for(n&&e.push(" ");h<l;h++){p=f.getItem(h);a(p)&&
|
||||
!p.is(g)?e=e.concat(d(p,c)):e.push(p)}n&&e.push(" ");return e}function e(b){return b&&a(b)&&(b.is(r.$removeEmpty)||b.is("a")&&!b.isBlockBoundary())}function f(b,c,d,e){var p=b.clone(),h,r;p.setEndAt(c,CKEDITOR.POSITION_BEFORE_END);if((h=(new CKEDITOR.dom.walker(p)).next())&&a(h)&&g[h.getName()]&&(r=h.getPrevious())&&a(r)&&!r.getParent().equals(b.startContainer)&&d.contains(r)&&e.contains(h)&&h.isIdentical(r)){h.moveChildren(r);h.remove();f(b,c,d,e)}}function p(b,c){function d(b,c){if(c.isBlock&&c.isElement&&
|
||||
!c.node.is("br")&&a(b)&&b.is("br")){b.remove();return 1}}var e=c.endContainer.getChild(c.endOffset),f=c.endContainer.getChild(c.endOffset-1);e&&d(e,b[b.length-1]);if(f&&d(f,b[0])){c.setEnd(c.endContainer,c.endOffset-1);c.collapse()}}var r=CKEDITOR.dtd,g={p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,ul:1,ol:1,li:1,pre:1,dl:1,blockquote:1},m={p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1},C=CKEDITOR.tools.extend({},r.$inline);delete C.br;return function(g,n,k){var q=g.editor,v=q.getSelection().getRanges()[0],
|
||||
G=false;if(n=="unfiltered_html"){n="html";G=true}if(!v.checkReadOnly()){var z=(new CKEDITOR.dom.elementPath(v.startContainer,v.root)).blockLimit||v.root,n={type:n,dontFilter:G,editable:g,editor:q,range:v,blockLimit:z,mergeCandidates:[],zombies:[]},q=n.range,G=n.mergeCandidates,B,x,E,s;if(n.type=="text"&&q.shrink(CKEDITOR.SHRINK_ELEMENT,true,false)){B=CKEDITOR.dom.element.createFromHtml("<span> </span>",q.document);q.insertNode(B);q.setStartAfter(B)}x=new CKEDITOR.dom.elementPath(q.startContainer);
|
||||
n.endPath=E=new CKEDITOR.dom.elementPath(q.endContainer);if(!q.collapsed){var z=E.block||E.blockLimit,w=q.getCommonAncestor();z&&(!z.equals(w)&&!z.contains(w)&&q.checkEndOfBlock())&&n.zombies.push(z);q.deleteContents()}for(;(s=a(q.startContainer)&&q.startContainer.getChild(q.startOffset-1))&&a(s)&&s.isBlockBoundary()&&x.contains(s);)q.moveToPosition(s,CKEDITOR.POSITION_BEFORE_END);f(q,n.blockLimit,x,E);if(B){q.setEndBefore(B);q.collapse();B.remove()}B=q.startPath();if(z=B.contains(e,false,1)){q.splitElement(z);
|
||||
n.inlineStylesRoot=z;n.inlineStylesPeak=B.lastElement}B=q.createBookmark();(z=B.startNode.getPrevious(c))&&a(z)&&e(z)&&G.push(z);(z=B.startNode.getNext(c))&&a(z)&&e(z)&&G.push(z);for(z=B.startNode;(z=z.getParent())&&e(z);)G.push(z);q.moveToBookmark(B);if(B=k){B=n.range;if(n.type=="text"&&n.inlineStylesRoot){s=n.inlineStylesPeak;q=s.getDocument().createText("{cke-peak}");for(G=n.inlineStylesRoot.getParent();!s.equals(G);){q=q.appendTo(s.clone());s=s.getParent()}k=q.getOuterHtml().split("{cke-peak}").join(k)}s=
|
||||
n.blockLimit.getName();if(/^\s+|\s+$/.test(k)&&"span"in CKEDITOR.dtd[s])var y='<span data-cke-marker="1"> </span>',k=y+k+y;k=n.editor.dataProcessor.toHtml(k,{context:null,fixForBody:false,dontFilter:n.dontFilter,filter:n.editor.activeFilter,enterMode:n.editor.activeEnterMode});s=B.document.createElement("body");s.setHtml(k);if(y){s.getFirst().remove();s.getLast().remove()}if((y=B.startPath().block)&&!(y.getChildCount()==1&&y.getBogus()))a:{var t;if(s.getChildCount()==1&&a(t=s.getFirst())&&t.is(m)){y=
|
||||
t.getElementsByTag("*");B=0;for(G=y.count();B<G;B++){q=y.getItem(B);if(!q.is(C))break a}t.moveChildren(t.getParent(1));t.remove()}}n.dataWrapper=s;B=k}if(B){t=n.range;var y=t.document,D,k=n.blockLimit;B=0;var J;s=[];var H,Q,G=q=0,M,S;x=t.startContainer;var z=n.endPath.elements[0],T;E=z.getPosition(x);w=!!z.getCommonAncestor(x)&&E!=CKEDITOR.POSITION_IDENTICAL&&!(E&CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_IS_CONTAINED);x=b(n.dataWrapper,n);for(p(x,t);B<x.length;B++){E=x[B];if(D=E.isLineBreak){D=
|
||||
t;M=k;var O=void 0,V=void 0;if(E.hasBlockSibling)D=1;else{O=D.startContainer.getAscendant(r.$block,1);if(!O||!O.is({div:1,p:1}))D=0;else{V=O.getPosition(M);if(V==CKEDITOR.POSITION_IDENTICAL||V==CKEDITOR.POSITION_CONTAINS)D=0;else{M=D.splitElement(O);D.moveToPosition(M,CKEDITOR.POSITION_AFTER_START);D=1}}}}if(D)G=B>0;else{D=t.startPath();if(!E.isBlock&&h(n.editor,D.block,D.blockLimit)&&(Q=n.editor.activeEnterMode!=CKEDITOR.ENTER_BR&&n.editor.config.autoParagraph!==false?n.editor.activeEnterMode==CKEDITOR.ENTER_DIV?
|
||||
"div":"p":false)){Q=y.createElement(Q);Q.appendBogus();t.insertNode(Q);CKEDITOR.env.needsBrFiller&&(J=Q.getBogus())&&J.remove();t.moveToPosition(Q,CKEDITOR.POSITION_BEFORE_END)}if((D=t.startPath().block)&&!D.equals(H)){if(J=D.getBogus()){J.remove();s.push(D)}H=D}E.firstNotAllowed&&(q=1);if(q&&E.isElement){D=t.startContainer;for(M=null;D&&!r[D.getName()][E.name];){if(D.equals(k)){D=null;break}M=D;D=D.getParent()}if(D){if(M){S=t.splitElement(M);n.zombies.push(S);n.zombies.push(M)}}else{M=k.getName();
|
||||
T=!B;D=B==x.length-1;M=d(E.node,M);for(var O=[],V=M.length,W=0,Y=void 0,Z=0,U=-1;W<V;W++){Y=M[W];if(Y==" "){if(!Z&&(!T||W)){O.push(new CKEDITOR.dom.text(" "));U=O.length}Z=1}else{O.push(Y);Z=0}}D&&U==O.length&&O.pop();T=O}}if(T){for(;D=T.pop();)t.insertNode(D);T=0}else t.insertNode(E.node);if(E.lastNotAllowed&&B<x.length-1){(S=w?z:S)&&t.setEndAt(S,CKEDITOR.POSITION_AFTER_START);q=0}t.collapse()}}n.dontMoveCaret=G;n.bogusNeededBlocks=s}J=n.range;var N;S=n.bogusNeededBlocks;for(T=J.createBookmark();H=
|
||||
n.zombies.pop();)if(H.getParent()){Q=J.clone();Q.moveToElementEditStart(H);Q.removeEmptyBlocksAtEnd()}if(S)for(;H=S.pop();)CKEDITOR.env.needsBrFiller?H.appendBogus():H.append(J.document.createText(" "));for(;H=n.mergeCandidates.pop();)H.mergeSiblings();J.moveToBookmark(T);if(!n.dontMoveCaret){for(H=a(J.startContainer)&&J.startContainer.getChild(J.startOffset-1);H&&a(H)&&!H.is(r.$empty);){if(H.isBlockBoundary())J.moveToPosition(H,CKEDITOR.POSITION_BEFORE_END);else{if(e(H)&&H.getHtml().match(/(\s| )$/g)){N=
|
||||
null;break}N=J.clone();N.moveToPosition(H,CKEDITOR.POSITION_BEFORE_END)}H=H.getLast(c)}N&&J.moveToRange(N)}v.select();j(g)}}}(),t=function(){function a(b){b=new CKEDITOR.dom.walker(b);b.guard=function(a,b){if(b)return false;if(a.type==CKEDITOR.NODE_ELEMENT)return a.is(CKEDITOR.dtd.$tableContent)};b.evaluator=function(a){return a.type==CKEDITOR.NODE_ELEMENT};return b}function b(a,c,d){c=a.getDocument().createElement(c);a.append(c,d);return c}function c(a){var b=a.count(),d;for(b;b-- >0;){d=a.getItem(b);
|
||||
if(!CKEDITOR.tools.trim(d.getHtml())){d.appendBogus();CKEDITOR.env.ie&&(CKEDITOR.env.version<9&&d.getChildCount())&&d.getFirst().remove()}}}return function(d){var e=d.startContainer,f=e.getAscendant("table",1),h=false;c(f.getElementsByTag("td"));c(f.getElementsByTag("th"));f=d.clone();f.setStart(e,0);f=a(f).lastBackward();if(!f){f=d.clone();f.setEndAt(e,CKEDITOR.POSITION_BEFORE_END);f=a(f).lastForward();h=true}f||(f=e);if(f.is("table")){d.setStartAt(f,CKEDITOR.POSITION_BEFORE_START);d.collapse(true);
|
||||
f.remove()}else{f.is({tbody:1,thead:1,tfoot:1})&&(f=b(f,"tr",h));f.is("tr")&&(f=b(f,f.getParent().is("thead")?"th":"td",h));(e=f.getBogus())&&e.remove();d.moveToPosition(f,h?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_END)}}}()})();
|
||||
(function(){function a(){var a=this._.fakeSelection,b;if(a){b=this.getSelection(1);if(!b||!b.isHidden()){a.reset();a=0}}if(!a){a=b||this.getSelection(1);if(!a||a.getType()==CKEDITOR.SELECTION_NONE)return}this.fire("selectionCheck",a);b=this.elementPath();if(!b.compare(this._.selectionPreviousPath)){if(CKEDITOR.env.webkit)this._.previousActive=this.document.getActive();this._.selectionPreviousPath=b;this.fire("selectionChange",{selection:a,path:b})}}function f(){q=true;if(!w){b.call(this);w=CKEDITOR.tools.setTimeout(b,
|
||||
200,this)}}function b(){w=null;if(q){CKEDITOR.tools.setTimeout(a,0,this);q=false}}function c(a){return t(a)||a.type==CKEDITOR.NODE_ELEMENT&&!a.is(CKEDITOR.dtd.$empty)?true:false}function e(a){function b(c,d){return!c||c.type==CKEDITOR.NODE_TEXT?false:a.clone()["moveToElementEdit"+(d?"End":"Start")](c)}if(!(a.root instanceof CKEDITOR.editable))return false;var d=a.startContainer,e=a.getPreviousNode(c,null,d),f=a.getNextNode(c,null,d);return b(e)||b(f,1)||!e&&!f&&!(d.type==CKEDITOR.NODE_ELEMENT&&d.isBlockBoundary()&&
|
||||
d.getBogus())?true:false}function d(a){return a.getCustomData("cke-fillingChar")}function h(a,b){var c=a&&a.removeCustomData("cke-fillingChar");if(c){if(b!==false){var d,e=a.getDocument().getSelection().getNative(),f=e&&e.type!="None"&&e.getRangeAt(0);if(c.getLength()>1&&f&&f.intersectsNode(c.$)){d=j(e);f=e.focusNode==c.$&&e.focusOffset>0;e.anchorNode==c.$&&e.anchorOffset>0&&d[0].offset--;f&&d[1].offset--}}c.setText(k(c.getText()));d&&g(a.getDocument().$,d)}}function k(a){return a.replace(/\u200B( )?/g,
|
||||
function(a){return a[1]?" ":""})}function j(a){return[{node:a.anchorNode,offset:a.anchorOffset},{node:a.focusNode,offset:a.focusOffset}]}function g(a,b){var c=a.getSelection(),d=a.createRange();d.setStart(b[0].node,b[0].offset);d.collapse(true);c.removeAllRanges();c.addRange(d);c.extend(b[1].node,b[1].offset)}function m(a){var b=CKEDITOR.dom.element.createFromHtml('<div data-cke-hidden-sel="1" data-cke-temp="1" style="'+(CKEDITOR.env.ie?"display:none":"position:fixed;top:0;left:-1000px")+'"> </div>',
|
||||
a.document);a.fire("lockSnapshot");a.editable().append(b);var c=a.getSelection(1),d=a.createRange(),e=c.root.on("selectionchange",function(a){a.cancel()},null,null,0);d.setStartAt(b,CKEDITOR.POSITION_AFTER_START);d.setEndAt(b,CKEDITOR.POSITION_BEFORE_END);c.selectRanges([d]);e.removeListener();a.fire("unlockSnapshot");a._.hiddenSelectionContainer=b}function y(a){var b={37:1,39:1,8:1,46:1};return function(c){var d=c.data.getKeystroke();if(b[d]){var e=a.getSelection().getRanges(),f=e[0];if(e.length==
|
||||
1&&f.collapsed)if((d=f[d<38?"getPreviousEditableNode":"getNextEditableNode"]())&&d.type==CKEDITOR.NODE_ELEMENT&&d.getAttribute("contenteditable")=="false"){a.getSelection().fake(d);c.data.preventDefault();c.cancel()}}}}function s(a){for(var b=0;b<a.length;b++){var c=a[b];c.getCommonAncestor().isReadOnly()&&a.splice(b,1);if(!c.collapsed){if(c.startContainer.isReadOnly())for(var d=c.startContainer,e;d;){if((e=d.type==CKEDITOR.NODE_ELEMENT)&&d.is("body")||!d.isReadOnly())break;e&&d.getAttribute("contentEditable")==
|
||||
"false"&&c.setStartAfter(d);d=d.getParent()}d=c.startContainer;e=c.endContainer;var f=c.startOffset,h=c.endOffset,g=c.clone();d&&d.type==CKEDITOR.NODE_TEXT&&(f>=d.getLength()?g.setStartAfter(d):g.setStartBefore(d));e&&e.type==CKEDITOR.NODE_TEXT&&(h?g.setEndAfter(e):g.setEndBefore(e));d=new CKEDITOR.dom.walker(g);d.evaluator=function(d){if(d.type==CKEDITOR.NODE_ELEMENT&&d.isReadOnly()){var e=c.clone();c.setEndBefore(d);c.collapsed&&a.splice(b--,1);if(!(d.getPosition(g.endContainer)&CKEDITOR.POSITION_CONTAINS)){e.setStartAfter(d);
|
||||
e.collapsed||a.splice(b+1,0,e)}return true}return false};d.next()}}return a}var w,q,t=CKEDITOR.dom.walker.invisible(1),i=function(){function a(b){return function(a){var c=a.editor.createRange();c.moveToClosestEditablePosition(a.selected,b)&&a.editor.getSelection().selectRanges([c]);return false}}function b(a){return function(b){var c=b.editor,d=c.createRange(),e;if(!(e=d.moveToClosestEditablePosition(b.selected,a)))e=d.moveToClosestEditablePosition(b.selected,!a);e&&c.getSelection().selectRanges([d]);
|
||||
c.fire("saveSnapshot");b.selected.remove();if(!e){d.moveToElementEditablePosition(c.editable());c.getSelection().selectRanges([d])}c.fire("saveSnapshot");return false}}var c=a(),d=a(1);return{37:c,38:c,39:d,40:d,8:b(),46:b(1)}}();CKEDITOR.on("instanceCreated",function(b){function c(){var a=d.getSelection();a&&a.removeAllRanges()}var d=b.editor;d.on("contentDom",function(){function b(){z=new CKEDITOR.dom.selection(d.getSelection());z.lock()}function c(){l.removeListener("mouseup",c);i.removeListener("mouseup",
|
||||
c);var a=CKEDITOR.document.$.selection,b=a.createRange();a.type!="None"&&b.parentElement().ownerDocument==e.$&&b.select()}var e=d.document,l=CKEDITOR.document,g=d.editable(),p=e.getBody(),i=e.getDocumentElement(),v=g.isInline(),j,z;CKEDITOR.env.gecko&&g.attachListener(g,"focus",function(a){a.removeListener();if(j!==0)if((a=d.getSelection().getNative())&&a.isCollapsed&&a.anchorNode==g.$){a=d.createRange();a.moveToElementEditStart(g);a.select()}},null,null,-2);g.attachListener(g,CKEDITOR.env.webkit?
|
||||
"DOMFocusIn":"focus",function(){j&&CKEDITOR.env.webkit&&(j=d._.previousActive&&d._.previousActive.equals(e.getActive()));d.unlockSelection(j);j=0},null,null,-1);g.attachListener(g,"mousedown",function(){j=0});if(CKEDITOR.env.ie||v){A?g.attachListener(g,"beforedeactivate",b,null,null,-1):g.attachListener(d,"selectionCheck",b,null,null,-1);g.attachListener(g,CKEDITOR.env.webkit?"DOMFocusOut":"blur",function(){d.lockSelection(z);j=1},null,null,-1);g.attachListener(g,"mousedown",function(){j=0})}if(CKEDITOR.env.ie&&
|
||||
!v){var B;g.attachListener(g,"mousedown",function(a){if(a.data.$.button==2){a=d.document.getSelection();if(!a||a.getType()==CKEDITOR.SELECTION_NONE)B=d.window.getScrollPosition()}});g.attachListener(g,"mouseup",function(a){if(a.data.$.button==2&&B){d.document.$.documentElement.scrollLeft=B.x;d.document.$.documentElement.scrollTop=B.y}B=null});if(e.$.compatMode!="BackCompat"){if(CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat)i.on("mousedown",function(a){function b(a){a=a.data.$;if(d){var c=p.$.createTextRange();
|
||||
try{c.moveToPoint(a.clientX,a.clientY)}catch(e){}d.setEndPoint(f.compareEndPoints("StartToStart",c)<0?"EndToEnd":"StartToStart",c);d.select()}}function c(){i.removeListener("mousemove",b);l.removeListener("mouseup",c);i.removeListener("mouseup",c);d.select()}a=a.data;if(a.getTarget().is("html")&&a.$.y<i.$.clientHeight&&a.$.x<i.$.clientWidth){var d=p.$.createTextRange();try{d.moveToPoint(a.$.clientX,a.$.clientY)}catch(e){}var f=d.duplicate();i.on("mousemove",b);l.on("mouseup",c);i.on("mouseup",c)}});
|
||||
if(CKEDITOR.env.version>7&&CKEDITOR.env.version<11)i.on("mousedown",function(a){if(a.data.getTarget().is("html")){l.on("mouseup",c);i.on("mouseup",c)}})}}g.attachListener(g,"selectionchange",a,d);g.attachListener(g,"keyup",f,d);g.attachListener(g,CKEDITOR.env.webkit?"DOMFocusIn":"focus",function(){d.forceNextSelectionCheck();d.selectionChange(1)});if(v&&(CKEDITOR.env.webkit||CKEDITOR.env.gecko)){var x;g.attachListener(g,"mousedown",function(){x=1});g.attachListener(e.getDocumentElement(),"mouseup",
|
||||
function(){x&&f.call(d);x=0})}else g.attachListener(CKEDITOR.env.ie?g:e.getDocumentElement(),"mouseup",f,d);CKEDITOR.env.webkit&&g.attachListener(e,"keydown",function(a){switch(a.data.getKey()){case 13:case 33:case 34:case 35:case 36:case 37:case 39:case 8:case 45:case 46:h(g)}},null,null,-1);g.attachListener(g,"keydown",y(d),null,null,-1)});d.on("setData",function(){d.unlockSelection();CKEDITOR.env.webkit&&c()});d.on("contentDomUnload",function(){d.unlockSelection()});if(CKEDITOR.env.ie9Compat)d.on("beforeDestroy",
|
||||
c,null,null,9);d.on("dataReady",function(){delete d._.fakeSelection;delete d._.hiddenSelectionContainer;d.selectionChange(1)});d.on("loadSnapshot",function(){var a=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT),b=d.editable().getLast(a);if(b&&b.hasAttribute("data-cke-hidden-sel")){b.remove();if(CKEDITOR.env.gecko)(a=d.editable().getFirst(a))&&(a.is("br")&&a.getAttribute("_moz_editor_bogus_node"))&&a.remove()}},null,null,100);d.on("key",function(a){if(d.mode=="wysiwyg"){var b=d.getSelection();
|
||||
if(b.isFake){var c=i[a.data.keyCode];if(c)return c({editor:d,selected:b.getSelectedElement(),selection:b,keyEvent:a})}}})});CKEDITOR.on("instanceReady",function(a){function b(){var a=e.editable();if(a)if(a=d(a)){var c=e.document.$.getSelection();if(c.type!="None"&&(c.anchorNode==a.$||c.focusNode==a.$))i=j(c);f=a.getText();a.setText(k(f))}}function c(){var a=e.editable();if(a)if(a=d(a)){a.setText(f);if(i){g(e.document.$,i);i=null}}}var e=a.editor,f,i;if(CKEDITOR.env.webkit){e.on("selectionChange",
|
||||
function(){var a=e.editable(),b=d(a);b&&(b.getCustomData("ready")?h(a):b.setCustomData("ready",1))},null,null,-1);e.on("beforeSetMode",function(){h(e.editable())},null,null,-1);e.on("beforeUndoImage",b);e.on("afterUndoImage",c);e.on("beforeGetData",b,null,null,0);e.on("getData",c)}});CKEDITOR.editor.prototype.selectionChange=function(b){(b?a:f).call(this)};CKEDITOR.editor.prototype.getSelection=function(a){if((this._.savedSelection||this._.fakeSelection)&&!a)return this._.savedSelection||this._.fakeSelection;
|
||||
return(a=this.editable())&&this.mode=="wysiwyg"?new CKEDITOR.dom.selection(a):null};CKEDITOR.editor.prototype.lockSelection=function(a){a=a||this.getSelection(1);if(a.getType()!=CKEDITOR.SELECTION_NONE){!a.isLocked&&a.lock();this._.savedSelection=a;return true}return false};CKEDITOR.editor.prototype.unlockSelection=function(a){var b=this._.savedSelection;if(b){b.unlock(a);delete this._.savedSelection;return true}return false};CKEDITOR.editor.prototype.forceNextSelectionCheck=function(){delete this._.selectionPreviousPath};
|
||||
CKEDITOR.dom.document.prototype.getSelection=function(){return new CKEDITOR.dom.selection(this)};CKEDITOR.dom.range.prototype.select=function(){var a=this.root instanceof CKEDITOR.editable?this.root.editor.getSelection():new CKEDITOR.dom.selection(this.root);a.selectRanges([this]);return a};CKEDITOR.SELECTION_NONE=1;CKEDITOR.SELECTION_TEXT=2;CKEDITOR.SELECTION_ELEMENT=3;var A=typeof window.getSelection!="function",u=1;CKEDITOR.dom.selection=function(a){if(a instanceof CKEDITOR.dom.selection)var b=
|
||||
a,a=a.root;var c=a instanceof CKEDITOR.dom.element;this.rev=b?b.rev:u++;this.document=a instanceof CKEDITOR.dom.document?a:a.getDocument();this.root=c?a:this.document.getBody();this.isLocked=0;this._={cache:{}};if(b){CKEDITOR.tools.extend(this._.cache,b._.cache);this.isFake=b.isFake;this.isLocked=b.isLocked;return this}var a=this.getNative(),d,e;if(a)if(a.getRangeAt)d=(e=a.rangeCount&&a.getRangeAt(0))&&new CKEDITOR.dom.node(e.commonAncestorContainer);else{try{e=a.createRange()}catch(f){}d=e&&CKEDITOR.dom.element.get(e.item&&
|
||||
e.item(0)||e.parentElement())}if(!d||!(d.type==CKEDITOR.NODE_ELEMENT||d.type==CKEDITOR.NODE_TEXT)||!this.root.equals(d)&&!this.root.contains(d)){this._.cache.type=CKEDITOR.SELECTION_NONE;this._.cache.startElement=null;this._.cache.selectedElement=null;this._.cache.selectedText="";this._.cache.ranges=new CKEDITOR.dom.rangeList}return this};var o={img:1,hr:1,li:1,table:1,tr:1,td:1,th:1,embed:1,object:1,ol:1,ul:1,a:1,input:1,form:1,select:1,textarea:1,button:1,fieldset:1,thead:1,tfoot:1};CKEDITOR.dom.selection.prototype=
|
||||
{getNative:function(){return this._.cache.nativeSel!==void 0?this._.cache.nativeSel:this._.cache.nativeSel=A?this.document.$.selection:this.document.getWindow().$.getSelection()},getType:A?function(){var a=this._.cache;if(a.type)return a.type;var b=CKEDITOR.SELECTION_NONE;try{var c=this.getNative(),d=c.type;if(d=="Text")b=CKEDITOR.SELECTION_TEXT;if(d=="Control")b=CKEDITOR.SELECTION_ELEMENT;if(c.createRange().parentElement())b=CKEDITOR.SELECTION_TEXT}catch(e){}return a.type=b}:function(){var a=this._.cache;
|
||||
if(a.type)return a.type;var b=CKEDITOR.SELECTION_TEXT,c=this.getNative();if(!c||!c.rangeCount)b=CKEDITOR.SELECTION_NONE;else if(c.rangeCount==1){var c=c.getRangeAt(0),d=c.startContainer;if(d==c.endContainer&&d.nodeType==1&&c.endOffset-c.startOffset==1&&o[d.childNodes[c.startOffset].nodeName.toLowerCase()])b=CKEDITOR.SELECTION_ELEMENT}return a.type=b},getRanges:function(){var a=A?function(){function a(b){return(new CKEDITOR.dom.node(b)).getIndex()}var b=function(b,c){b=b.duplicate();b.collapse(c);
|
||||
var d=b.parentElement();if(!d.hasChildNodes())return{container:d,offset:0};for(var e=d.children,f,g,h=b.duplicate(),v=0,l=e.length-1,i=-1,j,x;v<=l;){i=Math.floor((v+l)/2);f=e[i];h.moveToElementText(f);j=h.compareEndPoints("StartToStart",b);if(j>0)l=i-1;else if(j<0)v=i+1;else return{container:d,offset:a(f)}}if(i==-1||i==e.length-1&&j<0){h.moveToElementText(d);h.setEndPoint("StartToStart",b);h=h.text.replace(/(\r\n|\r)/g,"\n").length;e=d.childNodes;if(!h){f=e[e.length-1];return f.nodeType!=CKEDITOR.NODE_TEXT?
|
||||
{container:d,offset:e.length}:{container:f,offset:f.nodeValue.length}}for(d=e.length;h>0&&d>0;){g=e[--d];if(g.nodeType==CKEDITOR.NODE_TEXT){x=g;h=h-g.nodeValue.length}}return{container:x,offset:-h}}h.collapse(j>0?true:false);h.setEndPoint(j>0?"StartToStart":"EndToStart",b);h=h.text.replace(/(\r\n|\r)/g,"\n").length;if(!h)return{container:d,offset:a(f)+(j>0?0:1)};for(;h>0;)try{g=f[j>0?"previousSibling":"nextSibling"];if(g.nodeType==CKEDITOR.NODE_TEXT){h=h-g.nodeValue.length;x=g}f=g}catch(m){return{container:d,
|
||||
offset:a(f)}}return{container:x,offset:j>0?-h:x.nodeValue.length+h}};return function(){var a=this.getNative(),c=a&&a.createRange(),d=this.getType();if(!a)return[];if(d==CKEDITOR.SELECTION_TEXT){a=new CKEDITOR.dom.range(this.root);d=b(c,true);a.setStart(new CKEDITOR.dom.node(d.container),d.offset);d=b(c);a.setEnd(new CKEDITOR.dom.node(d.container),d.offset);a.endContainer.getPosition(a.startContainer)&CKEDITOR.POSITION_PRECEDING&&a.endOffset<=a.startContainer.getIndex()&&a.collapse();return[a]}if(d==
|
||||
CKEDITOR.SELECTION_ELEMENT){for(var d=[],e=0;e<c.length;e++){for(var f=c.item(e),h=f.parentNode,g=0,a=new CKEDITOR.dom.range(this.root);g<h.childNodes.length&&h.childNodes[g]!=f;g++);a.setStart(new CKEDITOR.dom.node(h),g);a.setEnd(new CKEDITOR.dom.node(h),g+1);d.push(a)}return d}return[]}}():function(){var a=[],b,c=this.getNative();if(!c)return a;for(var d=0;d<c.rangeCount;d++){var e=c.getRangeAt(d);b=new CKEDITOR.dom.range(this.root);b.setStart(new CKEDITOR.dom.node(e.startContainer),e.startOffset);
|
||||
b.setEnd(new CKEDITOR.dom.node(e.endContainer),e.endOffset);a.push(b)}return a};return function(b){var c=this._.cache,d=c.ranges;if(!d)c.ranges=d=new CKEDITOR.dom.rangeList(a.call(this));return!b?d:s(new CKEDITOR.dom.rangeList(d.slice()))}}(),getStartElement:function(){var a=this._.cache;if(a.startElement!==void 0)return a.startElement;var b;switch(this.getType()){case CKEDITOR.SELECTION_ELEMENT:return this.getSelectedElement();case CKEDITOR.SELECTION_TEXT:var c=this.getRanges()[0];if(c){if(c.collapsed){b=
|
||||
c.startContainer;b.type!=CKEDITOR.NODE_ELEMENT&&(b=b.getParent())}else{for(c.optimize();;){b=c.startContainer;if(c.startOffset==(b.getChildCount?b.getChildCount():b.getLength())&&!b.isBlockBoundary())c.setStartAfter(b);else break}b=c.startContainer;if(b.type!=CKEDITOR.NODE_ELEMENT)return b.getParent();b=b.getChild(c.startOffset);if(!b||b.type!=CKEDITOR.NODE_ELEMENT)b=c.startContainer;else for(c=b.getFirst();c&&c.type==CKEDITOR.NODE_ELEMENT;){b=c;c=c.getFirst()}}b=b.$}}return a.startElement=b?new CKEDITOR.dom.element(b):
|
||||
null},getSelectedElement:function(){var a=this._.cache;if(a.selectedElement!==void 0)return a.selectedElement;var b=this,c=CKEDITOR.tools.tryThese(function(){return b.getNative().createRange().item(0)},function(){for(var a=b.getRanges()[0].clone(),c,d,e=2;e&&(!(c=a.getEnclosedNode())||!(c.type==CKEDITOR.NODE_ELEMENT&&o[c.getName()]&&(d=c)));e--)a.shrink(CKEDITOR.SHRINK_ELEMENT);return d&&d.$});return a.selectedElement=c?new CKEDITOR.dom.element(c):null},getSelectedText:function(){var a=this._.cache;
|
||||
if(a.selectedText!==void 0)return a.selectedText;var b=this.getNative(),b=A?b.type=="Control"?"":b.createRange().text:b.toString();return a.selectedText=b},lock:function(){this.getRanges();this.getStartElement();this.getSelectedElement();this.getSelectedText();this._.cache.nativeSel=null;this.isLocked=1},unlock:function(a){if(this.isLocked){if(a)var b=this.getSelectedElement(),c=!b&&this.getRanges(),d=this.isFake;this.isLocked=0;this.reset();if(a)(a=b||c[0]&&c[0].getCommonAncestor())&&a.getAscendant("body",
|
||||
1)&&(d?this.fake(b):b?this.selectElement(b):this.selectRanges(c))}},reset:function(){this._.cache={};this.isFake=0;var a=this.root.editor;if(a&&a._.fakeSelection&&this.rev==a._.fakeSelection.rev){delete a._.fakeSelection;var b=a._.hiddenSelectionContainer;if(b){var c=a.checkDirty();a.fire("lockSnapshot");b.remove();a.fire("unlockSnapshot");!c&&a.resetDirty()}delete a._.hiddenSelectionContainer}this.rev=u++},selectElement:function(a){var b=new CKEDITOR.dom.range(this.root);b.setStartBefore(a);b.setEndAfter(a);
|
||||
this.selectRanges([b])},selectRanges:function(a){var b=this.root.editor,b=b&&b._.hiddenSelectionContainer;this.reset();if(b)for(var b=this.root,c,d=0;d<a.length;++d){c=a[d];if(c.endContainer.equals(b))c.endOffset=Math.min(c.endOffset,b.getChildCount())}if(a.length)if(this.isLocked){var f=CKEDITOR.document.getActive();this.unlock();this.selectRanges(a);this.lock();f&&!f.equals(this.root)&&f.focus()}else{var g;a:{var i,j;if(a.length==1&&!(j=a[0]).collapsed&&(g=j.getEnclosedNode())&&g.type==CKEDITOR.NODE_ELEMENT){j=
|
||||
j.clone();j.shrink(CKEDITOR.SHRINK_ELEMENT,true);if((i=j.getEnclosedNode())&&i.type==CKEDITOR.NODE_ELEMENT)g=i;if(g.getAttribute("contenteditable")=="false")break a}g=void 0}if(g)this.fake(g);else{if(A){j=CKEDITOR.dom.walker.whitespaces(true);i=/\ufeff|\u00a0/;b={table:1,tbody:1,tr:1};if(a.length>1){g=a[a.length-1];a[0].setEnd(g.endContainer,g.endOffset)}g=a[0];var a=g.collapsed,m,k,v;if((c=g.getEnclosedNode())&&c.type==CKEDITOR.NODE_ELEMENT&&c.getName()in o&&(!c.is("a")||!c.getText()))try{v=c.$.createControlRange();
|
||||
v.addElement(c.$);v.select();return}catch(q){}if(g.startContainer.type==CKEDITOR.NODE_ELEMENT&&g.startContainer.getName()in b||g.endContainer.type==CKEDITOR.NODE_ELEMENT&&g.endContainer.getName()in b){g.shrink(CKEDITOR.NODE_ELEMENT,true);a=g.collapsed}v=g.createBookmark();b=v.startNode;if(!a)f=v.endNode;v=g.document.$.body.createTextRange();v.moveToElementText(b.$);v.moveStart("character",1);if(f){i=g.document.$.body.createTextRange();i.moveToElementText(f.$);v.setEndPoint("EndToEnd",i);v.moveEnd("character",
|
||||
-1)}else{m=b.getNext(j);k=b.hasAscendant("pre");m=!(m&&m.getText&&m.getText().match(i))&&(k||!b.hasPrevious()||b.getPrevious().is&&b.getPrevious().is("br"));k=g.document.createElement("span");k.setHtml("");k.insertBefore(b);m&&g.document.createText("").insertBefore(b)}g.setStartBefore(b);b.remove();if(a){if(m){v.moveStart("character",-1);v.select();g.document.$.selection.clear()}else v.select();g.moveToPosition(k,CKEDITOR.POSITION_BEFORE_START);k.remove()}else{g.setEndBefore(f);f.remove();
|
||||
v.select()}}else{f=this.getNative();if(!f)return;this.removeAllRanges();for(v=0;v<a.length;v++){if(v<a.length-1){m=a[v];k=a[v+1];i=m.clone();i.setStart(m.endContainer,m.endOffset);i.setEnd(k.startContainer,k.startOffset);if(!i.collapsed){i.shrink(CKEDITOR.NODE_ELEMENT,true);g=i.getCommonAncestor();i=i.getEnclosedNode();if(g.isReadOnly()||i&&i.isReadOnly()){k.setStart(m.startContainer,m.startOffset);a.splice(v--,1);continue}}}g=a[v];k=this.document.$.createRange();if(g.collapsed&&CKEDITOR.env.webkit&&
|
||||
e(g)){m=this.root;h(m,false);i=m.getDocument().createText("");m.setCustomData("cke-fillingChar",i);g.insertNode(i);if((m=i.getNext())&&!i.getPrevious()&&m.type==CKEDITOR.NODE_ELEMENT&&m.getName()=="br"){h(this.root);g.moveToPosition(m,CKEDITOR.POSITION_BEFORE_START)}else g.moveToPosition(i,CKEDITOR.POSITION_AFTER_END)}k.setStart(g.startContainer.$,g.startOffset);try{k.setEnd(g.endContainer.$,g.endOffset)}catch(z){if(z.toString().indexOf("NS_ERROR_ILLEGAL_VALUE")>=0){g.collapse(1);k.setEnd(g.endContainer.$,
|
||||
g.endOffset)}else throw z;}f.addRange(k)}}this.reset();this.root.fire("selectionchange")}}},fake:function(a){var b=this.root.editor;this.reset();m(b);var c=this._.cache,d=new CKEDITOR.dom.range(this.root);d.setStartBefore(a);d.setEndAfter(a);c.ranges=new CKEDITOR.dom.rangeList(d);c.selectedElement=c.startElement=a;c.type=CKEDITOR.SELECTION_ELEMENT;c.selectedText=c.nativeSel=null;this.isFake=1;this.rev=u++;b._.fakeSelection=this;this.root.fire("selectionchange")},isHidden:function(){var a=this.getCommonAncestor();
|
||||
a&&a.type==CKEDITOR.NODE_TEXT&&(a=a.getParent());return!(!a||!a.data("cke-hidden-sel"))},createBookmarks:function(a){a=this.getRanges().createBookmarks(a);this.isFake&&(a.isFake=1);return a},createBookmarks2:function(a){a=this.getRanges().createBookmarks2(a);this.isFake&&(a.isFake=1);return a},selectBookmarks:function(a){for(var b=[],c=0;c<a.length;c++){var d=new CKEDITOR.dom.range(this.root);d.moveToBookmark(a[c]);b.push(d)}a.isFake?this.fake(b[0].getEnclosedNode()):this.selectRanges(b);return this},
|
||||
getCommonAncestor:function(){var a=this.getRanges();return!a.length?null:a[0].startContainer.getCommonAncestor(a[a.length-1].endContainer)},scrollIntoView:function(){this.type!=CKEDITOR.SELECTION_NONE&&this.getRanges()[0].scrollIntoView()},removeAllRanges:function(){if(this.getType()!=CKEDITOR.SELECTION_NONE){var a=this.getNative();try{a&&a[A?"empty":"removeAllRanges"]()}catch(b){}this.reset()}}}})();"use strict";CKEDITOR.STYLE_BLOCK=1;CKEDITOR.STYLE_INLINE=2;CKEDITOR.STYLE_OBJECT=3;
|
||||
(function(){function a(a,b){for(var c,d;a=a.getParent();){if(a.equals(b))break;if(a.getAttribute("data-nostyle"))c=a;else if(!d){var e=a.getAttribute("contentEditable");e=="false"?c=a:e=="true"&&(d=1)}}return c}function f(b){var d=b.document;if(b.collapsed){d=i(this,d);b.insertNode(d);b.moveToPosition(d,CKEDITOR.POSITION_BEFORE_END)}else{var e=this.element,g=this._.definition,h,j=g.ignoreReadonly,m=j||g.includeReadonly;m==null&&(m=b.root.getCustomData("cke_includeReadonly"));var k=CKEDITOR.dtd[e];
|
||||
if(!k){h=true;k=CKEDITOR.dtd.span}b.enlarge(CKEDITOR.ENLARGE_INLINE,1);b.trim();var l=b.createBookmark(),q=l.startNode,o=l.endNode,n=q,p;if(!j){var s=b.getCommonAncestor(),j=a(q,s),s=a(o,s);j&&(n=j.getNextSourceNode(true));s&&(o=s)}for(n.getPosition(o)==CKEDITOR.POSITION_FOLLOWING&&(n=0);n;){j=false;if(n.equals(o)){n=null;j=true}else{var r=n.type==CKEDITOR.NODE_ELEMENT?n.getName():null,s=r&&n.getAttribute("contentEditable")=="false",t=r&&n.getAttribute("data-nostyle");if(r&&n.data("cke-bookmark")){n=
|
||||
n.getNextSourceNode(true);continue}if(s&&m&&CKEDITOR.dtd.$block[r])for(var y=n,u=c(y),A=void 0,C=u.length,F=0,y=C&&new CKEDITOR.dom.range(y.getDocument());F<C;++F){var A=u[F],P=CKEDITOR.filter.instances[A.data("cke-filter")];if(P?P.check(this):1){y.selectNodeContents(A);f.call(this,y)}}u=r?!k[r]||t?0:s&&!m?0:(n.getPosition(o)|K)==K&&(!g.childRule||g.childRule(n)):1;if(u)if((u=n.getParent())&&((u.getDtd()||CKEDITOR.dtd.span)[e]||h)&&(!g.parentRule||g.parentRule(u))){if(!p&&(!r||!CKEDITOR.dtd.$removeEmpty[r]||
|
||||
(n.getPosition(o)|K)==K)){p=b.clone();p.setStartBefore(n)}r=n.type;if(r==CKEDITOR.NODE_TEXT||s||r==CKEDITOR.NODE_ELEMENT&&!n.getChildCount()){for(var r=n,U;(j=!r.getNext(L))&&(U=r.getParent(),k[U.getName()])&&(U.getPosition(q)|I)==I&&(!g.childRule||g.childRule(U));)r=U;p.setEndAfter(r)}}else j=true;else j=true;n=n.getNextSourceNode(t||s)}if(j&&p&&!p.collapsed){for(var j=i(this,d),s=j.hasAttributes(),t=p.getCommonAncestor(),r={},u={},A={},C={},N,R,X;j&&t;){if(t.getName()==e){for(N in g.attributes)if(!C[N]&&
|
||||
(X=t.getAttribute(R)))j.getAttribute(N)==X?u[N]=1:C[N]=1;for(R in g.styles)if(!A[R]&&(X=t.getStyle(R)))j.getStyle(R)==X?r[R]=1:A[R]=1}t=t.getParent()}for(N in u)j.removeAttribute(N);for(R in r)j.removeStyle(R);s&&!j.hasAttributes()&&(j=null);if(j){p.extractContents().appendTo(j);p.insertNode(j);w.call(this,j);j.mergeSiblings();CKEDITOR.env.ie||j.$.normalize()}else{j=new CKEDITOR.dom.element("span");p.extractContents().appendTo(j);p.insertNode(j);w.call(this,j);j.remove(true)}p=null}}b.moveToBookmark(l);
|
||||
b.shrink(CKEDITOR.SHRINK_TEXT);b.shrink(CKEDITOR.NODE_ELEMENT,true)}}function b(a){function b(){for(var a=new CKEDITOR.dom.elementPath(d.getParent()),c=new CKEDITOR.dom.elementPath(j.getParent()),e=null,f=null,g=0;g<a.elements.length;g++){var h=a.elements[g];if(h==a.block||h==a.blockLimit)break;m.checkElementRemovable(h,true)&&(e=h)}for(g=0;g<c.elements.length;g++){h=c.elements[g];if(h==c.block||h==c.blockLimit)break;m.checkElementRemovable(h,true)&&(f=h)}f&&j.breakParent(f);e&&d.breakParent(e)}a.enlarge(CKEDITOR.ENLARGE_INLINE,
|
||||
1);var c=a.createBookmark(),d=c.startNode;if(a.collapsed){for(var e=new CKEDITOR.dom.elementPath(d.getParent(),a.root),f,g=0,h;g<e.elements.length&&(h=e.elements[g]);g++){if(h==e.block||h==e.blockLimit)break;if(this.checkElementRemovable(h)){var i;if(a.collapsed&&(a.checkBoundaryOfElement(h,CKEDITOR.END)||(i=a.checkBoundaryOfElement(h,CKEDITOR.START)))){f=h;f.match=i?"start":"end"}else{h.mergeSiblings();h.is(this.element)?s.call(this,h):q(h,o(this)[h.getName()])}}}if(f){h=d;for(g=0;;g++){i=e.elements[g];
|
||||
if(i.equals(f))break;else if(i.match)continue;else i=i.clone();i.append(h);h=i}h[f.match=="start"?"insertBefore":"insertAfter"](f)}}else{var j=c.endNode,m=this;b();for(e=d;!e.equals(j);){f=e.getNextSourceNode();if(e.type==CKEDITOR.NODE_ELEMENT&&this.checkElementRemovable(e)){e.getName()==this.element?s.call(this,e):q(e,o(this)[e.getName()]);if(f.type==CKEDITOR.NODE_ELEMENT&&f.contains(d)){b();f=d.getNext()}}e=f}}a.moveToBookmark(c);a.shrink(CKEDITOR.NODE_ELEMENT,true)}function c(a){var b=[];a.forEach(function(a){if(a.getAttribute("contenteditable")==
|
||||
"true"){b.push(a);return false}},CKEDITOR.NODE_ELEMENT,true);return b}function e(a){var b=a.getEnclosedNode()||a.getCommonAncestor(false,true);(a=(new CKEDITOR.dom.elementPath(b,a.root)).contains(this.element,1))&&!a.isReadOnly()&&A(a,this)}function d(a){var b=a.getCommonAncestor(true,true);if(a=(new CKEDITOR.dom.elementPath(b,a.root)).contains(this.element,1)){var b=this._.definition,c=b.attributes;if(c)for(var d in c)a.removeAttribute(d,c[d]);if(b.styles)for(var e in b.styles)b.styles.hasOwnProperty(e)&&
|
||||
a.removeStyle(e)}}function h(a){var b=a.createBookmark(true),c=a.createIterator();c.enforceRealBlocks=true;if(this._.enterMode)c.enlargeBr=this._.enterMode!=CKEDITOR.ENTER_BR;for(var d,e=a.document,f;d=c.getNextParagraph();)if(!d.isReadOnly()&&(c.activeFilter?c.activeFilter.check(this):1)){f=i(this,e,d);j(d,f)}a.moveToBookmark(b)}function k(a){var b=a.createBookmark(1),c=a.createIterator();c.enforceRealBlocks=true;c.enlargeBr=this._.enterMode!=CKEDITOR.ENTER_BR;for(var d,e;d=c.getNextParagraph();)if(this.checkElementRemovable(d))if(d.is("pre")){(e=
|
||||
this._.enterMode==CKEDITOR.ENTER_BR?null:a.document.createElement(this._.enterMode==CKEDITOR.ENTER_P?"p":"div"))&&d.copyAttributes(e);j(d,e)}else s.call(this,d);a.moveToBookmark(b)}function j(a,b){var c=!b;if(c){b=a.getDocument().createElement("div");a.copyAttributes(b)}var d=b&&b.is("pre"),e=a.is("pre"),f=!d&&e;if(d&&!e){e=b;(f=a.getBogus())&&f.remove();f=a.getHtml();f=m(f,/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g,"");f=f.replace(/[ \t\r\n]*(<br[^>]*>)[ \t\r\n]*/gi,"$1");f=f.replace(/([ \t\n\r]+| )/g,
|
||||
" ");f=f.replace(/<br\b[^>]*>/gi,"\n");if(CKEDITOR.env.ie){var h=a.getDocument().createElement("div");h.append(e);e.$.outerHTML="<pre>"+f+"</pre>";e.copyAttributes(h.getFirst());e=h.getFirst().remove()}else e.setHtml(f);b=e}else f?b=y(c?[a.getHtml()]:g(a),b):a.moveChildren(b);b.replace(a);if(d){var c=b,i;if((i=c.getPrevious(F))&&i.type==CKEDITOR.NODE_ELEMENT&&i.is("pre")){d=m(i.getHtml(),/\n$/,"")+"\n\n"+m(c.getHtml(),/^\n/,"");CKEDITOR.env.ie?c.$.outerHTML="<pre>"+d+"</pre>":c.setHtml(d);i.remove()}}else c&&
|
||||
t(b)}function g(a){var b=[];m(a.getOuterHtml(),/(\S\s*)\n(?:\s|(<span[^>]+data-cke-bookmark.*?\/span>))*\n(?!$)/gi,function(a,b,c){return b+"</pre>"+c+"<pre>"}).replace(/<pre\b.*?>([\s\S]*?)<\/pre>/gi,function(a,c){b.push(c)});return b}function m(a,b,c){var d="",e="",a=a.replace(/(^<span[^>]+data-cke-bookmark.*?\/span>)|(<span[^>]+data-cke-bookmark.*?\/span>$)/gi,function(a,b,c){b&&(d=b);c&&(e=c);return""});return d+a.replace(b,c)+e}function y(a,b){var c;a.length>1&&(c=new CKEDITOR.dom.documentFragment(b.getDocument()));
|
||||
for(var d=0;d<a.length;d++){var e=a[d],e=e.replace(/(\r\n|\r)/g,"\n"),e=m(e,/^[ \t]*\n/,""),e=m(e,/\n$/,""),e=m(e,/^[ \t]+|[ \t]+$/g,function(a,b){return a.length==1?" ":b?" "+CKEDITOR.tools.repeat(" ",a.length-1):CKEDITOR.tools.repeat(" ",a.length-1)+" "}),e=e.replace(/\n/g,"<br>"),e=e.replace(/[ \t]{2,}/g,function(a){return CKEDITOR.tools.repeat(" ",a.length-1)+" "});if(c){var f=b.clone();f.setHtml(e);c.append(f)}else b.setHtml(e)}return c||b}function s(a,b){var c=this._.definition,
|
||||
d=c.attributes,c=c.styles,e=o(this)[a.getName()],f=CKEDITOR.tools.isEmpty(d)&&CKEDITOR.tools.isEmpty(c),g;for(g in d)if(!((g=="class"||this._.definition.fullMatch)&&a.getAttribute(g)!=l(g,d[g]))&&!(b&&g.slice(0,5)=="data-")){f=a.hasAttribute(g);a.removeAttribute(g)}for(var h in c)if(!(this._.definition.fullMatch&&a.getStyle(h)!=l(h,c[h],true))){f=f||!!a.getStyle(h);a.removeStyle(h)}q(a,e,r[a.getName()]);f&&(this._.definition.alwaysRemoveElement?t(a,1):!CKEDITOR.dtd.$block[a.getName()]||this._.enterMode==
|
||||
CKEDITOR.ENTER_BR&&!a.hasAttributes()?t(a):a.renameNode(this._.enterMode==CKEDITOR.ENTER_P?"p":"div"))}function w(a){for(var b=o(this),c=a.getElementsByTag(this.element),d,e=c.count();--e>=0;){d=c.getItem(e);d.isReadOnly()||s.call(this,d,true)}for(var f in b)if(f!=this.element){c=a.getElementsByTag(f);for(e=c.count()-1;e>=0;e--){d=c.getItem(e);d.isReadOnly()||q(d,b[f])}}}function q(a,b,c){if(b=b&&b.attributes)for(var d=0;d<b.length;d++){var e=b[d][0],f;if(f=a.getAttribute(e)){var g=b[d][1];(g===null||
|
||||
g.test&&g.test(f)||typeof g=="string"&&f==g)&&a.removeAttribute(e)}}c||t(a)}function t(a,b){if(!a.hasAttributes()||b)if(CKEDITOR.dtd.$block[a.getName()]){var c=a.getPrevious(F),d=a.getNext(F);c&&(c.type==CKEDITOR.NODE_TEXT||!c.isBlockBoundary({br:1}))&&a.append("br",1);d&&(d.type==CKEDITOR.NODE_TEXT||!d.isBlockBoundary({br:1}))&&a.append("br");a.remove(true)}else{c=a.getFirst();d=a.getLast();a.remove(true);if(c){c.type==CKEDITOR.NODE_ELEMENT&&c.mergeSiblings();d&&(!c.equals(d)&&d.type==CKEDITOR.NODE_ELEMENT)&&
|
||||
d.mergeSiblings()}}}function i(a,b,c){var d;d=a.element;d=="*"&&(d="span");d=new CKEDITOR.dom.element(d,b);c&&c.copyAttributes(d);d=A(d,a);b.getCustomData("doc_processing_style")&&d.hasAttribute("id")?d.removeAttribute("id"):b.setCustomData("doc_processing_style",1);return d}function A(a,b){var c=b._.definition,d=c.attributes,c=CKEDITOR.style.getStyleText(c);if(d)for(var e in d)a.setAttribute(e,d[e]);c&&a.setAttribute("style",c);return a}function u(a,b){for(var c in a)a[c]=a[c].replace(C,function(a,
|
||||
c){return b[c]})}function o(a){if(a._.overrides)return a._.overrides;var b=a._.overrides={},c=a._.definition.overrides;if(c){CKEDITOR.tools.isArray(c)||(c=[c]);for(var d=0;d<c.length;d++){var e=c[d],f,g;if(typeof e=="string")f=e.toLowerCase();else{f=e.element?e.element.toLowerCase():a.element;g=e.attributes}e=b[f]||(b[f]={});if(g){var e=e.attributes=e.attributes||[],h;for(h in g)e.push([h.toLowerCase(),g[h]])}}}return b}function l(a,b,c){var d=new CKEDITOR.dom.element("span");d[c?"setStyle":"setAttribute"](a,
|
||||
b);return d[c?"getStyle":"getAttribute"](a)}function p(a,b,c){for(var d=a.document,e=a.getRanges(),b=b?this.removeFromRange:this.applyToRange,f,g=e.createIterator();f=g.getNextRange();)b.call(this,f,c);a.selectRanges(e);d.removeCustomData("doc_processing_style")}var r={address:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,section:1,header:1,footer:1,nav:1,article:1,aside:1,figure:1,dialog:1,hgroup:1,time:1,meter:1,menu:1,command:1,keygen:1,output:1,progress:1,details:1,datagrid:1,datalist:1},n=
|
||||
{a:1,blockquote:1,embed:1,hr:1,img:1,li:1,object:1,ol:1,table:1,td:1,tr:1,th:1,ul:1,dl:1,dt:1,dd:1,form:1,audio:1,video:1},P=/\s*(?:;\s*|$)/,C=/#\((.+?)\)/g,L=CKEDITOR.dom.walker.bookmark(0,1),F=CKEDITOR.dom.walker.whitespaces(1);CKEDITOR.style=function(a,b){if(typeof a.type=="string")return new CKEDITOR.style.customHandlers[a.type](a);var c=a.attributes;if(c&&c.style){a.styles=CKEDITOR.tools.extend({},a.styles,CKEDITOR.tools.parseCssText(c.style));delete c.style}if(b){a=CKEDITOR.tools.clone(a);u(a.attributes,
|
||||
b);u(a.styles,b)}c=this.element=a.element?typeof a.element=="string"?a.element.toLowerCase():a.element:"*";this.type=a.type||(r[c]?CKEDITOR.STYLE_BLOCK:n[c]?CKEDITOR.STYLE_OBJECT:CKEDITOR.STYLE_INLINE);if(typeof this.element=="object")this.type=CKEDITOR.STYLE_OBJECT;this._={definition:a}};CKEDITOR.style.prototype={apply:function(a){if(a instanceof CKEDITOR.dom.document)return p.call(this,a.getSelection());if(this.checkApplicable(a.elementPath(),a)){var b=this._.enterMode;if(!b)this._.enterMode=a.activeEnterMode;
|
||||
p.call(this,a.getSelection(),0,a);this._.enterMode=b}},remove:function(a){if(a instanceof CKEDITOR.dom.document)return p.call(this,a.getSelection(),1);if(this.checkApplicable(a.elementPath(),a)){var b=this._.enterMode;if(!b)this._.enterMode=a.activeEnterMode;p.call(this,a.getSelection(),1,a);this._.enterMode=b}},applyToRange:function(a){this.applyToRange=this.type==CKEDITOR.STYLE_INLINE?f:this.type==CKEDITOR.STYLE_BLOCK?h:this.type==CKEDITOR.STYLE_OBJECT?e:null;return this.applyToRange(a)},removeFromRange:function(a){this.removeFromRange=
|
||||
this.type==CKEDITOR.STYLE_INLINE?b:this.type==CKEDITOR.STYLE_BLOCK?k:this.type==CKEDITOR.STYLE_OBJECT?d:null;return this.removeFromRange(a)},applyToObject:function(a){A(a,this)},checkActive:function(a,b){switch(this.type){case CKEDITOR.STYLE_BLOCK:return this.checkElementRemovable(a.block||a.blockLimit,true,b);case CKEDITOR.STYLE_OBJECT:case CKEDITOR.STYLE_INLINE:for(var c=a.elements,d=0,e;d<c.length;d++){e=c[d];if(!(this.type==CKEDITOR.STYLE_INLINE&&(e==a.block||e==a.blockLimit))){if(this.type==
|
||||
CKEDITOR.STYLE_OBJECT){var f=e.getName();if(!(typeof this.element=="string"?f==this.element:f in this.element))continue}if(this.checkElementRemovable(e,true,b))return true}}}return false},checkApplicable:function(a,b,c){b&&b instanceof CKEDITOR.filter&&(c=b);if(c&&!c.check(this))return false;switch(this.type){case CKEDITOR.STYLE_OBJECT:return!!a.contains(this.element);case CKEDITOR.STYLE_BLOCK:return!!a.blockLimit.getDtd()[this.element]}return true},checkElementMatch:function(a,b){var c=this._.definition;
|
||||
if(!a||!c.ignoreReadonly&&a.isReadOnly())return false;var d=a.getName();if(typeof this.element=="string"?d==this.element:d in this.element){if(!b&&!a.hasAttributes())return true;if(d=c._AC)c=d;else{var d={},e=0,f=c.attributes;if(f)for(var g in f){e++;d[g]=f[g]}if(g=CKEDITOR.style.getStyleText(c)){d.style||e++;d.style=g}d._length=e;c=c._AC=d}if(c._length){for(var h in c)if(h!="_length"){e=a.getAttribute(h)||"";if(h=="style")a:{d=c[h];typeof d=="string"&&(d=CKEDITOR.tools.parseCssText(d));typeof e==
|
||||
"string"&&(e=CKEDITOR.tools.parseCssText(e,true));g=void 0;for(g in d)if(!(g in e&&(e[g]==d[g]||d[g]=="inherit"||e[g]=="inherit"))){d=false;break a}d=true}else d=c[h]==e;if(d){if(!b)return true}else if(b)return false}if(b)return true}else return true}return false},checkElementRemovable:function(a,b,c){if(this.checkElementMatch(a,b,c))return true;if(b=o(this)[a.getName()]){var d;if(!(b=b.attributes))return true;for(c=0;c<b.length;c++){d=b[c][0];if(d=a.getAttribute(d)){var e=b[c][1];if(e===null)return true;
|
||||
if(typeof e=="string"){if(d==e)return true}else if(e.test(d))return true}}}return false},buildPreview:function(a){var b=this._.definition,c=[],d=b.element;d=="bdo"&&(d="span");var c=["<",d],e=b.attributes;if(e)for(var f in e)c.push(" ",f,'="',e[f],'"');(e=CKEDITOR.style.getStyleText(b))&&c.push(' style="',e,'"');c.push(">",a||b.name,"</",d,">");return c.join("")},getDefinition:function(){return this._.definition}};CKEDITOR.style.getStyleText=function(a){var b=a._ST;if(b)return b;var b=a.styles,c=
|
||||
a.attributes&&a.attributes.style||"",d="";c.length&&(c=c.replace(P,";"));for(var e in b){var f=b[e],g=(e+":"+f).replace(P,";");f=="inherit"?d=d+g:c=c+g}c.length&&(c=CKEDITOR.tools.normalizeCssText(c,true));return a._ST=c+d};CKEDITOR.style.customHandlers={};CKEDITOR.style.addCustomHandler=function(a){var b=function(a){this._={definition:a};this.setup&&this.setup(a)};b.prototype=CKEDITOR.tools.extend(CKEDITOR.tools.prototypedCopy(CKEDITOR.style.prototype),{assignedTo:CKEDITOR.STYLE_OBJECT},a,true);
|
||||
return this.customHandlers[a.type]=b};var K=CKEDITOR.POSITION_PRECEDING|CKEDITOR.POSITION_IDENTICAL|CKEDITOR.POSITION_IS_CONTAINED,I=CKEDITOR.POSITION_FOLLOWING|CKEDITOR.POSITION_IDENTICAL|CKEDITOR.POSITION_IS_CONTAINED})();CKEDITOR.styleCommand=function(a,f){this.requiredContent=this.allowedContent=this.style=a;CKEDITOR.tools.extend(this,f,true)};
|
||||
CKEDITOR.styleCommand.prototype.exec=function(a){a.focus();this.state==CKEDITOR.TRISTATE_OFF?a.applyStyle(this.style):this.state==CKEDITOR.TRISTATE_ON&&a.removeStyle(this.style)};CKEDITOR.stylesSet=new CKEDITOR.resourceManager("","stylesSet");CKEDITOR.addStylesSet=CKEDITOR.tools.bind(CKEDITOR.stylesSet.add,CKEDITOR.stylesSet);CKEDITOR.loadStylesSet=function(a,f,b){CKEDITOR.stylesSet.addExternal(a,f,"");CKEDITOR.stylesSet.load(a,b)};
|
||||
CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{attachStyleStateChange:function(a,f){var b=this._.styleStateChangeCallbacks;if(!b){b=this._.styleStateChangeCallbacks=[];this.on("selectionChange",function(a){for(var e=0;e<b.length;e++){var d=b[e],f=d.style.checkActive(a.data.path,this)?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF;d.fn.call(this,f)}})}b.push({style:a,fn:f})},applyStyle:function(a){a.apply(this)},removeStyle:function(a){a.remove(this)},getStylesSet:function(a){if(this._.stylesDefinitions)a(this._.stylesDefinitions);
|
||||
else{var f=this,b=f.config.stylesCombo_stylesSet||f.config.stylesSet;if(b===false)a(null);else if(b instanceof Array){f._.stylesDefinitions=b;a(b)}else{b||(b="default");var b=b.split(":"),c=b[0];CKEDITOR.stylesSet.addExternal(c,b[1]?b.slice(1).join(":"):CKEDITOR.getUrl("styles.js"),"");CKEDITOR.stylesSet.load(c,function(b){f._.stylesDefinitions=b[c];a(f._.stylesDefinitions)})}}}});
|
||||
CKEDITOR.dom.comment=function(a,f){typeof a=="string"&&(a=(f?f.$:document).createComment(a));CKEDITOR.dom.domObject.call(this,a)};CKEDITOR.dom.comment.prototype=new CKEDITOR.dom.node;CKEDITOR.tools.extend(CKEDITOR.dom.comment.prototype,{type:CKEDITOR.NODE_COMMENT,getOuterHtml:function(){return"<\!--"+this.$.nodeValue+"--\>"}});"use strict";
|
||||
(function(){var a={},f={},b;for(b in CKEDITOR.dtd.$blockLimit)b in CKEDITOR.dtd.$list||(a[b]=1);for(b in CKEDITOR.dtd.$block)b in CKEDITOR.dtd.$blockLimit||b in CKEDITOR.dtd.$empty||(f[b]=1);CKEDITOR.dom.elementPath=function(b,e){var d=null,h=null,k=[],j=b,g,e=e||b.getDocument().getBody();do if(j.type==CKEDITOR.NODE_ELEMENT){k.push(j);if(!this.lastElement){this.lastElement=j;if(j.is(CKEDITOR.dtd.$object)||j.getAttribute("contenteditable")=="false")continue}if(j.equals(e))break;if(!h){g=j.getName();
|
||||
j.getAttribute("contenteditable")=="true"?h=j:!d&&f[g]&&(d=j);if(a[g]){var m;if(m=!d){if(g=g=="div"){a:{g=j.getChildren();m=0;for(var y=g.count();m<y;m++){var s=g.getItem(m);if(s.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$block[s.getName()]){g=true;break a}}g=false}g=!g}m=g}m?d=j:h=j}}}while(j=j.getParent());h||(h=e);this.block=d;this.blockLimit=h;this.root=e;this.elements=k}})();
|
||||
CKEDITOR.dom.elementPath.prototype={compare:function(a){var f=this.elements,a=a&&a.elements;if(!a||f.length!=a.length)return false;for(var b=0;b<f.length;b++)if(!f[b].equals(a[b]))return false;return true},contains:function(a,f,b){var c;typeof a=="string"&&(c=function(b){return b.getName()==a});a instanceof CKEDITOR.dom.element?c=function(b){return b.equals(a)}:CKEDITOR.tools.isArray(a)?c=function(b){return CKEDITOR.tools.indexOf(a,b.getName())>-1}:typeof a=="function"?c=a:typeof a=="object"&&(c=
|
||||
function(b){return b.getName()in a});var e=this.elements,d=e.length;f&&d--;if(b){e=Array.prototype.slice.call(e,0);e.reverse()}for(f=0;f<d;f++)if(c(e[f]))return e[f];return null},isContextFor:function(a){var f;if(a in CKEDITOR.dtd.$block){f=this.contains(CKEDITOR.dtd.$intermediate)||this.root.equals(this.block)&&this.block||this.blockLimit;return!!f.getDtd()[a]}return true},direction:function(){return(this.block||this.blockLimit||this.root).getDirection(1)}};
|
||||
CKEDITOR.dom.text=function(a,f){typeof a=="string"&&(a=(f?f.$:document).createTextNode(a));this.$=a};CKEDITOR.dom.text.prototype=new CKEDITOR.dom.node;
|
||||
CKEDITOR.tools.extend(CKEDITOR.dom.text.prototype,{type:CKEDITOR.NODE_TEXT,getLength:function(){return this.$.nodeValue.length},getText:function(){return this.$.nodeValue},setText:function(a){this.$.nodeValue=a},split:function(a){var f=this.$.parentNode,b=f.childNodes.length,c=this.getLength(),e=this.getDocument(),d=new CKEDITOR.dom.text(this.$.splitText(a),e);if(f.childNodes.length==b)if(a>=c){d=e.createText("");d.insertAfter(this)}else{a=e.createText("");a.insertAfter(d);a.remove()}return d},substring:function(a,
|
||||
f){return typeof f!="number"?this.$.nodeValue.substr(a):this.$.nodeValue.substring(a,f)}});
|
||||
(function(){function a(a,c,e){var d=a.serializable,f=c[e?"endContainer":"startContainer"],k=e?"endOffset":"startOffset",j=d?c.document.getById(a.startNode):a.startNode,a=d?c.document.getById(a.endNode):a.endNode;if(f.equals(j.getPrevious())){c.startOffset=c.startOffset-f.getLength()-a.getPrevious().getLength();f=a.getNext()}else if(f.equals(a.getPrevious())){c.startOffset=c.startOffset-f.getLength();f=a.getNext()}f.equals(j.getParent())&&c[k]++;f.equals(a.getParent())&&c[k]++;c[e?"endContainer":"startContainer"]=
|
||||
f;return c}CKEDITOR.dom.rangeList=function(a){if(a instanceof CKEDITOR.dom.rangeList)return a;a?a instanceof CKEDITOR.dom.range&&(a=[a]):a=[];return CKEDITOR.tools.extend(a,f)};var f={createIterator:function(){var a=this,c=CKEDITOR.dom.walker.bookmark(),e=[],d;return{getNextRange:function(f){d=d===void 0?0:d+1;var k=a[d];if(k&&a.length>1){if(!d)for(var j=a.length-1;j>=0;j--)e.unshift(a[j].createBookmark(true));if(f)for(var g=0;a[d+g+1];){for(var m=k.document,f=0,j=m.getById(e[g].endNode),m=m.getById(e[g+
|
||||
1].startNode);;){j=j.getNextSourceNode(false);if(m.equals(j))f=1;else if(c(j)||j.type==CKEDITOR.NODE_ELEMENT&&j.isBlockBoundary())continue;break}if(!f)break;g++}for(k.moveToBookmark(e.shift());g--;){j=a[++d];j.moveToBookmark(e.shift());k.setEnd(j.endContainer,j.endOffset)}}return k}}},createBookmarks:function(b){for(var c=[],e,d=0;d<this.length;d++){c.push(e=this[d].createBookmark(b,true));for(var f=d+1;f<this.length;f++){this[f]=a(e,this[f]);this[f]=a(e,this[f],true)}}return c},createBookmarks2:function(a){for(var c=
|
||||
[],e=0;e<this.length;e++)c.push(this[e].createBookmark2(a));return c},moveToBookmarks:function(a){for(var c=0;c<this.length;c++)this[c].moveToBookmark(a[c])}}})();
|
||||
(function(){function a(){return CKEDITOR.getUrl(CKEDITOR.skinName.split(",")[1]||"skins/"+CKEDITOR.skinName.split(",")[0]+"/")}function f(b){var c=CKEDITOR.skin["ua_"+b],d=CKEDITOR.env;if(c)for(var c=c.split(",").sort(function(a,b){return a>b?-1:1}),e=0,f;e<c.length;e++){f=c[e];if(d.ie&&(f.replace(/^ie/,"")==d.version||d.quirks&&f=="iequirks"))f="ie";if(d[f]){b=b+("_"+c[e]);break}}return CKEDITOR.getUrl(a()+b+".css")}function b(a,b){if(!d[a]){CKEDITOR.document.appendStyleSheet(f(a));d[a]=1}b&&b()}
|
||||
function c(a){var b=a.getById(h);if(!b){b=a.getHead().append("style");b.setAttribute("id",h);b.setAttribute("type","text/css")}return b}function e(a,b,c){var d,e,f;if(CKEDITOR.env.webkit){b=b.split("}").slice(0,-1);for(e=0;e<b.length;e++)b[e]=b[e].split("{")}for(var h=0;h<a.length;h++)if(CKEDITOR.env.webkit)for(e=0;e<b.length;e++){f=b[e][1];for(d=0;d<c.length;d++)f=f.replace(c[d][0],c[d][1]);a[h].$.sheet.addRule(b[e][0],f)}else{f=b;for(d=0;d<c.length;d++)f=f.replace(c[d][0],c[d][1]);CKEDITOR.env.ie&&
|
||||
CKEDITOR.env.version<11?a[h].$.styleSheet.cssText=a[h].$.styleSheet.cssText+f:a[h].$.innerHTML=a[h].$.innerHTML+f}}var d={};CKEDITOR.skin={path:a,loadPart:function(c,d){CKEDITOR.skin.name!=CKEDITOR.skinName.split(",")[0]?CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(a()+"skin.js"),function(){b(c,d)}):b(c,d)},getPath:function(a){return CKEDITOR.getUrl(f(a))},icons:{},addIcon:function(a,b,c,d){a=a.toLowerCase();this.icons[a]||(this.icons[a]={path:b,offset:c||0,bgsize:d||"16px"})},getIconStyle:function(a,
|
||||
b,c,d,e){var f;if(a){a=a.toLowerCase();b&&(f=this.icons[a+"-rtl"]);f||(f=this.icons[a])}a=c||f&&f.path||"";d=d||f&&f.offset;e=e||f&&f.bgsize||"16px";return a&&"background-image:url("+CKEDITOR.getUrl(a)+");background-position:0 "+d+"px;background-size:"+e+";"}};CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{getUiColor:function(){return this.uiColor},setUiColor:function(a){var b=c(CKEDITOR.document);return(this.setUiColor=function(a){this.uiColor=a;var c=CKEDITOR.skin.chameleon,d="",f="";if(typeof c==
|
||||
"function"){d=c(this,"editor");f=c(this,"panel")}a=[[j,a]];e([b],d,a);e(k,f,a)}).call(this,a)}});var h="cke_ui_color",k=[],j=/\$color/g;CKEDITOR.on("instanceLoaded",function(a){if(!CKEDITOR.env.ie||!CKEDITOR.env.quirks){var b=a.editor,a=function(a){a=(a.data[0]||a.data).element.getElementsByTag("iframe").getItem(0).getFrameDocument();if(!a.getById("cke_ui_color")){a=c(a);k.push(a);var d=b.getUiColor();d&&e([a],CKEDITOR.skin.chameleon(b,"panel"),[[j,d]])}};b.on("panelShow",a);b.on("menuShow",a);b.config.uiColor&&
|
||||
b.setUiColor(b.config.uiColor)}})})();
|
||||
(function(){if(CKEDITOR.env.webkit)CKEDITOR.env.hc=false;else{var a=CKEDITOR.dom.element.createFromHtml('<div style="width:0;height:0;position:absolute;left:-10000px;border:1px solid;border-color:red blue"></div>',CKEDITOR.document);a.appendTo(CKEDITOR.document.getHead());try{var f=a.getComputedStyle("border-top-color"),b=a.getComputedStyle("border-right-color");CKEDITOR.env.hc=!!(f&&f==b)}catch(c){CKEDITOR.env.hc=false}a.remove()}if(CKEDITOR.env.hc)CKEDITOR.env.cssClass=CKEDITOR.env.cssClass+" cke_hc";
|
||||
CKEDITOR.document.appendStyleText(".cke{visibility:hidden;}");CKEDITOR.status="loaded";CKEDITOR.fireOnce("loaded");if(a=CKEDITOR._.pending){delete CKEDITOR._.pending;for(f=0;f<a.length;f++){CKEDITOR.editor.prototype.constructor.apply(a[f][0],a[f][1]);CKEDITOR.add(a[f][0])}}})();/*
|
||||
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.md or http://ckeditor.com/license
|
||||
*/
|
||||
CKEDITOR.skin.name="moono";CKEDITOR.skin.ua_editor="ie,iequirks,ie7,ie8,gecko";CKEDITOR.skin.ua_dialog="ie,iequirks,ie7,ie8";
|
||||
CKEDITOR.skin.chameleon=function(){var b=function(){return function(b,e){for(var a=b.match(/[^#]./g),c=0;3>c;c++){var f=a,h=c,d;d=parseInt(a[c],16);d=("0"+(0>e?0|d*(1+e):0|d+(255-d)*e).toString(16)).slice(-2);f[h]=d}return"#"+a.join("")}}(),c=function(){var b=new CKEDITOR.template("background:#{to};background-image:-webkit-gradient(linear,lefttop,leftbottom,from({from}),to({to}));background-image:-moz-linear-gradient(top,{from},{to});background-image:-webkit-linear-gradient(top,{from},{to});background-image:-o-linear-gradient(top,{from},{to});background-image:-ms-linear-gradient(top,{from},{to});background-image:linear-gradient(top,{from},{to});filter:progid:DXImageTransform.Microsoft.gradient(gradientType=0,startColorstr='{from}',endColorstr='{to}');");return function(c,
|
||||
a){return b.output({from:c,to:a})}}(),f={editor:new CKEDITOR.template("{id}.cke_chrome [border-color:{defaultBorder};] {id} .cke_top [ {defaultGradient}border-bottom-color:{defaultBorder};] {id} .cke_bottom [{defaultGradient}border-top-color:{defaultBorder};] {id} .cke_resizer [border-right-color:{ckeResizer}] {id} .cke_dialog_title [{defaultGradient}border-bottom-color:{defaultBorder};] {id} .cke_dialog_footer [{defaultGradient}outline-color:{defaultBorder};border-top-color:{defaultBorder};] {id} .cke_dialog_tab [{lightGradient}border-color:{defaultBorder};] {id} .cke_dialog_tab:hover [{mediumGradient}] {id} .cke_dialog_contents [border-top-color:{defaultBorder};] {id} .cke_dialog_tab_selected, {id} .cke_dialog_tab_selected:hover [background:{dialogTabSelected};border-bottom-color:{dialogTabSelectedBorder};] {id} .cke_dialog_body [background:{dialogBody};border-color:{defaultBorder};] {id} .cke_toolgroup [{lightGradient}border-color:{defaultBorder};] {id} a.cke_button_off:hover, {id} a.cke_button_off:focus, {id} a.cke_button_off:active [{mediumGradient}] {id} .cke_button_on [{ckeButtonOn}] {id} .cke_toolbar_separator [background-color: {ckeToolbarSeparator};] {id} .cke_combo_button [border-color:{defaultBorder};{lightGradient}] {id} a.cke_combo_button:hover, {id} a.cke_combo_button:focus, {id} .cke_combo_on a.cke_combo_button [border-color:{defaultBorder};{mediumGradient}] {id} .cke_path_item [color:{elementsPathColor};] {id} a.cke_path_item:hover, {id} a.cke_path_item:focus, {id} a.cke_path_item:active [background-color:{elementsPathBg};] {id}.cke_panel [border-color:{defaultBorder};] "),
|
||||
panel:new CKEDITOR.template(".cke_panel_grouptitle [{lightGradient}border-color:{defaultBorder};] .cke_menubutton_icon [background-color:{menubuttonIcon};] .cke_menubutton:hover .cke_menubutton_icon, .cke_menubutton:focus .cke_menubutton_icon, .cke_menubutton:active .cke_menubutton_icon [background-color:{menubuttonIconHover};] .cke_menuseparator [background-color:{menubuttonIcon};] a:hover.cke_colorbox, a:focus.cke_colorbox, a:active.cke_colorbox [border-color:{defaultBorder};] a:hover.cke_colorauto, a:hover.cke_colormore, a:focus.cke_colorauto, a:focus.cke_colormore, a:active.cke_colorauto, a:active.cke_colormore [background-color:{ckeColorauto};border-color:{defaultBorder};] ")};
|
||||
return function(g,e){var a=g.uiColor,a={id:"."+g.id,defaultBorder:b(a,-0.1),defaultGradient:c(b(a,0.9),a),lightGradient:c(b(a,1),b(a,0.7)),mediumGradient:c(b(a,0.8),b(a,0.5)),ckeButtonOn:c(b(a,0.6),b(a,0.7)),ckeResizer:b(a,-0.4),ckeToolbarSeparator:b(a,0.5),ckeColorauto:b(a,0.8),dialogBody:b(a,0.7),dialogTabSelected:c("#FFFFFF","#FFFFFF"),dialogTabSelectedBorder:"#FFF",elementsPathColor:b(a,-0.6),elementsPathBg:a,menubuttonIcon:b(a,0.5),menubuttonIconHover:b(a,0.3)};return f[e].output(a).replace(/\[/g,
|
||||
"{").replace(/\]/g,"}")}}();CKEDITOR.plugins.add("dialogui",{onLoad:function(){var h=function(b){this._||(this._={});this._["default"]=this._.initValue=b["default"]||"";this._.required=b.required||!1;for(var a=[this._],d=1;d<arguments.length;d++)a.push(arguments[d]);a.push(!0);CKEDITOR.tools.extend.apply(CKEDITOR.tools,a);return this._},r={build:function(b,a,d){return new CKEDITOR.ui.dialog.textInput(b,a,d)}},l={build:function(b,a,d){return new CKEDITOR.ui.dialog[a.type](b,a,d)}},n={isChanged:function(){return this.getValue()!=
|
||||
this.getInitValue()},reset:function(b){this.setValue(this.getInitValue(),b)},setInitValue:function(){this._.initValue=this.getValue()},resetInitValue:function(){this._.initValue=this._["default"]},getInitValue:function(){return this._.initValue}},o=CKEDITOR.tools.extend({},CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors,{onChange:function(b,a){this._.domOnChangeRegistered||(b.on("load",function(){this.getInputElement().on("change",function(){b.parts.dialog.isVisible()&&this.fire("change",{value:this.getValue()})},
|
||||
this)},this),this._.domOnChangeRegistered=!0);this.on("change",a)}},!0),s=/^on([A-Z]\w+)/,p=function(b){for(var a in b)(s.test(a)||"title"==a||"type"==a)&&delete b[a];return b};CKEDITOR.tools.extend(CKEDITOR.ui.dialog,{labeledElement:function(b,a,d,f){if(!(4>arguments.length)){var c=h.call(this,a);c.labelId=CKEDITOR.tools.getNextId()+"_label";this._.children=[];var e={role:a.role||"presentation"};a.includeLabel&&(e["aria-labelledby"]=c.labelId);CKEDITOR.ui.dialog.uiElement.call(this,b,a,d,"div",null,
|
||||
e,function(){var e=[],g=a.required?" cke_required":"";if(a.labelLayout!="horizontal")e.push('<label class="cke_dialog_ui_labeled_label'+g+'" ',' id="'+c.labelId+'"',c.inputId?' for="'+c.inputId+'"':"",(a.labelStyle?' style="'+a.labelStyle+'"':"")+">",a.label,"</label>",'<div class="cke_dialog_ui_labeled_content"',a.controlStyle?' style="'+a.controlStyle+'"':"",' role="presentation">',f.call(this,b,a),"</div>");else{g={type:"hbox",widths:a.widths,padding:0,children:[{type:"html",html:'<label class="cke_dialog_ui_labeled_label'+
|
||||
g+'" id="'+c.labelId+'" for="'+c.inputId+'"'+(a.labelStyle?' style="'+a.labelStyle+'"':"")+">"+CKEDITOR.tools.htmlEncode(a.label)+"</span>"},{type:"html",html:'<span class="cke_dialog_ui_labeled_content"'+(a.controlStyle?' style="'+a.controlStyle+'"':"")+">"+f.call(this,b,a)+"</span>"}]};CKEDITOR.dialog._.uiElementBuilders.hbox.build(b,g,e)}return e.join("")})}},textInput:function(b,a,d){if(!(3>arguments.length)){h.call(this,a);var f=this._.inputId=CKEDITOR.tools.getNextId()+"_textInput",c={"class":"cke_dialog_ui_input_"+
|
||||
a.type,id:f,type:a.type};a.validate&&(this.validate=a.validate);a.maxLength&&(c.maxlength=a.maxLength);a.size&&(c.size=a.size);a.inputStyle&&(c.style=a.inputStyle);var e=this,k=!1;b.on("load",function(){e.getInputElement().on("keydown",function(a){a.data.getKeystroke()==13&&(k=true)});e.getInputElement().on("keyup",function(a){if(a.data.getKeystroke()==13&&k){b.getButton("ok")&&setTimeout(function(){b.getButton("ok").click()},0);k=false}},null,null,1E3)});CKEDITOR.ui.dialog.labeledElement.call(this,
|
||||
b,a,d,function(){var b=['<div class="cke_dialog_ui_input_',a.type,'" role="presentation"'];a.width&&b.push('style="width:'+a.width+'" ');b.push("><input ");c["aria-labelledby"]=this._.labelId;this._.required&&(c["aria-required"]=this._.required);for(var e in c)b.push(e+'="'+c[e]+'" ');b.push(" /></div>");return b.join("")})}},textarea:function(b,a,d){if(!(3>arguments.length)){h.call(this,a);var f=this,c=this._.inputId=CKEDITOR.tools.getNextId()+"_textarea",e={};a.validate&&(this.validate=a.validate);
|
||||
e.rows=a.rows||5;e.cols=a.cols||20;e["class"]="cke_dialog_ui_input_textarea "+(a["class"]||"");"undefined"!=typeof a.inputStyle&&(e.style=a.inputStyle);a.dir&&(e.dir=a.dir);CKEDITOR.ui.dialog.labeledElement.call(this,b,a,d,function(){e["aria-labelledby"]=this._.labelId;this._.required&&(e["aria-required"]=this._.required);var a=['<div class="cke_dialog_ui_input_textarea" role="presentation"><textarea id="',c,'" '],b;for(b in e)a.push(b+'="'+CKEDITOR.tools.htmlEncode(e[b])+'" ');a.push(">",CKEDITOR.tools.htmlEncode(f._["default"]),
|
||||
"</textarea></div>");return a.join("")})}},checkbox:function(b,a,d){if(!(3>arguments.length)){var f=h.call(this,a,{"default":!!a["default"]});a.validate&&(this.validate=a.validate);CKEDITOR.ui.dialog.uiElement.call(this,b,a,d,"span",null,null,function(){var c=CKEDITOR.tools.extend({},a,{id:a.id?a.id+"_checkbox":CKEDITOR.tools.getNextId()+"_checkbox"},true),e=[],d=CKEDITOR.tools.getNextId()+"_label",g={"class":"cke_dialog_ui_checkbox_input",type:"checkbox","aria-labelledby":d};p(c);if(a["default"])g.checked=
|
||||
"checked";if(typeof c.inputStyle!="undefined")c.style=c.inputStyle;f.checkbox=new CKEDITOR.ui.dialog.uiElement(b,c,e,"input",null,g);e.push(' <label id="',d,'" for="',g.id,'"'+(a.labelStyle?' style="'+a.labelStyle+'"':"")+">",CKEDITOR.tools.htmlEncode(a.label),"</label>");return e.join("")})}},radio:function(b,a,d){if(!(3>arguments.length)){h.call(this,a);this._["default"]||(this._["default"]=this._.initValue=a.items[0][1]);a.validate&&(this.validate=a.valdiate);var f=[],c=this;a.role="radiogroup";
|
||||
a.includeLabel=!0;CKEDITOR.ui.dialog.labeledElement.call(this,b,a,d,function(){for(var e=[],d=[],g=(a.id?a.id:CKEDITOR.tools.getNextId())+"_radio",i=0;i<a.items.length;i++){var j=a.items[i],h=j[2]!==void 0?j[2]:j[0],l=j[1]!==void 0?j[1]:j[0],m=CKEDITOR.tools.getNextId()+"_radio_input",n=m+"_label",m=CKEDITOR.tools.extend({},a,{id:m,title:null,type:null},true),h=CKEDITOR.tools.extend({},m,{title:h},true),o={type:"radio","class":"cke_dialog_ui_radio_input",name:g,value:l,"aria-labelledby":n},q=[];if(c._["default"]==
|
||||
l)o.checked="checked";p(m);p(h);if(typeof m.inputStyle!="undefined")m.style=m.inputStyle;m.keyboardFocusable=true;f.push(new CKEDITOR.ui.dialog.uiElement(b,m,q,"input",null,o));q.push(" ");new CKEDITOR.ui.dialog.uiElement(b,h,q,"label",null,{id:n,"for":o.id},j[0]);e.push(q.join(""))}new CKEDITOR.ui.dialog.hbox(b,f,e,d);return d.join("")});this._.children=f}},button:function(b,a,d){if(arguments.length){"function"==typeof a&&(a=a(b.getParentEditor()));h.call(this,a,{disabled:a.disabled||!1});CKEDITOR.event.implementOn(this);
|
||||
var f=this;b.on("load",function(){var a=this.getElement();(function(){a.on("click",function(a){f.click();a.data.preventDefault()});a.on("keydown",function(a){a.data.getKeystroke()in{32:1}&&(f.click(),a.data.preventDefault())})})();a.unselectable()},this);var c=CKEDITOR.tools.extend({},a);delete c.style;var e=CKEDITOR.tools.getNextId()+"_label";CKEDITOR.ui.dialog.uiElement.call(this,b,c,d,"a",null,{style:a.style,href:"javascript:void(0)",title:a.label,hidefocus:"true","class":a["class"],role:"button",
|
||||
"aria-labelledby":e},'<span id="'+e+'" class="cke_dialog_ui_button">'+CKEDITOR.tools.htmlEncode(a.label)+"</span>")}},select:function(b,a,d){if(!(3>arguments.length)){var f=h.call(this,a);a.validate&&(this.validate=a.validate);f.inputId=CKEDITOR.tools.getNextId()+"_select";CKEDITOR.ui.dialog.labeledElement.call(this,b,a,d,function(){var c=CKEDITOR.tools.extend({},a,{id:a.id?a.id+"_select":CKEDITOR.tools.getNextId()+"_select"},true),e=[],d=[],g={id:f.inputId,"class":"cke_dialog_ui_input_select","aria-labelledby":this._.labelId};
|
||||
e.push('<div class="cke_dialog_ui_input_',a.type,'" role="presentation"');a.width&&e.push('style="width:'+a.width+'" ');e.push(">");if(a.size!==void 0)g.size=a.size;if(a.multiple!==void 0)g.multiple=a.multiple;p(c);for(var i=0,j;i<a.items.length&&(j=a.items[i]);i++)d.push('<option value="',CKEDITOR.tools.htmlEncode(j[1]!==void 0?j[1]:j[0]).replace(/"/g,"""),'" /> ',CKEDITOR.tools.htmlEncode(j[0]));if(typeof c.inputStyle!="undefined")c.style=c.inputStyle;f.select=new CKEDITOR.ui.dialog.uiElement(b,
|
||||
c,e,"select",null,g,d.join(""));e.push("</div>");return e.join("")})}},file:function(b,a,d){if(!(3>arguments.length)){void 0===a["default"]&&(a["default"]="");var f=CKEDITOR.tools.extend(h.call(this,a),{definition:a,buttons:[]});a.validate&&(this.validate=a.validate);b.on("load",function(){CKEDITOR.document.getById(f.frameId).getParent().addClass("cke_dialog_ui_input_file")});CKEDITOR.ui.dialog.labeledElement.call(this,b,a,d,function(){f.frameId=CKEDITOR.tools.getNextId()+"_fileInput";var b=['<iframe frameborder="0" allowtransparency="0" class="cke_dialog_ui_input_file" role="presentation" id="',
|
||||
f.frameId,'" title="',a.label,'" src="javascript:void('];b.push(CKEDITOR.env.ie?"(function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.close();")+"})()":"0");b.push(')"></iframe>');return b.join("")})}},fileButton:function(b,a,d){var f=this;if(!(3>arguments.length)){h.call(this,a);a.validate&&(this.validate=a.validate);var c=CKEDITOR.tools.extend({},a),e=c.onClick;c.className=(c.className?c.className+" ":"")+"cke_dialog_ui_button";c.onClick=function(c){var d=
|
||||
a["for"];if(!e||e.call(this,c)!==false){b.getContentElement(d[0],d[1]).submit();this.disable()}};b.on("load",function(){b.getContentElement(a["for"][0],a["for"][1])._.buttons.push(f)});CKEDITOR.ui.dialog.button.call(this,b,c,d)}},html:function(){var b=/^\s*<[\w:]+\s+([^>]*)?>/,a=/^(\s*<[\w:]+(?:\s+[^>]*)?)((?:.|\r|\n)+)$/,d=/\/$/;return function(f,c,e){if(!(3>arguments.length)){var k=[],g=c.html;"<"!=g.charAt(0)&&(g="<span>"+g+"</span>");var i=c.focus;if(i){var j=this.focus;this.focus=function(){("function"==
|
||||
typeof i?i:j).call(this);this.fire("focus")};c.isFocusable&&(this.isFocusable=this.isFocusable);this.keyboardFocusable=!0}CKEDITOR.ui.dialog.uiElement.call(this,f,c,k,"span",null,null,"");k=k.join("").match(b);g=g.match(a)||["","",""];d.test(g[1])&&(g[1]=g[1].slice(0,-1),g[2]="/"+g[2]);e.push([g[1]," ",k[1]||"",g[2]].join(""))}}}(),fieldset:function(b,a,d,f,c){var e=c.label;this._={children:a};CKEDITOR.ui.dialog.uiElement.call(this,b,c,f,"fieldset",null,null,function(){var a=[];e&&a.push("<legend"+
|
||||
(c.labelStyle?' style="'+c.labelStyle+'"':"")+">"+e+"</legend>");for(var b=0;b<d.length;b++)a.push(d[b]);return a.join("")})}},!0);CKEDITOR.ui.dialog.html.prototype=new CKEDITOR.ui.dialog.uiElement;CKEDITOR.ui.dialog.labeledElement.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{setLabel:function(b){var a=CKEDITOR.document.getById(this._.labelId);1>a.getChildCount()?(new CKEDITOR.dom.text(b,CKEDITOR.document)).appendTo(a):a.getChild(0).$.nodeValue=b;return this},getLabel:function(){var b=
|
||||
CKEDITOR.document.getById(this._.labelId);return!b||1>b.getChildCount()?"":b.getChild(0).getText()},eventProcessors:o},!0);CKEDITOR.ui.dialog.button.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{click:function(){return!this._.disabled?this.fire("click",{dialog:this._.dialog}):!1},enable:function(){this._.disabled=!1;var b=this.getElement();b&&b.removeClass("cke_disabled")},disable:function(){this._.disabled=!0;this.getElement().addClass("cke_disabled")},isVisible:function(){return this.getElement().getFirst().isVisible()},
|
||||
isEnabled:function(){return!this._.disabled},eventProcessors:CKEDITOR.tools.extend({},CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors,{onClick:function(b,a){this.on("click",function(){a.apply(this,arguments)})}},!0),accessKeyUp:function(){this.click()},accessKeyDown:function(){this.focus()},keyboardFocusable:!0},!0);CKEDITOR.ui.dialog.textInput.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement,{getInputElement:function(){return CKEDITOR.document.getById(this._.inputId)},
|
||||
focus:function(){var b=this.selectParentTab();setTimeout(function(){var a=b.getInputElement();a&&a.$.focus()},0)},select:function(){var b=this.selectParentTab();setTimeout(function(){var a=b.getInputElement();a&&(a.$.focus(),a.$.select())},0)},accessKeyUp:function(){this.select()},setValue:function(b){!b&&(b="");return CKEDITOR.ui.dialog.uiElement.prototype.setValue.apply(this,arguments)},keyboardFocusable:!0},n,!0);CKEDITOR.ui.dialog.textarea.prototype=new CKEDITOR.ui.dialog.textInput;CKEDITOR.ui.dialog.select.prototype=
|
||||
CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement,{getInputElement:function(){return this._.select.getElement()},add:function(b,a,d){var f=new CKEDITOR.dom.element("option",this.getDialog().getParentEditor().document),c=this.getInputElement().$;f.$.text=b;f.$.value=void 0===a||null===a?b:a;void 0===d||null===d?CKEDITOR.env.ie?c.add(f.$):c.add(f.$,null):c.add(f.$,d);return this},remove:function(b){this.getInputElement().$.remove(b);return this},clear:function(){for(var b=this.getInputElement().$;0<
|
||||
b.length;)b.remove(0);return this},keyboardFocusable:!0},n,!0);CKEDITOR.ui.dialog.checkbox.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{getInputElement:function(){return this._.checkbox.getElement()},setValue:function(b,a){this.getInputElement().$.checked=b;!a&&this.fire("change",{value:b})},getValue:function(){return this.getInputElement().$.checked},accessKeyUp:function(){this.setValue(!this.getValue())},eventProcessors:{onChange:function(b,a){if(!CKEDITOR.env.ie||8<CKEDITOR.env.version)return o.onChange.apply(this,
|
||||
arguments);b.on("load",function(){var a=this._.checkbox.getElement();a.on("propertychange",function(b){b=b.data.$;"checked"==b.propertyName&&this.fire("change",{value:a.$.checked})},this)},this);this.on("change",a);return null}},keyboardFocusable:!0},n,!0);CKEDITOR.ui.dialog.radio.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{setValue:function(b,a){for(var d=this._.children,f,c=0;c<d.length&&(f=d[c]);c++)f.getElement().$.checked=f.getValue()==b;!a&&this.fire("change",{value:b})},
|
||||
getValue:function(){for(var b=this._.children,a=0;a<b.length;a++)if(b[a].getElement().$.checked)return b[a].getValue();return null},accessKeyUp:function(){var b=this._.children,a;for(a=0;a<b.length;a++)if(b[a].getElement().$.checked){b[a].getElement().focus();return}b[0].getElement().focus()},eventProcessors:{onChange:function(b,a){if(CKEDITOR.env.ie)b.on("load",function(){for(var a=this._.children,b=this,c=0;c<a.length;c++)a[c].getElement().on("propertychange",function(a){a=a.data.$;"checked"==a.propertyName&&
|
||||
this.$.checked&&b.fire("change",{value:this.getAttribute("value")})})},this),this.on("change",a);else return o.onChange.apply(this,arguments);return null}}},n,!0);CKEDITOR.ui.dialog.file.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement,n,{getInputElement:function(){var b=CKEDITOR.document.getById(this._.frameId).getFrameDocument();return 0<b.$.forms.length?new CKEDITOR.dom.element(b.$.forms[0].elements[0]):this.getElement()},submit:function(){this.getInputElement().getParent().$.submit();
|
||||
return this},getAction:function(){return this.getInputElement().getParent().$.action},registerEvents:function(b){var a=/^on([A-Z]\w+)/,d,f=function(a,b,c,d){a.on("formLoaded",function(){a.getInputElement().on(c,d,a)})},c;for(c in b)if(d=c.match(a))this.eventProcessors[c]?this.eventProcessors[c].call(this,this._.dialog,b[c]):f(this,this._.dialog,d[1].toLowerCase(),b[c]);return this},reset:function(){function b(){d.$.open();var b="";f.size&&(b=f.size-(CKEDITOR.env.ie?7:0));var h=a.frameId+"_input";
|
||||
d.$.write(['<html dir="'+g+'" lang="'+i+'"><head><title></title></head><body style="margin: 0; overflow: hidden; background: transparent;">','<form enctype="multipart/form-data" method="POST" dir="'+g+'" lang="'+i+'" action="',CKEDITOR.tools.htmlEncode(f.action),'"><label id="',a.labelId,'" for="',h,'" style="display:none">',CKEDITOR.tools.htmlEncode(f.label),'</label><input style="width:100%" id="',h,'" aria-labelledby="',a.labelId,'" type="file" name="',CKEDITOR.tools.htmlEncode(f.id||"cke_upload"),
|
||||
'" size="',CKEDITOR.tools.htmlEncode(0<b?b:""),'" /></form></body></html><script>',CKEDITOR.env.ie?"("+CKEDITOR.tools.fixDomain+")();":"","window.parent.CKEDITOR.tools.callFunction("+e+");","window.onbeforeunload = function() {window.parent.CKEDITOR.tools.callFunction("+k+")}","<\/script>"].join(""));d.$.close();for(b=0;b<c.length;b++)c[b].enable()}var a=this._,d=CKEDITOR.document.getById(a.frameId).getFrameDocument(),f=a.definition,c=a.buttons,e=this.formLoadedNumber,k=this.formUnloadNumber,g=a.dialog._.editor.lang.dir,
|
||||
i=a.dialog._.editor.langCode;e||(e=this.formLoadedNumber=CKEDITOR.tools.addFunction(function(){this.fire("formLoaded")},this),k=this.formUnloadNumber=CKEDITOR.tools.addFunction(function(){this.getInputElement().clearCustomData()},this),this.getDialog()._.editor.on("destroy",function(){CKEDITOR.tools.removeFunction(e);CKEDITOR.tools.removeFunction(k)}));CKEDITOR.env.gecko?setTimeout(b,500):b()},getValue:function(){return this.getInputElement().$.value||""},setInitValue:function(){this._.initValue=
|
||||
""},eventProcessors:{onChange:function(b,a){this._.domOnChangeRegistered||(this.on("formLoaded",function(){this.getInputElement().on("change",function(){this.fire("change",{value:this.getValue()})},this)},this),this._.domOnChangeRegistered=!0);this.on("change",a)}},keyboardFocusable:!0},!0);CKEDITOR.ui.dialog.fileButton.prototype=new CKEDITOR.ui.dialog.button;CKEDITOR.ui.dialog.fieldset.prototype=CKEDITOR.tools.clone(CKEDITOR.ui.dialog.hbox.prototype);CKEDITOR.dialog.addUIElement("text",r);CKEDITOR.dialog.addUIElement("password",
|
||||
r);CKEDITOR.dialog.addUIElement("textarea",l);CKEDITOR.dialog.addUIElement("checkbox",l);CKEDITOR.dialog.addUIElement("radio",l);CKEDITOR.dialog.addUIElement("button",l);CKEDITOR.dialog.addUIElement("select",l);CKEDITOR.dialog.addUIElement("file",l);CKEDITOR.dialog.addUIElement("fileButton",l);CKEDITOR.dialog.addUIElement("html",l);CKEDITOR.dialog.addUIElement("fieldset",{build:function(b,a,d){for(var f=a.children,c,e=[],h=[],g=0;g<f.length&&(c=f[g]);g++){var i=[];e.push(i);h.push(CKEDITOR.dialog._.uiElementBuilders[c.type].build(b,
|
||||
c,i))}return new CKEDITOR.ui.dialog[a.type](b,h,e,d,a)}})}});CKEDITOR.DIALOG_RESIZE_NONE=0;CKEDITOR.DIALOG_RESIZE_WIDTH=1;CKEDITOR.DIALOG_RESIZE_HEIGHT=2;CKEDITOR.DIALOG_RESIZE_BOTH=3;
|
||||
(function(){function t(){for(var a=this._.tabIdList.length,b=CKEDITOR.tools.indexOf(this._.tabIdList,this._.currentTabId)+a,c=b-1;c>b-a;c--)if(this._.tabs[this._.tabIdList[c%a]][0].$.offsetHeight)return this._.tabIdList[c%a];return null}function u(){for(var a=this._.tabIdList.length,b=CKEDITOR.tools.indexOf(this._.tabIdList,this._.currentTabId),c=b+1;c<b+a;c++)if(this._.tabs[this._.tabIdList[c%a]][0].$.offsetHeight)return this._.tabIdList[c%a];return null}function G(a,b){for(var c=a.$.getElementsByTagName("input"),
|
||||
e=0,d=c.length;e<d;e++){var g=new CKEDITOR.dom.element(c[e]);"text"==g.getAttribute("type").toLowerCase()&&(b?(g.setAttribute("value",g.getCustomData("fake_value")||""),g.removeCustomData("fake_value")):(g.setCustomData("fake_value",g.getAttribute("value")),g.setAttribute("value","")))}}function P(a,b){var c=this.getInputElement();c&&(a?c.removeAttribute("aria-invalid"):c.setAttribute("aria-invalid",!0));a||(this.select?this.select():this.focus());b&&alert(b);this.fire("validated",{valid:a,msg:b})}
|
||||
function Q(){var a=this.getInputElement();a&&a.removeAttribute("aria-invalid")}function R(a){var a=CKEDITOR.dom.element.createFromHtml(CKEDITOR.addTemplate("dialog",S).output({id:CKEDITOR.tools.getNextNumber(),editorId:a.id,langDir:a.lang.dir,langCode:a.langCode,editorDialogClass:"cke_editor_"+a.name.replace(/\./g,"\\.")+"_dialog",closeTitle:a.lang.common.close,hidpi:CKEDITOR.env.hidpi?"cke_hidpi":""})),b=a.getChild([0,0,0,0,0]),c=b.getChild(0),e=b.getChild(1);if(CKEDITOR.env.ie&&!CKEDITOR.env.quirks){var d=
|
||||
"javascript:void(function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.close();")+"}())";CKEDITOR.dom.element.createFromHtml('<iframe frameBorder="0" class="cke_iframe_shim" src="'+d+'" tabIndex="-1"></iframe>').appendTo(b.getParent())}c.unselectable();e.unselectable();return{element:a,parts:{dialog:a.getChild(0),title:c,close:e,tabs:b.getChild(2),contents:b.getChild([3,0,0,0]),footer:b.getChild([3,0,1,0])}}}function H(a,b,c){this.element=b;this.focusIndex=c;this.tabIndex=
|
||||
0;this.isFocusable=function(){return!b.getAttribute("disabled")&&b.isVisible()};this.focus=function(){a._.currentFocusIndex=this.focusIndex;this.element.focus()};b.on("keydown",function(a){a.data.getKeystroke()in{32:1,13:1}&&this.fire("click")});b.on("focus",function(){this.fire("mouseover")});b.on("blur",function(){this.fire("mouseout")})}function T(a){function b(){a.layout()}var c=CKEDITOR.document.getWindow();c.on("resize",b);a.on("hide",function(){c.removeListener("resize",b)})}function I(a,b){this._=
|
||||
{dialog:a};CKEDITOR.tools.extend(this,b)}function U(a){function b(b){var c=a.getSize(),i=CKEDITOR.document.getWindow().getViewPaneSize(),o=b.data.$.screenX,j=b.data.$.screenY,n=o-e.x,l=j-e.y;e={x:o,y:j};d.x+=n;d.y+=l;a.move(d.x+h[3]<f?-h[3]:d.x-h[1]>i.width-c.width-f?i.width-c.width+("rtl"==g.lang.dir?0:h[1]):d.x,d.y+h[0]<f?-h[0]:d.y-h[2]>i.height-c.height-f?i.height-c.height+h[2]:d.y,1);b.data.preventDefault()}function c(){CKEDITOR.document.removeListener("mousemove",b);CKEDITOR.document.removeListener("mouseup",
|
||||
c);if(CKEDITOR.env.ie6Compat){var a=q.getChild(0).getFrameDocument();a.removeListener("mousemove",b);a.removeListener("mouseup",c)}}var e=null,d=null,g=a.getParentEditor(),f=g.config.dialog_magnetDistance,h=CKEDITOR.skin.margins||[0,0,0,0];"undefined"==typeof f&&(f=20);a.parts.title.on("mousedown",function(f){e={x:f.data.$.screenX,y:f.data.$.screenY};CKEDITOR.document.on("mousemove",b);CKEDITOR.document.on("mouseup",c);d=a.getPosition();if(CKEDITOR.env.ie6Compat){var h=q.getChild(0).getFrameDocument();
|
||||
h.on("mousemove",b);h.on("mouseup",c)}f.data.preventDefault()},a)}function V(a){var b,c;function e(d){var e="rtl"==h.lang.dir,j=o.width,C=o.height,D=j+(d.data.$.screenX-b)*(e?-1:1)*(a._.moved?1:2),n=C+(d.data.$.screenY-c)*(a._.moved?1:2),x=a._.element.getFirst(),x=e&&x.getComputedStyle("right"),y=a.getPosition();y.y+n>i.height&&(n=i.height-y.y);if((e?x:y.x)+D>i.width)D=i.width-(e?x:y.x);if(f==CKEDITOR.DIALOG_RESIZE_WIDTH||f==CKEDITOR.DIALOG_RESIZE_BOTH)j=Math.max(g.minWidth||0,D-m);if(f==CKEDITOR.DIALOG_RESIZE_HEIGHT||
|
||||
f==CKEDITOR.DIALOG_RESIZE_BOTH)C=Math.max(g.minHeight||0,n-k);a.resize(j,C);a._.moved||a.layout();d.data.preventDefault()}function d(){CKEDITOR.document.removeListener("mouseup",d);CKEDITOR.document.removeListener("mousemove",e);j&&(j.remove(),j=null);if(CKEDITOR.env.ie6Compat){var a=q.getChild(0).getFrameDocument();a.removeListener("mouseup",d);a.removeListener("mousemove",e)}}var g=a.definition,f=g.resizable;if(f!=CKEDITOR.DIALOG_RESIZE_NONE){var h=a.getParentEditor(),m,k,i,o,j,n=CKEDITOR.tools.addFunction(function(f){o=
|
||||
a.getSize();var h=a.parts.contents;h.$.getElementsByTagName("iframe").length&&(j=CKEDITOR.dom.element.createFromHtml('<div class="cke_dialog_resize_cover" style="height: 100%; position: absolute; width: 100%;"></div>'),h.append(j));k=o.height-a.parts.contents.getSize("height",!(CKEDITOR.env.gecko||CKEDITOR.env.ie&&CKEDITOR.env.quirks));m=o.width-a.parts.contents.getSize("width",1);b=f.screenX;c=f.screenY;i=CKEDITOR.document.getWindow().getViewPaneSize();CKEDITOR.document.on("mousemove",e);CKEDITOR.document.on("mouseup",
|
||||
d);CKEDITOR.env.ie6Compat&&(h=q.getChild(0).getFrameDocument(),h.on("mousemove",e),h.on("mouseup",d));f.preventDefault&&f.preventDefault()});a.on("load",function(){var b="";f==CKEDITOR.DIALOG_RESIZE_WIDTH?b=" cke_resizer_horizontal":f==CKEDITOR.DIALOG_RESIZE_HEIGHT&&(b=" cke_resizer_vertical");b=CKEDITOR.dom.element.createFromHtml('<div class="cke_resizer'+b+" cke_resizer_"+h.lang.dir+'" title="'+CKEDITOR.tools.htmlEncode(h.lang.common.resize)+'" onmousedown="CKEDITOR.tools.callFunction('+n+', event )">'+
|
||||
("ltr"==h.lang.dir?"◢":"◣")+"</div>");a.parts.footer.append(b,1)});h.on("destroy",function(){CKEDITOR.tools.removeFunction(n)})}}function E(a){a.data.preventDefault(1)}function J(a){var b=CKEDITOR.document.getWindow(),c=a.config,e=c.dialog_backgroundCoverColor||"white",d=c.dialog_backgroundCoverOpacity,g=c.baseFloatZIndex,c=CKEDITOR.tools.genKey(e,d,g),f=w[c];f?f.show():(g=['<div tabIndex="-1" style="position: ',CKEDITOR.env.ie6Compat?"absolute":"fixed","; z-index: ",g,"; top: 0px; left: 0px; ",!CKEDITOR.env.ie6Compat?
|
||||
"background-color: "+e:"",'" class="cke_dialog_background_cover">'],CKEDITOR.env.ie6Compat&&(e="<html><body style=\\'background-color:"+e+";\\'></body></html>",g.push('<iframe hidefocus="true" frameborder="0" id="cke_dialog_background_iframe" src="javascript:'),g.push("void((function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.write( '"+e+"' );document.close();")+"})())"),g.push('" style="position:absolute;left:0;top:0;width:100%;height: 100%;filter: progid:DXImageTransform.Microsoft.Alpha(opacity=0)"></iframe>')),
|
||||
g.push("</div>"),f=CKEDITOR.dom.element.createFromHtml(g.join("")),f.setOpacity(void 0!==d?d:0.5),f.on("keydown",E),f.on("keypress",E),f.on("keyup",E),f.appendTo(CKEDITOR.document.getBody()),w[c]=f);a.focusManager.add(f);q=f;var a=function(){var a=b.getViewPaneSize();f.setStyles({width:a.width+"px",height:a.height+"px"})},h=function(){var a=b.getScrollPosition(),c=CKEDITOR.dialog._.currentTop;f.setStyles({left:a.x+"px",top:a.y+"px"});if(c){do{a=c.getPosition();c.move(a.x,a.y)}while(c=c._.parentDialog)
|
||||
}};F=a;b.on("resize",a);a();(!CKEDITOR.env.mac||!CKEDITOR.env.webkit)&&f.focus();if(CKEDITOR.env.ie6Compat){var m=function(){h();arguments.callee.prevScrollHandler.apply(this,arguments)};b.$.setTimeout(function(){m.prevScrollHandler=window.onscroll||function(){};window.onscroll=m},0);h()}}function K(a){q&&(a.focusManager.remove(q),a=CKEDITOR.document.getWindow(),q.hide(),a.removeListener("resize",F),CKEDITOR.env.ie6Compat&&a.$.setTimeout(function(){window.onscroll=window.onscroll&&window.onscroll.prevScrollHandler||
|
||||
null},0),F=null)}var r=CKEDITOR.tools.cssLength,S='<div class="cke_reset_all {editorId} {editorDialogClass} {hidpi}" dir="{langDir}" lang="{langCode}" role="dialog" aria-labelledby="cke_dialog_title_{id}"><table class="cke_dialog '+CKEDITOR.env.cssClass+' cke_{langDir}" style="position:absolute" role="presentation"><tr><td role="presentation"><div class="cke_dialog_body" role="presentation"><div id="cke_dialog_title_{id}" class="cke_dialog_title" role="presentation"></div><a id="cke_dialog_close_button_{id}" class="cke_dialog_close_button" href="javascript:void(0)" title="{closeTitle}" role="button"><span class="cke_label">X</span></a><div id="cke_dialog_tabs_{id}" class="cke_dialog_tabs" role="tablist"></div><table class="cke_dialog_contents" role="presentation"><tr><td id="cke_dialog_contents_{id}" class="cke_dialog_contents_body" role="presentation"></td></tr><tr><td id="cke_dialog_footer_{id}" class="cke_dialog_footer" role="presentation"></td></tr></table></div></td></tr></table></div>';
|
||||
CKEDITOR.dialog=function(a,b){function c(){var a=l._.focusList;a.sort(function(a,b){return a.tabIndex!=b.tabIndex?b.tabIndex-a.tabIndex:a.focusIndex-b.focusIndex});for(var b=a.length,c=0;c<b;c++)a[c].focusIndex=c}function e(a){var b=l._.focusList,a=a||0;if(!(1>b.length)){var c=l._.currentFocusIndex;try{b[c].getInputElement().$.blur()}catch(f){}for(var d=c=(c+a+b.length)%b.length;a&&!b[d].isFocusable()&&!(d=(d+a+b.length)%b.length,d==c););b[d].focus();"text"==b[d].type&&b[d].select()}}function d(b){if(l==
|
||||
CKEDITOR.dialog._.currentTop){var c=b.data.getKeystroke(),d="rtl"==a.lang.dir;o=j=0;if(9==c||c==CKEDITOR.SHIFT+9)c=c==CKEDITOR.SHIFT+9,l._.tabBarMode?(c=c?t.call(l):u.call(l),l.selectPage(c),l._.tabs[c][0].focus()):e(c?-1:1),o=1;else if(c==CKEDITOR.ALT+121&&!l._.tabBarMode&&1<l.getPageCount())l._.tabBarMode=!0,l._.tabs[l._.currentTabId][0].focus(),o=1;else if((37==c||39==c)&&l._.tabBarMode)c=c==(d?39:37)?t.call(l):u.call(l),l.selectPage(c),l._.tabs[c][0].focus(),o=1;else if((13==c||32==c)&&l._.tabBarMode)this.selectPage(this._.currentTabId),
|
||||
this._.tabBarMode=!1,this._.currentFocusIndex=-1,e(1),o=1;else if(13==c){c=b.data.getTarget();if(!c.is("a","button","select","textarea")&&(!c.is("input")||"button"!=c.$.type))(c=this.getButton("ok"))&&CKEDITOR.tools.setTimeout(c.click,0,c),o=1;j=1}else if(27==c)(c=this.getButton("cancel"))?CKEDITOR.tools.setTimeout(c.click,0,c):!1!==this.fire("cancel",{hide:!0}).hide&&this.hide(),j=1;else return;g(b)}}function g(a){o?a.data.preventDefault(1):j&&a.data.stopPropagation()}var f=CKEDITOR.dialog._.dialogDefinitions[b],
|
||||
h=CKEDITOR.tools.clone(W),m=a.config.dialog_buttonsOrder||"OS",k=a.lang.dir,i={},o,j;("OS"==m&&CKEDITOR.env.mac||"rtl"==m&&"ltr"==k||"ltr"==m&&"rtl"==k)&&h.buttons.reverse();f=CKEDITOR.tools.extend(f(a),h);f=CKEDITOR.tools.clone(f);f=new L(this,f);h=R(a);this._={editor:a,element:h.element,name:b,contentSize:{width:0,height:0},size:{width:0,height:0},contents:{},buttons:{},accessKeyMap:{},tabs:{},tabIdList:[],currentTabId:null,currentTabIndex:null,pageCount:0,lastTab:null,tabBarMode:!1,focusList:[],
|
||||
currentFocusIndex:0,hasFocus:!1};this.parts=h.parts;CKEDITOR.tools.setTimeout(function(){a.fire("ariaWidget",this.parts.contents)},0,this);h={position:CKEDITOR.env.ie6Compat?"absolute":"fixed",top:0,visibility:"hidden"};h["rtl"==k?"right":"left"]=0;this.parts.dialog.setStyles(h);CKEDITOR.event.call(this);this.definition=f=CKEDITOR.fire("dialogDefinition",{name:b,definition:f},a).definition;if(!("removeDialogTabs"in a._)&&a.config.removeDialogTabs){h=a.config.removeDialogTabs.split(";");for(k=0;k<
|
||||
h.length;k++)if(m=h[k].split(":"),2==m.length){var n=m[0];i[n]||(i[n]=[]);i[n].push(m[1])}a._.removeDialogTabs=i}if(a._.removeDialogTabs&&(i=a._.removeDialogTabs[b]))for(k=0;k<i.length;k++)f.removeContents(i[k]);if(f.onLoad)this.on("load",f.onLoad);if(f.onShow)this.on("show",f.onShow);if(f.onHide)this.on("hide",f.onHide);if(f.onOk)this.on("ok",function(b){a.fire("saveSnapshot");setTimeout(function(){a.fire("saveSnapshot")},0);!1===f.onOk.call(this,b)&&(b.data.hide=!1)});if(f.onCancel)this.on("cancel",
|
||||
function(a){!1===f.onCancel.call(this,a)&&(a.data.hide=!1)});var l=this,p=function(a){var b=l._.contents,c=!1,d;for(d in b)for(var f in b[d])if(c=a.call(this,b[d][f]))return};this.on("ok",function(a){p(function(b){if(b.validate){var c=b.validate(this),d="string"==typeof c||!1===c;d&&(a.data.hide=!1,a.stop());P.call(b,!d,"string"==typeof c?c:void 0);return d}})},this,null,0);this.on("cancel",function(b){p(function(c){if(c.isChanged())return!a.config.dialog_noConfirmCancel&&!confirm(a.lang.common.confirmCancel)&&
|
||||
(b.data.hide=!1),!0})},this,null,0);this.parts.close.on("click",function(a){!1!==this.fire("cancel",{hide:!0}).hide&&this.hide();a.data.preventDefault()},this);this.changeFocus=e;var v=this._.element;a.focusManager.add(v,1);this.on("show",function(){v.on("keydown",d,this);if(CKEDITOR.env.gecko)v.on("keypress",g,this)});this.on("hide",function(){v.removeListener("keydown",d);CKEDITOR.env.gecko&&v.removeListener("keypress",g);p(function(a){Q.apply(a)})});this.on("iframeAdded",function(a){(new CKEDITOR.dom.document(a.data.iframe.$.contentWindow.document)).on("keydown",
|
||||
d,this,null,0)});this.on("show",function(){c();if(a.config.dialog_startupFocusTab&&1<l._.pageCount)l._.tabBarMode=!0,l._.tabs[l._.currentTabId][0].focus();else if(!this._.hasFocus)if(this._.currentFocusIndex=-1,f.onFocus){var b=f.onFocus.call(this);b&&b.focus()}else e(1)},this,null,4294967295);if(CKEDITOR.env.ie6Compat)this.on("load",function(){var a=this.getElement(),b=a.getFirst();b.remove();b.appendTo(a)},this);U(this);V(this);(new CKEDITOR.dom.text(f.title,CKEDITOR.document)).appendTo(this.parts.title);
|
||||
for(k=0;k<f.contents.length;k++)(i=f.contents[k])&&this.addPage(i);this.parts.tabs.on("click",function(a){var b=a.data.getTarget();b.hasClass("cke_dialog_tab")&&(b=b.$.id,this.selectPage(b.substring(4,b.lastIndexOf("_"))),this._.tabBarMode&&(this._.tabBarMode=!1,this._.currentFocusIndex=-1,e(1)),a.data.preventDefault())},this);k=[];i=CKEDITOR.dialog._.uiElementBuilders.hbox.build(this,{type:"hbox",className:"cke_dialog_footer_buttons",widths:[],children:f.buttons},k).getChild();this.parts.footer.setHtml(k.join(""));
|
||||
for(k=0;k<i.length;k++)this._.buttons[i[k].id]=i[k]};CKEDITOR.dialog.prototype={destroy:function(){this.hide();this._.element.remove()},resize:function(){return function(a,b){if(!this._.contentSize||!(this._.contentSize.width==a&&this._.contentSize.height==b))CKEDITOR.dialog.fire("resize",{dialog:this,width:a,height:b},this._.editor),this.fire("resize",{width:a,height:b},this._.editor),this.parts.contents.setStyles({width:a+"px",height:b+"px"}),"rtl"==this._.editor.lang.dir&&this._.position&&(this._.position.x=
|
||||
CKEDITOR.document.getWindow().getViewPaneSize().width-this._.contentSize.width-parseInt(this._.element.getFirst().getStyle("right"),10)),this._.contentSize={width:a,height:b}}}(),getSize:function(){var a=this._.element.getFirst();return{width:a.$.offsetWidth||0,height:a.$.offsetHeight||0}},move:function(a,b,c){var e=this._.element.getFirst(),d="rtl"==this._.editor.lang.dir,g="fixed"==e.getComputedStyle("position");CKEDITOR.env.ie&&e.setStyle("zoom","100%");if(!g||!this._.position||!(this._.position.x==
|
||||
a&&this._.position.y==b))this._.position={x:a,y:b},g||(g=CKEDITOR.document.getWindow().getScrollPosition(),a+=g.x,b+=g.y),d&&(g=this.getSize(),a=CKEDITOR.document.getWindow().getViewPaneSize().width-g.width-a),b={top:(0<b?b:0)+"px"},b[d?"right":"left"]=(0<a?a:0)+"px",e.setStyles(b),c&&(this._.moved=1)},getPosition:function(){return CKEDITOR.tools.extend({},this._.position)},show:function(){var a=this._.element,b=this.definition;!a.getParent()||!a.getParent().equals(CKEDITOR.document.getBody())?a.appendTo(CKEDITOR.document.getBody()):
|
||||
a.setStyle("display","block");this.resize(this._.contentSize&&this._.contentSize.width||b.width||b.minWidth,this._.contentSize&&this._.contentSize.height||b.height||b.minHeight);this.reset();this.selectPage(this.definition.contents[0].id);null===CKEDITOR.dialog._.currentZIndex&&(CKEDITOR.dialog._.currentZIndex=this._.editor.config.baseFloatZIndex);this._.element.getFirst().setStyle("z-index",CKEDITOR.dialog._.currentZIndex+=10);null===CKEDITOR.dialog._.currentTop?(CKEDITOR.dialog._.currentTop=this,
|
||||
this._.parentDialog=null,J(this._.editor)):(this._.parentDialog=CKEDITOR.dialog._.currentTop,this._.parentDialog.getElement().getFirst().$.style.zIndex-=Math.floor(this._.editor.config.baseFloatZIndex/2),CKEDITOR.dialog._.currentTop=this);a.on("keydown",M);a.on("keyup",N);this._.hasFocus=!1;for(var c in b.contents)if(b.contents[c]){var a=b.contents[c],e=this._.tabs[a.id],d=a.requiredContent,g=0;if(e){for(var f in this._.contents[a.id]){var h=this._.contents[a.id][f];"hbox"==h.type||("vbox"==h.type||
|
||||
!h.getInputElement())||(h.requiredContent&&!this._.editor.activeFilter.check(h.requiredContent)?h.disable():(h.enable(),g++))}!g||d&&!this._.editor.activeFilter.check(d)?e[0].addClass("cke_dialog_tab_disabled"):e[0].removeClass("cke_dialog_tab_disabled")}}CKEDITOR.tools.setTimeout(function(){this.layout();T(this);this.parts.dialog.setStyle("visibility","");this.fireOnce("load",{});CKEDITOR.ui.fire("ready",this);this.fire("show",{});this._.editor.fire("dialogShow",this);this._.parentDialog||this._.editor.focusManager.lock();
|
||||
this.foreach(function(a){a.setInitValue&&a.setInitValue()})},100,this)},layout:function(){var a=this.parts.dialog,b=this.getSize(),c=CKEDITOR.document.getWindow().getViewPaneSize(),e=(c.width-b.width)/2,d=(c.height-b.height)/2;CKEDITOR.env.ie6Compat||(b.height+(0<d?d:0)>c.height||b.width+(0<e?e:0)>c.width?a.setStyle("position","absolute"):a.setStyle("position","fixed"));this.move(this._.moved?this._.position.x:e,this._.moved?this._.position.y:d)},foreach:function(a){for(var b in this._.contents)for(var c in this._.contents[b])a.call(this,
|
||||
this._.contents[b][c]);return this},reset:function(){var a=function(a){a.reset&&a.reset(1)};return function(){this.foreach(a);return this}}(),setupContent:function(){var a=arguments;this.foreach(function(b){b.setup&&b.setup.apply(b,a)})},commitContent:function(){var a=arguments;this.foreach(function(b){CKEDITOR.env.ie&&this._.currentFocusIndex==b.focusIndex&&b.getInputElement().$.blur();b.commit&&b.commit.apply(b,a)})},hide:function(){if(this.parts.dialog.isVisible()){this.fire("hide",{});this._.editor.fire("dialogHide",
|
||||
this);this.selectPage(this._.tabIdList[0]);var a=this._.element;a.setStyle("display","none");this.parts.dialog.setStyle("visibility","hidden");for(X(this);CKEDITOR.dialog._.currentTop!=this;)CKEDITOR.dialog._.currentTop.hide();if(this._.parentDialog){var b=this._.parentDialog.getElement().getFirst();b.setStyle("z-index",parseInt(b.$.style.zIndex,10)+Math.floor(this._.editor.config.baseFloatZIndex/2))}else K(this._.editor);if(CKEDITOR.dialog._.currentTop=this._.parentDialog)CKEDITOR.dialog._.currentZIndex-=
|
||||
10;else{CKEDITOR.dialog._.currentZIndex=null;a.removeListener("keydown",M);a.removeListener("keyup",N);var c=this._.editor;c.focus();setTimeout(function(){c.focusManager.unlock();CKEDITOR.env.iOS&&c.window.focus()},0)}delete this._.parentDialog;this.foreach(function(a){a.resetInitValue&&a.resetInitValue()})}},addPage:function(a){if(!a.requiredContent||this._.editor.filter.check(a.requiredContent)){for(var b=[],c=a.label?' title="'+CKEDITOR.tools.htmlEncode(a.label)+'"':"",e=CKEDITOR.dialog._.uiElementBuilders.vbox.build(this,
|
||||
{type:"vbox",className:"cke_dialog_page_contents",children:a.elements,expand:!!a.expand,padding:a.padding,style:a.style||"width: 100%;"},b),d=this._.contents[a.id]={},g=e.getChild(),f=0;e=g.shift();)!e.notAllowed&&("hbox"!=e.type&&"vbox"!=e.type)&&f++,d[e.id]=e,"function"==typeof e.getChild&&g.push.apply(g,e.getChild());f||(a.hidden=!0);b=CKEDITOR.dom.element.createFromHtml(b.join(""));b.setAttribute("role","tabpanel");e=CKEDITOR.env;d="cke_"+a.id+"_"+CKEDITOR.tools.getNextNumber();c=CKEDITOR.dom.element.createFromHtml(['<a class="cke_dialog_tab"',
|
||||
0<this._.pageCount?" cke_last":"cke_first",c,a.hidden?' style="display:none"':"",' id="',d,'"',e.gecko&&!e.hc?"":' href="javascript:void(0)"',' tabIndex="-1" hidefocus="true" role="tab">',a.label,"</a>"].join(""));b.setAttribute("aria-labelledby",d);this._.tabs[a.id]=[c,b];this._.tabIdList.push(a.id);!a.hidden&&this._.pageCount++;this._.lastTab=c;this.updateStyle();b.setAttribute("name",a.id);b.appendTo(this.parts.contents);c.unselectable();this.parts.tabs.append(c);a.accessKey&&(O(this,this,"CTRL+"+
|
||||
a.accessKey,Y,Z),this._.accessKeyMap["CTRL+"+a.accessKey]=a.id)}},selectPage:function(a){if(this._.currentTabId!=a&&!this._.tabs[a][0].hasClass("cke_dialog_tab_disabled")&&!1!==this.fire("selectPage",{page:a,currentPage:this._.currentTabId})){for(var b in this._.tabs){var c=this._.tabs[b][0],e=this._.tabs[b][1];b!=a&&(c.removeClass("cke_dialog_tab_selected"),e.hide());e.setAttribute("aria-hidden",b!=a)}var d=this._.tabs[a];d[0].addClass("cke_dialog_tab_selected");CKEDITOR.env.ie6Compat||CKEDITOR.env.ie7Compat?
|
||||
(G(d[1]),d[1].show(),setTimeout(function(){G(d[1],1)},0)):d[1].show();this._.currentTabId=a;this._.currentTabIndex=CKEDITOR.tools.indexOf(this._.tabIdList,a)}},updateStyle:function(){this.parts.dialog[(1===this._.pageCount?"add":"remove")+"Class"]("cke_single_page")},hidePage:function(a){var b=this._.tabs[a]&&this._.tabs[a][0];b&&(1!=this._.pageCount&&b.isVisible())&&(a==this._.currentTabId&&this.selectPage(t.call(this)),b.hide(),this._.pageCount--,this.updateStyle())},showPage:function(a){if(a=this._.tabs[a]&&
|
||||
this._.tabs[a][0])a.show(),this._.pageCount++,this.updateStyle()},getElement:function(){return this._.element},getName:function(){return this._.name},getContentElement:function(a,b){var c=this._.contents[a];return c&&c[b]},getValueOf:function(a,b){return this.getContentElement(a,b).getValue()},setValueOf:function(a,b,c){return this.getContentElement(a,b).setValue(c)},getButton:function(a){return this._.buttons[a]},click:function(a){return this._.buttons[a].click()},disableButton:function(a){return this._.buttons[a].disable()},
|
||||
enableButton:function(a){return this._.buttons[a].enable()},getPageCount:function(){return this._.pageCount},getParentEditor:function(){return this._.editor},getSelectedElement:function(){return this.getParentEditor().getSelection().getSelectedElement()},addFocusable:function(a,b){if("undefined"==typeof b)b=this._.focusList.length,this._.focusList.push(new H(this,a,b));else{this._.focusList.splice(b,0,new H(this,a,b));for(var c=b+1;c<this._.focusList.length;c++)this._.focusList[c].focusIndex++}}};
|
||||
CKEDITOR.tools.extend(CKEDITOR.dialog,{add:function(a,b){if(!this._.dialogDefinitions[a]||"function"==typeof b)this._.dialogDefinitions[a]=b},exists:function(a){return!!this._.dialogDefinitions[a]},getCurrent:function(){return CKEDITOR.dialog._.currentTop},isTabEnabled:function(a,b,c){a=a.config.removeDialogTabs;return!(a&&a.match(RegExp("(?:^|;)"+b+":"+c+"(?:$|;)","i")))},okButton:function(){var a=function(a,c){c=c||{};return CKEDITOR.tools.extend({id:"ok",type:"button",label:a.lang.common.ok,"class":"cke_dialog_ui_button_ok",
|
||||
onClick:function(a){a=a.data.dialog;!1!==a.fire("ok",{hide:!0}).hide&&a.hide()}},c,!0)};a.type="button";a.override=function(b){return CKEDITOR.tools.extend(function(c){return a(c,b)},{type:"button"},!0)};return a}(),cancelButton:function(){var a=function(a,c){c=c||{};return CKEDITOR.tools.extend({id:"cancel",type:"button",label:a.lang.common.cancel,"class":"cke_dialog_ui_button_cancel",onClick:function(a){a=a.data.dialog;!1!==a.fire("cancel",{hide:!0}).hide&&a.hide()}},c,!0)};a.type="button";a.override=
|
||||
function(b){return CKEDITOR.tools.extend(function(c){return a(c,b)},{type:"button"},!0)};return a}(),addUIElement:function(a,b){this._.uiElementBuilders[a]=b}});CKEDITOR.dialog._={uiElementBuilders:{},dialogDefinitions:{},currentTop:null,currentZIndex:null};CKEDITOR.event.implementOn(CKEDITOR.dialog);CKEDITOR.event.implementOn(CKEDITOR.dialog.prototype);var W={resizable:CKEDITOR.DIALOG_RESIZE_BOTH,minWidth:600,minHeight:400,buttons:[CKEDITOR.dialog.okButton,CKEDITOR.dialog.cancelButton]},z=function(a,
|
||||
b,c){for(var e=0,d;d=a[e];e++)if(d.id==b||c&&d[c]&&(d=z(d[c],b,c)))return d;return null},A=function(a,b,c,e,d){if(c){for(var g=0,f;f=a[g];g++){if(f.id==c)return a.splice(g,0,b),b;if(e&&f[e]&&(f=A(f[e],b,c,e,!0)))return f}if(d)return null}a.push(b);return b},B=function(a,b,c){for(var e=0,d;d=a[e];e++){if(d.id==b)return a.splice(e,1);if(c&&d[c]&&(d=B(d[c],b,c)))return d}return null},L=function(a,b){this.dialog=a;for(var c=b.contents,e=0,d;d=c[e];e++)c[e]=d&&new I(a,d);CKEDITOR.tools.extend(this,b)};
|
||||
L.prototype={getContents:function(a){return z(this.contents,a)},getButton:function(a){return z(this.buttons,a)},addContents:function(a,b){return A(this.contents,a,b)},addButton:function(a,b){return A(this.buttons,a,b)},removeContents:function(a){B(this.contents,a)},removeButton:function(a){B(this.buttons,a)}};I.prototype={get:function(a){return z(this.elements,a,"children")},add:function(a,b){return A(this.elements,a,b,"children")},remove:function(a){B(this.elements,a,"children")}};var F,w={},q,s=
|
||||
{},M=function(a){var b=a.data.$.ctrlKey||a.data.$.metaKey,c=a.data.$.altKey,e=a.data.$.shiftKey,d=String.fromCharCode(a.data.$.keyCode);if((b=s[(b?"CTRL+":"")+(c?"ALT+":"")+(e?"SHIFT+":"")+d])&&b.length)b=b[b.length-1],b.keydown&&b.keydown.call(b.uiElement,b.dialog,b.key),a.data.preventDefault()},N=function(a){var b=a.data.$.ctrlKey||a.data.$.metaKey,c=a.data.$.altKey,e=a.data.$.shiftKey,d=String.fromCharCode(a.data.$.keyCode);if((b=s[(b?"CTRL+":"")+(c?"ALT+":"")+(e?"SHIFT+":"")+d])&&b.length)b=b[b.length-
|
||||
1],b.keyup&&(b.keyup.call(b.uiElement,b.dialog,b.key),a.data.preventDefault())},O=function(a,b,c,e,d){(s[c]||(s[c]=[])).push({uiElement:a,dialog:b,key:c,keyup:d||a.accessKeyUp,keydown:e||a.accessKeyDown})},X=function(a){for(var b in s){for(var c=s[b],e=c.length-1;0<=e;e--)(c[e].dialog==a||c[e].uiElement==a)&&c.splice(e,1);0===c.length&&delete s[b]}},Z=function(a,b){a._.accessKeyMap[b]&&a.selectPage(a._.accessKeyMap[b])},Y=function(){};(function(){CKEDITOR.ui.dialog={uiElement:function(a,b,c,e,d,g,
|
||||
f){if(!(4>arguments.length)){var h=(e.call?e(b):e)||"div",m=["<",h," "],k=(d&&d.call?d(b):d)||{},i=(g&&g.call?g(b):g)||{},o=(f&&f.call?f.call(this,a,b):f)||"",j=this.domId=i.id||CKEDITOR.tools.getNextId()+"_uiElement";b.requiredContent&&!a.getParentEditor().filter.check(b.requiredContent)&&(k.display="none",this.notAllowed=!0);i.id=j;var n={};b.type&&(n["cke_dialog_ui_"+b.type]=1);b.className&&(n[b.className]=1);b.disabled&&(n.cke_disabled=1);for(var l=i["class"]&&i["class"].split?i["class"].split(" "):
|
||||
[],j=0;j<l.length;j++)l[j]&&(n[l[j]]=1);l=[];for(j in n)l.push(j);i["class"]=l.join(" ");b.title&&(i.title=b.title);n=(b.style||"").split(";");b.align&&(l=b.align,k["margin-left"]="left"==l?0:"auto",k["margin-right"]="right"==l?0:"auto");for(j in k)n.push(j+":"+k[j]);b.hidden&&n.push("display:none");for(j=n.length-1;0<=j;j--)""===n[j]&&n.splice(j,1);0<n.length&&(i.style=(i.style?i.style+"; ":"")+n.join("; "));for(j in i)m.push(j+'="'+CKEDITOR.tools.htmlEncode(i[j])+'" ');m.push(">",o,"</",h,">");
|
||||
c.push(m.join(""));(this._||(this._={})).dialog=a;"boolean"==typeof b.isChanged&&(this.isChanged=function(){return b.isChanged});"function"==typeof b.isChanged&&(this.isChanged=b.isChanged);"function"==typeof b.setValue&&(this.setValue=CKEDITOR.tools.override(this.setValue,function(a){return function(c){a.call(this,b.setValue.call(this,c))}}));"function"==typeof b.getValue&&(this.getValue=CKEDITOR.tools.override(this.getValue,function(a){return function(){return b.getValue.call(this,a.call(this))}}));
|
||||
CKEDITOR.event.implementOn(this);this.registerEvents(b);this.accessKeyUp&&(this.accessKeyDown&&b.accessKey)&&O(this,a,"CTRL+"+b.accessKey);var p=this;a.on("load",function(){var b=p.getInputElement();if(b){var c=p.type in{checkbox:1,ratio:1}&&CKEDITOR.env.ie&&CKEDITOR.env.version<8?"cke_dialog_ui_focused":"";b.on("focus",function(){a._.tabBarMode=false;a._.hasFocus=true;p.fire("focus");c&&this.addClass(c)});b.on("blur",function(){p.fire("blur");c&&this.removeClass(c)})}});CKEDITOR.tools.extend(this,
|
||||
b);this.keyboardFocusable&&(this.tabIndex=b.tabIndex||0,this.focusIndex=a._.focusList.push(this)-1,this.on("focus",function(){a._.currentFocusIndex=p.focusIndex}))}},hbox:function(a,b,c,e,d){if(!(4>arguments.length)){this._||(this._={});var g=this._.children=b,f=d&&d.widths||null,h=d&&d.height||null,m,k={role:"presentation"};d&&d.align&&(k.align=d.align);CKEDITOR.ui.dialog.uiElement.call(this,a,d||{type:"hbox"},e,"table",{},k,function(){var a=['<tbody><tr class="cke_dialog_ui_hbox">'];for(m=0;m<c.length;m++){var b=
|
||||
"cke_dialog_ui_hbox_child",e=[];0===m&&(b="cke_dialog_ui_hbox_first");m==c.length-1&&(b="cke_dialog_ui_hbox_last");a.push('<td class="',b,'" role="presentation" ');f?f[m]&&e.push("width:"+r(f[m])):e.push("width:"+Math.floor(100/c.length)+"%");h&&e.push("height:"+r(h));d&&void 0!==d.padding&&e.push("padding:"+r(d.padding));CKEDITOR.env.ie&&(CKEDITOR.env.quirks&&g[m].align)&&e.push("text-align:"+g[m].align);0<e.length&&a.push('style="'+e.join("; ")+'" ');a.push(">",c[m],"</td>")}a.push("</tr></tbody>");
|
||||
return a.join("")})}},vbox:function(a,b,c,e,d){if(!(3>arguments.length)){this._||(this._={});var g=this._.children=b,f=d&&d.width||null,h=d&&d.heights||null;CKEDITOR.ui.dialog.uiElement.call(this,a,d||{type:"vbox"},e,"div",null,{role:"presentation"},function(){var b=['<table role="presentation" cellspacing="0" border="0" '];b.push('style="');d&&d.expand&&b.push("height:100%;");b.push("width:"+r(f||"100%"),";");CKEDITOR.env.webkit&&b.push("float:none;");b.push('"');b.push('align="',CKEDITOR.tools.htmlEncode(d&&
|
||||
d.align||("ltr"==a.getParentEditor().lang.dir?"left":"right")),'" ');b.push("><tbody>");for(var e=0;e<c.length;e++){var i=[];b.push('<tr><td role="presentation" ');f&&i.push("width:"+r(f||"100%"));h?i.push("height:"+r(h[e])):d&&d.expand&&i.push("height:"+Math.floor(100/c.length)+"%");d&&void 0!==d.padding&&i.push("padding:"+r(d.padding));CKEDITOR.env.ie&&(CKEDITOR.env.quirks&&g[e].align)&&i.push("text-align:"+g[e].align);0<i.length&&b.push('style="',i.join("; "),'" ');b.push(' class="cke_dialog_ui_vbox_child">',
|
||||
c[e],"</td></tr>")}b.push("</tbody></table>");return b.join("")})}}}})();CKEDITOR.ui.dialog.uiElement.prototype={getElement:function(){return CKEDITOR.document.getById(this.domId)},getInputElement:function(){return this.getElement()},getDialog:function(){return this._.dialog},setValue:function(a,b){this.getInputElement().setValue(a);!b&&this.fire("change",{value:a});return this},getValue:function(){return this.getInputElement().getValue()},isChanged:function(){return!1},selectParentTab:function(){for(var a=
|
||||
this.getInputElement();(a=a.getParent())&&-1==a.$.className.search("cke_dialog_page_contents"););if(!a)return this;a=a.getAttribute("name");this._.dialog._.currentTabId!=a&&this._.dialog.selectPage(a);return this},focus:function(){this.selectParentTab().getInputElement().focus();return this},registerEvents:function(a){var b=/^on([A-Z]\w+)/,c,e=function(a,b,c,d){b.on("load",function(){a.getInputElement().on(c,d,a)})},d;for(d in a)if(c=d.match(b))this.eventProcessors[d]?this.eventProcessors[d].call(this,
|
||||
this._.dialog,a[d]):e(this,this._.dialog,c[1].toLowerCase(),a[d]);return this},eventProcessors:{onLoad:function(a,b){a.on("load",b,this)},onShow:function(a,b){a.on("show",b,this)},onHide:function(a,b){a.on("hide",b,this)}},accessKeyDown:function(){this.focus()},accessKeyUp:function(){},disable:function(){var a=this.getElement();this.getInputElement().setAttribute("disabled","true");a.addClass("cke_disabled")},enable:function(){var a=this.getElement();this.getInputElement().removeAttribute("disabled");
|
||||
a.removeClass("cke_disabled")},isEnabled:function(){return!this.getElement().hasClass("cke_disabled")},isVisible:function(){return this.getInputElement().isVisible()},isFocusable:function(){return!this.isEnabled()||!this.isVisible()?!1:!0}};CKEDITOR.ui.dialog.hbox.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{getChild:function(a){if(1>arguments.length)return this._.children.concat();a.splice||(a=[a]);return 2>a.length?this._.children[a[0]]:this._.children[a[0]]&&this._.children[a[0]].getChild?
|
||||
this._.children[a[0]].getChild(a.slice(1,a.length)):null}},!0);CKEDITOR.ui.dialog.vbox.prototype=new CKEDITOR.ui.dialog.hbox;(function(){var a={build:function(a,c,e){for(var d=c.children,g,f=[],h=[],m=0;m<d.length&&(g=d[m]);m++){var k=[];f.push(k);h.push(CKEDITOR.dialog._.uiElementBuilders[g.type].build(a,g,k))}return new CKEDITOR.ui.dialog[c.type](a,h,f,e,c)}};CKEDITOR.dialog.addUIElement("hbox",a);CKEDITOR.dialog.addUIElement("vbox",a)})();CKEDITOR.dialogCommand=function(a,b){this.dialogName=a;
|
||||
CKEDITOR.tools.extend(this,b,!0)};CKEDITOR.dialogCommand.prototype={exec:function(a){a.openDialog(this.dialogName)},canUndo:!1,editorFocus:1};(function(){var a=/^([a]|[^a])+$/,b=/^\d*$/,c=/^\d*(?:\.\d+)?$/,e=/^(((\d*(\.\d+))|(\d*))(px|\%)?)?$/,d=/^(((\d*(\.\d+))|(\d*))(px|em|ex|in|cm|mm|pt|pc|\%)?)?$/i,g=/^(\s*[\w-]+\s*:\s*[^:;]+(?:;|$))*$/;CKEDITOR.VALIDATE_OR=1;CKEDITOR.VALIDATE_AND=2;CKEDITOR.dialog.validate={functions:function(){var a=arguments;return function(){var b=this&&this.getValue?this.getValue():
|
||||
a[0],c,d=CKEDITOR.VALIDATE_AND,e=[],g;for(g=0;g<a.length;g++)if("function"==typeof a[g])e.push(a[g]);else break;g<a.length&&"string"==typeof a[g]&&(c=a[g],g++);g<a.length&&"number"==typeof a[g]&&(d=a[g]);var j=d==CKEDITOR.VALIDATE_AND?!0:!1;for(g=0;g<e.length;g++)j=d==CKEDITOR.VALIDATE_AND?j&&e[g](b):j||e[g](b);return!j?c:!0}},regex:function(a,b){return function(c){c=this&&this.getValue?this.getValue():c;return!a.test(c)?b:!0}},notEmpty:function(b){return this.regex(a,b)},integer:function(a){return this.regex(b,
|
||||
a)},number:function(a){return this.regex(c,a)},cssLength:function(a){return this.functions(function(a){return d.test(CKEDITOR.tools.trim(a))},a)},htmlLength:function(a){return this.functions(function(a){return e.test(CKEDITOR.tools.trim(a))},a)},inlineStyle:function(a){return this.functions(function(a){return g.test(CKEDITOR.tools.trim(a))},a)},equals:function(a,b){return this.functions(function(b){return b==a},b)},notEqual:function(a,b){return this.functions(function(b){return b!=a},b)}};CKEDITOR.on("instanceDestroyed",
|
||||
function(a){if(CKEDITOR.tools.isEmpty(CKEDITOR.instances)){for(var b;b=CKEDITOR.dialog._.currentTop;)b.hide();for(var c in w)w[c].remove();w={}}var a=a.editor._.storedDialogs,d;for(d in a)a[d].destroy()})})();CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{openDialog:function(a,b){var c=null,e=CKEDITOR.dialog._.dialogDefinitions[a];null===CKEDITOR.dialog._.currentTop&&J(this);if("function"==typeof e)c=this._.storedDialogs||(this._.storedDialogs={}),c=c[a]||(c[a]=new CKEDITOR.dialog(this,a)),b&&b.call(c,
|
||||
c),c.show();else{if("failed"==e)throw K(this),Error('[CKEDITOR.dialog.openDialog] Dialog "'+a+'" failed when loading definition.');"string"==typeof e&&CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(e),function(){"function"!=typeof CKEDITOR.dialog._.dialogDefinitions[a]&&(CKEDITOR.dialog._.dialogDefinitions[a]="failed");this.openDialog(a,b)},this,0,1)}CKEDITOR.skin.loadPart("dialog");return c}})})();
|
||||
CKEDITOR.plugins.add("dialog",{requires:"dialogui",init:function(t){t.on("doubleclick",function(u){u.data.dialog&&t.openDialog(u.data.dialog)},null,null,999)}});CKEDITOR.plugins.add("about",{requires:"dialog",init:function(a){var b=a.addCommand("about",new CKEDITOR.dialogCommand("about"));b.modes={wysiwyg:1,source:1};b.canUndo=!1;b.readOnly=1;a.ui.addButton&&a.ui.addButton("About",{label:a.lang.about.title,command:"about",toolbar:"about"});CKEDITOR.dialog.add("about",this.path+"dialogs/about.js")}});CKEDITOR.plugins.add("basicstyles",{init:function(c){var e=0,d=function(g,d,b,a){if(a){var a=new CKEDITOR.style(a),f=h[b];f.unshift(a);c.attachStyleStateChange(a,function(a){!c.readOnly&&c.getCommand(b).setState(a)});c.addCommand(b,new CKEDITOR.styleCommand(a,{contentForms:f}));c.ui.addButton&&c.ui.addButton(g,{label:d,command:b,toolbar:"basicstyles,"+(e+=10)})}},h={bold:["strong","b",["span",function(a){a=a.styles["font-weight"];return"bold"==a||700<=+a}]],italic:["em","i",["span",function(a){return"italic"==
|
||||
a.styles["font-style"]}]],underline:["u",["span",function(a){return"underline"==a.styles["text-decoration"]}]],strike:["s","strike",["span",function(a){return"line-through"==a.styles["text-decoration"]}]],subscript:["sub"],superscript:["sup"]},b=c.config,a=c.lang.basicstyles;d("Bold",a.bold,"bold",b.coreStyles_bold);d("Italic",a.italic,"italic",b.coreStyles_italic);d("Underline",a.underline,"underline",b.coreStyles_underline);d("Strike",a.strike,"strike",b.coreStyles_strike);d("Subscript",a.subscript,
|
||||
"subscript",b.coreStyles_subscript);d("Superscript",a.superscript,"superscript",b.coreStyles_superscript);c.setKeystroke([[CKEDITOR.CTRL+66,"bold"],[CKEDITOR.CTRL+73,"italic"],[CKEDITOR.CTRL+85,"underline"]])}});CKEDITOR.config.coreStyles_bold={element:"strong",overrides:"b"};CKEDITOR.config.coreStyles_italic={element:"em",overrides:"i"};CKEDITOR.config.coreStyles_underline={element:"u"};CKEDITOR.config.coreStyles_strike={element:"s",overrides:"strike"};CKEDITOR.config.coreStyles_subscript={element:"sub"};
|
||||
CKEDITOR.config.coreStyles_superscript={element:"sup"};(function(){function v(b){function a(){var e=b.editable();e.on(p,function(b){(!CKEDITOR.env.ie||!n)&&u(b)});CKEDITOR.env.ie&&e.on("paste",function(e){q||(g(),e.data.preventDefault(),u(e),h("paste")||b.openDialog("paste"))});CKEDITOR.env.ie&&(e.on("contextmenu",i,null,null,0),e.on("beforepaste",function(b){b.data&&(!b.data.$.ctrlKey&&!b.data.$.shiftKey)&&i()},null,null,0));e.on("beforecut",function(){!n&&j(b)});var a;e.attachListener(CKEDITOR.env.ie?e:b.document.getDocumentElement(),"mouseup",function(){a=
|
||||
setTimeout(function(){r()},0)});b.on("destroy",function(){clearTimeout(a)});e.on("keyup",r)}function c(e){return{type:e,canUndo:"cut"==e,startDisabled:!0,exec:function(){"cut"==this.type&&j();var e;var a=this.type;if(CKEDITOR.env.ie)e=h(a);else try{e=b.document.$.execCommand(a,!1,null)}catch(d){e=!1}e||alert(b.lang.clipboard[this.type+"Error"]);return e}}}function d(){return{canUndo:!1,async:!0,exec:function(b,a){var d=function(a,d){a&&f(a.type,a.dataValue,!!d);b.fire("afterCommandExec",{name:"paste",
|
||||
command:c,returnValue:!!a})},c=this;"string"==typeof a?d({type:"auto",dataValue:a},1):b.getClipboardData(d)}}}function g(){q=1;setTimeout(function(){q=0},100)}function i(){n=1;setTimeout(function(){n=0},10)}function h(e){var a=b.document,d=a.getBody(),c=!1,j=function(){c=!0};d.on(e,j);(7<CKEDITOR.env.version?a.$:a.$.selection.createRange()).execCommand(e);d.removeListener(e,j);return c}function f(e,a,d){e={type:e};if(d&&!1===b.fire("beforePaste",e)||!a)return!1;e.dataValue=a;return b.fire("paste",
|
||||
e)}function j(){if(CKEDITOR.env.ie&&!CKEDITOR.env.quirks){var e=b.getSelection(),a,d,c;if(e.getType()==CKEDITOR.SELECTION_ELEMENT&&(a=e.getSelectedElement()))d=e.getRanges()[0],c=b.document.createText(""),c.insertBefore(a),d.setStartBefore(c),d.setEndAfter(a),e.selectRanges([d]),setTimeout(function(){a.getParent()&&(c.remove(),e.selectElement(a))},0)}}function l(a,d){var c=b.document,j=b.editable(),l=function(b){b.cancel()},g;if(!c.getById("cke_pastebin")){var i=b.getSelection(),s=i.createBookmarks();
|
||||
CKEDITOR.env.ie&&i.root.fire("selectionchange");var k=new CKEDITOR.dom.element((CKEDITOR.env.webkit||j.is("body"))&&!CKEDITOR.env.ie?"body":"div",c);k.setAttributes({id:"cke_pastebin","data-cke-temp":"1"});var f=0,c=c.getWindow();CKEDITOR.env.webkit?(j.append(k),k.addClass("cke_editable"),j.is("body")||(f="static"!=j.getComputedStyle("position")?j:CKEDITOR.dom.element.get(j.$.offsetParent),f=f.getDocumentPosition().y)):j.getAscendant(CKEDITOR.env.ie?"body":"html",1).append(k);k.setStyles({position:"absolute",
|
||||
top:c.getScrollPosition().y-f+10+"px",width:"1px",height:Math.max(1,c.getViewPaneSize().height-20)+"px",overflow:"hidden",margin:0,padding:0});CKEDITOR.env.safari&&k.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select","text"));(f=k.getParent().isReadOnly())?(k.setOpacity(0),k.setAttribute("contenteditable",!0)):k.setStyle("ltr"==b.config.contentsLangDirection?"left":"right","-1000px");b.on("selectionChange",l,null,null,0);if(CKEDITOR.env.webkit||CKEDITOR.env.gecko)g=j.once("blur",l,null,null,-100);
|
||||
f&&k.focus();f=new CKEDITOR.dom.range(k);f.selectNodeContents(k);var h=f.select();CKEDITOR.env.ie&&(g=j.once("blur",function(){b.lockSelection(h)}));var m=CKEDITOR.document.getWindow().getScrollPosition().y;setTimeout(function(){if(CKEDITOR.env.webkit)CKEDITOR.document.getBody().$.scrollTop=m;g&&g.removeListener();CKEDITOR.env.ie&&j.focus();i.selectBookmarks(s);k.remove();var a;if(CKEDITOR.env.webkit&&(a=k.getFirst())&&a.is&&a.hasClass("Apple-style-span"))k=a;b.removeListener("selectionChange",l);
|
||||
d(k.getHtml())},0)}}function s(){if(CKEDITOR.env.ie){b.focus();g();var a=b.focusManager;a.lock();if(b.editable().fire(p)&&!h("paste"))return a.unlock(),!1;a.unlock()}else try{if(b.editable().fire(p)&&!b.document.$.execCommand("Paste",!1,null))throw 0;}catch(d){return!1}return!0}function o(a){if("wysiwyg"==b.mode)switch(a.data.keyCode){case CKEDITOR.CTRL+86:case CKEDITOR.SHIFT+45:a=b.editable();g();!CKEDITOR.env.ie&&a.fire("beforepaste");break;case CKEDITOR.CTRL+88:case CKEDITOR.SHIFT+46:b.fire("saveSnapshot"),
|
||||
setTimeout(function(){b.fire("saveSnapshot")},50)}}function u(a){var d={type:"auto"},c=b.fire("beforePaste",d);l(a,function(b){b=b.replace(/<span[^>]+data-cke-bookmark[^<]*?<\/span>/ig,"");c&&f(d.type,b,0,1)})}function r(){if("wysiwyg"==b.mode){var a=m("paste");b.getCommand("cut").setState(m("cut"));b.getCommand("copy").setState(m("copy"));b.getCommand("paste").setState(a);b.fire("pasteState",a)}}function m(a){if(t&&a in{paste:1,cut:1})return CKEDITOR.TRISTATE_DISABLED;if("paste"==a)return CKEDITOR.TRISTATE_OFF;
|
||||
var a=b.getSelection(),d=a.getRanges();return a.getType()==CKEDITOR.SELECTION_NONE||1==d.length&&d[0].collapsed?CKEDITOR.TRISTATE_DISABLED:CKEDITOR.TRISTATE_OFF}var n=0,q=0,t=0,p=CKEDITOR.env.ie?"beforepaste":"paste";(function(){b.on("key",o);b.on("contentDom",a);b.on("selectionChange",function(b){t=b.data.selection.getRanges()[0].checkReadOnly();r()});b.contextMenu&&b.contextMenu.addListener(function(b,a){t=a.getRanges()[0].checkReadOnly();return{cut:m("cut"),copy:m("copy"),paste:m("paste")}})})();
|
||||
(function(){function a(d,c,j,e,l){var g=b.lang.clipboard[c];b.addCommand(c,j);b.ui.addButton&&b.ui.addButton(d,{label:g,command:c,toolbar:"clipboard,"+e});b.addMenuItems&&b.addMenuItem(c,{label:g,command:c,group:"clipboard",order:l})}a("Cut","cut",c("cut"),10,1);a("Copy","copy",c("copy"),20,4);a("Paste","paste",d(),30,8)})();b.getClipboardData=function(a,d){function c(a){a.removeListener();a.cancel();d(a.data)}function j(a){a.removeListener();a.cancel();i=!0;d({type:f,dataValue:a.data})}function l(){this.customTitle=
|
||||
a&&a.title}var g=!1,f="auto",i=!1;d||(d=a,a=null);b.on("paste",c,null,null,0);b.on("beforePaste",function(a){a.removeListener();g=true;f=a.data.type},null,null,1E3);!1===s()&&(b.removeListener("paste",c),g&&b.fire("pasteDialog",l)?(b.on("pasteDialogCommit",j),b.on("dialogHide",function(a){a.removeListener();a.data.removeListener("pasteDialogCommit",j);setTimeout(function(){i||d(null)},10)})):d(null))}}function w(b){if(CKEDITOR.env.webkit){if(!b.match(/^[^<]*$/g)&&!b.match(/^(<div><br( ?\/)?><\/div>|<div>[^<]*<\/div>)*$/gi))return"html"}else if(CKEDITOR.env.ie){if(!b.match(/^([^<]|<br( ?\/)?>)*$/gi)&&
|
||||
!b.match(/^(<p>([^<]|<br( ?\/)?>)*<\/p>|(\r\n))*$/gi))return"html"}else if(CKEDITOR.env.gecko){if(!b.match(/^([^<]|<br( ?\/)?>)*$/gi))return"html"}else return"html";return"htmlifiedtext"}function x(b,a){function c(a){return CKEDITOR.tools.repeat("</p><p>",~~(a/2))+(1==a%2?"<br>":"")}a=a.replace(/\s+/g," ").replace(/> +</g,"><").replace(/<br ?\/>/gi,"<br>");a=a.replace(/<\/?[A-Z]+>/g,function(a){return a.toLowerCase()});if(a.match(/^[^<]$/))return a;CKEDITOR.env.webkit&&-1<a.indexOf("<div>")&&(a=a.replace(/^(<div>(<br>|)<\/div>)(?!$|(<div>(<br>|)<\/div>))/g,
|
||||
"<br>").replace(/^(<div>(<br>|)<\/div>){2}(?!$)/g,"<div></div>"),a.match(/<div>(<br>|)<\/div>/)&&(a="<p>"+a.replace(/(<div>(<br>|)<\/div>)+/g,function(a){return c(a.split("</div><div>").length+1)})+"</p>"),a=a.replace(/<\/div><div>/g,"<br>"),a=a.replace(/<\/?div>/g,""));CKEDITOR.env.gecko&&b.enterMode!=CKEDITOR.ENTER_BR&&(CKEDITOR.env.gecko&&(a=a.replace(/^<br><br>$/,"<br>")),-1<a.indexOf("<br><br>")&&(a="<p>"+a.replace(/(<br>){2,}/g,function(a){return c(a.length/4)})+"</p>"));return o(b,a)}function y(){var b=
|
||||
new CKEDITOR.htmlParser.filter,a={blockquote:1,dl:1,fieldset:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,ol:1,p:1,table:1,ul:1},c=CKEDITOR.tools.extend({br:0},CKEDITOR.dtd.$inline),d={p:1,br:1,"cke:br":1},g=CKEDITOR.dtd,i=CKEDITOR.tools.extend({area:1,basefont:1,embed:1,iframe:1,map:1,object:1,param:1},CKEDITOR.dtd.$nonBodyContent,CKEDITOR.dtd.$cdata),h=function(a){delete a.name;a.add(new CKEDITOR.htmlParser.text(" "))},f=function(a){for(var b=a,c;(b=b.next)&&b.name&&b.name.match(/^h\d$/);){c=new CKEDITOR.htmlParser.element("cke:br");
|
||||
c.isEmpty=!0;for(a.add(c);c=b.children.shift();)a.add(c)}};b.addRules({elements:{h1:f,h2:f,h3:f,h4:f,h5:f,h6:f,img:function(a){var a=CKEDITOR.tools.trim(a.attributes.alt||""),b=" ";a&&!a.match(/(^http|\.(jpe?g|gif|png))/i)&&(b=" ["+a+"] ");return new CKEDITOR.htmlParser.text(b)},td:h,th:h,$:function(b){var f=b.name,h;if(i[f])return!1;b.attributes={};if("br"==f)return b;if(a[f])b.name="p";else if(c[f])delete b.name;else if(g[f]){h=new CKEDITOR.htmlParser.element("cke:br");h.isEmpty=!0;if(CKEDITOR.dtd.$empty[f])return h;
|
||||
b.add(h,0);h=h.clone();h.isEmpty=!0;b.add(h);delete b.name}d[b.name]||delete b.name;return b}}},{applyToAll:!0});return b}function z(b,a,c){var a=new CKEDITOR.htmlParser.fragment.fromHtml(a),d=new CKEDITOR.htmlParser.basicWriter;a.writeHtml(d,c);var a=d.getHtml(),a=a.replace(/\s*(<\/?[a-z:]+ ?\/?>)\s*/g,"$1").replace(/(<cke:br \/>){2,}/g,"<cke:br />").replace(/(<cke:br \/>)(<\/?p>|<br \/>)/g,"$2").replace(/(<\/?p>|<br \/>)(<cke:br \/>)/g,"$1").replace(/<(cke:)?br( \/)?>/g,"<br>").replace(/<p><\/p>/g,
|
||||
""),g=0,a=a.replace(/<\/?p>/g,function(a){if("<p>"==a){if(1<++g)return"</p><p>"}else if(0<--g)return"</p><p>";return a}).replace(/<p><\/p>/g,"");return o(b,a)}function o(b,a){b.enterMode==CKEDITOR.ENTER_BR?a=a.replace(/(<\/p><p>)+/g,function(a){return CKEDITOR.tools.repeat("<br>",2*(a.length/7))}).replace(/<\/?p>/g,""):b.enterMode==CKEDITOR.ENTER_DIV&&(a=a.replace(/<(\/)?p>/g,"<$1div>"));return a}CKEDITOR.plugins.add("clipboard",{requires:"dialog",init:function(b){var a;v(b);CKEDITOR.dialog.add("paste",
|
||||
CKEDITOR.getUrl(this.path+"dialogs/paste.js"));b.on("paste",function(a){var b=a.data.dataValue,g=CKEDITOR.dtd.$block;-1<b.indexOf("Apple-")&&(b=b.replace(/<span class="Apple-converted-space"> <\/span>/gi," "),"html"!=a.data.type&&(b=b.replace(/<span class="Apple-tab-span"[^>]*>([^<]*)<\/span>/gi,function(a,b){return b.replace(/\t/g," ")})),-1<b.indexOf('<br class="Apple-interchange-newline">')&&(a.data.startsWithEOL=1,a.data.preSniffing="html",b=b.replace(/<br class="Apple-interchange-newline">/,
|
||||
"")),b=b.replace(/(<[^>]+) class="Apple-[^"]*"/gi,"$1"));if(b.match(/^<[^<]+cke_(editable|contents)/i)){var i,h,f=new CKEDITOR.dom.element("div");for(f.setHtml(b);1==f.getChildCount()&&(i=f.getFirst())&&i.type==CKEDITOR.NODE_ELEMENT&&(i.hasClass("cke_editable")||i.hasClass("cke_contents"));)f=h=i;h&&(b=h.getHtml().replace(/<br>$/i,""))}CKEDITOR.env.ie?b=b.replace(/^ (?: |\r\n)?<(\w+)/g,function(b,d){if(d.toLowerCase()in g){a.data.preSniffing="html";return"<"+d}return b}):CKEDITOR.env.webkit?
|
||||
b=b.replace(/<\/(\w+)><div><br><\/div>$/,function(b,d){if(d in g){a.data.endsWithEOL=1;return"</"+d+">"}return b}):CKEDITOR.env.gecko&&(b=b.replace(/(\s)<br>$/,"$1"));a.data.dataValue=b},null,null,3);b.on("paste",function(c){var c=c.data,d=c.type,g=c.dataValue,i,h=b.config.clipboard_defaultContentType||"html";i="html"==d||"html"==c.preSniffing?"html":w(g);"htmlifiedtext"==i?g=x(b.config,g):"text"==d&&"html"==i&&(g=z(b.config,g,a||(a=y(b))));c.startsWithEOL&&(g='<br data-cke-eol="1">'+g);c.endsWithEOL&&
|
||||
(g+='<br data-cke-eol="1">');"auto"==d&&(d="html"==i||"html"==h?"html":"text");c.type=d;c.dataValue=g;delete c.preSniffing;delete c.startsWithEOL;delete c.endsWithEOL},null,null,6);b.on("paste",function(a){a=a.data;b.insertHtml(a.dataValue,a.type);setTimeout(function(){b.fire("afterPaste")},0)},null,null,1E3);b.on("pasteDialog",function(a){setTimeout(function(){b.openDialog("paste",a.data)},0)})}})})();(function(){var c='<a id="{id}" class="cke_button cke_button__{name} cke_button_{state} {cls}"'+(CKEDITOR.env.gecko&&!CKEDITOR.env.hc?"":" href=\"javascript:void('{titleJs}')\"")+' title="{title}" tabindex="-1" hidefocus="true" role="button" aria-labelledby="{id}_label" aria-haspopup="{hasArrow}" aria-disabled="{ariaDisabled}"';CKEDITOR.env.gecko&&CKEDITOR.env.mac&&(c+=' onkeypress="return false;"');CKEDITOR.env.gecko&&(c+=' onblur="this.style.cssText = this.style.cssText;"');var c=c+(' onkeydown="return CKEDITOR.tools.callFunction({keydownFn},event);" onfocus="return CKEDITOR.tools.callFunction({focusFn},event);" '+
|
||||
(CKEDITOR.env.ie?'onclick="return false;" onmouseup':"onclick")+'="CKEDITOR.tools.callFunction({clickFn},this);return false;"><span class="cke_button_icon cke_button__{iconName}_icon" style="{style}"'),c=c+'> </span><span id="{id}_label" class="cke_button_label cke_button__{name}_label" aria-hidden="false">{label}</span>{arrowHtml}</a>',o=CKEDITOR.addTemplate("buttonArrow",'<span class="cke_button_arrow">'+(CKEDITOR.env.hc?"▼":"")+"</span>"),p=CKEDITOR.addTemplate("button",c);CKEDITOR.plugins.add("button",
|
||||
{beforeInit:function(a){a.ui.addHandler(CKEDITOR.UI_BUTTON,CKEDITOR.ui.button.handler)}});CKEDITOR.UI_BUTTON="button";CKEDITOR.ui.button=function(a){CKEDITOR.tools.extend(this,a,{title:a.label,click:a.click||function(b){b.execCommand(a.command)}});this._={}};CKEDITOR.ui.button.handler={create:function(a){return new CKEDITOR.ui.button(a)}};CKEDITOR.ui.button.prototype={render:function(a,b){function c(){var e=a.mode;e&&(e=this.modes[e]?void 0!==i[e]?i[e]:CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,
|
||||
e=a.readOnly&&!this.readOnly?CKEDITOR.TRISTATE_DISABLED:e,this.setState(e),this.refresh&&this.refresh())}var j=CKEDITOR.env,k=this._.id=CKEDITOR.tools.getNextId(),f="",g=this.command,l;this._.editor=a;var d={id:k,button:this,editor:a,focus:function(){CKEDITOR.document.getById(k).focus()},execute:function(){this.button.click(a)},attach:function(a){this.button.attach(a)}},q=CKEDITOR.tools.addFunction(function(a){if(d.onkey)return a=new CKEDITOR.dom.event(a),!1!==d.onkey(d,a.getKeystroke())}),r=CKEDITOR.tools.addFunction(function(a){var b;
|
||||
d.onfocus&&(b=!1!==d.onfocus(d,new CKEDITOR.dom.event(a)));return b}),m=0;d.clickFn=l=CKEDITOR.tools.addFunction(function(){m&&(a.unlockSelection(1),m=0);d.execute();j.iOS&&a.focus()});if(this.modes){var i={};a.on("beforeModeUnload",function(){a.mode&&this._.state!=CKEDITOR.TRISTATE_DISABLED&&(i[a.mode]=this._.state)},this);a.on("activeFilterChange",c,this);a.on("mode",c,this);!this.readOnly&&a.on("readOnly",c,this)}else if(g&&(g=a.getCommand(g)))g.on("state",function(){this.setState(g.state)},this),
|
||||
f+=g.state==CKEDITOR.TRISTATE_ON?"on":g.state==CKEDITOR.TRISTATE_DISABLED?"disabled":"off";if(this.directional)a.on("contentDirChanged",function(b){var c=CKEDITOR.document.getById(this._.id),d=c.getFirst(),b=b.data;b!=a.lang.dir?c.addClass("cke_"+b):c.removeClass("cke_ltr").removeClass("cke_rtl");d.setAttribute("style",CKEDITOR.skin.getIconStyle(h,"rtl"==b,this.icon,this.iconOffset))},this);g||(f+="off");var n=this.name||this.command,h=n;this.icon&&!/\./.test(this.icon)&&(h=this.icon,this.icon=null);
|
||||
f={id:k,name:n,iconName:h,label:this.label,cls:this.className||"",state:f,ariaDisabled:"disabled"==f?"true":"false",title:this.title,titleJs:j.gecko&&!j.hc?"":(this.title||"").replace("'",""),hasArrow:this.hasArrow?"true":"false",keydownFn:q,focusFn:r,clickFn:l,style:CKEDITOR.skin.getIconStyle(h,"rtl"==a.lang.dir,this.icon,this.iconOffset),arrowHtml:this.hasArrow?o.output():""};p.output(f,b);if(this.onRender)this.onRender();return d},setState:function(a){if(this._.state==a)return!1;this._.state=a;
|
||||
var b=CKEDITOR.document.getById(this._.id);return b?(b.setState(a,"cke_button"),a==CKEDITOR.TRISTATE_DISABLED?b.setAttribute("aria-disabled",!0):b.removeAttribute("aria-disabled"),this.hasArrow?(a=a==CKEDITOR.TRISTATE_ON?this._.editor.lang.button.selectedLabel.replace(/%1/g,this.label):this.label,CKEDITOR.document.getById(this._.id+"_label").setText(a)):a==CKEDITOR.TRISTATE_ON?b.setAttribute("aria-pressed",!0):b.removeAttribute("aria-pressed"),!0):!1},getState:function(){return this._.state},toFeature:function(a){if(this._.feature)return this._.feature;
|
||||
var b=this;!this.allowedContent&&(!this.requiredContent&&this.command)&&(b=a.getCommand(this.command)||b);return this._.feature=b}};CKEDITOR.ui.prototype.addButton=function(a,b){this.add(a,CKEDITOR.UI_BUTTON,b)}})();(function(){function w(a){function d(){for(var b=g(),e=CKEDITOR.tools.clone(a.config.toolbarGroups)||n(a),f=0;f<e.length;f++){var k=e[f];if("/"!=k){"string"==typeof k&&(k=e[f]={name:k});var i,d=k.groups;if(d)for(var h=0;h<d.length;h++)i=d[h],(i=b[i])&&c(k,i);(i=b[k.name])&&c(k,i)}}return e}function g(){var b={},c,f,e;for(c in a.ui.items)f=a.ui.items[c],e=f.toolbar||"others",e=e.split(","),f=e[0],e=parseInt(e[1]||-1,10),b[f]||(b[f]=[]),b[f].push({name:c,order:e});for(f in b)b[f]=b[f].sort(function(b,
|
||||
a){return b.order==a.order?0:0>a.order?-1:0>b.order?1:b.order<a.order?-1:1});return b}function c(c,e){if(e.length){c.items?c.items.push(a.ui.create("-")):c.items=[];for(var f;f=e.shift();)if(f="string"==typeof f?f:f.name,!b||-1==CKEDITOR.tools.indexOf(b,f))(f=a.ui.create(f))&&a.addFeature(f)&&c.items.push(f)}}function h(b){var a=[],e,d,h;for(e=0;e<b.length;++e)d=b[e],h={},"/"==d?a.push(d):CKEDITOR.tools.isArray(d)?(c(h,CKEDITOR.tools.clone(d)),a.push(h)):d.items&&(c(h,CKEDITOR.tools.clone(d.items)),
|
||||
h.name=d.name,a.push(h));return a}var b=a.config.removeButtons,b=b&&b.split(","),e=a.config.toolbar;"string"==typeof e&&(e=a.config["toolbar_"+e]);return a.toolbar=e?h(e):d()}function n(a){return a._.toolbarGroups||(a._.toolbarGroups=[{name:"document",groups:["mode","document","doctools"]},{name:"clipboard",groups:["clipboard","undo"]},{name:"editing",groups:["find","selection","spellchecker"]},{name:"forms"},"/",{name:"basicstyles",groups:["basicstyles","cleanup"]},{name:"paragraph",groups:["list",
|
||||
"indent","blocks","align","bidi"]},{name:"links"},{name:"insert"},"/",{name:"styles"},{name:"colors"},{name:"tools"},{name:"others"},{name:"about"}])}var u=function(){this.toolbars=[];this.focusCommandExecuted=!1};u.prototype.focus=function(){for(var a=0,d;d=this.toolbars[a++];)for(var g=0,c;c=d.items[g++];)if(c.focus){c.focus();return}};var x={modes:{wysiwyg:1,source:1},readOnly:1,exec:function(a){a.toolbox&&(a.toolbox.focusCommandExecuted=!0,CKEDITOR.env.ie||CKEDITOR.env.air?setTimeout(function(){a.toolbox.focus()},
|
||||
100):a.toolbox.focus())}};CKEDITOR.plugins.add("toolbar",{requires:"button",init:function(a){var d,g=function(c,h){var b,e="rtl"==a.lang.dir,j=a.config.toolbarGroupCycling,o=e?37:39,e=e?39:37,j=void 0===j||j;switch(h){case 9:case CKEDITOR.SHIFT+9:for(;!b||!b.items.length;)if(b=9==h?(b?b.next:c.toolbar.next)||a.toolbox.toolbars[0]:(b?b.previous:c.toolbar.previous)||a.toolbox.toolbars[a.toolbox.toolbars.length-1],b.items.length)for(c=b.items[d?b.items.length-1:0];c&&!c.focus;)(c=d?c.previous:c.next)||
|
||||
(b=0);c&&c.focus();return!1;case o:b=c;do b=b.next,!b&&j&&(b=c.toolbar.items[0]);while(b&&!b.focus);b?b.focus():g(c,9);return!1;case 40:return c.button&&c.button.hasArrow?(a.once("panelShow",function(b){b.data._.panel._.currentBlock.onKeyDown(40)}),c.execute()):g(c,40==h?o:e),!1;case e:case 38:b=c;do b=b.previous,!b&&j&&(b=c.toolbar.items[c.toolbar.items.length-1]);while(b&&!b.focus);b?b.focus():(d=1,g(c,CKEDITOR.SHIFT+9),d=0);return!1;case 27:return a.focus(),!1;case 13:case 32:return c.execute(),
|
||||
!1}return!0};a.on("uiSpace",function(c){if(c.data.space==a.config.toolbarLocation){c.removeListener();a.toolbox=new u;var d=CKEDITOR.tools.getNextId(),b=['<span id="',d,'" class="cke_voice_label">',a.lang.toolbar.toolbars,"</span>",'<span id="'+a.ui.spaceId("toolbox")+'" class="cke_toolbox" role="group" aria-labelledby="',d,'" onmousedown="return false;">'],d=!1!==a.config.toolbarStartupExpanded,e,j;a.config.toolbarCanCollapse&&a.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE&&b.push('<span class="cke_toolbox_main"'+
|
||||
(d?">":' style="display:none">'));for(var o=a.toolbox.toolbars,f=w(a),k=0;k<f.length;k++){var i,l=0,r,m=f[k],s;if(m)if(e&&(b.push("</span>"),j=e=0),"/"===m)b.push('<span class="cke_toolbar_break"></span>');else{s=m.items||m;for(var t=0;t<s.length;t++){var p=s[t],n;if(p)if(p.type==CKEDITOR.UI_SEPARATOR)j=e&&p;else{n=!1!==p.canGroup;if(!l){i=CKEDITOR.tools.getNextId();l={id:i,items:[]};r=m.name&&(a.lang.toolbar.toolbarGroups[m.name]||m.name);b.push('<span id="',i,'" class="cke_toolbar"',r?' aria-labelledby="'+
|
||||
i+'_label"':"",' role="toolbar">');r&&b.push('<span id="',i,'_label" class="cke_voice_label">',r,"</span>");b.push('<span class="cke_toolbar_start"></span>');var q=o.push(l)-1;0<q&&(l.previous=o[q-1],l.previous.next=l)}n?e||(b.push('<span class="cke_toolgroup" role="presentation">'),e=1):e&&(b.push("</span>"),e=0);i=function(c){c=c.render(a,b);q=l.items.push(c)-1;if(q>0){c.previous=l.items[q-1];c.previous.next=c}c.toolbar=l;c.onkey=g;c.onfocus=function(){a.toolbox.focusCommandExecuted||a.focus()}};
|
||||
j&&(i(j),j=0);i(p)}}e&&(b.push("</span>"),j=e=0);l&&b.push('<span class="cke_toolbar_end"></span></span>')}}a.config.toolbarCanCollapse&&b.push("</span>");if(a.config.toolbarCanCollapse&&a.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE){var v=CKEDITOR.tools.addFunction(function(){a.execCommand("toolbarCollapse")});a.on("destroy",function(){CKEDITOR.tools.removeFunction(v)});a.addCommand("toolbarCollapse",{readOnly:1,exec:function(b){var a=b.ui.space("toolbar_collapser"),c=a.getPrevious(),e=b.ui.space("contents"),
|
||||
d=c.getParent(),f=parseInt(e.$.style.height,10),h=d.$.offsetHeight,g=a.hasClass("cke_toolbox_collapser_min");g?(c.show(),a.removeClass("cke_toolbox_collapser_min"),a.setAttribute("title",b.lang.toolbar.toolbarCollapse)):(c.hide(),a.addClass("cke_toolbox_collapser_min"),a.setAttribute("title",b.lang.toolbar.toolbarExpand));a.getFirst().setText(g?"▲":"◀");e.setStyle("height",f-(d.$.offsetHeight-h)+"px");b.fire("resize")},modes:{wysiwyg:1,source:1}});a.setKeystroke(CKEDITOR.ALT+(CKEDITOR.env.ie||CKEDITOR.env.webkit?
|
||||
189:109),"toolbarCollapse");b.push('<a title="'+(d?a.lang.toolbar.toolbarCollapse:a.lang.toolbar.toolbarExpand)+'" id="'+a.ui.spaceId("toolbar_collapser")+'" tabIndex="-1" class="cke_toolbox_collapser');d||b.push(" cke_toolbox_collapser_min");b.push('" onclick="CKEDITOR.tools.callFunction('+v+')">','<span class="cke_arrow">▲</span>',"</a>")}b.push("</span>");c.data.html+=b.join("")}});a.on("destroy",function(){if(this.toolbox){var a,d=0,b,e,g;for(a=this.toolbox.toolbars;d<a.length;d++){e=a[d].items;
|
||||
for(b=0;b<e.length;b++)g=e[b],g.clickFn&&CKEDITOR.tools.removeFunction(g.clickFn),g.keyDownFn&&CKEDITOR.tools.removeFunction(g.keyDownFn)}}});a.on("uiReady",function(){var c=a.ui.space("toolbox");c&&a.focusManager.add(c,1)});a.addCommand("toolbarFocus",x);a.setKeystroke(CKEDITOR.ALT+121,"toolbarFocus");a.ui.add("-",CKEDITOR.UI_SEPARATOR,{});a.ui.addHandler(CKEDITOR.UI_SEPARATOR,{create:function(){return{render:function(a,d){d.push('<span class="cke_toolbar_separator" role="separator"></span>');return{}}}}})}});
|
||||
CKEDITOR.ui.prototype.addToolbarGroup=function(a,d,g){var c=n(this.editor),h=0===d,b={name:a};if(g){if(g=CKEDITOR.tools.search(c,function(a){return a.name==g})){!g.groups&&(g.groups=[]);if(d&&(d=CKEDITOR.tools.indexOf(g.groups,d),0<=d)){g.groups.splice(d+1,0,a);return}h?g.groups.splice(0,0,a):g.groups.push(a);return}d=null}d&&(d=CKEDITOR.tools.indexOf(c,function(a){return a.name==d}));h?c.splice(0,0,a):"number"==typeof d?c.splice(d+1,0,b):c.push(a)}})();CKEDITOR.UI_SEPARATOR="separator";
|
||||
CKEDITOR.config.toolbarLocation="top";(function(){function m(b,d,a){a=b.config.forceEnterMode||a;"wysiwyg"==b.mode&&(d||(d=b.activeEnterMode),b.elementPath().isContextFor("p")||(d=CKEDITOR.ENTER_BR,a=1),b.fire("saveSnapshot"),d==CKEDITOR.ENTER_BR?p(b,d,null,a):q(b,d,null,a),b.fire("saveSnapshot"))}function r(b){for(var b=b.getSelection().getRanges(!0),d=b.length-1;0<d;d--)b[d].deleteContents();return b[0]}function u(b){var d=b.startContainer.getAscendant(function(a){return a.type==CKEDITOR.NODE_ELEMENT&&"true"==a.getAttribute("contenteditable")},
|
||||
!0);if(b.root.equals(d))return b;d=new CKEDITOR.dom.range(d);d.moveToRange(b);return d}CKEDITOR.plugins.add("enterkey",{init:function(b){b.addCommand("enter",{modes:{wysiwyg:1},editorFocus:!1,exec:function(b){m(b)}});b.addCommand("shiftEnter",{modes:{wysiwyg:1},editorFocus:!1,exec:function(b){m(b,b.activeShiftEnterMode,1)}});b.setKeystroke([[13,"enter"],[CKEDITOR.SHIFT+13,"shiftEnter"]])}});var v=CKEDITOR.dom.walker.whitespaces(),w=CKEDITOR.dom.walker.bookmark();CKEDITOR.plugins.enterkey={enterBlock:function(b,
|
||||
d,a,h){if(a=a||r(b)){var a=u(a),f=a.document,i=a.checkStartOfBlock(),k=a.checkEndOfBlock(),j=b.elementPath(a.startContainer),c=j.block,l=d==CKEDITOR.ENTER_DIV?"div":"p",e;if(i&&k){if(c&&(c.is("li")||c.getParent().is("li"))){c.is("li")||(c=c.getParent());a=c.getParent();e=a.getParent();var h=!c.hasPrevious(),n=!c.hasNext(),l=b.getSelection(),g=l.createBookmarks(),i=c.getDirection(1),k=c.getAttribute("class"),o=c.getAttribute("style"),m=e.getDirection(1)!=i,b=b.enterMode!=CKEDITOR.ENTER_BR||m||o||k;
|
||||
if(e.is("li"))if(h||n)c[h?"insertBefore":"insertAfter"](e);else c.breakParent(e);else{if(b)if(j.block.is("li")?(e=f.createElement(d==CKEDITOR.ENTER_P?"p":"div"),m&&e.setAttribute("dir",i),o&&e.setAttribute("style",o),k&&e.setAttribute("class",k),c.moveChildren(e)):e=j.block,h||n)e[h?"insertBefore":"insertAfter"](a);else c.breakParent(a),e.insertAfter(a);else if(c.appendBogus(!0),h||n)for(;f=c[h?"getFirst":"getLast"]();)f[h?"insertBefore":"insertAfter"](a);else for(c.breakParent(a);f=c.getLast();)f.insertAfter(a);
|
||||
c.remove()}l.selectBookmarks(g);return}if(c&&c.getParent().is("blockquote")){c.breakParent(c.getParent());c.getPrevious().getFirst(CKEDITOR.dom.walker.invisible(1))||c.getPrevious().remove();c.getNext().getFirst(CKEDITOR.dom.walker.invisible(1))||c.getNext().remove();a.moveToElementEditStart(c);a.select();return}}else if(c&&c.is("pre")&&!k){p(b,d,a,h);return}if(i=a.splitBlock(l)){d=i.previousBlock;c=i.nextBlock;j=i.wasStartOfBlock;b=i.wasEndOfBlock;if(c)g=c.getParent(),g.is("li")&&(c.breakParent(g),
|
||||
c.move(c.getNext(),1));else if(d&&(g=d.getParent())&&g.is("li"))d.breakParent(g),g=d.getNext(),a.moveToElementEditStart(g),d.move(d.getPrevious());if(!j&&!b)c.is("li")&&(e=a.clone(),e.selectNodeContents(c),e=new CKEDITOR.dom.walker(e),e.evaluator=function(a){return!(w(a)||v(a)||a.type==CKEDITOR.NODE_ELEMENT&&a.getName()in CKEDITOR.dtd.$inline&&!(a.getName()in CKEDITOR.dtd.$empty))},(g=e.next())&&(g.type==CKEDITOR.NODE_ELEMENT&&g.is("ul","ol"))&&(CKEDITOR.env.needsBrFiller?f.createElement("br"):f.createText(" ")).insertBefore(g)),
|
||||
c&&a.moveToElementEditStart(c);else{if(d){if(d.is("li")||!s.test(d.getName())&&!d.is("pre"))e=d.clone()}else c&&(e=c.clone());e?h&&!e.is("li")&&e.renameNode(l):g&&g.is("li")?e=g:(e=f.createElement(l),d&&(n=d.getDirection())&&e.setAttribute("dir",n));if(f=i.elementPath){h=0;for(l=f.elements.length;h<l;h++){g=f.elements[h];if(g.equals(f.block)||g.equals(f.blockLimit))break;CKEDITOR.dtd.$removeEmpty[g.getName()]&&(g=g.clone(),e.moveChildren(g),e.append(g))}}e.appendBogus();e.getParent()||a.insertNode(e);
|
||||
e.is("li")&&e.removeAttribute("value");if(CKEDITOR.env.ie&&j&&(!b||!d.getChildCount()))a.moveToElementEditStart(b?d:e),a.select();a.moveToElementEditStart(j&&!b?c:e)}a.select();a.scrollIntoView()}}},enterBr:function(b,d,a,h){if(a=a||r(b)){var f=a.document,i=a.checkEndOfBlock(),k=new CKEDITOR.dom.elementPath(b.getSelection().getStartElement()),j=k.block,c=j&&k.block.getName();!h&&"li"==c?q(b,d,a,h):(!h&&i&&s.test(c)?(i=j.getDirection())?(f=f.createElement("div"),f.setAttribute("dir",i),f.insertAfter(j),
|
||||
a.setStart(f,0)):(f.createElement("br").insertAfter(j),CKEDITOR.env.gecko&&f.createText("").insertAfter(j),a.setStartAt(j.getNext(),CKEDITOR.env.ie?CKEDITOR.POSITION_BEFORE_START:CKEDITOR.POSITION_AFTER_START)):(b="pre"==c&&CKEDITOR.env.ie&&8>CKEDITOR.env.version?f.createText("\r"):f.createElement("br"),a.deleteContents(),a.insertNode(b),CKEDITOR.env.needsBrFiller?(f.createText("").insertAfter(b),i&&(j||k.blockLimit).appendBogus(),b.getNext().$.nodeValue="",a.setStartAt(b.getNext(),CKEDITOR.POSITION_AFTER_START)):
|
||||
a.setStartAt(b,CKEDITOR.POSITION_AFTER_END)),a.collapse(!0),a.select(),a.scrollIntoView())}}};var t=CKEDITOR.plugins.enterkey,p=t.enterBr,q=t.enterBlock,s=/^h[1-6]$/})();(function(){function i(b,f){var g={},c=[],e={nbsp:" ",shy:"",gt:">",lt:"<",amp:"&",apos:"'",quot:'"'},b=b.replace(/\b(nbsp|shy|gt|lt|amp|apos|quot)(?:,|$)/g,function(b,a){var d=f?"&"+a+";":e[a];g[d]=f?e[a]:"&"+a+";";c.push(d);return""});if(!f&&b){var b=b.split(","),a=document.createElement("div"),d;a.innerHTML="&"+b.join(";&")+";";d=a.innerHTML;a=null;for(a=0;a<d.length;a++){var h=d.charAt(a);g[h]="&"+b[a]+";";c.push(h)}}g.regex=c.join(f?"|":"");return g}CKEDITOR.plugins.add("entities",{afterInit:function(b){function f(a){return h[a]}
|
||||
function g(b){return"force"==c.entities_processNumerical||!a[b]?"&#"+b.charCodeAt(0)+";":a[b]}var c=b.config;if(b=(b=b.dataProcessor)&&b.htmlFilter){var e=[];!1!==c.basicEntities&&e.push("nbsp,gt,lt,amp");c.entities&&(e.length&&e.push("quot,iexcl,cent,pound,curren,yen,brvbar,sect,uml,copy,ordf,laquo,not,shy,reg,macr,deg,plusmn,sup2,sup3,acute,micro,para,middot,cedil,sup1,ordm,raquo,frac14,frac12,frac34,iquest,times,divide,fnof,bull,hellip,prime,Prime,oline,frasl,weierp,image,real,trade,alefsym,larr,uarr,rarr,darr,harr,crarr,lArr,uArr,rArr,dArr,hArr,forall,part,exist,empty,nabla,isin,notin,ni,prod,sum,minus,lowast,radic,prop,infin,ang,and,or,cap,cup,int,there4,sim,cong,asymp,ne,equiv,le,ge,sub,sup,nsub,sube,supe,oplus,otimes,perp,sdot,lceil,rceil,lfloor,rfloor,lang,rang,loz,spades,clubs,hearts,diams,circ,tilde,ensp,emsp,thinsp,zwnj,zwj,lrm,rlm,ndash,mdash,lsquo,rsquo,sbquo,ldquo,rdquo,bdquo,dagger,Dagger,permil,lsaquo,rsaquo,euro"),
|
||||
c.entities_latin&&e.push("Agrave,Aacute,Acirc,Atilde,Auml,Aring,AElig,Ccedil,Egrave,Eacute,Ecirc,Euml,Igrave,Iacute,Icirc,Iuml,ETH,Ntilde,Ograve,Oacute,Ocirc,Otilde,Ouml,Oslash,Ugrave,Uacute,Ucirc,Uuml,Yacute,THORN,szlig,agrave,aacute,acirc,atilde,auml,aring,aelig,ccedil,egrave,eacute,ecirc,euml,igrave,iacute,icirc,iuml,eth,ntilde,ograve,oacute,ocirc,otilde,ouml,oslash,ugrave,uacute,ucirc,uuml,yacute,thorn,yuml,OElig,oelig,Scaron,scaron,Yuml"),c.entities_greek&&e.push("Alpha,Beta,Gamma,Delta,Epsilon,Zeta,Eta,Theta,Iota,Kappa,Lambda,Mu,Nu,Xi,Omicron,Pi,Rho,Sigma,Tau,Upsilon,Phi,Chi,Psi,Omega,alpha,beta,gamma,delta,epsilon,zeta,eta,theta,iota,kappa,lambda,mu,nu,xi,omicron,pi,rho,sigmaf,sigma,tau,upsilon,phi,chi,psi,omega,thetasym,upsih,piv"),
|
||||
c.entities_additional&&e.push(c.entities_additional));var a=i(e.join(",")),d=a.regex?"["+a.regex+"]":"a^";delete a.regex;c.entities&&c.entities_processNumerical&&(d="[^ -~]|"+d);var d=RegExp(d,"g"),h=i("nbsp,gt,lt,amp,shy",!0),j=RegExp(h.regex,"g");b.addRules({text:function(a){return a.replace(j,f).replace(d,g)}},{applyToAll:!0,excludeNestedEditable:!0})}}})})();CKEDITOR.config.basicEntities=!0;CKEDITOR.config.entities=!0;CKEDITOR.config.entities_latin=!0;CKEDITOR.config.entities_greek=!0;
|
||||
CKEDITOR.config.entities_additional="#39";(function(){function i(a){var j=a.config,m=a.fire("uiSpace",{space:"top",html:""}).html,p=function(){function f(a,c,e){b.setStyle(c,s(e));b.setStyle("position",a)}function e(a){var b=i.getDocumentPosition();switch(a){case "top":f("absolute","top",b.y-n-o);break;case "pin":f("fixed","top",t);break;case "bottom":f("absolute","top",b.y+(c.height||c.bottom-c.top)+o)}k=a}var k,i,l,c,h,n,r,m=j.floatSpaceDockedOffsetX||0,o=j.floatSpaceDockedOffsetY||0,q=j.floatSpacePinnedOffsetX||0,t=j.floatSpacePinnedOffsetY||
|
||||
0;return function(d){if(i=a.editable())if(d&&"focus"==d.name&&b.show(),b.removeStyle("left"),b.removeStyle("right"),l=b.getClientRect(),c=i.getClientRect(),h=g.getViewPaneSize(),n=l.height,r="pageXOffset"in g.$?g.$.pageXOffset:CKEDITOR.document.$.documentElement.scrollLeft,k){n+o<=c.top?e("top"):n+o>h.height-c.bottom?e("pin"):e("bottom");var d=h.width/2,d=0<c.left&&c.right<h.width&&c.width>l.width?"rtl"==a.config.contentsLangDirection?"right":"left":d-c.left>c.right-d?"left":"right",f;l.width>h.width?
|
||||
(d="left",f=0):(f="left"==d?0<c.left?c.left:0:c.right<h.width?h.width-c.right:0,f+l.width>h.width&&(d="left"==d?"right":"left",f=0));b.setStyle(d,s(("pin"==k?q:m)+f+("pin"==k?0:"left"==d?r:-r)))}else k="pin",e("pin"),p(d)}}();if(m){var i=new CKEDITOR.template('<div id="cke_{name}" class="cke {id} cke_reset_all cke_chrome cke_editor_{name} cke_float cke_{langDir} '+CKEDITOR.env.cssClass+'" dir="{langDir}" title="'+(CKEDITOR.env.gecko?" ":"")+'" lang="{langCode}" role="application" style="{style}"'+
|
||||
(a.title?' aria-labelledby="cke_{name}_arialbl"':" ")+">"+(a.title?'<span id="cke_{name}_arialbl" class="cke_voice_label">{voiceLabel}</span>':" ")+'<div class="cke_inner"><div id="{topId}" class="cke_top" role="presentation">{content}</div></div></div>'),b=CKEDITOR.document.getBody().append(CKEDITOR.dom.element.createFromHtml(i.output({content:m,id:a.id,langDir:a.lang.dir,langCode:a.langCode,name:a.name,style:"display:none;z-index:"+(j.baseFloatZIndex-1),topId:a.ui.spaceId("top"),voiceLabel:a.title}))),
|
||||
q=CKEDITOR.tools.eventsBuffer(500,p),e=CKEDITOR.tools.eventsBuffer(100,p);b.unselectable();b.on("mousedown",function(a){a=a.data;a.getTarget().hasAscendant("a",1)||a.preventDefault()});a.on("focus",function(b){p(b);a.on("change",q.input);g.on("scroll",e.input);g.on("resize",e.input)});a.on("blur",function(){b.hide();a.removeListener("change",q.input);g.removeListener("scroll",e.input);g.removeListener("resize",e.input)});a.on("destroy",function(){g.removeListener("scroll",e.input);g.removeListener("resize",
|
||||
e.input);b.clearCustomData();b.remove()});a.focusManager.hasFocus&&b.show();a.focusManager.add(b,1)}}var g=CKEDITOR.document.getWindow(),s=CKEDITOR.tools.cssLength;CKEDITOR.plugins.add("floatingspace",{init:function(a){a.on("loaded",function(){i(this)},null,null,20)}})})();(function(){function k(a){var e=this.editor,b=a.document,c=b.body,d=b.getElementById("cke_actscrpt");d&&d.parentNode.removeChild(d);(d=b.getElementById("cke_shimscrpt"))&&d.parentNode.removeChild(d);(d=b.getElementById("cke_basetagscrpt"))&&d.parentNode.removeChild(d);c.contentEditable=!0;CKEDITOR.env.ie&&(c.hideFocus=!0,c.disabled=!0,c.removeAttribute("disabled"));delete this._.isLoadingData;this.$=c;b=new CKEDITOR.dom.document(b);this.setup();this.fixInitialSelection();CKEDITOR.env.ie&&(b.getDocumentElement().addClass(b.$.compatMode),
|
||||
e.config.enterMode!=CKEDITOR.ENTER_P&&this.attachListener(b,"selectionchange",function(){var a=b.getBody(),c=e.getSelection(),d=c&&c.getRanges()[0];d&&(a.getHtml().match(/^<p>(?: |<br>)<\/p>$/i)&&d.startContainer.equals(a))&&setTimeout(function(){d=e.getSelection().getRanges()[0];if(!d.startContainer.equals("body")){a.getFirst().remove(1);d.moveToElementEditEnd(a);d.select()}},0)}));if(CKEDITOR.env.webkit||CKEDITOR.env.ie&&10<CKEDITOR.env.version)b.getDocumentElement().on("mousedown",function(a){a.data.getTarget().is("html")&&
|
||||
setTimeout(function(){e.editable().focus()})});l(e);try{e.document.$.execCommand("2D-position",!1,!0)}catch(g){}(CKEDITOR.env.gecko||CKEDITOR.env.ie&&"CSS1Compat"==e.document.$.compatMode)&&this.attachListener(this,"keydown",function(a){var b=a.data.getKeystroke();if(b==33||b==34)if(CKEDITOR.env.ie)setTimeout(function(){e.getSelection().scrollIntoView()},0);else if(e.window.$.innerHeight>this.$.offsetHeight){var c=e.createRange();c[b==33?"moveToElementEditStart":"moveToElementEditEnd"](this);c.select();
|
||||
a.data.preventDefault()}});CKEDITOR.env.ie&&this.attachListener(b,"blur",function(){try{b.$.selection.empty()}catch(a){}});CKEDITOR.env.iOS&&this.attachListener(b,"touchend",function(){a.focus()});c=e.document.getElementsByTag("title").getItem(0);c.data("cke-title",c.getText());CKEDITOR.env.ie&&(e.document.$.title=this._.docTitle);CKEDITOR.tools.setTimeout(function(){if(this.status=="unloaded")this.status="ready";e.fire("contentDom");if(this._.isPendingFocus){e.focus();this._.isPendingFocus=false}setTimeout(function(){e.fire("dataReady")},
|
||||
0);CKEDITOR.env.ie&&setTimeout(function(){if(e.document){var a=e.document.$.body;a.runtimeStyle.marginBottom="0px";a.runtimeStyle.marginBottom=""}},1E3)},0,this)}function l(a){function e(){var c;a.editable().attachListener(a,"selectionChange",function(){var d=a.getSelection().getSelectedElement();d&&(c&&(c.detachEvent("onresizestart",b),c=null),d.$.attachEvent("onresizestart",b),c=d.$)})}function b(a){a.returnValue=!1}if(CKEDITOR.env.gecko)try{var c=a.document.$;c.execCommand("enableObjectResizing",
|
||||
!1,!a.config.disableObjectResizing);c.execCommand("enableInlineTableEditing",!1,!a.config.disableNativeTableHandles)}catch(d){}else CKEDITOR.env.ie&&(11>CKEDITOR.env.version&&a.config.disableObjectResizing)&&e(a)}function m(){var a=[];if(8<=CKEDITOR.document.$.documentMode){a.push("html.CSS1Compat [contenteditable=false]{min-height:0 !important}");var e=[],b;for(b in CKEDITOR.dtd.$removeEmpty)e.push("html.CSS1Compat "+b+"[contenteditable=false]");a.push(e.join(",")+"{display:inline-block}")}else CKEDITOR.env.gecko&&
|
||||
(a.push("html{height:100% !important}"),a.push("img:-moz-broken{-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}"));a.push("html{cursor:text;*cursor:auto}");a.push("img,input,textarea{cursor:default}");return a.join("\n")}CKEDITOR.plugins.add("wysiwygarea",{init:function(a){a.config.fullPage&&a.addFeature({allowedContent:"html head title; style [media,type]; body (*)[id]; meta link [*]",requiredContent:"body"});a.addMode("wysiwyg",function(e){function b(b){b&&b.removeListener();a.editable(new j(a,
|
||||
d.$.contentWindow.document.body));a.setData(a.getData(1),e)}var c="document.open();"+(CKEDITOR.env.ie?"("+CKEDITOR.tools.fixDomain+")();":"")+"document.close();",c=CKEDITOR.env.air?"javascript:void(0)":CKEDITOR.env.ie?"javascript:void(function(){"+encodeURIComponent(c)+"}())":"",d=CKEDITOR.dom.element.createFromHtml('<iframe src="'+c+'" frameBorder="0"></iframe>');d.setStyles({width:"100%",height:"100%"});d.addClass("cke_wysiwyg_frame cke_reset");var g=a.ui.space("contents");g.append(d);if(c=CKEDITOR.env.ie||
|
||||
CKEDITOR.env.gecko)d.on("load",b);var f=a.title,h=a.fire("ariaEditorHelpLabel",{}).label;f&&(CKEDITOR.env.ie&&h&&(f+=", "+h),d.setAttribute("title",f));if(h){var f=CKEDITOR.tools.getNextId(),i=CKEDITOR.dom.element.createFromHtml('<span id="'+f+'" class="cke_voice_label">'+h+"</span>");g.append(i,1);d.setAttribute("aria-describedby",f)}a.on("beforeModeUnload",function(a){a.removeListener();i&&i.remove()});d.setAttributes({tabIndex:a.tabIndex,allowTransparency:"true"});!c&&b();CKEDITOR.env.webkit&&
|
||||
(c=function(){g.setStyle("width","100%");d.hide();d.setSize("width",g.getSize("width"));g.removeStyle("width");d.show()},d.setCustomData("onResize",c),CKEDITOR.document.getWindow().on("resize",c));a.fire("ariaWidget",d)})}});CKEDITOR.editor.prototype.addContentsCss=function(a){var e=this.config,b=e.contentsCss;CKEDITOR.tools.isArray(b)||(e.contentsCss=b?[b]:[]);e.contentsCss.push(a)};var j=CKEDITOR.tools.createClass({$:function(){this.base.apply(this,arguments);this._.frameLoadedHandler=CKEDITOR.tools.addFunction(function(a){CKEDITOR.tools.setTimeout(k,
|
||||
0,this,a)},this);this._.docTitle=this.getWindow().getFrame().getAttribute("title")},base:CKEDITOR.editable,proto:{setData:function(a,e){var b=this.editor;if(e)this.setHtml(a),this.fixInitialSelection(),b.fire("dataReady");else{this._.isLoadingData=!0;b._.dataStore={id:1};var c=b.config,d=c.fullPage,g=c.docType,f=CKEDITOR.tools.buildStyleHtml(m()).replace(/<style>/,'<style data-cke-temp="1">');d||(f+=CKEDITOR.tools.buildStyleHtml(b.config.contentsCss));var h=c.baseHref?'<base href="'+c.baseHref+'" data-cke-temp="1" />':
|
||||
"";d&&(a=a.replace(/<!DOCTYPE[^>]*>/i,function(a){b.docType=g=a;return""}).replace(/<\?xml\s[^\?]*\?>/i,function(a){b.xmlDeclaration=a;return""}));a=b.dataProcessor.toHtml(a);d?(/<body[\s|>]/.test(a)||(a="<body>"+a),/<html[\s|>]/.test(a)||(a="<html>"+a+"</html>"),/<head[\s|>]/.test(a)?/<title[\s|>]/.test(a)||(a=a.replace(/<head[^>]*>/,"$&<title></title>")):a=a.replace(/<html[^>]*>/,"$&<head><title></title></head>"),h&&(a=a.replace(/<head[^>]*?>/,"$&"+h)),a=a.replace(/<\/head\s*>/,f+"$&"),a=g+a):a=
|
||||
c.docType+'<html dir="'+c.contentsLangDirection+'" lang="'+(c.contentsLanguage||b.langCode)+'"><head><title>'+this._.docTitle+"</title>"+h+f+"</head><body"+(c.bodyId?' id="'+c.bodyId+'"':"")+(c.bodyClass?' class="'+c.bodyClass+'"':"")+">"+a+"</body></html>";CKEDITOR.env.gecko&&(a=a.replace(/<body/,'<body contenteditable="true" '),2E4>CKEDITOR.env.version&&(a=a.replace(/<body[^>]*>/,"$&<\!-- cke-content-start --\>")));c='<script id="cke_actscrpt" type="text/javascript"'+(CKEDITOR.env.ie?' defer="defer" ':
|
||||
"")+">var wasLoaded=0;function onload(){if(!wasLoaded)window.parent.CKEDITOR.tools.callFunction("+this._.frameLoadedHandler+",window);wasLoaded=1;}"+(CKEDITOR.env.ie?"onload();":'document.addEventListener("DOMContentLoaded", onload, false );')+"<\/script>";CKEDITOR.env.ie&&9>CKEDITOR.env.version&&(c+='<script id="cke_shimscrpt">window.parent.CKEDITOR.tools.enableHtml5Elements(document)<\/script>');h&&(CKEDITOR.env.ie&&10>CKEDITOR.env.version)&&(c+='<script id="cke_basetagscrpt">var baseTag = document.querySelector( "base" );baseTag.href = baseTag.href;<\/script>');
|
||||
a=a.replace(/(?=\s*<\/(:?head)>)/,c);this.clearCustomData();this.clearListeners();b.fire("contentDomUnload");var i=this.getDocument();try{i.write(a)}catch(j){setTimeout(function(){i.write(a)},0)}}},getData:function(a){if(a)return this.getHtml();var a=this.editor,e=a.config,b=e.fullPage,c=b&&a.docType,d=b&&a.xmlDeclaration,g=this.getDocument(),b=b?g.getDocumentElement().getOuterHtml():g.getBody().getHtml();CKEDITOR.env.gecko&&e.enterMode!=CKEDITOR.ENTER_BR&&(b=b.replace(/<br>(?=\s*(:?$|<\/body>))/,
|
||||
""));b=a.dataProcessor.toDataFormat(b);d&&(b=d+"\n"+b);c&&(b=c+"\n"+b);return b},focus:function(){this._.isLoadingData?this._.isPendingFocus=!0:j.baseProto.focus.call(this)},detach:function(){var a=this.editor,e=a.document,a=a.window.getFrame();j.baseProto.detach.call(this);this.clearCustomData();e.getDocumentElement().clearCustomData();a.clearCustomData();CKEDITOR.tools.removeFunction(this._.frameLoadedHandler);(e=a.removeCustomData("onResize"))&&e.removeListener();a.remove()}}})})();
|
||||
CKEDITOR.config.disableObjectResizing=!1;CKEDITOR.config.disableNativeTableHandles=!0;CKEDITOR.config.disableNativeSpellChecker=!0;CKEDITOR.config.contentsCss=CKEDITOR.getUrl("contents.css");(function(){function k(a,b){var e,f;b.on("refresh",function(a){var b=[i],c;for(c in a.data.states)b.push(a.data.states[c]);this.setState(CKEDITOR.tools.search(b,m)?m:i)},b,null,100);b.on("exec",function(b){e=a.getSelection();f=e.createBookmarks(1);b.data||(b.data={});b.data.done=!1},b,null,0);b.on("exec",function(){a.forceNextSelectionCheck();e.selectBookmarks(f)},b,null,100)}var i=CKEDITOR.TRISTATE_DISABLED,m=CKEDITOR.TRISTATE_OFF;CKEDITOR.plugins.add("indent",{init:function(a){var b=CKEDITOR.plugins.indent.genericDefinition;
|
||||
k(a,a.addCommand("indent",new b(!0)));k(a,a.addCommand("outdent",new b));a.ui.addButton&&(a.ui.addButton("Indent",{label:a.lang.indent.indent,command:"indent",directional:!0,toolbar:"indent,20"}),a.ui.addButton("Outdent",{label:a.lang.indent.outdent,command:"outdent",directional:!0,toolbar:"indent,10"}));a.on("dirChanged",function(b){var f=a.createRange(),j=b.data.node;f.setStartBefore(j);f.setEndAfter(j);for(var l=new CKEDITOR.dom.walker(f),c;c=l.next();)if(c.type==CKEDITOR.NODE_ELEMENT)if(!c.equals(j)&&
|
||||
c.getDirection()){f.setStartAfter(c);l=new CKEDITOR.dom.walker(f)}else{var d=a.config.indentClasses;if(d)for(var g=b.data.dir=="ltr"?["_rtl",""]:["","_rtl"],h=0;h<d.length;h++)if(c.hasClass(d[h]+g[0])){c.removeClass(d[h]+g[0]);c.addClass(d[h]+g[1])}d=c.getStyle("margin-right");g=c.getStyle("margin-left");d?c.setStyle("margin-left",d):c.removeStyle("margin-left");g?c.setStyle("margin-right",g):c.removeStyle("margin-right")}})}});CKEDITOR.plugins.indent={genericDefinition:function(a){this.isIndent=
|
||||
!!a;this.startDisabled=!this.isIndent},specificDefinition:function(a,b,e){this.name=b;this.editor=a;this.jobs={};this.enterBr=a.config.enterMode==CKEDITOR.ENTER_BR;this.isIndent=!!e;this.relatedGlobal=e?"indent":"outdent";this.indentKey=e?9:CKEDITOR.SHIFT+9;this.database={}},registerCommands:function(a,b){a.on("pluginsLoaded",function(){for(var a in b)(function(a,b){var e=a.getCommand(b.relatedGlobal),c;for(c in b.jobs)e.on("exec",function(d){d.data.done||(a.fire("lockSnapshot"),b.execJob(a,c)&&(d.data.done=
|
||||
!0),a.fire("unlockSnapshot"),CKEDITOR.dom.element.clearAllMarkers(b.database))},this,null,c),e.on("refresh",function(d){d.data.states||(d.data.states={});d.data.states[b.name+"@"+c]=b.refreshJob(a,c,d.data.path)},this,null,c);a.addFeature(b)})(this,b[a])})}};CKEDITOR.plugins.indent.genericDefinition.prototype={context:"p",exec:function(){}};CKEDITOR.plugins.indent.specificDefinition.prototype={execJob:function(a,b){var e=this.jobs[b];if(e.state!=i)return e.exec.call(this,a)},refreshJob:function(a,
|
||||
b,e){b=this.jobs[b];b.state=a.activeFilter.checkFeature(this)?b.refresh.call(this,a,e):i;return b.state},getContext:function(a){return a.contains(this.context)}}})();(function(){function s(c){function f(b){for(var e=d.startContainer,a=d.endContainer;e&&!e.getParent().equals(b);)e=e.getParent();for(;a&&!a.getParent().equals(b);)a=a.getParent();if(!e||!a)return!1;for(var g=e,e=[],i=!1;!i;)g.equals(a)&&(i=!0),e.push(g),g=g.getNext();if(1>e.length)return!1;g=b.getParents(!0);for(a=0;a<g.length;a++)if(g[a].getName&&m[g[a].getName()]){b=g[a];break}for(var g=j.isIndent?1:-1,a=e[0],e=e[e.length-1],i=CKEDITOR.plugins.list.listToArray(b,n),l=i[e.getCustomData("listarray_index")].indent,
|
||||
a=a.getCustomData("listarray_index");a<=e.getCustomData("listarray_index");a++)if(i[a].indent+=g,0<g){var h=i[a].parent;i[a].parent=new CKEDITOR.dom.element(h.getName(),h.getDocument())}for(a=e.getCustomData("listarray_index")+1;a<i.length&&i[a].indent>l;a++)i[a].indent+=g;e=CKEDITOR.plugins.list.arrayToList(i,n,null,c.config.enterMode,b.getDirection());if(!j.isIndent){var f;if((f=b.getParent())&&f.is("li"))for(var g=e.listNode.getChildren(),o=[],k,a=g.count()-1;0<=a;a--)(k=g.getItem(a))&&(k.is&&
|
||||
k.is("li"))&&o.push(k)}e&&e.listNode.replace(b);if(o&&o.length)for(a=0;a<o.length;a++){for(k=b=o[a];(k=k.getNext())&&k.is&&k.getName()in m;)CKEDITOR.env.needsNbspFiller&&!b.getFirst(t)&&b.append(d.document.createText(" ")),b.append(k);b.insertAfter(f)}e&&c.fire("contentDomInvalidated");return!0}for(var j=this,n=this.database,m=this.context,l=c.getSelection(),l=(l&&l.getRanges()).createIterator(),d;d=l.getNextRange();){for(var b=d.getCommonAncestor();b&&!(b.type==CKEDITOR.NODE_ELEMENT&&m[b.getName()]);)b=
|
||||
b.getParent();b||(b=d.startPath().contains(m))&&d.setEndAt(b,CKEDITOR.POSITION_BEFORE_END);if(!b){var h=d.getEnclosedNode();h&&(h.type==CKEDITOR.NODE_ELEMENT&&h.getName()in m)&&(d.setStartAt(h,CKEDITOR.POSITION_AFTER_START),d.setEndAt(h,CKEDITOR.POSITION_BEFORE_END),b=h)}b&&(d.startContainer.type==CKEDITOR.NODE_ELEMENT&&d.startContainer.getName()in m)&&(h=new CKEDITOR.dom.walker(d),h.evaluator=p,d.startContainer=h.next());b&&(d.endContainer.type==CKEDITOR.NODE_ELEMENT&&d.endContainer.getName()in m)&&
|
||||
(h=new CKEDITOR.dom.walker(d),h.evaluator=p,d.endContainer=h.previous());if(b)return f(b)}return 0}function p(c){return c.type==CKEDITOR.NODE_ELEMENT&&c.is("li")}function t(c){return u(c)&&v(c)}var u=CKEDITOR.dom.walker.whitespaces(!0),v=CKEDITOR.dom.walker.bookmark(!1,!0),q=CKEDITOR.TRISTATE_DISABLED,r=CKEDITOR.TRISTATE_OFF;CKEDITOR.plugins.add("indentlist",{requires:"indent",init:function(c){function f(c){j.specificDefinition.apply(this,arguments);this.requiredContent=["ul","ol"];c.on("key",function(f){if("wysiwyg"==
|
||||
c.mode&&f.data.keyCode==this.indentKey){var l=this.getContext(c.elementPath());if(l&&(!this.isIndent||!CKEDITOR.plugins.indentList.firstItemInPath(this.context,c.elementPath(),l)))c.execCommand(this.relatedGlobal),f.cancel()}},this);this.jobs[this.isIndent?10:30]={refresh:this.isIndent?function(c,f){var d=this.getContext(f),b=CKEDITOR.plugins.indentList.firstItemInPath(this.context,f,d);return!d||!this.isIndent||b?q:r}:function(c,f){return!this.getContext(f)||this.isIndent?q:r},exec:CKEDITOR.tools.bind(s,
|
||||
this)}}var j=CKEDITOR.plugins.indent;j.registerCommands(c,{indentlist:new f(c,"indentlist",!0),outdentlist:new f(c,"outdentlist")});CKEDITOR.tools.extend(f.prototype,j.specificDefinition.prototype,{context:{ol:1,ul:1}})}});CKEDITOR.plugins.indentList={};CKEDITOR.plugins.indentList.firstItemInPath=function(c,f,j){var n=f.contains(p);j||(j=f.contains(c));return j&&n&&n.equals(j.getFirst(p))}})();(function(){function g(a,b){var c=j.exec(a),d=j.exec(b);if(c){if(!c[2]&&"px"==d[2])return d[1];if("px"==c[2]&&!d[2])return d[1]+"px"}return b}var i=CKEDITOR.htmlParser.cssStyle,h=CKEDITOR.tools.cssLength,j=/^((?:\d*(?:\.\d+))|(?:\d+))(.*)?$/i,k={elements:{$:function(a){var b=a.attributes;if((b=(b=(b=b&&b["data-cke-realelement"])&&new CKEDITOR.htmlParser.fragment.fromHtml(decodeURIComponent(b)))&&b.children[0])&&a.attributes["data-cke-resizable"]){var c=(new i(a)).rules,a=b.attributes,d=c.width,c=
|
||||
c.height;d&&(a.width=g(a.width,d));c&&(a.height=g(a.height,c))}return b}}};CKEDITOR.plugins.add("fakeobjects",{init:function(a){a.filter.allow("img[!data-cke-realelement,src,alt,title](*){*}","fakeobjects")},afterInit:function(a){(a=(a=a.dataProcessor)&&a.htmlFilter)&&a.addRules(k,{applyToAll:!0})}});CKEDITOR.editor.prototype.createFakeElement=function(a,b,c,d){var e=this.lang.fakeobjects,e=e[c]||e.unknown,b={"class":b,"data-cke-realelement":encodeURIComponent(a.getOuterHtml()),"data-cke-real-node-type":a.type,
|
||||
alt:e,title:e,align:a.getAttribute("align")||""};CKEDITOR.env.hc||(b.src=CKEDITOR.tools.transparentImageData);c&&(b["data-cke-real-element-type"]=c);d&&(b["data-cke-resizable"]=d,c=new i,d=a.getAttribute("width"),a=a.getAttribute("height"),d&&(c.rules.width=h(d)),a&&(c.rules.height=h(a)),c.populate(b));return this.document.createElement("img",{attributes:b})};CKEDITOR.editor.prototype.createFakeParserElement=function(a,b,c,d){var e=this.lang.fakeobjects,e=e[c]||e.unknown,f;f=new CKEDITOR.htmlParser.basicWriter;
|
||||
a.writeHtml(f);f=f.getHtml();b={"class":b,"data-cke-realelement":encodeURIComponent(f),"data-cke-real-node-type":a.type,alt:e,title:e,align:a.attributes.align||""};CKEDITOR.env.hc||(b.src=CKEDITOR.tools.transparentImageData);c&&(b["data-cke-real-element-type"]=c);d&&(b["data-cke-resizable"]=d,d=a.attributes,a=new i,c=d.width,d=d.height,void 0!==c&&(a.rules.width=h(c)),void 0!==d&&(a.rules.height=h(d)),a.populate(b));return new CKEDITOR.htmlParser.element("img",b)};CKEDITOR.editor.prototype.restoreRealElement=
|
||||
function(a){if(a.data("cke-real-node-type")!=CKEDITOR.NODE_ELEMENT)return null;var b=CKEDITOR.dom.element.createFromHtml(decodeURIComponent(a.data("cke-realelement")),this.document);if(a.data("cke-resizable")){var c=a.getStyle("width"),a=a.getStyle("height");c&&b.setAttribute("width",g(b.getAttribute("width"),c));a&&b.setAttribute("height",g(b.getAttribute("height"),a))}return b}})();(function(){function m(c){return c.replace(/'/g,"\\$&")}function n(c){for(var b,a=c.length,f=[],e=0;e<a;e++)b=c.charCodeAt(e),f.push(b);return"String.fromCharCode("+f.join(",")+")"}function o(c,b){var a=c.plugins.link,f=a.compiledProtectionFunction.params,e,d;d=[a.compiledProtectionFunction.name,"("];for(var g=0;g<f.length;g++)a=f[g].toLowerCase(),e=b[a],0<g&&d.push(","),d.push("'",e?m(encodeURIComponent(b[a])):"","'");d.push(")");return d.join("")}function l(c){var c=c.config.emailProtection||"",
|
||||
b;c&&"encode"!=c&&(b={},c.replace(/^([^(]+)\(([^)]+)\)$/,function(a,c,e){b.name=c;b.params=[];e.replace(/[^,\s]+/g,function(a){b.params.push(a)})}));return b}CKEDITOR.plugins.add("link",{requires:"dialog,fakeobjects",onLoad:function(){function c(b){return a.replace(/%1/g,"rtl"==b?"right":"left").replace(/%2/g,"cke_contents_"+b)}var b="background:url("+CKEDITOR.getUrl(this.path+"images"+(CKEDITOR.env.hidpi?"/hidpi":"")+"/anchor.png")+") no-repeat %1 center;border:1px dotted #00f;background-size:16px;",
|
||||
a=".%2 a.cke_anchor,.%2 a.cke_anchor_empty,.cke_editable.%2 a[name],.cke_editable.%2 a[data-cke-saved-name]{"+b+"padding-%1:18px;cursor:auto;}.%2 img.cke_anchor{"+b+"width:16px;min-height:15px;height:1.15em;vertical-align:text-bottom;}";CKEDITOR.addCss(c("ltr")+c("rtl"))},init:function(c){var b="a[!href]";CKEDITOR.dialog.isTabEnabled(c,"link","advanced")&&(b=b.replace("]",",accesskey,charset,dir,id,lang,name,rel,tabindex,title,type]{*}(*)"));CKEDITOR.dialog.isTabEnabled(c,"link","target")&&(b=b.replace("]",
|
||||
",target,onclick]"));c.addCommand("link",new CKEDITOR.dialogCommand("link",{allowedContent:b,requiredContent:"a[href]"}));c.addCommand("anchor",new CKEDITOR.dialogCommand("anchor",{allowedContent:"a[!name,id]",requiredContent:"a[name]"}));c.addCommand("unlink",new CKEDITOR.unlinkCommand);c.addCommand("removeAnchor",new CKEDITOR.removeAnchorCommand);c.setKeystroke(CKEDITOR.CTRL+76,"link");c.ui.addButton&&(c.ui.addButton("Link",{label:c.lang.link.toolbar,command:"link",toolbar:"links,10"}),c.ui.addButton("Unlink",
|
||||
{label:c.lang.link.unlink,command:"unlink",toolbar:"links,20"}),c.ui.addButton("Anchor",{label:c.lang.link.anchor.toolbar,command:"anchor",toolbar:"links,30"}));CKEDITOR.dialog.add("link",this.path+"dialogs/link.js");CKEDITOR.dialog.add("anchor",this.path+"dialogs/anchor.js");c.on("doubleclick",function(a){var b=CKEDITOR.plugins.link.getSelectedLink(c)||a.data.element;if(!b.isReadOnly())if(b.is("a")){a.data.dialog=b.getAttribute("name")&&(!b.getAttribute("href")||!b.getChildCount())?"anchor":"link";
|
||||
a.data.link=b}else if(CKEDITOR.plugins.link.tryRestoreFakeAnchor(c,b))a.data.dialog="anchor"},null,null,0);c.on("doubleclick",function(a){a.data.dialog in{link:1,anchor:1}&&a.data.link&&c.getSelection().selectElement(a.data.link)},null,null,20);c.addMenuItems&&c.addMenuItems({anchor:{label:c.lang.link.anchor.menu,command:"anchor",group:"anchor",order:1},removeAnchor:{label:c.lang.link.anchor.remove,command:"removeAnchor",group:"anchor",order:5},link:{label:c.lang.link.menu,command:"link",group:"link",
|
||||
order:1},unlink:{label:c.lang.link.unlink,command:"unlink",group:"link",order:5}});c.contextMenu&&c.contextMenu.addListener(function(a){if(!a||a.isReadOnly())return null;a=CKEDITOR.plugins.link.tryRestoreFakeAnchor(c,a);if(!a&&!(a=CKEDITOR.plugins.link.getSelectedLink(c)))return null;var b={};a.getAttribute("href")&&a.getChildCount()&&(b={link:CKEDITOR.TRISTATE_OFF,unlink:CKEDITOR.TRISTATE_OFF});if(a&&a.hasAttribute("name"))b.anchor=b.removeAnchor=CKEDITOR.TRISTATE_OFF;return b});this.compiledProtectionFunction=
|
||||
l(c)},afterInit:function(c){c.dataProcessor.dataFilter.addRules({elements:{a:function(a){return!a.attributes.name?null:!a.children.length?c.createFakeParserElement(a,"cke_anchor","anchor"):null}}});var b=c._.elementsPath&&c._.elementsPath.filters;b&&b.push(function(a,b){if("a"==b&&(CKEDITOR.plugins.link.tryRestoreFakeAnchor(c,a)||a.getAttribute("name")&&(!a.getAttribute("href")||!a.getChildCount())))return"anchor"})}});var p=/^javascript:/,q=/^mailto:([^?]+)(?:\?(.+))?$/,r=/subject=([^;?:@&=$,\/]*)/,
|
||||
s=/body=([^;?:@&=$,\/]*)/,t=/^#(.*)$/,u=/^((?:http|https|ftp|news):\/\/)?(.*)$/,v=/^(_(?:self|top|parent|blank))$/,w=/^javascript:void\(location\.href='mailto:'\+String\.fromCharCode\(([^)]+)\)(?:\+'(.*)')?\)$/,x=/^javascript:([^(]+)\(([^)]+)\)$/,y=/\s*window.open\(\s*this\.href\s*,\s*(?:'([^']*)'|null)\s*,\s*'([^']*)'\s*\)\s*;\s*return\s*false;*\s*/,z=/(?:^|,)([^=]+)=(\d+|yes|no)/gi,j={id:"advId",dir:"advLangDir",accessKey:"advAccessKey",name:"advName",lang:"advLangCode",tabindex:"advTabIndex",title:"advTitle",
|
||||
type:"advContentType","class":"advCSSClasses",charset:"advCharset",style:"advStyles",rel:"advRel"};CKEDITOR.plugins.link={getSelectedLink:function(c){var b=c.getSelection(),a=b.getSelectedElement();return a&&a.is("a")?a:(b=b.getRanges()[0])?(b.shrink(CKEDITOR.SHRINK_TEXT),c.elementPath(b.getCommonAncestor()).contains("a",1)):null},getEditorAnchors:function(c){for(var b=c.editable(),a=b.isInline()&&!c.plugins.divarea?c.document:b,b=a.getElementsByTag("a"),a=a.getElementsByTag("img"),f=[],e=0,d;d=b.getItem(e++);)if(d.data("cke-saved-name")||
|
||||
d.hasAttribute("name"))f.push({name:d.data("cke-saved-name")||d.getAttribute("name"),id:d.getAttribute("id")});for(e=0;d=a.getItem(e++);)(d=this.tryRestoreFakeAnchor(c,d))&&f.push({name:d.getAttribute("name"),id:d.getAttribute("id")});return f},fakeAnchor:!0,tryRestoreFakeAnchor:function(c,b){if(b&&b.data("cke-real-element-type")&&"anchor"==b.data("cke-real-element-type")){var a=c.restoreRealElement(b);if(a.data("cke-saved-name"))return a}},parseLinkAttributes:function(c,b){var a=b&&(b.data("cke-saved-href")||
|
||||
b.getAttribute("href"))||"",f=c.plugins.link.compiledProtectionFunction,e=c.config.emailProtection,d,g={};a.match(p)&&("encode"==e?a=a.replace(w,function(a,b,c){return"mailto:"+String.fromCharCode.apply(String,b.split(","))+(c&&c.replace(/\\'/g,"'"))}):e&&a.replace(x,function(a,b,c){if(b==f.name){g.type="email";for(var a=g.email={},b=/(^')|('$)/g,c=c.match(/[^,\s]+/g),d=c.length,e,h,i=0;i<d;i++)e=decodeURIComponent,h=c[i].replace(b,"").replace(/\\'/g,"'"),h=e(h),e=f.params[i].toLowerCase(),a[e]=h;
|
||||
a.address=[a.name,a.domain].join("@")}}));if(!g.type)if(e=a.match(t))g.type="anchor",g.anchor={},g.anchor.name=g.anchor.id=e[1];else if(e=a.match(q)){d=a.match(r);a=a.match(s);g.type="email";var i=g.email={};i.address=e[1];d&&(i.subject=decodeURIComponent(d[1]));a&&(i.body=decodeURIComponent(a[1]))}else if(a&&(d=a.match(u)))g.type="url",g.url={},g.url.protocol=d[1],g.url.url=d[2];if(b){if(a=b.getAttribute("target"))g.target={type:a.match(v)?a:"frame",name:a};else if(a=(a=b.data("cke-pa-onclick")||
|
||||
b.getAttribute("onclick"))&&a.match(y))for(g.target={type:"popup",name:a[1]};e=z.exec(a[2]);)("yes"==e[2]||"1"==e[2])&&!(e[1]in{height:1,width:1,top:1,left:1})?g.target[e[1]]=!0:isFinite(e[2])&&(g.target[e[1]]=e[2]);var a={},h;for(h in j)(e=b.getAttribute(h))&&(a[j[h]]=e);if(h=b.data("cke-saved-name")||a.advName)a.advName=h;CKEDITOR.tools.isEmpty(a)||(g.advanced=a)}return g},getLinkAttributes:function(c,b){var a=c.config.emailProtection||"",f={};switch(b.type){case "url":var a=b.url&&void 0!==b.url.protocol?
|
||||
b.url.protocol:"http://",e=b.url&&CKEDITOR.tools.trim(b.url.url)||"";f["data-cke-saved-href"]=0===e.indexOf("/")?e:a+e;break;case "anchor":a=b.anchor&&b.anchor.id;f["data-cke-saved-href"]="#"+(b.anchor&&b.anchor.name||a||"");break;case "email":var d=b.email,e=d.address;switch(a){case "":case "encode":var g=encodeURIComponent(d.subject||""),i=encodeURIComponent(d.body||""),d=[];g&&d.push("subject="+g);i&&d.push("body="+i);d=d.length?"?"+d.join("&"):"";"encode"==a?(a=["javascript:void(location.href='mailto:'+",
|
||||
n(e)],d&&a.push("+'",m(d),"'"),a.push(")")):a=["mailto:",e,d];break;default:a=e.split("@",2),d.name=a[0],d.domain=a[1],a=["javascript:",o(c,d)]}f["data-cke-saved-href"]=a.join("")}if(b.target)if("popup"==b.target.type){for(var a=["window.open(this.href, '",b.target.name||"","', '"],h="resizable status location toolbar menubar fullscreen scrollbars dependent".split(" "),e=h.length,g=function(a){b.target[a]&&h.push(a+"="+b.target[a])},d=0;d<e;d++)h[d]+=b.target[h[d]]?"=yes":"=no";g("width");g("left");
|
||||
g("height");g("top");a.push(h.join(","),"'); return false;");f["data-cke-pa-onclick"]=a.join("")}else"notSet"!=b.target.type&&b.target.name&&(f.target=b.target.name);if(b.advanced){for(var k in j)(a=b.advanced[j[k]])&&(f[k]=a);f.name&&(f["data-cke-saved-name"]=f.name)}f["data-cke-saved-href"]&&(f.href=f["data-cke-saved-href"]);k=CKEDITOR.tools.extend({target:1,onclick:1,"data-cke-pa-onclick":1,"data-cke-saved-name":1},j);for(var l in f)delete k[l];return{set:f,removed:CKEDITOR.tools.objectKeys(k)}}};
|
||||
CKEDITOR.unlinkCommand=function(){};CKEDITOR.unlinkCommand.prototype={exec:function(c){var b=new CKEDITOR.style({element:"a",type:CKEDITOR.STYLE_INLINE,alwaysRemoveElement:1});c.removeStyle(b)},refresh:function(c,b){var a=b.lastElement&&b.lastElement.getAscendant("a",!0);a&&"a"==a.getName()&&a.getAttribute("href")&&a.getChildCount()?this.setState(CKEDITOR.TRISTATE_OFF):this.setState(CKEDITOR.TRISTATE_DISABLED)},contextSensitive:1,startDisabled:1,requiredContent:"a[href]"};CKEDITOR.removeAnchorCommand=
|
||||
function(){};CKEDITOR.removeAnchorCommand.prototype={exec:function(c){var b=c.getSelection(),a=b.createBookmarks(),f;if(b&&(f=b.getSelectedElement())&&(!f.getChildCount()?CKEDITOR.plugins.link.tryRestoreFakeAnchor(c,f):f.is("a")))f.remove(1);else if(f=CKEDITOR.plugins.link.getSelectedLink(c))f.hasAttribute("href")?(f.removeAttributes({name:1,"data-cke-saved-name":1}),f.removeClass("cke_anchor")):f.remove(1);b.selectBookmarks(a)},requiredContent:"a[name]"};CKEDITOR.tools.extend(CKEDITOR.config,{linkShowAdvancedTab:!0,
|
||||
linkShowTargetTab:!0})})();(function(){function E(b,k,e){function d(d){if((a=c[d?"getFirst":"getLast"]())&&(!a.is||!a.isBlockBoundary())&&(m=k.root[d?"getPrevious":"getNext"](CKEDITOR.dom.walker.invisible(!0)))&&(!m.is||!m.isBlockBoundary({br:1})))b.document.createElement("br")[d?"insertBefore":"insertAfter"](a)}for(var f=CKEDITOR.plugins.list.listToArray(k.root,e),g=[],i=0;i<k.contents.length;i++){var h=k.contents[i];if((h=h.getAscendant("li",!0))&&!h.getCustomData("list_item_processed"))g.push(h),CKEDITOR.dom.element.setMarker(e,
|
||||
h,"list_item_processed",!0)}h=null;for(i=0;i<g.length;i++)h=g[i].getCustomData("listarray_index"),f[h].indent=-1;for(i=h+1;i<f.length;i++)if(f[i].indent>f[i-1].indent+1){g=f[i-1].indent+1-f[i].indent;for(h=f[i].indent;f[i]&&f[i].indent>=h;)f[i].indent+=g,i++;i--}var c=CKEDITOR.plugins.list.arrayToList(f,e,null,b.config.enterMode,k.root.getAttribute("dir")).listNode,a,m;d(!0);d();c.replace(k.root);b.fire("contentDomInvalidated")}function x(b,k){this.name=b;this.context=this.type=k;this.allowedContent=
|
||||
k+" li";this.requiredContent=k}function A(b,k,e,d){for(var f,g;f=b[d?"getLast":"getFirst"](F);)(g=f.getDirection(1))!==k.getDirection(1)&&f.setAttribute("dir",g),f.remove(),e?f[d?"insertBefore":"insertAfter"](e):k.append(f,d)}function B(b){function k(e){var d=b[e?"getPrevious":"getNext"](q);d&&(d.type==CKEDITOR.NODE_ELEMENT&&d.is(b.getName()))&&(A(b,d,null,!e),b.remove(),b=d)}k();k(1)}function C(b){return b.type==CKEDITOR.NODE_ELEMENT&&(b.getName()in CKEDITOR.dtd.$block||b.getName()in CKEDITOR.dtd.$listItem)&&
|
||||
CKEDITOR.dtd[b.getName()]["#"]}function y(b,k,e){b.fire("saveSnapshot");e.enlarge(CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS);var d=e.extractContents();k.trim(!1,!0);var f=k.createBookmark(),g=new CKEDITOR.dom.elementPath(k.startContainer),i=g.block,g=g.lastElement.getAscendant("li",1)||i,h=new CKEDITOR.dom.elementPath(e.startContainer),c=h.contains(CKEDITOR.dtd.$listItem),h=h.contains(CKEDITOR.dtd.$list);i?(i=i.getBogus())&&i.remove():h&&(i=h.getPrevious(q))&&v(i)&&i.remove();(i=d.getLast())&&(i.type==
|
||||
CKEDITOR.NODE_ELEMENT&&i.is("br"))&&i.remove();(i=k.startContainer.getChild(k.startOffset))?d.insertBefore(i):k.startContainer.append(d);if(c&&(d=w(c)))g.contains(c)?(A(d,c.getParent(),c),d.remove()):g.append(d);for(;e.checkStartOfBlock()&&e.checkEndOfBlock();){h=e.startPath();d=h.block;if(!d)break;d.is("li")&&(g=d.getParent(),d.equals(g.getLast(q))&&d.equals(g.getFirst(q))&&(d=g));e.moveToPosition(d,CKEDITOR.POSITION_BEFORE_START);d.remove()}e=e.clone();d=b.editable();e.setEndAt(d,CKEDITOR.POSITION_BEFORE_END);
|
||||
e=new CKEDITOR.dom.walker(e);e.evaluator=function(a){return q(a)&&!v(a)};(e=e.next())&&(e.type==CKEDITOR.NODE_ELEMENT&&e.getName()in CKEDITOR.dtd.$list)&&B(e);k.moveToBookmark(f);k.select();b.fire("saveSnapshot")}function w(b){return(b=b.getLast(q))&&b.type==CKEDITOR.NODE_ELEMENT&&b.getName()in r?b:null}var r={ol:1,ul:1},G=CKEDITOR.dom.walker.whitespaces(),D=CKEDITOR.dom.walker.bookmark(),q=function(b){return!(G(b)||D(b))},v=CKEDITOR.dom.walker.bogus();CKEDITOR.plugins.list={listToArray:function(b,
|
||||
k,e,d,f){if(!r[b.getName()])return[];d||(d=0);e||(e=[]);for(var g=0,i=b.getChildCount();g<i;g++){var h=b.getChild(g);h.type==CKEDITOR.NODE_ELEMENT&&h.getName()in CKEDITOR.dtd.$list&&CKEDITOR.plugins.list.listToArray(h,k,e,d+1);if("li"==h.$.nodeName.toLowerCase()){var c={parent:b,indent:d,element:h,contents:[]};f?c.grandparent=f:(c.grandparent=b.getParent(),c.grandparent&&"li"==c.grandparent.$.nodeName.toLowerCase()&&(c.grandparent=c.grandparent.getParent()));k&&CKEDITOR.dom.element.setMarker(k,h,
|
||||
"listarray_index",e.length);e.push(c);for(var a=0,m=h.getChildCount(),j;a<m;a++)j=h.getChild(a),j.type==CKEDITOR.NODE_ELEMENT&&r[j.getName()]?CKEDITOR.plugins.list.listToArray(j,k,e,d+1,c.grandparent):c.contents.push(j)}}return e},arrayToList:function(b,k,e,d,f){e||(e=0);if(!b||b.length<e+1)return null;for(var g,i=b[e].parent.getDocument(),h=new CKEDITOR.dom.documentFragment(i),c=null,a=e,m=Math.max(b[e].indent,0),j=null,n,l,p=d==CKEDITOR.ENTER_P?"p":"div";;){var o=b[a];g=o.grandparent;n=o.element.getDirection(1);
|
||||
if(o.indent==m){if(!c||b[a].parent.getName()!=c.getName())c=b[a].parent.clone(!1,1),f&&c.setAttribute("dir",f),h.append(c);j=c.append(o.element.clone(0,1));n!=c.getDirection(1)&&j.setAttribute("dir",n);for(g=0;g<o.contents.length;g++)j.append(o.contents[g].clone(1,1));a++}else if(o.indent==Math.max(m,0)+1)o=b[a-1].element.getDirection(1),a=CKEDITOR.plugins.list.arrayToList(b,null,a,d,o!=n?n:null),!j.getChildCount()&&(CKEDITOR.env.needsNbspFiller&&7>=i.$.documentMode)&&j.append(i.createText(" ")),
|
||||
j.append(a.listNode),a=a.nextIndex;else if(-1==o.indent&&!e&&g){r[g.getName()]?(j=o.element.clone(!1,!0),n!=g.getDirection(1)&&j.setAttribute("dir",n)):j=new CKEDITOR.dom.documentFragment(i);var c=g.getDirection(1)!=n,u=o.element,z=u.getAttribute("class"),v=u.getAttribute("style"),w=j.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT&&(d!=CKEDITOR.ENTER_BR||c||v||z),s,x=o.contents.length,t;for(g=0;g<x;g++)if(s=o.contents[g],D(s)&&1<x)w?t=s.clone(1,1):j.append(s.clone(1,1));else if(s.type==CKEDITOR.NODE_ELEMENT&&
|
||||
s.isBlockBoundary()){c&&!s.getDirection()&&s.setAttribute("dir",n);l=s;var y=u.getAttribute("style");y&&l.setAttribute("style",y.replace(/([^;])$/,"$1;")+(l.getAttribute("style")||""));z&&s.addClass(z);l=null;t&&(j.append(t),t=null);j.append(s.clone(1,1))}else w?(l||(l=i.createElement(p),j.append(l),c&&l.setAttribute("dir",n)),v&&l.setAttribute("style",v),z&&l.setAttribute("class",z),t&&(l.append(t),t=null),l.append(s.clone(1,1))):j.append(s.clone(1,1));t&&((l||j).append(t),t=null);j.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT&&
|
||||
a!=b.length-1&&(CKEDITOR.env.needsBrFiller&&(n=j.getLast())&&(n.type==CKEDITOR.NODE_ELEMENT&&n.is("br"))&&n.remove(),n=j.getLast(q),(!n||!(n.type==CKEDITOR.NODE_ELEMENT&&n.is(CKEDITOR.dtd.$block)))&&j.append(i.createElement("br")));n=j.$.nodeName.toLowerCase();("div"==n||"p"==n)&&j.appendBogus();h.append(j);c=null;a++}else return null;l=null;if(b.length<=a||Math.max(b[a].indent,0)<m)break}if(k)for(b=h.getFirst();b;){if(b.type==CKEDITOR.NODE_ELEMENT&&(CKEDITOR.dom.element.clearMarkers(k,b),b.getName()in
|
||||
CKEDITOR.dtd.$listItem&&(e=b,i=f=d=void 0,d=e.getDirection()))){for(f=e.getParent();f&&!(i=f.getDirection());)f=f.getParent();d==i&&e.removeAttribute("dir")}b=b.getNextSourceNode()}return{listNode:h,nextIndex:a}}};var H=/^h[1-6]$/,F=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT);x.prototype={exec:function(b){this.refresh(b,b.elementPath());var k=b.config,e=b.getSelection(),d=e&&e.getRanges();if(this.state==CKEDITOR.TRISTATE_OFF){var f=b.editable();if(f.getFirst(q)){var g=1==d.length&&d[0];(k=
|
||||
g&&g.getEnclosedNode())&&(k.is&&this.type==k.getName())&&this.setState(CKEDITOR.TRISTATE_ON)}else k.enterMode==CKEDITOR.ENTER_BR?f.appendBogus():d[0].fixBlock(1,k.enterMode==CKEDITOR.ENTER_P?"p":"div"),e.selectRanges(d)}for(var k=e.createBookmarks(!0),f=[],i={},d=d.createIterator(),h=0;(g=d.getNextRange())&&++h;){var c=g.getBoundaryNodes(),a=c.startNode,m=c.endNode;a.type==CKEDITOR.NODE_ELEMENT&&"td"==a.getName()&&g.setStartAt(c.startNode,CKEDITOR.POSITION_AFTER_START);m.type==CKEDITOR.NODE_ELEMENT&&
|
||||
"td"==m.getName()&&g.setEndAt(c.endNode,CKEDITOR.POSITION_BEFORE_END);g=g.createIterator();for(g.forceBrBreak=this.state==CKEDITOR.TRISTATE_OFF;c=g.getNextParagraph();)if(!c.getCustomData("list_block")){CKEDITOR.dom.element.setMarker(i,c,"list_block",1);for(var j=b.elementPath(c),a=j.elements,m=0,j=j.blockLimit,n,l=a.length-1;0<=l&&(n=a[l]);l--)if(r[n.getName()]&&j.contains(n)){j.removeCustomData("list_group_object_"+h);(a=n.getCustomData("list_group_object"))?a.contents.push(c):(a={root:n,contents:[c]},
|
||||
f.push(a),CKEDITOR.dom.element.setMarker(i,n,"list_group_object",a));m=1;break}m||(m=j,m.getCustomData("list_group_object_"+h)?m.getCustomData("list_group_object_"+h).contents.push(c):(a={root:m,contents:[c]},CKEDITOR.dom.element.setMarker(i,m,"list_group_object_"+h,a),f.push(a)))}}for(n=[];0<f.length;)if(a=f.shift(),this.state==CKEDITOR.TRISTATE_OFF)if(r[a.root.getName()]){d=b;h=a;a=i;g=n;m=CKEDITOR.plugins.list.listToArray(h.root,a);j=[];for(c=0;c<h.contents.length;c++)if(l=h.contents[c],(l=l.getAscendant("li",
|
||||
!0))&&!l.getCustomData("list_item_processed"))j.push(l),CKEDITOR.dom.element.setMarker(a,l,"list_item_processed",!0);for(var l=h.root.getDocument(),p=void 0,o=void 0,c=0;c<j.length;c++){var u=j[c].getCustomData("listarray_index"),p=m[u].parent;p.is(this.type)||(o=l.createElement(this.type),p.copyAttributes(o,{start:1,type:1}),o.removeStyle("list-style-type"),m[u].parent=o)}a=CKEDITOR.plugins.list.arrayToList(m,a,null,d.config.enterMode);m=void 0;j=a.listNode.getChildCount();for(c=0;c<j&&(m=a.listNode.getChild(c));c++)m.getName()==
|
||||
this.type&&g.push(m);a.listNode.replace(h.root);d.fire("contentDomInvalidated")}else{m=b;c=a;g=n;j=c.contents;d=c.root.getDocument();h=[];1==j.length&&j[0].equals(c.root)&&(a=d.createElement("div"),j[0].moveChildren&&j[0].moveChildren(a),j[0].append(a),j[0]=a);c=c.contents[0].getParent();for(l=0;l<j.length;l++)c=c.getCommonAncestor(j[l].getParent());p=m.config.useComputedState;m=a=void 0;p=void 0===p||p;for(l=0;l<j.length;l++)for(o=j[l];u=o.getParent();){if(u.equals(c)){h.push(o);!m&&o.getDirection()&&
|
||||
(m=1);o=o.getDirection(p);null!==a&&(a=a&&a!=o?null:o);break}o=u}if(!(1>h.length)){j=h[h.length-1].getNext();l=d.createElement(this.type);g.push(l);for(p=g=void 0;h.length;)g=h.shift(),p=d.createElement("li"),g.is("pre")||H.test(g.getName())||"false"==g.getAttribute("contenteditable")?g.appendTo(p):(g.copyAttributes(p),a&&g.getDirection()&&(p.removeStyle("direction"),p.removeAttribute("dir")),g.moveChildren(p),g.remove()),p.appendTo(l);a&&m&&l.setAttribute("dir",a);j?l.insertBefore(j):l.appendTo(c)}}else this.state==
|
||||
CKEDITOR.TRISTATE_ON&&r[a.root.getName()]&&E.call(this,b,a,i);for(l=0;l<n.length;l++)B(n[l]);CKEDITOR.dom.element.clearAllMarkers(i);e.selectBookmarks(k);b.focus()},refresh:function(b,k){var e=k.contains(r,1),d=k.blockLimit||k.root;e&&d.contains(e)?this.setState(e.is(this.type)?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF):this.setState(CKEDITOR.TRISTATE_OFF)}};CKEDITOR.plugins.add("list",{requires:"indentlist",init:function(b){b.blockless||(b.addCommand("numberedlist",new x("numberedlist","ol")),b.addCommand("bulletedlist",
|
||||
new x("bulletedlist","ul")),b.ui.addButton&&(b.ui.addButton("NumberedList",{label:b.lang.list.numberedlist,command:"numberedlist",directional:!0,toolbar:"list,10"}),b.ui.addButton("BulletedList",{label:b.lang.list.bulletedlist,command:"bulletedlist",directional:!0,toolbar:"list,20"})),b.on("key",function(k){var e=k.data.domEvent.getKey(),d;if(b.mode=="wysiwyg"&&e in{8:1,46:1}){var f=b.getSelection().getRanges()[0],g=f&&f.startPath();if(f&&f.collapsed){var i=e==8,h=b.editable(),c=new CKEDITOR.dom.walker(f.clone());
|
||||
c.evaluator=function(a){return q(a)&&!v(a)};c.guard=function(a,b){return!(b&&a.type==CKEDITOR.NODE_ELEMENT&&a.is("table"))};e=f.clone();if(i){var a;if((a=g.contains(r))&&f.checkBoundaryOfElement(a,CKEDITOR.START)&&(a=a.getParent())&&a.is("li")&&(a=w(a))){d=a;a=a.getPrevious(q);e.moveToPosition(a&&v(a)?a:d,CKEDITOR.POSITION_BEFORE_START)}else{c.range.setStartAt(h,CKEDITOR.POSITION_AFTER_START);c.range.setEnd(f.startContainer,f.startOffset);if((a=c.previous())&&a.type==CKEDITOR.NODE_ELEMENT&&(a.getName()in
|
||||
r||a.is("li"))){if(!a.is("li")){c.range.selectNodeContents(a);c.reset();c.evaluator=C;a=c.previous()}d=a;e.moveToElementEditEnd(d)}}if(d){y(b,e,f);k.cancel()}else if((e=g.contains(r))&&f.checkBoundaryOfElement(e,CKEDITOR.START)){d=e.getFirst(q);if(f.checkBoundaryOfElement(d,CKEDITOR.START)){a=e.getPrevious(q);if(w(d)){if(a){f.moveToElementEditEnd(a);f.select()}}else b.execCommand("outdent");k.cancel()}}}else if(d=g.contains("li")){c.range.setEndAt(h,CKEDITOR.POSITION_BEFORE_END);d=(g=d.getLast(q))&&
|
||||
C(g)?g:d;h=0;if((a=c.next())&&a.type==CKEDITOR.NODE_ELEMENT&&a.getName()in r&&a.equals(g)){h=1;a=c.next()}else f.checkBoundaryOfElement(d,CKEDITOR.END)&&(h=1);if(h&&a){f=f.clone();f.moveToElementEditStart(a);y(b,e,f);k.cancel()}}else{c.range.setEndAt(h,CKEDITOR.POSITION_BEFORE_END);if((a=c.next())&&a.type==CKEDITOR.NODE_ELEMENT&&a.is(r)){a=a.getFirst(q);if(g.block&&f.checkStartOfBlock()&&f.checkEndOfBlock()){g.block.remove();f.moveToElementEditStart(a);f.select()}else if(w(a)){f.moveToElementEditStart(a);
|
||||
f.select()}else{f=f.clone();f.moveToElementEditStart(a);y(b,e,f)}k.cancel()}}setTimeout(function(){b.selectionChange(1)})}}}))}})})();(function(){var g=[CKEDITOR.CTRL+90,CKEDITOR.CTRL+89,CKEDITOR.CTRL+CKEDITOR.SHIFT+90],l={8:1,46:1};CKEDITOR.plugins.add("undo",{init:function(a){function b(a){d.enabled&&!1!==a.data.command.canUndo&&d.save()}function c(){d.enabled=a.readOnly?!1:"wysiwyg"==a.mode;d.onChange()}var d=a.undoManager=new e(a),j=d.editingHandler=new i(d),f=a.addCommand("undo",{exec:function(){d.undo()&&(a.selectionChange(),this.fire("afterUndo"))},startDisabled:!0,canUndo:!1}),h=a.addCommand("redo",{exec:function(){d.redo()&&
|
||||
(a.selectionChange(),this.fire("afterRedo"))},startDisabled:!0,canUndo:!1});a.setKeystroke([[g[0],"undo"],[g[1],"redo"],[g[2],"redo"]]);d.onChange=function(){f.setState(d.undoable()?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED);h.setState(d.redoable()?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED)};a.on("beforeCommandExec",b);a.on("afterCommandExec",b);a.on("saveSnapshot",function(a){d.save(a.data&&a.data.contentOnly)});a.on("contentDom",j.attachListeners,j);a.on("instanceReady",function(){a.fire("saveSnapshot")});
|
||||
a.on("beforeModeUnload",function(){"wysiwyg"==a.mode&&d.save(!0)});a.on("mode",c);a.on("readOnly",c);a.ui.addButton&&(a.ui.addButton("Undo",{label:a.lang.undo.undo,command:"undo",toolbar:"undo,10"}),a.ui.addButton("Redo",{label:a.lang.undo.redo,command:"redo",toolbar:"undo,20"}));a.resetUndo=function(){d.reset();a.fire("saveSnapshot")};a.on("updateSnapshot",function(){d.currentImage&&d.update()});a.on("lockSnapshot",function(a){a=a.data;d.lock(a&&a.dontUpdate,a&&a.forceUpdate)});a.on("unlockSnapshot",
|
||||
d.unlock,d)}});CKEDITOR.plugins.undo={};var e=CKEDITOR.plugins.undo.UndoManager=function(a){this.strokesRecorded=[0,0];this.locked=null;this.previousKeyGroup=-1;this.limit=a.config.undoStackSize||20;this.strokesLimit=25;this.editor=a;this.reset()};e.prototype={type:function(a,b){var c=e.getKeyGroup(a),d=this.strokesRecorded[c]+1,b=b||d>=this.strokesLimit;this.typing||(this.hasUndo=this.typing=!0,this.hasRedo=!1,this.onChange());b?(d=0,this.editor.fire("saveSnapshot")):this.editor.fire("change");this.strokesRecorded[c]=
|
||||
d;this.previousKeyGroup=c},keyGroupChanged:function(a){return e.getKeyGroup(a)!=this.previousKeyGroup},reset:function(){this.snapshots=[];this.index=-1;this.currentImage=null;this.hasRedo=this.hasUndo=!1;this.locked=null;this.resetType()},resetType:function(){this.strokesRecorded=[0,0];this.typing=!1;this.previousKeyGroup=-1},refreshState:function(){this.hasUndo=!!this.getNextImage(!0);this.hasRedo=!!this.getNextImage(!1);this.resetType();this.onChange()},save:function(a,b,c){var d=this.editor;if(this.locked||
|
||||
"ready"!=d.status||"wysiwyg"!=d.mode)return!1;var e=d.editable();if(!e||"ready"!=e.status)return!1;e=this.snapshots;b||(b=new f(d));if(!1===b.contents)return!1;if(this.currentImage)if(b.equalsContent(this.currentImage)){if(a||b.equalsSelection(this.currentImage))return!1}else!1!==c&&d.fire("change");e.splice(this.index+1,e.length-this.index-1);e.length==this.limit&&e.shift();this.index=e.push(b)-1;this.currentImage=b;!1!==c&&this.refreshState();return!0},restoreImage:function(a){var b=this.editor,
|
||||
c;a.bookmarks&&(b.focus(),c=b.getSelection());this.locked={level:999};this.editor.loadSnapshot(a.contents);a.bookmarks?c.selectBookmarks(a.bookmarks):CKEDITOR.env.ie&&(c=this.editor.document.getBody().$.createTextRange(),c.collapse(!0),c.select());this.locked=null;this.index=a.index;this.currentImage=this.snapshots[this.index];this.update();this.refreshState();b.fire("change")},getNextImage:function(a){var b=this.snapshots,c=this.currentImage,d;if(c)if(a)for(d=this.index-1;0<=d;d--){if(a=b[d],!c.equalsContent(a))return a.index=
|
||||
d,a}else for(d=this.index+1;d<b.length;d++)if(a=b[d],!c.equalsContent(a))return a.index=d,a;return null},redoable:function(){return this.enabled&&this.hasRedo},undoable:function(){return this.enabled&&this.hasUndo},undo:function(){if(this.undoable()){this.save(!0);var a=this.getNextImage(!0);if(a)return this.restoreImage(a),!0}return!1},redo:function(){if(this.redoable()&&(this.save(!0),this.redoable())){var a=this.getNextImage(!1);if(a)return this.restoreImage(a),!0}return!1},update:function(a){if(!this.locked){a||
|
||||
(a=new f(this.editor));for(var b=this.index,c=this.snapshots;0<b&&this.currentImage.equalsContent(c[b-1]);)b-=1;c.splice(b,this.index-b+1,a);this.index=b;this.currentImage=a}},updateSelection:function(a){if(!this.snapshots.length)return!1;var b=this.snapshots,c=b[b.length-1];return c.equalsContent(a)&&!c.equalsSelection(a)?(this.currentImage=b[b.length-1]=a,!0):!1},lock:function(a,b){if(this.locked)this.locked.level++;else if(a)this.locked={level:1};else{var c=null;if(b)c=!0;else{var d=new f(this.editor,
|
||||
!0);this.currentImage&&this.currentImage.equalsContent(d)&&(c=d)}this.locked={update:c,level:1}}},unlock:function(){if(this.locked&&!--this.locked.level){var a=this.locked.update;this.locked=null;if(!0===a)this.update();else if(a){var b=new f(this.editor,!0);a.equalsContent(b)||this.update()}}}};e.navigationKeyCodes={37:1,38:1,39:1,40:1,36:1,35:1,33:1,34:1};e.keyGroups={PRINTABLE:0,FUNCTIONAL:1};e.isNavigationKey=function(a){return!!e.navigationKeyCodes[a]};e.getKeyGroup=function(a){var b=e.keyGroups;
|
||||
return l[a]?b.FUNCTIONAL:b.PRINTABLE};e.getOppositeKeyGroup=function(a){var b=e.keyGroups;return a==b.FUNCTIONAL?b.PRINTABLE:b.FUNCTIONAL};e.ieFunctionalKeysBug=function(a){return CKEDITOR.env.ie&&e.getKeyGroup(a)==e.keyGroups.FUNCTIONAL};var f=CKEDITOR.plugins.undo.Image=function(a,b){this.editor=a;a.fire("beforeUndoImage");var c=a.getSnapshot();CKEDITOR.env.ie&&c&&(c=c.replace(/\s+data-cke-expando=".*?"/g,""));this.contents=c;b||(this.bookmarks=(c=c&&a.getSelection())&&c.createBookmarks2(!0));a.fire("afterUndoImage")},
|
||||
h=/\b(?:href|src|name)="[^"]*?"/gi;f.prototype={equalsContent:function(a){var b=this.contents,a=a.contents;if(CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks))b=b.replace(h,""),a=a.replace(h,"");return b!=a?!1:!0},equalsSelection:function(a){var b=this.bookmarks,a=a.bookmarks;if(b||a){if(!b||!a||b.length!=a.length)return!1;for(var c=0;c<b.length;c++){var d=b[c],e=a[c];if(d.startOffset!=e.startOffset||d.endOffset!=e.endOffset||!CKEDITOR.tools.arrayCompare(d.start,e.start)||!CKEDITOR.tools.arrayCompare(d.end,
|
||||
e.end))return!1}}return!0}};var i=CKEDITOR.plugins.undo.NativeEditingHandler=function(a){this.undoManager=a;this.ignoreInputEvent=!1;this.keyEventsStack=new k;this.lastKeydownImage=null};i.prototype={onKeydown:function(a){var b=a.data.getKey();if(229!==b)if(-1<CKEDITOR.tools.indexOf(g,a.data.getKeystroke()))a.data.preventDefault();else if(this.keyEventsStack.cleanUp(a),a=this.undoManager,this.keyEventsStack.getLast(b)||this.keyEventsStack.push(b),this.lastKeydownImage=new f(a.editor),e.isNavigationKey(b)||
|
||||
this.undoManager.keyGroupChanged(b))if(a.strokesRecorded[0]||a.strokesRecorded[1])a.save(!1,this.lastKeydownImage,!1),a.resetType()},onInput:function(){if(this.ignoreInputEvent)this.ignoreInputEvent=!1;else{var a=this.keyEventsStack.getLast();a||(a=this.keyEventsStack.push(0));this.keyEventsStack.increment(a.keyCode);this.keyEventsStack.getTotalInputs()>=this.undoManager.strokesLimit&&(this.undoManager.type(a.keyCode,!0),this.keyEventsStack.resetInputs())}},onKeyup:function(a){var b=this.undoManager,
|
||||
a=a.data.getKey(),c=this.keyEventsStack.getTotalInputs();this.keyEventsStack.remove(a);if(!e.ieFunctionalKeysBug(a)||!this.lastKeydownImage||!this.lastKeydownImage.equalsContent(new f(b.editor,!0)))if(0<c)b.type(a);else if(e.isNavigationKey(a))this.onNavigationKey(!0)},onNavigationKey:function(a){var b=this.undoManager;(a||!b.save(!0,null,!1))&&b.updateSelection(new f(b.editor));b.resetType()},ignoreInputEventListener:function(){this.ignoreInputEvent=!0},attachListeners:function(){var a=this.undoManager.editor,
|
||||
b=a.editable(),c=this;b.attachListener(b,"keydown",function(a){c.onKeydown(a);if(e.ieFunctionalKeysBug(a.data.getKey()))c.onInput()},null,null,999);b.attachListener(b,CKEDITOR.env.ie?"keypress":"input",c.onInput,c,null,999);b.attachListener(b,"keyup",c.onKeyup,c,null,999);b.attachListener(b,"paste",c.ignoreInputEventListener,c,null,999);b.attachListener(b,"drop",c.ignoreInputEventListener,c,null,999);b.attachListener(b.isInline()?b:a.document.getDocumentElement(),"click",function(){c.onNavigationKey()},
|
||||
null,null,999);b.attachListener(this.undoManager.editor,"blur",function(){c.keyEventsStack.remove(9)},null,null,999)}};var k=CKEDITOR.plugins.undo.KeyEventsStack=function(){this.stack=[]};k.prototype={push:function(a){return this.stack[this.stack.push({keyCode:a,inputs:0})-1]},getLastIndex:function(a){if("number"!=typeof a)return this.stack.length-1;for(var b=this.stack.length;b--;)if(this.stack[b].keyCode==a)return b;return-1},getLast:function(a){a=this.getLastIndex(a);return-1!=a?this.stack[a]:
|
||||
null},increment:function(a){this.getLast(a).inputs++},remove:function(a){a=this.getLastIndex(a);-1!=a&&this.stack.splice(a,1)},resetInputs:function(a){if("number"==typeof a)this.getLast(a).inputs=0;else for(a=this.stack.length;a--;)this.stack[a].inputs=0},getTotalInputs:function(){for(var a=this.stack.length,b=0;a--;)b+=this.stack[a].inputs;return b},cleanUp:function(a){a=a.data.$;!a.ctrlKey&&!a.metaKey&&this.remove(17);a.shiftKey||this.remove(16);a.altKey||this.remove(18)}}})();CKEDITOR.config.plugins='dialogui,dialog,about,basicstyles,clipboard,button,toolbar,enterkey,entities,floatingspace,wysiwygarea,indent,indentlist,fakeobjects,link,list,undo';CKEDITOR.config.skin='moono';(function() {var setIcons = function(icons, strip) {var path = CKEDITOR.getUrl( 'plugins/' + strip );icons = icons.split( ',' );for ( var i = 0; i < icons.length; i++ )CKEDITOR.skin.icons[ icons[ i ] ] = { path: path, offset: -icons[ ++i ], bgsize : icons[ ++i ] };};if (CKEDITOR.env.hidpi) setIcons('about,0,,bold,24,,italic,48,,strike,72,,subscript,96,,superscript,120,,underline,144,,copy-rtl,168,,copy,192,,cut-rtl,216,,cut,240,,paste-rtl,264,,paste,288,,indent-rtl,312,,indent,336,,outdent-rtl,360,,outdent,384,,anchor-rtl,408,,anchor,432,,link,456,,unlink,480,,bulletedlist-rtl,504,,bulletedlist,528,,numberedlist-rtl,552,,numberedlist,576,,redo-rtl,600,,redo,624,,undo-rtl,648,,undo,672,','icons_hidpi.png');else setIcons('about,0,auto,bold,24,auto,italic,48,auto,strike,72,auto,subscript,96,auto,superscript,120,auto,underline,144,auto,copy-rtl,168,auto,copy,192,auto,cut-rtl,216,auto,cut,240,auto,paste-rtl,264,auto,paste,288,auto,indent-rtl,312,auto,indent,336,auto,outdent-rtl,360,auto,outdent,384,auto,anchor-rtl,408,auto,anchor,432,auto,link,456,auto,unlink,480,auto,bulletedlist-rtl,504,auto,bulletedlist,528,auto,numberedlist-rtl,552,auto,numberedlist,576,auto,redo-rtl,600,auto,redo,624,auto,undo-rtl,648,auto,undo,672,auto','icons.png');})();CKEDITOR.lang.languages={"af":1,"sq":1,"ar":1,"eu":1,"bn":1,"bs":1,"bg":1,"ca":1,"zh-cn":1,"zh":1,"hr":1,"cs":1,"da":1,"nl":1,"en":1,"en-au":1,"en-ca":1,"en-gb":1,"eo":1,"et":1,"fo":1,"fi":1,"fr":1,"fr-ca":1,"gl":1,"ka":1,"de":1,"el":1,"gu":1,"he":1,"hi":1,"hu":1,"is":1,"id":1,"it":1,"ja":1,"km":1,"ko":1,"ku":1,"lv":1,"lt":1,"mk":1,"ms":1,"mn":1,"no":1,"nb":1,"fa":1,"pl":1,"pt-br":1,"pt":1,"ro":1,"ru":1,"sr":1,"sr-latn":1,"si":1,"sk":1,"sl":1,"es":1,"sv":1,"tt":1,"th":1,"tr":1,"ug":1,"uk":1,"vi":1,"cy":1};}());
|
||||
44
include/jQuery/ckeditor/config.js
Executable file
44
include/jQuery/ckeditor/config.js
Executable file
@@ -0,0 +1,44 @@
|
||||
/**
|
||||
* @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
|
||||
* For licensing, see LICENSE.md or http://ckeditor.com/license
|
||||
*/
|
||||
|
||||
CKEDITOR.editorConfig = function( config ) {
|
||||
// Define changes to default configuration here.
|
||||
// For complete reference see:
|
||||
// http://docs.ckeditor.com/#!/api/CKEDITOR.config
|
||||
//config.skin = 'office2013';
|
||||
//config.skin = 'Moono_blue';
|
||||
// The toolbar groups arrangement, optimized for a single toolbar row.
|
||||
config.toolbarGroups = [
|
||||
{ name: 'document', groups: [ 'mode', 'document', 'doctools' ] },
|
||||
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
|
||||
{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ] },
|
||||
{ name: 'forms' },
|
||||
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
|
||||
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ] },
|
||||
{ name: 'links' },
|
||||
{ name: 'insert' },
|
||||
{ name: 'styles' },
|
||||
{ name: 'colors' },
|
||||
{ name: 'tools' },
|
||||
{ name: 'others' },
|
||||
{ name: 'about' }
|
||||
];
|
||||
config.extraPlugins = 'autogrow';
|
||||
config.autoGrow_minHeight = 250;
|
||||
config.autoGrow_maxHeight = 800;
|
||||
config.resize_dir = 'both';
|
||||
config.resize_enabled = true;
|
||||
config.resize_minWidth = 100;
|
||||
config.resize_maxWidth = 6000;
|
||||
config.resize_minHeight = 100;
|
||||
config.resize_maxHeight = 6000;
|
||||
// The default plugins included in the basic setup define some buttons that
|
||||
// are not needed in a basic editor. They are removed here.
|
||||
// config.removeButtons = 'Subscript,Superscript';
|
||||
|
||||
// Dialog windows are also simplified.
|
||||
config.removeDialogTabs = 'link:advanced';
|
||||
config.extraPlugins = 'sourcearea,colorbutton,autogrow,panelbutton,removeformat,colordialog,table,tableresize,tabletools,contextmenu,menu,blockquote,pastetext,justify,clipboard,resize,elementspath,font,richcombo,listblock,floatpanel,panel,button,format,horizontalrule,image,imagepaste,imageresize,symbol';
|
||||
}; // <- trza dodać
|
||||
5
include/jQuery/ckeditor/lang/af.js
Executable file
5
include/jQuery/ckeditor/lang/af.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/ar.js
Executable file
5
include/jQuery/ckeditor/lang/ar.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/bg.js
Executable file
5
include/jQuery/ckeditor/lang/bg.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/bn.js
Executable file
5
include/jQuery/ckeditor/lang/bn.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/bs.js
Executable file
5
include/jQuery/ckeditor/lang/bs.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/ca.js
Executable file
5
include/jQuery/ckeditor/lang/ca.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/cs.js
Executable file
5
include/jQuery/ckeditor/lang/cs.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/cy.js
Executable file
5
include/jQuery/ckeditor/lang/cy.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/da.js
Executable file
5
include/jQuery/ckeditor/lang/da.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/de.js
Executable file
5
include/jQuery/ckeditor/lang/de.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/el.js
Executable file
5
include/jQuery/ckeditor/lang/el.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/en-au.js
Executable file
5
include/jQuery/ckeditor/lang/en-au.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/en-ca.js
Executable file
5
include/jQuery/ckeditor/lang/en-ca.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/en-gb.js
Executable file
5
include/jQuery/ckeditor/lang/en-gb.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/en.js
Executable file
5
include/jQuery/ckeditor/lang/en.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/eo.js
Executable file
5
include/jQuery/ckeditor/lang/eo.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/es.js
Executable file
5
include/jQuery/ckeditor/lang/es.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/et.js
Executable file
5
include/jQuery/ckeditor/lang/et.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/eu.js
Executable file
5
include/jQuery/ckeditor/lang/eu.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/fa.js
Executable file
5
include/jQuery/ckeditor/lang/fa.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/fi.js
Executable file
5
include/jQuery/ckeditor/lang/fi.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/fo.js
Executable file
5
include/jQuery/ckeditor/lang/fo.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/fr-ca.js
Executable file
5
include/jQuery/ckeditor/lang/fr-ca.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/fr.js
Executable file
5
include/jQuery/ckeditor/lang/fr.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/gl.js
Executable file
5
include/jQuery/ckeditor/lang/gl.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/gu.js
Executable file
5
include/jQuery/ckeditor/lang/gu.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/he.js
Executable file
5
include/jQuery/ckeditor/lang/he.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/hi.js
Executable file
5
include/jQuery/ckeditor/lang/hi.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/hr.js
Executable file
5
include/jQuery/ckeditor/lang/hr.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/hu.js
Executable file
5
include/jQuery/ckeditor/lang/hu.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/id.js
Executable file
5
include/jQuery/ckeditor/lang/id.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/is.js
Executable file
5
include/jQuery/ckeditor/lang/is.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/it.js
Executable file
5
include/jQuery/ckeditor/lang/it.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/ja.js
Executable file
5
include/jQuery/ckeditor/lang/ja.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/ka.js
Executable file
5
include/jQuery/ckeditor/lang/ka.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/km.js
Executable file
5
include/jQuery/ckeditor/lang/km.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/ko.js
Executable file
5
include/jQuery/ckeditor/lang/ko.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/ku.js
Executable file
5
include/jQuery/ckeditor/lang/ku.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/lt.js
Executable file
5
include/jQuery/ckeditor/lang/lt.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/lv.js
Executable file
5
include/jQuery/ckeditor/lang/lv.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/mk.js
Executable file
5
include/jQuery/ckeditor/lang/mk.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/mn.js
Executable file
5
include/jQuery/ckeditor/lang/mn.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/ms.js
Executable file
5
include/jQuery/ckeditor/lang/ms.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/nb.js
Executable file
5
include/jQuery/ckeditor/lang/nb.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/nl.js
Executable file
5
include/jQuery/ckeditor/lang/nl.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/no.js
Executable file
5
include/jQuery/ckeditor/lang/no.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/pl.js
Executable file
5
include/jQuery/ckeditor/lang/pl.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/pt-br.js
Executable file
5
include/jQuery/ckeditor/lang/pt-br.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/pt.js
Executable file
5
include/jQuery/ckeditor/lang/pt.js
Executable file
File diff suppressed because one or more lines are too long
5
include/jQuery/ckeditor/lang/ro.js
Executable file
5
include/jQuery/ckeditor/lang/ro.js
Executable file
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user