diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 000000000..13566b81b --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 000000000..4c9e052b8 --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,56 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 000000000..79ee123c2 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 000000000..456b18c39 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/php.xml b/.idea/php.xml new file mode 100644 index 000000000..85d0a1121 --- /dev/null +++ b/.idea/php.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/sms.iml b/.idea/sms.iml new file mode 100644 index 000000000..2c97708e6 --- /dev/null +++ b/.idea/sms.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 000000000..94a25f7f4 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/ProgramFunctions/StudentsUsersInfo.fnc.php b/ProgramFunctions/StudentsUsersInfo.fnc.php index a055dba91..489201d93 100644 --- a/ProgramFunctions/StudentsUsersInfo.fnc.php +++ b/ProgramFunctions/StudentsUsersInfo.fnc.php @@ -841,7 +841,7 @@ function _makeStartInput( $value, $column ) $disallow_edit_parent_student = true; } - $return = '
' . $add . + $return = '
' . //$add . DateInput( $value, 'values[student_enrollment][' . $id . '][' . $column . ']', diff --git a/assets/js/plugins.js b/assets/js/plugins.js new file mode 100644 index 000000000..fc8f61905 --- /dev/null +++ b/assets/js/plugins.js @@ -0,0 +1,4861 @@ +/*! rosariosis 2022-07-19 */ + +!(function (n) { + "function" == typeof define && define.amd + ? define(["jquery"], n) + : "object" == typeof module && module.exports + ? (module.exports = function (e, t) { + return void 0 === t && (t = "undefined" != typeof window ? require("jquery") : require("jquery")(e)), n(t), t; + }) + : n(jQuery); +})(function (M) { + "use strict"; + var h = /\r?\n/g, + g = {}; + (g.fileapi = void 0 !== M('').get(0).files), (g.formdata = void 0 !== window.FormData); + var N = !!M.fn.prop; + function i(e) { + var t = e.data; + e.isDefaultPrevented() || (e.preventDefault(), M(e.target).closest("form").ajaxSubmit(t)); + } + function o(e) { + var t = e.target, + n = M(t); + if (!n.is("[type=submit],[type=image]")) { + var a = n.closest("[type=submit]"); + if (0 === a.length) return; + t = a[0]; + } + var r = t.form; + "image" === (r.clk = t).type && + (void 0 !== e.offsetX + ? ((r.clk_x = e.offsetX), (r.clk_y = e.offsetY)) + : "function" == typeof M.fn.offset + ? ((n = n.offset()), (r.clk_x = e.pageX - n.left), (r.clk_y = e.pageY - n.top)) + : ((r.clk_x = e.pageX - t.offsetLeft), (r.clk_y = e.pageY - t.offsetTop))), + setTimeout(function () { + r.clk = r.clk_x = r.clk_y = null; + }, 100); + } + function O() { + var e; + M.fn.ajaxSubmit.debug && ((e = "[jquery.form] " + Array.prototype.join.call(arguments, "")), window.console && window.console.log ? window.console.log(e) : window.opera && window.opera.postError && window.opera.postError(e)); + } + (M.fn.attr2 = function () { + if (!N) return this.attr.apply(this, arguments); + var e = this.prop.apply(this, arguments); + return (e && e.jquery) || "string" == typeof e ? e : this.attr.apply(this, arguments); + }), + (M.fn.ajaxSubmit = function (_, e, t, n) { + if (!this.length) return O("ajaxSubmit: skipping submit process - no element selected"), this; + var T, + S = this; + "function" == typeof _ ? (_ = { success: _ }) : "string" == typeof _ || (!1 === _ && 0 < arguments.length) ? ((_ = { url: _, data: e, dataType: t }), "function" == typeof n && (_.success = n)) : void 0 === _ && (_ = {}), + (T = _.method || _.type || this.attr2("method")), + (n = (n = (n = "string" == typeof (t = _.url || this.attr2("action")) ? M.trim(t) : "") || window.location.href || "") && (n.match(/^([^#]+)/) || [])[1]), + (_ = M.extend(!0, { url: n, success: M.ajaxSettings.success, type: T || M.ajaxSettings.type, iframeSrc: /^https/i.test(window.location.href || "") ? "javascript:false" : "about:blank" }, _)); + t = {}; + if ((this.trigger("form-pre-serialize", [this, _, t]), t.veto)) return O("ajaxSubmit: submit vetoed via form-pre-serialize trigger"), this; + if (_.beforeSerialize && !1 === _.beforeSerialize(this, _)) return O("ajaxSubmit: submit aborted via beforeSerialize callback"), this; + n = _.traditional; + void 0 === n && (n = M.ajaxSettings.traditional); + var B = [], + a = this.formToArray(_.semantic, B, _.filtering); + if ((_.data && ((u = M.isFunction(_.data) ? _.data(a) : _.data), (_.extraData = u), (u = M.param(u, n))), _.beforeSubmit && !1 === _.beforeSubmit(a, this, _))) + return O("ajaxSubmit: submit aborted via beforeSubmit callback"), this; + if ((this.trigger("form-submit-validate", [a, this, _, t]), t.veto)) return O("ajaxSubmit: submit vetoed via form-submit-validate trigger"), this; + t = M.param(a, n); + u && (t = t ? t + "&" + u : u), "GET" === _.type.toUpperCase() ? ((_.url += (0 <= _.url.indexOf("?") ? "&" : "?") + t), (_.data = null)) : (_.data = t); + var i, + r, + o, + s = []; + _.resetForm && + s.push(function () { + S.resetForm(); + }), + _.clearForm && + s.push(function () { + S.clearForm(_.includeHidden); + }), + !_.dataType && _.target + ? ((i = _.success || function () {}), + s.push(function (e, t, n) { + var a = arguments, + r = _.replaceTarget ? "replaceWith" : "html"; + M(_.target) + [r](e) + .each(function () { + i.apply(this, a); + }); + })) + : _.success && (M.isArray(_.success) ? M.merge(s, _.success) : s.push(_.success)), + (_.success = function (e, t, n) { + for (var a = _.context || this, r = 0, i = s.length; r < i; r++) s[r].apply(a, [e, t, n || S, S]); + }), + _.error && + ((r = _.error), + (_.error = function (e, t, n) { + var a = _.context || this; + r.apply(a, [e, t, n, S]); + })), + _.complete && + ((o = _.complete), + (_.complete = function (e, t) { + var n = _.context || this; + o.apply(n, [e, t, S]); + })); + var l, + n = + 0 < + M("input[type=file]:enabled", this).filter(function () { + return "" !== M(this).val(); + }).length, + u = "multipart/form-data", + t = S.attr("enctype") === u || S.attr("encoding") === u, + u = g.fileapi && g.formdata; + O("fileAPI :" + u), + !1 !== _.iframe && (_.iframe || ((n || t) && !u)) + ? _.closeKeepAlive + ? M.get(_.closeKeepAlive, function () { + l = d(a); + }) + : (l = d(a)) + : (l = + (n || t) && u + ? (function (e) { + for (var n = new FormData(), t = 0; t < e.length; t++) n.append(e[t].name, e[t].value); + if (_.extraData) { + var a = (function (e) { + var t, + n, + a = M.param(e, _.traditional).split("&"), + r = a.length, + i = []; + for (t = 0; t < r; t++) (a[t] = a[t].replace(/\+/g, " ")), (n = a[t].split("=")), i.push([decodeURIComponent(n[0]), decodeURIComponent(n[1])]); + return i; + })(_.extraData); + for (t = 0; t < a.length; t++) a[t] && n.append(a[t][0], a[t][1]); + } + _.data = null; + var r = M.extend(!0, {}, M.ajaxSettings, _, { contentType: !1, processData: !1, cache: !1, type: T || "POST" }); + _.uploadProgress && + (r.xhr = function () { + var e = M.ajaxSettings.xhr(); + return ( + e.upload && + e.upload.addEventListener( + "progress", + function (e) { + var t = 0, + n = e.loaded || e.position, + a = e.total; + e.lengthComputable && (t = Math.ceil((n / a) * 100)), _.uploadProgress(e, n, a, t); + }, + !1 + ), + e + ); + }); + r.data = null; + var i = r.beforeSend; + return ( + (r.beforeSend = function (e, t) { + _.formData ? (t.data = _.formData) : (t.data = n), i && i.call(this, e, t); + }), + M.ajax(r) + ); + })(a) + : M.ajax(_)), + S.removeData("jqxhr").data("jqxhr", l); + for (var c = 0; c < B.length; c++) B[c] = null; + return this.trigger("form-submit-notify", [this, _]), this; + function d(e) { + var t, + n, + u, + c, + d, + h, + p, + f, + m, + i = S[0], + g = M.Deferred(); + if ( + ((g.abort = function (e) { + p.abort(e); + }), + e) + ) + for (n = 0; n < B.length; n++) (t = M(B[n])), N ? t.prop("disabled", !1) : t.removeAttr("disabled"); + (u = M.extend(!0, {}, M.ajaxSettings, _)).context = u.context || u; + var o = "jqFormIO" + new Date().getTime(), + s = i.ownerDocument, + l = S.closest("body"); + if ( + (u.iframeTarget + ? (a = (d = M(u.iframeTarget, s)).attr2("name")) + ? (o = a) + : d.attr2("name", o) + : (d = M('';d.extend(y.prototype,{_scroll:function(){var b=this.qtip.elements.overlay;b&&(b[0].style.top=d(a).scrollTop()+"px")},init:function(c){var e=c.tooltip;d("select, object").length<1&&(this.bgiframe=c.elements.bgiframe=d(Da).appendTo(e),c._bind(e,"tooltipmove",this.adjustBGIFrame,this._ns,this)),this.redrawContainer=d("
",{id:T+"-rcontainer"}).appendTo(b.body),c.elements.overlay&&c.elements.overlay.addClass("qtipmodal-ie6fix")&&(c._bind(a,["scroll","resize"],this._scroll,this._ns,this),c._bind(e,["tooltipshow"],this._scroll,this._ns,this)),this.redraw()},adjustBGIFrame:function(){var a,b,c=this.qtip.tooltip,d={height:c.outerHeight(F),width:c.outerWidth(F)},e=this.qtip.plugins.tip,f=this.qtip.elements.tip;b=parseInt(c.css("borderLeftWidth"),10)||0,b={left:-b,top:-b},e&&f&&(a="x"===e.corner.precedance?[J,M]:[K,L],b[a[1]]-=f[a[0]]()),this.bgiframe.css(b).css(d)},redraw:function(){if(this.qtip.rendered<1||this.drawing)return this;var a,b,c,d,e=this.qtip.tooltip,f=this.qtip.options.style,g=this.qtip.options.position.container;return this.qtip.drawing=1,f.height&&e.css(K,f.height),f.width?e.css(J,f.width):(e.css(J,"").appendTo(this.redrawContainer),b=e.width(),1>b%2&&(b+=1),c=e.css("maxWidth")||"",d=e.css("minWidth")||"",a=(c+d).indexOf("%")>-1?g.width()/100:0,c=(c.indexOf("%")>-1?a:1)*parseInt(c,10)||b,d=(d.indexOf("%")>-1?a:1)*parseInt(d,10)||0,b=c+d?Math.min(Math.max(b,d),c):b,e.css(J,Math.round(b)).appendTo(g)),this.drawing=0,this},destroy:function(){this.bgiframe&&this.bgiframe.remove(),this.qtip._unbind([a,this.qtip.tooltip],this._ns)}}),Ca=S.ie6=function(a){return 6===ea.ie?new y(a):F},Ca.initialize="render",C.ie6={"^content|style$":function(){this.redraw()}}})}(window,document),function(a){a.fn.typeWatch=function(b){function c(b,c){var d=a(b.el).val();(d.length>=f.captureLength&&d.toUpperCase()!=b.text||c&&d.length>=f.captureLength)&&(b.text=d.toUpperCase(),b.cb.call(b.el,d))}function d(b){var d=b.type.toUpperCase();if(a.inArray(d,f.inputTypes)>=0){var e={timer:null,text:a(b).val().toUpperCase(),cb:f.callback,el:b,wait:f.wait};f.highlight&&a(b).focus(function(){this.select()});var g=function(b){var d=e.wait,g=!1,h=this.type.toUpperCase();"undefined"!=typeof b.keyCode&&13==b.keyCode&&"TEXTAREA"!=h&&a.inArray(h,f.inputTypes)>=0&&(d=1,g=!0);var i=function(){c(e,g)};clearTimeout(e.timer),e.timer=setTimeout(i,d)};a(b).on("keydown paste cut input",g)}}var e=["TEXT","TEXTAREA","PASSWORD","TEL","SEARCH","URL","EMAIL","DATETIME","DATE","MONTH","WEEK","TIME","DATETIME-LOCAL","NUMBER","RANGE"],f=a.extend({wait:750,callback:function(){},highlight:!0,captureLength:2,inputTypes:e},b);return this.each(function(){d(this)})}}(jQuery),function(a){a.fn.serializeForm=function(){if(this.length<1)return!1;var b={},c=b,d=':input[type!="checkbox"][type!="radio"], input:checked',e=function(){if(!this.disabled){var d=this.name.replace(/\[([^\]]+)?\]/g,",$1").split(","),e=d.length-1,f=a(this);if(d[0]){for(var g=0;e>g;g++)c=c[d[g]]=c[d[g]]||(""===d[g+1]||"0"===d[g+1]?[]:{});void 0!==c.length?c.push(f.val()):c[d[e]]=f.val(),c=b}}};return this.filter(d).each(e),this.find(d).each(e),b}}(jQuery),function(a){function b(){var a="!@#$%^&*()+=[]\\';,/{}|\":<>?~`.-_";return a+=" "}function c(){var a="¬€£¦";return a}function d(b,c,d){b.each(function(){var b=a(this);b.bind("keyup change paste",function(a){var e="";a.originalEvent&&a.originalEvent.clipboardData&&a.originalEvent.clipboardData.getData&&(e=a.originalEvent.clipboardData.getData("text/plain")),setTimeout(function(){h(b,c,d,e)},0)}),b.bind("keypress",function(a){var e=a.charCode?a.charCode:a.which;if(!(g(e)||a.ctrlKey||a.metaKey)){var f=String.fromCharCode(e),h=b.selection(),i=h.start,j=h.end,k=b.val(),l=k.substring(0,i)+f+k.substring(j),m=c(l,d);m!=l&&a.preventDefault()}})})}function e(b,c){var d=parseFloat(a(b).val()),e=a(b);return isNaN(d)?void e.val(""):(f(c.min)&&dc.max&&e.val("")))}function f(a){return!isNaN(a)}function g(a){return a>=32?!1:10==a?!1:13==a?!1:!0}function h(a,b,c,d){var e=a.val();""==e&&d.length>0&&(e=d);var f=b(e,c);if(e!=f){var g=a.alphanum_caret();a.val(f),a.alphanum_caret(e.length==f.length+1?g-1:g)}}function i(b,c){"undefined"==typeof c&&(c=D);var d,e={};return d="string"==typeof b?F[b]:"undefined"==typeof b?{}:b,a.extend(e,c,d),"undefined"==typeof e.blacklist&&(e.blacklistSet=x(e.allow,e.disallow)),e}function j(b){var c,d={};return c="string"==typeof b?G[b]:"undefined"==typeof b?{}:b,a.extend(d,E,c),d}function k(a,b,c){return c.maxLength&&a.length>=c.maxLength?!1:c.allow.indexOf(b)>=0?!0:c.allowSpace&&" "==b?!0:c.blacklistSet.contains(b)?!1:!c.allowNumeric&&K[b]?!1:!c.allowUpper&&u(b)?!1:!c.allowLower&&v(b)?!1:!c.allowCaseless&&w(b)?!1:!c.allowLatin&&L.contains(b)?!1:c.allowOtherCharSets?!0:K[b]||L.contains(b)?!0:!1}function l(a,b,c){if(K[b])return n(a,c)?!1:p(a,c)?!1:o(a,c)?!1:q(a+b,c)?!1:r(a+b,c)?!1:!0;if(c.allowPlus&&"+"==b&&""==a)return!0;if(c.allowMinus&&"-"==b&&""==a)return!0;if(b==I&&c.allowThouSep&&A(a,b))return!0;if(b==J){if(a.indexOf(J)>=0)return!1;if(c.allowDecSep)return!0}return!1}function m(a){return a+="",a.replace(/[^0-9]/g,"").length}function n(a,b){var c=b.maxDigits;if(""==c||isNaN(c))return!1;var d=m(a);return d>=c?!0:!1}function o(a,b){var c=b.maxDecimalPlaces;if(""==c||isNaN(c))return!1;var d=a.indexOf(J);if(-1==d)return!1;var e=a.substring(d),f=m(e);return f>=c?!0:!1}function p(a,b){var c=b.maxPreDecimalPlaces;if(""==c||isNaN(c))return!1;var d=a.indexOf(J);if(d>=0)return!1;var e=m(a);return e>=c?!0:!1}function q(a,b){if(!b.max||b.max<0)return!1;var c=parseFloat(a);return c>b.max?!0:!1}function r(a,b){if(!b.min||b.min>0)return!1;var c=parseFloat(a);return c=0)return!1;var c=a.indexOf(I);if(0>c)return!0;var d=a.lastIndexOf(I),e=a.length-d-1;if(3>e)return!1;var f=m(a.substring(c));return f%3>0?!1:!0}function B(a){this.map="string"==typeof a?C(a):{}}function C(a){var b,c={},d=a.split(""),e=0;for(e=0;e=0?d.toString().length:startPos+c.toString().length,{start:startPos,end:endPos}):null},d=function(d){var e=b(d);if(void 0!==d.selectionStart)return document.activeElement&&document.activeElement!=d&&d.selectionStart==d.selectionEnd&&0==d.selectionStart?{start:d.value.length,end:d.value.length}:{start:d.selectionStart,end:d.selectionEnd};if(e.getSelection)return c(d,e);try{if("input"==d.nodeName.toLowerCase()){var f=b(d).document.selection.createRange(),g=d.createTextRange();g.setEndPoint("EndToStart",f);var h=g.text.length;return{start:h,end:h+f.text.length}}var i=c(d,e);if(!i)return i;var j=a.Range.current().clone(),k=j.clone().collapse().range,l=j.clone().collapse(!1).range;return k.moveStart("character",-1),l.moveStart("character",-1),0!=i.startPos&&""==k.text&&(i.startPos+=2),0!=i.endPos&&""==l.text&&(i.endPos+=2),i}catch(m){return{start:d.value.length,end:d.value.length}}},e=function(a,c,d){var e=b(a);if(a.setSelectionRange)void 0===d?(a.focus(),a.setSelectionRange(c,c)):(a.select(),a.selectionStart=c,a.selectionEnd=d);else if(a.createTextRange){var f=a.createTextRange();f.moveStart("character",c),d=d||c,f.moveEnd("character",d-a.value.length),f.select()}else if(e.getSelection){var h=e.document,i=e.getSelection(),j=h.createRange(),k=[c,void 0!==d?d:c];g([a],k),j.setStart(k[0].el,k[0].count),j.setEnd(k[1].el,k[1].count),i.removeAllRanges(),i.addRange(j)}else if(e.document.body.createTextRange){var j=document.body.createTextRange();j.moveToElementText(a),j.collapse(),j.moveStart("character",c),j.moveEnd("character",void 0!==d?d:c),j.select()}},f=function(a,b,c,d){"number"==typeof c[0]&&c[0]d.right||c.bottomd.bottom)}},a.redux.hideFields(),a.redux.checkRequired(),a.redux.initEvents(),a.redux.initQtip(),a.redux.tabCheck(),a.redux.notices(),a.redux.tabControl(),a.redux.devFunctions()}),a.redux.ajax_save=function(b){var c=a(document.getElementById("redux_ajax_overlay"));c.fadeIn(),jQuery(".redux-action_bar .spinner").show(),jQuery(".redux-action_bar input").attr("disabled","disabled");var d=jQuery(document.getElementById("redux_notification_bar"));d.slideUp(),jQuery(".redux-save-warn").slideUp();var e=jQuery(document.getElementById("redux-form-wrapper"));redux.fields.hasOwnProperty("editor")&&a.each(redux.fields.editor,function(a){var b=tinyMCE.get(a);b&&b.save()});var f=e.serialize();e.find("input[type=checkbox]").each(function(){if("undefined"!=typeof a(this).attr("name")){var b=a(this).is(":checked")?a(this).val():"0";f+="&"+a(this).attr("name")+"="+b}}),"redux_save"!=b.attr("name")&&(f+="&"+b.attr("name")+"="+b.val());var g=e.attr("data-nonce");return jQuery.ajax({type:"post",dataType:"json",url:ajaxurl,data:{action:redux.args.opt_name+"_ajax_save",nonce:g,opt_name:redux.args.opt_name,data:f},error:function(a){window.console||(console={}),console.log=console.log||function(){},console.log(redux.ajax.console),console.log(a.responseText),jQuery(".redux-action_bar input").removeAttr("disabled"),c.fadeOut("fast"),jQuery(".redux-action_bar .spinner").fadeOut("fast"),alert(redux.ajax.alert)},success:function(b){if(b.action&&"reload"==b.action)location.reload();else if("success"==b.status){jQuery(".redux-action_bar input").removeAttr("disabled"),c.fadeOut("fast"),jQuery(".redux-action_bar .spinner").fadeOut("fast"),redux.options=b.options,redux.errors=b.errors,redux.warnings=b.warnings,d.html(b.notification_bar).slideDown("fast"),(null!==b.errors||null!==b.warnings)&&a.redux.notices();var e=a(document.getElementById("redux_notification_bar")).find(".saved_notice");e.slideDown(),e.delay(4e3).slideUp()}else jQuery(".redux-action_bar input").removeAttr("disabled"),jQuery(".redux-action_bar .spinner").fadeOut("fast"),c.fadeOut("fast"),jQuery(".redux_ajax_save_error").slideUp(),jQuery(".wrap h2:first-child").parent().append('"),jQuery(".redux_ajax_save_error").slideDown(),jQuery("html, body").animate({scrollTop:0},"slow")}}),!1},a.redux.initEvents=function(){a(".redux-presets-bar").on("click",function(){window.onbeforeunload=null}),a("#toplevel_page_"+redux.args.slug+" .wp-submenu a, #wp-admin-bar-"+redux.args.slug+" a.ab-item").click(function(b){if((a("#toplevel_page_"+redux.args.slug).hasClass("wp-menu-open")||a(this).hasClass("ab-item"))&&!a(this).parents("ul.ab-submenu:first").hasClass("ab-sub-secondary")&&a(this).attr("href").toLowerCase().indexOf(redux.args.slug+"&tab=")>=0){b.preventDefault();var c=a(this).attr("href").split("&tab=");return a("#"+c[1]+"_section_group_li_a").click(),a(this).parents("ul:first").find(".current").removeClass("current"),a(this).addClass("current"),a(this).parent().addClass("current"),!1}}),a(".redux-action_bar input").on("click",function(b){if(a(this).attr("name")==redux.args.opt_name+"[defaults]"){if(!confirm(redux.args.reset_confirm))return!1}else if(a(this).attr("name")==redux.args.opt_name+"[defaults-section]"&&!confirm(redux.args.reset_section_confirm))return!1; + +window.onbeforeunload=null,redux.args.ajax_save===!0&&(a.redux.ajax_save(a(this)),b.preventDefault())}),a(".expand_options").click(function(b){b.preventDefault();var c=a(".redux-container");if(a(c).hasClass("fully-expanded")){a(c).removeClass("fully-expanded");var d=a.cookie("redux_current_tab");a(".redux-container:first").find("#"+d+"_section_group").fadeIn(200,function(){0!==a(".redux-container:first").find("#redux-footer").length&&a.redux.stickyInfo(),a.redux.initFields()})}return a.redux.expandOptions(a(this).parents(".redux-container:first")),!1}),a(".saved_notice").is(":visible")&&a(".saved_notice").slideDown(),a(document.body).on("change",".redux-field input, .redux-field textarea, .redux-field select",function(){a(this).hasClass("noUpdate")||redux_change(a(this))});var b=a("#redux-footer").height();a("#redux-sticky-padder").css({height:b}),a("#redux-footer-sticky").removeClass("hide"),0!==a("#redux-footer").length&&(a(window).scroll(function(){a.redux.stickyInfo()}),a(window).resize(function(){a.redux.stickyInfo()})),a(".saved_notice").delay(4e3).slideUp()},a.redux.hideFields=function(){a("label[for='redux_hide_field']").each(function(){var b=a(this).parent().parent();a(b).addClass("hidden")})},a.redux.checkRequired=function(){a.redux.required(),a("body").on("change",".redux-main select, .redux-main radio, .redux-main input[type=checkbox], .redux-main input[type=hidden]",function(){a.redux.check_dependencies(this)}),a("body").on("check_dependencies",function(b,c){a.redux.check_dependencies(c)}),a("td > fieldset:empty,td > div:empty").parent().parent().hide()},a.redux.initQtip=function(){if(a().qtip){var b="",c=redux.args.hints.tip_style.shadow;c===!0&&(b="qtip-shadow");var d="",e=redux.args.hints.tip_style.color;""!==e&&(d="qtip-"+e);var f="",g=redux.args.hints.tip_style.rounded;g===!0&&(f="qtip-rounded");var h="",i=redux.args.hints.tip_style.style;""!==i&&(h="qtip-"+i);var j=b+","+d+","+f+","+h;j=j.replace(/,/g," ");var k=redux.args.hints.tip_position.my,l=redux.args.hints.tip_position.at;k=a.redux.verifyPos(k.toLowerCase(),!0),l=a.redux.verifyPos(l.toLowerCase(),!1);var m=redux.args.hints.tip_effect.show.event,n=redux.args.hints.tip_effect.hide.event,o=redux.args.hints.tip_effect.show.effect,p=redux.args.hints.tip_effect.show.duration,q=redux.args.hints.tip_effect.hide.effect,r=redux.args.hints.tip_effect.hide.duration;a("div.redux-hint-qtip").each(function(){a(this).qtip({content:{text:a(this).attr("qtip-content"),title:a(this).attr("qtip-title")},show:{effect:function(){switch(o){case"slide":a(this).slideDown(p);break;case"fade":a(this).fadeIn(p);break;default:a(this).show()}},event:m},hide:{effect:function(){switch(q){case"slide":a(this).slideUp(r);break;case"fade":a(this).fadeOut(r);break;default:a(this).show(r)}},event:n},style:{classes:j},position:{my:k,at:l}})}),a("input[qtip-content]").each(function(){a(this).qtip({content:{text:a(this).attr("qtip-content"),title:a(this).attr("qtip-title")},show:"focus",hide:"blur",style:j,position:{my:k,at:l}})})}},a.redux.tabCheck=function(){a(".redux-group-tab-link-a").click(function(){var b=a(this);if(b.parent().hasClass("empty_section")&&b.parent().hasClass("hasSubSections")){var c=a(this).closest("ul").find(".redux-group-tab-link-a"),d=c.index(this);b=c.slice(d+1,d+2)}var e=b.parents(".redux-container:first"),f=b.data("rel"),g=e.find(".redux-group-tab-link-li.active:first .redux-group-tab-link-a").data("rel");if(g!==f){if(a("#currentSection").val(f),b.parents(".postbox-container:first").length||a.cookie("redux_current_tab",f,{expires:7,path:"/"}),e.find("#"+f+"_section_group_li").parents(".redux-group-tab-link-li").length){var h=e.find("#"+f+"_section_group_li").parents(".redux-group-tab-link-li").attr("id").split("_");h=h[0]}if(e.find("#toplevel_page_"+redux.args.slug+" .wp-submenu a.current").removeClass("current"),e.find("#toplevel_page_"+redux.args.slug+" .wp-submenu li.current").removeClass("current"),e.find("#toplevel_page_"+redux.args.slug+" .wp-submenu a").each(function(){var b=a(this).attr("href").split("&tab=");(b[1]==f||b[1]==h)&&(a(this).addClass("current"),a(this).parent().addClass("current"))}),e.find("#"+g+"_section_group_li").find("#"+g+"_section_group_li").length)e.find("#"+g+"_section_group_li").addClass("activeChild"),e.find("#"+f+"_section_group_li").addClass("active").removeClass("activeChild");else if(e.find("#"+f+"_section_group_li").parents("#"+g+"_section_group_li").length||e.find("#"+g+"_section_group_li").parents("ul.subsection").find("#"+f+"_section_group_li").length)e.find("#"+f+"_section_group_li").parents("#"+g+"_section_group_li").length?e.find("#"+g+"_section_group_li").addClass("activeChild").removeClass("active"):(e.find("#"+f+"_section_group_li").addClass("active"),e.find("#"+g+"_section_group_li").removeClass("active")),e.find("#"+f+"_section_group_li").removeClass("activeChild").addClass("active");else if(e.find("#"+f+"_section_group_li").addClass("active").removeClass("activeChild").find("ul.subsection").slideDown(),e.find("#"+g+"_section_group_li").find("ul.subsection").length){e.find("#"+g+"_section_group_li").find("ul.subsection").slideUp("fast",function(){e.find("#"+g+"_section_group_li").removeClass("active").removeClass("activeChild")});var i=e.find("#"+f+"_section_group_li").parents(".hasSubSections:first");i.length>0&&(e.find("#"+f+"_section_group_li").removeClass("active"),f=i.find(".redux-group-tab-link-a:first").data("rel"),i.hasClass("empty_section")?(i.find(".subsection li:first").addClass("active"),e.find("#"+f+"_section_group_li").removeClass("active").addClass("activeChild").find("ul.subsection").slideDown(),i=i.find(".subsection li:first"),f=i.find(".redux-group-tab-link-a:first").data("rel")):e.find("#"+f+"_section_group_li").addClass("active").removeClass("activeChild").find("ul.subsection").slideDown())}else e.find("#"+g+"_section_group_li").parents("ul.subsection").length?e.find("#"+g+"_section_group_li").parents("#"+f+"_section_group_li").length?e.find("#"+g+"_section_group_li").removeClass("active"):e.find("#"+g+"_section_group_li").parents("ul.subsection").slideUp("fast",function(){e.find("#"+g+"_section_group_li").removeClass("active"),e.find("#"+g+"_section_group_li").parents(".redux-group-tab-link-li").removeClass("active").removeClass("activeChild"),e.find("#"+f+"_section_group_li").parents(".redux-group-tab-link-li").addClass("activeChild").find("ul.subsection").slideDown(),e.find("#"+f+"_section_group_li").addClass("active")}):(e.find("#"+g+"_section_group_li").removeClass("active"),e.find("#"+f+"_section_group_li").parents(".redux-group-tab-link-li").length&&(e.find("#"+f+"_section_group_li").parents(".redux-group-tab-link-li").addClass("activeChild").find("ul.subsection").slideDown(),e.find("#"+f+"_section_group_li").addClass("active")));e.find("#"+g+"_section_group").hide(),e.find("#"+f+"_section_group").fadeIn(200,function(){0!==e.find("#redux-footer").length&&a.redux.stickyInfo(),a.redux.initFields()}),a("#toplevel_page_"+redux.args.slug).find(".current").removeClass("current")}});var b=decodeURI((new RegExp("tab=(.+?)(&|$)").exec(location.search)||[,""])[1]);""!==b?a.cookie("redux_current_tab_get")!==b&&(a.cookie("redux_current_tab",b,{expires:7,path:"/"}),a.cookie("redux_current_tab_get",b,{expires:7,path:"/"}),a("#"+b+"_section_group_li").click()):""!==a.cookie("redux_current_tab_get")&&a.removeCookie("redux_current_tab_get");var c=a("#"+a.cookie("redux_current_tab")+"_section_group_li_a");null===a.cookie("redux_current_tab")||"undefined"==typeof a.cookie("redux_current_tab")||0===c.length?a(".redux-container").find(".redux-group-tab-link-a:first").click():c.click()},a.redux.initFields=function(){a(".redux-group-tab:visible").find(".redux-field-init:visible").each(function(){var b=a(this).attr("data-type");if("undefined"!=typeof redux.field_objects&&redux.field_objects[b]&&redux.field_objects[b]&&redux.field_objects[b].init(),a(this).hasClass("redux_remove_th")){var c=a(this).parents("tr:first"),d=c.find("th:first");a(this).prepend(d.html()),a(this).find(".redux_field_th").css("padding","0 0 10px 0"),a(this).parent().attr("colspan","2"),d.remove()}})},a.redux.notices=function(){redux.errors&&redux.errors.errors&&(a.each(redux.errors.errors,function(b,c){a.each(c.errors,function(b,c){a("#"+redux.args.opt_name+"-"+c.id).addClass("redux-field-error"),0===a("#"+redux.args.opt_name+"-"+c.id).parent().find(".redux-th-error").length?a("#"+redux.args.opt_name+"-"+c.id).append('
'+c.msg+"
"):a("#"+redux.args.opt_name+"-"+c.id).parent().find(".redux-th-error").html(c.msg).css("display","block")})}),a(".redux-container").each(function(){var b=a(this);b.find(".redux-menu-error").remove();var c=b.find(".redux-field-error").length;c>0&&(b.find(".redux-field-errors span").text(c),b.find(".redux-field-errors").slideDown(),b.find(".redux-group-tab").each(function(){var c=a(this).find(".redux-field-error").length;if(c>0){var d=a(this).attr("id").split("_");d=d[0],b.find('.redux-group-tab-link-a[data-key="'+d+'"]').prepend(''+c+""),b.find('.redux-group-tab-link-a[data-key="'+d+'"]').addClass("hasError");var e=b.find('.redux-group-tab-link-a[data-key="'+d+'"]').parents(".hasSubSections:first");e&&e.find(".redux-group-tab-link-a:first").addClass("hasError")}}))})),redux.warnings&&redux.warnings.warnings&&(a.each(redux.warnings.warnings,function(b,c){a.each(c.warnings,function(b,c){a("#"+redux.args.opt_name+"-"+c.id).addClass("redux-field-warning"),0===a("#"+redux.args.opt_name+"-"+c.id).parent().find(".redux-th-warning").length?a("#"+redux.args.opt_name+"-"+c.id).append('
'+c.msg+"
"):a("#"+redux.args.opt_name+"-"+c.id).parent().find(".redux-th-warning").html(c.msg).css("display","block")})}),a(".redux-container").each(function(){var b=a(this);b.find(".redux-menu-warning").remove();var c=b.find(".redux-field-warning").length;c>0&&(b.find(".redux-field-warnings span").text(c),b.find(".redux-field-warnings").slideDown(),b.find(".redux-group-tab").each(function(){var c=a(this).find(".redux-field-warning").length;if(c>0){var d=a(this).attr("id").split("_");d=d[0],b.find('.redux-group-tab-link-a[data-key="'+d+'"]').prepend(''+c+""),b.find('.redux-group-tab-link-a[data-key="'+d+'"]').addClass("hasWarning");var e=b.find('.redux-group-tab-link-a[data-key="'+d+'"]').parents(".hasSubSections:first");e&&e.find(".redux-group-tab-link-a:first").addClass("hasWarning")}}))}))},a.redux.tabControl=function(){a(".redux-section-tabs div").hide(),a(".redux-section-tabs div:first").show(),a(".redux-section-tabs ul li:first").addClass("active"),a(".redux-section-tabs ul li a").click(function(){a(".redux-section-tabs ul li").removeClass("active"),a(this).parent().addClass("active");var b=a(this).attr("href");return a(".redux-section-tabs div").hide(),a(b).fadeIn("medium",function(){a.redux.initFields()}),!1})},a.redux.devFunctions=function(){a("#consolePrintObject").on("click",function(b){b.preventDefault(),console.log(a.parseJSON(a("#redux-object-json").html()))}),"function"==typeof jsonView&&jsonView("#redux-object-json","#redux-object-browser")},a.redux.required=function(){a.each(redux.folds,function(b,c){var d=a("#"+redux.args.opt_name+"-"+b);if(d.parents("tr:first").addClass("fold"),"hide"==c){if(d.parents("tr:first").addClass("hide"),d.hasClass("redux-container-section")){var e=a("#section-"+b);e.hasClass("redux-section-indent-start")&&(a("#section-table-"+b).hide().addClass("hide"),e.hide().addClass("hide"))}if(d.hasClass("redux-container-info")&&a("#info-"+b).hide().addClass("hide"),d.hasClass("redux-container-divide")&&a("#divide-"+b).hide().addClass("hide"),d.hasClass("redux-container-raw")){var f=d.parents().find("table#"+redux.args.opt_name+"-"+b);f.hide().addClass("hide")}}})},a.redux.get_container_value=function(b){var c=a("#"+redux.args.opt_name+"-"+b).serializeForm();return null!==c&&"object"==typeof c&&c.hasOwnProperty(redux.args.opt_name)&&(c=c[redux.args.opt_name][b]),a("#"+redux.args.opt_name+"-"+b).hasClass("redux-container-media")&&(c=c.url),c},a.redux.check_dependencies=function(b){if(null!==redux.required){var c=a(b),d=c.parents(".redux-field:first").data("id");if(redux.required.hasOwnProperty(d)){var e=c.parents(".redux-field-container:first"),f=e.parents("tr:first").hasClass(".hide");a.each(redux.required[d],function(b){var c=a(this),d=!1,e=a("#"+redux.args.opt_name+"-"+b),g=e.parents("tr:first");if(f||(d=a.redux.check_parents_dependencies(b)),d===!0){if(e.hasClass("redux-container-section")){var h=a("#section-"+b);h.hasClass("redux-section-indent-start")&&h.hasClass("hide")&&(a("#section-table-"+b).fadeIn(300).removeClass("hide"),h.fadeIn(300).removeClass("hide"))}if(e.hasClass("redux-container-info")&&a("#info-"+b).fadeIn(300).removeClass("hide"),e.hasClass("redux-container-divide")&&a("#divide-"+b).fadeIn(300).removeClass("hide"),e.hasClass("redux-container-raw")){var i=e.parents().find("table#"+redux.args.opt_name+"-"+b);i.fadeIn(300).removeClass("hide")}g.fadeIn(300,function(){a(this).removeClass("hide"),redux.required.hasOwnProperty(b)&&a.redux.check_dependencies(a("#"+redux.args.opt_name+"-"+b).children().first()),a.redux.initFields()}),(e.hasClass("redux-container-section")||e.hasClass("redux-container-info"))&&g.css({display:"none"})}else d===!1&&g.fadeOut(100,function(){a(this).addClass("hide"),redux.required.hasOwnProperty(b)&&a.redux.required_recursive_hide(b)});c.find("select, radio, input[type=checkbox]").trigger("change")})}}},a.redux.required_recursive_hide=function(b){var c=a("#"+redux.args.opt_name+"-"+b).parents("tr:first");c.fadeOut(50,function(){if(a(this).addClass("hide"),a("#"+redux.args.opt_name+"-"+b).hasClass("redux-container-section")){var c=a("#section-"+b);c.hasClass("redux-section-indent-start")&&(a("#section-table-"+b).fadeOut(50).addClass("hide"),c.fadeOut(50).addClass("hide"))}if(a("#"+redux.args.opt_name+"-"+b).hasClass("redux-container-info")&&a("#info-"+b).fadeOut(50).addClass("hide"),a("#"+redux.args.opt_name+"-"+b).hasClass("redux-container-divide")&&a("#divide-"+b).fadeOut(50).addClass("hide"),a("#"+redux.args.opt_name+"-"+b).hasClass("redux-container-raw")){var d=a("#"+redux.args.opt_name+"-"+b).parents().find("table#"+redux.args.opt_name+"-"+b);d.fadeOut(50).addClass("hide")}redux.required.hasOwnProperty(b)&&a.each(redux.required[b],function(b){a.redux.required_recursive_hide(b)})})},a.redux.check_parents_dependencies=function(b){var c="";return redux.required_child.hasOwnProperty(b)?a.each(redux.required_child[b],function(b,d){if(a("#"+redux.args.opt_name+"-"+d.parent).parents("tr:first").hasClass(".hide"))c=!1;else if(c!==!1){var e=a.redux.get_container_value(d.parent);c=a.redux.check_dependencies_visibility(e,d)}}):c=!0,c},a.redux.check_dependencies_visibility=function(b,c){var d=!1,e=c.checkValue,f=c.operation;switch(f){case"=":case"equals":a.isArray(b)?a(b[0]).each(function(b,c){if(a.isArray(e))a(e).each(function(a,b){return c==b?(d=!0,!0):void 0});else if(c==e)return d=!0,!0}):a.isArray(e)?a(e).each(function(a,c){b==c&&(d=!0)}):b==e&&(d=!0);break;case"!=":case"not":a.isArray(b)?a(b[0]).each(function(b,c){if(a.isArray(e))a(e).each(function(a,b){return c!=b?(d=!0,!0):void 0});else if(c!=e)return d=!0,!0}):a.isArray(e)?a(e).each(function(a,c){b!=c&&(d=!0)}):b!=e&&(d=!0);break;case">":case"greater":case"is_larger":parseFloat(b)>parseFloat(e)&&(d=!0);break;case">=":case"greater_equal":case"is_larger_equal":parseFloat(b)>=parseFloat(e)&&(d=!0);break;case"<":case"less":case"is_smaller":parseFloat(b)g)&&(g=h,b.attr("data-height",g),b.css("width","auto"),b.attr("data-width",b.width()),f=b.width()),f>d?(e=d/f,b.css("width",d),b.css("height",g*e),g*=e,f*=e):b.css("width","auto"),g>c?(e=c/g,b.css("height",c),b.css("width",f*e),f*=e,g*=e):b.css("height","auto");var i=(a(document.getElementById("redux-header")).height()-b.height())/2;i>0?b.css("margin-top",i):b.css("margin-top",0),a("#redux-header .redux_field_search")&&a("#redux-header .redux_field_search").css("right",a(b).width()+20)},a.redux.resizeAds=function(){var b=a("#redux-header"),c=b.find(".rAds"),d=b.height(),e=b.width()-b.find(".display_header").width()-30;a(c).find("video").each(function(){a.redux.scaleToRatio(a(this),d,e)}),a(c).find("img").each(function(){a.redux.scaleToRatio(a(this),d,e)}),a(c).find("div").each(function(){a.redux.scaleToRatio(a(this),d,e)}),"-99999px"==c.css("left")&&c.css("display","none").css("left","auto"),c.fadeIn("slow")},a(document).ready(function(){redux.rAds&&setTimeout(function(){a("#redux-header").append('
');var b=a("#redux-header");b.css("position","relative"),b.find(".rAds").attr("style","position:absolute; top: 6px; right: 6px; display:block !important;overflow:hidden;").css("left","-99999px"),b.find(".rAds").html(redux.rAds.replace(//,""));{var c=b.find(".rAds");b.height(),b.width()-b.find(".display_header").width()-30}c.find("a").css("float","right").css("line-height",b.height()+"px").css("margin-left","5px"),a(document).ajaxComplete(function(){c.find("a").hide(),setTimeout(function(){a.redux.resizeAds(),c.find("a").fadeIn()},1400),setTimeout(function(){a.redux.resizeAds()},1500),a(document).unbind("ajaxComplete")}),a(window).resize(function(){a.redux.resizeAds()})},400)})}(jQuery),jQuery.noConflict();var confirmOnPageExit=function(a){a=a||window.event;var b=redux.args.save_pending;return a&&(a.returnValue=b),window.onbeforeunload=null,b}; \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor.min.js b/plugins/legacy-admin/framework/core/assets/js/vendor.min.js new file mode 100644 index 000000000..adc1315df --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor.min.js @@ -0,0 +1,2 @@ +!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){function b(a){return a}function c(a){return decodeURIComponent(a.replace(e," "))}function d(a){0===a.indexOf('"')&&(a=a.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return f.json?JSON.parse(a):a}catch(b){}}var e=/\+/g,f=a.cookie=function(e,g,h){if(void 0!==g){if(h=a.extend({},f.defaults,h),"number"==typeof h.expires){var i=h.expires,j=h.expires=new Date;j.setDate(j.getDate()+i)}return g=f.json?JSON.stringify(g):String(g),document.cookie=[f.raw?e:encodeURIComponent(e),"=",f.raw?g:encodeURIComponent(g),h.expires?"; expires="+h.expires.toUTCString():"",h.path?"; path="+h.path:"",h.domain?"; domain="+h.domain:"",h.secure?"; secure":""].join("")}for(var k=f.raw?b:c,l=document.cookie.split("; "),m=e?void 0:{},n=0,o=l.length;o>n;n++){var p=l[n].split("="),q=k(p.shift()),r=k(p.join("="));if(e&&e===q){m=d(r);break}e||(m[q]=d(r))}return m};f.defaults={},a.removeCookie=function(b,c){return void 0!==a.cookie(b)?(a.cookie(b,"",a.extend({},c,{expires:-1})),!0):!1}}),"undefined"==typeof jQuery.qtip&&!function(a,b,c){!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):jQuery&&!jQuery.fn.qtip&&a(jQuery)}(function(d){"use strict";function e(a,b,c,e){this.id=c,this.target=a,this.tooltip=G,this.elements={target:a},this._id=T+"-"+c,this.timers={img:{}},this.options=b,this.plugins={},this.cache={event:{},target:d(),disabled:F,attr:e,onTooltip:F,lastClass:""},this.rendered=this.destroyed=this.disabled=this.waiting=this.hiddenDuringWait=this.positioning=this.triggering=F}function f(a){return a===G||"object"!==d.type(a)}function g(a){return!(d.isFunction(a)||a&&a.attr||a.length||"object"===d.type(a)&&(a.jquery||a.then))}function h(a){var b,c,e,h;return f(a)?F:(f(a.metadata)&&(a.metadata={type:a.metadata}),"content"in a&&(b=a.content,f(b)||b.jquery||b.done?b=a.content={text:c=g(b)?F:b}:c=b.text,"ajax"in b&&(e=b.ajax,h=e&&e.once!==F,delete b.ajax,b.text=function(a,b){var f=c||d(this).attr(b.options.content.attr)||"Loading...",g=d.ajax(d.extend({},e,{context:b})).then(e.success,G,e.error).then(function(a){return a&&h&&b.set("content.text",a),a},function(a,c,d){b.destroyed||0===a.status||b.set("content.text",c+": "+d)});return h?f:(b.set("content.text",f),g)}),"title"in b&&(f(b.title)||(b.button=b.title.button,b.title=b.title.text),g(b.title||F)&&(b.title=F))),"position"in a&&f(a.position)&&(a.position={my:a.position,at:a.position}),"show"in a&&f(a.show)&&(a.show=a.show.jquery?{target:a.show}:a.show===E?{ready:E}:{event:a.show}),"hide"in a&&f(a.hide)&&(a.hide=a.hide.jquery?{target:a.hide}:{event:a.hide}),"style"in a&&f(a.style)&&(a.style={classes:a.style}),d.each(S,function(){this.sanitize&&this.sanitize(a)}),a)}function i(a,b){for(var c,d=0,e=a,f=b.split(".");e=e[f[d++]];)d0?setTimeout(d.proxy(a,this),b):void a.call(this)}function n(a){return this.tooltip.hasClass(ba)?F:(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),void(this.timers.show=m.call(this,function(){this.toggle(E,a)},this.options.show.delay)))}function o(a){if(this.tooltip.hasClass(ba))return F;var b=d(a.relatedTarget),c=b.closest(X)[0]===this.tooltip[0],e=b[0]===this.options.show.target[0];if(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this!==b[0]&&"mouse"===this.options.position.target&&c||this.options.hide.fixed&&/mouse(out|leave|move)/.test(a.type)&&(c||e))try{a.preventDefault(),a.stopImmediatePropagation()}catch(f){}else this.timers.hide=m.call(this,function(){this.toggle(F,a)},this.options.hide.delay,this)}function p(a){return this.tooltip.hasClass(ba)||!this.options.hide.inactive?F:(clearTimeout(this.timers.inactive),void(this.timers.inactive=m.call(this,function(){this.hide(a)},this.options.hide.inactive)))}function q(a){this.rendered&&this.tooltip[0].offsetWidth>0&&this.reposition(a)}function r(a,c,e){d(b.body).delegate(a,(c.split?c:c.join(ia+" "))+ia,function(){var a=z.api[d.attr(this,V)];a&&!a.disabled&&e.apply(a,arguments)})}function s(a,c,f){var g,i,j,k,l,m=d(b.body),n=a[0]===b?m:a,o=a.metadata?a.metadata(f.metadata):G,p="html5"===f.metadata.type&&o?o[f.metadata.name]:G,q=a.data(f.metadata.name||"qtipopts");try{q="string"==typeof q?d.parseJSON(q):q}catch(r){}if(k=d.extend(E,{},z.defaults,f,"object"==typeof q?h(q):G,h(p||o)),i=k.position,k.id=c,"boolean"==typeof k.content.text){if(j=a.attr(k.content.attr),k.content.attr===F||!j)return F;k.content.text=j}if(i.container.length||(i.container=m),i.target===F&&(i.target=n),k.show.target===F&&(k.show.target=n),k.show.solo===E&&(k.show.solo=i.container.closest("body")),k.hide.target===F&&(k.hide.target=n),k.position.viewport===E&&(k.position.viewport=i.container),i.container=i.container.eq(0),i.at=new B(i.at,E),i.my=new B(i.my),a.data(T))if(k.overwrite)a.qtip("destroy",!0);else if(k.overwrite===F)return F;return a.attr(U,c),k.suppress&&(l=a.attr("title"))&&a.removeAttr("title").attr(da,l).attr("title",""),g=new e(a,k,c,!!j),a.data(T,g),a.one("remove.qtip-"+c+" removeqtip.qtip-"+c,function(){var a;(a=d(this).data(T))&&a.destroy(!0)}),g}function t(a){return a.charAt(0).toUpperCase()+a.slice(1)}function u(a,b){var d,e,f=b.charAt(0).toUpperCase()+b.slice(1),g=(b+" "+ta.join(f+" ")+f).split(" "),h=0;if(sa[b])return a.css(sa[b]);for(;d=g[h++];)if((e=a.css(d))!==c)return sa[b]=d,e}function v(a,b){return Math.ceil(parseFloat(u(a,b)))}function w(a,b){this._ns="tip",this.options=b,this.offset=b.offset,this.size=[b.width,b.height],this.init(this.qtip=a)}function x(a,b){this.options=b,this._ns="-modal",this.init(this.qtip=a)}function y(a){this._ns="ie6",this.init(this.qtip=a)}var z,A,B,C,D,E=!0,F=!1,G=null,H="x",I="y",J="width",K="height",L="top",M="left",N="bottom",O="right",P="center",Q="flipinvert",R="shift",S={},T="qtip",U="data-hasqtip",V="data-qtip-id",W=["ui-widget","ui-tooltip"],X="."+T,Y="click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" "),Z=T+"-fixed",$=T+"-default",_=T+"-focus",aa=T+"-hover",ba=T+"-disabled",ca="_replacedByqTip",da="oldtitle",ea={ie:function(){for(var a=3,c=b.createElement("div");(c.innerHTML="")&&c.getElementsByTagName("i")[0];);return a>4?a:0/0}(),iOS:parseFloat((""+(/CPU.*OS ([0-9_]{1,5})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))||F};A=e.prototype,A._when=function(a){return d.when.apply(d,a)},A.render=function(a){if(this.rendered||this.destroyed)return this;var b,c=this,e=this.options,f=this.cache,g=this.elements,h=e.content.text,i=e.content.title,j=e.content.button,k=e.position,l=("."+this._id+" ",[]);return d.attr(this.target[0],"aria-describedby",this._id),this.tooltip=g.tooltip=b=d("
",{id:this._id,"class":[T,$,e.style.classes,T+"-pos-"+e.position.my.abbrev()].join(" "),width:e.style.width||"",height:e.style.height||"",tracking:"mouse"===k.target&&k.adjust.mouse,role:"alert","aria-live":"polite","aria-atomic":F,"aria-describedby":this._id+"-content","aria-hidden":E}).toggleClass(ba,this.disabled).attr(V,this.id).data(T,this).appendTo(k.container).append(g.content=d("
",{"class":T+"-content",id:this._id+"-content","aria-atomic":E})),this.rendered=-1,this.positioning=E,i&&(this._createTitle(),d.isFunction(i)||l.push(this._updateTitle(i,F))),j&&this._createButton(),d.isFunction(h)||l.push(this._updateContent(h,F)),this.rendered=E,this._setWidget(),d.each(S,function(a){var b;"render"===this.initialize&&(b=this(c))&&(c.plugins[a]=b)}),this._unassignEvents(),this._assignEvents(),this._when(l).then(function(){c._trigger("render"),c.positioning=F,c.hiddenDuringWait||!e.show.ready&&!a||c.toggle(E,f.event,F),c.hiddenDuringWait=F}),z.api[this.id]=this,this},A.destroy=function(a){function b(){if(!this.destroyed){this.destroyed=E;var a=this.target,b=a.attr(da);this.rendered&&this.tooltip.stop(1,0).find("*").remove().end().remove(),d.each(this.plugins,function(){this.destroy&&this.destroy()}),clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this._unassignEvents(),a.removeData(T).removeAttr(V).removeAttr(U).removeAttr("aria-describedby"),this.options.suppress&&b&&a.attr("title",b).removeAttr(da),this._unbind(a),this.options=this.elements=this.cache=this.timers=this.plugins=this.mouse=G,delete z.api[this.id]}}return this.destroyed?this.target:(a===E&&"hide"!==this.triggering||!this.rendered?b.call(this):(this.tooltip.one("tooltiphidden",d.proxy(b,this)),!this.triggering&&this.hide()),this.target)},C=A.checks={builtin:{"^id$":function(a,b,c,e){var f=c===E?z.nextid:c,g=T+"-"+f;f!==F&&f.length>0&&!d("#"+g).length?(this._id=g,this.rendered&&(this.tooltip[0].id=this._id,this.elements.content[0].id=this._id+"-content",this.elements.title[0].id=this._id+"-title")):a[b]=e},"^prerender":function(a,b,c){c&&!this.rendered&&this.render(this.options.show.ready)},"^content.text$":function(a,b,c){this._updateContent(c)},"^content.attr$":function(a,b,c,d){this.options.content.text===this.target.attr(d)&&this._updateContent(this.target.attr(c))},"^content.title$":function(a,b,c){return c?(c&&!this.elements.title&&this._createTitle(),void this._updateTitle(c)):this._removeTitle()},"^content.button$":function(a,b,c){this._updateButton(c)},"^content.title.(text|button)$":function(a,b,c){this.set("content."+b,c)},"^position.(my|at)$":function(a,b,c){"string"==typeof c&&(a[b]=new B(c,"at"===b))},"^position.container$":function(a,b,c){this.rendered&&this.tooltip.appendTo(c)},"^show.ready$":function(a,b,c){c&&(!this.rendered&&this.render(E)||this.toggle(E))},"^style.classes$":function(a,b,c,d){this.rendered&&this.tooltip.removeClass(d).addClass(c)},"^style.(width|height)":function(a,b,c){this.rendered&&this.tooltip.css(b,c)},"^style.widget|content.title":function(){this.rendered&&this._setWidget()},"^style.def":function(a,b,c){this.rendered&&this.tooltip.toggleClass($,!!c)},"^events.(render|show|move|hide|focus|blur)$":function(a,b,c){this.rendered&&this.tooltip[(d.isFunction(c)?"":"un")+"bind"]("tooltip"+b,c)},"^(show|hide|position).(event|target|fixed|inactive|leave|distance|viewport|adjust)":function(){if(this.rendered){var a=this.options.position;this.tooltip.attr("tracking","mouse"===a.target&&a.adjust.mouse),this._unassignEvents(),this._assignEvents()}}}},A.get=function(a){if(this.destroyed)return this;var b=i(this.options,a.toLowerCase()),c=b[0][b[1]];return c.precedance?c.string():c};var fa=/^position\.(my|at|adjust|target|container|viewport)|style|content|show\.ready/i,ga=/^prerender|show\.ready/i;A.set=function(a,b){if(this.destroyed)return this;{var c,e=this.rendered,f=F,g=this.options;this.checks}return"string"==typeof a?(c=a,a={},a[c]=b):a=d.extend({},a),d.each(a,function(b,c){if(e&&ga.test(b))return void delete a[b];var h,j=i(g,b.toLowerCase());h=j[0][j[1]],j[0][j[1]]=c&&c.nodeType?d(c):c,f=fa.test(b)||f,a[b]=[j[0],j[1],c,h]}),h(g),this.positioning=E,d.each(a,d.proxy(j,this)),this.positioning=F,this.rendered&&this.tooltip[0].offsetWidth>0&&f&&this.reposition("mouse"===g.position.target?G:this.cache.event),this},A._update=function(a,b){var c=this,e=this.cache;return this.rendered&&a?(d.isFunction(a)&&(a=a.call(this.elements.target,e.event,this)||""),d.isFunction(a.then)?(e.waiting=E,a.then(function(a){return e.waiting=F,c._update(a,b)},G,function(a){return c._update(a,b)})):a===F||!a&&""!==a?F:(a.jquery&&a.length>0?b.empty().append(a.css({display:"block",visibility:"visible"})):b.html(a),this._waitForContent(b).then(function(a){a.images&&a.images.length&&c.rendered&&c.tooltip[0].offsetWidth>0&&c.reposition(e.event,!a.length)}))):F},A._waitForContent=function(a){var b=this.cache;return b.waiting=E,(d.fn.imagesLoaded?a.imagesLoaded():d.Deferred().resolve([])).done(function(){b.waiting=F}).promise()},A._updateContent=function(a,b){this._update(a,this.elements.content,b)},A._updateTitle=function(a,b){this._update(a,this.elements.title,b)===F&&this._removeTitle(F)},A._createTitle=function(){var a=this.elements,b=this._id+"-title";a.titlebar&&this._removeTitle(),a.titlebar=d("
",{"class":T+"-titlebar "+(this.options.style.widget?k("header"):"")}).append(a.title=d("
",{id:b,"class":T+"-title","aria-atomic":E})).insertBefore(a.content).delegate(".qtip-close","mousedown keydown mouseup keyup mouseout",function(a){d(this).toggleClass("ui-state-active ui-state-focus","down"===a.type.substr(-4))}).delegate(".qtip-close","mouseover mouseout",function(a){d(this).toggleClass("ui-state-hover","mouseover"===a.type)}),this.options.content.button&&this._createButton()},A._removeTitle=function(a){var b=this.elements;b.title&&(b.titlebar.remove(),b.titlebar=b.title=b.button=G,a!==F&&this.reposition())},A.reposition=function(c,e){if(!this.rendered||this.positioning||this.destroyed)return this;this.positioning=E;var f,g,h=this.cache,i=this.tooltip,j=this.options.position,k=j.target,l=j.my,m=j.at,n=j.viewport,o=j.container,p=j.adjust,q=p.method.split(" "),r=i.outerWidth(F),s=i.outerHeight(F),t=0,u=0,v=i.css("position"),w={left:0,top:0},x=i[0].offsetWidth>0,y=c&&"scroll"===c.type,z=d(a),A=o[0].ownerDocument,B=this.mouse;if(d.isArray(k)&&2===k.length)m={x:M,y:L},w={left:k[0],top:k[1]};else if("mouse"===k)m={x:M,y:L},!B||!B.pageX||!p.mouse&&c&&c.pageX?c&&c.pageX||((!p.mouse||this.options.show.distance)&&h.origin&&h.origin.pageX?c=h.origin:(!c||c&&("resize"===c.type||"scroll"===c.type))&&(c=h.event)):c=B,"static"!==v&&(w=o.offset()),A.body.offsetWidth!==(a.innerWidth||A.documentElement.clientWidth)&&(g=d(b.body).offset()),w={left:c.pageX-w.left+(g&&g.left||0),top:c.pageY-w.top+(g&&g.top||0)},p.mouse&&y&&B&&(w.left-=(B.scrollX||0)-z.scrollLeft(),w.top-=(B.scrollY||0)-z.scrollTop());else{if("event"===k?c&&c.target&&"scroll"!==c.type&&"resize"!==c.type?h.target=d(c.target):c.target||(h.target=this.elements.target):"event"!==k&&(h.target=d(k.jquery?k:this.elements.target)),k=h.target,k=d(k).eq(0),0===k.length)return this;k[0]===b||k[0]===a?(t=ea.iOS?a.innerWidth:k.width(),u=ea.iOS?a.innerHeight:k.height(),k[0]===a&&(w={top:(n||k).scrollTop(),left:(n||k).scrollLeft()})):S.imagemap&&k.is("area")?f=S.imagemap(this,k,m,S.viewport?q:F):S.svg&&k&&k[0].ownerSVGElement?f=S.svg(this,k,m,S.viewport?q:F):(t=k.outerWidth(F),u=k.outerHeight(F),w=k.offset()),f&&(t=f.width,u=f.height,g=f.offset,w=f.position),w=this.reposition.offset(k,w,o),(ea.iOS>3.1&&ea.iOS<4.1||ea.iOS>=4.3&&ea.iOS<4.33||!ea.iOS&&"fixed"===v)&&(w.left-=z.scrollLeft(),w.top-=z.scrollTop()),(!f||f&&f.adjustable!==F)&&(w.left+=m.x===O?t:m.x===P?t/2:0,w.top+=m.y===N?u:m.y===P?u/2:0)}return w.left+=p.x+(l.x===O?-r:l.x===P?-r/2:0),w.top+=p.y+(l.y===N?-s:l.y===P?-s/2:0),S.viewport?(w.adjusted=S.viewport(this,w,j,t,u,r,s),g&&w.adjusted.left&&(w.left+=g.left),g&&w.adjusted.top&&(w.top+=g.top)):w.adjusted={left:0,top:0},this._trigger("move",[w,n.elem||n],c)?(delete w.adjusted,e===F||!x||isNaN(w.left)||isNaN(w.top)||"mouse"===k||!d.isFunction(j.effect)?i.css(w):d.isFunction(j.effect)&&(j.effect.call(i,this,d.extend({},w)),i.queue(function(a){d(this).css({opacity:"",height:""}),ea.ie&&this.style.removeAttribute("filter"),a()})),this.positioning=F,this):this},A.reposition.offset=function(a,c,e){function f(a,b){c.left+=b*a.scrollLeft(),c.top+=b*a.scrollTop()}if(!e[0])return c;var g,h,i,j,k=d(a[0].ownerDocument),l=!!ea.ie&&"CSS1Compat"!==b.compatMode,m=e[0];do"static"!==(h=d.css(m,"position"))&&("fixed"===h?(i=m.getBoundingClientRect(),f(k,-1)):(i=d(m).position(),i.left+=parseFloat(d.css(m,"borderLeftWidth"))||0,i.top+=parseFloat(d.css(m,"borderTopWidth"))||0),c.left-=i.left+(parseFloat(d.css(m,"marginLeft"))||0),c.top-=i.top+(parseFloat(d.css(m,"marginTop"))||0),g||"hidden"===(j=d.css(m,"overflow"))||"visible"===j||(g=d(m)));while(m=m.offsetParent);return g&&(g[0]!==k[0]||l)&&f(g,1),c};var ha=(B=A.reposition.Corner=function(a,b){a=(""+a).replace(/([A-Z])/," $1").replace(/middle/gi,P).toLowerCase(),this.x=(a.match(/left|right/i)||a.match(/center/)||["inherit"])[0].toLowerCase(),this.y=(a.match(/top|bottom|center/i)||["inherit"])[0].toLowerCase(),this.forceY=!!b;var c=a.charAt(0);this.precedance="t"===c||"b"===c?I:H}).prototype;ha.invert=function(a,b){this[a]=this[a]===M?O:this[a]===O?M:b||this[a]},ha.string=function(){var a=this.x,b=this.y;return a===b?a:this.precedance===I||this.forceY&&"center"!==b?b+" "+a:a+" "+b},ha.abbrev=function(){var a=this.string().split(" ");return a[0].charAt(0)+(a[1]&&a[1].charAt(0)||"")},ha.clone=function(){return new B(this.string(),this.forceY)},A.toggle=function(a,c){var e=this.cache,f=this.options,g=this.tooltip;if(c){if(/over|enter/.test(c.type)&&/out|leave/.test(e.event.type)&&f.show.target.add(c.target).length===f.show.target.length&&g.has(c.relatedTarget).length)return this;e.event=l(c)}if(this.waiting&&!a&&(this.hiddenDuringWait=E),!this.rendered)return a?this.render(1):this;if(this.destroyed||this.disabled)return this;var h,i,j,k=a?"show":"hide",m=this.options[k],n=(this.options[a?"hide":"show"],this.options.position),o=this.options.content,p=this.tooltip.css("width"),q=this.tooltip.is(":visible"),r=a||1===m.target.length,s=!c||m.target.length<2||e.target[0]===c.target;return(typeof a).search("boolean|number")&&(a=!q),h=!g.is(":animated")&&q===a&&s,i=h?G:!!this._trigger(k,[90]),this.destroyed?this:(i!==F&&a&&this.focus(c),!i||h?this:(d.attr(g[0],"aria-hidden",!a),a?(e.origin=l(this.mouse),d.isFunction(o.text)&&this._updateContent(o.text,F),d.isFunction(o.title)&&this._updateTitle(o.title,F),!D&&"mouse"===n.target&&n.adjust.mouse&&(d(b).bind("mousemove."+T,this._storeMouse),D=E),p||g.css("width",g.outerWidth(F)),this.reposition(c,arguments[2]),p||g.css("width",""),m.solo&&("string"==typeof m.solo?d(m.solo):d(X,m.solo)).not(g).not(m.target).qtip("hide",d.Event("tooltipsolo"))):(clearTimeout(this.timers.show),delete e.origin,D&&!d(X+'[tracking="true"]:visible',m.solo).not(g).length&&(d(b).unbind("mousemove."+T),D=F),this.blur(c)),j=d.proxy(function(){a?(ea.ie&&g[0].style.removeAttribute("filter"),g.css("overflow",""),"string"==typeof m.autofocus&&d(this.options.show.autofocus,g).focus(),this.options.show.target.trigger("qtip-"+this.id+"-inactive")):g.css({display:"",visibility:"",opacity:"",left:"",top:""}),this._trigger(a?"visible":"hidden")},this),m.effect===F||r===F?(g[k](),j()):d.isFunction(m.effect)?(g.stop(1,1),m.effect.call(g,this),g.queue("fx",function(a){j(),a()})):g.fadeTo(90,a?1:0,j),a&&m.target.trigger("qtip-"+this.id+"-inactive"),this))},A.show=function(a){return this.toggle(E,a)},A.hide=function(a){return this.toggle(F,a)},A.focus=function(a){if(!this.rendered||this.destroyed)return this;var b=d(X),c=this.tooltip,e=parseInt(c[0].style.zIndex,10),f=z.zindex+b.length;return c.hasClass(_)||this._trigger("focus",[f],a)&&(e!==f&&(b.each(function(){this.style.zIndex>e&&(this.style.zIndex=this.style.zIndex-1)}),b.filter("."+_).qtip("blur",a)),c.addClass(_)[0].style.zIndex=f),this},A.blur=function(a){return!this.rendered||this.destroyed?this:(this.tooltip.removeClass(_),this._trigger("blur",[this.tooltip.css("zIndex")],a),this)},A.disable=function(a){return this.destroyed?this:("toggle"===a?a=!(this.rendered?this.tooltip.hasClass(ba):this.disabled):"boolean"!=typeof a&&(a=E),this.rendered&&this.tooltip.toggleClass(ba,a).attr("aria-disabled",a),this.disabled=!!a,this)},A.enable=function(){return this.disable(F)},A._createButton=function(){var a=this,b=this.elements,c=b.tooltip,e=this.options.content.button,f="string"==typeof e,g=f?e:"Close tooltip";b.button&&b.button.remove(),b.button=e.jquery?e:d("",{"class":"qtip-close "+(this.options.style.widget?"":T+"-icon"),title:g,"aria-label":g}).prepend(d("",{"class":"ui-icon ui-icon-close",html:"×"})),b.button.appendTo(b.titlebar||c).attr("role","button").click(function(b){return c.hasClass(ba)||a.hide(b),F})},A._updateButton=function(a){if(!this.rendered)return F;var b=this.elements.button;a?this._createButton():b.remove()},A._setWidget=function(){var a=this.options.style.widget,b=this.elements,c=b.tooltip,d=c.hasClass(ba);c.removeClass(ba),ba=a?"ui-state-disabled":"qtip-disabled",c.toggleClass(ba,d),c.toggleClass("ui-helper-reset "+k(),a).toggleClass($,this.options.style.def&&!a),b.content&&b.content.toggleClass(k("content"),a),b.titlebar&&b.titlebar.toggleClass(k("header"),a),b.button&&b.button.toggleClass(T+"-icon",!a)},A._storeMouse=function(a){(this.mouse=l(a)).type="mousemove"},A._bind=function(a,b,c,e,f){var g="."+this._id+(e?"-"+e:"");b.length&&d(a).bind((b.split?b:b.join(g+" "))+g,d.proxy(c,f||this))},A._unbind=function(a,b){d(a).unbind("."+this._id+(b?"-"+b:""))};var ia="."+T;d(function(){r(X,["mouseenter","mouseleave"],function(a){var b="mouseenter"===a.type,c=d(a.currentTarget),e=d(a.relatedTarget||a.target),f=this.options;b?(this.focus(a),c.hasClass(Z)&&!c.hasClass(ba)&&clearTimeout(this.timers.hide)):"mouse"===f.position.target&&f.hide.event&&f.show.target&&!e.closest(f.show.target[0]).length&&this.hide(a),c.toggleClass(aa,b)}),r("["+V+"]",Y,p)}),A._trigger=function(a,b,c){var e=d.Event("tooltip"+a);return e.originalEvent=c&&d.extend({},c)||this.cache.event||G,this.triggering=a,this.tooltip.trigger(e,[this].concat(b||[])),this.triggering=F,!e.isDefaultPrevented()},A._bindEvents=function(a,b,c,e,f,g){if(e.add(c).length===e.length){var h=[];b=d.map(b,function(b){var c=d.inArray(b,a);return c>-1?void h.push(a.splice(c,1)[0]):b}),h.length&&this._bind(c,h,function(a){var b=this.rendered?this.tooltip[0].offsetWidth>0:!1;(b?g:f).call(this,a)})}this._bind(c,a,f),this._bind(e,b,g)},A._assignInitialEvents=function(a){function b(a){return this.disabled||this.destroyed?F:(this.cache.event=l(a),this.cache.target=a?d(a.target):[c],clearTimeout(this.timers.show),void(this.timers.show=m.call(this,function(){this.render("object"==typeof a||e.show.ready)},e.show.delay)))}var e=this.options,f=e.show.target,g=e.hide.target,h=e.show.event?d.trim(""+e.show.event).split(" "):[],i=e.hide.event?d.trim(""+e.hide.event).split(" "):[];/mouse(over|enter)/i.test(e.show.event)&&!/mouse(out|leave)/i.test(e.hide.event)&&i.push("mouseleave"),this._bind(f,"mousemove",function(a){this._storeMouse(a),this.cache.onTarget=E}),this._bindEvents(h,i,f,g,b,function(){clearTimeout(this.timers.show)}),(e.show.ready||e.prerender)&&b.call(this,a)},A._assignEvents=function(){var c=this,e=this.options,f=e.position,g=this.tooltip,h=e.show.target,i=e.hide.target,j=f.container,k=f.viewport,l=d(b),m=(d(b.body),d(a)),r=e.show.event?d.trim(""+e.show.event).split(" "):[],s=e.hide.event?d.trim(""+e.hide.event).split(" "):[];d.each(e.events,function(a,b){c._bind(g,"toggle"===a?["tooltipshow","tooltiphide"]:["tooltip"+a],b,null,g)}),/mouse(out|leave)/i.test(e.hide.event)&&"window"===e.hide.leave&&this._bind(l,["mouseout","blur"],function(a){/select|option/.test(a.target.nodeName)||a.relatedTarget||this.hide(a)}),e.hide.fixed?i=i.add(g.addClass(Z)):/mouse(over|enter)/i.test(e.show.event)&&this._bind(i,"mouseleave",function(){clearTimeout(this.timers.show)}),(""+e.hide.event).indexOf("unfocus")>-1&&this._bind(j.closest("html"),["mousedown","touchstart"],function(a){var b=d(a.target),c=this.rendered&&!this.tooltip.hasClass(ba)&&this.tooltip[0].offsetWidth>0,e=b.parents(X).filter(this.tooltip[0]).length>0;b[0]===this.target[0]||b[0]===this.tooltip[0]||e||this.target.has(b[0]).length||!c||this.hide(a)}),"number"==typeof e.hide.inactive&&(this._bind(h,"qtip-"+this.id+"-inactive",p),this._bind(i.add(g),z.inactiveEvents,p,"-inactive")),this._bindEvents(r,s,h,i,n,o),this._bind(h.add(g),"mousemove",function(a){if("number"==typeof e.hide.distance){var b=this.cache.origin||{},c=this.options.hide.distance,d=Math.abs;(d(a.pageX-b.pageX)>=c||d(a.pageY-b.pageY)>=c)&&this.hide(a)}this._storeMouse(a)}),"mouse"===f.target&&f.adjust.mouse&&(e.hide.event&&this._bind(h,["mouseenter","mouseleave"],function(a){this.cache.onTarget="mouseenter"===a.type}),this._bind(l,"mousemove",function(a){this.rendered&&this.cache.onTarget&&!this.tooltip.hasClass(ba)&&this.tooltip[0].offsetWidth>0&&this.reposition(a)})),(f.adjust.resize||k.length)&&this._bind(d.event.special.resize?k:m,"resize",q),f.adjust.scroll&&this._bind(m.add(f.container),"scroll",q)},A._unassignEvents=function(){var c=[this.options.show.target[0],this.options.hide.target[0],this.rendered&&this.tooltip[0],this.options.position.container[0],this.options.position.viewport[0],this.options.position.container.closest("html")[0],a,b];this._unbind(d([]).pushStack(d.grep(c,function(a){return"object"==typeof a})))},z=d.fn.qtip=function(a,b,e){var f=(""+a).toLowerCase(),g=G,i=d.makeArray(arguments).slice(1),j=i[i.length-1],k=this[0]?d.data(this[0],T):G;return!arguments.length&&k||"api"===f?k:"string"==typeof a?(this.each(function(){var a=d.data(this,T);if(!a)return E;if(j&&j.timeStamp&&(a.cache.event=j),!b||"option"!==f&&"options"!==f)a[f]&&a[f].apply(a,i);else{if(e===c&&!d.isPlainObject(b))return g=a.get(b),F;a.set(b,e)}}),g!==G?g:this):"object"!=typeof a&&arguments.length?void 0:(k=h(d.extend(E,{},a)),this.each(function(a){var b,c;return c=d.isArray(k.id)?k.id[a]:k.id,c=!c||c===F||c.length<1||z.api[c]?z.nextid++:c,b=s(d(this),c,k),b===F?E:(z.api[c]=b,d.each(S,function(){"initialize"===this.initialize&&this(b)}),void b._assignInitialEvents(j))}))},d.qtip=e,z.api={},d.each({attr:function(a,b){if(this.length){var c=this[0],e="title",f=d.data(c,"qtip");if(a===e&&f&&"object"==typeof f&&f.options.suppress)return arguments.length<2?d.attr(c,da):(f&&f.options.content.attr===e&&f.cache.attr&&f.set("content.text",b),this.attr(da,b))}return d.fn["attr"+ca].apply(this,arguments)},clone:function(a){var b=(d([]),d.fn["clone"+ca].apply(this,arguments));return a||b.filter("["+da+"]").attr("title",function(){return d.attr(this,da)}).removeAttr(da),b}},function(a,b){if(!b||d.fn[a+ca])return E;var c=d.fn[a+ca]=d.fn[a];d.fn[a]=function(){return b.apply(this,arguments)||c.apply(this,arguments)}}),d.ui||(d["cleanData"+ca]=d.cleanData,d.cleanData=function(a){for(var b,c=0;(b=d(a[c])).length;c++)if(b.attr(U))try{b.triggerHandler("removeqtip")}catch(e){}d["cleanData"+ca].apply(this,arguments)}),z.version="2.2.0",z.nextid=0,z.inactiveEvents=Y,z.zindex=15e3,z.defaults={prerender:F,id:F,overwrite:E,suppress:E,content:{text:E,attr:"title",title:F,button:F},position:{my:"top left",at:"bottom right",target:F,container:F,viewport:F,adjust:{x:0,y:0,mouse:E,scroll:E,resize:E,method:"flipinvert flipinvert"},effect:function(a,b){d(this).animate(b,{duration:200,queue:F})}},show:{target:F,event:"mouseenter",effect:E,delay:90,solo:F,ready:F,autofocus:F},hide:{target:F,event:"mouseleave",effect:E,delay:0,fixed:F,inactive:F,leave:"window",distance:F},style:{classes:"",widget:F,width:F,height:F,def:E},events:{render:G,move:G,show:G,hide:G,toggle:G,visible:G,hidden:G,focus:G,blur:G}};var ja,ka="margin",la="border",ma="color",na="background-color",oa="transparent",pa=" !important",qa=!!b.createElement("canvas").getContext,ra=/rgba?\(0, 0, 0(, 0)?\)|transparent|#123456/i,sa={},ta=["Webkit","O","Moz","ms"];if(qa)var ua=a.devicePixelRatio||1,va=function(){var a=b.createElement("canvas").getContext("2d");return a.backingStorePixelRatio||a.webkitBackingStorePixelRatio||a.mozBackingStorePixelRatio||a.msBackingStorePixelRatio||a.oBackingStorePixelRatio||1}(),wa=ua/va;else var xa=function(a,b,c){return"'};d.extend(w.prototype,{init:function(a){var b,c;c=this.element=a.elements.tip=d("
",{"class":T+"-tip"}).prependTo(a.tooltip),qa?(b=d("").appendTo(this.element)[0].getContext("2d"),b.lineJoin="miter",b.miterLimit=1e5,b.save()):(b=xa("shape",'coordorigin="0,0"',"position:absolute;"),this.element.html(b+b),a._bind(d("*",c).add(c),["click","mousedown"],function(a){a.stopPropagation()},this._ns)),a._bind(a.tooltip,"tooltipmove",this.reposition,this._ns,this),this.create()},_swapDimensions:function(){this.size[0]=this.options.height,this.size[1]=this.options.width},_resetDimensions:function(){this.size[0]=this.options.width,this.size[1]=this.options.height},_useTitle:function(a){var b=this.qtip.elements.titlebar;return b&&(a.y===L||a.y===P&&this.element.position().top+this.size[1]/2+this.options.offsetl&&!ra.test(e[1])&&(e[0]=e[1]),this.border=l=p.border!==E?p.border:l):this.border=l=0,k=this.size=this._calculateSize(b),n.css({width:k[0],height:k[1],lineHeight:k[1]+"px"}),j=b.precedance===I?[s(r.x===M?l:r.x===O?k[0]-q[0]-l:(k[0]-q[0])/2),s(r.y===L?k[1]-q[1]:0)]:[s(r.x===M?k[0]-q[0]:0),s(r.y===L?l:r.y===N?k[1]-q[1]-l:(k[1]-q[1])/2)],qa?(g=o[0].getContext("2d"),g.restore(),g.save(),g.clearRect(0,0,6e3,6e3),h=this._calculateTip(r,q,wa),i=this._calculateTip(r,this.size,wa),o.attr(J,k[0]*wa).attr(K,k[1]*wa),o.css(J,k[0]).css(K,k[1]),this._drawCoords(g,i),g.fillStyle=e[1],g.fill(),g.translate(j[0]*wa,j[1]*wa),this._drawCoords(g,h), +g.fillStyle=e[0],g.fill()):(h=this._calculateTip(r),h="m"+h[0]+","+h[1]+" l"+h[2]+","+h[3]+" "+h[4]+","+h[5]+" xe",j[2]=l&&/^(r|b)/i.test(b.string())?8===ea.ie?2:1:0,o.css({coordsize:k[0]+l+" "+(k[1]+l),antialias:""+(r.string().indexOf(P)>-1),left:j[0]-j[2]*Number(f===H),top:j[1]-j[2]*Number(f===I),width:k[0]+l,height:k[1]+l}).each(function(a){var b=d(this);b[b.prop?"prop":"attr"]({coordsize:k[0]+l+" "+(k[1]+l),path:h,fillcolor:e[0],filled:!!a,stroked:!a}).toggle(!(!l&&!a)),!a&&b.html(xa("stroke",'weight="'+2*l+'px" color="'+e[1]+'" miterlimit="1000" joinstyle="miter"'))})),a.opera&&setTimeout(function(){m.tip.css({display:"inline-block",visibility:"visible"})},1),c!==F&&this.calculate(b,k)},calculate:function(a,b){if(!this.enabled)return F;var c,e,f=this,g=this.qtip.elements,h=this.element,i=this.options.offset,j=(g.tooltip.hasClass("ui-widget"),{});return a=a||this.corner,c=a.precedance,b=b||this._calculateSize(a),e=[a.x,a.y],c===H&&e.reverse(),d.each(e,function(d,e){var h,k,l;e===P?(h=c===I?M:L,j[h]="50%",j[ka+"-"+h]=-Math.round(b[c===I?0:1]/2)+i):(h=f._parseWidth(a,e,g.tooltip),k=f._parseWidth(a,e,g.content),l=f._parseRadius(a),j[e]=Math.max(-f.border,d?k:i+(l>h?l:-h)))}),j[a[c]]-=b[c===H?0:1],h.css({margin:"",top:"",bottom:"",left:"",right:""}).css(j),j},reposition:function(a,b,d){function e(a,b,c,d,e){a===R&&j.precedance===b&&k[d]&&j[c]!==P?j.precedance=j.precedance===H?I:H:a!==R&&k[d]&&(j[b]=j[b]===P?k[d]>0?d:e:j[b]===d?e:d)}function f(a,b,e){j[a]===P?p[ka+"-"+b]=o[a]=g[ka+"-"+b]-k[b]:(h=g[e]!==c?[k[b],-g[b]]:[-k[b],g[b]],(o[a]=Math.max(h[0],h[1]))>h[0]&&(d[b]-=k[b],o[b]=F),p[g[e]!==c?e:b]=o[a])}if(this.enabled){var g,h,i=b.cache,j=this.corner.clone(),k=d.adjusted,l=b.options.position.adjust.method.split(" "),m=l[0],n=l[1]||l[0],o={left:F,top:F,x:0,y:0},p={};this.corner.fixed!==E&&(e(m,H,I,M,O),e(n,I,H,L,N),j.string()===i.corner.string()||i.cornerTop===k.top&&i.cornerLeft===k.left||this.update(j,F)),g=this.calculate(j),g.right!==c&&(g.left=-g.right),g.bottom!==c&&(g.top=-g.bottom),g.user=this.offset,(o.left=m===R&&!!k.left)&&f(H,M,O),(o.top=n===R&&!!k.top)&&f(I,L,N),this.element.css(p).toggle(!(o.x&&o.y||j.x===P&&o.y||j.y===P&&o.x)),d.left-=g.left.charAt?g.user:m!==R||o.top||!o.left&&!o.top?g.left+this.border:0,d.top-=g.top.charAt?g.user:n!==R||o.left||!o.left&&!o.top?g.top+this.border:0,i.cornerLeft=k.left,i.cornerTop=k.top,i.corner=j.clone()}},destroy:function(){this.qtip._unbind(this.qtip.tooltip,this._ns),this.qtip.elements.tip&&this.qtip.elements.tip.find("*").remove().end().remove()}}),ja=S.tip=function(a){return new w(a,a.options.style.tip)},ja.initialize="render",ja.sanitize=function(a){if(a.style&&"tip"in a.style){var b=a.style.tip;"object"!=typeof b&&(b=a.style.tip={corner:b}),/string|boolean/i.test(typeof b.corner)||(b.corner=E)}},C.tip={"^position.my|style.tip.(corner|mimic|border)$":function(){this.create(),this.qtip.reposition()},"^style.tip.(height|width)$":function(a){this.size=[a.width,a.height],this.update(),this.qtip.reposition()},"^content.title|style.(classes|widget)$":function(){this.update()}},d.extend(E,z.defaults,{style:{tip:{corner:E,mimic:F,width:6,height:6,border:E,offset:0}}});var ya,za,Aa="qtip-modal",Ba="."+Aa;za=function(){function a(a){if(d.expr[":"].focusable)return d.expr[":"].focusable;var b,c,e,f=!isNaN(d.attr(a,"tabindex")),g=a.nodeName&&a.nodeName.toLowerCase();return"area"===g?(b=a.parentNode,c=b.name,a.href&&c&&"map"===b.nodeName.toLowerCase()?(e=d("img[usemap=#"+c+"]")[0],!!e&&e.is(":visible")):!1):/input|select|textarea|button|object/.test(g)?!a.disabled:"a"===g?a.href||f:f}function c(a){k.length<1&&a.length?a.not("body").blur():k.first().focus()}function e(a){if(i.is(":visible")){var b,e=d(a.target),h=f.tooltip,j=e.closest(X);b=j.length<1?F:parseInt(j[0].style.zIndex,10)>parseInt(h[0].style.zIndex,10),b||e.closest(X)[0]===h[0]||c(e),g=a.target===k[k.length-1]}}var f,g,h,i,j=this,k={};d.extend(j,{init:function(){return i=j.elem=d("
",{id:"qtip-overlay",html:"
",mousedown:function(){return F}}).hide(),d(b.body).bind("focusin"+Ba,e),d(b).bind("keydown"+Ba,function(a){f&&f.options.show.modal.escape&&27===a.keyCode&&f.hide(a)}),i.bind("click"+Ba,function(a){f&&f.options.show.modal.blur&&f.hide(a)}),j},update:function(b){f=b,k=b.options.show.modal.stealfocus!==F?b.tooltip.find("*").filter(function(){return a(this)}):[]},toggle:function(a,e,g){var k=(d(b.body),a.tooltip),l=a.options.show.modal,m=l.effect,n=e?"show":"hide",o=i.is(":visible"),p=d(Ba).filter(":visible:not(:animated)").not(k);return j.update(a),e&&l.stealfocus!==F&&c(d(":focus")),i.toggleClass("blurs",l.blur),e&&i.appendTo(b.body),i.is(":animated")&&o===e&&h!==F||!e&&p.length?j:(i.stop(E,F),d.isFunction(m)?m.call(i,e):m===F?i[n]():i.fadeTo(parseInt(g,10)||90,e?1:0,function(){e||i.hide()}),e||i.queue(function(a){i.css({left:"",top:""}),d(Ba).length||i.detach(),a()}),h=e,f.destroyed&&(f=G),j)}}),j.init()},za=new za,d.extend(x.prototype,{init:function(a){var b=a.tooltip;return this.options.on?(a.elements.overlay=za.elem,b.addClass(Aa).css("z-index",z.modal_zindex+d(Ba).length),a._bind(b,["tooltipshow","tooltiphide"],function(a,c,e){var f=a.originalEvent;if(a.target===b[0])if(f&&"tooltiphide"===a.type&&/mouse(leave|enter)/.test(f.type)&&d(f.relatedTarget).closest(za.elem[0]).length)try{a.preventDefault()}catch(g){}else(!f||f&&"tooltipsolo"!==f.type)&&this.toggle(a,"tooltipshow"===a.type,e)},this._ns,this),a._bind(b,"tooltipfocus",function(a,c){if(!a.isDefaultPrevented()&&a.target===b[0]){var e=d(Ba),f=z.modal_zindex+e.length,g=parseInt(b[0].style.zIndex,10);za.elem[0].style.zIndex=f-1,e.each(function(){this.style.zIndex>g&&(this.style.zIndex-=1)}),e.filter("."+_).qtip("blur",a.originalEvent),b.addClass(_)[0].style.zIndex=f,za.update(c);try{a.preventDefault()}catch(h){}}},this._ns,this),void a._bind(b,"tooltiphide",function(a){a.target===b[0]&&d(Ba).filter(":visible").not(b).last().qtip("focus",a)},this._ns,this)):this},toggle:function(a,b,c){return a&&a.isDefaultPrevented()?this:void za.toggle(this.qtip,!!b,c)},destroy:function(){this.qtip.tooltip.removeClass(Aa),this.qtip._unbind(this.qtip.tooltip,this._ns),za.toggle(this.qtip,F),delete this.qtip.elements.overlay}}),ya=S.modal=function(a){return new x(a,a.options.show.modal)},ya.sanitize=function(a){a.show&&("object"!=typeof a.show.modal?a.show.modal={on:!!a.show.modal}:"undefined"==typeof a.show.modal.on&&(a.show.modal.on=E))},z.modal_zindex=z.zindex-200,ya.initialize="render",C.modal={"^show.modal.(on|blur)$":function(){this.destroy(),this.init(),this.qtip.elems.overlay.toggle(this.qtip.tooltip[0].offsetWidth>0)}},d.extend(E,z.defaults,{show:{modal:{on:F,effect:E,blur:E,stealfocus:E,escape:E}}}),S.viewport=function(c,d,e,f,g,h,i){function j(a,b,c,e,f,g,h,i,j){var k=d[f],m=v[a],t=w[a],u=c===R,x=m===f?j:m===g?-j:-j/2,y=t===f?i:t===g?-i:-i/2,z=r[f]+s[f]-(o?0:n[f]),A=z-k,B=k+j-(h===J?p:q)-z,C=x-(v.precedance===a||m===v[b]?y:0)-(t===P?i/2:0);return u?(C=(m===f?1:-1)*x,d[f]+=A>0?A:B>0?-B:0,d[f]=Math.max(-n[f]+s[f],k-C,Math.min(Math.max(-n[f]+s[f]+(h===J?p:q),k+C),d[f],"center"===m?k-x:1e9))):(e*=c===Q?2:0,A>0&&(m!==f||B>0)?(d[f]-=C+e,l.invert(a,f)):B>0&&(m!==g||A>0)&&(d[f]-=(m===P?-C:C)+e,l.invert(a,g)),d[f]B&&(d[f]=k,l=v.clone())),d[f]-k}var k,l,m,n,o,p,q,r,s,t=e.target,u=c.elements.tooltip,v=e.my,w=e.at,x=e.adjust,y=x.method.split(" "),z=y[0],A=y[1]||y[0],B=e.viewport,C=e.container,D=c.cache,E={left:0,top:0};return B.jquery&&t[0]!==a&&t[0]!==b.body&&"none"!==x.method?(n=C.offset()||E,o="static"===C.css("position"),k="fixed"===u.css("position"),p=B[0]===a?B.width():B.outerWidth(F),q=B[0]===a?B.height():B.outerHeight(F),r={left:k?0:B.scrollLeft(),top:k?0:B.scrollTop()},s=B.offset()||E,("shift"!==z||"shift"!==A)&&(l=v.clone()),E={left:"none"!==z?j(H,I,z,x.x,M,O,J,f,h):0,top:"none"!==A?j(I,H,A,x.y,L,N,K,g,i):0},l&&D.lastClass!==(m=T+"-pos-"+l.abbrev())&&u.removeClass(c.cache.lastClass).addClass(c.cache.lastClass=m),E):E},S.polys={polygon:function(a,b){var c,d,e,f={width:0,height:0,position:{top:1e10,right:0,bottom:0,left:1e10},adjustable:F},g=0,h=[],i=1,j=1,k=0,l=0;for(g=a.length;g--;)c=[parseInt(a[--g],10),parseInt(a[g+1],10)],c[0]>f.position.right&&(f.position.right=c[0]),c[0]f.position.bottom&&(f.position.bottom=c[1]),c[1]0&&e>0&&i>0&&j>0;)for(d=Math.floor(d/2),e=Math.floor(e/2),b.x===M?i=d:b.x===O?i=f.width-d:i+=Math.floor(d/2),b.y===L?j=e:b.y===N?j=f.height-e:j+=Math.floor(e/2),g=h.length;g--&&!(h.length<2);)k=h[g][0]-f.position.left,l=h[g][1]-f.position.top,(b.x===M&&k>=i||b.x===O&&i>=k||b.x===P&&(i>k||k>f.width-i)||b.y===L&&l>=j||b.y===N&&j>=l||b.y===P&&(j>l||l>f.height-j))&&h.splice(g,1);f.position={left:h[0][0],top:h[0][1]}}return f},rect:function(a,b,c,d){return{width:Math.abs(c-a),height:Math.abs(d-b),position:{left:Math.min(a,c),top:Math.min(b,d)}}},_angles:{tc:1.5,tr:7/4,tl:5/4,bc:.5,br:.25,bl:.75,rc:2,lc:1,c:0},ellipse:function(a,b,c,d,e){var f=S.polys._angles[e.abbrev()],g=0===f?0:c*Math.cos(f*Math.PI),h=d*Math.sin(f*Math.PI);return{width:2*c-Math.abs(g),height:2*d-Math.abs(h),position:{left:a+g,top:b+h},adjustable:F}},circle:function(a,b,c,d){return S.polys.ellipse(a,b,c,c,d)}},S.svg=function(a,c,e){for(var f,g,h,i,j,k,l,m,n,o,p,q=d(b),r=c[0],s=d(r.ownerSVGElement),t=1,u=1,v=!0;!r.getBBox;)r=r.parentNode;if(!r.getBBox||!r.parentNode)return F;f=s.attr("width")||s.width()||parseInt(s.css("width"),10),g=s.attr("height")||s.height()||parseInt(s.css("height"),10);var w=(parseInt(c.css("stroke-width"),10)||0)/2;switch(w&&(t+=w/f,u+=w/g),r.nodeName){case"ellipse":case"circle":o=S.polys.ellipse(r.cx.baseVal.value,r.cy.baseVal.value,(r.rx||r.r).baseVal.value+w,(r.ry||r.r).baseVal.value+w,e);break;case"line":case"polygon":case"polyline":for(n=r.points||[{x:r.x1.baseVal.value,y:r.y1.baseVal.value},{x:r.x2.baseVal.value,y:r.y2.baseVal.value}],o=[],m=-1,k=n.numberOfItems||n.length;++m';d.extend(y.prototype,{_scroll:function(){var b=this.qtip.elements.overlay;b&&(b[0].style.top=d(a).scrollTop()+"px")},init:function(c){var e=c.tooltip;d("select, object").length<1&&(this.bgiframe=c.elements.bgiframe=d(Da).appendTo(e),c._bind(e,"tooltipmove",this.adjustBGIFrame,this._ns,this)),this.redrawContainer=d("
",{id:T+"-rcontainer"}).appendTo(b.body),c.elements.overlay&&c.elements.overlay.addClass("qtipmodal-ie6fix")&&(c._bind(a,["scroll","resize"],this._scroll,this._ns,this),c._bind(e,["tooltipshow"],this._scroll,this._ns,this)),this.redraw()},adjustBGIFrame:function(){var a,b,c=this.qtip.tooltip,d={height:c.outerHeight(F),width:c.outerWidth(F)},e=this.qtip.plugins.tip,f=this.qtip.elements.tip;b=parseInt(c.css("borderLeftWidth"),10)||0,b={left:-b,top:-b},e&&f&&(a="x"===e.corner.precedance?[J,M]:[K,L],b[a[1]]-=f[a[0]]()),this.bgiframe.css(b).css(d)},redraw:function(){if(this.qtip.rendered<1||this.drawing)return this;var a,b,c,d,e=this.qtip.tooltip,f=this.qtip.options.style,g=this.qtip.options.position.container;return this.qtip.drawing=1,f.height&&e.css(K,f.height),f.width?e.css(J,f.width):(e.css(J,"").appendTo(this.redrawContainer),b=e.width(),1>b%2&&(b+=1),c=e.css("maxWidth")||"",d=e.css("minWidth")||"",a=(c+d).indexOf("%")>-1?g.width()/100:0,c=(c.indexOf("%")>-1?a:1)*parseInt(c,10)||b,d=(d.indexOf("%")>-1?a:1)*parseInt(d,10)||0,b=c+d?Math.min(Math.max(b,d),c):b,e.css(J,Math.round(b)).appendTo(g)),this.drawing=0,this},destroy:function(){this.bgiframe&&this.bgiframe.remove(),this.qtip._unbind([a,this.qtip.tooltip],this._ns)}}),Ca=S.ie6=function(a){return 6===ea.ie?new y(a):F},Ca.initialize="render",C.ie6={"^content|style$":function(){this.redraw()}}})}(window,document),function(a){a.fn.serializeForm=function(){if(this.length<1)return!1;var b={},c=b,d=':input[type!="checkbox"][type!="radio"], input:checked',e=function(){if(!this.disabled){var d=this.name.replace(/\[([^\]]+)?\]/g,",$1").split(","),e=d.length-1,f=a(this);if(d[0]){for(var g=0;e>g;g++)c=c[d[g]]=c[d[g]]||(""===d[g+1]||"0"===d[g+1]?[]:{});void 0!==c.length?c.push(f.val()):c[d[e]]=f.val(),c=b}}};return this.filter(d).each(e),this.find(d).each(e),b}}(jQuery),function(a){a.fn.typeWatch=function(b){function c(b,c){var d=a(b.el).val();(d.length>=f.captureLength&&d.toUpperCase()!=b.text||c&&d.length>=f.captureLength)&&(b.text=d.toUpperCase(),b.cb.call(b.el,d))}function d(b){var d=b.type.toUpperCase();if(a.inArray(d,f.inputTypes)>=0){var e={timer:null,text:a(b).val().toUpperCase(),cb:f.callback,el:b,wait:f.wait};f.highlight&&a(b).focus(function(){this.select()});var g=function(b){var d=e.wait,g=!1,h=this.type.toUpperCase();"undefined"!=typeof b.keyCode&&13==b.keyCode&&"TEXTAREA"!=h&&a.inArray(h,f.inputTypes)>=0&&(d=1,g=!0);var i=function(){c(e,g)};clearTimeout(e.timer),e.timer=setTimeout(i,d)};a(b).on("keydown paste cut input",g)}}var e=["TEXT","TEXTAREA","PASSWORD","TEL","SEARCH","URL","EMAIL","DATETIME","DATE","MONTH","WEEK","TIME","DATETIME-LOCAL","NUMBER","RANGE"],f=a.extend({wait:750,callback:function(){},highlight:!0,captureLength:2,inputTypes:e},b);return this.each(function(){d(this)})}}(jQuery),function(a){function b(){var a="!@#$%^&*()+=[]\\';,/{}|\":<>?~`.-_";return a+=" "}function c(){var a="¬€£¦";return a}function d(b,c,d){b.each(function(){var b=a(this);b.bind("keyup change paste",function(a){var e="";a.originalEvent&&a.originalEvent.clipboardData&&a.originalEvent.clipboardData.getData&&(e=a.originalEvent.clipboardData.getData("text/plain")),setTimeout(function(){h(b,c,d,e)},0)}),b.bind("keypress",function(a){var e=a.charCode?a.charCode:a.which;if(!(g(e)||a.ctrlKey||a.metaKey)){var f=String.fromCharCode(e),h=b.selection(),i=h.start,j=h.end,k=b.val(),l=k.substring(0,i)+f+k.substring(j),m=c(l,d);m!=l&&a.preventDefault()}})})}function e(b,c){var d=parseFloat(a(b).val()),e=a(b);return isNaN(d)?void e.val(""):(f(c.min)&&dc.max&&e.val("")))}function f(a){return!isNaN(a)}function g(a){return a>=32?!1:10==a?!1:13==a?!1:!0}function h(a,b,c,d){var e=a.val();""==e&&d.length>0&&(e=d);var f=b(e,c);if(e!=f){var g=a.alphanum_caret();a.val(f),a.alphanum_caret(e.length==f.length+1?g-1:g)}}function i(b,c){"undefined"==typeof c&&(c=D);var d,e={};return d="string"==typeof b?F[b]:"undefined"==typeof b?{}:b,a.extend(e,c,d),"undefined"==typeof e.blacklist&&(e.blacklistSet=x(e.allow,e.disallow)),e}function j(b){var c,d={};return c="string"==typeof b?G[b]:"undefined"==typeof b?{}:b,a.extend(d,E,c),d}function k(a,b,c){return c.maxLength&&a.length>=c.maxLength?!1:c.allow.indexOf(b)>=0?!0:c.allowSpace&&" "==b?!0:c.blacklistSet.contains(b)?!1:!c.allowNumeric&&K[b]?!1:!c.allowUpper&&u(b)?!1:!c.allowLower&&v(b)?!1:!c.allowCaseless&&w(b)?!1:!c.allowLatin&&L.contains(b)?!1:c.allowOtherCharSets?!0:K[b]||L.contains(b)?!0:!1}function l(a,b,c){if(K[b])return n(a,c)?!1:p(a,c)?!1:o(a,c)?!1:q(a+b,c)?!1:r(a+b,c)?!1:!0;if(c.allowPlus&&"+"==b&&""==a)return!0;if(c.allowMinus&&"-"==b&&""==a)return!0;if(b==I&&c.allowThouSep&&A(a,b))return!0;if(b==J){if(a.indexOf(J)>=0)return!1;if(c.allowDecSep)return!0}return!1}function m(a){return a+="",a.replace(/[^0-9]/g,"").length}function n(a,b){var c=b.maxDigits;if(""==c||isNaN(c))return!1;var d=m(a);return d>=c?!0:!1}function o(a,b){var c=b.maxDecimalPlaces;if(""==c||isNaN(c))return!1;var d=a.indexOf(J);if(-1==d)return!1;var e=a.substring(d),f=m(e);return f>=c?!0:!1}function p(a,b){var c=b.maxPreDecimalPlaces;if(""==c||isNaN(c))return!1;var d=a.indexOf(J);if(d>=0)return!1;var e=m(a);return e>=c?!0:!1}function q(a,b){if(!b.max||b.max<0)return!1;var c=parseFloat(a);return c>b.max?!0:!1}function r(a,b){if(!b.min||b.min>0)return!1;var c=parseFloat(a);return c=0)return!1;var c=a.indexOf(I);if(0>c)return!0;var d=a.lastIndexOf(I),e=a.length-d-1;if(3>e)return!1;var f=m(a.substring(c));return f%3>0?!1:!0}function B(a){this.map="string"==typeof a?C(a):{}}function C(a){var b,c={},d=a.split(""),e=0;for(e=0;e=0?d.toString().length:startPos+c.toString().length,{start:startPos,end:endPos}):null},d=function(d){var e=b(d);if(void 0!==d.selectionStart)return document.activeElement&&document.activeElement!=d&&d.selectionStart==d.selectionEnd&&0==d.selectionStart?{start:d.value.length,end:d.value.length}:{start:d.selectionStart,end:d.selectionEnd};if(e.getSelection)return c(d,e);try{if("input"==d.nodeName.toLowerCase()){var f=b(d).document.selection.createRange(),g=d.createTextRange();g.setEndPoint("EndToStart",f);var h=g.text.length;return{start:h,end:h+f.text.length}}var i=c(d,e);if(!i)return i;var j=a.Range.current().clone(),k=j.clone().collapse().range,l=j.clone().collapse(!1).range;return k.moveStart("character",-1),l.moveStart("character",-1),0!=i.startPos&&""==k.text&&(i.startPos+=2),0!=i.endPos&&""==l.text&&(i.endPos+=2),i}catch(m){return{start:d.value.length,end:d.value.length}}},e=function(a,c,d){var e=b(a);if(a.setSelectionRange)void 0===d?(a.focus(),a.setSelectionRange(c,c)):(a.select(),a.selectionStart=c,a.selectionEnd=d);else if(a.createTextRange){var f=a.createTextRange();f.moveStart("character",c),d=d||c,f.moveEnd("character",d-a.value.length),f.select()}else if(e.getSelection){var h=e.document,i=e.getSelection(),j=h.createRange(),k=[c,void 0!==d?d:c];g([a],k),j.setStart(k[0].el,k[0].count),j.setEnd(k[1].el,k[1].count),i.removeAllRanges(),i.addRange(j)}else if(e.document.body.createTextRange){var j=document.body.createTextRange();j.moveToElementText(a),j.collapse(),j.moveStart("character",c),j.moveEnd("character",void 0!==d?d:c),j.select()}},f=function(a,b,c,d){"number"==typeof c[0]&&c[0]?~`.-_'; + blacklist += " "; // 'Space' is on the blacklist but can be enabled using the 'allowSpace' config entry + return blacklist; + } + + // Return the blacklisted special chars that are NOT encodable using 7-bit ascii + // We want this .js file to be encoded using 7-bit ascii so it can reach the widest possible audience + // Higher order chars must be escaped eg "\xAC" + // Not too worried about comments containing higher order characters for now (let's wait and see if it becomes a problem) + function getBlacklistNonAscii(){ + var blacklist = + "\xAC" // � + + "\u20AC" // � + + "\xA3" // � + + "\xA6" // � + ; + return blacklist; + } + + // End Settings //////////////////////////////////////////////////////// + + + // Implementation details go here //////////////////////////////////////////////////////// + + function setupEventHandlers($textboxes, trimFunction, settings) { + + $textboxes.each(function(){ + + var $textbox = $(this); + + $textbox.bind("keyup change paste", function(e){ + + var pastedText = ""; + + if(e.originalEvent && e.originalEvent.clipboardData && e.originalEvent.clipboardData.getData) + pastedText = e.originalEvent.clipboardData.getData("text/plain") + + // setTimeout is necessary for handling the 'paste' event + setTimeout(function(){ + trimTextbox($textbox, trimFunction, settings, pastedText); + }, 0); + }); + + $textbox.bind("keypress", function(e){ + + // Determine which key is pressed. + // If it's a control key, then allow the event's default action to occur eg backspace, tab + var charCode = !e.charCode ? e.which : e.charCode; + if(isControlKey(charCode) + || e.ctrlKey + || e.metaKey ) // cmd on MacOS + return; + + var newChar = String.fromCharCode(charCode); + + // Determine if some text was selected / highlighted when the key was pressed + var selectionObject = $textbox.selection(); + var start = selectionObject.start; + var end = selectionObject.end; + + var textBeforeKeypress = $textbox.val(); + + // The new char may be inserted: + // 1) At the start + // 2) In the middle + // 3) At the end + // 4) User highlights some text and then presses a key which would replace the highlighted text + // + // Here we build the string that would result after the keypress. + // If the resulting string is invalid, we cancel the event. + // Unfortunately, it isn't enough to just check if the new char is valid because some chars + // are position sensitive eg the decimal point '.'' or the minus sign '-'' are only valid in certain positions. + var potentialTextAfterKeypress = textBeforeKeypress.substring(0, start) + newChar + textBeforeKeypress.substring(end); + var validatedText = trimFunction(potentialTextAfterKeypress, settings); + + // If the keypress would cause the textbox to contain invalid characters, then cancel the keypress event + if(validatedText != potentialTextAfterKeypress) + e.preventDefault(); + }); + }); + + } + + // Ensure the text is a valid number when focus leaves the textbox + // This catches the case where a user enters '-' or '.' without entering any digits + function numericField_Blur(inputBox, settings) { + var fieldValueNumeric = parseFloat($(inputBox).val()); + var $inputBox = $(inputBox); + + if(isNaN(fieldValueNumeric)) { + $inputBox.val(""); + return; + } + + if(isNumeric(settings.min) && fieldValueNumeric < settings.min) + $inputBox.val(""); + + if(isNumeric(settings.max) && fieldValueNumeric > settings.max) + $inputBox.val(""); + } + + function isNumeric(value) { + return !isNaN(value); + } + + function isControlKey(charCode) { + + if(charCode >= 32) + return false; + if(charCode == 10) + return false; + if(charCode == 13) + return false; + + return true; + } + + // One way to prevent a character being entered is to cancel the keypress event. + // However, this gets messy when you have to deal with things like copy paste which isn't a keypress. + // Which event gets fired first, keypress or keyup? What about IE6 etc etc? + // Instead, it's easier to allow the 'bad' character to be entered and then to delete it immediately after. + + function trimTextbox($textBox, trimFunction, settings, pastedText){ + + var inputString = $textBox.val(); + + if(inputString == "" && pastedText.length > 0) + inputString = pastedText; + + var outputString = trimFunction(inputString, settings); + + if(inputString == outputString) + return; + + var caretPos = $textBox.alphanum_caret(); + + $textBox.val(outputString); + + //Reset the caret position + if(inputString.length ==(outputString.length + 1)) + $textBox.alphanum_caret(caretPos - 1); + else + $textBox.alphanum_caret(caretPos); + } + + function getCombinedSettingsAlphaNum(settings, defaultSettings){ + if(typeof defaultSettings == "undefined") + defaultSettings = DEFAULT_SETTINGS_ALPHANUM; + var userSettings, combinedSettings = {}; + if(typeof settings === "string") + userSettings = CONVENIENCE_SETTINGS_ALPHANUM[settings]; + else if(typeof settings == "undefined") + userSettings = {}; + else + userSettings = settings; + + $.extend(combinedSettings, defaultSettings, userSettings); + + if(typeof combinedSettings.blacklist == 'undefined') + combinedSettings.blacklistSet = getBlacklistSet(combinedSettings.allow, combinedSettings.disallow); + + return combinedSettings; + } + + function getCombinedSettingsNum(settings){ + var userSettings, combinedSettings = {}; + if(typeof settings === "string") + userSettings = CONVENIENCE_SETTINGS_NUMERIC[settings]; + else if(typeof settings == "undefined") + userSettings = {}; + else + userSettings = settings; + + $.extend(combinedSettings, DEFAULT_SETTINGS_NUM, userSettings); + + return combinedSettings; + } + + + // This is the heart of the algorithm + function alphanum_allowChar(validatedStringFragment, Char, settings){ + + if(settings.maxLength && validatedStringFragment.length >= settings.maxLength) + return false; + + if(settings.allow.indexOf(Char) >=0 ) + return true; + + if(settings.allowSpace && (Char == " ")) + return true; + + if(settings.blacklistSet.contains(Char)) + return false; + + if(!settings.allowNumeric && DIGITS[Char]) + return false; + + if(!settings.allowUpper && isUpper(Char)) + return false; + + if(!settings.allowLower && isLower(Char)) + return false; + + if(!settings.allowCaseless && isCaseless(Char)) + return false; + + if(!settings.allowLatin && LATIN_CHARS.contains(Char)) + return false; + + if(!settings.allowOtherCharSets){ + if(DIGITS[Char] || LATIN_CHARS.contains(Char)) + return true; + else + return false; + } + + return true; + } + + function numeric_allowChar(validatedStringFragment, Char, settings){ + + if(DIGITS[Char]) { + + if(isMaxDigitsReached(validatedStringFragment, settings)) + return false; + + if(isMaxPreDecimalsReached(validatedStringFragment, settings)) + return false; + + if(isMaxDecimalsReached(validatedStringFragment, settings)) + return false; + + if(isGreaterThanMax(validatedStringFragment + Char, settings)) + return false; + + if(isLessThanMin(validatedStringFragment + Char, settings)) + return false; + + return true; + } + + if(settings.allowPlus && Char == '+' && validatedStringFragment == '') + return true; + + if(settings.allowMinus && Char == '-' && validatedStringFragment == '') + return true; + + if(Char == THOU_SEP && settings.allowThouSep && allowThouSep(validatedStringFragment, Char)) + return true; + + if(Char == DEC_SEP) { + // Only one decimal separator allowed + if(validatedStringFragment.indexOf(DEC_SEP) >= 0) + return false; + if(settings.allowDecSep) + return true; + } + + return false; + } + + function countDigits(string) { + + // Error handling, nulls etc + string = string + ""; + + // Count the digits + return string.replace(/[^0-9]/g,"").length; + } + + function isMaxDigitsReached(string, settings) { + + var maxDigits = settings.maxDigits; + + if(maxDigits == "" || isNaN(maxDigits)) + return false; // In this case, there is no maximum + + var numDigits = countDigits(string); + + if(numDigits >= maxDigits) + return true; + + return false; + } + + function isMaxDecimalsReached(string, settings) { + + var maxDecimalPlaces = settings.maxDecimalPlaces; + + if(maxDecimalPlaces == "" || isNaN(maxDecimalPlaces)) + return false; // In this case, there is no maximum + + var indexOfDecimalPoint = string.indexOf(DEC_SEP); + + if(indexOfDecimalPoint == -1) + return false; + + var decimalSubstring = string.substring(indexOfDecimalPoint); + var numDecimals = countDigits(decimalSubstring); + + if(numDecimals >= maxDecimalPlaces) + return true; + + return false; + } + + function isMaxPreDecimalsReached(string, settings) { + + var maxPreDecimalPlaces = settings.maxPreDecimalPlaces; + + if(maxPreDecimalPlaces == "" || isNaN(maxPreDecimalPlaces)) + return false; // In this case, there is no maximum + + var indexOfDecimalPoint = string.indexOf(DEC_SEP); + + if(indexOfDecimalPoint >= 0) + return false; + + var numPreDecimalDigits = countDigits(string); + + if(numPreDecimalDigits >= maxPreDecimalPlaces) + return true; + + return false; + } + + function isGreaterThanMax(numericString, settings) { + + if(!settings.max || settings.max < 0) + return false; + + var outputNumber = parseFloat(numericString); + if(outputNumber > settings.max) + return true; + + return false; + } + + function isLessThanMin(numericString, settings) { + + if(!settings.min || settings.min > 0) + return false; + + var outputNumber = parseFloat(numericString); + if(outputNumber < settings.min) + return true; + + return false; + } + + /******************************** + * Trims a string according to the settings provided + ********************************/ + function trimAlphaNum(inputString, settings){ + + if(typeof inputString != "string") + return inputString; + + var inChars = inputString.split(""); + var outChars = []; + var i = 0; + var Char; + + for(i=0; i= 0) + return false; + + var posOfFirstThouSep = currentString.indexOf(THOU_SEP); + + // Check if this is the first occurrence of a THOU_SEP + if(posOfFirstThouSep < 0) + return true; + + var posOfLastThouSep = currentString.lastIndexOf(THOU_SEP); + var charsSinceLastThouSep = currentString.length - posOfLastThouSep - 1; + + // Check if there has been 3 digits since the last THOU_SEP + if(charsSinceLastThouSep < 3) + return false; + + var digitsSinceFirstThouSep = countDigits(currentString.substring(posOfFirstThouSep)); + + // Check if there has been a multiple of 3 digits since the first THOU_SEP + if((digitsSinceFirstThouSep % 3) > 0) + return false; + + return true; + } + + //////////////////////////////////////////////////////////////////////////////////// + // Implementation of a Set + //////////////////////////////////////////////////////////////////////////////////// + function Set(elems){ + if(typeof elems == "string") + this.map = stringToMap(elems); + else + this.map = {}; + } + + Set.prototype.add = function(set){ + + var newSet = this.clone(); + + for(var key in set.map) + newSet.map[key] = true; + + return newSet; + } + + Set.prototype.subtract = function(set){ + + var newSet = this.clone(); + + for(var key in set.map) + delete newSet.map[key]; + + return newSet; + } + + Set.prototype.contains = function(key){ + if(this.map[key]) + return true; + else + return false; + } + + Set.prototype.clone = function(){ + var newSet = new Set(); + + for(var key in this.map) + newSet.map[key] = true; + + return newSet; + } + //////////////////////////////////////////////////////////////////////////////////// + + function stringToMap(string){ + var map = {}; + var array = string.split(""); + var i=0; + var Char; + + for(i=0; i=0){endPos=i.toString().length}else{endPos=startPos+r.toString().length}return{start:startPos,end:endPos}},s=function(t){var n=r(t);if(t.selectionStart!==undefined){if(document.activeElement&&document.activeElement!=t&&t.selectionStart==t.selectionEnd&&t.selectionStart==0){return{start:t.value.length,end:t.value.length}}return{start:t.selectionStart,end:t.selectionEnd}}else if(n.getSelection){return i(t,n)}else{try{if(t.nodeName.toLowerCase()=="input"){var s=r(t).document.selection.createRange(),o=t.createTextRange();o.setEndPoint("EndToStart",s);var u=o.text.length;return{start:u,end:u+s.text.length}}else{var a=i(t,n);if(!a){return a}var f=e.Range.current().clone(),l=f.clone().collapse().range,c=f.clone().collapse(false).range;l.moveStart("character",-1);c.moveStart("character",-1);if(a.startPos!=0&&l.text==""){a.startPos+=2}if(a.endPos!=0&&c.text==""){a.endPos+=2}return a}}catch(h){return{start:t.value.length,end:t.value.length}}}},o=function(e,t,n){var i=r(e);if(e.setSelectionRange){if(n===undefined){e.focus();e.setSelectionRange(t,t)}else{e.select();e.selectionStart=t;e.selectionEnd=n}}else if(e.createTextRange){var s=e.createTextRange();s.moveStart("character",t);n=n||t;s.moveEnd("character",n-e.value.length);s.select()}else if(i.getSelection){var o=i.document,u=i.getSelection(),f=o.createRange(),l=[t,n!==undefined?n:t];a([e],l);f.setStart(l[0].el,l[0].count);f.setEnd(l[1].el,l[1].count);u.removeAllRanges();u.addRange(f)}else if(i.document.body.createTextRange){var f=document.body.createTextRange();f.moveToElementText(e);f.collapse();f.moveStart("character",t);f.moveEnd("character",n!==undefined?n:t);f.select()}},u=function(e,t,n,r){if(typeof n[0]==="number"&&n[0]= options.captureLength AND text != saved text OR if override AND text >= options.captureLength + if ((value.length >= options.captureLength && value.toUpperCase() != timer.text) + || (override && value.length >= options.captureLength)) + { + timer.text = value.toUpperCase(); + timer.cb.call(timer.el, value); + } + }; + + function watchElement(elem) { + var elementType = elem.type.toUpperCase(); + if (jQuery.inArray(elementType, options.inputTypes) >= 0) { + + // Allocate timer element + var timer = { + timer: null, + text: jQuery(elem).val().toUpperCase(), + cb: options.callback, + el: elem, + wait: options.wait + }; + + // Set focus action (highlight) + if (options.highlight) { + jQuery(elem).focus( + function() { + this.select(); + }); + } + + // Key watcher / clear and reset the timer + var startWatch = function(evt) { + var timerWait = timer.wait; + var overrideBool = false; + var evtElementType = this.type.toUpperCase(); + + // If enter key is pressed and not a TEXTAREA and matched inputTypes + if (typeof evt.keyCode != 'undefined' && evt.keyCode == 13 && evtElementType != 'TEXTAREA' && jQuery.inArray(evtElementType, options.inputTypes) >= 0) { + timerWait = 1; + overrideBool = true; + } + + var timerCallbackFx = function() { + checkElement(timer, overrideBool) + } + + // Clear timer + clearTimeout(timer.timer); + timer.timer = setTimeout(timerCallbackFx, timerWait); + }; + + jQuery(elem).on('keydown paste cut input', startWatch); + } + }; + + // Watch Each Element + return this.each(function() { + watchElement(this); + }); + + }; +})(jQuery); \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/jsonview.js b/plugins/legacy-admin/framework/core/assets/js/vendor/jsonview.js new file mode 100644 index 000000000..1afe0271f --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/jsonview.js @@ -0,0 +1,265 @@ + +/* global console, jsonView */ +/* + * ViewJSON + * Version 1.0 + * A Google Chrome extension to display JSON in a user-friendly format + * + * This is a chromeified version of the JSONView Firefox extension by Ben Hollis: + * http://jsonview.com + * http://code.google.com/p/jsonview + * + * Also based on the XMLTree Chrome extension by Moonty & alan.stroop + * https://chrome.google.com/extensions/detail/gbammbheopgpmaagmckhpjbfgdfkpadb + * + * port by Jamie Wilkinson (@jamiew) | http://jamiedubs.com | http://github.com/jamiew + * MIT license / copyfree (f) F.A.T. Lab http://fffff.at + * Speed Project Approved: 2h + */ + +function collapse(evt) { + var collapser = evt.target; + var target = collapser.parentNode.getElementsByClassName('collapsible'); + if (!target.length) { + return; + } + target = target[0]; + if (target.style.display === 'none') { + var ellipsis = target.parentNode.getElementsByClassName('ellipsis')[0]; + target.parentNode.removeChild(ellipsis); + target.style.display = ''; + } else { + target.style.display = 'none'; + var ellipsis = document.createElement('span'); + ellipsis.className = 'ellipsis'; + ellipsis.innerHTML = ' … '; + target.parentNode.insertBefore(ellipsis, target); + } + collapser.innerHTML = (collapser.innerHTML === '-') ? '+' : '-'; +} + +function addCollapser(item) { + // This mainly filters out the root object (which shouldn't be collapsible) + if (item.nodeName !== 'LI') { + return; + } + var collapser = document.createElement('div'); + collapser.className = 'collapser'; + collapser.innerHTML = '-'; + collapser.addEventListener('click', collapse, false); + item.insertBefore(collapser, item.firstChild); +} + +function jsonView(id, target) { + this.debug = false; + if (id.indexOf("#") !== -1) { + this.idType = "id"; + this.id = id.replace('#', ''); + } else if (id.indexOf(".") !== -1) { + this.idType = "class"; + this.id = id.replace('.', ''); + } else { + if (this.debug) { console.log("Can't find that element"); } + return; + } + + this.data = document.getElementById(this.id).innerHTML; + if (typeof(target) !== undefined) { + if (target.indexOf("#") !== -1) { + this.targetType = "id"; + this.target = target.replace('#', ''); + } else if (id.indexOf(".") !== -1) { + this.targetType = "class"; + this.target = target.replace('.', ''); + } else { + if (this.debug) { console.log("Can't find the target element"); } + return; + } + } + // Note: now using "*.json*" URI matching rather than these page regexes -- save CPU cycles! + // var is_json = /^\s*(\{.*\})\s*$/.test(this.data); + // var is_jsonp = /^.*\(\s*(\{.*\})\s*\)$/.test(this.data); + // if(is_json || is_jsonp){ + // Our manifest specifies that we only do URLs matching '.json', so attempt to sanitize any HTML + // added by Chrome's "text/plain" or "text/html" handlers + if (/^\(.*)\<\/pre\>$/.test(this.data)) { + if (this.debug) { console.log("JSONView: data is wrapped in
...
, stripping HTML..."); } + this.data = this.data.replace(/<(?:.|\s)*?>/g, ''); //Aggressively strip HTML. + } + // Test if what remains is JSON or JSONp + var json_regex = /^\s*([\[\{].*[\}\]])\s*$/; // Ghetto, but it works + var jsonp_regex = /^[\s\u200B\uFEFF]*([\w$\[\]\.]+)[\s\u200B\uFEFF]*\([\s\u200B\uFEFF]*([\[{][\s\S]*[\]}])[\s\u200B\uFEFF]*\);?[\s\u200B\uFEFF]*$/; + var jsonp_regex2 = /([\[\{][\s\S]*[\]\}])\)/; // more liberal support... this allows us to pass the jsonp.json & jsonp2.json tests + var is_json = json_regex.test(this.data); + var is_jsonp = jsonp_regex.test(this.data); + if (this.debug) { console.log("JSONView: is_json=" + is_json + " is_jsonp=" + is_jsonp); } + if (is_json || is_jsonp) { + if (this.debug) { console.log("JSONView: sexytime!"); } + // JSONFormatter json->HTML prototype straight from Firefox JSONView + // For reference: http://code.google.com/p/jsonview + + function JSONFormatter() { + // No magic required. + } + JSONFormatter.prototype = { + htmlEncode: function(t) { + return t != null ? t.toString().replace(/&/g, "&").replace(/"/g, """).replace(//g, ">") : ''; + }, + decorateWithSpan: function(value, className) { + return '' + this.htmlEncode(value) + ''; + }, + // Convert a basic JSON datatype (number, string, boolean, null, object, array) into an HTML fragment. + valueToHTML: function(value) { + var valueType = typeof value; + var output = ""; + if (value === null) { + output += this.decorateWithSpan('null', 'null'); + } else if (value && value.constructor === Array) { + output += this.arrayToHTML(value); + } else if (valueType === 'object') { + output += this.objectToHTML(value); + } else if (valueType === 'number') { + output += this.decorateWithSpan(value, 'num'); + } else if (valueType === 'string') { + if (/^(http|https):\/\/[^\s]+$/.test(value)) { + output += '
' + this.htmlEncode(value) + ''; + } else { + output += this.decorateWithSpan('"' + value + '"', 'string'); + } + } else if (valueType === 'boolean') { + output += this.decorateWithSpan(value, 'bool'); + } + return output; + }, + // Convert an array into an HTML fragment + arrayToHTML: function(json) { + var output = '[
    '; + var hasContents = false; + for (var prop in json) { + hasContents = true; + output += '
  • '; + output += this.valueToHTML(json[prop]); + output += '
  • '; + } + output += '
]'; + if (!hasContents) { + output = "[ ]"; + } + return output; + }, + // Convert a JSON object to an HTML fragment + objectToHTML: function(json) { + var output = '{
    '; + var hasContents = false; + for (var prop in json) { + hasContents = true; + output += '
  • '; + output += '' + this.htmlEncode(prop) + ': '; + output += this.valueToHTML(json[prop]); + output += '
  • '; + } + output += '
}'; + if (!hasContents) { + output = "{ }"; + } + return output; + }, + // Convert a whole JSON object into a formatted HTML document. + jsonToHTML: function(json, callback, uri) { + var output = ''; + if (callback) { + output += '
' + callback + ' (
'; + output += '
'; + } else { + output += '
'; + } + output += this.valueToHTML(json); + output += '
'; + if (callback) { + output += '
)
'; + } + return this.toHTML(output, uri); + }, + // Produce an error document for when parsing fails. + errorPage: function(error, data, uri) { + // var output = '
' + this.stringbundle.GetStringFromName('errorParsing') + '
'; + // output += '

' + this.stringbundle.GetStringFromName('docContents') + ':

'; + var output = '
Error parsing JSON: ' + error.message + '
'; + output += '

' + error.stack + ':

'; + output += '
' + this.htmlEncode(data) + '
'; + return this.toHTML(output, uri + ' - Error'); + }, + // Wrap the HTML fragment in a full document. Used by jsonToHTML and errorPage. + toHTML: function(content) { + return content; + } + }; + // Sanitize & output -- all magic from JSONView Firefox + this.jsonFormatter = new JSONFormatter(); + // This regex attempts to match a JSONP structure: + // * Any amount of whitespace (including unicode nonbreaking spaces) between the start of the file and the callback name + // * Callback name (any valid JavaScript function name according to ECMA-262 Edition 3 spec) + // * Any amount of whitespace (including unicode nonbreaking spaces) + // * Open parentheses + // * Any amount of whitespace (including unicode nonbreaking spaces) + // * Either { or [, the only two valid characters to start a JSON string. + // * Any character, any number of times + // * Either } or ], the only two valid closing characters of a JSON string. + // * Any amount of whitespace (including unicode nonbreaking spaces) + // * A closing parenthesis, an optional semicolon, and any amount of whitespace (including unicode nonbreaking spaces) until the end of the file. + // This will miss anything that has comments, or more than one callback, or requires modification before use. + var outputDoc = ''; + // text = text.match(jsonp_regex)[1]; + var cleanData = '', + callback = ''; + var callback_results = jsonp_regex.exec(this.data); + if (callback_results && callback_results.length === 3) { + if (this.debug) { console.log("THIS IS JSONp"); } + callback = callback_results[1]; + cleanData = callback_results[2]; + } else { + if (this.debug) { console.log("Vanilla JSON"); } + cleanData = this.data; + } + if (this.debug) { console.log(cleanData); } + // Covert, and catch exceptions on failure + try { + // var jsonObj = this.nativeJSON.decode(cleanData); + var jsonObj = JSON.parse(cleanData); + if (jsonObj) { + outputDoc = this.jsonFormatter.jsonToHTML(jsonObj, callback); + } else { + throw "There was no object!"; + } + } catch (e) { + if (this.debug) { console.log(e); } + outputDoc = this.jsonFormatter.errorPage(e, this.data); + } + var links = ''; + if (this.targetType !== undefined) { + this.idType = this.targetType; + this.id = this.target; + } + var el; + if (this.idType === "class") { + el = document.getElementsByClassName(this.id); + if (el) { + el.className += el.className ? ' jsonViewOutput' : 'jsonViewOutput'; + el.innerHTML = links + outputDoc; + } + } else if (this.idType === "id") { + el = document.getElementById(this.id); + if (el) { + el.className += el.className ? ' jsonViewOutput' : 'jsonViewOutput'; + el.innerHTML = links + outputDoc; + } + el.innerHTML = links + outputDoc; + } + var items = document.getElementsByClassName('collapsible'); + for (var i = 0; i < items.length; i++) { + addCollapser(items[i].parentNode); + } + } else { + // console.log("JSONView: this is not json, not formatting."); + } +} \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/jsonview.min.js b/plugins/legacy-admin/framework/core/assets/js/vendor/jsonview.min.js new file mode 100644 index 000000000..b8c4f1bb5 --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/jsonview.min.js @@ -0,0 +1,16 @@ +/* global console, jsonView *//* + * ViewJSON + * Version 1.0 + * A Google Chrome extension to display JSON in a user-friendly format + * + * This is a chromeified version of the JSONView Firefox extension by Ben Hollis: + * http://jsonview.com + * http://code.google.com/p/jsonview + * + * Also based on the XMLTree Chrome extension by Moonty & alan.stroop + * https://chrome.google.com/extensions/detail/gbammbheopgpmaagmckhpjbfgdfkpadb + * + * port by Jamie Wilkinson (@jamiew) | http://jamiedubs.com | http://github.com/jamiew + * MIT license / copyfree (f) F.A.T. Lab http://fffff.at + * Speed Project Approved: 2h + */function collapse(e){var t=e.target,n=t.parentNode.getElementsByClassName("collapsible");if(!n.length)return;n=n[0];if(n.style.display==="none"){var r=n.parentNode.getElementsByClassName("ellipsis")[0];n.parentNode.removeChild(r),n.style.display=""}else{n.style.display="none";var r=document.createElement("span");r.className="ellipsis",r.innerHTML=" … ",n.parentNode.insertBefore(r,n)}t.innerHTML=t.innerHTML==="-"?"+":"-"}function addCollapser(e){if(e.nodeName!=="LI")return;var t=document.createElement("div");t.className="collapser",t.innerHTML="-",t.addEventListener("click",collapse,!1),e.insertBefore(t,e.firstChild)}function jsonView(e,t){this.debug=!1;if(e.indexOf("#")!==-1)this.idType="id",this.id=e.replace("#","");else{if(e.indexOf(".")===-1){this.debug&&console.log("Can't find that element");return}this.idType="class",this.id=e.replace(".","")}this.data=document.getElementById(this.id).innerHTML;if(typeof t!==undefined)if(t.indexOf("#")!==-1)this.targetType="id",this.target=t.replace("#","");else{if(e.indexOf(".")===-1){this.debug&&console.log("Can't find the target element");return}this.targetType="class",this.target=t.replace(".","")}/^\(.*)\<\/pre\>$/.test(this.data)&&(this.debug&&console.log("JSONView: data is wrapped in
...
, stripping HTML..."),this.data=this.data.replace(/<(?:.|\s)*?>/g,""));var n=/^\s*([\[\{].*[\}\]])\s*$/,r=/^[\s\u200B\uFEFF]*([\w$\[\]\.]+)[\s\u200B\uFEFF]*\([\s\u200B\uFEFF]*([\[{][\s\S]*[\]}])[\s\u200B\uFEFF]*\);?[\s\u200B\uFEFF]*$/,i=/([\[\{][\s\S]*[\]\}])\)/,s=n.test(this.data),o=r.test(this.data);this.debug&&console.log("JSONView: is_json="+s+" is_jsonp="+o);if(s||o){this.debug&&console.log("JSONView: sexytime!");function u(){}u.prototype={htmlEncode:function(e){return e!=null?e.toString().replace(/&/g,"&").replace(/"/g,""").replace(//g,">"):""},decorateWithSpan:function(e,t){return''+this.htmlEncode(e)+""},valueToHTML:function(e){var t=typeof e,n="";return e===null?n+=this.decorateWithSpan("null","null"):e&&e.constructor===Array?n+=this.arrayToHTML(e):t==="object"?n+=this.objectToHTML(e):t==="number"?n+=this.decorateWithSpan(e,"num"):t==="string"?/^(http|https):\/\/[^\s]+$/.test(e)?n+=''+this.htmlEncode(e)+"":n+=this.decorateWithSpan('"'+e+'"',"string"):t==="boolean"&&(n+=this.decorateWithSpan(e,"bool")),n},arrayToHTML:function(e){var t='[
    ',n=!1;for(var r in e)n=!0,t+="
  • ",t+=this.valueToHTML(e[r]),t+="
  • ";return t+="
]",n||(t="[ ]"),t},objectToHTML:function(e){var t='{
    ',n=!1;for(var r in e)n=!0,t+="
  • ",t+=''+this.htmlEncode(r)+": ",t+=this.valueToHTML(e[r]),t+="
  • ";return t+="
}",n||(t="{ }"),t},jsonToHTML:function(e,t,n){var r="";return t?(r+='
'+t+" (
",r+='
'):r+='
',r+=this.valueToHTML(e),r+="
",t&&(r+='
)
'),this.toHTML(r,n)},errorPage:function(e,t,n){var r='
Error parsing JSON: '+e.message+"
";return r+="

"+e.stack+":

",r+='
'+this.htmlEncode(t)+"
",this.toHTML(r,n+" - Error")},toHTML:function(e){return e}},this.jsonFormatter=new u;var a="",f="",l="",c=r.exec(this.data);c&&c.length===3?(this.debug&&console.log("THIS IS JSONp"),l=c[1],f=c[2]):(this.debug&&console.log("Vanilla JSON"),f=this.data),this.debug&&console.log(f);try{var h=JSON.parse(f);if(!h)throw"There was no object!";a=this.jsonFormatter.jsonToHTML(h,l)}catch(p){this.debug&&console.log(p),a=this.jsonFormatter.errorPage(p,this.data)}var d="";this.targetType!==undefined&&(this.idType=this.targetType,this.id=this.target);var v;this.idType==="class"?(v=document.getElementsByClassName(this.id),v&&(v.className+=v.className?" jsonViewOutput":"jsonViewOutput",v.innerHTML=d+a)):this.idType==="id"&&(v=document.getElementById(this.id),v&&(v.className+=v.className?" jsonViewOutput":"jsonViewOutput",v.innerHTML=d+a),v.innerHTML=d+a);var m=document.getElementsByClassName("collapsible");for(var g=0;g' + entity + '' + html; + } + var icons = { + 'icon-move' : '', + 'icon-music' : '', + 'icon-network' : '', + 'icon-off' : '', + 'icon-ok' : '', + 'icon-ok-circle' : '', + 'icon-ok-sign' : '', + 'icon-paper-clip' : '', + 'icon-paper-clip-alt' : '', + 'icon-path' : '', + 'icon-plus-sign' : '', + 'icon-print' : '', + 'icon-qrcode' : '', + 'icon-question' : '', + 'icon-question-sign' : '', + 'icon-quotes' : '', + 'icon-quotes-alt' : '', + 'icon-random' : '', + 'icon-record' : '', + 'icon-reddit' : '', + 'icon-refresh' : '', + 'icon-screenshot' : '', + 'icon-search' : '', + 'icon-search-alt' : '', + 'icon-share' : '', + 'icon-share-alt' : '', + 'icon-shopping-cart' : '', + 'icon-shopping-cart-sign' : '', + 'icon-signal' : '', + 'icon-skype' : '', + 'icon-slideshare' : '', + 'icon-smiley' : '', + 'icon-th-large' : '', + 'icon-th-list' : '', + 'icon-thumbs-down' : '', + 'icon-thumbs-up' : '', + 'icon-time' : '', + 'icon-time-alt' : '', + 'icon-tint' : '', + 'icon-torso' : '', + 'icon-trash' : '', + 'icon-trash-alt' : '', + 'icon-tumblr' : '', + 'icon-w3c' : '', + 'icon-warning-sign' : '', + 'icon-website' : '', + 'icon-website-alt' : '', + 'icon-wheelchair' : '', + 'icon-wordpress' : '', + 'icon-wrench' : '', + 'icon-wrench-alt' : '', + 'icon-youtube' : '', + 'icon-zoom-in' : '', + 'icon-zoom-out' : '', + 'icon-pause-alt' : '', + 'icon-pencil' : '', + 'icon-pencil-alt' : '', + 'icon-person' : '', + 'icon-phone' : '', + 'icon-phone-alt' : '', + 'icon-photo' : '', + 'icon-photo-alt' : '', + 'icon-picasa' : '', + 'icon-picture' : '', + 'icon-pinterest' : '', + 'icon-plane' : '', + 'icon-play-alt' : '', + 'icon-play-circle' : '', + 'icon-plus' : '', + 'icon-remove' : '', + 'icon-remove-circle' : '', + 'icon-remove-sign' : '', + 'icon-repeat' : '', + 'icon-repeat-alt' : '', + 'icon-resize-full' : '', + 'icon-resize-horizontal' : '', + 'icon-resize-small' : '', + 'icon-resize-vertical' : '', + 'icon-retweet' : '', + 'icon-reverse-alt' : '', + 'icon-road' : '', + 'icon-rss' : '', + 'icon-screen' : '', + 'icon-screen-alt' : '', + 'icon-smiley-alt' : '', + 'icon-speaker' : '', + 'icon-stackoverflow' : '', + 'icon-star' : '', + 'icon-star-alt' : '', + 'icon-star-empty' : '', + 'icon-stop-alt' : '', + 'icon-stumbleupon' : '', + 'icon-tag' : '', + 'icon-tags' : '', + 'icon-tasks' : '', + 'icon-text-height' : '', + 'icon-text-width' : '', + 'icon-th' : '', + 'icon-twitter' : '', + 'icon-universal-access' : '', + 'icon-unlock' : '', + 'icon-unlock-alt' : '', + 'icon-upload' : '', + 'icon-user' : '', + 'icon-video' : '', + 'icon-video-alt' : '', + 'icon-video-chat' : '', + 'icon-view-mode' : '', + 'icon-vimeo' : '', + 'icon-vkontakte' : '', + 'icon-volume-down' : '', + 'icon-volume-off' : '', + 'icon-volume-up' : '', + 'icon-backward' : '', + 'icon-fast-backward' : '', + 'icon-fast-forward' : '', + 'icon-forward' : '', + 'icon-play' : '', + 'icon-step-backward' : '', + 'icon-step-forward' : '', + 'icon-briefcase' : '', + 'icon-bullhorn' : '', + 'icon-calendar' : '', + 'icon-calendar-sign' : '', + 'icon-address-book' : '', + 'icon-address-book-alt' : '', + 'icon-adjust' : '', + 'icon-adult' : '', + 'icon-align-center' : '', + 'icon-align-justify' : '', + 'icon-align-left' : '', + 'icon-align-right' : '', + 'icon-arrow-down' : '', + 'icon-arrow-left' : '', + 'icon-arrow-right' : '', + 'icon-arrow-up' : '', + 'icon-asl' : '', + 'icon-asterisk' : '', + 'icon-ban-circle' : '', + 'icon-barcode' : '', + 'icon-behance' : '', + 'icon-bell' : '', + 'icon-blind' : '', + 'icon-blogger' : '', + 'icon-bold' : '', + 'icon-book' : '', + 'icon-bookmark' : '', + 'icon-bookmark-empty' : '', + 'icon-braille' : '', + 'icon-camera' : '', + 'icon-cc' : '', + 'icon-certificate' : '', + 'icon-check' : '', + 'icon-check-empty' : '', + 'icon-chevron-down' : '', + 'icon-chevron-left' : '', + 'icon-chevron-right' : '', + 'icon-chevron-up' : '', + 'icon-child' : '', + 'icon-circle-arrow-down' : '', + 'icon-circle-arrow-left' : '', + 'icon-circle-arrow-right' : '', + 'icon-circle-arrow-up' : '', + 'icon-cloud' : '', + 'icon-cloud-alt' : '', + 'icon-cog' : '', + 'icon-cog-alt' : '', + 'icon-cogs' : '', + 'icon-comment' : '', + 'icon-comment-alt' : '', + 'icon-compass' : '', + 'icon-compass-alt' : '', + 'icon-credit-card' : '', + 'icon-css' : '', + 'icon-dashboard' : '', + 'icon-delicious' : '', + 'icon-deviantart' : '', + 'icon-digg' : '', + 'icon-download' : '', + 'icon-download-alt' : '', + 'icon-dribble' : '', + 'icon-edit' : '', + 'icon-eject' : '', + 'icon-envelope' : '', + 'icon-envelope-alt' : '', + 'icon-error' : '', + 'icon-error-alt' : '', + 'icon-exclamation-sign' : '', + 'icon-eye-close' : '', + 'icon-eye-open' : '', + 'icon-facebook' : '', + 'icon-facetime-video' : '', + 'icon-female' : '', + 'icon-file' : '', + 'icon-file-alt' : '', + 'icon-file-edit' : '', + 'icon-file-edit-alt' : '', + 'icon-file-new' : '', + 'icon-file-new-alt' : '', + 'icon-film' : '', + 'icon-filter' : '', + 'icon-fire' : '', + 'icon-flag' : '', + 'icon-flag-alt' : '', + 'icon-flickr' : '', + 'icon-folder' : '', + 'icon-folder-close' : '', + 'icon-folder-open' : '', + 'icon-folder-sign' : '', + 'icon-font' : '', + 'icon-fontsize' : '', + 'icon-forward-alt' : '', + 'icon-foursquare' : '', + 'icon-friendfeed' : '', + 'icon-friendfeed-rect' : '', + 'icon-fullscreen' : '', + 'icon-gift' : '', + 'icon-github' : '', + 'icon-github-text' : '', + 'icon-glass' : '', + 'icon-glasses' : '', + 'icon-globe' : '', + 'icon-globe-alt' : '', + 'icon-googleplus' : '', + 'icon-graph' : '', + 'icon-graph-alt' : '', + 'icon-group' : '', + 'icon-group-alt' : '', + 'icon-guidedog' : '', + 'icon-hand-down' : '', + 'icon-hand-left' : '', + 'icon-hand-right' : '', + 'icon-hand-up' : '', + 'icon-hdd' : '', + 'icon-headphones' : '', + 'icon-hearing-impaired' : '', + 'icon-heart' : '', + 'icon-heart-alt' : '', + 'icon-heart-empty' : '', + 'icon-home' : '', + 'icon-home-alt' : '', + 'icon-idea' : '', + 'icon-idea-alt' : '', + 'icon-inbox' : '', + 'icon-inbox-alt' : '', + 'icon-inbox-box' : '', + 'icon-indent-left' : '', + 'icon-indent-right' : '', + 'icon-info-sign' : '', + 'icon-instagram' : '', + 'icon-iphone-home' : '', + 'icon-italic' : '', + 'icon-key' : '', + 'icon-laptop' : '', + 'icon-laptop-alt' : '', + 'icon-leaf' : '', + 'icon-linkedin' : '', + 'icon-list' : '', + 'icon-list-alt' : '', + 'icon-lock' : '', + 'icon-lock-alt' : '', + 'icon-magnet' : '', + 'icon-male' : '', + 'icon-map-marker' : '', + 'icon-map-marker-alt' : '', + 'icon-mic' : '', + 'icon-mic-alt' : '', + 'icon-minus' : '', + 'icon-minus-sign' : '', + 'icon-pause' : '', + 'icon-fork' : '', + 'icon-broom' : '', + 'icon-return-key' : '', + 'icon-lastfm' : '', + 'icon-livejournal' : '', + 'icon-myspace' : '', + 'icon-soundcloud' : '', + 'icon-viadeo' : '', + 'icon-spotify' : '', + 'icon-caret-left' : '', + 'icon-caret-up' : '', + 'icon-caret-right' : '', + 'icon-caret-down' : '', + 'icon-stop' : '' + }, + els = document.getElementsByTagName('*'), + i, attr, html, c, el; + for (i = 0; ; i += 1) { + el = els[i]; + if(!el) { + break; + } + attr = el.getAttribute('data-icon'); + if (attr) { + addIcon(el, attr); + } + c = el.className; + c = c.match(/icon-[^\s'"]+/); + if (c && icons[c[0]]) { + addIcon(el, icons[c[0]]); + } + } +}; \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/qtip/jquery.qtip.js b/plugins/legacy-admin/framework/core/assets/js/vendor/qtip/jquery.qtip.js new file mode 100644 index 000000000..dfec8b8e3 --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/qtip/jquery.qtip.js @@ -0,0 +1,3951 @@ +/* + * qTip2 - Pretty powerful tooltips - v2.2.0 + * http://qtip2.com + * + * Copyright (c) 2013 Craig Michael Thompson + * Released under the MIT, GPL licenses + * http://jquery.org/license + * + * Date: Thu Nov 21 2013 08:34 GMT+0000 + * Plugins: tips modal viewport svg imagemap ie6 + * Styles: basic css3 + */ +/*global window: false, jQuery: false, console: false, define: false */ + +if ( typeof jQuery.qtip === 'undefined' ) { + /* Cache window, document, undefined */ + (function( window, document, undefined ) { + + // Uses AMD or browser globals to create a jQuery plugin. + (function( factory ) { + "use strict"; + if ( typeof define === 'function' && define.amd ) { + define( ['jquery'], factory ); + } + else if ( jQuery && !jQuery.fn.qtip ) { + factory( jQuery ); + } + } + ( + function( $ ) { + "use strict"; // Enable ECMAScript "strict" operation for this function. See more: http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/ + + ;// Munge the primitives - Paul Irish tip + var TRUE = true, + FALSE = false, + NULL = null, + + // Common variables + X = 'x', Y = 'y', + WIDTH = 'width', + HEIGHT = 'height', + + // Positioning sides + TOP = 'top', + LEFT = 'left', + BOTTOM = 'bottom', + RIGHT = 'right', + CENTER = 'center', + + // Position adjustment types + FLIP = 'flip', + FLIPINVERT = 'flipinvert', + SHIFT = 'shift', + + // Shortcut vars + QTIP, PROTOTYPE, CORNER, CHECKS, + PLUGINS = {}, + NAMESPACE = 'qtip', + ATTR_HAS = 'data-hasqtip', + ATTR_ID = 'data-qtip-id', + WIDGET = ['ui-widget', 'ui-tooltip'], + SELECTOR = '.' + NAMESPACE, + INACTIVE_EVENTS = 'click dblclick mousedown mouseup mousemove mouseleave mouseenter'.split( ' ' ), + + CLASS_FIXED = NAMESPACE + '-fixed', + CLASS_DEFAULT = NAMESPACE + '-default', + CLASS_FOCUS = NAMESPACE + '-focus', + CLASS_HOVER = NAMESPACE + '-hover', + CLASS_DISABLED = NAMESPACE + '-disabled', + + replaceSuffix = '_replacedByqTip', + oldtitle = 'oldtitle', + trackingBound, + + // Browser detection + BROWSER = { + /* + * IE version detection + * + * Adapted from: http://ajaxian.com/archives/attack-of-the-ie-conditional-comment + * Credit to James Padolsey for the original implemntation! + */ + ie: (function() { + var v = 3, div = document.createElement( 'div' ); + while ( (div.innerHTML = '') ) { + if ( !div.getElementsByTagName( 'i' )[0] ) { + break; + } + } + return v > 4 ? v : NaN; + }()), + + /* + * iOS version detection + */ + iOS: parseFloat( + ('' + (/CPU.*OS ([0-9_]{1,5})|(CPU like).*AppleWebKit.*Mobile/i.exec( navigator.userAgent ) || [0, ''])[1]) + .replace( 'undefined', '3_2' ).replace( '_', '.' ).replace( '_', '' ) + ) || FALSE + }; + + ; + function QTip( target, options, id, attr ) { + // Elements and ID + this.id = id; + this.target = target; + this.tooltip = NULL; + this.elements = {target: target}; + + // Internal constructs + this._id = NAMESPACE + '-' + id; + this.timers = {img: {}}; + this.options = options; + this.plugins = {}; + + // Cache object + this.cache = { + event: {}, + target: $(), + disabled: FALSE, + attr: attr, + onTooltip: FALSE, + lastClass: '' + }; + + // Set the initial flags + this.rendered = this.destroyed = this.disabled = this.waiting = + this.hiddenDuringWait = this.positioning = this.triggering = FALSE; + } + + PROTOTYPE = QTip.prototype; + + PROTOTYPE._when = function( deferreds ) { + return $.when.apply( $, deferreds ); + }; + + PROTOTYPE.render = function( show ) { + if ( this.rendered || this.destroyed ) { + return this; + } // If tooltip has already been rendered, exit + + var self = this, + options = this.options, + cache = this.cache, + elements = this.elements, + text = options.content.text, + title = options.content.title, + button = options.content.button, + posOptions = options.position, + namespace = '.' + this._id + ' ', + deferreds = [], + tooltip; + + // Add ARIA attributes to target + $.attr( this.target[0], 'aria-describedby', this._id ); + + // Create tooltip element + this.tooltip = elements.tooltip = tooltip = $( + '
', { + 'id': this._id, + 'class': [NAMESPACE, CLASS_DEFAULT, options.style.classes, NAMESPACE + '-pos-' + options.position.my.abbrev()].join( ' ' ), + 'width': options.style.width || '', + 'height': options.style.height || '', + 'tracking': posOptions.target === 'mouse' && posOptions.adjust.mouse, + + /* ARIA specific attributes */ + 'role': 'alert', + 'aria-live': 'polite', + 'aria-atomic': FALSE, + 'aria-describedby': this._id + '-content', + 'aria-hidden': TRUE + } + ) + .toggleClass( CLASS_DISABLED, this.disabled ) + .attr( ATTR_ID, this.id ) + .data( NAMESPACE, this ) + .appendTo( posOptions.container ) + .append( + // Create content element + elements.content = $( + '
', { + 'class': NAMESPACE + '-content', + 'id': this._id + '-content', + 'aria-atomic': TRUE + } + ) + ); + + // Set rendered flag and prevent redundant reposition calls for now + this.rendered = -1; + this.positioning = TRUE; + + // Create title... + if ( title ) { + + this._createTitle(); + + // Update title only if its not a callback (called in toggle if so) + if ( !$.isFunction( title ) ) { + deferreds.push( this._updateTitle( title, FALSE ) ); + } + } + + // Create button + if ( button ) { + this._createButton(); + } + + // Set proper rendered flag and update content if not a callback function (called in toggle) + if ( !$.isFunction( text ) ) { + deferreds.push( this._updateContent( text, FALSE ) ); + } + this.rendered = TRUE; + + // Setup widget classes + this._setWidget(); + + // Initialize 'render' plugins + $.each( + PLUGINS, function( name ) { + var instance; + if ( this.initialize === 'render' && (instance = this( self )) ) { + self.plugins[name] = instance; + } + } + ); + + // Unassign initial events and assign proper events + this._unassignEvents(); + this._assignEvents(); + + // When deferreds have completed + this._when( deferreds ).then( + function() { + // tooltiprender event + self._trigger( 'render' ); + + // Reset flags + self.positioning = FALSE; + + // Show tooltip if not hidden during wait period + if ( !self.hiddenDuringWait && (options.show.ready || show) ) { + self.toggle( TRUE, cache.event, FALSE ); + } + self.hiddenDuringWait = FALSE; + } + ); + + // Expose API + QTIP.api[this.id] = this; + + return this; + }; + + PROTOTYPE.destroy = function( immediate ) { + // Set flag the signify destroy is taking place to plugins + // and ensure it only gets destroyed once! + if ( this.destroyed ) { + return this.target; + } + + function process() { + if ( this.destroyed ) { + return; + } + this.destroyed = TRUE; + + var target = this.target, + title = target.attr( oldtitle ); + + // Destroy tooltip if rendered + if ( this.rendered ) { + this.tooltip.stop( 1, 0 ).find( '*' ).remove().end().remove(); + } + + // Destroy all plugins + $.each( + this.plugins, function( name ) { + this.destroy && this.destroy(); + } + ); + + // Clear timers and remove bound events + clearTimeout( this.timers.show ); + clearTimeout( this.timers.hide ); + this._unassignEvents(); + + // Remove api object and ARIA attributes + target.removeData( NAMESPACE ) + .removeAttr( ATTR_ID ) + .removeAttr( ATTR_HAS ) + .removeAttr( 'aria-describedby' ); + + // Reset old title attribute if removed + if ( this.options.suppress && title ) { + target.attr( 'title', title ).removeAttr( oldtitle ); + } + + // Remove qTip events associated with this API + this._unbind( target ); + + // Remove ID from used id objects, and delete object references + // for better garbage collection and leak protection + this.options = this.elements = this.cache = this.timers = + this.plugins = this.mouse = NULL; + + // Delete epoxsed API object + delete QTIP.api[this.id]; + } + + // If an immediate destory is needed + if ( (immediate !== TRUE || this.triggering === 'hide') && this.rendered ) { + this.tooltip.one( 'tooltiphidden', $.proxy( process, this ) ); + !this.triggering && this.hide(); + } + + // If we're not in the process of hiding... process + else { + process.call( this ); + } + + return this.target; + }; + + ; + function invalidOpt( a ) { + return a === NULL || $.type( a ) !== 'object'; + } + + function invalidContent( c ) { + return !( $.isFunction( c ) || (c && c.attr) || c.length || ($.type( c ) === 'object' && (c.jquery || c.then) )); + } + + // Option object sanitizer + function sanitizeOptions( opts ) { + var content, text, ajax, once; + + if ( invalidOpt( opts ) ) { + return FALSE; + } + + if ( invalidOpt( opts.metadata ) ) { + opts.metadata = {type: opts.metadata}; + } + + if ( 'content' in opts ) { + content = opts.content; + + if ( invalidOpt( content ) || content.jquery || content.done ) { + content = opts.content = { + text: (text = invalidContent( content ) ? FALSE : content) + }; + } + else { + text = content.text; + } + + // DEPRECATED - Old content.ajax plugin functionality + // Converts it into the proper Deferred syntax + if ( 'ajax' in content ) { + ajax = content.ajax; + once = ajax && ajax.once !== FALSE; + delete content.ajax; + + content.text = function( event, api ) { + var loading = text || $( this ).attr( api.options.content.attr ) || 'Loading...', + + deferred = $.ajax( + $.extend( {}, ajax, {context: api} ) + ) + .then( ajax.success, NULL, ajax.error ) + .then( + function( content ) { + if ( content && once ) { + api.set( 'content.text', content ); + } + return content; + }, + function( xhr, status, error ) { + if ( api.destroyed || xhr.status === 0 ) { + return; + } + api.set( 'content.text', status + ': ' + error ); + } + ); + + return !once ? (api.set( 'content.text', loading ), deferred) : loading; + }; + } + + if ( 'title' in content ) { + if ( !invalidOpt( content.title ) ) { + content.button = content.title.button; + content.title = content.title.text; + } + + if ( invalidContent( content.title || FALSE ) ) { + content.title = FALSE; + } + } + } + + if ( 'position' in opts && invalidOpt( opts.position ) ) { + opts.position = {my: opts.position, at: opts.position}; + } + + if ( 'show' in opts && invalidOpt( opts.show ) ) { + opts.show = opts.show.jquery ? {target: opts.show} : + opts.show === TRUE ? {ready: TRUE} : {event: opts.show}; + } + + if ( 'hide' in opts && invalidOpt( opts.hide ) ) { + opts.hide = opts.hide.jquery ? {target: opts.hide} : {event: opts.hide}; + } + + if ( 'style' in opts && invalidOpt( opts.style ) ) { + opts.style = {classes: opts.style}; + } + + // Sanitize plugin options + $.each( + PLUGINS, function() { + this.sanitize && this.sanitize( opts ); + } + ); + + return opts; + } + + // Setup builtin .set() option checks + CHECKS = PROTOTYPE.checks = { + builtin: { + // Core checks + '^id$': function( obj, o, v, prev ) { + var id = v === TRUE ? QTIP.nextid : v, + new_id = NAMESPACE + '-' + id; + + if ( id !== FALSE && id.length > 0 && !$( '#' + new_id ).length ) { + this._id = new_id; + + if ( this.rendered ) { + this.tooltip[0].id = this._id; + this.elements.content[0].id = this._id + '-content'; + this.elements.title[0].id = this._id + '-title'; + } + } + else { + obj[o] = prev; + } + }, + '^prerender': function( obj, o, v ) { + v && !this.rendered && this.render( this.options.show.ready ); + }, + + // Content checks + '^content.text$': function( obj, o, v ) { + this._updateContent( v ); + }, + '^content.attr$': function( obj, o, v, prev ) { + if ( this.options.content.text === this.target.attr( prev ) ) { + this._updateContent( this.target.attr( v ) ); + } + }, + '^content.title$': function( obj, o, v ) { + + // Remove title if content is null + if ( !v ) { + return this._removeTitle(); + } + + // If title isn't already created, create it now and update + v && !this.elements.title && this._createTitle(); + this._updateTitle( v ); + }, + '^content.button$': function( obj, o, v ) { + this._updateButton( v ); + }, + '^content.title.(text|button)$': function( obj, o, v ) { + this.set( 'content.' + o, v ); // Backwards title.text/button compat + }, + + // Position checks + '^position.(my|at)$': function( obj, o, v ) { + 'string' === typeof v && (obj[o] = new CORNER( v, o === 'at' )); + }, + '^position.container$': function( obj, o, v ) { + this.rendered && this.tooltip.appendTo( v ); + }, + + // Show checks + '^show.ready$': function( obj, o, v ) { + v && (!this.rendered && this.render( TRUE ) || this.toggle( TRUE )); + }, + + // Style checks + '^style.classes$': function( obj, o, v, p ) { + this.rendered && this.tooltip.removeClass( p ).addClass( v ); + }, + '^style.(width|height)': function( obj, o, v ) { + this.rendered && this.tooltip.css( o, v ); + }, + '^style.widget|content.title': function() { + this.rendered && this._setWidget(); + }, + '^style.def': function( obj, o, v ) { + this.rendered && this.tooltip.toggleClass( CLASS_DEFAULT, !!v ); + }, + + // Events check + '^events.(render|show|move|hide|focus|blur)$': function( obj, o, v ) { + this.rendered && this.tooltip[($.isFunction( v ) ? '' : 'un') + 'bind']( 'tooltip' + o, v ); + }, + + // Properties which require event reassignment + '^(show|hide|position).(event|target|fixed|inactive|leave|distance|viewport|adjust)': function() { + if ( !this.rendered ) { + return; + } + + // Set tracking flag + var posOptions = this.options.position; + this.tooltip.attr( 'tracking', posOptions.target === 'mouse' && posOptions.adjust.mouse ); + + // Reassign events + this._unassignEvents(); + this._assignEvents(); + } + } + }; + + // Dot notation converter + function convertNotation( options, notation ) { + var i = 0, obj, option = options, + + // Split notation into array + levels = notation.split( '.' ); + + // Loop through + while ( option = option[levels[i++]] ) { + if ( i < levels.length ) { + obj = option; + } + } + + return [obj || options, levels.pop()]; + } + + PROTOTYPE.get = function( notation ) { + if ( this.destroyed ) { + return this; + } + + var o = convertNotation( this.options, notation.toLowerCase() ), + result = o[0][o[1]]; + + return result.precedance ? result.string() : result; + }; + + function setCallback( notation, args ) { + var category, rule, match; + + for ( category in this.checks ) { + for ( rule in this.checks[category] ) { + if ( match = (new RegExp( rule, 'i' )).exec( notation ) ) { + args.push( match ); + + if ( category === 'builtin' || this.plugins[category] ) { + this.checks[category][rule].apply( + this.plugins[category] || this, args + ); + } + } + } + } + } + + var rmove = /^position\.(my|at|adjust|target|container|viewport)|style|content|show\.ready/i, + rrender = /^prerender|show\.ready/i; + + PROTOTYPE.set = function( option, value ) { + if ( this.destroyed ) { + return this; + } + + var rendered = this.rendered, + reposition = FALSE, + options = this.options, + checks = this.checks, + name; + + // Convert singular option/value pair into object form + if ( 'string' === typeof option ) { + name = option; + option = {}; + option[name] = value; + } + else { + option = $.extend( {}, option ); + } + + // Set all of the defined options to their new values + $.each( + option, function( notation, value ) { + if ( rendered && rrender.test( notation ) ) { + delete option[notation]; + return; + } + + // Set new obj value + var obj = convertNotation( options, notation.toLowerCase() ), previous; + previous = obj[0][obj[1]]; + obj[0][obj[1]] = value && value.nodeType ? $( value ) : value; + + // Also check if we need to reposition + reposition = rmove.test( notation ) || reposition; + + // Set the new params for the callback + option[notation] = [obj[0], obj[1], value, previous]; + } + ); + + // Re-sanitize options + sanitizeOptions( options ); + + /* + * Execute any valid callbacks for the set options + * Also set positioning flag so we don't get loads of redundant repositioning calls. + */ + this.positioning = TRUE; + $.each( option, $.proxy( setCallback, this ) ); + this.positioning = FALSE; + + // Update position if needed + if ( this.rendered && this.tooltip[0].offsetWidth > 0 && reposition ) { + this.reposition( options.position.target === 'mouse' ? NULL : this.cache.event ); + } + + return this; + }; + + ; + PROTOTYPE._update = function( content, element, reposition ) { + var self = this, + cache = this.cache; + + // Make sure tooltip is rendered and content is defined. If not return + if ( !this.rendered || !content ) { + return FALSE; + } + + // Use function to parse content + if ( $.isFunction( content ) ) { + content = content.call( this.elements.target, cache.event, this ) || ''; + } + + // Handle deferred content + if ( $.isFunction( content.then ) ) { + cache.waiting = TRUE; + return content.then( + function( c ) { + cache.waiting = FALSE; + return self._update( c, element ); + }, NULL, function( e ) { + return self._update( e, element ); + } + ); + } + + // If content is null... return false + if ( content === FALSE || (!content && content !== '') ) { + return FALSE; + } + + // Append new content if its a DOM array and show it if hidden + if ( content.jquery && content.length > 0 ) { + element.empty().append( + content.css( {display: 'block', visibility: 'visible'} ) + ); + } + + // Content is a regular string, insert the new content + else { + element.html( content ); + } + + // Wait for content to be loaded, and reposition + return this._waitForContent( element ).then( + function( images ) { + if ( images.images && images.images.length && self.rendered && self.tooltip[0].offsetWidth > 0 ) { + self.reposition( cache.event, !images.length ); + } + } + ); + }; + + PROTOTYPE._waitForContent = function( element ) { + var cache = this.cache; + + // Set flag + cache.waiting = TRUE; + + // If imagesLoaded is included, ensure images have loaded and return promise + return ( $.fn.imagesLoaded ? element.imagesLoaded() : $.Deferred().resolve( [] ) ) + .done( + function() { + cache.waiting = FALSE; + } + ) + .promise(); + }; + + PROTOTYPE._updateContent = function( content, reposition ) { + this._update( content, this.elements.content, reposition ); + }; + + PROTOTYPE._updateTitle = function( content, reposition ) { + if ( this._update( content, this.elements.title, reposition ) === FALSE ) { + this._removeTitle( FALSE ); + } + }; + + PROTOTYPE._createTitle = function() { + var elements = this.elements, + id = this._id + '-title'; + + // Destroy previous title element, if present + if ( elements.titlebar ) { + this._removeTitle(); + } + + // Create title bar and title elements + elements.titlebar = $( + '
', { + 'class': NAMESPACE + '-titlebar ' + (this.options.style.widget ? createWidgetClass( 'header' ) : '') + } + ) + .append( + elements.title = $( + '
', { + 'id': id, + 'class': NAMESPACE + '-title', + 'aria-atomic': TRUE + } + ) + ) + .insertBefore( elements.content ) + + // Button-specific events + .delegate( + '.qtip-close', 'mousedown keydown mouseup keyup mouseout', function( event ) { + $( this ).toggleClass( + 'ui-state-active ui-state-focus', event.type.substr( -4 ) === 'down' + ); + } + ) + .delegate( + '.qtip-close', 'mouseover mouseout', function( event ) { + $( this ).toggleClass( 'ui-state-hover', event.type === 'mouseover' ); + } + ); + + // Create button if enabled + if ( this.options.content.button ) { + this._createButton(); + } + }; + + PROTOTYPE._removeTitle = function( reposition ) { + var elements = this.elements; + + if ( elements.title ) { + elements.titlebar.remove(); + elements.titlebar = elements.title = elements.button = NULL; + + // Reposition if enabled + if ( reposition !== FALSE ) { + this.reposition(); + } + } + }; + + ; + PROTOTYPE.reposition = function( event, effect ) { + if ( !this.rendered || this.positioning || this.destroyed ) { + return this; + } + + // Set positioning flag + this.positioning = TRUE; + + var cache = this.cache, + tooltip = this.tooltip, + posOptions = this.options.position, + target = posOptions.target, + my = posOptions.my, + at = posOptions.at, + viewport = posOptions.viewport, + container = posOptions.container, + adjust = posOptions.adjust, + method = adjust.method.split( ' ' ), + tooltipWidth = tooltip.outerWidth( FALSE ), + tooltipHeight = tooltip.outerHeight( FALSE ), + targetWidth = 0, + targetHeight = 0, + type = tooltip.css( 'position' ), + position = {left: 0, top: 0}, + visible = tooltip[0].offsetWidth > 0, + isScroll = event && event.type === 'scroll', + win = $( window ), + doc = container[0].ownerDocument, + mouse = this.mouse, + pluginCalculations, offset; + + // Check if absolute position was passed + if ( $.isArray( target ) && target.length === 2 ) { + // Force left top and set position + at = {x: LEFT, y: TOP}; + position = {left: target[0], top: target[1]}; + } + + // Check if mouse was the target + else if ( target === 'mouse' ) { + // Force left top to allow flipping + at = {x: LEFT, y: TOP}; + + // Use the cached mouse coordinates if available, or passed event has no coordinates + if ( mouse && mouse.pageX && (adjust.mouse || !event || !event.pageX) ) { + event = mouse; + } + + // If the passed event has no coordinates (such as a scroll event) + else if ( !event || !event.pageX ) { + // Use the mouse origin that caused the show event, if distance hiding is enabled + if ( (!adjust.mouse || this.options.show.distance) && cache.origin && cache.origin.pageX ) { + event = cache.origin; + } + + // Use cached event for resize/scroll events + else if ( !event || (event && (event.type === 'resize' || event.type === 'scroll')) ) { + event = cache.event; + } + } + + // Calculate body and container offset and take them into account below + if ( type !== 'static' ) { + position = container.offset(); + } + if ( doc.body.offsetWidth !== (window.innerWidth || doc.documentElement.clientWidth) ) { + offset = $( document.body ).offset(); + } + + // Use event coordinates for position + position = { + left: event.pageX - position.left + (offset && offset.left || 0), + top: event.pageY - position.top + (offset && offset.top || 0) + }; + + // Scroll events are a pain, some browsers + if ( adjust.mouse && isScroll && mouse ) { + position.left -= (mouse.scrollX || 0) - win.scrollLeft(); + position.top -= (mouse.scrollY || 0) - win.scrollTop(); + } + } + + // Target wasn't mouse or absolute... + else { + // Check if event targetting is being used + if ( target === 'event' ) { + if ( event && event.target && event.type !== 'scroll' && event.type !== 'resize' ) { + cache.target = $( event.target ); + } + else if ( !event.target ) { + cache.target = this.elements.target; + } + } + else if ( target !== 'event' ) { + cache.target = $( target.jquery ? target : this.elements.target ); + } + target = cache.target; + + // Parse the target into a jQuery object and make sure there's an element present + target = $( target ).eq( 0 ); + if ( target.length === 0 ) { + return this; + } + + // Check if window or document is the target + else if ( target[0] === document || target[0] === window ) { + targetWidth = BROWSER.iOS ? window.innerWidth : target.width(); + targetHeight = BROWSER.iOS ? window.innerHeight : target.height(); + + if ( target[0] === window ) { + position = { + top: (viewport || target).scrollTop(), + left: (viewport || target).scrollLeft() + }; + } + } + + // Check if the target is an element + else if ( PLUGINS.imagemap && target.is( 'area' ) ) { + pluginCalculations = PLUGINS.imagemap( + this, target, at, PLUGINS.viewport ? method : FALSE + ); + } + + // Check if the target is an SVG element + else if ( PLUGINS.svg && target && target[0].ownerSVGElement ) { + pluginCalculations = PLUGINS.svg( this, target, at, PLUGINS.viewport ? method : FALSE ); + } + + // Otherwise use regular jQuery methods + else { + targetWidth = target.outerWidth( FALSE ); + targetHeight = target.outerHeight( FALSE ); + position = target.offset(); + } + + // Parse returned plugin values into proper variables + if ( pluginCalculations ) { + targetWidth = pluginCalculations.width; + targetHeight = pluginCalculations.height; + offset = pluginCalculations.offset; + position = pluginCalculations.position; + } + + // Adjust position to take into account offset parents + position = this.reposition.offset( target, position, container ); + + // Adjust for position.fixed tooltips (and also iOS scroll bug in v3.2-4.0 & v4.3-4.3.2) + if ( (BROWSER.iOS > 3.1 && BROWSER.iOS < 4.1) || + (BROWSER.iOS >= 4.3 && BROWSER.iOS < 4.33) || + (!BROWSER.iOS && type === 'fixed') + ) { + position.left -= win.scrollLeft(); + position.top -= win.scrollTop(); + } + + // Adjust position relative to target + if ( !pluginCalculations || (pluginCalculations && pluginCalculations.adjustable !== FALSE) ) { + position.left += at.x === RIGHT ? targetWidth : at.x === CENTER ? targetWidth / 2 : 0; + position.top += at.y === BOTTOM ? targetHeight : at.y === CENTER ? targetHeight / 2 : 0; + } + } + + // Adjust position relative to tooltip + position.left += adjust.x + (my.x === RIGHT ? -tooltipWidth : my.x === CENTER ? -tooltipWidth / 2 : 0); + position.top += adjust.y + (my.y === BOTTOM ? -tooltipHeight : my.y === CENTER ? -tooltipHeight / 2 : 0); + + // Use viewport adjustment plugin if enabled + if ( PLUGINS.viewport ) { + position.adjusted = PLUGINS.viewport( + this, position, posOptions, targetWidth, targetHeight, tooltipWidth, tooltipHeight + ); + + // Apply offsets supplied by positioning plugin (if used) + if ( offset && position.adjusted.left ) { + position.left += offset.left; + } + if ( offset && position.adjusted.top ) { + position.top += offset.top; + } + } + + // Viewport adjustment is disabled, set values to zero + else { + position.adjusted = {left: 0, top: 0}; + } + + // tooltipmove event + if ( !this._trigger( 'move', [position, viewport.elem || viewport], event ) ) { + return this; + } + delete position.adjusted; + + // If effect is disabled, target it mouse, no animation is defined or positioning gives NaN out, set CSS directly + if ( effect === FALSE || !visible || isNaN( position.left ) || isNaN( position.top ) || target === 'mouse' || !$.isFunction( posOptions.effect ) ) { + tooltip.css( position ); + } + + // Use custom function if provided + else if ( $.isFunction( posOptions.effect ) ) { + posOptions.effect.call( tooltip, this, $.extend( {}, position ) ); + tooltip.queue( + function( next ) { + // Reset attributes to avoid cross-browser rendering bugs + $( this ).css( {opacity: '', height: ''} ); + if ( BROWSER.ie ) { + this.style.removeAttribute( 'filter' ); + } + + next(); + } + ); + } + + // Set positioning flag + this.positioning = FALSE; + + return this; + }; + + // Custom (more correct for qTip!) offset calculator + PROTOTYPE.reposition.offset = function( elem, pos, container ) { + if ( !container[0] ) { + return pos; + } + + var ownerDocument = $( elem[0].ownerDocument ), + quirks = !!BROWSER.ie && document.compatMode !== 'CSS1Compat', + parent = container[0], + scrolled, position, parentOffset, overflow; + + function scroll( e, i ) { + pos.left += i * e.scrollLeft(); + pos.top += i * e.scrollTop(); + } + + // Compensate for non-static containers offset + do { + if ( (position = $.css( parent, 'position' )) !== 'static' ) { + if ( position === 'fixed' ) { + parentOffset = parent.getBoundingClientRect(); + scroll( ownerDocument, -1 ); + } + else { + parentOffset = $( parent ).position(); + parentOffset.left += (parseFloat( $.css( parent, 'borderLeftWidth' ) ) || 0); + parentOffset.top += (parseFloat( $.css( parent, 'borderTopWidth' ) ) || 0); + } + + pos.left -= parentOffset.left + (parseFloat( $.css( parent, 'marginLeft' ) ) || 0); + pos.top -= parentOffset.top + (parseFloat( $.css( parent, 'marginTop' ) ) || 0); + + // If this is the first parent element with an overflow of "scroll" or "auto", store it + if ( !scrolled && (overflow = $.css( + parent, 'overflow' + )) !== 'hidden' && overflow !== 'visible' ) { + scrolled = $( parent ); + } + } + } + while ( (parent = parent.offsetParent) ); + + // Compensate for containers scroll if it also has an offsetParent (or in IE quirks mode) + if ( scrolled && (scrolled[0] !== ownerDocument[0] || quirks) ) { + scroll( scrolled, 1 ); + } + + return pos; + }; + + // Corner class + var C = (CORNER = PROTOTYPE.reposition.Corner = function( corner, forceY ) { + corner = ('' + corner).replace( /([A-Z])/, ' $1' ).replace( /middle/gi, CENTER ).toLowerCase(); + this.x = (corner.match( /left|right/i ) || corner.match( /center/ ) || ['inherit'])[0].toLowerCase(); + this.y = (corner.match( /top|bottom|center/i ) || ['inherit'])[0].toLowerCase(); + this.forceY = !!forceY; + + var f = corner.charAt( 0 ); + this.precedance = (f === 't' || f === 'b' ? Y : X); + }).prototype; + + C.invert = function( z, center ) { + this[z] = this[z] === LEFT ? RIGHT : this[z] === RIGHT ? LEFT : center || this[z]; + }; + + C.string = function() { + var x = this.x, y = this.y; + return x === y ? x : this.precedance === Y || (this.forceY && y !== 'center') ? y + ' ' + x : x + ' ' + y; + }; + + C.abbrev = function() { + var result = this.string().split( ' ' ); + return result[0].charAt( 0 ) + (result[1] && result[1].charAt( 0 ) || ''); + }; + + C.clone = function() { + return new CORNER( this.string(), this.forceY ); + }; + ; + PROTOTYPE.toggle = function( state, event ) { + var cache = this.cache, + options = this.options, + tooltip = this.tooltip; + + // Try to prevent flickering when tooltip overlaps show element + if ( event ) { + if ( (/over|enter/).test( event.type ) && (/out|leave/).test( cache.event.type ) && + options.show.target.add( event.target ).length === options.show.target.length && + tooltip.has( event.relatedTarget ).length ) { + return this; + } + + // Cache event + cache.event = cloneEvent( event ); + } + + // If we're currently waiting and we've just hidden... stop it + this.waiting && !state && (this.hiddenDuringWait = TRUE); + + // Render the tooltip if showing and it isn't already + if ( !this.rendered ) { + return state ? this.render( 1 ) : this; + } + else if ( this.destroyed || this.disabled ) { + return this; + } + + var type = state ? 'show' : 'hide', + opts = this.options[type], + otherOpts = this.options[!state ? 'show' : 'hide'], + posOptions = this.options.position, + contentOptions = this.options.content, + width = this.tooltip.css( 'width' ), + visible = this.tooltip.is( ':visible' ), + animate = state || opts.target.length === 1, + sameTarget = !event || opts.target.length < 2 || cache.target[0] === event.target, + identicalState, allow, showEvent, delay, after; + + // Detect state if valid one isn't provided + if ( (typeof state).search( 'boolean|number' ) ) { + state = !visible; + } + + // Check if the tooltip is in an identical state to the new would-be state + identicalState = !tooltip.is( ':animated' ) && visible === state && sameTarget; + + // Fire tooltip(show/hide) event and check if destroyed + allow = !identicalState ? !!this._trigger( type, [90] ) : NULL; + + // Check to make sure the tooltip wasn't destroyed in the callback + if ( this.destroyed ) { + return this; + } + + // If the user didn't stop the method prematurely and we're showing the tooltip, focus it + if ( allow !== FALSE && state ) { + this.focus( event ); + } + + // If the state hasn't changed or the user stopped it, return early + if ( !allow || identicalState ) { + return this; + } + + // Set ARIA hidden attribute + $.attr( tooltip[0], 'aria-hidden', !!!state ); + + // Execute state specific properties + if ( state ) { + // Store show origin coordinates + cache.origin = cloneEvent( this.mouse ); + + // Update tooltip content & title if it's a dynamic function + if ( $.isFunction( contentOptions.text ) ) { + this._updateContent( contentOptions.text, FALSE ); + } + if ( $.isFunction( contentOptions.title ) ) { + this._updateTitle( contentOptions.title, FALSE ); + } + + // Cache mousemove events for positioning purposes (if not already tracking) + if ( !trackingBound && posOptions.target === 'mouse' && posOptions.adjust.mouse ) { + $( document ).bind( 'mousemove.' + NAMESPACE, this._storeMouse ); + trackingBound = TRUE; + } + + // Update the tooltip position (set width first to prevent viewport/max-width issues) + if ( !width ) { + tooltip.css( 'width', tooltip.outerWidth( FALSE ) ); + } + this.reposition( event, arguments[2] ); + if ( !width ) { + tooltip.css( 'width', '' ); + } + + // Hide other tooltips if tooltip is solo + if ( !!opts.solo ) { + (typeof opts.solo === 'string' ? $( opts.solo ) : $( SELECTOR, opts.solo )) + .not( tooltip ).not( opts.target ).qtip( 'hide', $.Event( 'tooltipsolo' ) ); + } + } + else { + // Clear show timer if we're hiding + clearTimeout( this.timers.show ); + + // Remove cached origin on hide + delete cache.origin; + + // Remove mouse tracking event if not needed (all tracking qTips are hidden) + if ( trackingBound && !$( + SELECTOR + '[tracking="true"]:visible', opts.solo + ).not( tooltip ).length ) { + $( document ).unbind( 'mousemove.' + NAMESPACE ); + trackingBound = FALSE; + } + + // Blur the tooltip + this.blur( event ); + } + + // Define post-animation, state specific properties + after = $.proxy( + function() { + if ( state ) { + // Prevent antialias from disappearing in IE by removing filter + if ( BROWSER.ie ) { + tooltip[0].style.removeAttribute( 'filter' ); + } + + // Remove overflow setting to prevent tip bugs + tooltip.css( 'overflow', '' ); + + // Autofocus elements if enabled + if ( 'string' === typeof opts.autofocus ) { + $( this.options.show.autofocus, tooltip ).focus(); + } + + // If set, hide tooltip when inactive for delay period + this.options.show.target.trigger( 'qtip-' + this.id + '-inactive' ); + } + else { + // Reset CSS states + tooltip.css( + { + display: '', + visibility: '', + opacity: '', + left: '', + top: '' + } + ); + } + + // tooltipvisible/tooltiphidden events + this._trigger( state ? 'visible' : 'hidden' ); + }, this + ); + + // If no effect type is supplied, use a simple toggle + if ( opts.effect === FALSE || animate === FALSE ) { + tooltip[type](); + after(); + } + + // Use custom function if provided + else if ( $.isFunction( opts.effect ) ) { + tooltip.stop( 1, 1 ); + opts.effect.call( tooltip, this ); + tooltip.queue( + 'fx', function( n ) { + after(); + n(); + } + ); + } + + // Use basic fade function by default + else { + tooltip.fadeTo( 90, state ? 1 : 0, after ); + } + + // If inactive hide method is set, active it + if ( state ) { + opts.target.trigger( 'qtip-' + this.id + '-inactive' ); + } + + return this; + }; + + PROTOTYPE.show = function( event ) { + return this.toggle( TRUE, event ); + }; + + PROTOTYPE.hide = function( event ) { + return this.toggle( FALSE, event ); + }; + + ; + PROTOTYPE.focus = function( event ) { + if ( !this.rendered || this.destroyed ) { + return this; + } + + var qtips = $( SELECTOR ), + tooltip = this.tooltip, + curIndex = parseInt( tooltip[0].style.zIndex, 10 ), + newIndex = QTIP.zindex + qtips.length, + focusedElem; + + // Only update the z-index if it has changed and tooltip is not already focused + if ( !tooltip.hasClass( CLASS_FOCUS ) ) { + // tooltipfocus event + if ( this._trigger( 'focus', [newIndex], event ) ) { + // Only update z-index's if they've changed + if ( curIndex !== newIndex ) { + // Reduce our z-index's and keep them properly ordered + qtips.each( + function() { + if ( this.style.zIndex > curIndex ) { + this.style.zIndex = this.style.zIndex - 1; + } + } + ); + + // Fire blur event for focused tooltip + qtips.filter( '.' + CLASS_FOCUS ).qtip( 'blur', event ); + } + + // Set the new z-index + tooltip.addClass( CLASS_FOCUS )[0].style.zIndex = newIndex; + } + } + + return this; + }; + + PROTOTYPE.blur = function( event ) { + if ( !this.rendered || this.destroyed ) { + return this; + } + + // Set focused status to FALSE + this.tooltip.removeClass( CLASS_FOCUS ); + + // tooltipblur event + this._trigger( 'blur', [this.tooltip.css( 'zIndex' )], event ); + + return this; + }; + + ; + PROTOTYPE.disable = function( state ) { + if ( this.destroyed ) { + return this; + } + + // If 'toggle' is passed, toggle the current state + if ( state === 'toggle' ) { + state = !(this.rendered ? this.tooltip.hasClass( CLASS_DISABLED ) : this.disabled); + } + + // Disable if no state passed + else if ( 'boolean' !== typeof state ) { + state = TRUE; + } + + if ( this.rendered ) { + this.tooltip.toggleClass( CLASS_DISABLED, state ) + .attr( 'aria-disabled', state ); + } + + this.disabled = !!state; + + return this; + }; + + PROTOTYPE.enable = function() { + return this.disable( FALSE ); + }; + + ; + PROTOTYPE._createButton = function() { + var self = this, + elements = this.elements, + tooltip = elements.tooltip, + button = this.options.content.button, + isString = typeof button === 'string', + close = isString ? button : 'Close tooltip'; + + if ( elements.button ) { + elements.button.remove(); + } + + // Use custom button if one was supplied by user, else use default + if ( button.jquery ) { + elements.button = button; + } + else { + elements.button = $( + '', { + 'class': 'qtip-close ' + (this.options.style.widget ? '' : NAMESPACE + '-icon'), + 'title': close, + 'aria-label': close + } + ) + .prepend( + $( + '', { + 'class': 'ui-icon ui-icon-close', + 'html': '×' + } + ) + ); + } + + // Create button and setup attributes + elements.button.appendTo( elements.titlebar || tooltip ) + .attr( 'role', 'button' ) + .click( + function( event ) { + if ( !tooltip.hasClass( CLASS_DISABLED ) ) { + self.hide( event ); + } + return FALSE; + } + ); + }; + + PROTOTYPE._updateButton = function( button ) { + // Make sure tooltip is rendered and if not, return + if ( !this.rendered ) { + return FALSE; + } + + var elem = this.elements.button; + if ( button ) { + this._createButton(); + } + else { + elem.remove(); + } + }; + + ;// Widget class creator + function createWidgetClass( cls ) { + return WIDGET.concat( '' ).join( cls ? '-' + cls + ' ' : ' ' ); + } + + // Widget class setter method + PROTOTYPE._setWidget = function() { + var on = this.options.style.widget, + elements = this.elements, + tooltip = elements.tooltip, + disabled = tooltip.hasClass( CLASS_DISABLED ); + + tooltip.removeClass( CLASS_DISABLED ); + CLASS_DISABLED = on ? 'ui-state-disabled' : 'qtip-disabled'; + tooltip.toggleClass( CLASS_DISABLED, disabled ); + + tooltip.toggleClass( 'ui-helper-reset ' + createWidgetClass(), on ).toggleClass( + CLASS_DEFAULT, this.options.style.def && !on + ); + + if ( elements.content ) { + elements.content.toggleClass( createWidgetClass( 'content' ), on ); + } + if ( elements.titlebar ) { + elements.titlebar.toggleClass( createWidgetClass( 'header' ), on ); + } + if ( elements.button ) { + elements.button.toggleClass( NAMESPACE + '-icon', !on ); + } + }; + ; + function cloneEvent( event ) { + return event && { + type: event.type, + pageX: event.pageX, + pageY: event.pageY, + target: event.target, + relatedTarget: event.relatedTarget, + scrollX: event.scrollX || window.pageXOffset || document.body.scrollLeft || document.documentElement.scrollLeft, + scrollY: event.scrollY || window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop + } || {}; + } + + function delay( callback, duration ) { + // If tooltip has displayed, start hide timer + if ( duration > 0 ) { + return setTimeout( + $.proxy( callback, this ), duration + ); + } + else { + callback.call( this ); + } + } + + function showMethod( event ) { + if ( this.tooltip.hasClass( CLASS_DISABLED ) ) { + return FALSE; + } + + // Clear hide timers + clearTimeout( this.timers.show ); + clearTimeout( this.timers.hide ); + + // Start show timer + this.timers.show = delay.call( + this, + function() { + this.toggle( TRUE, event ); + }, + this.options.show.delay + ); + } + + function hideMethod( event ) { + if ( this.tooltip.hasClass( CLASS_DISABLED ) ) { + return FALSE; + } + + // Check if new target was actually the tooltip element + var relatedTarget = $( event.relatedTarget ), + ontoTooltip = relatedTarget.closest( SELECTOR )[0] === this.tooltip[0], + ontoTarget = relatedTarget[0] === this.options.show.target[0]; + + // Clear timers and stop animation queue + clearTimeout( this.timers.show ); + clearTimeout( this.timers.hide ); + + // Prevent hiding if tooltip is fixed and event target is the tooltip. + // Or if mouse positioning is enabled and cursor momentarily overlaps + if ( this !== relatedTarget[0] && + (this.options.position.target === 'mouse' && ontoTooltip) || + (this.options.hide.fixed && ( + (/mouse(out|leave|move)/).test( event.type ) && (ontoTooltip || ontoTarget)) + ) ) { + try { + event.preventDefault(); + event.stopImmediatePropagation(); + } catch ( e ) { + } + + return; + } + + // If tooltip has displayed, start hide timer + this.timers.hide = delay.call( + this, + function() { + this.toggle( FALSE, event ); + }, + this.options.hide.delay, + this + ); + } + + function inactiveMethod( event ) { + if ( this.tooltip.hasClass( CLASS_DISABLED ) || !this.options.hide.inactive ) { + return FALSE; + } + + // Clear timer + clearTimeout( this.timers.inactive ); + + this.timers.inactive = delay.call( + this, + function() { + this.hide( event ); + }, + this.options.hide.inactive + ); + } + + function repositionMethod( event ) { + if ( this.rendered && this.tooltip[0].offsetWidth > 0 ) { + this.reposition( event ); + } + } + + // Store mouse coordinates + PROTOTYPE._storeMouse = function( event ) { + (this.mouse = cloneEvent( event )).type = 'mousemove'; + }; + + // Bind events + PROTOTYPE._bind = function( targets, events, method, suffix, context ) { + var ns = '.' + this._id + (suffix ? '-' + suffix : ''); + events.length && $( targets ).bind( + (events.split ? events : events.join( ns + ' ' )) + ns, + $.proxy( method, context || this ) + ); + }; + PROTOTYPE._unbind = function( targets, suffix ) { + $( targets ).unbind( '.' + this._id + (suffix ? '-' + suffix : '') ); + }; + + // Apply common event handlers using delegate (avoids excessive .bind calls!) + var ns = '.' + NAMESPACE; + + function delegate( selector, events, method ) { + $( document.body ).delegate( + selector, + (events.split ? events : events.join( ns + ' ' )) + ns, + function() { + var api = QTIP.api[$.attr( this, ATTR_ID )]; + api && !api.disabled && method.apply( api, arguments ); + } + ); + } + + $( + function() { + delegate( + SELECTOR, ['mouseenter', 'mouseleave'], function( event ) { + var state = event.type === 'mouseenter', + tooltip = $( event.currentTarget ), + target = $( event.relatedTarget || event.target ), + options = this.options; + + // On mouseenter... + if ( state ) { + // Focus the tooltip on mouseenter (z-index stacking) + this.focus( event ); + + // Clear hide timer on tooltip hover to prevent it from closing + tooltip.hasClass( CLASS_FIXED ) && !tooltip.hasClass( CLASS_DISABLED ) && clearTimeout( this.timers.hide ); + } + + // On mouseleave... + else { + // Hide when we leave the tooltip and not onto the show target (if a hide event is set) + if ( options.position.target === 'mouse' && options.hide.event && + options.show.target && !target.closest( options.show.target[0] ).length ) { + this.hide( event ); + } + } + + // Add hover class + tooltip.toggleClass( CLASS_HOVER, state ); + } + ); + + // Define events which reset the 'inactive' event handler + delegate( '[' + ATTR_ID + ']', INACTIVE_EVENTS, inactiveMethod ); + } + ); + + // Event trigger + PROTOTYPE._trigger = function( type, args, event ) { + var callback = $.Event( 'tooltip' + type ); + callback.originalEvent = (event && $.extend( {}, event )) || this.cache.event || NULL; + + this.triggering = type; + this.tooltip.trigger( callback, [this].concat( args || [] ) ); + this.triggering = FALSE; + + return !callback.isDefaultPrevented(); + }; + + PROTOTYPE._bindEvents = function( showEvents, hideEvents, showTarget, hideTarget, showMethod, hideMethod ) { + // If hide and show targets are the same... + if ( hideTarget.add( showTarget ).length === hideTarget.length ) { + var toggleEvents = []; + + // Filter identical show/hide events + hideEvents = $.map( + hideEvents, function( type ) { + var showIndex = $.inArray( type, showEvents ); + + // Both events are identical, remove from both hide and show events + // and append to toggleEvents + if ( showIndex > -1 ) { + toggleEvents.push( showEvents.splice( showIndex, 1 )[0] ); + return; + } + + return type; + } + ); + + // Toggle events are special case of identical show/hide events, which happen in sequence + toggleEvents.length && this._bind( + showTarget, toggleEvents, function( event ) { + var state = this.rendered ? this.tooltip[0].offsetWidth > 0 : false; + (state ? hideMethod : showMethod).call( this, event ); + } + ); + } + + // Apply show/hide/toggle events + this._bind( showTarget, showEvents, showMethod ); + this._bind( hideTarget, hideEvents, hideMethod ); + }; + + PROTOTYPE._assignInitialEvents = function( event ) { + var options = this.options, + showTarget = options.show.target, + hideTarget = options.hide.target, + showEvents = options.show.event ? $.trim( '' + options.show.event ).split( ' ' ) : [], + hideEvents = options.hide.event ? $.trim( '' + options.hide.event ).split( ' ' ) : []; + + /* + * Make sure hoverIntent functions properly by using mouseleave as a hide event if + * mouseenter/mouseout is used for show.event, even if it isn't in the users options. + */ + if ( /mouse(over|enter)/i.test( options.show.event ) && !/mouse(out|leave)/i.test( options.hide.event ) ) { + hideEvents.push( 'mouseleave' ); + } + + /* + * Also make sure initial mouse targetting works correctly by caching mousemove coords + * on show targets before the tooltip has rendered. Also set onTarget when triggered to + * keep mouse tracking working. + */ + this._bind( + showTarget, 'mousemove', function( event ) { + this._storeMouse( event ); + this.cache.onTarget = TRUE; + } + ); + + // Define hoverIntent function + function hoverIntent( event ) { + // Only continue if tooltip isn't disabled + if ( this.disabled || this.destroyed ) { + return FALSE; + } + + // Cache the event data + this.cache.event = cloneEvent( event ); + this.cache.target = event ? $( event.target ) : [undefined]; + + // Start the event sequence + clearTimeout( this.timers.show ); + this.timers.show = delay.call( + this, + function() { + this.render( typeof event === 'object' || options.show.ready ); + }, + options.show.delay + ); + } + + // Filter and bind events + this._bindEvents( + showEvents, hideEvents, showTarget, hideTarget, hoverIntent, function() { + clearTimeout( this.timers.show ); + } + ); + + // Prerendering is enabled, create tooltip now + if ( options.show.ready || options.prerender ) { + hoverIntent.call( this, event ); + } + }; + + // Event assignment method + PROTOTYPE._assignEvents = function() { + var self = this, + options = this.options, + posOptions = options.position, + + tooltip = this.tooltip, + showTarget = options.show.target, + hideTarget = options.hide.target, + containerTarget = posOptions.container, + viewportTarget = posOptions.viewport, + documentTarget = $( document ), + bodyTarget = $( document.body ), + windowTarget = $( window ), + + showEvents = options.show.event ? $.trim( '' + options.show.event ).split( ' ' ) : [], + hideEvents = options.hide.event ? $.trim( '' + options.hide.event ).split( ' ' ) : []; + + + // Assign passed event callbacks + $.each( + options.events, function( name, callback ) { + self._bind( + tooltip, name === 'toggle' ? ['tooltipshow', 'tooltiphide'] : ['tooltip' + name], + callback, null, tooltip + ); + } + ); + + // Hide tooltips when leaving current window/frame (but not select/option elements) + if ( /mouse(out|leave)/i.test( options.hide.event ) && options.hide.leave === 'window' ) { + this._bind( + documentTarget, ['mouseout', 'blur'], function( event ) { + if ( !/select|option/.test( event.target.nodeName ) && !event.relatedTarget ) { + this.hide( event ); + } + } + ); + } + + // Enable hide.fixed by adding appropriate class + if ( options.hide.fixed ) { + hideTarget = hideTarget.add( tooltip.addClass( CLASS_FIXED ) ); + } + + /* + * Make sure hoverIntent functions properly by using mouseleave to clear show timer if + * mouseenter/mouseout is used for show.event, even if it isn't in the users options. + */ + else if ( /mouse(over|enter)/i.test( options.show.event ) ) { + this._bind( + hideTarget, 'mouseleave', function() { + clearTimeout( this.timers.show ); + } + ); + } + + // Hide tooltip on document mousedown if unfocus events are enabled + if ( ('' + options.hide.event).indexOf( 'unfocus' ) > -1 ) { + this._bind( + containerTarget.closest( 'html' ), ['mousedown', 'touchstart'], function( event ) { + var elem = $( event.target ), + enabled = this.rendered && !this.tooltip.hasClass( CLASS_DISABLED ) && this.tooltip[0].offsetWidth > 0, + isAncestor = elem.parents( SELECTOR ).filter( this.tooltip[0] ).length > 0; + + if ( elem[0] !== this.target[0] && elem[0] !== this.tooltip[0] && !isAncestor && !this.target.has( elem[0] ).length && enabled + ) { + this.hide( event ); + } + } + ); + } + + // Check if the tooltip hides when inactive + if ( 'number' === typeof options.hide.inactive ) { + // Bind inactive method to show target(s) as a custom event + this._bind( showTarget, 'qtip-' + this.id + '-inactive', inactiveMethod ); + + // Define events which reset the 'inactive' event handler + this._bind( hideTarget.add( tooltip ), QTIP.inactiveEvents, inactiveMethod, '-inactive' ); + } + + // Filter and bind events + this._bindEvents( showEvents, hideEvents, showTarget, hideTarget, showMethod, hideMethod ); + + // Mouse movement bindings + this._bind( + showTarget.add( tooltip ), 'mousemove', function( event ) { + // Check if the tooltip hides when mouse is moved a certain distance + if ( 'number' === typeof options.hide.distance ) { + var origin = this.cache.origin || {}, + limit = this.options.hide.distance, + abs = Math.abs; + + // Check if the movement has gone beyond the limit, and hide it if so + if ( abs( event.pageX - origin.pageX ) >= limit || abs( event.pageY - origin.pageY ) >= limit ) { + this.hide( event ); + } + } + + // Cache mousemove coords on show targets + this._storeMouse( event ); + } + ); + + // Mouse positioning events + if ( posOptions.target === 'mouse' ) { + // If mouse adjustment is on... + if ( posOptions.adjust.mouse ) { + // Apply a mouseleave event so we don't get problems with overlapping + if ( options.hide.event ) { + // Track if we're on the target or not + this._bind( + showTarget, ['mouseenter', 'mouseleave'], function( event ) { + this.cache.onTarget = event.type === 'mouseenter'; + } + ); + } + + // Update tooltip position on mousemove + this._bind( + documentTarget, 'mousemove', function( event ) { + // Update the tooltip position only if the tooltip is visible and adjustment is enabled + if ( this.rendered && this.cache.onTarget && !this.tooltip.hasClass( CLASS_DISABLED ) && this.tooltip[0].offsetWidth > 0 ) { + this.reposition( event ); + } + } + ); + } + } + + // Adjust positions of the tooltip on window resize if enabled + if ( posOptions.adjust.resize || viewportTarget.length ) { + this._bind( + $.event.special.resize ? viewportTarget : windowTarget, 'resize', repositionMethod + ); + } + + // Adjust tooltip position on scroll of the window or viewport element if present + if ( posOptions.adjust.scroll ) { + this._bind( windowTarget.add( posOptions.container ), 'scroll', repositionMethod ); + } + }; + + // Un-assignment method + PROTOTYPE._unassignEvents = function() { + var targets = [ + this.options.show.target[0], + this.options.hide.target[0], + this.rendered && this.tooltip[0], + this.options.position.container[0], + this.options.position.viewport[0], + this.options.position.container.closest( 'html' )[0], // unfocus + window, + document + ]; + + this._unbind( + $( [] ).pushStack( + $.grep( + targets, function( i ) { + return typeof i === 'object'; + } + ) + ) + ); + }; + + ;// Initialization method + function init( elem, id, opts ) { + var obj, posOptions, attr, config, title, + + // Setup element references + docBody = $( document.body ), + + // Use document body instead of document element if needed + newTarget = elem[0] === document ? docBody : elem, + + // Grab metadata from element if plugin is present + metadata = (elem.metadata) ? elem.metadata( opts.metadata ) : NULL, + + // If metadata type if HTML5, grab 'name' from the object instead, or use the regular data object otherwise + metadata5 = opts.metadata.type === 'html5' && metadata ? metadata[opts.metadata.name] : NULL, + + // Grab data from metadata.name (or data-qtipopts as fallback) using .data() method, + html5 = elem.data( opts.metadata.name || 'qtipopts' ); + + // If we don't get an object returned attempt to parse it manualyl without parseJSON + try { + html5 = typeof html5 === 'string' ? $.parseJSON( html5 ) : html5; + } catch ( e ) { + } + + // Merge in and sanitize metadata + config = $.extend( + TRUE, {}, QTIP.defaults, opts, + typeof html5 === 'object' ? sanitizeOptions( html5 ) : NULL, + sanitizeOptions( metadata5 || metadata ) + ); + + // Re-grab our positioning options now we've merged our metadata and set id to passed value + posOptions = config.position; + config.id = id; + + // Setup missing content if none is detected + if ( 'boolean' === typeof config.content.text ) { + attr = elem.attr( config.content.attr ); + + // Grab from supplied attribute if available + if ( config.content.attr !== FALSE && attr ) { + config.content.text = attr; + } + + // No valid content was found, abort render + else { + return FALSE; + } + } + + // Setup target options + if ( !posOptions.container.length ) { + posOptions.container = docBody; + } + if ( posOptions.target === FALSE ) { + posOptions.target = newTarget; + } + if ( config.show.target === FALSE ) { + config.show.target = newTarget; + } + if ( config.show.solo === TRUE ) { + config.show.solo = posOptions.container.closest( 'body' ); + } + if ( config.hide.target === FALSE ) { + config.hide.target = newTarget; + } + if ( config.position.viewport === TRUE ) { + config.position.viewport = posOptions.container; + } + + // Ensure we only use a single container + posOptions.container = posOptions.container.eq( 0 ); + + // Convert position corner values into x and y strings + posOptions.at = new CORNER( posOptions.at, TRUE ); + posOptions.my = new CORNER( posOptions.my ); + + // Destroy previous tooltip if overwrite is enabled, or skip element if not + if ( elem.data( NAMESPACE ) ) { + if ( config.overwrite ) { + elem.qtip( 'destroy', true ); + } + else if ( config.overwrite === FALSE ) { + return FALSE; + } + } + + // Add has-qtip attribute + elem.attr( ATTR_HAS, id ); + + // Remove title attribute and store it if present + if ( config.suppress && (title = elem.attr( 'title' )) ) { + // Final attr call fixes event delegatiom and IE default tooltip showing problem + elem.removeAttr( 'title' ).attr( oldtitle, title ).attr( 'title', '' ); + } + + // Initialize the tooltip and add API reference + obj = new QTip( elem, config, id, !!attr ); + elem.data( NAMESPACE, obj ); + + // Catch remove/removeqtip events on target element to destroy redundant tooltip + elem.one( + 'remove.qtip-' + id + ' removeqtip.qtip-' + id, function() { + var api; + if ( (api = $( this ).data( NAMESPACE )) ) { + api.destroy( true ); + } + } + ); + + return obj; + } + + // jQuery $.fn extension method + QTIP = $.fn.qtip = function( options, notation, newValue ) { + var command = ('' + options).toLowerCase(), // Parse command + returned = NULL, + args = $.makeArray( arguments ).slice( 1 ), + event = args[args.length - 1], + opts = this[0] ? $.data( this[0], NAMESPACE ) : NULL; + + // Check for API request + if ( (!arguments.length && opts) || command === 'api' ) { + return opts; + } + + // Execute API command if present + else if ( 'string' === typeof options ) { + this.each( + function() { + var api = $.data( this, NAMESPACE ); + if ( !api ) { + return TRUE; + } + + // Cache the event if possible + if ( event && event.timeStamp ) { + api.cache.event = event; + } + + // Check for specific API commands + if ( notation && (command === 'option' || command === 'options') ) { + if ( newValue !== undefined || $.isPlainObject( notation ) ) { + api.set( notation, newValue ); + } + else { + returned = api.get( notation ); + return FALSE; + } + } + + // Execute API command + else if ( api[command] ) { + api[command].apply( api, args ); + } + } + ); + + return returned !== NULL ? returned : this; + } + + // No API commands. validate provided options and setup qTips + else if ( 'object' === typeof options || !arguments.length ) { + // Sanitize options first + opts = sanitizeOptions( $.extend( TRUE, {}, options ) ); + + return this.each( + function( i ) { + var api, id; + + // Find next available ID, or use custom ID if provided + id = $.isArray( opts.id ) ? opts.id[i] : opts.id; + id = !id || id === FALSE || id.length < 1 || QTIP.api[id] ? QTIP.nextid++ : id; + + // Initialize the qTip and re-grab newly sanitized options + api = init( $( this ), id, opts ); + if ( api === FALSE ) { + return TRUE; + } + else { + QTIP.api[id] = api; + } + + // Initialize plugins + $.each( + PLUGINS, function() { + if ( this.initialize === 'initialize' ) { + this( api ); + } + } + ); + + // Assign initial pre-render events + api._assignInitialEvents( event ); + } + ); + } + }; + + // Expose class + $.qtip = QTip; + + // Populated in render method + QTIP.api = {}; + ; + $.each( + { + /* Allow other plugins to successfully retrieve the title of an element with a qTip applied */ + attr: function( attr, val ) { + if ( this.length ) { + var self = this[0], + title = 'title', + api = $.data( self, 'qtip' ); + + if ( attr === title && api && 'object' === typeof api && api.options.suppress ) { + if ( arguments.length < 2 ) { + return $.attr( self, oldtitle ); + } + + // If qTip is rendered and title was originally used as content, update it + if ( api && api.options.content.attr === title && api.cache.attr ) { + api.set( 'content.text', val ); + } + + // Use the regular attr method to set, then cache the result + return this.attr( oldtitle, val ); + } + } + + return $.fn['attr' + replaceSuffix].apply( this, arguments ); + }, + + /* Allow clone to correctly retrieve cached title attributes */ + clone: function( keepData ) { + var titles = $( [] ), title = 'title', + + // Clone our element using the real clone method + elems = $.fn['clone' + replaceSuffix].apply( this, arguments ); + + // Grab all elements with an oldtitle set, and change it to regular title attribute, if keepData is false + if ( !keepData ) { + elems.filter( '[' + oldtitle + ']' ).attr( + 'title', function() { + return $.attr( this, oldtitle ); + } + ) + .removeAttr( oldtitle ); + } + + return elems; + } + }, function( name, func ) { + if ( !func || $.fn[name + replaceSuffix] ) { + return TRUE; + } + + var old = $.fn[name + replaceSuffix] = $.fn[name]; + $.fn[name] = function() { + return func.apply( this, arguments ) || old.apply( this, arguments ); + }; + } + ); + + /* Fire off 'removeqtip' handler in $.cleanData if jQuery UI not present (it already does similar). + * This snippet is taken directly from jQuery UI source code found here: + * http://code.jquery.com/ui/jquery-ui-git.js + */ + if ( !$.ui ) { + $['cleanData' + replaceSuffix] = $.cleanData; + $.cleanData = function( elems ) { + for ( var i = 0, elem; (elem = $( elems[i] )).length; i++ ) { + if ( elem.attr( ATTR_HAS ) ) { + try { + elem.triggerHandler( 'removeqtip' ); + } + catch ( e ) { + } + } + } + $['cleanData' + replaceSuffix].apply( this, arguments ); + }; + } + + ;// qTip version + QTIP.version = '2.2.0'; + + // Base ID for all qTips + QTIP.nextid = 0; + + // Inactive events array + QTIP.inactiveEvents = INACTIVE_EVENTS; + + // Base z-index for all qTips + QTIP.zindex = 15000; + + // Define configuration defaults + QTIP.defaults = { + prerender: FALSE, + id: FALSE, + overwrite: TRUE, + suppress: TRUE, + content: { + text: TRUE, + attr: 'title', + title: FALSE, + button: FALSE + }, + position: { + my: 'top left', + at: 'bottom right', + target: FALSE, + container: FALSE, + viewport: FALSE, + adjust: { + x: 0, y: 0, + mouse: TRUE, + scroll: TRUE, + resize: TRUE, + method: 'flipinvert flipinvert' + }, + effect: function( api, pos, viewport ) { + $( this ).animate( + pos, { + duration: 200, + queue: FALSE + } + ); + } + }, + show: { + target: FALSE, + event: 'mouseenter', + effect: TRUE, + delay: 90, + solo: FALSE, + ready: FALSE, + autofocus: FALSE + }, + hide: { + target: FALSE, + event: 'mouseleave', + effect: TRUE, + delay: 0, + fixed: FALSE, + inactive: FALSE, + leave: 'window', + distance: FALSE + }, + style: { + classes: '', + widget: FALSE, + width: FALSE, + height: FALSE, + def: TRUE + }, + events: { + render: NULL, + move: NULL, + show: NULL, + hide: NULL, + toggle: NULL, + visible: NULL, + hidden: NULL, + focus: NULL, + blur: NULL + } + }; + + ; + var TIP, + + // .bind()/.on() namespace + TIPNS = '.qtip-tip', + + // Common CSS strings + MARGIN = 'margin', + BORDER = 'border', + COLOR = 'color', + BG_COLOR = 'background-color', + TRANSPARENT = 'transparent', + IMPORTANT = ' !important', + + // Check if the browser supports elements + HASCANVAS = !!document.createElement( 'canvas' ).getContext, + + // Invalid colour values used in parseColours() + INVALID = /rgba?\(0, 0, 0(, 0)?\)|transparent|#123456/i; + + // Camel-case method, taken from jQuery source + // http://code.jquery.com/jquery-1.8.0.js + function camel( s ) { + return s.charAt( 0 ).toUpperCase() + s.slice( 1 ); + } + + /* + * Modified from Modernizr's testPropsAll() + * http://modernizr.com/downloads/modernizr-latest.js + */ + var cssProps = {}, cssPrefixes = ["Webkit", "O", "Moz", "ms"]; + + function vendorCss( elem, prop ) { + var ucProp = prop.charAt( 0 ).toUpperCase() + prop.slice( 1 ), + props = (prop + ' ' + cssPrefixes.join( ucProp + ' ' ) + ucProp).split( ' ' ), + cur, val, i = 0; + + // If the property has already been mapped... + if ( cssProps[prop] ) { + return elem.css( cssProps[prop] ); + } + + while ( (cur = props[i++]) ) { + if ( (val = elem.css( cur )) !== undefined ) { + return cssProps[prop] = cur, val; + } + } + } + + // Parse a given elements CSS property into an int + function intCss( elem, prop ) { + return Math.ceil( parseFloat( vendorCss( elem, prop ) ) ); + } + + + // VML creation (for IE only) + if ( !HASCANVAS ) { + var createVML = function( tag, props, style ) { + return ''; + }; + } + + // Canvas only definitions + else { + var PIXEL_RATIO = window.devicePixelRatio || 1, + BACKING_STORE_RATIO = (function() { + var context = document.createElement( 'canvas' ).getContext( '2d' ); + return context.backingStorePixelRatio || context.webkitBackingStorePixelRatio || context.mozBackingStorePixelRatio || + context.msBackingStorePixelRatio || context.oBackingStorePixelRatio || 1; + }()), + SCALE = PIXEL_RATIO / BACKING_STORE_RATIO; + } + + + function Tip( qtip, options ) { + this._ns = 'tip'; + this.options = options; + this.offset = options.offset; + this.size = [options.width, options.height]; + + // Initialize + this.init( (this.qtip = qtip) ); + } + + $.extend( + Tip.prototype, { + init: function( qtip ) { + var context, tip; + + // Create tip element and prepend to the tooltip + tip = this.element = qtip.elements.tip = $( + '
', {'class': NAMESPACE + '-tip'} + ).prependTo( qtip.tooltip ); + + // Create tip drawing element(s) + if ( HASCANVAS ) { + // save() as soon as we create the canvas element so FF2 doesn't bork on our first restore()! + context = $( '' ).appendTo( this.element )[0].getContext( '2d' ); + + // Setup constant parameters + context.lineJoin = 'miter'; + context.miterLimit = 100000; + context.save(); + } + else { + context = createVML( 'shape', 'coordorigin="0,0"', 'position:absolute;' ); + this.element.html( context + context ); + + // Prevent mousing down on the tip since it causes problems with .live() handling in IE due to VML + qtip._bind( + $( '*', tip ).add( tip ), ['click', 'mousedown'], function( event ) { + event.stopPropagation(); + }, this._ns + ); + } + + // Bind update events + qtip._bind( qtip.tooltip, 'tooltipmove', this.reposition, this._ns, this ); + + // Create it + this.create(); + }, + + _swapDimensions: function() { + this.size[0] = this.options.height; + this.size[1] = this.options.width; + }, + _resetDimensions: function() { + this.size[0] = this.options.width; + this.size[1] = this.options.height; + }, + + _useTitle: function( corner ) { + var titlebar = this.qtip.elements.titlebar; + return titlebar && ( + corner.y === TOP || (corner.y === CENTER && this.element.position().top + (this.size[1] / 2) + this.options.offset < titlebar.outerHeight( TRUE )) + ); + }, + + _parseCorner: function( corner ) { + var my = this.qtip.options.position.my; + + // Detect corner and mimic properties + if ( corner === FALSE || my === FALSE ) { + corner = FALSE; + } + else if ( corner === TRUE ) { + corner = new CORNER( my.string() ); + } + else if ( !corner.string ) { + corner = new CORNER( corner ); + corner.fixed = TRUE; + } + + return corner; + }, + + _parseWidth: function( corner, side, use ) { + var elements = this.qtip.elements, + prop = BORDER + camel( side ) + 'Width'; + + return (use ? intCss( use, prop ) : ( + intCss( elements.content, prop ) || + intCss( this._useTitle( corner ) && elements.titlebar || elements.content, prop ) || + intCss( elements.tooltip, prop ) + )) || 0; + }, + + _parseRadius: function( corner ) { + var elements = this.qtip.elements, + prop = BORDER + camel( corner.y ) + camel( corner.x ) + 'Radius'; + + return BROWSER.ie < 9 ? 0 : + intCss( this._useTitle( corner ) && elements.titlebar || elements.content, prop ) || + intCss( elements.tooltip, prop ) || 0; + }, + + _invalidColour: function( elem, prop, compare ) { + var val = elem.css( prop ); + return !val || (compare && val === elem.css( compare )) || INVALID.test( val ) ? FALSE : val; + }, + + _parseColours: function( corner ) { + var elements = this.qtip.elements, + tip = this.element.css( 'cssText', '' ), + borderSide = BORDER + camel( corner[corner.precedance] ) + camel( COLOR ), + colorElem = this._useTitle( corner ) && elements.titlebar || elements.content, + css = this._invalidColour, color = []; + + // Attempt to detect the background colour from various elements, left-to-right precedance + color[0] = css( tip, BG_COLOR ) || css( colorElem, BG_COLOR ) || css( + elements.content, BG_COLOR + ) || + css( elements.tooltip, BG_COLOR ) || tip.css( BG_COLOR ); + + // Attempt to detect the correct border side colour from various elements, left-to-right precedance + color[1] = css( tip, borderSide, COLOR ) || css( colorElem, borderSide, COLOR ) || + css( elements.content, borderSide, COLOR ) || css( + elements.tooltip, borderSide, COLOR + ) || elements.tooltip.css( borderSide ); + + // Reset background and border colours + $( '*', tip ).add( tip ).css( + 'cssText', + BG_COLOR + ':' + TRANSPARENT + IMPORTANT + ';' + BORDER + ':0' + IMPORTANT + ';' + ); + + return color; + }, + + _calculateSize: function( corner ) { + var y = corner.precedance === Y, + width = this.options['width'], + height = this.options['height'], + isCenter = corner.abbrev() === 'c', + base = (y ? width : height) * (isCenter ? 0.5 : 1), + pow = Math.pow, + round = Math.round, + bigHyp, ratio, result, + + smallHyp = Math.sqrt( pow( base, 2 ) + pow( height, 2 ) ), + hyp = [(this.border / base) * smallHyp, (this.border / height) * smallHyp]; + + hyp[2] = Math.sqrt( pow( hyp[0], 2 ) - pow( this.border, 2 ) ); + hyp[3] = Math.sqrt( pow( hyp[1], 2 ) - pow( this.border, 2 ) ); + + bigHyp = smallHyp + hyp[2] + hyp[3] + (isCenter ? 0 : hyp[0]); + ratio = bigHyp / smallHyp; + + result = [round( ratio * width ), round( ratio * height )]; + return y ? result : result.reverse(); + }, + + // Tip coordinates calculator + _calculateTip: function( corner, size, scale ) { + scale = scale || 1; + size = size || this.size; + + var width = size[0] * scale, + height = size[1] * scale, + width2 = Math.ceil( width / 2 ), height2 = Math.ceil( height / 2 ), + + // Define tip coordinates in terms of height and width values + tips = { + br: [0, 0, width, height, width, 0], + bl: [0, 0, width, 0, 0, height], + tr: [0, height, width, 0, width, height], + tl: [0, 0, 0, height, width, height], + tc: [0, height, width2, 0, width, height], + bc: [0, 0, width, 0, width2, height], + rc: [0, 0, width, height2, 0, height], + lc: [width, 0, width, height, 0, height2] + }; + + // Set common side shapes + tips.lt = tips.br; + tips.rt = tips.bl; + tips.lb = tips.tr; + tips.rb = tips.tl; + + return tips[corner.abbrev()]; + }, + + // Tip coordinates drawer (canvas) + _drawCoords: function( context, coords ) { + context.beginPath(); + context.moveTo( coords[0], coords[1] ); + context.lineTo( coords[2], coords[3] ); + context.lineTo( coords[4], coords[5] ); + context.closePath(); + }, + + create: function() { + // Determine tip corner + var c = this.corner = (HASCANVAS || BROWSER.ie) && this._parseCorner( this.options.corner ); + + // If we have a tip corner... + if ( (this.enabled = !!this.corner && this.corner.abbrev() !== 'c') ) { + // Cache it + this.qtip.cache.corner = c.clone(); + + // Create it + this.update(); + } + + // Toggle tip element + this.element.toggle( this.enabled ); + + return this.corner; + }, + + update: function( corner, position ) { + if ( !this.enabled ) { + return this; + } + + var elements = this.qtip.elements, + tip = this.element, + inner = tip.children(), + options = this.options, + curSize = this.size, + mimic = options.mimic, + round = Math.round, + color, precedance, context, + coords, bigCoords, translate, newSize, border, BACKING_STORE_RATIO; + + // Re-determine tip if not already set + if ( !corner ) { + corner = this.qtip.cache.corner || this.corner; + } + + // Use corner property if we detect an invalid mimic value + if ( mimic === FALSE ) { + mimic = corner; + } + + // Otherwise inherit mimic properties from the corner object as necessary + else { + mimic = new CORNER( mimic ); + mimic.precedance = corner.precedance; + + if ( mimic.x === 'inherit' ) { + mimic.x = corner.x; + } + else if ( mimic.y === 'inherit' ) { + mimic.y = corner.y; + } + else if ( mimic.x === mimic.y ) { + mimic[corner.precedance] = corner[corner.precedance]; + } + } + precedance = mimic.precedance; + + // Ensure the tip width.height are relative to the tip position + if ( corner.precedance === X ) { + this._swapDimensions(); + } + else { + this._resetDimensions(); + } + + // Update our colours + color = this.color = this._parseColours( corner ); + + // Detect border width, taking into account colours + if ( color[1] !== TRANSPARENT ) { + // Grab border width + border = this.border = this._parseWidth( corner, corner[corner.precedance] ); + + // If border width isn't zero, use border color as fill if it's not invalid (1.0 style tips) + if ( options.border && border < 1 && !INVALID.test( color[1] ) ) { + color[0] = color[1]; + } + + // Set border width (use detected border width if options.border is true) + this.border = border = options.border !== TRUE ? options.border : border; + } + + // Border colour was invalid, set border to zero + else { + this.border = border = 0; + } + + // Determine tip size + newSize = this.size = this._calculateSize( corner ); + tip.css( + { + width: newSize[0], + height: newSize[1], + lineHeight: newSize[1] + 'px' + } + ); + + // Calculate tip translation + if ( corner.precedance === Y ) { + translate = [ + round( mimic.x === LEFT ? border : mimic.x === RIGHT ? newSize[0] - curSize[0] - border : (newSize[0] - curSize[0]) / 2 ), + round( mimic.y === TOP ? newSize[1] - curSize[1] : 0 ) + ]; + } + else { + translate = [ + round( mimic.x === LEFT ? newSize[0] - curSize[0] : 0 ), + round( mimic.y === TOP ? border : mimic.y === BOTTOM ? newSize[1] - curSize[1] - border : (newSize[1] - curSize[1]) / 2 ) + ]; + } + + // Canvas drawing implementation + if ( HASCANVAS ) { + // Grab canvas context and clear/save it + context = inner[0].getContext( '2d' ); + context.restore(); + context.save(); + context.clearRect( 0, 0, 6000, 6000 ); + + // Calculate coordinates + coords = this._calculateTip( mimic, curSize, SCALE ); + bigCoords = this._calculateTip( mimic, this.size, SCALE ); + + // Set the canvas size using calculated size + inner.attr( WIDTH, newSize[0] * SCALE ).attr( HEIGHT, newSize[1] * SCALE ); + inner.css( WIDTH, newSize[0] ).css( HEIGHT, newSize[1] ); + + // Draw the outer-stroke tip + this._drawCoords( context, bigCoords ); + context.fillStyle = color[1]; + context.fill(); + + // Draw the actual tip + context.translate( translate[0] * SCALE, translate[1] * SCALE ); + this._drawCoords( context, coords ); + context.fillStyle = color[0]; + context.fill(); + } + + // VML (IE Proprietary implementation) + else { + // Calculate coordinates + coords = this._calculateTip( mimic ); + + // Setup coordinates string + coords = 'm' + coords[0] + ',' + coords[1] + ' l' + coords[2] + + ',' + coords[3] + ' ' + coords[4] + ',' + coords[5] + ' xe'; + + // Setup VML-specific offset for pixel-perfection + translate[2] = border && /^(r|b)/i.test( corner.string() ) ? + BROWSER.ie === 8 ? 2 : 1 : 0; + + // Set initial CSS + inner.css( + { + coordsize: (newSize[0] + border) + ' ' + (newSize[1] + border), + antialias: '' + (mimic.string().indexOf( CENTER ) > -1), + left: translate[0] - (translate[2] * Number( precedance === X )), + top: translate[1] - (translate[2] * Number( precedance === Y )), + width: newSize[0] + border, + height: newSize[1] + border + } + ) + .each( + function( i ) { + var $this = $( this ); + + // Set shape specific attributes + $this[$this.prop ? 'prop' : 'attr']( + { + coordsize: (newSize[0] + border) + ' ' + (newSize[1] + border), + path: coords, + fillcolor: color[0], + filled: !!i, + stroked: !i + } + ) + .toggle( !!(border || i) ); + + // Check if border is enabled and add stroke element + !i && $this.html( + createVML( + 'stroke', + 'weight="' + (border * 2) + 'px" color="' + color[1] + '" miterlimit="1000" joinstyle="miter"' + ) + ); + } + ); + } + + // Opera bug #357 - Incorrect tip position + // https://github.com/Craga89/qTip2/issues/367 + window.opera && setTimeout( + function() { + elements.tip.css( + { + display: 'inline-block', + visibility: 'visible' + } + ); + }, 1 + ); + + // Position if needed + if ( position !== FALSE ) { + this.calculate( corner, newSize ); + } + }, + + calculate: function( corner, size ) { + if ( !this.enabled ) { + return FALSE; + } + + var self = this, + elements = this.qtip.elements, + tip = this.element, + userOffset = this.options.offset, + isWidget = elements.tooltip.hasClass( 'ui-widget' ), + position = {}, + precedance, corners; + + // Inherit corner if not provided + corner = corner || this.corner; + precedance = corner.precedance; + + // Determine which tip dimension to use for adjustment + size = size || this._calculateSize( corner ); + + // Setup corners and offset array + corners = [corner.x, corner.y]; + if ( precedance === X ) { + corners.reverse(); + } + + // Calculate tip position + $.each( + corners, function( i, side ) { + var b, bc, br; + + if ( side === CENTER ) { + b = precedance === Y ? LEFT : TOP; + position[b] = '50%'; + position[MARGIN + '-' + b] = -Math.round( size[precedance === Y ? 0 : 1] / 2 ) + userOffset; + } + else { + b = self._parseWidth( corner, side, elements.tooltip ); + bc = self._parseWidth( corner, side, elements.content ); + br = self._parseRadius( corner ); + + position[side] = Math.max( + -self.border, i ? bc : (userOffset + (br > b ? br : -b)) + ); + } + } + ); + + // Adjust for tip size + position[corner[precedance]] -= size[precedance === X ? 0 : 1]; + + // Set and return new position + tip.css( {margin: '', top: '', bottom: '', left: '', right: ''} ).css( position ); + return position; + }, + + reposition: function( event, api, pos, viewport ) { + if ( !this.enabled ) { + return; + } + + var cache = api.cache, + newCorner = this.corner.clone(), + adjust = pos.adjusted, + method = api.options.position.adjust.method.split( ' ' ), + horizontal = method[0], + vertical = method[1] || method[0], + shift = {left: FALSE, top: FALSE, x: 0, y: 0}, + offset, css = {}, props; + + function shiftflip( direction, precedance, popposite, side, opposite ) { + // Horizontal - Shift or flip method + if ( direction === SHIFT && newCorner.precedance === precedance && adjust[side] && newCorner[popposite] !== CENTER ) { + newCorner.precedance = newCorner.precedance === X ? Y : X; + } + else if ( direction !== SHIFT && adjust[side] ) { + newCorner[precedance] = newCorner[precedance] === CENTER ? + (adjust[side] > 0 ? side : opposite) : (newCorner[precedance] === side ? opposite : side); + } + } + + function shiftonly( xy, side, opposite ) { + if ( newCorner[xy] === CENTER ) { + css[MARGIN + '-' + side] = shift[xy] = offset[MARGIN + '-' + side] - adjust[side]; + } + else { + props = offset[opposite] !== undefined ? + [adjust[side], -offset[side]] : [-adjust[side], offset[side]]; + + if ( (shift[xy] = Math.max( props[0], props[1] )) > props[0] ) { + pos[side] -= adjust[side]; + shift[side] = FALSE; + } + + css[offset[opposite] !== undefined ? opposite : side] = shift[xy]; + } + } + + // If our tip position isn't fixed e.g. doesn't adjust with viewport... + if ( this.corner.fixed !== TRUE ) { + // Perform shift/flip adjustments + shiftflip( horizontal, X, Y, LEFT, RIGHT ); + shiftflip( vertical, Y, X, TOP, BOTTOM ); + + // Update and redraw the tip if needed (check cached details of last drawn tip) + if ( newCorner.string() !== cache.corner.string() && (cache.cornerTop !== adjust.top || cache.cornerLeft !== adjust.left) ) { + this.update( newCorner, FALSE ); + } + } + + // Setup tip offset properties + offset = this.calculate( newCorner ); + + // Readjust offset object to make it left/top + if ( offset.right !== undefined ) { + offset.left = -offset.right; + } + if ( offset.bottom !== undefined ) { + offset.top = -offset.bottom; + } + offset.user = this.offset; + + // Perform shift adjustments + if ( shift.left = (horizontal === SHIFT && !!adjust.left) ) { + shiftonly( X, LEFT, RIGHT ); + } + if ( shift.top = (vertical === SHIFT && !!adjust.top) ) { + shiftonly( Y, TOP, BOTTOM ); + } + + /* + * If the tip is adjusted in both dimensions, or in a + * direction that would cause it to be anywhere but the + * outer border, hide it! + */ + this.element.css( css ).toggle( + !((shift.x && shift.y) || (newCorner.x === CENTER && shift.y) || (newCorner.y === CENTER && shift.x)) + ); + + // Adjust position to accomodate tip dimensions + pos.left -= offset.left.charAt ? offset.user : + horizontal !== SHIFT || shift.top || !shift.left && !shift.top ? offset.left + this.border : 0; + pos.top -= offset.top.charAt ? offset.user : + vertical !== SHIFT || shift.left || !shift.left && !shift.top ? offset.top + this.border : 0; + + // Cache details + cache.cornerLeft = adjust.left; + cache.cornerTop = adjust.top; + cache.corner = newCorner.clone(); + }, + + destroy: function() { + // Unbind events + this.qtip._unbind( this.qtip.tooltip, this._ns ); + + // Remove the tip element(s) + if ( this.qtip.elements.tip ) { + this.qtip.elements.tip.find( '*' ) + .remove().end().remove(); + } + } + } + ); + + TIP = PLUGINS.tip = function( api ) { + return new Tip( api, api.options.style.tip ); + }; + + // Initialize tip on render + TIP.initialize = 'render'; + + // Setup plugin sanitization options + TIP.sanitize = function( options ) { + if ( options.style && 'tip' in options.style ) { + var opts = options.style.tip; + if ( typeof opts !== 'object' ) { + opts = options.style.tip = {corner: opts}; + } + if ( !(/string|boolean/i).test( typeof opts.corner ) ) { + opts.corner = TRUE; + } + } + }; + + // Add new option checks for the plugin + CHECKS.tip = { + '^position.my|style.tip.(corner|mimic|border)$': function() { + // Make sure a tip can be drawn + this.create(); + + // Reposition the tooltip + this.qtip.reposition(); + }, + '^style.tip.(height|width)$': function( obj ) { + // Re-set dimensions and redraw the tip + this.size = [obj.width, obj.height]; + this.update(); + + // Reposition the tooltip + this.qtip.reposition(); + }, + '^content.title|style.(classes|widget)$': function() { + this.update(); + } + }; + + // Extend original qTip defaults + $.extend( + TRUE, QTIP.defaults, { + style: { + tip: { + corner: TRUE, + mimic: FALSE, + width: 6, + height: 6, + border: TRUE, + offset: 0 + } + } + } + ); + + ; + var MODAL, OVERLAY, + MODALCLASS = 'qtip-modal', + MODALSELECTOR = '.' + MODALCLASS; + + OVERLAY = function() { + var self = this, + focusableElems = {}, + current, onLast, + prevState, elem; + + // Modified code from jQuery UI 1.10.0 source + // http://code.jquery.com/ui/1.10.0/jquery-ui.js + function focusable( element ) { + // Use the defined focusable checker when possible + if ( $.expr[':'].focusable ) { + return $.expr[':'].focusable; + } + + var isTabIndexNotNaN = !isNaN( $.attr( element, 'tabindex' ) ), + nodeName = element.nodeName && element.nodeName.toLowerCase(), + map, mapName, img; + + if ( 'area' === nodeName ) { + map = element.parentNode; + mapName = map.name; + if ( !element.href || !mapName || map.nodeName.toLowerCase() !== 'map' ) { + return false; + } + img = $( 'img[usemap=#' + mapName + ']' )[0]; + return !!img && img.is( ':visible' ); + } + return (/input|select|textarea|button|object/.test( nodeName ) ? + !element.disabled : + 'a' === nodeName ? + element.href || isTabIndexNotNaN : + isTabIndexNotNaN + ); + } + + // Focus inputs using cached focusable elements (see update()) + function focusInputs( blurElems ) { + // Blurring body element in IE causes window.open windows to unfocus! + if ( focusableElems.length < 1 && blurElems.length ) { + blurElems.not( 'body' ).blur(); + } + + // Focus the inputs + else { + focusableElems.first().focus(); + } + } + + // Steal focus from elements outside tooltip + function stealFocus( event ) { + if ( !elem.is( ':visible' ) ) { + return; + } + + var target = $( event.target ), + tooltip = current.tooltip, + container = target.closest( SELECTOR ), + targetOnTop; + + // Determine if input container target is above this + targetOnTop = container.length < 1 ? FALSE : + (parseInt( container[0].style.zIndex, 10 ) > parseInt( tooltip[0].style.zIndex, 10 )); + + // If we're showing a modal, but focus has landed on an input below + // this modal, divert focus to the first visible input in this modal + // or if we can't find one... the tooltip itself + if ( !targetOnTop && target.closest( SELECTOR )[0] !== tooltip[0] ) { + focusInputs( target ); + } + + // Detect when we leave the last focusable element... + onLast = event.target === focusableElems[focusableElems.length - 1]; + } + + $.extend( + self, { + init: function() { + // Create document overlay + elem = self.elem = $( + '
', { + id: 'qtip-overlay', + html: '
', + mousedown: function() { + return FALSE; + } + } + ) + .hide(); + + // Make sure we can't focus anything outside the tooltip + $( document.body ).bind( 'focusin' + MODALSELECTOR, stealFocus ); + + // Apply keyboard "Escape key" close handler + $( document ).bind( + 'keydown' + MODALSELECTOR, function( event ) { + if ( current && current.options.show.modal.escape && event.keyCode === 27 ) { + current.hide( event ); + } + } + ); + + // Apply click handler for blur option + elem.bind( + 'click' + MODALSELECTOR, function( event ) { + if ( current && current.options.show.modal.blur ) { + current.hide( event ); + } + } + ); + + return self; + }, + + update: function( api ) { + // Update current API reference + current = api; + + // Update focusable elements if enabled + if ( api.options.show.modal.stealfocus !== FALSE ) { + focusableElems = api.tooltip.find( '*' ).filter( + function() { + return focusable( this ); + } + ); + } + else { + focusableElems = []; + } + }, + + toggle: function( api, state, duration ) { + var docBody = $( document.body ), + tooltip = api.tooltip, + options = api.options.show.modal, + effect = options.effect, + type = state ? 'show' : 'hide', + visible = elem.is( ':visible' ), + visibleModals = $( MODALSELECTOR ).filter( ':visible:not(:animated)' ).not( tooltip ), + zindex; + + // Set active tooltip API reference + self.update( api ); + + // If the modal can steal the focus... + // Blur the current item and focus anything in the modal we an + if ( state && options.stealfocus !== FALSE ) { + focusInputs( $( ':focus' ) ); + } + + // Toggle backdrop cursor style on show + elem.toggleClass( 'blurs', options.blur ); + + // Append to body on show + if ( state ) { + elem.appendTo( document.body ); + } + + // Prevent modal from conflicting with show.solo, and don't hide backdrop is other modals are visible + if ( (elem.is( ':animated' ) && visible === state && prevState !== FALSE) || (!state && visibleModals.length) ) { + return self; + } + + // Stop all animations + elem.stop( TRUE, FALSE ); + + // Use custom function if provided + if ( $.isFunction( effect ) ) { + effect.call( elem, state ); + } + + // If no effect type is supplied, use a simple toggle + else if ( effect === FALSE ) { + elem[type](); + } + + // Use basic fade function + else { + elem.fadeTo( + parseInt( duration, 10 ) || 90, state ? 1 : 0, function() { + if ( !state ) { + elem.hide(); + } + } + ); + } + + // Reset position and detach from body on hide + if ( !state ) { + elem.queue( + function( next ) { + elem.css( {left: '', top: ''} ); + if ( !$( MODALSELECTOR ).length ) { + elem.detach(); + } + next(); + } + ); + } + + // Cache the state + prevState = state; + + // If the tooltip is destroyed, set reference to null + if ( current.destroyed ) { + current = NULL; + } + + return self; + } + } + ); + + self.init(); + }; + OVERLAY = new OVERLAY(); + + function Modal( api, options ) { + this.options = options; + this._ns = '-modal'; + + this.init( (this.qtip = api) ); + } + + $.extend( + Modal.prototype, { + init: function( qtip ) { + var tooltip = qtip.tooltip; + + // If modal is disabled... return + if ( !this.options.on ) { + return this; + } + + // Set overlay reference + qtip.elements.overlay = OVERLAY.elem; + + // Add unique attribute so we can grab modal tooltips easily via a SELECTOR, and set z-index + tooltip.addClass( MODALCLASS ).css( + 'z-index', QTIP.modal_zindex + $( MODALSELECTOR ).length + ); + + // Apply our show/hide/focus modal events + qtip._bind( + tooltip, ['tooltipshow', 'tooltiphide'], function( event, api, duration ) { + var oEvent = event.originalEvent; + + // Make sure mouseout doesn't trigger a hide when showing the modal and mousing onto backdrop + if ( event.target === tooltip[0] ) { + if ( oEvent && event.type === 'tooltiphide' && /mouse(leave|enter)/.test( oEvent.type ) && $( oEvent.relatedTarget ).closest( OVERLAY.elem[0] ).length ) { + try { + event.preventDefault(); + } catch ( e ) { + } + } + else if ( !oEvent || (oEvent && oEvent.type !== 'tooltipsolo') ) { + this.toggle( event, event.type === 'tooltipshow', duration ); + } + } + }, this._ns, this + ); + + // Adjust modal z-index on tooltip focus + qtip._bind( + tooltip, 'tooltipfocus', function( event, api ) { + // If focus was cancelled before it reached us, don't do anything + if ( event.isDefaultPrevented() || event.target !== tooltip[0] ) { + return; + } + + var qtips = $( MODALSELECTOR ), + + // Keep the modal's lower than other, regular qtips + newIndex = QTIP.modal_zindex + qtips.length, + curIndex = parseInt( tooltip[0].style.zIndex, 10 ); + + // Set overlay z-index + OVERLAY.elem[0].style.zIndex = newIndex - 1; + + // Reduce modal z-index's and keep them properly ordered + qtips.each( + function() { + if ( this.style.zIndex > curIndex ) { + this.style.zIndex -= 1; + } + } + ); + + // Fire blur event for focused tooltip + qtips.filter( '.' + CLASS_FOCUS ).qtip( 'blur', event.originalEvent ); + + // Set the new z-index + tooltip.addClass( CLASS_FOCUS )[0].style.zIndex = newIndex; + + // Set current + OVERLAY.update( api ); + + // Prevent default handling + try { + event.preventDefault(); + } catch ( e ) { + } + }, this._ns, this + ); + + // Focus any other visible modals when this one hides + qtip._bind( + tooltip, 'tooltiphide', function( event ) { + if ( event.target === tooltip[0] ) { + $( MODALSELECTOR ).filter( ':visible' ).not( tooltip ).last().qtip( + 'focus', event + ); + } + }, this._ns, this + ); + }, + + toggle: function( event, state, duration ) { + // Make sure default event hasn't been prevented + if ( event && event.isDefaultPrevented() ) { + return this; + } + + // Toggle it + OVERLAY.toggle( this.qtip, !!state, duration ); + }, + + destroy: function() { + // Remove modal class + this.qtip.tooltip.removeClass( MODALCLASS ); + + // Remove bound events + this.qtip._unbind( this.qtip.tooltip, this._ns ); + + // Delete element reference + OVERLAY.toggle( this.qtip, FALSE ); + delete this.qtip.elements.overlay; + } + } + ); + + + MODAL = PLUGINS.modal = function( api ) { + return new Modal( api, api.options.show.modal ); + }; + + // Setup sanitiztion rules + MODAL.sanitize = function( opts ) { + if ( opts.show ) { + if ( typeof opts.show.modal !== 'object' ) { + opts.show.modal = {on: !!opts.show.modal}; + } + else if ( typeof opts.show.modal.on === 'undefined' ) { + opts.show.modal.on = TRUE; + } + } + }; + + // Base z-index for all modal tooltips (use qTip core z-index as a base) + QTIP.modal_zindex = QTIP.zindex - 200; + + // Plugin needs to be initialized on render + MODAL.initialize = 'render'; + + // Setup option set checks + CHECKS.modal = { + '^show.modal.(on|blur)$': function() { + // Initialise + this.destroy(); + this.init(); + + // Show the modal if not visible already and tooltip is visible + this.qtip.elems.overlay.toggle( + this.qtip.tooltip[0].offsetWidth > 0 + ); + } + }; + + // Extend original api defaults + $.extend( + TRUE, QTIP.defaults, { + show: { + modal: { + on: FALSE, + effect: TRUE, + blur: TRUE, + stealfocus: TRUE, + escape: TRUE + } + } + } + ); + ; + PLUGINS.viewport = function( api, position, posOptions, targetWidth, targetHeight, elemWidth, elemHeight ) { + var target = posOptions.target, + tooltip = api.elements.tooltip, + my = posOptions.my, + at = posOptions.at, + adjust = posOptions.adjust, + method = adjust.method.split( ' ' ), + methodX = method[0], + methodY = method[1] || method[0], + viewport = posOptions.viewport, + container = posOptions.container, + cache = api.cache, + adjusted = {left: 0, top: 0}, + fixed, newMy, newClass, containerOffset, containerStatic, + viewportWidth, viewportHeight, viewportScroll, viewportOffset; + + // If viewport is not a jQuery element, or it's the window/document, or no adjustment method is used... return + if ( !viewport.jquery || target[0] === window || target[0] === document.body || adjust.method === 'none' ) { + return adjusted; + } + + // Cach container details + containerOffset = container.offset() || adjusted; + containerStatic = container.css( 'position' ) === 'static'; + + // Cache our viewport details + fixed = tooltip.css( 'position' ) === 'fixed'; + viewportWidth = viewport[0] === window ? viewport.width() : viewport.outerWidth( FALSE ); + viewportHeight = viewport[0] === window ? viewport.height() : viewport.outerHeight( FALSE ); + viewportScroll = {left: fixed ? 0 : viewport.scrollLeft(), top: fixed ? 0 : viewport.scrollTop()}; + viewportOffset = viewport.offset() || adjusted; + + // Generic calculation method + function calculate( side, otherSide, type, adjust, side1, side2, lengthName, targetLength, elemLength ) { + var initialPos = position[side1], + mySide = my[side], + atSide = at[side], + isShift = type === SHIFT, + myLength = mySide === side1 ? elemLength : mySide === side2 ? -elemLength : -elemLength / 2, + atLength = atSide === side1 ? targetLength : atSide === side2 ? -targetLength : -targetLength / 2, + sideOffset = viewportScroll[side1] + viewportOffset[side1] - (containerStatic ? 0 : containerOffset[side1]), + overflow1 = sideOffset - initialPos, + overflow2 = initialPos + elemLength - (lengthName === WIDTH ? viewportWidth : viewportHeight) - sideOffset, + offset = myLength - (my.precedance === side || mySide === my[otherSide] ? atLength : 0) - (atSide === CENTER ? targetLength / 2 : 0); + + // shift + if ( isShift ) { + offset = (mySide === side1 ? 1 : -1) * myLength; + + // Adjust position but keep it within viewport dimensions + position[side1] += overflow1 > 0 ? overflow1 : overflow2 > 0 ? -overflow2 : 0; + position[side1] = Math.max( + -containerOffset[side1] + viewportOffset[side1], + initialPos - offset, + Math.min( + Math.max( + -containerOffset[side1] + viewportOffset[side1] + (lengthName === WIDTH ? viewportWidth : viewportHeight), + initialPos + offset + ), + position[side1], + + // Make sure we don't adjust complete off the element when using 'center' + mySide === 'center' ? initialPos - myLength : 1E9 + ) + ); + + } + + // flip/flipinvert + else { + // Update adjustment amount depending on if using flipinvert or flip + adjust *= (type === FLIPINVERT ? 2 : 0); + + // Check for overflow on the left/top + if ( overflow1 > 0 && (mySide !== side1 || overflow2 > 0) ) { + position[side1] -= offset + adjust; + newMy.invert( side, side1 ); + } + + // Check for overflow on the bottom/right + else if ( overflow2 > 0 && (mySide !== side2 || overflow1 > 0) ) { + position[side1] -= (mySide === CENTER ? -offset : offset) + adjust; + newMy.invert( side, side2 ); + } + + // Make sure we haven't made things worse with the adjustment and reset if so + if ( position[side1] < viewportScroll && -position[side1] > overflow2 ) { + position[side1] = initialPos; + newMy = my.clone(); + } + } + + return position[side1] - initialPos; + } + + // Set newMy if using flip or flipinvert methods + if ( methodX !== 'shift' || methodY !== 'shift' ) { + newMy = my.clone(); + } + + // Adjust position based onviewport and adjustment options + adjusted = { + left: methodX !== 'none' ? calculate( + X, Y, methodX, adjust.x, LEFT, RIGHT, WIDTH, targetWidth, elemWidth + ) : 0, + top: methodY !== 'none' ? calculate( + Y, X, methodY, adjust.y, TOP, BOTTOM, HEIGHT, targetHeight, elemHeight + ) : 0 + }; + + // Set tooltip position class if it's changed + if ( newMy && cache.lastClass !== (newClass = NAMESPACE + '-pos-' + newMy.abbrev()) ) { + tooltip.removeClass( api.cache.lastClass ).addClass( (api.cache.lastClass = newClass) ); + } + + return adjusted; + }; + ; + PLUGINS.polys = { + // POLY area coordinate calculator + // Special thanks to Ed Cradock for helping out with this. + // Uses a binary search algorithm to find suitable coordinates. + polygon: function( baseCoords, corner ) { + var result = { + width: 0, height: 0, + position: { + top: 1e10, right: 0, + bottom: 0, left: 1e10 + }, + adjustable: FALSE + }, + i = 0, next, + coords = [], + compareX = 1, compareY = 1, + realX = 0, realY = 0, + newWidth, newHeight; + + // First pass, sanitize coords and determine outer edges + i = baseCoords.length; + while ( i-- ) { + next = [parseInt( baseCoords[--i], 10 ), parseInt( baseCoords[i + 1], 10 )]; + + if ( next[0] > result.position.right ) { + result.position.right = next[0]; + } + if ( next[0] < result.position.left ) { + result.position.left = next[0]; + } + if ( next[1] > result.position.bottom ) { + result.position.bottom = next[1]; + } + if ( next[1] < result.position.top ) { + result.position.top = next[1]; + } + + coords.push( next ); + } + + // Calculate height and width from outer edges + newWidth = result.width = Math.abs( result.position.right - result.position.left ); + newHeight = result.height = Math.abs( result.position.bottom - result.position.top ); + + // If it's the center corner... + if ( corner.abbrev() === 'c' ) { + result.position = { + left: result.position.left + (result.width / 2), + top: result.position.top + (result.height / 2) + }; + } + else { + // Second pass, use a binary search algorithm to locate most suitable coordinate + while ( newWidth > 0 && newHeight > 0 && compareX > 0 && compareY > 0 ) { + newWidth = Math.floor( newWidth / 2 ); + newHeight = Math.floor( newHeight / 2 ); + + if ( corner.x === LEFT ) { + compareX = newWidth; + } + else if ( corner.x === RIGHT ) { + compareX = result.width - newWidth; + } + else { + compareX += Math.floor( newWidth / 2 ); + } + + if ( corner.y === TOP ) { + compareY = newHeight; + } + else if ( corner.y === BOTTOM ) { + compareY = result.height - newHeight; + } + else { + compareY += Math.floor( newHeight / 2 ); + } + + i = coords.length; + while ( i-- ) { + if ( coords.length < 2 ) { + break; + } + + realX = coords[i][0] - result.position.left; + realY = coords[i][1] - result.position.top; + + if ( (corner.x === LEFT && realX >= compareX) || + (corner.x === RIGHT && realX <= compareX) || + (corner.x === CENTER && (realX < compareX || realX > (result.width - compareX))) || + (corner.y === TOP && realY >= compareY) || + (corner.y === BOTTOM && realY <= compareY) || + (corner.y === CENTER && (realY < compareY || realY > (result.height - compareY))) ) { + coords.splice( i, 1 ); + } + } + } + result.position = {left: coords[0][0], top: coords[0][1]}; + } + + return result; + }, + + rect: function( ax, ay, bx, by ) { + return { + width: Math.abs( bx - ax ), + height: Math.abs( by - ay ), + position: { + left: Math.min( ax, bx ), + top: Math.min( ay, by ) + } + }; + }, + + _angles: { + tc: 3 / 2, tr: 7 / 4, tl: 5 / 4, + bc: 1 / 2, br: 1 / 4, bl: 3 / 4, + rc: 2, lc: 1, c: 0 + }, + ellipse: function( cx, cy, rx, ry, corner ) { + var c = PLUGINS.polys._angles[corner.abbrev()], + rxc = c === 0 ? 0 : rx * Math.cos( c * Math.PI ), + rys = ry * Math.sin( c * Math.PI ); + + return { + width: (rx * 2) - Math.abs( rxc ), + height: (ry * 2) - Math.abs( rys ), + position: { + left: cx + rxc, + top: cy + rys + }, + adjustable: FALSE + }; + }, + circle: function( cx, cy, r, corner ) { + return PLUGINS.polys.ellipse( cx, cy, r, r, corner ); + } + }; + ; + PLUGINS.svg = function( api, svg, corner ) { + var doc = $( document ), + elem = svg[0], + root = $( elem.ownerSVGElement ), + xScale = 1, yScale = 1, + complex = true, + rootWidth, rootHeight, + mtx, transformed, viewBox, + len, next, i, points, + result, position, dimensions; + + // Ascend the parentNode chain until we find an element with getBBox() + while ( !elem.getBBox ) { + elem = elem.parentNode; + } + if ( !elem.getBBox || !elem.parentNode ) { + return FALSE; + } + + // Determine dimensions where possible + rootWidth = root.attr( 'width' ) || root.width() || parseInt( root.css( 'width' ), 10 ); + rootHeight = root.attr( 'height' ) || root.height() || parseInt( root.css( 'height' ), 10 ); + + // Add stroke characteristics to scaling + var strokeWidth2 = (parseInt( svg.css( 'stroke-width' ), 10 ) || 0) / 2; + if ( strokeWidth2 ) { + xScale += strokeWidth2 / rootWidth; + yScale += strokeWidth2 / rootHeight; + } + + // Determine which shape calculation to use + switch ( elem.nodeName ) { + case 'ellipse': + case 'circle': + result = PLUGINS.polys.ellipse( + elem.cx.baseVal.value, + elem.cy.baseVal.value, + (elem.rx || elem.r).baseVal.value + strokeWidth2, + (elem.ry || elem.r).baseVal.value + strokeWidth2, + corner + ); + break; + + case 'line': + case 'polygon': + case 'polyline': + // Determine points object (line has none, so mimic using array) + points = elem.points || [ + {x: elem.x1.baseVal.value, y: elem.y1.baseVal.value}, + {x: elem.x2.baseVal.value, y: elem.y2.baseVal.value} + ]; + + for ( result = [], i = -1, len = points.numberOfItems || points.length; ++i < len; ) { + next = points.getItem ? points.getItem( i ) : points[i]; + result.push.apply( result, [next.x, next.y] ); + } + + result = PLUGINS.polys.polygon( result, corner ); + break; + + // Unknown shape or rectangle? Use bounding box + default: + result = elem.getBoundingClientRect(); + result = { + width: result.width, height: result.height, + position: { + left: result.left, + top: result.top + } + }; + complex = false; + break; + } + + // Shortcut assignments + position = result.position; + root = root[0]; + + // If the shape was complex (i.e. not using bounding box calculations) + if ( complex ) { + // Convert position into a pixel value + if ( root.createSVGPoint ) { + mtx = elem.getScreenCTM(); + points = root.createSVGPoint(); + + points.x = position.left; + points.y = position.top; + transformed = points.matrixTransform( mtx ); + position.left = transformed.x; + position.top = transformed.y; + } + + // Calculate viewBox characteristics + if ( root.viewBox && (viewBox = root.viewBox.baseVal) && viewBox.width && viewBox.height ) { + xScale *= rootWidth / viewBox.width; + yScale *= rootHeight / viewBox.height; + } + } + + // Adjust by scroll offset + position.left += doc.scrollLeft(); + position.top += doc.scrollTop(); + + return result; + }; + ; + PLUGINS.imagemap = function( api, area, corner, adjustMethod ) { + if ( !area.jquery ) { + area = $( area ); + } + + var shape = area.attr( 'shape' ).toLowerCase().replace( 'poly', 'polygon' ), + image = $( 'img[usemap="#' + area.parent( 'map' ).attr( 'name' ) + '"]' ), + coordsString = $.trim( area.attr( 'coords' ) ), + coordsArray = coordsString.replace( /,$/, '' ).split( ',' ), + imageOffset, coords, i, next, result, len; + + // If we can't find the image using the map... + if ( !image.length ) { + return FALSE; + } + + // Pass coordinates string if polygon + if ( shape === 'polygon' ) { + result = PLUGINS.polys.polygon( coordsArray, corner ); + } + + // Otherwise parse the coordinates and pass them as arguments + else if ( PLUGINS.polys[shape] ) { + for ( i = -1, len = coordsArray.length, coords = []; ++i < len; ) { + coords.push( parseInt( coordsArray[i], 10 ) ); + } + + result = PLUGINS.polys[shape].apply( + this, coords.concat( corner ) + ); + } + + // If no shapre calculation method was found, return false + else { + return FALSE; + } + + // Make sure we account for padding and borders on the image + imageOffset = image.offset(); + imageOffset.left += Math.ceil( (image.outerWidth( FALSE ) - image.width()) / 2 ); + imageOffset.top += Math.ceil( (image.outerHeight( FALSE ) - image.height()) / 2 ); + + // Add image position to offset coordinates + result.position.left += imageOffset.left; + result.position.top += imageOffset.top; + + return result; + }; + ; + var IE6, + + /* + * BGIFrame adaption (http://plugins.jquery.com/project/bgiframe) + * Special thanks to Brandon Aaron + */ + BGIFRAME = ''; + + function Ie6( api, qtip ) { + this._ns = 'ie6'; + this.init( (this.qtip = api) ); + } + + $.extend( + Ie6.prototype, { + _scroll: function() { + var overlay = this.qtip.elements.overlay; + overlay && (overlay[0].style.top = $( window ).scrollTop() + 'px'); + }, + + init: function( qtip ) { + var tooltip = qtip.tooltip, + scroll; + + // Create the BGIFrame element if needed + if ( $( 'select, object' ).length < 1 ) { + this.bgiframe = qtip.elements.bgiframe = $( BGIFRAME ).appendTo( tooltip ); + + // Update BGIFrame on tooltip move + qtip._bind( tooltip, 'tooltipmove', this.adjustBGIFrame, this._ns, this ); + } + + // redraw() container for width/height calculations + this.redrawContainer = $( '
', {id: NAMESPACE + '-rcontainer'} ) + .appendTo( document.body ); + + // Fixup modal plugin if present too + if ( qtip.elements.overlay && qtip.elements.overlay.addClass( 'qtipmodal-ie6fix' ) ) { + qtip._bind( window, ['scroll', 'resize'], this._scroll, this._ns, this ); + qtip._bind( tooltip, ['tooltipshow'], this._scroll, this._ns, this ); + } + + // Set dimensions + this.redraw(); + }, + + adjustBGIFrame: function() { + var tooltip = this.qtip.tooltip, + dimensions = { + height: tooltip.outerHeight( FALSE ), + width: tooltip.outerWidth( FALSE ) + }, + plugin = this.qtip.plugins.tip, + tip = this.qtip.elements.tip, + tipAdjust, offset; + + // Adjust border offset + offset = parseInt( tooltip.css( 'borderLeftWidth' ), 10 ) || 0; + offset = {left: -offset, top: -offset}; + + // Adjust for tips plugin + if ( plugin && tip ) { + tipAdjust = (plugin.corner.precedance === 'x') ? [WIDTH, LEFT] : [HEIGHT, TOP]; + offset[tipAdjust[1]] -= tip[tipAdjust[0]](); + } + + // Update bgiframe + this.bgiframe.css( offset ).css( dimensions ); + }, + + // Max/min width simulator function + redraw: function() { + if ( this.qtip.rendered < 1 || this.drawing ) { + return this; + } + + var tooltip = this.qtip.tooltip, + style = this.qtip.options.style, + container = this.qtip.options.position.container, + perc, width, max, min; + + // Set drawing flag + this.qtip.drawing = 1; + + // If tooltip has a set height/width, just set it... like a boss! + if ( style.height ) { + tooltip.css( HEIGHT, style.height ); + } + if ( style.width ) { + tooltip.css( WIDTH, style.width ); + } + + // Simulate max/min width if not set width present... + else { + // Reset width and add fluid class + tooltip.css( WIDTH, '' ).appendTo( this.redrawContainer ); + + // Grab our tooltip width (add 1 if odd so we don't get wrapping problems.. huzzah!) + width = tooltip.width(); + if ( width % 2 < 1 ) { + width += 1; + } + + // Grab our max/min properties + max = tooltip.css( 'maxWidth' ) || ''; + min = tooltip.css( 'minWidth' ) || ''; + + // Parse into proper pixel values + perc = (max + min).indexOf( '%' ) > -1 ? container.width() / 100 : 0; + max = ((max.indexOf( '%' ) > -1 ? perc : 1) * parseInt( max, 10 )) || width; + min = ((min.indexOf( '%' ) > -1 ? perc : 1) * parseInt( min, 10 )) || 0; + + // Determine new dimension size based on max/min/current values + width = max + min ? Math.min( Math.max( width, min ), max ) : width; + + // Set the newly calculated width and remvoe fluid class + tooltip.css( WIDTH, Math.round( width ) ).appendTo( container ); + } + + // Set drawing flag + this.drawing = 0; + + return this; + }, + + destroy: function() { + // Remove iframe + this.bgiframe && this.bgiframe.remove(); + + // Remove bound events + this.qtip._unbind( [window, this.qtip.tooltip], this._ns ); + } + } + ); + + IE6 = PLUGINS.ie6 = function( api ) { + // Proceed only if the browser is IE6 + return BROWSER.ie === 6 ? new Ie6( api ) : FALSE; + }; + + IE6.initialize = 'render'; + + CHECKS.ie6 = { + '^content|style$': function() { + this.redraw(); + } + }; + ; + } + )); + }( window, document )); +} + + + + diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/qtip/jquery.qtip.min.js b/plugins/legacy-admin/framework/core/assets/js/vendor/qtip/jquery.qtip.min.js new file mode 100644 index 000000000..291133fda --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/qtip/jquery.qtip.min.js @@ -0,0 +1,3 @@ +/* qTip2 v2.2.0 None | qtip2.com | Licensed MIT, GPL | Sun Dec 15 2013 23:29:05 */ +if ( typeof jQuery.qtip === 'undefined' ) {!function(a,b,c){!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):jQuery&&!jQuery.fn.qtip&&a(jQuery)}(function(d){"use strict";function e(a,b,c,e){this.id=c,this.target=a,this.tooltip=A,this.elements={target:a},this._id=J+"-"+c,this.timers={img:{}},this.options=b,this.plugins={},this.cache={event:{},target:d(),disabled:z,attr:e,onTooltip:z,lastClass:""},this.rendered=this.destroyed=this.disabled=this.waiting=this.hiddenDuringWait=this.positioning=this.triggering=z}function f(a){return a===A||"object"!==d.type(a)}function g(a){return!(d.isFunction(a)||a&&a.attr||a.length||"object"===d.type(a)&&(a.jquery||a.then))}function h(a){var b,c,e,h;return f(a)?z:(f(a.metadata)&&(a.metadata={type:a.metadata}),"content"in a&&(b=a.content,f(b)||b.jquery||b.done?b=a.content={text:c=g(b)?z:b}:c=b.text,"ajax"in b&&(e=b.ajax,h=e&&e.once!==z,delete b.ajax,b.text=function(a,b){var f=c||d(this).attr(b.options.content.attr)||"Loading...",g=d.ajax(d.extend({},e,{context:b})).then(e.success,A,e.error).then(function(a){return a&&h&&b.set("content.text",a),a},function(a,c,d){b.destroyed||0===a.status||b.set("content.text",c+": "+d)});return h?f:(b.set("content.text",f),g)}),"title"in b&&(f(b.title)||(b.button=b.title.button,b.title=b.title.text),g(b.title||z)&&(b.title=z))),"position"in a&&f(a.position)&&(a.position={my:a.position,at:a.position}),"show"in a&&f(a.show)&&(a.show=a.show.jquery?{target:a.show}:a.show===y?{ready:y}:{event:a.show}),"hide"in a&&f(a.hide)&&(a.hide=a.hide.jquery?{target:a.hide}:{event:a.hide}),"style"in a&&f(a.style)&&(a.style={classes:a.style}),d.each(I,function(){this.sanitize&&this.sanitize(a)}),a)}function i(a,b){for(var c,d=0,e=a,f=b.split(".");e=e[f[d++]];)d0?setTimeout(d.proxy(a,this),b):(a.call(this),void 0)}function n(a){return this.tooltip.hasClass(T)?z:(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this.timers.show=m.call(this,function(){this.toggle(y,a)},this.options.show.delay),void 0)}function o(a){if(this.tooltip.hasClass(T))return z;var b=d(a.relatedTarget),c=b.closest(N)[0]===this.tooltip[0],e=b[0]===this.options.show.target[0];if(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this!==b[0]&&"mouse"===this.options.position.target&&c||this.options.hide.fixed&&/mouse(out|leave|move)/.test(a.type)&&(c||e))try{a.preventDefault(),a.stopImmediatePropagation()}catch(f){}else this.timers.hide=m.call(this,function(){this.toggle(z,a)},this.options.hide.delay,this)}function p(a){return this.tooltip.hasClass(T)||!this.options.hide.inactive?z:(clearTimeout(this.timers.inactive),this.timers.inactive=m.call(this,function(){this.hide(a)},this.options.hide.inactive),void 0)}function q(a){this.rendered&&this.tooltip[0].offsetWidth>0&&this.reposition(a)}function r(a,c,e){d(b.body).delegate(a,(c.split?c:c.join($+" "))+$,function(){var a=t.api[d.attr(this,L)];a&&!a.disabled&&e.apply(a,arguments)})}function s(a,c,f){var g,i,j,k,l,m=d(b.body),n=a[0]===b?m:a,o=a.metadata?a.metadata(f.metadata):A,p="html5"===f.metadata.type&&o?o[f.metadata.name]:A,q=a.data(f.metadata.name||"qtipopts");try{q="string"==typeof q?d.parseJSON(q):q}catch(r){}if(k=d.extend(y,{},t.defaults,f,"object"==typeof q?h(q):A,h(p||o)),i=k.position,k.id=c,"boolean"==typeof k.content.text){if(j=a.attr(k.content.attr),k.content.attr===z||!j)return z;k.content.text=j}if(i.container.length||(i.container=m),i.target===z&&(i.target=n),k.show.target===z&&(k.show.target=n),k.show.solo===y&&(k.show.solo=i.container.closest("body")),k.hide.target===z&&(k.hide.target=n),k.position.viewport===y&&(k.position.viewport=i.container),i.container=i.container.eq(0),i.at=new v(i.at,y),i.my=new v(i.my),a.data(J))if(k.overwrite)a.qtip("destroy",!0);else if(k.overwrite===z)return z;return a.attr(K,c),k.suppress&&(l=a.attr("title"))&&a.removeAttr("title").attr(V,l).attr("title",""),g=new e(a,k,c,!!j),a.data(J,g),a.one("remove.qtip-"+c+" removeqtip.qtip-"+c,function(){var a;(a=d(this).data(J))&&a.destroy(!0)}),g}var t,u,v,w,x,y=!0,z=!1,A=null,B="x",C="y",D="top",E="left",F="bottom",G="right",H="center",I={},J="qtip",K="data-hasqtip",L="data-qtip-id",M=["ui-widget","ui-tooltip"],N="."+J,O="click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" "),P=J+"-fixed",Q=J+"-default",R=J+"-focus",S=J+"-hover",T=J+"-disabled",U="_replacedByqTip",V="oldtitle",W={ie:function(){for(var a=3,c=b.createElement("div");(c.innerHTML="")&&c.getElementsByTagName("i")[0];);return a>4?a:0/0}(),iOS:parseFloat((""+(/CPU.*OS ([0-9_]{1,5})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))||z};u=e.prototype,u._when=function(a){return d.when.apply(d,a)},u.render=function(a){if(this.rendered||this.destroyed)return this;var b,c=this,e=this.options,f=this.cache,g=this.elements,h=e.content.text,i=e.content.title,j=e.content.button,k=e.position,l=("."+this._id+" ",[]);return d.attr(this.target[0],"aria-describedby",this._id),this.tooltip=g.tooltip=b=d("
",{id:this._id,"class":[J,Q,e.style.classes,J+"-pos-"+e.position.my.abbrev()].join(" "),width:e.style.width||"",height:e.style.height||"",tracking:"mouse"===k.target&&k.adjust.mouse,role:"alert","aria-live":"polite","aria-atomic":z,"aria-describedby":this._id+"-content","aria-hidden":y}).toggleClass(T,this.disabled).attr(L,this.id).data(J,this).appendTo(k.container).append(g.content=d("
",{"class":J+"-content",id:this._id+"-content","aria-atomic":y})),this.rendered=-1,this.positioning=y,i&&(this._createTitle(),d.isFunction(i)||l.push(this._updateTitle(i,z))),j&&this._createButton(),d.isFunction(h)||l.push(this._updateContent(h,z)),this.rendered=y,this._setWidget(),d.each(I,function(a){var b;"render"===this.initialize&&(b=this(c))&&(c.plugins[a]=b)}),this._unassignEvents(),this._assignEvents(),this._when(l).then(function(){c._trigger("render"),c.positioning=z,c.hiddenDuringWait||!e.show.ready&&!a||c.toggle(y,f.event,z),c.hiddenDuringWait=z}),t.api[this.id]=this,this},u.destroy=function(a){function b(){if(!this.destroyed){this.destroyed=y;var a=this.target,b=a.attr(V);this.rendered&&this.tooltip.stop(1,0).find("*").remove().end().remove(),d.each(this.plugins,function(){this.destroy&&this.destroy()}),clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this._unassignEvents(),a.removeData(J).removeAttr(L).removeAttr(K).removeAttr("aria-describedby"),this.options.suppress&&b&&a.attr("title",b).removeAttr(V),this._unbind(a),this.options=this.elements=this.cache=this.timers=this.plugins=this.mouse=A,delete t.api[this.id]}}return this.destroyed?this.target:(a===y&&"hide"!==this.triggering||!this.rendered?b.call(this):(this.tooltip.one("tooltiphidden",d.proxy(b,this)),!this.triggering&&this.hide()),this.target)},w=u.checks={builtin:{"^id$":function(a,b,c,e){var f=c===y?t.nextid:c,g=J+"-"+f;f!==z&&f.length>0&&!d("#"+g).length?(this._id=g,this.rendered&&(this.tooltip[0].id=this._id,this.elements.content[0].id=this._id+"-content",this.elements.title[0].id=this._id+"-title")):a[b]=e},"^prerender":function(a,b,c){c&&!this.rendered&&this.render(this.options.show.ready)},"^content.text$":function(a,b,c){this._updateContent(c)},"^content.attr$":function(a,b,c,d){this.options.content.text===this.target.attr(d)&&this._updateContent(this.target.attr(c))},"^content.title$":function(a,b,c){return c?(c&&!this.elements.title&&this._createTitle(),this._updateTitle(c),void 0):this._removeTitle()},"^content.button$":function(a,b,c){this._updateButton(c)},"^content.title.(text|button)$":function(a,b,c){this.set("content."+b,c)},"^position.(my|at)$":function(a,b,c){"string"==typeof c&&(a[b]=new v(c,"at"===b))},"^position.container$":function(a,b,c){this.rendered&&this.tooltip.appendTo(c)},"^show.ready$":function(a,b,c){c&&(!this.rendered&&this.render(y)||this.toggle(y))},"^style.classes$":function(a,b,c,d){this.rendered&&this.tooltip.removeClass(d).addClass(c)},"^style.(width|height)":function(a,b,c){this.rendered&&this.tooltip.css(b,c)},"^style.widget|content.title":function(){this.rendered&&this._setWidget()},"^style.def":function(a,b,c){this.rendered&&this.tooltip.toggleClass(Q,!!c)},"^events.(render|show|move|hide|focus|blur)$":function(a,b,c){this.rendered&&this.tooltip[(d.isFunction(c)?"":"un")+"bind"]("tooltip"+b,c)},"^(show|hide|position).(event|target|fixed|inactive|leave|distance|viewport|adjust)":function(){if(this.rendered){var a=this.options.position;this.tooltip.attr("tracking","mouse"===a.target&&a.adjust.mouse),this._unassignEvents(),this._assignEvents()}}}},u.get=function(a){if(this.destroyed)return this;var b=i(this.options,a.toLowerCase()),c=b[0][b[1]];return c.precedance?c.string():c};var X=/^position\.(my|at|adjust|target|container|viewport)|style|content|show\.ready/i,Y=/^prerender|show\.ready/i;u.set=function(a,b){if(this.destroyed)return this;{var c,e=this.rendered,f=z,g=this.options;this.checks}return"string"==typeof a?(c=a,a={},a[c]=b):a=d.extend({},a),d.each(a,function(b,c){if(e&&Y.test(b))return delete a[b],void 0;var h,j=i(g,b.toLowerCase());h=j[0][j[1]],j[0][j[1]]=c&&c.nodeType?d(c):c,f=X.test(b)||f,a[b]=[j[0],j[1],c,h]}),h(g),this.positioning=y,d.each(a,d.proxy(j,this)),this.positioning=z,this.rendered&&this.tooltip[0].offsetWidth>0&&f&&this.reposition("mouse"===g.position.target?A:this.cache.event),this},u._update=function(a,b){var c=this,e=this.cache;return this.rendered&&a?(d.isFunction(a)&&(a=a.call(this.elements.target,e.event,this)||""),d.isFunction(a.then)?(e.waiting=y,a.then(function(a){return e.waiting=z,c._update(a,b)},A,function(a){return c._update(a,b)})):a===z||!a&&""!==a?z:(a.jquery&&a.length>0?b.empty().append(a.css({display:"block",visibility:"visible"})):b.html(a),this._waitForContent(b).then(function(a){a.images&&a.images.length&&c.rendered&&c.tooltip[0].offsetWidth>0&&c.reposition(e.event,!a.length)}))):z},u._waitForContent=function(a){var b=this.cache;return b.waiting=y,(d.fn.imagesLoaded?a.imagesLoaded():d.Deferred().resolve([])).done(function(){b.waiting=z}).promise()},u._updateContent=function(a,b){this._update(a,this.elements.content,b)},u._updateTitle=function(a,b){this._update(a,this.elements.title,b)===z&&this._removeTitle(z)},u._createTitle=function(){var a=this.elements,b=this._id+"-title";a.titlebar&&this._removeTitle(),a.titlebar=d("
",{"class":J+"-titlebar "+(this.options.style.widget?k("header"):"")}).append(a.title=d("
",{id:b,"class":J+"-title","aria-atomic":y})).insertBefore(a.content).delegate(".qtip-close","mousedown keydown mouseup keyup mouseout",function(a){d(this).toggleClass("ui-state-active ui-state-focus","down"===a.type.substr(-4))}).delegate(".qtip-close","mouseover mouseout",function(a){d(this).toggleClass("ui-state-hover","mouseover"===a.type)}),this.options.content.button&&this._createButton()},u._removeTitle=function(a){var b=this.elements;b.title&&(b.titlebar.remove(),b.titlebar=b.title=b.button=A,a!==z&&this.reposition())},u.reposition=function(c,e){if(!this.rendered||this.positioning||this.destroyed)return this;this.positioning=y;var f,g,h=this.cache,i=this.tooltip,j=this.options.position,k=j.target,l=j.my,m=j.at,n=j.viewport,o=j.container,p=j.adjust,q=p.method.split(" "),r=i.outerWidth(z),s=i.outerHeight(z),t=0,u=0,v=i.css("position"),w={left:0,top:0},x=i[0].offsetWidth>0,A=c&&"scroll"===c.type,B=d(a),C=o[0].ownerDocument,J=this.mouse;if(d.isArray(k)&&2===k.length)m={x:E,y:D},w={left:k[0],top:k[1]};else if("mouse"===k)m={x:E,y:D},!J||!J.pageX||!p.mouse&&c&&c.pageX?c&&c.pageX||((!p.mouse||this.options.show.distance)&&h.origin&&h.origin.pageX?c=h.origin:(!c||c&&("resize"===c.type||"scroll"===c.type))&&(c=h.event)):c=J,"static"!==v&&(w=o.offset()),C.body.offsetWidth!==(a.innerWidth||C.documentElement.clientWidth)&&(g=d(b.body).offset()),w={left:c.pageX-w.left+(g&&g.left||0),top:c.pageY-w.top+(g&&g.top||0)},p.mouse&&A&&J&&(w.left-=(J.scrollX||0)-B.scrollLeft(),w.top-=(J.scrollY||0)-B.scrollTop());else{if("event"===k?c&&c.target&&"scroll"!==c.type&&"resize"!==c.type?h.target=d(c.target):c.target||(h.target=this.elements.target):"event"!==k&&(h.target=d(k.jquery?k:this.elements.target)),k=h.target,k=d(k).eq(0),0===k.length)return this;k[0]===b||k[0]===a?(t=W.iOS?a.innerWidth:k.width(),u=W.iOS?a.innerHeight:k.height(),k[0]===a&&(w={top:(n||k).scrollTop(),left:(n||k).scrollLeft()})):I.imagemap&&k.is("area")?f=I.imagemap(this,k,m,I.viewport?q:z):I.svg&&k&&k[0].ownerSVGElement?f=I.svg(this,k,m,I.viewport?q:z):(t=k.outerWidth(z),u=k.outerHeight(z),w=k.offset()),f&&(t=f.width,u=f.height,g=f.offset,w=f.position),w=this.reposition.offset(k,w,o),(W.iOS>3.1&&W.iOS<4.1||W.iOS>=4.3&&W.iOS<4.33||!W.iOS&&"fixed"===v)&&(w.left-=B.scrollLeft(),w.top-=B.scrollTop()),(!f||f&&f.adjustable!==z)&&(w.left+=m.x===G?t:m.x===H?t/2:0,w.top+=m.y===F?u:m.y===H?u/2:0)}return w.left+=p.x+(l.x===G?-r:l.x===H?-r/2:0),w.top+=p.y+(l.y===F?-s:l.y===H?-s/2:0),I.viewport?(w.adjusted=I.viewport(this,w,j,t,u,r,s),g&&w.adjusted.left&&(w.left+=g.left),g&&w.adjusted.top&&(w.top+=g.top)):w.adjusted={left:0,top:0},this._trigger("move",[w,n.elem||n],c)?(delete w.adjusted,e===z||!x||isNaN(w.left)||isNaN(w.top)||"mouse"===k||!d.isFunction(j.effect)?i.css(w):d.isFunction(j.effect)&&(j.effect.call(i,this,d.extend({},w)),i.queue(function(a){d(this).css({opacity:"",height:""}),W.ie&&this.style.removeAttribute("filter"),a()})),this.positioning=z,this):this},u.reposition.offset=function(a,c,e){function f(a,b){c.left+=b*a.scrollLeft(),c.top+=b*a.scrollTop()}if(!e[0])return c;var g,h,i,j,k=d(a[0].ownerDocument),l=!!W.ie&&"CSS1Compat"!==b.compatMode,m=e[0];do"static"!==(h=d.css(m,"position"))&&("fixed"===h?(i=m.getBoundingClientRect(),f(k,-1)):(i=d(m).position(),i.left+=parseFloat(d.css(m,"borderLeftWidth"))||0,i.top+=parseFloat(d.css(m,"borderTopWidth"))||0),c.left-=i.left+(parseFloat(d.css(m,"marginLeft"))||0),c.top-=i.top+(parseFloat(d.css(m,"marginTop"))||0),g||"hidden"===(j=d.css(m,"overflow"))||"visible"===j||(g=d(m)));while(m=m.offsetParent);return g&&(g[0]!==k[0]||l)&&f(g,1),c};var Z=(v=u.reposition.Corner=function(a,b){a=(""+a).replace(/([A-Z])/," $1").replace(/middle/gi,H).toLowerCase(),this.x=(a.match(/left|right/i)||a.match(/center/)||["inherit"])[0].toLowerCase(),this.y=(a.match(/top|bottom|center/i)||["inherit"])[0].toLowerCase(),this.forceY=!!b;var c=a.charAt(0);this.precedance="t"===c||"b"===c?C:B}).prototype;Z.invert=function(a,b){this[a]=this[a]===E?G:this[a]===G?E:b||this[a]},Z.string=function(){var a=this.x,b=this.y;return a===b?a:this.precedance===C||this.forceY&&"center"!==b?b+" "+a:a+" "+b},Z.abbrev=function(){var a=this.string().split(" ");return a[0].charAt(0)+(a[1]&&a[1].charAt(0)||"")},Z.clone=function(){return new v(this.string(),this.forceY)},u.toggle=function(a,c){var e=this.cache,f=this.options,g=this.tooltip;if(c){if(/over|enter/.test(c.type)&&/out|leave/.test(e.event.type)&&f.show.target.add(c.target).length===f.show.target.length&&g.has(c.relatedTarget).length)return this;e.event=l(c)}if(this.waiting&&!a&&(this.hiddenDuringWait=y),!this.rendered)return a?this.render(1):this;if(this.destroyed||this.disabled)return this;var h,i,j,k=a?"show":"hide",m=this.options[k],n=(this.options[a?"hide":"show"],this.options.position),o=this.options.content,p=this.tooltip.css("width"),q=this.tooltip.is(":visible"),r=a||1===m.target.length,s=!c||m.target.length<2||e.target[0]===c.target;return(typeof a).search("boolean|number")&&(a=!q),h=!g.is(":animated")&&q===a&&s,i=h?A:!!this._trigger(k,[90]),this.destroyed?this:(i!==z&&a&&this.focus(c),!i||h?this:(d.attr(g[0],"aria-hidden",!a),a?(e.origin=l(this.mouse),d.isFunction(o.text)&&this._updateContent(o.text,z),d.isFunction(o.title)&&this._updateTitle(o.title,z),!x&&"mouse"===n.target&&n.adjust.mouse&&(d(b).bind("mousemove."+J,this._storeMouse),x=y),p||g.css("width",g.outerWidth(z)),this.reposition(c,arguments[2]),p||g.css("width",""),m.solo&&("string"==typeof m.solo?d(m.solo):d(N,m.solo)).not(g).not(m.target).qtip("hide",d.Event("tooltipsolo"))):(clearTimeout(this.timers.show),delete e.origin,x&&!d(N+'[tracking="true"]:visible',m.solo).not(g).length&&(d(b).unbind("mousemove."+J),x=z),this.blur(c)),j=d.proxy(function(){a?(W.ie&&g[0].style.removeAttribute("filter"),g.css("overflow",""),"string"==typeof m.autofocus&&d(this.options.show.autofocus,g).focus(),this.options.show.target.trigger("qtip-"+this.id+"-inactive")):g.css({display:"",visibility:"",opacity:"",left:"",top:""}),this._trigger(a?"visible":"hidden")},this),m.effect===z||r===z?(g[k](),j()):d.isFunction(m.effect)?(g.stop(1,1),m.effect.call(g,this),g.queue("fx",function(a){j(),a()})):g.fadeTo(90,a?1:0,j),a&&m.target.trigger("qtip-"+this.id+"-inactive"),this))},u.show=function(a){return this.toggle(y,a)},u.hide=function(a){return this.toggle(z,a)},u.focus=function(a){if(!this.rendered||this.destroyed)return this;var b=d(N),c=this.tooltip,e=parseInt(c[0].style.zIndex,10),f=t.zindex+b.length;return c.hasClass(R)||this._trigger("focus",[f],a)&&(e!==f&&(b.each(function(){this.style.zIndex>e&&(this.style.zIndex=this.style.zIndex-1)}),b.filter("."+R).qtip("blur",a)),c.addClass(R)[0].style.zIndex=f),this},u.blur=function(a){return!this.rendered||this.destroyed?this:(this.tooltip.removeClass(R),this._trigger("blur",[this.tooltip.css("zIndex")],a),this)},u.disable=function(a){return this.destroyed?this:("toggle"===a?a=!(this.rendered?this.tooltip.hasClass(T):this.disabled):"boolean"!=typeof a&&(a=y),this.rendered&&this.tooltip.toggleClass(T,a).attr("aria-disabled",a),this.disabled=!!a,this)},u.enable=function(){return this.disable(z)},u._createButton=function(){var a=this,b=this.elements,c=b.tooltip,e=this.options.content.button,f="string"==typeof e,g=f?e:"Close tooltip";b.button&&b.button.remove(),b.button=e.jquery?e:d("",{"class":"qtip-close "+(this.options.style.widget?"":J+"-icon"),title:g,"aria-label":g}).prepend(d("",{"class":"ui-icon ui-icon-close",html:"×"})),b.button.appendTo(b.titlebar||c).attr("role","button").click(function(b){return c.hasClass(T)||a.hide(b),z})},u._updateButton=function(a){if(!this.rendered)return z;var b=this.elements.button;a?this._createButton():b.remove()},u._setWidget=function(){var a=this.options.style.widget,b=this.elements,c=b.tooltip,d=c.hasClass(T);c.removeClass(T),T=a?"ui-state-disabled":"qtip-disabled",c.toggleClass(T,d),c.toggleClass("ui-helper-reset "+k(),a).toggleClass(Q,this.options.style.def&&!a),b.content&&b.content.toggleClass(k("content"),a),b.titlebar&&b.titlebar.toggleClass(k("header"),a),b.button&&b.button.toggleClass(J+"-icon",!a)},u._storeMouse=function(a){(this.mouse=l(a)).type="mousemove"},u._bind=function(a,b,c,e,f){var g="."+this._id+(e?"-"+e:"");b.length&&d(a).bind((b.split?b:b.join(g+" "))+g,d.proxy(c,f||this))},u._unbind=function(a,b){d(a).unbind("."+this._id+(b?"-"+b:""))};var $="."+J;d(function(){r(N,["mouseenter","mouseleave"],function(a){var b="mouseenter"===a.type,c=d(a.currentTarget),e=d(a.relatedTarget||a.target),f=this.options;b?(this.focus(a),c.hasClass(P)&&!c.hasClass(T)&&clearTimeout(this.timers.hide)):"mouse"===f.position.target&&f.hide.event&&f.show.target&&!e.closest(f.show.target[0]).length&&this.hide(a),c.toggleClass(S,b)}),r("["+L+"]",O,p)}),u._trigger=function(a,b,c){var e=d.Event("tooltip"+a);return e.originalEvent=c&&d.extend({},c)||this.cache.event||A,this.triggering=a,this.tooltip.trigger(e,[this].concat(b||[])),this.triggering=z,!e.isDefaultPrevented()},u._bindEvents=function(a,b,c,e,f,g){if(e.add(c).length===e.length){var h=[];b=d.map(b,function(b){var c=d.inArray(b,a);return c>-1?(h.push(a.splice(c,1)[0]),void 0):b}),h.length&&this._bind(c,h,function(a){var b=this.rendered?this.tooltip[0].offsetWidth>0:!1;(b?g:f).call(this,a)})}this._bind(c,a,f),this._bind(e,b,g)},u._assignInitialEvents=function(a){function b(a){return this.disabled||this.destroyed?z:(this.cache.event=l(a),this.cache.target=a?d(a.target):[c],clearTimeout(this.timers.show),this.timers.show=m.call(this,function(){this.render("object"==typeof a||e.show.ready)},e.show.delay),void 0)}var e=this.options,f=e.show.target,g=e.hide.target,h=e.show.event?d.trim(""+e.show.event).split(" "):[],i=e.hide.event?d.trim(""+e.hide.event).split(" "):[];/mouse(over|enter)/i.test(e.show.event)&&!/mouse(out|leave)/i.test(e.hide.event)&&i.push("mouseleave"),this._bind(f,"mousemove",function(a){this._storeMouse(a),this.cache.onTarget=y}),this._bindEvents(h,i,f,g,b,function(){clearTimeout(this.timers.show)}),(e.show.ready||e.prerender)&&b.call(this,a)},u._assignEvents=function(){var c=this,e=this.options,f=e.position,g=this.tooltip,h=e.show.target,i=e.hide.target,j=f.container,k=f.viewport,l=d(b),m=(d(b.body),d(a)),r=e.show.event?d.trim(""+e.show.event).split(" "):[],s=e.hide.event?d.trim(""+e.hide.event).split(" "):[];d.each(e.events,function(a,b){c._bind(g,"toggle"===a?["tooltipshow","tooltiphide"]:["tooltip"+a],b,null,g)}),/mouse(out|leave)/i.test(e.hide.event)&&"window"===e.hide.leave&&this._bind(l,["mouseout","blur"],function(a){/select|option/.test(a.target.nodeName)||a.relatedTarget||this.hide(a)}),e.hide.fixed?i=i.add(g.addClass(P)):/mouse(over|enter)/i.test(e.show.event)&&this._bind(i,"mouseleave",function(){clearTimeout(this.timers.show)}),(""+e.hide.event).indexOf("unfocus")>-1&&this._bind(j.closest("html"),["mousedown","touchstart"],function(a){var b=d(a.target),c=this.rendered&&!this.tooltip.hasClass(T)&&this.tooltip[0].offsetWidth>0,e=b.parents(N).filter(this.tooltip[0]).length>0;b[0]===this.target[0]||b[0]===this.tooltip[0]||e||this.target.has(b[0]).length||!c||this.hide(a)}),"number"==typeof e.hide.inactive&&(this._bind(h,"qtip-"+this.id+"-inactive",p),this._bind(i.add(g),t.inactiveEvents,p,"-inactive")),this._bindEvents(r,s,h,i,n,o),this._bind(h.add(g),"mousemove",function(a){if("number"==typeof e.hide.distance){var b=this.cache.origin||{},c=this.options.hide.distance,d=Math.abs;(d(a.pageX-b.pageX)>=c||d(a.pageY-b.pageY)>=c)&&this.hide(a)}this._storeMouse(a)}),"mouse"===f.target&&f.adjust.mouse&&(e.hide.event&&this._bind(h,["mouseenter","mouseleave"],function(a){this.cache.onTarget="mouseenter"===a.type}),this._bind(l,"mousemove",function(a){this.rendered&&this.cache.onTarget&&!this.tooltip.hasClass(T)&&this.tooltip[0].offsetWidth>0&&this.reposition(a)})),(f.adjust.resize||k.length)&&this._bind(d.event.special.resize?k:m,"resize",q),f.adjust.scroll&&this._bind(m.add(f.container),"scroll",q)},u._unassignEvents=function(){var c=[this.options.show.target[0],this.options.hide.target[0],this.rendered&&this.tooltip[0],this.options.position.container[0],this.options.position.viewport[0],this.options.position.container.closest("html")[0],a,b];this._unbind(d([]).pushStack(d.grep(c,function(a){return"object"==typeof a})))},t=d.fn.qtip=function(a,b,e){var f=(""+a).toLowerCase(),g=A,i=d.makeArray(arguments).slice(1),j=i[i.length-1],k=this[0]?d.data(this[0],J):A;return!arguments.length&&k||"api"===f?k:"string"==typeof a?(this.each(function(){var a=d.data(this,J);if(!a)return y;if(j&&j.timeStamp&&(a.cache.event=j),!b||"option"!==f&&"options"!==f)a[f]&&a[f].apply(a,i);else{if(e===c&&!d.isPlainObject(b))return g=a.get(b),z;a.set(b,e)}}),g!==A?g:this):"object"!=typeof a&&arguments.length?void 0:(k=h(d.extend(y,{},a)),this.each(function(a){var b,c;return c=d.isArray(k.id)?k.id[a]:k.id,c=!c||c===z||c.length<1||t.api[c]?t.nextid++:c,b=s(d(this),c,k),b===z?y:(t.api[c]=b,d.each(I,function(){"initialize"===this.initialize&&this(b)}),b._assignInitialEvents(j),void 0)}))},d.qtip=e,t.api={},d.each({attr:function(a,b){if(this.length){var c=this[0],e="title",f=d.data(c,"qtip");if(a===e&&f&&"object"==typeof f&&f.options.suppress)return arguments.length<2?d.attr(c,V):(f&&f.options.content.attr===e&&f.cache.attr&&f.set("content.text",b),this.attr(V,b))}return d.fn["attr"+U].apply(this,arguments)},clone:function(a){var b=(d([]),d.fn["clone"+U].apply(this,arguments));return a||b.filter("["+V+"]").attr("title",function(){return d.attr(this,V)}).removeAttr(V),b}},function(a,b){if(!b||d.fn[a+U])return y;var c=d.fn[a+U]=d.fn[a];d.fn[a]=function(){return b.apply(this,arguments)||c.apply(this,arguments)}}),d.ui||(d["cleanData"+U]=d.cleanData,d.cleanData=function(a){for(var b,c=0;(b=d(a[c])).length;c++)if(b.attr(K))try{b.triggerHandler("removeqtip")}catch(e){}d["cleanData"+U].apply(this,arguments)}),t.version="2.2.0",t.nextid=0,t.inactiveEvents=O,t.zindex=15e3,t.defaults={prerender:z,id:z,overwrite:y,suppress:y,content:{text:y,attr:"title",title:z,button:z},position:{my:"top left",at:"bottom right",target:z,container:z,viewport:z,adjust:{x:0,y:0,mouse:y,scroll:y,resize:y,method:"flipinvert flipinvert"},effect:function(a,b){d(this).animate(b,{duration:200,queue:z})}},show:{target:z,event:"mouseenter",effect:y,delay:90,solo:z,ready:z,autofocus:z},hide:{target:z,event:"mouseleave",effect:y,delay:0,fixed:z,inactive:z,leave:"window",distance:z},style:{classes:"",widget:z,width:z,height:z,def:y},events:{render:A,move:A,show:A,hide:A,toggle:A,visible:A,hidden:A,focus:A,blur:A}}})}(window,document);} +//# sourceMappingURL=http://cdnjs.cloudflare.com/ajax/libs/qtip2/2.2.0//var/www/qtip2/build/tmp/tmp-9404qaj6jps/jquery.qtip.min.map \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/redux.select2.sortable.js b/plugins/legacy-admin/framework/core/assets/js/vendor/redux.select2.sortable.js new file mode 100644 index 000000000..896c1adcc --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/redux.select2.sortable.js @@ -0,0 +1,152 @@ +/** + * jQuery Select2 Sortable + * - enable select2 to be sortable via normal select element + * + * author : Vafour + * modified : Kevin Provance (kprovance) + * inspired by : jQuery Chosen Sortable (https://github.com/mrhenry/jquery-chosen-sortable) + * License : GPL + */ + +(function ($) { + $.fn.extend({ + select2SortableOrder: function () { + var $this = this.filter('[multiple]'); + + $this.each(function () { + var $select = $(this); + + // skip elements not select2-ed + if (typeof ($select.data('select2')) !== 'object') { + return false; + } + + var $select2 = $select.siblings('.select2-container'); + var sorted; + + // Opt group names + var optArr = []; + + $select.find('optgroup').each(function(idx, val) { + optArr.push (val); + }); + + $select.find('option').each(function(idx, val) { + var groupName = $(this).parent('optgroup').prop('label'); + var optVal = this; + + if (groupName === undefined) { + if (this.value !== '' && !this.selected) { + optArr.push (optVal); + } + } + }); + + sorted = $($select2.find('.select2-choices li[class!="select2-search-field"]').map(function () { + if (!this) { + return undefined; + } + + if($(this).data('select2Data') != undefined){ + var id = $(this).data('select2Data').id; + return $select.find('option[value="' + id + '"]')[0]; + } + + + //var id = $(this).data('select2Data').id; + + //return $select.find('option[value="' + id + '"]')[0]; + })); + + sorted.push.apply(sorted, optArr); + + $select.children().remove(); + $select.append(sorted); + }); + + return $this; + }, + + select2Sortable: function () { + var args = Array.prototype.slice.call(arguments, 0); + $this = this.filter('[multiple]'), + validMethods = ['destroy']; + + if (args.length === 0 || typeof (args[0]) === 'object') { + var defaultOptions = { + bindOrder: 'formSubmit', // or sortableStop + sortableOptions: { + placeholder: 'ui-state-highlight', + items: 'li:not(.select2-search-field)', + tolerance: 'pointer' + } + }; + + var options = $.extend(defaultOptions, args[0]); + + // Init select2 only if not already initialized to prevent select2 configuration loss + if (typeof ($this.data('select2')) !== 'object') { + $this.select2(); + } + + $this.each(function () { + var $select = $(this) + var $select2choices = $select.siblings('.select2-container').find('.select2-choices'); + + // Init jQuery UI Sortable + $select2choices.sortable(options.sortableOptions); + + switch (options.bindOrder) { + case 'sortableStop': + // apply options ordering in sortstop event + $select2choices.on("sortstop.select2sortable", function (event, ui) { + $select.select2SortableOrder(); + }); + + $select.on('change', function (e) { + $(this).select2SortableOrder(); + }); + break; + + default: + // apply options ordering in form submit + $select.closest('form').unbind('submit.select2sortable').on('submit.select2sortable', function () { + $select.select2SortableOrder(); + }); + break; + } + }); + } + else if (typeof (args[0] === 'string')) { + if ($.inArray(args[0], validMethods) == -1) { + throw "Unknown method: " + args[0]; + } + + if (args[0] === 'destroy') { + $this.select2SortableDestroy(); + } + } + + return $this; + }, + + select2SortableDestroy: function () { + var $this = this.filter('[multiple]'); + $this.each(function () { + var $select = $(this) + var $select2choices = $select.parent().find('.select2-choices'); + + // unbind form submit event + $select.closest('form').unbind('submit.select2sortable'); + + // unbind sortstop event + $select2choices.unbind("sortstop.select2sortable"); + + // destroy select2Sortable + $select2choices.sortable('destroy'); + }); + + return $this; + } + }); +}(jQuery)); \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/redux.select2.sortable.min.js b/plugins/legacy-admin/framework/core/assets/js/vendor/redux.select2.sortable.min.js new file mode 100644 index 000000000..91a4968a6 --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/redux.select2.sortable.min.js @@ -0,0 +1 @@ +!function(a){a.fn.extend({select2SortableOrder:function(){var b=this.filter("[multiple]");return b.each(function(){var b=a(this);if("object"!=typeof b.data("select2"))return!1;var c,d=b.siblings(".select2-container"),e=[];b.find("optgroup").each(function(a,b){e.push(b)}),b.find("option").each(function(){var b=a(this).parent("optgroup").prop("label"),c=this;void 0===b&&(""===this.value||this.selected||e.push(c))}),c=a(d.find('.select2-choices li[class!="select2-search-field"]').map(function(){if(!this)return void 0;if(void 0!=a(this).data("select2Data")){var c=a(this).data("select2Data").id;return b.find('option[value="'+c+'"]')[0]}})),c.push.apply(c,e),b.children().remove(),b.append(c)}),b},select2Sortable:function(){var b=Array.prototype.slice.call(arguments,0);if($this=this.filter("[multiple]"),validMethods=["destroy"],0===b.length||"object"==typeof b[0]){var c={bindOrder:"formSubmit",sortableOptions:{placeholder:"ui-state-highlight",items:"li:not(.select2-search-field)",tolerance:"pointer"}},d=a.extend(c,b[0]);"object"!=typeof $this.data("select2")&&$this.select2(),$this.each(function(){var b=a(this),c=b.siblings(".select2-container").find(".select2-choices");switch(c.sortable(d.sortableOptions),d.bindOrder){case"sortableStop":c.on("sortstop.select2sortable",function(){b.select2SortableOrder()}),b.on("change",function(){a(this).select2SortableOrder()});break;default:b.closest("form").unbind("submit.select2sortable").on("submit.select2sortable",function(){b.select2SortableOrder()})}})}else{if(-1==a.inArray(b[0],validMethods))throw"Unknown method: "+b[0];"destroy"===b[0]&&$this.select2SortableDestroy()}return $this},select2SortableDestroy:function(){var b=this.filter("[multiple]");return b.each(function(){var b=a(this),c=b.parent().find(".select2-choices");b.closest("form").unbind("submit.select2sortable"),c.unbind("sortstop.select2sortable"),c.sortable("destroy")}),b}})}(jQuery); \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/README.md b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/README.md new file mode 100644 index 000000000..64380c451 --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/README.md @@ -0,0 +1,114 @@ +Select2 +======= + +Select2 is a jQuery-based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results. + +To get started, checkout examples and documentation at http://ivaynberg.github.com/select2 + +Use cases +--------- + +* Enhancing native selects with search. +* Enhancing native selects with a better multi-select interface. +* Loading data from JavaScript: easily load items via ajax and have them searchable. +* Nesting optgroups: native selects only support one level of nested. Select2 does not have this restriction. +* Tagging: ability to add new items on the fly. +* Working with large, remote datasets: ability to partially load a dataset based on the search term. +* Paging of large datasets: easy support for loading more pages when the results are scrolled to the end. +* Templating: support for custom rendering of results and selections. + +Browser compatibility +--------------------- +* IE 8+ +* Chrome 8+ +* Firefox 10+ +* Safari 3+ +* Opera 10.6+ + +Usage +----- +You can source Select2 directly from a CDN like [JSDliver](http://www.jsdelivr.com/#!select2) or [CDNJS](http://www.cdnjs.com/libraries/select2), [download it from this GitHub repo](https://github.com/ivaynberg/select2/tags), or use one of the integrations below. + +Integrations +------------ + +* [Wicket-Select2](https://github.com/ivaynberg/wicket-select2) (Java / [Apache Wicket](http://wicket.apache.org)) +* [select2-rails](https://github.com/argerim/select2-rails) (Ruby on Rails) +* [AngularUI](http://angular-ui.github.io/#ui-select) ([AngularJS](https://angularjs.org/)) +* [Django](https://github.com/applegrew/django-select2) +* [Symfony](https://github.com/19Gerhard85/sfSelect2WidgetsPlugin) +* [Symfony2](https://github.com/avocode/FormExtensions) +* [Bootstrap 2](https://github.com/t0m/select2-bootstrap-css) and [Bootstrap 3](https://github.com/t0m/select2-bootstrap-css/tree/bootstrap3) (CSS skins) +* [Meteor](https://github.com/nate-strauser/meteor-select2) (modern reactive JavaScript framework; + [Bootstrap 3 skin](https://github.com/esperadomedia/meteor-select2-bootstrap3-css/)) +* [Meteor](https://jquery-select2.meteor.com) +* [Yii 2.x](http://demos.krajee.com/widgets#select2) +* [Yii 1.x](https://github.com/tonybolzan/yii-select2) +* [AtmosphereJS](https://atmospherejs.com/package/jquery-select2) + +### Example Integrations + +* [Knockout.js](https://github.com/ivaynberg/select2/wiki/Knockout.js-Integration) +* [Socket.IO](https://github.com/ivaynberg/select2/wiki/Socket.IO-Integration) +* [PHP](https://github.com/ivaynberg/select2/wiki/PHP-Example) +* [.Net MVC] (https://github.com/ivaynberg/select2/wiki/.Net-MVC-Example) + +Internationalization (i18n) +--------------------------- + +Select2 supports multiple languages by simply including the right language JS +file (`select2_locale_it.js`, `select2_locale_nl.js`, etc.) after `select2.js`. + +Missing a language? Just copy `select2_locale_en.js.template`, translate +it, and make a pull request back to Select2 here on GitHub. + +Documentation +------------- + +The documentation for Select2 is available [through GitHub Pages](https://ivaynberg.github.io/select2/) and is located within this repository in the [`gh-pages` branch](https://github.com/ivaynberg/select2/tree/gh-pages). + +Community +--------- + +### Bug tracker + +Have a bug? Please create an issue here on GitHub! + +https://github.com/ivaynberg/select2/issues + +### Mailing list + +Have a question? Ask on our mailing list! + +select2@googlegroups.com + +https://groups.google.com/d/forum/select2 + +### IRC channel + +Need help implementing Select2 in your project? Ask in our IRC channel! + +**Network:** [Freenode](https://freenode.net/) (`chat.freenode.net`) + +**Channel:** `#select2` + +**Web access:** https://webchat.freenode.net/?channels=select2 + +Copyright and license +--------------------- + +Copyright 2012 Igor Vaynberg + +This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU +General Public License version 2 (the "GPL License"). You may choose either license to govern your +use of this software only upon the condition that you accept all of the terms of either the Apache +License or the GPL License. + +You may obtain a copy of the Apache License and the GPL License in the LICENSE file, or at: + +http://www.apache.org/licenses/LICENSE-2.0 +http://www.gnu.org/licenses/gpl-2.0.html + +Unless required by applicable law or agreed to in writing, software distributed under the Apache License +or the GPL License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +either express or implied. See the Apache License and the GPL License for the specific language governing +permissions and limitations under the Apache License and the GPL License. diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/release.sh b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/release.sh new file mode 100644 index 000000000..3b63f9662 --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/release.sh @@ -0,0 +1,79 @@ +#!/bin/bash +set -e + +echo -n "Enter the version for this release: " + +read ver + +if [ ! $ver ]; then + echo "Invalid version." + exit +fi + +name="select2" +js="$name.js" +mini="$name.min.js" +css="$name.css" +release="$name-$ver" +tag="$ver" +branch="build-$ver" +curbranch=`git branch | grep "*" | sed "s/* //"` +timestamp=$(date) +tokens="s/@@ver@@/$ver/g;s/\@@timestamp@@/$timestamp/g" +remote="origin" + +echo "Pulling from origin" + +git pull + +echo "Updating Version Identifiers" + +sed -E -e "s/\"version\": \"([0-9\.]+)\",/\"version\": \"$ver\",/g" -i -- bower.json select2.jquery.json component.json composer.json package.json + +git add bower.json +git add select2.jquery.json +git add component.json +git add composer.json +git add package.json + +git commit -m "modified version identifiers in descriptors for release $ver" +git push + +git branch "$branch" +git checkout "$branch" + +echo "Tokenizing..." + +find . -name "$js" | xargs -I{} sed -e "$tokens" -i -- {} +find . -name "$css" | xargs -I{} sed -e "$tokens" -i -- {} + +sed -e "s/latest/$ver/g" -i -- bower.json + +git add "$js" +git add "$css" + +echo "Minifying..." + +echo "/*" > "$mini" +cat LICENSE | sed "$tokens" >> "$mini" +echo "*/" >> "$mini" + +curl -s \ + --data-urlencode "js_code@$js" \ + http://marijnhaverbeke.nl/uglifyjs \ + >> "$mini" + +git add "$mini" + +git commit -m "release $ver" + +echo "Tagging..." +git tag -a "$tag" -m "tagged version $ver" +git push "$remote" --tags + +echo "Cleaning Up..." + +git checkout "$curbranch" +git branch -D "$branch" + +echo "Done" diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2-bootstrap.css b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2-bootstrap.css new file mode 100644 index 000000000..3b83f0a22 --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2-bootstrap.css @@ -0,0 +1,87 @@ +.form-control .select2-choice { + border: 0; + border-radius: 2px; +} + +.form-control .select2-choice .select2-arrow { + border-radius: 0 2px 2px 0; +} + +.form-control.select2-container { + height: auto !important; + padding: 0; +} + +.form-control.select2-container.select2-dropdown-open { + border-color: #5897FB; + border-radius: 3px 3px 0 0; +} + +.form-control .select2-container.select2-dropdown-open .select2-choices { + border-radius: 3px 3px 0 0; +} + +.form-control.select2-container .select2-choices { + border: 0 !important; + border-radius: 3px; +} + +.control-group.warning .select2-container .select2-choice, +.control-group.warning .select2-container .select2-choices, +.control-group.warning .select2-container-active .select2-choice, +.control-group.warning .select2-container-active .select2-choices, +.control-group.warning .select2-dropdown-open.select2-drop-above .select2-choice, +.control-group.warning .select2-dropdown-open.select2-drop-above .select2-choices, +.control-group.warning .select2-container-multi.select2-container-active .select2-choices { + border: 1px solid #C09853 !important; +} + +.control-group.warning .select2-container .select2-choice div { + border-left: 1px solid #C09853 !important; + background: #FCF8E3 !important; +} + +.control-group.error .select2-container .select2-choice, +.control-group.error .select2-container .select2-choices, +.control-group.error .select2-container-active .select2-choice, +.control-group.error .select2-container-active .select2-choices, +.control-group.error .select2-dropdown-open.select2-drop-above .select2-choice, +.control-group.error .select2-dropdown-open.select2-drop-above .select2-choices, +.control-group.error .select2-container-multi.select2-container-active .select2-choices { + border: 1px solid #B94A48 !important; +} + +.control-group.error .select2-container .select2-choice div { + border-left: 1px solid #B94A48 !important; + background: #F2DEDE !important; +} + +.control-group.info .select2-container .select2-choice, +.control-group.info .select2-container .select2-choices, +.control-group.info .select2-container-active .select2-choice, +.control-group.info .select2-container-active .select2-choices, +.control-group.info .select2-dropdown-open.select2-drop-above .select2-choice, +.control-group.info .select2-dropdown-open.select2-drop-above .select2-choices, +.control-group.info .select2-container-multi.select2-container-active .select2-choices { + border: 1px solid #3A87AD !important; +} + +.control-group.info .select2-container .select2-choice div { + border-left: 1px solid #3A87AD !important; + background: #D9EDF7 !important; +} + +.control-group.success .select2-container .select2-choice, +.control-group.success .select2-container .select2-choices, +.control-group.success .select2-container-active .select2-choice, +.control-group.success .select2-container-active .select2-choices, +.control-group.success .select2-dropdown-open.select2-drop-above .select2-choice, +.control-group.success .select2-dropdown-open.select2-drop-above .select2-choices, +.control-group.success .select2-container-multi.select2-container-active .select2-choices { + border: 1px solid #468847 !important; +} + +.control-group.success .select2-container .select2-choice div { + border-left: 1px solid #468847 !important; + background: #DFF0D8 !important; +} diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2-spinner.gif b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2-spinner.gif new file mode 100644 index 000000000..5b33f7e54 Binary files /dev/null and b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2-spinner.gif differ diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2.css b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2.css new file mode 100644 index 000000000..2d07a0343 --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2.css @@ -0,0 +1,704 @@ +/* +Version: 3.5.2 Timestamp: Sat Nov 1 14:43:36 EDT 2014 +*/ +.select2-container { + margin: 0; + position: relative; + display: inline-block; + /* inline-block for ie7 */ + zoom: 1; + *display: inline; + vertical-align: middle; +} + +.select2-container, +.select2-drop, +.select2-search, +.select2-search input { + /* + Force border-box so that % widths fit the parent + container without overlap because of margin/padding. + More Info : http://www.quirksmode.org/css/box.html + */ + -webkit-box-sizing: border-box; /* webkit */ + -moz-box-sizing: border-box; /* firefox */ + box-sizing: border-box; /* css3 */ +} + +.select2-container .select2-choice { + display: block; + height: 26px; + padding: 0 0 0 8px; + overflow: hidden; + position: relative; + + border: 1px solid #aaa; + white-space: nowrap; + line-height: 26px; + color: #444; + text-decoration: none; + + border-radius: 4px; + + background-clip: padding-box; + + -webkit-touch-callout: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + + background-color: #fff; + background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eee), color-stop(0.5, #fff)); + background-image: -webkit-linear-gradient(center bottom, #eee 0%, #fff 50%); + background-image: -moz-linear-gradient(center bottom, #eee 0%, #fff 50%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#ffffff', endColorstr = '#eeeeee', GradientType = 0); + background-image: linear-gradient(to top, #eee 0%, #fff 50%); +} + +html[dir="rtl"] .select2-container .select2-choice { + padding: 0 8px 0 0; +} + +.select2-container.select2-drop-above .select2-choice { + border-bottom-color: #aaa; + + border-radius: 0 0 4px 4px; + + background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eee), color-stop(0.9, #fff)); + background-image: -webkit-linear-gradient(center bottom, #eee 0%, #fff 90%); + background-image: -moz-linear-gradient(center bottom, #eee 0%, #fff 90%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#eeeeee', GradientType=0); + background-image: linear-gradient(to bottom, #eee 0%, #fff 90%); +} + +.select2-container.select2-allowclear .select2-choice .select2-chosen { + margin-right: 42px; +} + +.select2-container .select2-choice > .select2-chosen { + margin-right: 26px; + display: block; + overflow: hidden; + + white-space: nowrap; + + text-overflow: ellipsis; + float: none; + width: auto; +} + +html[dir="rtl"] .select2-container .select2-choice > .select2-chosen { + margin-left: 26px; + margin-right: 0; +} + +.select2-container .select2-choice abbr { + display: none; + width: 12px; + height: 12px; + position: absolute; + right: 24px; + top: 8px; + + font-size: 1px; + text-decoration: none; + + border: 0; + background: url('select2.png') right top no-repeat; + cursor: pointer; + outline: 0; +} + +.select2-container.select2-allowclear .select2-choice abbr { + display: inline-block; +} + +.select2-container .select2-choice abbr:hover { + background-position: right -11px; + cursor: pointer; +} + +.select2-drop-mask { + border: 0; + margin: 0; + padding: 0; + position: fixed; + left: 0; + top: 0; + min-height: 100%; + min-width: 100%; + height: auto; + width: auto; + opacity: 0; + z-index: 9998; + /* styles required for IE to work */ + background-color: #fff; + filter: alpha(opacity=0); +} + +.select2-drop { + width: 100%; + margin-top: -1px; + position: absolute; + z-index: 9999; + top: 100%; + + background: #fff; + color: #000; + border: 1px solid #aaa; + border-top: 0; + + border-radius: 0 0 4px 4px; + + -webkit-box-shadow: 0 4px 5px rgba(0, 0, 0, .15); + box-shadow: 0 4px 5px rgba(0, 0, 0, .15); +} + +.select2-drop.select2-drop-above { + margin-top: 1px; + border-top: 1px solid #aaa; + border-bottom: 0; + + border-radius: 4px 4px 0 0; + + -webkit-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15); + box-shadow: 0 -4px 5px rgba(0, 0, 0, .15); +} + +.select2-drop-active { + border: 1px solid #5897fb; + border-top: none; +} + +.select2-drop.select2-drop-above.select2-drop-active { + border-top: 1px solid #5897fb; +} + +.select2-drop-auto-width { + border-top: 1px solid #aaa; + width: auto; +} + +.select2-drop-auto-width .select2-search { + padding-top: 4px; +} + +.select2-container .select2-choice .select2-arrow { + display: inline-block; + width: 18px; + height: 100%; + position: absolute; + right: 0; + top: 0; + + border-left: 1px solid #aaa; + border-radius: 0 4px 4px 0; + + background-clip: padding-box; + + background: #ccc; + background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #ccc), color-stop(0.6, #eee)); + background-image: -webkit-linear-gradient(center bottom, #ccc 0%, #eee 60%); + background-image: -moz-linear-gradient(center bottom, #ccc 0%, #eee 60%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#eeeeee', endColorstr = '#cccccc', GradientType = 0); + background-image: linear-gradient(to top, #ccc 0%, #eee 60%); +} + +html[dir="rtl"] .select2-container .select2-choice .select2-arrow { + left: 0; + right: auto; + + border-left: none; + border-right: 1px solid #aaa; + border-radius: 4px 0 0 4px; +} + +.select2-container .select2-choice .select2-arrow b { + display: block; + width: 100%; + height: 100%; + background: url('select2.png') no-repeat 0 1px; +} + +html[dir="rtl"] .select2-container .select2-choice .select2-arrow b { + background-position: 2px 1px; +} + +.select2-search { + display: inline-block; + width: 100%; + min-height: 26px; + margin: 0; + padding-left: 4px; + padding-right: 4px; + + position: relative; + z-index: 10000; + + white-space: nowrap; +} + +.select2-search input { + width: 100%; + height: auto !important; + min-height: 26px; + padding: 4px 20px 4px 5px; + margin: 0; + + outline: 0; + font-family: sans-serif; + font-size: 1em; + + border: 1px solid #aaa; + border-radius: 0; + + -webkit-box-shadow: none; + box-shadow: none; + + background: #fff url('select2.png') no-repeat 100% -22px; + background: url('select2.png') no-repeat 100% -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee)); + background: url('select2.png') no-repeat 100% -22px, -webkit-linear-gradient(center bottom, #fff 85%, #eee 99%); + background: url('select2.png') no-repeat 100% -22px, -moz-linear-gradient(center bottom, #fff 85%, #eee 99%); + background: url('select2.png') no-repeat 100% -22px, linear-gradient(to bottom, #fff 85%, #eee 99%) 0 0; +} + +html[dir="rtl"] .select2-search input { + padding: 4px 5px 4px 20px; + + background: #fff url('select2.png') no-repeat -37px -22px; + background: url('select2.png') no-repeat -37px -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee)); + background: url('select2.png') no-repeat -37px -22px, -webkit-linear-gradient(center bottom, #fff 85%, #eee 99%); + background: url('select2.png') no-repeat -37px -22px, -moz-linear-gradient(center bottom, #fff 85%, #eee 99%); + background: url('select2.png') no-repeat -37px -22px, linear-gradient(to bottom, #fff 85%, #eee 99%) 0 0; +} + +.select2-drop.select2-drop-above .select2-search input { + margin-top: 4px; +} + +.select2-search input.select2-active { + background: #fff url('select2-spinner.gif') no-repeat 100%; + background: url('select2-spinner.gif') no-repeat 100%, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee)); + background: url('select2-spinner.gif') no-repeat 100%, -webkit-linear-gradient(center bottom, #fff 85%, #eee 99%); + background: url('select2-spinner.gif') no-repeat 100%, -moz-linear-gradient(center bottom, #fff 85%, #eee 99%); + background: url('select2-spinner.gif') no-repeat 100%, linear-gradient(to bottom, #fff 85%, #eee 99%) 0 0; +} + +.select2-container-active .select2-choice, +.select2-container-active .select2-choices { + border: 1px solid #5897fb; + outline: none; + + -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, .3); + box-shadow: 0 0 5px rgba(0, 0, 0, .3); +} + +.select2-dropdown-open .select2-choice { + border-bottom-color: transparent; + -webkit-box-shadow: 0 1px 0 #fff inset; + box-shadow: 0 1px 0 #fff inset; + + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; + + background-color: #eee; + background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #fff), color-stop(0.5, #eee)); + background-image: -webkit-linear-gradient(center bottom, #fff 0%, #eee 50%); + background-image: -moz-linear-gradient(center bottom, #fff 0%, #eee 50%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#ffffff', GradientType=0); + background-image: linear-gradient(to top, #fff 0%, #eee 50%); +} + +.select2-dropdown-open.select2-drop-above .select2-choice, +.select2-dropdown-open.select2-drop-above .select2-choices { + border: 1px solid #5897fb; + border-top-color: transparent; + + background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #fff), color-stop(0.5, #eee)); + background-image: -webkit-linear-gradient(center top, #fff 0%, #eee 50%); + background-image: -moz-linear-gradient(center top, #fff 0%, #eee 50%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#ffffff', GradientType=0); + background-image: linear-gradient(to bottom, #fff 0%, #eee 50%); +} + +.select2-dropdown-open .select2-choice .select2-arrow { + background: transparent; + border-left: none; + filter: none; +} +html[dir="rtl"] .select2-dropdown-open .select2-choice .select2-arrow { + border-right: none; +} + +.select2-dropdown-open .select2-choice .select2-arrow b { + background-position: -18px 1px; +} + +html[dir="rtl"] .select2-dropdown-open .select2-choice .select2-arrow b { + background-position: -16px 1px; +} + +.select2-hidden-accessible { + border: 0; + clip: rect(0 0 0 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px; +} + +/* results */ +.select2-results { + max-height: 200px; + padding: 0 0 0 4px; + margin: 4px 4px 4px 0; + position: relative; + overflow-x: hidden; + overflow-y: auto; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); +} + +html[dir="rtl"] .select2-results { + padding: 0 4px 0 0; + margin: 4px 0 4px 4px; +} + +.select2-results ul.select2-result-sub { + margin: 0; + padding-left: 0; +} + +.select2-results li { + list-style: none; + display: list-item; + background-image: none; +} + +.select2-results li.select2-result-with-children > .select2-result-label { + font-weight: bold; +} + +.select2-results .select2-result-label { + padding: 3px 7px 4px; + margin: 0; + cursor: pointer; + + min-height: 1em; + + -webkit-touch-callout: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.select2-results-dept-1 .select2-result-label { padding-left: 20px } +.select2-results-dept-2 .select2-result-label { padding-left: 40px } +.select2-results-dept-3 .select2-result-label { padding-left: 60px } +.select2-results-dept-4 .select2-result-label { padding-left: 80px } +.select2-results-dept-5 .select2-result-label { padding-left: 100px } +.select2-results-dept-6 .select2-result-label { padding-left: 110px } +.select2-results-dept-7 .select2-result-label { padding-left: 120px } + +.select2-results .select2-highlighted { + background: #3875d7; + color: #fff; +} + +.select2-results li em { + background: #feffde; + font-style: normal; +} + +.select2-results .select2-highlighted em { + background: transparent; +} + +.select2-results .select2-highlighted ul { + background: #fff; + color: #000; +} + +.select2-results .select2-no-results, +.select2-results .select2-searching, +.select2-results .select2-ajax-error, +.select2-results .select2-selection-limit { + background: #f4f4f4; + display: list-item; + padding-left: 5px; +} + +/* +disabled look for disabled choices in the results dropdown +*/ +.select2-results .select2-disabled.select2-highlighted { + color: #666; + background: #f4f4f4; + display: list-item; + cursor: default; +} +.select2-results .select2-disabled { + background: #f4f4f4; + display: list-item; + cursor: default; +} + +.select2-results .select2-selected { + display: none; +} + +.select2-more-results.select2-active { + background: #f4f4f4 url('select2-spinner.gif') no-repeat 100%; +} + +.select2-results .select2-ajax-error { + background: rgba(255, 50, 50, .2); +} + +.select2-more-results { + background: #f4f4f4; + display: list-item; +} + +/* disabled styles */ + +.select2-container.select2-container-disabled .select2-choice { + background-color: #f4f4f4; + background-image: none; + border: 1px solid #ddd; + cursor: default; +} + +.select2-container.select2-container-disabled .select2-choice .select2-arrow { + background-color: #f4f4f4; + background-image: none; + border-left: 0; +} + +.select2-container.select2-container-disabled .select2-choice abbr { + display: none; +} + + +/* multiselect */ + +.select2-container-multi .select2-choices { + height: auto !important; + height: 1%; + margin: 0; + padding: 0 5px 0 0; + position: relative; + + border: 1px solid #aaa; + cursor: text; + overflow: hidden; + + background-color: #fff; + background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(1%, #eee), color-stop(15%, #fff)); + background-image: -webkit-linear-gradient(top, #eee 1%, #fff 15%); + background-image: -moz-linear-gradient(top, #eee 1%, #fff 15%); + background-image: linear-gradient(to bottom, #eee 1%, #fff 15%); +} + +html[dir="rtl"] .select2-container-multi .select2-choices { + padding: 0 0 0 5px; +} + +.select2-locked { + padding: 3px 5px 3px 5px !important; +} + +.select2-container-multi .select2-choices { + min-height: 26px; +} + +.select2-container-multi.select2-container-active .select2-choices { + border: 1px solid #5897fb; + outline: none; + + -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, .3); + box-shadow: 0 0 5px rgba(0, 0, 0, .3); +} +.select2-container-multi .select2-choices li { + float: left; + list-style: none; +} +html[dir="rtl"] .select2-container-multi .select2-choices li +{ + float: right; +} +.select2-container-multi .select2-choices .select2-search-field { + margin: 0; + padding: 0; + white-space: nowrap; +} + +.select2-container-multi .select2-choices .select2-search-field input { + padding: 5px; + margin: 1px 0; + + font-family: sans-serif; + font-size: 100%; + color: #666; + outline: 0; + border: 0; + -webkit-box-shadow: none; + box-shadow: none; + background: transparent !important; +} + +.select2-container-multi .select2-choices .select2-search-field input.select2-active { + background: #fff url('select2-spinner.gif') no-repeat 100% !important; +} + +.select2-default { + color: #999 !important; +} + +.select2-container-multi .select2-choices .select2-search-choice { + padding: 3px 5px 3px 18px; + margin: 3px 0 3px 5px; + position: relative; + + line-height: 13px; + color: #333; + cursor: default; + border: 1px solid #aaaaaa; + + border-radius: 3px; + + -webkit-box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05); + box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05); + + background-clip: padding-box; + + -webkit-touch-callout: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + + background-color: #e4e4e4; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#f4f4f4', GradientType=0); + background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eee)); + background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%); + background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%); + background-image: linear-gradient(to bottom, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%); +} +html[dir="rtl"] .select2-container-multi .select2-choices .select2-search-choice +{ + margin: 3px 5px 3px 0; + padding: 3px 18px 3px 5px; +} +.select2-container-multi .select2-choices .select2-search-choice .select2-chosen { + cursor: default; +} +.select2-container-multi .select2-choices .select2-search-choice-focus { + background: #d4d4d4; +} + +.select2-search-choice-close { + display: block; + width: 12px; + height: 13px; + position: absolute; + right: 3px; + top: 4px; + + font-size: 1px; + outline: none; + background: url('select2.png') right top no-repeat; +} +html[dir="rtl"] .select2-search-choice-close { + right: auto; + left: 3px; +} + +.select2-container-multi .select2-search-choice-close { + left: 3px; +} + +html[dir="rtl"] .select2-container-multi .select2-search-choice-close { + left: auto; + right: 2px; +} + +.select2-container-multi .select2-choices .select2-search-choice .select2-search-choice-close:hover { + background-position: right -11px; +} +.select2-container-multi .select2-choices .select2-search-choice-focus .select2-search-choice-close { + background-position: right -11px; +} + +/* disabled styles */ +.select2-container-multi.select2-container-disabled .select2-choices { + background-color: #f4f4f4; + background-image: none; + border: 1px solid #ddd; + cursor: default; +} + +.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice { + padding: 3px 5px 3px 5px; + border: 1px solid #ddd; + background-image: none; + background-color: #f4f4f4; +} + +.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice .select2-search-choice-close { display: none; + background: none; +} +/* end multiselect */ + + +.select2-result-selectable .select2-match, +.select2-result-unselectable .select2-match { + text-decoration: underline; +} + +.select2-offscreen, .select2-offscreen:focus { + clip: rect(0 0 0 0) !important; + width: 1px !important; + height: 1px !important; + border: 0 !important; + margin: 0 !important; + padding: 0 !important; + overflow: hidden !important; + position: absolute !important; + outline: 0 !important; + left: 0px !important; + top: 0px !important; +} + +.select2-display-none { + display: none; +} + +.select2-measure-scrollbar { + position: absolute; + top: -10000px; + left: -10000px; + width: 100px; + height: 100px; + overflow: scroll; +} + +/* Retina-ize icons */ + +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-resolution: 2dppx) { + .select2-search input, + .select2-search-choice-close, + .select2-container .select2-choice abbr, + .select2-container .select2-choice .select2-arrow b { + background-image: url('select2x2.png') !important; + background-repeat: no-repeat !important; + background-size: 60px 40px !important; + } + + .select2-search input { + background-position: 100% -21px !important; + } +} diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2.jquery.json b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2.jquery.json new file mode 100644 index 000000000..b005d8a20 --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2.jquery.json @@ -0,0 +1,36 @@ +{ + "name": "select2", + "title": "Select2", + "description": "Select2 is a jQuery based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results.", + "keywords": [ + "select", + "autocomplete", + "typeahead", + "dropdown", + "multiselect", + "tag", + "tagging" + ], + "version": "3.5.2", + "author": { + "name": "Igor Vaynberg", + "url": "https://github.com/ivaynberg" + }, + "licenses": [ + { + "type": "Apache", + "url": "http://www.apache.org/licenses/LICENSE-2.0" + }, + { + "type": "GPL v2", + "url": "http://www.gnu.org/licenses/gpl-2.0.html" + } + ], + "bugs": "https://github.com/ivaynberg/select2/issues", + "homepage": "http://ivaynberg.github.com/select2", + "docs": "http://ivaynberg.github.com/select2/", + "download": "https://github.com/ivaynberg/select2/tags", + "dependencies": { + "jquery": ">=1.7.1" + } +} diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2.js b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2.js new file mode 100644 index 000000000..7590b8229 --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2.js @@ -0,0 +1,3541 @@ +/* +Copyright 2012 Igor Vaynberg + +Version: 3.5.2 Timestamp: Sat Nov 1 14:43:36 EDT 2014 + +This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU +General Public License version 2 (the "GPL License"). You may choose either license to govern your +use of this software only upon the condition that you accept all of the terms of either the Apache +License or the GPL License. + +You may obtain a copy of the Apache License and the GPL License at: + + http://www.apache.org/licenses/LICENSE-2.0 + http://www.gnu.org/licenses/gpl-2.0.html + +Unless required by applicable law or agreed to in writing, software distributed under the +Apache License or the GPL License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +CONDITIONS OF ANY KIND, either express or implied. See the Apache License and the GPL License for +the specific language governing permissions and limitations under the Apache License and the GPL License. +*/ +(function ($) { + if(typeof $.fn.each2 == "undefined") { + $.extend($.fn, { + /* + * 4-10 times faster .each replacement + * use it carefully, as it overrides jQuery context of element on each iteration + */ + each2 : function (c) { + var j = $([0]), i = -1, l = this.length; + while ( + ++i < l + && (j.context = j[0] = this[i]) + && c.call(j[0], i, j) !== false //"this"=DOM, i=index, j=jQuery object + ); + return this; + } + }); + } +})(jQuery); + +(function ($, undefined) { + "use strict"; + /*global document, window, jQuery, console */ + + if (window.Select2 !== undefined) { + return; + } + + var AbstractSelect2, SingleSelect2, MultiSelect2, nextUid, sizer, + lastMousePosition={x:0,y:0}, $document, scrollBarDimensions, + + KEY = { + TAB: 9, + ENTER: 13, + ESC: 27, + SPACE: 32, + LEFT: 37, + UP: 38, + RIGHT: 39, + DOWN: 40, + SHIFT: 16, + CTRL: 17, + ALT: 18, + PAGE_UP: 33, + PAGE_DOWN: 34, + HOME: 36, + END: 35, + BACKSPACE: 8, + DELETE: 46, + isArrow: function (k) { + k = k.which ? k.which : k; + switch (k) { + case KEY.LEFT: + case KEY.RIGHT: + case KEY.UP: + case KEY.DOWN: + return true; + } + return false; + }, + isControl: function (e) { + var k = e.which; + switch (k) { + case KEY.SHIFT: + case KEY.CTRL: + case KEY.ALT: + return true; + } + + if (e.metaKey) return true; + + return false; + }, + isFunctionKey: function (k) { + k = k.which ? k.which : k; + return k >= 112 && k <= 123; + } + }, + MEASURE_SCROLLBAR_TEMPLATE = "
", + + DIACRITICS = {"\u24B6":"A","\uFF21":"A","\u00C0":"A","\u00C1":"A","\u00C2":"A","\u1EA6":"A","\u1EA4":"A","\u1EAA":"A","\u1EA8":"A","\u00C3":"A","\u0100":"A","\u0102":"A","\u1EB0":"A","\u1EAE":"A","\u1EB4":"A","\u1EB2":"A","\u0226":"A","\u01E0":"A","\u00C4":"A","\u01DE":"A","\u1EA2":"A","\u00C5":"A","\u01FA":"A","\u01CD":"A","\u0200":"A","\u0202":"A","\u1EA0":"A","\u1EAC":"A","\u1EB6":"A","\u1E00":"A","\u0104":"A","\u023A":"A","\u2C6F":"A","\uA732":"AA","\u00C6":"AE","\u01FC":"AE","\u01E2":"AE","\uA734":"AO","\uA736":"AU","\uA738":"AV","\uA73A":"AV","\uA73C":"AY","\u24B7":"B","\uFF22":"B","\u1E02":"B","\u1E04":"B","\u1E06":"B","\u0243":"B","\u0182":"B","\u0181":"B","\u24B8":"C","\uFF23":"C","\u0106":"C","\u0108":"C","\u010A":"C","\u010C":"C","\u00C7":"C","\u1E08":"C","\u0187":"C","\u023B":"C","\uA73E":"C","\u24B9":"D","\uFF24":"D","\u1E0A":"D","\u010E":"D","\u1E0C":"D","\u1E10":"D","\u1E12":"D","\u1E0E":"D","\u0110":"D","\u018B":"D","\u018A":"D","\u0189":"D","\uA779":"D","\u01F1":"DZ","\u01C4":"DZ","\u01F2":"Dz","\u01C5":"Dz","\u24BA":"E","\uFF25":"E","\u00C8":"E","\u00C9":"E","\u00CA":"E","\u1EC0":"E","\u1EBE":"E","\u1EC4":"E","\u1EC2":"E","\u1EBC":"E","\u0112":"E","\u1E14":"E","\u1E16":"E","\u0114":"E","\u0116":"E","\u00CB":"E","\u1EBA":"E","\u011A":"E","\u0204":"E","\u0206":"E","\u1EB8":"E","\u1EC6":"E","\u0228":"E","\u1E1C":"E","\u0118":"E","\u1E18":"E","\u1E1A":"E","\u0190":"E","\u018E":"E","\u24BB":"F","\uFF26":"F","\u1E1E":"F","\u0191":"F","\uA77B":"F","\u24BC":"G","\uFF27":"G","\u01F4":"G","\u011C":"G","\u1E20":"G","\u011E":"G","\u0120":"G","\u01E6":"G","\u0122":"G","\u01E4":"G","\u0193":"G","\uA7A0":"G","\uA77D":"G","\uA77E":"G","\u24BD":"H","\uFF28":"H","\u0124":"H","\u1E22":"H","\u1E26":"H","\u021E":"H","\u1E24":"H","\u1E28":"H","\u1E2A":"H","\u0126":"H","\u2C67":"H","\u2C75":"H","\uA78D":"H","\u24BE":"I","\uFF29":"I","\u00CC":"I","\u00CD":"I","\u00CE":"I","\u0128":"I","\u012A":"I","\u012C":"I","\u0130":"I","\u00CF":"I","\u1E2E":"I","\u1EC8":"I","\u01CF":"I","\u0208":"I","\u020A":"I","\u1ECA":"I","\u012E":"I","\u1E2C":"I","\u0197":"I","\u24BF":"J","\uFF2A":"J","\u0134":"J","\u0248":"J","\u24C0":"K","\uFF2B":"K","\u1E30":"K","\u01E8":"K","\u1E32":"K","\u0136":"K","\u1E34":"K","\u0198":"K","\u2C69":"K","\uA740":"K","\uA742":"K","\uA744":"K","\uA7A2":"K","\u24C1":"L","\uFF2C":"L","\u013F":"L","\u0139":"L","\u013D":"L","\u1E36":"L","\u1E38":"L","\u013B":"L","\u1E3C":"L","\u1E3A":"L","\u0141":"L","\u023D":"L","\u2C62":"L","\u2C60":"L","\uA748":"L","\uA746":"L","\uA780":"L","\u01C7":"LJ","\u01C8":"Lj","\u24C2":"M","\uFF2D":"M","\u1E3E":"M","\u1E40":"M","\u1E42":"M","\u2C6E":"M","\u019C":"M","\u24C3":"N","\uFF2E":"N","\u01F8":"N","\u0143":"N","\u00D1":"N","\u1E44":"N","\u0147":"N","\u1E46":"N","\u0145":"N","\u1E4A":"N","\u1E48":"N","\u0220":"N","\u019D":"N","\uA790":"N","\uA7A4":"N","\u01CA":"NJ","\u01CB":"Nj","\u24C4":"O","\uFF2F":"O","\u00D2":"O","\u00D3":"O","\u00D4":"O","\u1ED2":"O","\u1ED0":"O","\u1ED6":"O","\u1ED4":"O","\u00D5":"O","\u1E4C":"O","\u022C":"O","\u1E4E":"O","\u014C":"O","\u1E50":"O","\u1E52":"O","\u014E":"O","\u022E":"O","\u0230":"O","\u00D6":"O","\u022A":"O","\u1ECE":"O","\u0150":"O","\u01D1":"O","\u020C":"O","\u020E":"O","\u01A0":"O","\u1EDC":"O","\u1EDA":"O","\u1EE0":"O","\u1EDE":"O","\u1EE2":"O","\u1ECC":"O","\u1ED8":"O","\u01EA":"O","\u01EC":"O","\u00D8":"O","\u01FE":"O","\u0186":"O","\u019F":"O","\uA74A":"O","\uA74C":"O","\u01A2":"OI","\uA74E":"OO","\u0222":"OU","\u24C5":"P","\uFF30":"P","\u1E54":"P","\u1E56":"P","\u01A4":"P","\u2C63":"P","\uA750":"P","\uA752":"P","\uA754":"P","\u24C6":"Q","\uFF31":"Q","\uA756":"Q","\uA758":"Q","\u024A":"Q","\u24C7":"R","\uFF32":"R","\u0154":"R","\u1E58":"R","\u0158":"R","\u0210":"R","\u0212":"R","\u1E5A":"R","\u1E5C":"R","\u0156":"R","\u1E5E":"R","\u024C":"R","\u2C64":"R","\uA75A":"R","\uA7A6":"R","\uA782":"R","\u24C8":"S","\uFF33":"S","\u1E9E":"S","\u015A":"S","\u1E64":"S","\u015C":"S","\u1E60":"S","\u0160":"S","\u1E66":"S","\u1E62":"S","\u1E68":"S","\u0218":"S","\u015E":"S","\u2C7E":"S","\uA7A8":"S","\uA784":"S","\u24C9":"T","\uFF34":"T","\u1E6A":"T","\u0164":"T","\u1E6C":"T","\u021A":"T","\u0162":"T","\u1E70":"T","\u1E6E":"T","\u0166":"T","\u01AC":"T","\u01AE":"T","\u023E":"T","\uA786":"T","\uA728":"TZ","\u24CA":"U","\uFF35":"U","\u00D9":"U","\u00DA":"U","\u00DB":"U","\u0168":"U","\u1E78":"U","\u016A":"U","\u1E7A":"U","\u016C":"U","\u00DC":"U","\u01DB":"U","\u01D7":"U","\u01D5":"U","\u01D9":"U","\u1EE6":"U","\u016E":"U","\u0170":"U","\u01D3":"U","\u0214":"U","\u0216":"U","\u01AF":"U","\u1EEA":"U","\u1EE8":"U","\u1EEE":"U","\u1EEC":"U","\u1EF0":"U","\u1EE4":"U","\u1E72":"U","\u0172":"U","\u1E76":"U","\u1E74":"U","\u0244":"U","\u24CB":"V","\uFF36":"V","\u1E7C":"V","\u1E7E":"V","\u01B2":"V","\uA75E":"V","\u0245":"V","\uA760":"VY","\u24CC":"W","\uFF37":"W","\u1E80":"W","\u1E82":"W","\u0174":"W","\u1E86":"W","\u1E84":"W","\u1E88":"W","\u2C72":"W","\u24CD":"X","\uFF38":"X","\u1E8A":"X","\u1E8C":"X","\u24CE":"Y","\uFF39":"Y","\u1EF2":"Y","\u00DD":"Y","\u0176":"Y","\u1EF8":"Y","\u0232":"Y","\u1E8E":"Y","\u0178":"Y","\u1EF6":"Y","\u1EF4":"Y","\u01B3":"Y","\u024E":"Y","\u1EFE":"Y","\u24CF":"Z","\uFF3A":"Z","\u0179":"Z","\u1E90":"Z","\u017B":"Z","\u017D":"Z","\u1E92":"Z","\u1E94":"Z","\u01B5":"Z","\u0224":"Z","\u2C7F":"Z","\u2C6B":"Z","\uA762":"Z","\u24D0":"a","\uFF41":"a","\u1E9A":"a","\u00E0":"a","\u00E1":"a","\u00E2":"a","\u1EA7":"a","\u1EA5":"a","\u1EAB":"a","\u1EA9":"a","\u00E3":"a","\u0101":"a","\u0103":"a","\u1EB1":"a","\u1EAF":"a","\u1EB5":"a","\u1EB3":"a","\u0227":"a","\u01E1":"a","\u00E4":"a","\u01DF":"a","\u1EA3":"a","\u00E5":"a","\u01FB":"a","\u01CE":"a","\u0201":"a","\u0203":"a","\u1EA1":"a","\u1EAD":"a","\u1EB7":"a","\u1E01":"a","\u0105":"a","\u2C65":"a","\u0250":"a","\uA733":"aa","\u00E6":"ae","\u01FD":"ae","\u01E3":"ae","\uA735":"ao","\uA737":"au","\uA739":"av","\uA73B":"av","\uA73D":"ay","\u24D1":"b","\uFF42":"b","\u1E03":"b","\u1E05":"b","\u1E07":"b","\u0180":"b","\u0183":"b","\u0253":"b","\u24D2":"c","\uFF43":"c","\u0107":"c","\u0109":"c","\u010B":"c","\u010D":"c","\u00E7":"c","\u1E09":"c","\u0188":"c","\u023C":"c","\uA73F":"c","\u2184":"c","\u24D3":"d","\uFF44":"d","\u1E0B":"d","\u010F":"d","\u1E0D":"d","\u1E11":"d","\u1E13":"d","\u1E0F":"d","\u0111":"d","\u018C":"d","\u0256":"d","\u0257":"d","\uA77A":"d","\u01F3":"dz","\u01C6":"dz","\u24D4":"e","\uFF45":"e","\u00E8":"e","\u00E9":"e","\u00EA":"e","\u1EC1":"e","\u1EBF":"e","\u1EC5":"e","\u1EC3":"e","\u1EBD":"e","\u0113":"e","\u1E15":"e","\u1E17":"e","\u0115":"e","\u0117":"e","\u00EB":"e","\u1EBB":"e","\u011B":"e","\u0205":"e","\u0207":"e","\u1EB9":"e","\u1EC7":"e","\u0229":"e","\u1E1D":"e","\u0119":"e","\u1E19":"e","\u1E1B":"e","\u0247":"e","\u025B":"e","\u01DD":"e","\u24D5":"f","\uFF46":"f","\u1E1F":"f","\u0192":"f","\uA77C":"f","\u24D6":"g","\uFF47":"g","\u01F5":"g","\u011D":"g","\u1E21":"g","\u011F":"g","\u0121":"g","\u01E7":"g","\u0123":"g","\u01E5":"g","\u0260":"g","\uA7A1":"g","\u1D79":"g","\uA77F":"g","\u24D7":"h","\uFF48":"h","\u0125":"h","\u1E23":"h","\u1E27":"h","\u021F":"h","\u1E25":"h","\u1E29":"h","\u1E2B":"h","\u1E96":"h","\u0127":"h","\u2C68":"h","\u2C76":"h","\u0265":"h","\u0195":"hv","\u24D8":"i","\uFF49":"i","\u00EC":"i","\u00ED":"i","\u00EE":"i","\u0129":"i","\u012B":"i","\u012D":"i","\u00EF":"i","\u1E2F":"i","\u1EC9":"i","\u01D0":"i","\u0209":"i","\u020B":"i","\u1ECB":"i","\u012F":"i","\u1E2D":"i","\u0268":"i","\u0131":"i","\u24D9":"j","\uFF4A":"j","\u0135":"j","\u01F0":"j","\u0249":"j","\u24DA":"k","\uFF4B":"k","\u1E31":"k","\u01E9":"k","\u1E33":"k","\u0137":"k","\u1E35":"k","\u0199":"k","\u2C6A":"k","\uA741":"k","\uA743":"k","\uA745":"k","\uA7A3":"k","\u24DB":"l","\uFF4C":"l","\u0140":"l","\u013A":"l","\u013E":"l","\u1E37":"l","\u1E39":"l","\u013C":"l","\u1E3D":"l","\u1E3B":"l","\u017F":"l","\u0142":"l","\u019A":"l","\u026B":"l","\u2C61":"l","\uA749":"l","\uA781":"l","\uA747":"l","\u01C9":"lj","\u24DC":"m","\uFF4D":"m","\u1E3F":"m","\u1E41":"m","\u1E43":"m","\u0271":"m","\u026F":"m","\u24DD":"n","\uFF4E":"n","\u01F9":"n","\u0144":"n","\u00F1":"n","\u1E45":"n","\u0148":"n","\u1E47":"n","\u0146":"n","\u1E4B":"n","\u1E49":"n","\u019E":"n","\u0272":"n","\u0149":"n","\uA791":"n","\uA7A5":"n","\u01CC":"nj","\u24DE":"o","\uFF4F":"o","\u00F2":"o","\u00F3":"o","\u00F4":"o","\u1ED3":"o","\u1ED1":"o","\u1ED7":"o","\u1ED5":"o","\u00F5":"o","\u1E4D":"o","\u022D":"o","\u1E4F":"o","\u014D":"o","\u1E51":"o","\u1E53":"o","\u014F":"o","\u022F":"o","\u0231":"o","\u00F6":"o","\u022B":"o","\u1ECF":"o","\u0151":"o","\u01D2":"o","\u020D":"o","\u020F":"o","\u01A1":"o","\u1EDD":"o","\u1EDB":"o","\u1EE1":"o","\u1EDF":"o","\u1EE3":"o","\u1ECD":"o","\u1ED9":"o","\u01EB":"o","\u01ED":"o","\u00F8":"o","\u01FF":"o","\u0254":"o","\uA74B":"o","\uA74D":"o","\u0275":"o","\u01A3":"oi","\u0223":"ou","\uA74F":"oo","\u24DF":"p","\uFF50":"p","\u1E55":"p","\u1E57":"p","\u01A5":"p","\u1D7D":"p","\uA751":"p","\uA753":"p","\uA755":"p","\u24E0":"q","\uFF51":"q","\u024B":"q","\uA757":"q","\uA759":"q","\u24E1":"r","\uFF52":"r","\u0155":"r","\u1E59":"r","\u0159":"r","\u0211":"r","\u0213":"r","\u1E5B":"r","\u1E5D":"r","\u0157":"r","\u1E5F":"r","\u024D":"r","\u027D":"r","\uA75B":"r","\uA7A7":"r","\uA783":"r","\u24E2":"s","\uFF53":"s","\u00DF":"s","\u015B":"s","\u1E65":"s","\u015D":"s","\u1E61":"s","\u0161":"s","\u1E67":"s","\u1E63":"s","\u1E69":"s","\u0219":"s","\u015F":"s","\u023F":"s","\uA7A9":"s","\uA785":"s","\u1E9B":"s","\u24E3":"t","\uFF54":"t","\u1E6B":"t","\u1E97":"t","\u0165":"t","\u1E6D":"t","\u021B":"t","\u0163":"t","\u1E71":"t","\u1E6F":"t","\u0167":"t","\u01AD":"t","\u0288":"t","\u2C66":"t","\uA787":"t","\uA729":"tz","\u24E4":"u","\uFF55":"u","\u00F9":"u","\u00FA":"u","\u00FB":"u","\u0169":"u","\u1E79":"u","\u016B":"u","\u1E7B":"u","\u016D":"u","\u00FC":"u","\u01DC":"u","\u01D8":"u","\u01D6":"u","\u01DA":"u","\u1EE7":"u","\u016F":"u","\u0171":"u","\u01D4":"u","\u0215":"u","\u0217":"u","\u01B0":"u","\u1EEB":"u","\u1EE9":"u","\u1EEF":"u","\u1EED":"u","\u1EF1":"u","\u1EE5":"u","\u1E73":"u","\u0173":"u","\u1E77":"u","\u1E75":"u","\u0289":"u","\u24E5":"v","\uFF56":"v","\u1E7D":"v","\u1E7F":"v","\u028B":"v","\uA75F":"v","\u028C":"v","\uA761":"vy","\u24E6":"w","\uFF57":"w","\u1E81":"w","\u1E83":"w","\u0175":"w","\u1E87":"w","\u1E85":"w","\u1E98":"w","\u1E89":"w","\u2C73":"w","\u24E7":"x","\uFF58":"x","\u1E8B":"x","\u1E8D":"x","\u24E8":"y","\uFF59":"y","\u1EF3":"y","\u00FD":"y","\u0177":"y","\u1EF9":"y","\u0233":"y","\u1E8F":"y","\u00FF":"y","\u1EF7":"y","\u1E99":"y","\u1EF5":"y","\u01B4":"y","\u024F":"y","\u1EFF":"y","\u24E9":"z","\uFF5A":"z","\u017A":"z","\u1E91":"z","\u017C":"z","\u017E":"z","\u1E93":"z","\u1E95":"z","\u01B6":"z","\u0225":"z","\u0240":"z","\u2C6C":"z","\uA763":"z","\u0386":"\u0391","\u0388":"\u0395","\u0389":"\u0397","\u038A":"\u0399","\u03AA":"\u0399","\u038C":"\u039F","\u038E":"\u03A5","\u03AB":"\u03A5","\u038F":"\u03A9","\u03AC":"\u03B1","\u03AD":"\u03B5","\u03AE":"\u03B7","\u03AF":"\u03B9","\u03CA":"\u03B9","\u0390":"\u03B9","\u03CC":"\u03BF","\u03CD":"\u03C5","\u03CB":"\u03C5","\u03B0":"\u03C5","\u03C9":"\u03C9","\u03C2":"\u03C3"}; + + $document = $(document); + + nextUid=(function() { var counter=1; return function() { return counter++; }; }()); + + + function reinsertElement(element) { + var placeholder = $(document.createTextNode('')); + + element.before(placeholder); + placeholder.before(element); + placeholder.remove(); + } + + function stripDiacritics(str) { + // Used 'uni range + named function' from http://jsperf.com/diacritics/18 + function match(a) { + return DIACRITICS[a] || a; + } + + return str.replace(/[^\u0000-\u007E]/g, match); + } + + function indexOf(value, array) { + var i = 0, l = array.length; + for (; i < l; i = i + 1) { + if (equal(value, array[i])) return i; + } + return -1; + } + + function measureScrollbar () { + var $template = $( MEASURE_SCROLLBAR_TEMPLATE ); + $template.appendTo(document.body); + + var dim = { + width: $template.width() - $template[0].clientWidth, + height: $template.height() - $template[0].clientHeight + }; + $template.remove(); + + return dim; + } + + /** + * Compares equality of a and b + * @param a + * @param b + */ + function equal(a, b) { + if (a === b) return true; + if (a === undefined || b === undefined) return false; + if (a === null || b === null) return false; + // Check whether 'a' or 'b' is a string (primitive or object). + // The concatenation of an empty string (+'') converts its argument to a string's primitive. + if (a.constructor === String) return a+'' === b+''; // a+'' - in case 'a' is a String object + if (b.constructor === String) return b+'' === a+''; // b+'' - in case 'b' is a String object + return false; + } + + /** + * Splits the string into an array of values, transforming each value. An empty array is returned for nulls or empty + * strings + * @param string + * @param separator + */ + function splitVal(string, separator, transform) { + var val, i, l; + if (string === null || string.length < 1) return []; + val = string.split(separator); + for (i = 0, l = val.length; i < l; i = i + 1) val[i] = transform(val[i]); + return val; + } + + function getSideBorderPadding(element) { + return element.outerWidth(false) - element.width(); + } + + function installKeyUpChangeEvent(element) { + var key="keyup-change-value"; + element.on("keydown", function () { + if ($.data(element, key) === undefined) { + $.data(element, key, element.val()); + } + }); + element.on("keyup", function () { + var val= $.data(element, key); + if (val !== undefined && element.val() !== val) { + $.removeData(element, key); + element.trigger("keyup-change"); + } + }); + } + + + /** + * filters mouse events so an event is fired only if the mouse moved. + * + * filters out mouse events that occur when mouse is stationary but + * the elements under the pointer are scrolled. + */ + function installFilteredMouseMove(element) { + element.on("mousemove", function (e) { + var lastpos = lastMousePosition; + if (lastpos === undefined || lastpos.x !== e.pageX || lastpos.y !== e.pageY) { + $(e.target).trigger("mousemove-filtered", e); + } + }); + } + + /** + * Debounces a function. Returns a function that calls the original fn function only if no invocations have been made + * within the last quietMillis milliseconds. + * + * @param quietMillis number of milliseconds to wait before invoking fn + * @param fn function to be debounced + * @param ctx object to be used as this reference within fn + * @return debounced version of fn + */ + function debounce(quietMillis, fn, ctx) { + ctx = ctx || undefined; + var timeout; + return function () { + var args = arguments; + window.clearTimeout(timeout); + timeout = window.setTimeout(function() { + fn.apply(ctx, args); + }, quietMillis); + }; + } + + function installDebouncedScroll(threshold, element) { + var notify = debounce(threshold, function (e) { element.trigger("scroll-debounced", e);}); + element.on("scroll", function (e) { + if (indexOf(e.target, element.get()) >= 0) notify(e); + }); + } + + function focus($el) { + if ($el[0] === document.activeElement) return; + + /* set the focus in a 0 timeout - that way the focus is set after the processing + of the current event has finished - which seems like the only reliable way + to set focus */ + window.setTimeout(function() { + var el=$el[0], pos=$el.val().length, range; + + $el.focus(); + + /* make sure el received focus so we do not error out when trying to manipulate the caret. + sometimes modals or others listeners may steal it after its set */ + var isVisible = (el.offsetWidth > 0 || el.offsetHeight > 0); + if (isVisible && el === document.activeElement) { + + /* after the focus is set move the caret to the end, necessary when we val() + just before setting focus */ + if(el.setSelectionRange) + { + el.setSelectionRange(pos, pos); + } + else if (el.createTextRange) { + range = el.createTextRange(); + range.collapse(false); + range.select(); + } + } + }, 0); + } + + function getCursorInfo(el) { + el = $(el)[0]; + var offset = 0; + var length = 0; + if ('selectionStart' in el) { + offset = el.selectionStart; + length = el.selectionEnd - offset; + } else if ('selection' in document) { + el.focus(); + var sel = document.selection.createRange(); + length = document.selection.createRange().text.length; + sel.moveStart('character', -el.value.length); + offset = sel.text.length - length; + } + return { offset: offset, length: length }; + } + + function killEvent(event) { + event.preventDefault(); + event.stopPropagation(); + } + function killEventImmediately(event) { + event.preventDefault(); + event.stopImmediatePropagation(); + } + + function measureTextWidth(e) { + if (!sizer){ + var style = e[0].currentStyle || window.getComputedStyle(e[0], null); + sizer = $(document.createElement("div")).css({ + position: "absolute", + left: "-10000px", + top: "-10000px", + display: "none", + fontSize: style.fontSize, + fontFamily: style.fontFamily, + fontStyle: style.fontStyle, + fontWeight: style.fontWeight, + letterSpacing: style.letterSpacing, + textTransform: style.textTransform, + whiteSpace: "nowrap" + }); + sizer.attr("class","select2-sizer"); + $(document.body).append(sizer); + } + sizer.text(e.val()); + return sizer.width(); + } + + function syncCssClasses(dest, src, adapter) { + var classes, replacements = [], adapted; + + classes = $.trim(dest.attr("class")); + + if (classes) { + classes = '' + classes; // for IE which returns object + + $(classes.split(/\s+/)).each2(function() { + if (this.indexOf("select2-") === 0) { + replacements.push(this); + } + }); + } + + classes = $.trim(src.attr("class")); + + if (classes) { + classes = '' + classes; // for IE which returns object + + $(classes.split(/\s+/)).each2(function() { + if (this.indexOf("select2-") !== 0) { + adapted = adapter(this); + + if (adapted) { + replacements.push(adapted); + } + } + }); + } + + dest.attr("class", replacements.join(" ")); + } + + + function markMatch(text, term, markup, escapeMarkup) { + var match=stripDiacritics(text.toUpperCase()).indexOf(stripDiacritics(term.toUpperCase())), + tl=term.length; + + if (match<0) { + markup.push(escapeMarkup(text)); + return; + } + + markup.push(escapeMarkup(text.substring(0, match))); + markup.push(""); + markup.push(escapeMarkup(text.substring(match, match + tl))); + markup.push(""); + markup.push(escapeMarkup(text.substring(match + tl, text.length))); + } + + function defaultEscapeMarkup(markup) { + var replace_map = { + '\\': '\', + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''', + "/": '/' + }; + + return String(markup).replace(/[&<>"'\/\\]/g, function (match) { + return replace_map[match]; + }); + } + + /** + * Produces an ajax-based query function + * + * @param options object containing configuration parameters + * @param options.params parameter map for the transport ajax call, can contain such options as cache, jsonpCallback, etc. see $.ajax + * @param options.transport function that will be used to execute the ajax request. must be compatible with parameters supported by $.ajax + * @param options.url url for the data + * @param options.data a function(searchTerm, pageNumber, context) that should return an object containing query string parameters for the above url. + * @param options.dataType request data type: ajax, jsonp, other datatypes supported by jQuery's $.ajax function or the transport function if specified + * @param options.quietMillis (optional) milliseconds to wait before making the ajaxRequest, helps debounce the ajax function if invoked too often + * @param options.results a function(remoteData, pageNumber, query) that converts data returned form the remote request to the format expected by Select2. + * The expected format is an object containing the following keys: + * results array of objects that will be used as choices + * more (optional) boolean indicating whether there are more results available + * Example: {results:[{id:1, text:'Red'},{id:2, text:'Blue'}], more:true} + */ + function ajax(options) { + var timeout, // current scheduled but not yet executed request + handler = null, + quietMillis = options.quietMillis || 100, + ajaxUrl = options.url, + self = this; + + return function (query) { + window.clearTimeout(timeout); + timeout = window.setTimeout(function () { + var data = options.data, // ajax data function + url = ajaxUrl, // ajax url string or function + transport = options.transport || $.fn.select2.ajaxDefaults.transport, + // deprecated - to be removed in 4.0 - use params instead + deprecated = { + type: options.type || 'GET', // set type of request (GET or POST) + cache: options.cache || false, + jsonpCallback: options.jsonpCallback||undefined, + dataType: options.dataType||"json" + }, + params = $.extend({}, $.fn.select2.ajaxDefaults.params, deprecated); + + data = data ? data.call(self, query.term, query.page, query.context) : null; + url = (typeof url === 'function') ? url.call(self, query.term, query.page, query.context) : url; + + if (handler && typeof handler.abort === "function") { handler.abort(); } + + if (options.params) { + if ($.isFunction(options.params)) { + $.extend(params, options.params.call(self)); + } else { + $.extend(params, options.params); + } + } + + $.extend(params, { + url: url, + dataType: options.dataType, + data: data, + success: function (data) { + // TODO - replace query.page with query so users have access to term, page, etc. + // added query as third paramter to keep backwards compatibility + var results = options.results(data, query.page, query); + query.callback(results); + }, + error: function(jqXHR, textStatus, errorThrown){ + var results = { + hasError: true, + jqXHR: jqXHR, + textStatus: textStatus, + errorThrown: errorThrown + }; + + query.callback(results); + } + }); + handler = transport.call(self, params); + }, quietMillis); + }; + } + + /** + * Produces a query function that works with a local array + * + * @param options object containing configuration parameters. The options parameter can either be an array or an + * object. + * + * If the array form is used it is assumed that it contains objects with 'id' and 'text' keys. + * + * If the object form is used it is assumed that it contains 'data' and 'text' keys. The 'data' key should contain + * an array of objects that will be used as choices. These objects must contain at least an 'id' key. The 'text' + * key can either be a String in which case it is expected that each element in the 'data' array has a key with the + * value of 'text' which will be used to match choices. Alternatively, text can be a function(item) that can extract + * the text. + */ + function local(options) { + var data = options, // data elements + dataText, + tmp, + text = function (item) { return ""+item.text; }; // function used to retrieve the text portion of a data item that is matched against the search + + if ($.isArray(data)) { + tmp = data; + data = { results: tmp }; + } + + if ($.isFunction(data) === false) { + tmp = data; + data = function() { return tmp; }; + } + + var dataItem = data(); + if (dataItem.text) { + text = dataItem.text; + // if text is not a function we assume it to be a key name + if (!$.isFunction(text)) { + dataText = dataItem.text; // we need to store this in a separate variable because in the next step data gets reset and data.text is no longer available + text = function (item) { return item[dataText]; }; + } + } + + return function (query) { + var t = query.term, filtered = { results: [] }, process; + if (t === "") { + query.callback(data()); + return; + } + + process = function(datum, collection) { + var group, attr; + datum = datum[0]; + if (datum.children) { + group = {}; + for (attr in datum) { + if (datum.hasOwnProperty(attr)) group[attr]=datum[attr]; + } + group.children=[]; + $(datum.children).each2(function(i, childDatum) { process(childDatum, group.children); }); + if (group.children.length || query.matcher(t, text(group), datum)) { + collection.push(group); + } + } else { + if (query.matcher(t, text(datum), datum)) { + collection.push(datum); + } + } + }; + + $(data().results).each2(function(i, datum) { process(datum, filtered.results); }); + query.callback(filtered); + }; + } + + // TODO javadoc + function tags(data) { + var isFunc = $.isFunction(data); + return function (query) { + var t = query.term, filtered = {results: []}; + var result = isFunc ? data(query) : data; + if ($.isArray(result)) { + $(result).each(function () { + var isObject = this.text !== undefined, + text = isObject ? this.text : this; + if (t === "" || query.matcher(t, text)) { + filtered.results.push(isObject ? this : {id: this, text: this}); + } + }); + query.callback(filtered); + } + }; + } + + /** + * Checks if the formatter function should be used. + * + * Throws an error if it is not a function. Returns true if it should be used, + * false if no formatting should be performed. + * + * @param formatter + */ + function checkFormatter(formatter, formatterName) { + if ($.isFunction(formatter)) return true; + if (!formatter) return false; + if (typeof(formatter) === 'string') return true; + throw new Error(formatterName +" must be a string, function, or falsy value"); + } + + /** + * Returns a given value + * If given a function, returns its output + * + * @param val string|function + * @param context value of "this" to be passed to function + * @returns {*} + */ + function evaluate(val, context) { + if ($.isFunction(val)) { + var args = Array.prototype.slice.call(arguments, 2); + return val.apply(context, args); + } + return val; + } + + function countResults(results) { + var count = 0; + $.each(results, function(i, item) { + if (item.children) { + count += countResults(item.children); + } else { + count++; + } + }); + return count; + } + + /** + * Default tokenizer. This function uses breaks the input on substring match of any string from the + * opts.tokenSeparators array and uses opts.createSearchChoice to create the choice object. Both of those + * two options have to be defined in order for the tokenizer to work. + * + * @param input text user has typed so far or pasted into the search field + * @param selection currently selected choices + * @param selectCallback function(choice) callback tho add the choice to selection + * @param opts select2's opts + * @return undefined/null to leave the current input unchanged, or a string to change the input to the returned value + */ + function defaultTokenizer(input, selection, selectCallback, opts) { + var original = input, // store the original so we can compare and know if we need to tell the search to update its text + dupe = false, // check for whether a token we extracted represents a duplicate selected choice + token, // token + index, // position at which the separator was found + i, l, // looping variables + separator; // the matched separator + + if (!opts.createSearchChoice || !opts.tokenSeparators || opts.tokenSeparators.length < 1) return undefined; + + while (true) { + index = -1; + + for (i = 0, l = opts.tokenSeparators.length; i < l; i++) { + separator = opts.tokenSeparators[i]; + index = input.indexOf(separator); + if (index >= 0) break; + } + + if (index < 0) break; // did not find any token separator in the input string, bail + + token = input.substring(0, index); + input = input.substring(index + separator.length); + + if (token.length > 0) { + token = opts.createSearchChoice.call(this, token, selection); + if (token !== undefined && token !== null && opts.id(token) !== undefined && opts.id(token) !== null) { + dupe = false; + for (i = 0, l = selection.length; i < l; i++) { + if (equal(opts.id(token), opts.id(selection[i]))) { + dupe = true; break; + } + } + + if (!dupe) selectCallback(token); + } + } + } + + if (original!==input) return input; + } + + function cleanupJQueryElements() { + var self = this; + + $.each(arguments, function (i, element) { + self[element].remove(); + self[element] = null; + }); + } + + /** + * Creates a new class + * + * @param superClass + * @param methods + */ + function clazz(SuperClass, methods) { + var constructor = function () {}; + constructor.prototype = new SuperClass; + constructor.prototype.constructor = constructor; + constructor.prototype.parent = SuperClass.prototype; + constructor.prototype = $.extend(constructor.prototype, methods); + return constructor; + } + + AbstractSelect2 = clazz(Object, { + + // abstract + bind: function (func) { + var self = this; + return function () { + func.apply(self, arguments); + }; + }, + + // abstract + init: function (opts) { + var results, search, resultsSelector = ".select2-results"; + + // prepare options + this.opts = opts = this.prepareOpts(opts); + + this.id=opts.id; + + // destroy if called on an existing component + if (opts.element.data("select2") !== undefined && + opts.element.data("select2") !== null) { + opts.element.data("select2").destroy(); + } + + this.container = this.createContainer(); + + this.liveRegion = $('.select2-hidden-accessible'); + if (this.liveRegion.length == 0) { + this.liveRegion = $("", { + role: "status", + "aria-live": "polite" + }) + .addClass("select2-hidden-accessible") + .appendTo(document.body); + } + + this.containerId="s2id_"+(opts.element.attr("id") || "autogen"+nextUid()); + this.containerEventName= this.containerId + .replace(/([.])/g, '_') + .replace(/([;&,\-\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g, '\\$1'); + this.container.attr("id", this.containerId); + + this.container.attr("title", opts.element.attr("title")); + + this.body = $(document.body); + + syncCssClasses(this.container, this.opts.element, this.opts.adaptContainerCssClass); + + this.container.attr("style", opts.element.attr("style")); + this.container.css(evaluate(opts.containerCss, this.opts.element)); + this.container.addClass(evaluate(opts.containerCssClass, this.opts.element)); + + this.elementTabIndex = this.opts.element.attr("tabindex"); + + // swap container for the element + this.opts.element + .data("select2", this) + .attr("tabindex", "-1") + .before(this.container) + .on("click.select2", killEvent); // do not leak click events + + this.container.data("select2", this); + + this.dropdown = this.container.find(".select2-drop"); + + syncCssClasses(this.dropdown, this.opts.element, this.opts.adaptDropdownCssClass); + + this.dropdown.addClass(evaluate(opts.dropdownCssClass, this.opts.element)); + this.dropdown.data("select2", this); + this.dropdown.on("click", killEvent); + + this.results = results = this.container.find(resultsSelector); + this.search = search = this.container.find("input.select2-input"); + + this.queryCount = 0; + this.resultsPage = 0; + this.context = null; + + // initialize the container + this.initContainer(); + + this.container.on("click", killEvent); + + installFilteredMouseMove(this.results); + + this.dropdown.on("mousemove-filtered", resultsSelector, this.bind(this.highlightUnderEvent)); + this.dropdown.on("touchstart touchmove touchend", resultsSelector, this.bind(function (event) { + this._touchEvent = true; + this.highlightUnderEvent(event); + })); + this.dropdown.on("touchmove", resultsSelector, this.bind(this.touchMoved)); + this.dropdown.on("touchstart touchend", resultsSelector, this.bind(this.clearTouchMoved)); + + // Waiting for a click event on touch devices to select option and hide dropdown + // otherwise click will be triggered on an underlying element + this.dropdown.on('click', this.bind(function (event) { + if (this._touchEvent) { + this._touchEvent = false; + this.selectHighlighted(); + } + })); + + installDebouncedScroll(80, this.results); + this.dropdown.on("scroll-debounced", resultsSelector, this.bind(this.loadMoreIfNeeded)); + + // do not propagate change event from the search field out of the component + $(this.container).on("change", ".select2-input", function(e) {e.stopPropagation();}); + $(this.dropdown).on("change", ".select2-input", function(e) {e.stopPropagation();}); + + // if jquery.mousewheel plugin is installed we can prevent out-of-bounds scrolling of results via mousewheel + if ($.fn.mousewheel) { + results.mousewheel(function (e, delta, deltaX, deltaY) { + var top = results.scrollTop(); + if (deltaY > 0 && top - deltaY <= 0) { + results.scrollTop(0); + killEvent(e); + } else if (deltaY < 0 && results.get(0).scrollHeight - results.scrollTop() + deltaY <= results.height()) { + results.scrollTop(results.get(0).scrollHeight - results.height()); + killEvent(e); + } + }); + } + + installKeyUpChangeEvent(search); + search.on("keyup-change input paste", this.bind(this.updateResults)); + search.on("focus", function () { search.addClass("select2-focused"); }); + search.on("blur", function () { search.removeClass("select2-focused");}); + + this.dropdown.on("mouseup", resultsSelector, this.bind(function (e) { + if ($(e.target).closest(".select2-result-selectable").length > 0) { + this.highlightUnderEvent(e); + this.selectHighlighted(e); + } + })); + + // trap all mouse events from leaving the dropdown. sometimes there may be a modal that is listening + // for mouse events outside of itself so it can close itself. since the dropdown is now outside the select2's + // dom it will trigger the popup close, which is not what we want + // focusin can cause focus wars between modals and select2 since the dropdown is outside the modal. + this.dropdown.on("click mouseup mousedown touchstart touchend focusin", function (e) { e.stopPropagation(); }); + + this.nextSearchTerm = undefined; + + if ($.isFunction(this.opts.initSelection)) { + // initialize selection based on the current value of the source element + this.initSelection(); + + // if the user has provided a function that can set selection based on the value of the source element + // we monitor the change event on the element and trigger it, allowing for two way synchronization + this.monitorSource(); + } + + if (opts.maximumInputLength !== null) { + this.search.attr("maxlength", opts.maximumInputLength); + } + + var disabled = opts.element.prop("disabled"); + if (disabled === undefined) disabled = false; + this.enable(!disabled); + + var readonly = opts.element.prop("readonly"); + if (readonly === undefined) readonly = false; + this.readonly(readonly); + + // Calculate size of scrollbar + scrollBarDimensions = scrollBarDimensions || measureScrollbar(); + + this.autofocus = opts.element.prop("autofocus"); + opts.element.prop("autofocus", false); + if (this.autofocus) this.focus(); + + this.search.attr("placeholder", opts.searchInputPlaceholder); + }, + + // abstract + destroy: function () { + var element=this.opts.element, select2 = element.data("select2"), self = this; + + this.close(); + + if (element.length && element[0].detachEvent && self._sync) { + element.each(function () { + if (self._sync) { + this.detachEvent("onpropertychange", self._sync); + } + }); + } + if (this.propertyObserver) { + this.propertyObserver.disconnect(); + this.propertyObserver = null; + } + this._sync = null; + + if (select2 !== undefined) { + select2.container.remove(); + select2.liveRegion.remove(); + select2.dropdown.remove(); + element + .show() + .removeData("select2") + .off(".select2") + .prop("autofocus", this.autofocus || false); + if (this.elementTabIndex) { + element.attr({tabindex: this.elementTabIndex}); + } else { + element.removeAttr("tabindex"); + } + element.show(); + } + + cleanupJQueryElements.call(this, + "container", + "liveRegion", + "dropdown", + "results", + "search" + ); + }, + + // abstract + optionToData: function(element) { + if (element.is("option")) { + return { + id:element.prop("value"), + text:element.text(), + element: element.get(), + css: element.attr("class"), + disabled: element.prop("disabled"), + locked: equal(element.attr("locked"), "locked") || equal(element.data("locked"), true) + }; + } else if (element.is("optgroup")) { + return { + text:element.attr("label"), + children:[], + element: element.get(), + css: element.attr("class") + }; + } + }, + + // abstract + prepareOpts: function (opts) { + var element, select, idKey, ajaxUrl, self = this; + + element = opts.element; + + if (element.get(0).tagName.toLowerCase() === "select") { + this.select = select = opts.element; + } + + if (select) { + // these options are not allowed when attached to a select because they are picked up off the element itself + $.each(["id", "multiple", "ajax", "query", "createSearchChoice", "initSelection", "data", "tags"], function () { + if (this in opts) { + throw new Error("Option '" + this + "' is not allowed for Select2 when attached to a ", + "
", + " ", + "
    ", + "
", + "
"].join("")); + return container; + }, + + // single + enableInterface: function() { + if (this.parent.enableInterface.apply(this, arguments)) { + this.focusser.prop("disabled", !this.isInterfaceEnabled()); + } + }, + + // single + opening: function () { + var el, range, len; + + if (this.opts.minimumResultsForSearch >= 0) { + this.showSearch(true); + } + + this.parent.opening.apply(this, arguments); + + if (this.showSearchInput !== false) { + // IE appends focusser.val() at the end of field :/ so we manually insert it at the beginning using a range + // all other browsers handle this just fine + + this.search.val(this.focusser.val()); + } + if (this.opts.shouldFocusInput(this)) { + this.search.focus(); + // move the cursor to the end after focussing, otherwise it will be at the beginning and + // new text will appear *before* focusser.val() + el = this.search.get(0); + if (el.createTextRange) { + range = el.createTextRange(); + range.collapse(false); + range.select(); + } else if (el.setSelectionRange) { + len = this.search.val().length; + el.setSelectionRange(len, len); + } + } + + // initializes search's value with nextSearchTerm (if defined by user) + // ignore nextSearchTerm if the dropdown is opened by the user pressing a letter + if(this.search.val() === "") { + if(this.nextSearchTerm != undefined){ + this.search.val(this.nextSearchTerm); + this.search.select(); + } + } + + this.focusser.prop("disabled", true).val(""); + this.updateResults(true); + this.opts.element.trigger($.Event("select2-open")); + }, + + // single + close: function () { + if (!this.opened()) return; + this.parent.close.apply(this, arguments); + + this.focusser.prop("disabled", false); + + if (this.opts.shouldFocusInput(this)) { + this.focusser.focus(); + } + }, + + // single + focus: function () { + if (this.opened()) { + this.close(); + } else { + this.focusser.prop("disabled", false); + if (this.opts.shouldFocusInput(this)) { + this.focusser.focus(); + } + } + }, + + // single + isFocused: function () { + return this.container.hasClass("select2-container-active"); + }, + + // single + cancel: function () { + this.parent.cancel.apply(this, arguments); + this.focusser.prop("disabled", false); + + if (this.opts.shouldFocusInput(this)) { + this.focusser.focus(); + } + }, + + // single + destroy: function() { + $("label[for='" + this.focusser.attr('id') + "']") + .attr('for', this.opts.element.attr("id")); + this.parent.destroy.apply(this, arguments); + + cleanupJQueryElements.call(this, + "selection", + "focusser" + ); + }, + + // single + initContainer: function () { + + var selection, + container = this.container, + dropdown = this.dropdown, + idSuffix = nextUid(), + elementLabel; + + if (this.opts.minimumResultsForSearch < 0) { + this.showSearch(false); + } else { + this.showSearch(true); + } + + this.selection = selection = container.find(".select2-choice"); + + this.focusser = container.find(".select2-focusser"); + + // add aria associations + selection.find(".select2-chosen").attr("id", "select2-chosen-"+idSuffix); + this.focusser.attr("aria-labelledby", "select2-chosen-"+idSuffix); + this.results.attr("id", "select2-results-"+idSuffix); + this.search.attr("aria-owns", "select2-results-"+idSuffix); + + // rewrite labels from original element to focusser + this.focusser.attr("id", "s2id_autogen"+idSuffix); + + elementLabel = $("label[for='" + this.opts.element.attr("id") + "']"); + this.opts.element.focus(this.bind(function () { this.focus(); })); + + this.focusser.prev() + .text(elementLabel.text()) + .attr('for', this.focusser.attr('id')); + + // Ensure the original element retains an accessible name + var originalTitle = this.opts.element.attr("title"); + this.opts.element.attr("title", (originalTitle || elementLabel.text())); + + this.focusser.attr("tabindex", this.elementTabIndex); + + // write label for search field using the label from the focusser element + this.search.attr("id", this.focusser.attr('id') + '_search'); + + this.search.prev() + .text($("label[for='" + this.focusser.attr('id') + "']").text()) + .attr('for', this.search.attr('id')); + + this.search.on("keydown", this.bind(function (e) { + if (!this.isInterfaceEnabled()) return; + + // filter 229 keyCodes (input method editor is processing key input) + if (229 == e.keyCode) return; + + if (e.which === KEY.PAGE_UP || e.which === KEY.PAGE_DOWN) { + // prevent the page from scrolling + killEvent(e); + return; + } + + switch (e.which) { + case KEY.UP: + case KEY.DOWN: + this.moveHighlight((e.which === KEY.UP) ? -1 : 1); + killEvent(e); + return; + case KEY.ENTER: + this.selectHighlighted(); + killEvent(e); + return; + case KEY.TAB: + this.selectHighlighted({noFocus: true}); + return; + case KEY.ESC: + this.cancel(e); + killEvent(e); + return; + } + })); + + this.search.on("blur", this.bind(function(e) { + // a workaround for chrome to keep the search field focussed when the scroll bar is used to scroll the dropdown. + // without this the search field loses focus which is annoying + if (document.activeElement === this.body.get(0)) { + window.setTimeout(this.bind(function() { + if (this.opened()) { + this.search.focus(); + } + }), 0); + } + })); + + this.focusser.on("keydown", this.bind(function (e) { + if (!this.isInterfaceEnabled()) return; + + if (e.which === KEY.TAB || KEY.isControl(e) || KEY.isFunctionKey(e) || e.which === KEY.ESC) { + return; + } + + if (this.opts.openOnEnter === false && e.which === KEY.ENTER) { + killEvent(e); + return; + } + + if (e.which == KEY.DOWN || e.which == KEY.UP + || (e.which == KEY.ENTER && this.opts.openOnEnter)) { + + if (e.altKey || e.ctrlKey || e.shiftKey || e.metaKey) return; + + this.open(); + killEvent(e); + return; + } + + if (e.which == KEY.DELETE || e.which == KEY.BACKSPACE) { + if (this.opts.allowClear) { + this.clear(); + } + killEvent(e); + return; + } + })); + + + installKeyUpChangeEvent(this.focusser); + this.focusser.on("keyup-change input", this.bind(function(e) { + if (this.opts.minimumResultsForSearch >= 0) { + e.stopPropagation(); + if (this.opened()) return; + this.open(); + } + })); + + selection.on("mousedown touchstart", "abbr", this.bind(function (e) { + if (!this.isInterfaceEnabled()) { + return; + } + + this.clear(); + killEventImmediately(e); + this.close(); + + if (this.selection) { + this.selection.focus(); + } + })); + + selection.on("mousedown touchstart", this.bind(function (e) { + // Prevent IE from generating a click event on the body + reinsertElement(selection); + + if (!this.container.hasClass("select2-container-active")) { + this.opts.element.trigger($.Event("select2-focus")); + } + + if (this.opened()) { + this.close(); + } else if (this.isInterfaceEnabled()) { + this.open(); + } + + killEvent(e); + })); + + dropdown.on("mousedown touchstart", this.bind(function() { + if (this.opts.shouldFocusInput(this)) { + this.search.focus(); + } + })); + + selection.on("focus", this.bind(function(e) { + killEvent(e); + })); + + this.focusser.on("focus", this.bind(function(){ + if (!this.container.hasClass("select2-container-active")) { + this.opts.element.trigger($.Event("select2-focus")); + } + this.container.addClass("select2-container-active"); + })).on("blur", this.bind(function() { + if (!this.opened()) { + this.container.removeClass("select2-container-active"); + this.opts.element.trigger($.Event("select2-blur")); + } + })); + this.search.on("focus", this.bind(function(){ + if (!this.container.hasClass("select2-container-active")) { + this.opts.element.trigger($.Event("select2-focus")); + } + this.container.addClass("select2-container-active"); + })); + + this.initContainerWidth(); + this.opts.element.hide(); + this.setPlaceholder(); + + }, + + // single + clear: function(triggerChange) { + var data=this.selection.data("select2-data"); + if (data) { // guard against queued quick consecutive clicks + var evt = $.Event("select2-clearing"); + this.opts.element.trigger(evt); + if (evt.isDefaultPrevented()) { + return; + } + var placeholderOption = this.getPlaceholderOption(); + this.opts.element.val(placeholderOption ? placeholderOption.val() : ""); + this.selection.find(".select2-chosen").empty(); + this.selection.removeData("select2-data"); + this.setPlaceholder(); + + if (triggerChange !== false){ + this.opts.element.trigger({ type: "select2-removed", val: this.id(data), choice: data }); + this.triggerChange({removed:data}); + } + } + }, + + /** + * Sets selection based on source element's value + */ + // single + initSelection: function () { + var selected; + if (this.isPlaceholderOptionSelected()) { + this.updateSelection(null); + this.close(); + this.setPlaceholder(); + } else { + var self = this; + this.opts.initSelection.call(null, this.opts.element, function(selected){ + if (selected !== undefined && selected !== null) { + self.updateSelection(selected); + self.close(); + self.setPlaceholder(); + self.nextSearchTerm = self.opts.nextSearchTerm(selected, self.search.val()); + } + }); + } + }, + + isPlaceholderOptionSelected: function() { + var placeholderOption; + if (this.getPlaceholder() === undefined) return false; // no placeholder specified so no option should be considered + return ((placeholderOption = this.getPlaceholderOption()) !== undefined && placeholderOption.prop("selected")) + || (this.opts.element.val() === "") + || (this.opts.element.val() === undefined) + || (this.opts.element.val() === null); + }, + + // single + prepareOpts: function () { + var opts = this.parent.prepareOpts.apply(this, arguments), + self=this; + + if (opts.element.get(0).tagName.toLowerCase() === "select") { + // install the selection initializer + opts.initSelection = function (element, callback) { + var selected = element.find("option").filter(function() { return this.selected && !this.disabled }); + // a single select box always has a value, no need to null check 'selected' + callback(self.optionToData(selected)); + }; + } else if ("data" in opts) { + // install default initSelection when applied to hidden input and data is local + opts.initSelection = opts.initSelection || function (element, callback) { + var id = element.val(); + //search in data by id, storing the actual matching item + var match = null; + opts.query({ + matcher: function(term, text, el){ + var is_match = equal(id, opts.id(el)); + if (is_match) { + match = el; + } + return is_match; + }, + callback: !$.isFunction(callback) ? $.noop : function() { + callback(match); + } + }); + }; + } + + return opts; + }, + + // single + getPlaceholder: function() { + // if a placeholder is specified on a single select without a valid placeholder option ignore it + if (this.select) { + if (this.getPlaceholderOption() === undefined) { + return undefined; + } + } + + return this.parent.getPlaceholder.apply(this, arguments); + }, + + // single + setPlaceholder: function () { + var placeholder = this.getPlaceholder(); + + if (this.isPlaceholderOptionSelected() && placeholder !== undefined) { + + // check for a placeholder option if attached to a select + if (this.select && this.getPlaceholderOption() === undefined) return; + + this.selection.find(".select2-chosen").html(this.opts.escapeMarkup(placeholder)); + + this.selection.addClass("select2-default"); + + this.container.removeClass("select2-allowclear"); + } + }, + + // single + postprocessResults: function (data, initial, noHighlightUpdate) { + var selected = 0, self = this, showSearchInput = true; + + // find the selected element in the result list + + this.findHighlightableChoices().each2(function (i, elm) { + if (equal(self.id(elm.data("select2-data")), self.opts.element.val())) { + selected = i; + return false; + } + }); + + // and highlight it + if (noHighlightUpdate !== false) { + if (initial === true && selected >= 0) { + this.highlight(selected); + } else { + this.highlight(0); + } + } + + // hide the search box if this is the first we got the results and there are enough of them for search + + if (initial === true) { + var min = this.opts.minimumResultsForSearch; + if (min >= 0) { + this.showSearch(countResults(data.results) >= min); + } + } + }, + + // single + showSearch: function(showSearchInput) { + if (this.showSearchInput === showSearchInput) return; + + this.showSearchInput = showSearchInput; + + this.dropdown.find(".select2-search").toggleClass("select2-search-hidden", !showSearchInput); + this.dropdown.find(".select2-search").toggleClass("select2-offscreen", !showSearchInput); + //add "select2-with-searchbox" to the container if search box is shown + $(this.dropdown, this.container).toggleClass("select2-with-searchbox", showSearchInput); + }, + + // single + onSelect: function (data, options) { + + if (!this.triggerSelect(data)) { return; } + + var old = this.opts.element.val(), + oldData = this.data(); + + this.opts.element.val(this.id(data)); + this.updateSelection(data); + + this.opts.element.trigger({ type: "select2-selected", val: this.id(data), choice: data }); + + this.nextSearchTerm = this.opts.nextSearchTerm(data, this.search.val()); + this.close(); + + if ((!options || !options.noFocus) && this.opts.shouldFocusInput(this)) { + this.focusser.focus(); + } + + if (!equal(old, this.id(data))) { + this.triggerChange({ added: data, removed: oldData }); + } + }, + + // single + updateSelection: function (data) { + + var container=this.selection.find(".select2-chosen"), formatted, cssClass; + + this.selection.data("select2-data", data); + + container.empty(); + if (data !== null) { + formatted=this.opts.formatSelection(data, container, this.opts.escapeMarkup); + } + if (formatted !== undefined) { + container.append(formatted); + } + cssClass=this.opts.formatSelectionCssClass(data, container); + if (cssClass !== undefined) { + container.addClass(cssClass); + } + + this.selection.removeClass("select2-default"); + + if (this.opts.allowClear && this.getPlaceholder() !== undefined) { + this.container.addClass("select2-allowclear"); + } + }, + + // single + val: function () { + var val, + triggerChange = false, + data = null, + self = this, + oldData = this.data(); + + if (arguments.length === 0) { + return this.opts.element.val(); + } + + val = arguments[0]; + + if (arguments.length > 1) { + triggerChange = arguments[1]; + } + + if (this.select) { + this.select + .val(val) + .find("option").filter(function() { return this.selected }).each2(function (i, elm) { + data = self.optionToData(elm); + return false; + }); + this.updateSelection(data); + this.setPlaceholder(); + if (triggerChange) { + this.triggerChange({added: data, removed:oldData}); + } + } else { + // val is an id. !val is true for [undefined,null,'',0] - 0 is legal + if (!val && val !== 0) { + this.clear(triggerChange); + return; + } + if (this.opts.initSelection === undefined) { + throw new Error("cannot call val() if initSelection() is not defined"); + } + this.opts.element.val(val); + this.opts.initSelection(this.opts.element, function(data){ + self.opts.element.val(!data ? "" : self.id(data)); + self.updateSelection(data); + self.setPlaceholder(); + if (triggerChange) { + self.triggerChange({added: data, removed:oldData}); + } + }); + } + }, + + // single + clearSearch: function () { + this.search.val(""); + this.focusser.val(""); + }, + + // single + data: function(value) { + var data, + triggerChange = false; + + if (arguments.length === 0) { + data = this.selection.data("select2-data"); + if (data == undefined) data = null; + return data; + } else { + if (arguments.length > 1) { + triggerChange = arguments[1]; + } + if (!value) { + this.clear(triggerChange); + } else { + data = this.data(); + this.opts.element.val(!value ? "" : this.id(value)); + this.updateSelection(value); + if (triggerChange) { + this.triggerChange({added: value, removed:data}); + } + } + } + } + }); + + MultiSelect2 = clazz(AbstractSelect2, { + + // multi + createContainer: function () { + var container = $(document.createElement("div")).attr({ + "class": "select2-container select2-container-multi" + }).html([ + "
    ", + "
  • ", + " ", + " ", + "
  • ", + "
", + "
", + "
    ", + "
", + "
"].join("")); + return container; + }, + + // multi + prepareOpts: function () { + var opts = this.parent.prepareOpts.apply(this, arguments), + self=this; + + // TODO validate placeholder is a string if specified + if (opts.element.get(0).tagName.toLowerCase() === "select") { + // install the selection initializer + opts.initSelection = function (element, callback) { + + var data = []; + + element.find("option").filter(function() { return this.selected && !this.disabled }).each2(function (i, elm) { + data.push(self.optionToData(elm)); + }); + callback(data); + }; + } else if ("data" in opts) { + // install default initSelection when applied to hidden input and data is local + opts.initSelection = opts.initSelection || function (element, callback) { + var ids = splitVal(element.val(), opts.separator, opts.transformVal); + //search in data by array of ids, storing matching items in a list + var matches = []; + opts.query({ + matcher: function(term, text, el){ + var is_match = $.grep(ids, function(id) { + return equal(id, opts.id(el)); + }).length; + if (is_match) { + matches.push(el); + } + return is_match; + }, + callback: !$.isFunction(callback) ? $.noop : function() { + // reorder matches based on the order they appear in the ids array because right now + // they are in the order in which they appear in data array + var ordered = []; + for (var i = 0; i < ids.length; i++) { + var id = ids[i]; + for (var j = 0; j < matches.length; j++) { + var match = matches[j]; + if (equal(id, opts.id(match))) { + ordered.push(match); + matches.splice(j, 1); + break; + } + } + } + callback(ordered); + } + }); + }; + } + + return opts; + }, + + // multi + selectChoice: function (choice) { + + var selected = this.container.find(".select2-search-choice-focus"); + if (selected.length && choice && choice[0] == selected[0]) { + + } else { + if (selected.length) { + this.opts.element.trigger("choice-deselected", selected); + } + selected.removeClass("select2-search-choice-focus"); + if (choice && choice.length) { + this.close(); + choice.addClass("select2-search-choice-focus"); + this.opts.element.trigger("choice-selected", choice); + } + } + }, + + // multi + destroy: function() { + $("label[for='" + this.search.attr('id') + "']") + .attr('for', this.opts.element.attr("id")); + this.parent.destroy.apply(this, arguments); + + cleanupJQueryElements.call(this, + "searchContainer", + "selection" + ); + }, + + // multi + initContainer: function () { + + var selector = ".select2-choices", selection; + + this.searchContainer = this.container.find(".select2-search-field"); + this.selection = selection = this.container.find(selector); + + var _this = this; + this.selection.on("click", ".select2-container:not(.select2-container-disabled) .select2-search-choice:not(.select2-locked)", function (e) { + _this.search[0].focus(); + _this.selectChoice($(this)); + }); + + // rewrite labels from original element to focusser + this.search.attr("id", "s2id_autogen"+nextUid()); + + this.search.prev() + .text($("label[for='" + this.opts.element.attr("id") + "']").text()) + .attr('for', this.search.attr('id')); + this.opts.element.focus(this.bind(function () { this.focus(); })); + + this.search.on("input paste", this.bind(function() { + if (this.search.attr('placeholder') && this.search.val().length == 0) return; + if (!this.isInterfaceEnabled()) return; + if (!this.opened()) { + this.open(); + } + })); + + this.search.attr("tabindex", this.elementTabIndex); + + this.keydowns = 0; + this.search.on("keydown", this.bind(function (e) { + if (!this.isInterfaceEnabled()) return; + + ++this.keydowns; + var selected = selection.find(".select2-search-choice-focus"); + var prev = selected.prev(".select2-search-choice:not(.select2-locked)"); + var next = selected.next(".select2-search-choice:not(.select2-locked)"); + var pos = getCursorInfo(this.search); + + if (selected.length && + (e.which == KEY.LEFT || e.which == KEY.RIGHT || e.which == KEY.BACKSPACE || e.which == KEY.DELETE || e.which == KEY.ENTER)) { + var selectedChoice = selected; + if (e.which == KEY.LEFT && prev.length) { + selectedChoice = prev; + } + else if (e.which == KEY.RIGHT) { + selectedChoice = next.length ? next : null; + } + else if (e.which === KEY.BACKSPACE) { + if (this.unselect(selected.first())) { + this.search.width(10); + selectedChoice = prev.length ? prev : next; + } + } else if (e.which == KEY.DELETE) { + if (this.unselect(selected.first())) { + this.search.width(10); + selectedChoice = next.length ? next : null; + } + } else if (e.which == KEY.ENTER) { + selectedChoice = null; + } + + this.selectChoice(selectedChoice); + killEvent(e); + if (!selectedChoice || !selectedChoice.length) { + this.open(); + } + return; + } else if (((e.which === KEY.BACKSPACE && this.keydowns == 1) + || e.which == KEY.LEFT) && (pos.offset == 0 && !pos.length)) { + + this.selectChoice(selection.find(".select2-search-choice:not(.select2-locked)").last()); + killEvent(e); + return; + } else { + this.selectChoice(null); + } + + if (this.opened()) { + switch (e.which) { + case KEY.UP: + case KEY.DOWN: + this.moveHighlight((e.which === KEY.UP) ? -1 : 1); + killEvent(e); + return; + case KEY.ENTER: + this.selectHighlighted(); + killEvent(e); + return; + case KEY.TAB: + this.selectHighlighted({noFocus:true}); + this.close(); + return; + case KEY.ESC: + this.cancel(e); + killEvent(e); + return; + } + } + + if (e.which === KEY.TAB || KEY.isControl(e) || KEY.isFunctionKey(e) + || e.which === KEY.BACKSPACE || e.which === KEY.ESC) { + return; + } + + if (e.which === KEY.ENTER) { + if (this.opts.openOnEnter === false) { + return; + } else if (e.altKey || e.ctrlKey || e.shiftKey || e.metaKey) { + return; + } + } + + this.open(); + + if (e.which === KEY.PAGE_UP || e.which === KEY.PAGE_DOWN) { + // prevent the page from scrolling + killEvent(e); + } + + if (e.which === KEY.ENTER) { + // prevent form from being submitted + killEvent(e); + } + + })); + + this.search.on("keyup", this.bind(function (e) { + this.keydowns = 0; + this.resizeSearch(); + }) + ); + + this.search.on("blur", this.bind(function(e) { + this.container.removeClass("select2-container-active"); + this.search.removeClass("select2-focused"); + this.selectChoice(null); + if (!this.opened()) this.clearSearch(); + e.stopImmediatePropagation(); + this.opts.element.trigger($.Event("select2-blur")); + })); + + this.container.on("click", selector, this.bind(function (e) { + if (!this.isInterfaceEnabled()) return; + if ($(e.target).closest(".select2-search-choice").length > 0) { + // clicked inside a select2 search choice, do not open + return; + } + this.selectChoice(null); + this.clearPlaceholder(); + if (!this.container.hasClass("select2-container-active")) { + this.opts.element.trigger($.Event("select2-focus")); + } + this.open(); + this.focusSearch(); + e.preventDefault(); + })); + + this.container.on("focus", selector, this.bind(function () { + if (!this.isInterfaceEnabled()) return; + if (!this.container.hasClass("select2-container-active")) { + this.opts.element.trigger($.Event("select2-focus")); + } + this.container.addClass("select2-container-active"); + this.dropdown.addClass("select2-drop-active"); + this.clearPlaceholder(); + })); + + this.initContainerWidth(); + this.opts.element.hide(); + + // set the placeholder if necessary + this.clearSearch(); + }, + + // multi + enableInterface: function() { + if (this.parent.enableInterface.apply(this, arguments)) { + this.search.prop("disabled", !this.isInterfaceEnabled()); + } + }, + + // multi + initSelection: function () { + var data; + if (this.opts.element.val() === "" && this.opts.element.text() === "") { + this.updateSelection([]); + this.close(); + // set the placeholder if necessary + this.clearSearch(); + } + if (this.select || this.opts.element.val() !== "") { + var self = this; + this.opts.initSelection.call(null, this.opts.element, function(data){ + if (data !== undefined && data !== null) { + self.updateSelection(data); + self.close(); + // set the placeholder if necessary + self.clearSearch(); + } + }); + } + }, + + // multi + clearSearch: function () { + var placeholder = this.getPlaceholder(), + maxWidth = this.getMaxSearchWidth(); + + if (placeholder !== undefined && this.getVal().length === 0 && this.search.hasClass("select2-focused") === false) { + this.search.val(placeholder).addClass("select2-default"); + // stretch the search box to full width of the container so as much of the placeholder is visible as possible + // we could call this.resizeSearch(), but we do not because that requires a sizer and we do not want to create one so early because of a firefox bug, see #944 + this.search.width(maxWidth > 0 ? maxWidth : this.container.css("width")); + } else { + this.search.val("").width(10); + } + }, + + // multi + clearPlaceholder: function () { + if (this.search.hasClass("select2-default")) { + this.search.val("").removeClass("select2-default"); + } + }, + + // multi + opening: function () { + this.clearPlaceholder(); // should be done before super so placeholder is not used to search + this.resizeSearch(); + + this.parent.opening.apply(this, arguments); + + this.focusSearch(); + + // initializes search's value with nextSearchTerm (if defined by user) + // ignore nextSearchTerm if the dropdown is opened by the user pressing a letter + if(this.search.val() === "") { + if(this.nextSearchTerm != undefined){ + this.search.val(this.nextSearchTerm); + this.search.select(); + } + } + + this.updateResults(true); + if (this.opts.shouldFocusInput(this)) { + this.search.focus(); + } + this.opts.element.trigger($.Event("select2-open")); + }, + + // multi + close: function () { + if (!this.opened()) return; + this.parent.close.apply(this, arguments); + }, + + // multi + focus: function () { + this.close(); + this.search.focus(); + }, + + // multi + isFocused: function () { + return this.search.hasClass("select2-focused"); + }, + + // multi + updateSelection: function (data) { + var ids = [], filtered = [], self = this; + + // filter out duplicates + $(data).each(function () { + if (indexOf(self.id(this), ids) < 0) { + ids.push(self.id(this)); + filtered.push(this); + } + }); + data = filtered; + + this.selection.find(".select2-search-choice").remove(); + $(data).each(function () { + self.addSelectedChoice(this); + }); + self.postprocessResults(); + }, + + // multi + tokenize: function() { + var input = this.search.val(); + input = this.opts.tokenizer.call(this, input, this.data(), this.bind(this.onSelect), this.opts); + if (input != null && input != undefined) { + this.search.val(input); + if (input.length > 0) { + this.open(); + } + } + + }, + + // multi + onSelect: function (data, options) { + + if (!this.triggerSelect(data) || data.text === "") { return; } + + this.addSelectedChoice(data); + + this.opts.element.trigger({ type: "selected", val: this.id(data), choice: data }); + + // keep track of the search's value before it gets cleared + this.nextSearchTerm = this.opts.nextSearchTerm(data, this.search.val()); + + this.clearSearch(); + this.updateResults(); + + if (this.select || !this.opts.closeOnSelect) this.postprocessResults(data, false, this.opts.closeOnSelect===true); + + if (this.opts.closeOnSelect) { + this.close(); + this.search.width(10); + } else { + if (this.countSelectableResults()>0) { + this.search.width(10); + this.resizeSearch(); + if (this.getMaximumSelectionSize() > 0 && this.val().length >= this.getMaximumSelectionSize()) { + // if we reached max selection size repaint the results so choices + // are replaced with the max selection reached message + this.updateResults(true); + } else { + // initializes search's value with nextSearchTerm and update search result + if(this.nextSearchTerm != undefined){ + this.search.val(this.nextSearchTerm); + this.updateResults(); + this.search.select(); + } + } + this.positionDropdown(); + } else { + // if nothing left to select close + this.close(); + this.search.width(10); + } + } + + // since its not possible to select an element that has already been + // added we do not need to check if this is a new element before firing change + this.triggerChange({ added: data }); + + if (!options || !options.noFocus) + this.focusSearch(); + }, + + // multi + cancel: function () { + this.close(); + this.focusSearch(); + }, + + addSelectedChoice: function (data) { + var enableChoice = !data.locked, + enabledItem = $( + "
  • " + + "
    " + + "
    " + + "
  • "), + disabledItem = $( + "
  • " + + "
    " + + "
  • "); + var choice = enableChoice ? enabledItem : disabledItem, + id = this.id(data), + val = this.getVal(), + formatted, + cssClass; + + formatted=this.opts.formatSelection(data, choice.find("div"), this.opts.escapeMarkup); + if (formatted != undefined) { + choice.find("div").replaceWith($("
    ").html(formatted)); + } + cssClass=this.opts.formatSelectionCssClass(data, choice.find("div")); + if (cssClass != undefined) { + choice.addClass(cssClass); + } + + if(enableChoice){ + choice.find(".select2-search-choice-close") + .on("mousedown", killEvent) + .on("click dblclick", this.bind(function (e) { + if (!this.isInterfaceEnabled()) return; + + this.unselect($(e.target)); + this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"); + killEvent(e); + this.close(); + this.focusSearch(); + })).on("focus", this.bind(function () { + if (!this.isInterfaceEnabled()) return; + this.container.addClass("select2-container-active"); + this.dropdown.addClass("select2-drop-active"); + })); + } + + choice.data("select2-data", data); + choice.insertBefore(this.searchContainer); + + val.push(id); + this.setVal(val); + }, + + // multi + unselect: function (selected) { + var val = this.getVal(), + data, + index; + selected = selected.closest(".select2-search-choice"); + + if (selected.length === 0) { + throw "Invalid argument: " + selected + ". Must be .select2-search-choice"; + } + + data = selected.data("select2-data"); + + if (!data) { + // prevent a race condition when the 'x' is clicked really fast repeatedly the event can be queued + // and invoked on an element already removed + return; + } + + var evt = $.Event("select2-removing"); + evt.val = this.id(data); + evt.choice = data; + this.opts.element.trigger(evt); + + if (evt.isDefaultPrevented()) { + return false; + } + + while((index = indexOf(this.id(data), val)) >= 0) { + val.splice(index, 1); + this.setVal(val); + if (this.select) this.postprocessResults(); + } + + selected.remove(); + + this.opts.element.trigger({ type: "select2-removed", val: this.id(data), choice: data }); + this.triggerChange({ removed: data }); + + return true; + }, + + // multi + postprocessResults: function (data, initial, noHighlightUpdate) { + var val = this.getVal(), + choices = this.results.find(".select2-result"), + compound = this.results.find(".select2-result-with-children"), + self = this; + + choices.each2(function (i, choice) { + var id = self.id(choice.data("select2-data")); + if (indexOf(id, val) >= 0) { + choice.addClass("select2-selected"); + // mark all children of the selected parent as selected + choice.find(".select2-result-selectable").addClass("select2-selected"); + } + }); + + compound.each2(function(i, choice) { + // hide an optgroup if it doesn't have any selectable children + if (!choice.is('.select2-result-selectable') + && choice.find(".select2-result-selectable:not(.select2-selected)").length === 0) { + choice.addClass("select2-selected"); + } + }); + + if (this.highlight() == -1 && noHighlightUpdate !== false && this.opts.closeOnSelect === true){ + self.highlight(0); + } + + //If all results are chosen render formatNoMatches + if(!this.opts.createSearchChoice && !choices.filter('.select2-result:not(.select2-selected)').length > 0){ + if(!data || data && !data.more && this.results.find(".select2-no-results").length === 0) { + if (checkFormatter(self.opts.formatNoMatches, "formatNoMatches")) { + this.results.append("
  • " + evaluate(self.opts.formatNoMatches, self.opts.element, self.search.val()) + "
  • "); + } + } + } + + }, + + // multi + getMaxSearchWidth: function() { + return this.selection.width() - getSideBorderPadding(this.search); + }, + + // multi + resizeSearch: function () { + var minimumWidth, left, maxWidth, containerLeft, searchWidth, + sideBorderPadding = getSideBorderPadding(this.search); + + minimumWidth = measureTextWidth(this.search) + 10; + + left = this.search.offset().left; + + maxWidth = this.selection.width(); + containerLeft = this.selection.offset().left; + + searchWidth = maxWidth - (left - containerLeft) - sideBorderPadding; + + if (searchWidth < minimumWidth) { + searchWidth = maxWidth - sideBorderPadding; + } + + if (searchWidth < 40) { + searchWidth = maxWidth - sideBorderPadding; + } + + if (searchWidth <= 0) { + searchWidth = minimumWidth; + } + + this.search.width(Math.floor(searchWidth)); + }, + + // multi + getVal: function () { + var val; + if (this.select) { + val = this.select.val(); + return val === null ? [] : val; + } else { + val = this.opts.element.val(); + return splitVal(val, this.opts.separator, this.opts.transformVal); + } + }, + + // multi + setVal: function (val) { + var unique; + if (this.select) { + this.select.val(val); + } else { + unique = []; + // filter out duplicates + $(val).each(function () { + if (indexOf(this, unique) < 0) unique.push(this); + }); + this.opts.element.val(unique.length === 0 ? "" : unique.join(this.opts.separator)); + } + }, + + // multi + buildChangeDetails: function (old, current) { + var current = current.slice(0), + old = old.slice(0); + + // remove intersection from each array + for (var i = 0; i < current.length; i++) { + for (var j = 0; j < old.length; j++) { + if (equal(this.opts.id(current[i]), this.opts.id(old[j]))) { + current.splice(i, 1); + if(i>0){ + i--; + } + old.splice(j, 1); + j--; + } + } + } + + return {added: current, removed: old}; + }, + + + // multi + val: function (val, triggerChange) { + var oldData, self=this; + + if (arguments.length === 0) { + return this.getVal(); + } + + oldData=this.data(); + if (!oldData.length) oldData=[]; + + // val is an id. !val is true for [undefined,null,'',0] - 0 is legal + if (!val && val !== 0) { + this.opts.element.val(""); + this.updateSelection([]); + this.clearSearch(); + if (triggerChange) { + this.triggerChange({added: this.data(), removed: oldData}); + } + return; + } + + // val is a list of ids + this.setVal(val); + + if (this.select) { + this.opts.initSelection(this.select, this.bind(this.updateSelection)); + if (triggerChange) { + this.triggerChange(this.buildChangeDetails(oldData, this.data())); + } + } else { + if (this.opts.initSelection === undefined) { + throw new Error("val() cannot be called if initSelection() is not defined"); + } + + this.opts.initSelection(this.opts.element, function(data){ + var ids=$.map(data, self.id); + self.setVal(ids); + self.updateSelection(data); + self.clearSearch(); + if (triggerChange) { + self.triggerChange(self.buildChangeDetails(oldData, self.data())); + } + }); + } + this.clearSearch(); + }, + + // multi + onSortStart: function() { + if (this.select) { + throw new Error("Sorting of elements is not supported when attached to instead."); + } + + // collapse search field into 0 width so its container can be collapsed as well + this.search.width(0); + // hide the container + this.searchContainer.hide(); + }, + + // multi + onSortEnd:function() { + + var val=[], self=this; + + // show search and move it to the end of the list + this.searchContainer.show(); + // make sure the search container is the last item in the list + this.searchContainer.appendTo(this.searchContainer.parent()); + // since we collapsed the width in dragStarted, we resize it here + this.resizeSearch(); + + // update selection + this.selection.find(".select2-search-choice").each(function() { + val.push(self.opts.id($(this).data("select2-data"))); + }); + this.setVal(val); + this.triggerChange(); + }, + + // multi + data: function(values, triggerChange) { + var self=this, ids, old; + if (arguments.length === 0) { + return this.selection + .children(".select2-search-choice") + .map(function() { return $(this).data("select2-data"); }) + .get(); + } else { + old = this.data(); + if (!values) { values = []; } + ids = $.map(values, function(e) { return self.opts.id(e); }); + this.setVal(ids); + this.updateSelection(values); + this.clearSearch(); + if (triggerChange) { + this.triggerChange(this.buildChangeDetails(old, this.data())); + } + } + } + }); + + $.fn.select2 = function () { + + var args = Array.prototype.slice.call(arguments, 0), + opts, + select2, + method, value, multiple, + allowedMethods = ["val", "destroy", "opened", "open", "close", "focus", "isFocused", "container", "dropdown", "onSortStart", "onSortEnd", "enable", "disable", "readonly", "positionDropdown", "data", "search"], + valueMethods = ["opened", "isFocused", "container", "dropdown"], + propertyMethods = ["val", "data"], + methodsMap = { search: "externalSearch" }; + + this.each(function () { + if (args.length === 0 || typeof(args[0]) === "object") { + opts = args.length === 0 ? {} : $.extend({}, args[0]); + opts.element = $(this); + + if (opts.element.get(0).tagName.toLowerCase() === "select") { + multiple = opts.element.prop("multiple"); + } else { + multiple = opts.multiple || false; + if ("tags" in opts) {opts.multiple = multiple = true;} + } + + select2 = multiple ? new window.Select2["class"].multi() : new window.Select2["class"].single(); + select2.init(opts); + } else if (typeof(args[0]) === "string") { + + if (indexOf(args[0], allowedMethods) < 0) { + throw "Unknown method: " + args[0]; + } + + value = undefined; + select2 = $(this).data("select2"); + if (select2 === undefined) return; + + method=args[0]; + + if (method === "container") { + value = select2.container; + } else if (method === "dropdown") { + value = select2.dropdown; + } else { + if (methodsMap[method]) method = methodsMap[method]; + + value = select2[method].apply(select2, args.slice(1)); + } + if (indexOf(args[0], valueMethods) >= 0 + || (indexOf(args[0], propertyMethods) >= 0 && args.length == 1)) { + return false; // abort the iteration, ready to return first matched value + } + } else { + throw "Invalid arguments to select2 plugin: " + args; + } + }); + return (value === undefined) ? this : value; + }; + + // plugin defaults, accessible to users + $.fn.select2.defaults = { + width: "copy", + loadMorePadding: 0, + closeOnSelect: true, + openOnEnter: true, + containerCss: {}, + dropdownCss: {}, + containerCssClass: "", + dropdownCssClass: "", + formatResult: function(result, container, query, escapeMarkup) { + var markup=[]; + markMatch(this.text(result), query.term, markup, escapeMarkup); + return markup.join(""); + }, + transformVal: function(val) { + return $.trim(val); + }, + formatSelection: function (data, container, escapeMarkup) { + return data ? escapeMarkup(this.text(data)) : undefined; + }, + sortResults: function (results, container, query) { + return results; + }, + formatResultCssClass: function(data) {return data.css;}, + formatSelectionCssClass: function(data, container) {return undefined;}, + minimumResultsForSearch: 0, + minimumInputLength: 0, + maximumInputLength: null, + maximumSelectionSize: 0, + id: function (e) { return e == undefined ? null : e.id; }, + text: function (e) { + if (e && this.data && this.data.text) { + if ($.isFunction(this.data.text)) { + return this.data.text(e); + } else { + return e[this.data.text]; + } + } else { + return e.text; + } + }, + matcher: function(term, text) { + return stripDiacritics(''+text).toUpperCase().indexOf(stripDiacritics(''+term).toUpperCase()) >= 0; + }, + separator: ",", + tokenSeparators: [], + tokenizer: defaultTokenizer, + escapeMarkup: defaultEscapeMarkup, + blurOnChange: false, + selectOnBlur: false, + adaptContainerCssClass: function(c) { return c; }, + adaptDropdownCssClass: function(c) { return null; }, + nextSearchTerm: function(selectedObject, currentSearchTerm) { return undefined; }, + searchInputPlaceholder: '', + createSearchChoicePosition: 'top', + shouldFocusInput: function (instance) { + // Attempt to detect touch devices + var supportsTouchEvents = (('ontouchstart' in window) || + (navigator.msMaxTouchPoints > 0)); + + // Only devices which support touch events should be special cased + if (!supportsTouchEvents) { + return true; + } + + // Never focus the input if search is disabled + if (instance.opts.minimumResultsForSearch < 0) { + return false; + } + + return true; + } + }; + + $.fn.select2.locales = []; + + $.fn.select2.locales['en'] = { + formatMatches: function (matches) { if (matches === 1) { return "One result is available, press enter to select it."; } return matches + " results are available, use up and down arrow keys to navigate."; }, + formatNoMatches: function () { return "No matches found"; }, + formatAjaxError: function (jqXHR, textStatus, errorThrown) { return "Loading failed"; }, + formatInputTooShort: function (input, min) { var n = min - input.length; return "Please enter " + n + " or more character" + (n == 1 ? "" : "s"); }, + formatInputTooLong: function (input, max) { var n = input.length - max; return "Please delete " + n + " character" + (n == 1 ? "" : "s"); }, + formatSelectionTooBig: function (limit) { return "You can only select " + limit + " item" + (limit == 1 ? "" : "s"); }, + formatLoadMore: function (pageNumber) { return "Loading more results…"; }, + formatSearching: function () { return "Searching…"; } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['en']); + + $.fn.select2.ajaxDefaults = { + transport: $.ajax, + params: { + type: "GET", + cache: false, + dataType: "json" + } + }; + + // exports + window.Select2 = { + query: { + ajax: ajax, + local: local, + tags: tags + }, util: { + debounce: debounce, + markMatch: markMatch, + escapeMarkup: defaultEscapeMarkup, + stripDiacritics: stripDiacritics + }, "class": { + "abstract": AbstractSelect2, + "single": SingleSelect2, + "multi": MultiSelect2 + } + }; + +}(jQuery)); diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2.min.js b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2.min.js new file mode 100644 index 000000000..b56419e2e --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2.min.js @@ -0,0 +1,23 @@ +/* +Copyright 2014 Igor Vaynberg + +Version: 3.5.2 Timestamp: Sat Nov 1 14:43:36 EDT 2014 + +This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU +General Public License version 2 (the "GPL License"). You may choose either license to govern your +use of this software only upon the condition that you accept all of the terms of either the Apache +License or the GPL License. + +You may obtain a copy of the Apache License and the GPL License at: + +http://www.apache.org/licenses/LICENSE-2.0 +http://www.gnu.org/licenses/gpl-2.0.html + +Unless required by applicable law or agreed to in writing, software distributed under the Apache License +or the GPL Licesnse is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +either express or implied. See the Apache License and the GPL License for the specific language governing +permissions and limitations under the Apache License and the GPL License. +*/ +!function(a){"undefined"==typeof a.fn.each2&&a.extend(a.fn,{each2:function(b){for(var c=a([0]),d=-1,e=this.length;++dc;c+=1)if(r(a,b[c]))return c;return-1}function q(){var b=a(l);b.appendTo(document.body);var c={width:b.width()-b[0].clientWidth,height:b.height()-b[0].clientHeight};return b.remove(),c}function r(a,c){return a===c?!0:a===b||c===b?!1:null===a||null===c?!1:a.constructor===String?a+""==c+"":c.constructor===String?c+""==a+"":!1}function s(a,b,c){var d,e,f;if(null===a||a.length<1)return[];for(d=a.split(b),e=0,f=d.length;f>e;e+=1)d[e]=c(d[e]);return d}function t(a){return a.outerWidth(!1)-a.width()}function u(c){var d="keyup-change-value";c.on("keydown",function(){a.data(c,d)===b&&a.data(c,d,c.val())}),c.on("keyup",function(){var e=a.data(c,d);e!==b&&c.val()!==e&&(a.removeData(c,d),c.trigger("keyup-change"))})}function v(c){c.on("mousemove",function(c){var d=h;(d===b||d.x!==c.pageX||d.y!==c.pageY)&&a(c.target).trigger("mousemove-filtered",c)})}function w(a,c,d){d=d||b;var e;return function(){var b=arguments;window.clearTimeout(e),e=window.setTimeout(function(){c.apply(d,b)},a)}}function x(a,b){var c=w(a,function(a){b.trigger("scroll-debounced",a)});b.on("scroll",function(a){p(a.target,b.get())>=0&&c(a)})}function y(a){a[0]!==document.activeElement&&window.setTimeout(function(){var d,b=a[0],c=a.val().length;a.focus();var e=b.offsetWidth>0||b.offsetHeight>0;e&&b===document.activeElement&&(b.setSelectionRange?b.setSelectionRange(c,c):b.createTextRange&&(d=b.createTextRange(),d.collapse(!1),d.select()))},0)}function z(b){b=a(b)[0];var c=0,d=0;if("selectionStart"in b)c=b.selectionStart,d=b.selectionEnd-c;else if("selection"in document){b.focus();var e=document.selection.createRange();d=document.selection.createRange().text.length,e.moveStart("character",-b.value.length),c=e.text.length-d}return{offset:c,length:d}}function A(a){a.preventDefault(),a.stopPropagation()}function B(a){a.preventDefault(),a.stopImmediatePropagation()}function C(b){if(!g){var c=b[0].currentStyle||window.getComputedStyle(b[0],null);g=a(document.createElement("div")).css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:c.fontSize,fontFamily:c.fontFamily,fontStyle:c.fontStyle,fontWeight:c.fontWeight,letterSpacing:c.letterSpacing,textTransform:c.textTransform,whiteSpace:"nowrap"}),g.attr("class","select2-sizer"),a(document.body).append(g)}return g.text(b.val()),g.width()}function D(b,c,d){var e,g,f=[];e=a.trim(b.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each2(function(){0===this.indexOf("select2-")&&f.push(this)})),e=a.trim(c.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each2(function(){0!==this.indexOf("select2-")&&(g=d(this),g&&f.push(g))})),b.attr("class",f.join(" "))}function E(a,b,c,d){var e=o(a.toUpperCase()).indexOf(o(b.toUpperCase())),f=b.length;return 0>e?(c.push(d(a)),void 0):(c.push(d(a.substring(0,e))),c.push(""),c.push(d(a.substring(e,e+f))),c.push(""),c.push(d(a.substring(e+f,a.length))),void 0)}function F(a){var b={"\\":"\","&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})}function G(c){var d,e=null,f=c.quietMillis||100,g=c.url,h=this;return function(i){window.clearTimeout(d),d=window.setTimeout(function(){var d=c.data,f=g,j=c.transport||a.fn.select2.ajaxDefaults.transport,k={type:c.type||"GET",cache:c.cache||!1,jsonpCallback:c.jsonpCallback||b,dataType:c.dataType||"json"},l=a.extend({},a.fn.select2.ajaxDefaults.params,k);d=d?d.call(h,i.term,i.page,i.context):null,f="function"==typeof f?f.call(h,i.term,i.page,i.context):f,e&&"function"==typeof e.abort&&e.abort(),c.params&&(a.isFunction(c.params)?a.extend(l,c.params.call(h)):a.extend(l,c.params)),a.extend(l,{url:f,dataType:c.dataType,data:d,success:function(a){var b=c.results(a,i.page,i);i.callback(b)},error:function(a,b,c){var d={hasError:!0,jqXHR:a,textStatus:b,errorThrown:c};i.callback(d)}}),e=j.call(h,l)},f)}}function H(b){var d,e,c=b,f=function(a){return""+a.text};a.isArray(c)&&(e=c,c={results:e}),a.isFunction(c)===!1&&(e=c,c=function(){return e});var g=c();return g.text&&(f=g.text,a.isFunction(f)||(d=g.text,f=function(a){return a[d]})),function(b){var g,d=b.term,e={results:[]};return""===d?(b.callback(c()),void 0):(g=function(c,e){var h,i;if(c=c[0],c.children){h={};for(i in c)c.hasOwnProperty(i)&&(h[i]=c[i]);h.children=[],a(c.children).each2(function(a,b){g(b,h.children)}),(h.children.length||b.matcher(d,f(h),c))&&e.push(h)}else b.matcher(d,f(c),c)&&e.push(c)},a(c().results).each2(function(a,b){g(b,e.results)}),b.callback(e),void 0)}}function I(c){var d=a.isFunction(c);return function(e){var f=e.term,g={results:[]},h=d?c(e):c;a.isArray(h)&&(a(h).each(function(){var a=this.text!==b,c=a?this.text:this;(""===f||e.matcher(f,c))&&g.results.push(a?this:{id:this,text:this})}),e.callback(g))}}function J(b,c){if(a.isFunction(b))return!0;if(!b)return!1;if("string"==typeof b)return!0;throw new Error(c+" must be a string, function, or falsy value")}function K(b,c){if(a.isFunction(b)){var d=Array.prototype.slice.call(arguments,2);return b.apply(c,d)}return b}function L(b){var c=0;return a.each(b,function(a,b){b.children?c+=L(b.children):c++}),c}function M(a,c,d,e){var h,i,j,k,l,f=a,g=!1;if(!e.createSearchChoice||!e.tokenSeparators||e.tokenSeparators.length<1)return b;for(;;){for(i=-1,j=0,k=e.tokenSeparators.length;k>j&&(l=e.tokenSeparators[j],i=a.indexOf(l),!(i>=0));j++);if(0>i)break;if(h=a.substring(0,i),a=a.substring(i+l.length),h.length>0&&(h=e.createSearchChoice.call(this,h,c),h!==b&&null!==h&&e.id(h)!==b&&null!==e.id(h))){for(g=!1,j=0,k=c.length;k>j;j++)if(r(e.id(h),e.id(c[j]))){g=!0;break}g||d(h)}}return f!==a?a:void 0}function N(){var b=this;a.each(arguments,function(a,c){b[c].remove(),b[c]=null})}function O(b,c){var d=function(){};return d.prototype=new b,d.prototype.constructor=d,d.prototype.parent=b.prototype,d.prototype=a.extend(d.prototype,c),d}if(window.Select2===b){var c,d,e,f,g,i,j,h={x:0,y:0},k={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,isArrow:function(a){switch(a=a.which?a.which:a){case k.LEFT:case k.RIGHT:case k.UP:case k.DOWN:return!0}return!1},isControl:function(a){var b=a.which;switch(b){case k.SHIFT:case k.CTRL:case k.ALT:return!0}return a.metaKey?!0:!1},isFunctionKey:function(a){return a=a.which?a.which:a,a>=112&&123>=a}},l="
    ",m={"\u24b6":"A","\uff21":"A","\xc0":"A","\xc1":"A","\xc2":"A","\u1ea6":"A","\u1ea4":"A","\u1eaa":"A","\u1ea8":"A","\xc3":"A","\u0100":"A","\u0102":"A","\u1eb0":"A","\u1eae":"A","\u1eb4":"A","\u1eb2":"A","\u0226":"A","\u01e0":"A","\xc4":"A","\u01de":"A","\u1ea2":"A","\xc5":"A","\u01fa":"A","\u01cd":"A","\u0200":"A","\u0202":"A","\u1ea0":"A","\u1eac":"A","\u1eb6":"A","\u1e00":"A","\u0104":"A","\u023a":"A","\u2c6f":"A","\ua732":"AA","\xc6":"AE","\u01fc":"AE","\u01e2":"AE","\ua734":"AO","\ua736":"AU","\ua738":"AV","\ua73a":"AV","\ua73c":"AY","\u24b7":"B","\uff22":"B","\u1e02":"B","\u1e04":"B","\u1e06":"B","\u0243":"B","\u0182":"B","\u0181":"B","\u24b8":"C","\uff23":"C","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\xc7":"C","\u1e08":"C","\u0187":"C","\u023b":"C","\ua73e":"C","\u24b9":"D","\uff24":"D","\u1e0a":"D","\u010e":"D","\u1e0c":"D","\u1e10":"D","\u1e12":"D","\u1e0e":"D","\u0110":"D","\u018b":"D","\u018a":"D","\u0189":"D","\ua779":"D","\u01f1":"DZ","\u01c4":"DZ","\u01f2":"Dz","\u01c5":"Dz","\u24ba":"E","\uff25":"E","\xc8":"E","\xc9":"E","\xca":"E","\u1ec0":"E","\u1ebe":"E","\u1ec4":"E","\u1ec2":"E","\u1ebc":"E","\u0112":"E","\u1e14":"E","\u1e16":"E","\u0114":"E","\u0116":"E","\xcb":"E","\u1eba":"E","\u011a":"E","\u0204":"E","\u0206":"E","\u1eb8":"E","\u1ec6":"E","\u0228":"E","\u1e1c":"E","\u0118":"E","\u1e18":"E","\u1e1a":"E","\u0190":"E","\u018e":"E","\u24bb":"F","\uff26":"F","\u1e1e":"F","\u0191":"F","\ua77b":"F","\u24bc":"G","\uff27":"G","\u01f4":"G","\u011c":"G","\u1e20":"G","\u011e":"G","\u0120":"G","\u01e6":"G","\u0122":"G","\u01e4":"G","\u0193":"G","\ua7a0":"G","\ua77d":"G","\ua77e":"G","\u24bd":"H","\uff28":"H","\u0124":"H","\u1e22":"H","\u1e26":"H","\u021e":"H","\u1e24":"H","\u1e28":"H","\u1e2a":"H","\u0126":"H","\u2c67":"H","\u2c75":"H","\ua78d":"H","\u24be":"I","\uff29":"I","\xcc":"I","\xcd":"I","\xce":"I","\u0128":"I","\u012a":"I","\u012c":"I","\u0130":"I","\xcf":"I","\u1e2e":"I","\u1ec8":"I","\u01cf":"I","\u0208":"I","\u020a":"I","\u1eca":"I","\u012e":"I","\u1e2c":"I","\u0197":"I","\u24bf":"J","\uff2a":"J","\u0134":"J","\u0248":"J","\u24c0":"K","\uff2b":"K","\u1e30":"K","\u01e8":"K","\u1e32":"K","\u0136":"K","\u1e34":"K","\u0198":"K","\u2c69":"K","\ua740":"K","\ua742":"K","\ua744":"K","\ua7a2":"K","\u24c1":"L","\uff2c":"L","\u013f":"L","\u0139":"L","\u013d":"L","\u1e36":"L","\u1e38":"L","\u013b":"L","\u1e3c":"L","\u1e3a":"L","\u0141":"L","\u023d":"L","\u2c62":"L","\u2c60":"L","\ua748":"L","\ua746":"L","\ua780":"L","\u01c7":"LJ","\u01c8":"Lj","\u24c2":"M","\uff2d":"M","\u1e3e":"M","\u1e40":"M","\u1e42":"M","\u2c6e":"M","\u019c":"M","\u24c3":"N","\uff2e":"N","\u01f8":"N","\u0143":"N","\xd1":"N","\u1e44":"N","\u0147":"N","\u1e46":"N","\u0145":"N","\u1e4a":"N","\u1e48":"N","\u0220":"N","\u019d":"N","\ua790":"N","\ua7a4":"N","\u01ca":"NJ","\u01cb":"Nj","\u24c4":"O","\uff2f":"O","\xd2":"O","\xd3":"O","\xd4":"O","\u1ed2":"O","\u1ed0":"O","\u1ed6":"O","\u1ed4":"O","\xd5":"O","\u1e4c":"O","\u022c":"O","\u1e4e":"O","\u014c":"O","\u1e50":"O","\u1e52":"O","\u014e":"O","\u022e":"O","\u0230":"O","\xd6":"O","\u022a":"O","\u1ece":"O","\u0150":"O","\u01d1":"O","\u020c":"O","\u020e":"O","\u01a0":"O","\u1edc":"O","\u1eda":"O","\u1ee0":"O","\u1ede":"O","\u1ee2":"O","\u1ecc":"O","\u1ed8":"O","\u01ea":"O","\u01ec":"O","\xd8":"O","\u01fe":"O","\u0186":"O","\u019f":"O","\ua74a":"O","\ua74c":"O","\u01a2":"OI","\ua74e":"OO","\u0222":"OU","\u24c5":"P","\uff30":"P","\u1e54":"P","\u1e56":"P","\u01a4":"P","\u2c63":"P","\ua750":"P","\ua752":"P","\ua754":"P","\u24c6":"Q","\uff31":"Q","\ua756":"Q","\ua758":"Q","\u024a":"Q","\u24c7":"R","\uff32":"R","\u0154":"R","\u1e58":"R","\u0158":"R","\u0210":"R","\u0212":"R","\u1e5a":"R","\u1e5c":"R","\u0156":"R","\u1e5e":"R","\u024c":"R","\u2c64":"R","\ua75a":"R","\ua7a6":"R","\ua782":"R","\u24c8":"S","\uff33":"S","\u1e9e":"S","\u015a":"S","\u1e64":"S","\u015c":"S","\u1e60":"S","\u0160":"S","\u1e66":"S","\u1e62":"S","\u1e68":"S","\u0218":"S","\u015e":"S","\u2c7e":"S","\ua7a8":"S","\ua784":"S","\u24c9":"T","\uff34":"T","\u1e6a":"T","\u0164":"T","\u1e6c":"T","\u021a":"T","\u0162":"T","\u1e70":"T","\u1e6e":"T","\u0166":"T","\u01ac":"T","\u01ae":"T","\u023e":"T","\ua786":"T","\ua728":"TZ","\u24ca":"U","\uff35":"U","\xd9":"U","\xda":"U","\xdb":"U","\u0168":"U","\u1e78":"U","\u016a":"U","\u1e7a":"U","\u016c":"U","\xdc":"U","\u01db":"U","\u01d7":"U","\u01d5":"U","\u01d9":"U","\u1ee6":"U","\u016e":"U","\u0170":"U","\u01d3":"U","\u0214":"U","\u0216":"U","\u01af":"U","\u1eea":"U","\u1ee8":"U","\u1eee":"U","\u1eec":"U","\u1ef0":"U","\u1ee4":"U","\u1e72":"U","\u0172":"U","\u1e76":"U","\u1e74":"U","\u0244":"U","\u24cb":"V","\uff36":"V","\u1e7c":"V","\u1e7e":"V","\u01b2":"V","\ua75e":"V","\u0245":"V","\ua760":"VY","\u24cc":"W","\uff37":"W","\u1e80":"W","\u1e82":"W","\u0174":"W","\u1e86":"W","\u1e84":"W","\u1e88":"W","\u2c72":"W","\u24cd":"X","\uff38":"X","\u1e8a":"X","\u1e8c":"X","\u24ce":"Y","\uff39":"Y","\u1ef2":"Y","\xdd":"Y","\u0176":"Y","\u1ef8":"Y","\u0232":"Y","\u1e8e":"Y","\u0178":"Y","\u1ef6":"Y","\u1ef4":"Y","\u01b3":"Y","\u024e":"Y","\u1efe":"Y","\u24cf":"Z","\uff3a":"Z","\u0179":"Z","\u1e90":"Z","\u017b":"Z","\u017d":"Z","\u1e92":"Z","\u1e94":"Z","\u01b5":"Z","\u0224":"Z","\u2c7f":"Z","\u2c6b":"Z","\ua762":"Z","\u24d0":"a","\uff41":"a","\u1e9a":"a","\xe0":"a","\xe1":"a","\xe2":"a","\u1ea7":"a","\u1ea5":"a","\u1eab":"a","\u1ea9":"a","\xe3":"a","\u0101":"a","\u0103":"a","\u1eb1":"a","\u1eaf":"a","\u1eb5":"a","\u1eb3":"a","\u0227":"a","\u01e1":"a","\xe4":"a","\u01df":"a","\u1ea3":"a","\xe5":"a","\u01fb":"a","\u01ce":"a","\u0201":"a","\u0203":"a","\u1ea1":"a","\u1ead":"a","\u1eb7":"a","\u1e01":"a","\u0105":"a","\u2c65":"a","\u0250":"a","\ua733":"aa","\xe6":"ae","\u01fd":"ae","\u01e3":"ae","\ua735":"ao","\ua737":"au","\ua739":"av","\ua73b":"av","\ua73d":"ay","\u24d1":"b","\uff42":"b","\u1e03":"b","\u1e05":"b","\u1e07":"b","\u0180":"b","\u0183":"b","\u0253":"b","\u24d2":"c","\uff43":"c","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\xe7":"c","\u1e09":"c","\u0188":"c","\u023c":"c","\ua73f":"c","\u2184":"c","\u24d3":"d","\uff44":"d","\u1e0b":"d","\u010f":"d","\u1e0d":"d","\u1e11":"d","\u1e13":"d","\u1e0f":"d","\u0111":"d","\u018c":"d","\u0256":"d","\u0257":"d","\ua77a":"d","\u01f3":"dz","\u01c6":"dz","\u24d4":"e","\uff45":"e","\xe8":"e","\xe9":"e","\xea":"e","\u1ec1":"e","\u1ebf":"e","\u1ec5":"e","\u1ec3":"e","\u1ebd":"e","\u0113":"e","\u1e15":"e","\u1e17":"e","\u0115":"e","\u0117":"e","\xeb":"e","\u1ebb":"e","\u011b":"e","\u0205":"e","\u0207":"e","\u1eb9":"e","\u1ec7":"e","\u0229":"e","\u1e1d":"e","\u0119":"e","\u1e19":"e","\u1e1b":"e","\u0247":"e","\u025b":"e","\u01dd":"e","\u24d5":"f","\uff46":"f","\u1e1f":"f","\u0192":"f","\ua77c":"f","\u24d6":"g","\uff47":"g","\u01f5":"g","\u011d":"g","\u1e21":"g","\u011f":"g","\u0121":"g","\u01e7":"g","\u0123":"g","\u01e5":"g","\u0260":"g","\ua7a1":"g","\u1d79":"g","\ua77f":"g","\u24d7":"h","\uff48":"h","\u0125":"h","\u1e23":"h","\u1e27":"h","\u021f":"h","\u1e25":"h","\u1e29":"h","\u1e2b":"h","\u1e96":"h","\u0127":"h","\u2c68":"h","\u2c76":"h","\u0265":"h","\u0195":"hv","\u24d8":"i","\uff49":"i","\xec":"i","\xed":"i","\xee":"i","\u0129":"i","\u012b":"i","\u012d":"i","\xef":"i","\u1e2f":"i","\u1ec9":"i","\u01d0":"i","\u0209":"i","\u020b":"i","\u1ecb":"i","\u012f":"i","\u1e2d":"i","\u0268":"i","\u0131":"i","\u24d9":"j","\uff4a":"j","\u0135":"j","\u01f0":"j","\u0249":"j","\u24da":"k","\uff4b":"k","\u1e31":"k","\u01e9":"k","\u1e33":"k","\u0137":"k","\u1e35":"k","\u0199":"k","\u2c6a":"k","\ua741":"k","\ua743":"k","\ua745":"k","\ua7a3":"k","\u24db":"l","\uff4c":"l","\u0140":"l","\u013a":"l","\u013e":"l","\u1e37":"l","\u1e39":"l","\u013c":"l","\u1e3d":"l","\u1e3b":"l","\u017f":"l","\u0142":"l","\u019a":"l","\u026b":"l","\u2c61":"l","\ua749":"l","\ua781":"l","\ua747":"l","\u01c9":"lj","\u24dc":"m","\uff4d":"m","\u1e3f":"m","\u1e41":"m","\u1e43":"m","\u0271":"m","\u026f":"m","\u24dd":"n","\uff4e":"n","\u01f9":"n","\u0144":"n","\xf1":"n","\u1e45":"n","\u0148":"n","\u1e47":"n","\u0146":"n","\u1e4b":"n","\u1e49":"n","\u019e":"n","\u0272":"n","\u0149":"n","\ua791":"n","\ua7a5":"n","\u01cc":"nj","\u24de":"o","\uff4f":"o","\xf2":"o","\xf3":"o","\xf4":"o","\u1ed3":"o","\u1ed1":"o","\u1ed7":"o","\u1ed5":"o","\xf5":"o","\u1e4d":"o","\u022d":"o","\u1e4f":"o","\u014d":"o","\u1e51":"o","\u1e53":"o","\u014f":"o","\u022f":"o","\u0231":"o","\xf6":"o","\u022b":"o","\u1ecf":"o","\u0151":"o","\u01d2":"o","\u020d":"o","\u020f":"o","\u01a1":"o","\u1edd":"o","\u1edb":"o","\u1ee1":"o","\u1edf":"o","\u1ee3":"o","\u1ecd":"o","\u1ed9":"o","\u01eb":"o","\u01ed":"o","\xf8":"o","\u01ff":"o","\u0254":"o","\ua74b":"o","\ua74d":"o","\u0275":"o","\u01a3":"oi","\u0223":"ou","\ua74f":"oo","\u24df":"p","\uff50":"p","\u1e55":"p","\u1e57":"p","\u01a5":"p","\u1d7d":"p","\ua751":"p","\ua753":"p","\ua755":"p","\u24e0":"q","\uff51":"q","\u024b":"q","\ua757":"q","\ua759":"q","\u24e1":"r","\uff52":"r","\u0155":"r","\u1e59":"r","\u0159":"r","\u0211":"r","\u0213":"r","\u1e5b":"r","\u1e5d":"r","\u0157":"r","\u1e5f":"r","\u024d":"r","\u027d":"r","\ua75b":"r","\ua7a7":"r","\ua783":"r","\u24e2":"s","\uff53":"s","\xdf":"s","\u015b":"s","\u1e65":"s","\u015d":"s","\u1e61":"s","\u0161":"s","\u1e67":"s","\u1e63":"s","\u1e69":"s","\u0219":"s","\u015f":"s","\u023f":"s","\ua7a9":"s","\ua785":"s","\u1e9b":"s","\u24e3":"t","\uff54":"t","\u1e6b":"t","\u1e97":"t","\u0165":"t","\u1e6d":"t","\u021b":"t","\u0163":"t","\u1e71":"t","\u1e6f":"t","\u0167":"t","\u01ad":"t","\u0288":"t","\u2c66":"t","\ua787":"t","\ua729":"tz","\u24e4":"u","\uff55":"u","\xf9":"u","\xfa":"u","\xfb":"u","\u0169":"u","\u1e79":"u","\u016b":"u","\u1e7b":"u","\u016d":"u","\xfc":"u","\u01dc":"u","\u01d8":"u","\u01d6":"u","\u01da":"u","\u1ee7":"u","\u016f":"u","\u0171":"u","\u01d4":"u","\u0215":"u","\u0217":"u","\u01b0":"u","\u1eeb":"u","\u1ee9":"u","\u1eef":"u","\u1eed":"u","\u1ef1":"u","\u1ee5":"u","\u1e73":"u","\u0173":"u","\u1e77":"u","\u1e75":"u","\u0289":"u","\u24e5":"v","\uff56":"v","\u1e7d":"v","\u1e7f":"v","\u028b":"v","\ua75f":"v","\u028c":"v","\ua761":"vy","\u24e6":"w","\uff57":"w","\u1e81":"w","\u1e83":"w","\u0175":"w","\u1e87":"w","\u1e85":"w","\u1e98":"w","\u1e89":"w","\u2c73":"w","\u24e7":"x","\uff58":"x","\u1e8b":"x","\u1e8d":"x","\u24e8":"y","\uff59":"y","\u1ef3":"y","\xfd":"y","\u0177":"y","\u1ef9":"y","\u0233":"y","\u1e8f":"y","\xff":"y","\u1ef7":"y","\u1e99":"y","\u1ef5":"y","\u01b4":"y","\u024f":"y","\u1eff":"y","\u24e9":"z","\uff5a":"z","\u017a":"z","\u1e91":"z","\u017c":"z","\u017e":"z","\u1e93":"z","\u1e95":"z","\u01b6":"z","\u0225":"z","\u0240":"z","\u2c6c":"z","\ua763":"z","\u0386":"\u0391","\u0388":"\u0395","\u0389":"\u0397","\u038a":"\u0399","\u03aa":"\u0399","\u038c":"\u039f","\u038e":"\u03a5","\u03ab":"\u03a5","\u038f":"\u03a9","\u03ac":"\u03b1","\u03ad":"\u03b5","\u03ae":"\u03b7","\u03af":"\u03b9","\u03ca":"\u03b9","\u0390":"\u03b9","\u03cc":"\u03bf","\u03cd":"\u03c5","\u03cb":"\u03c5","\u03b0":"\u03c5","\u03c9":"\u03c9","\u03c2":"\u03c3"};i=a(document),f=function(){var a=1;return function(){return a++}}(),c=O(Object,{bind:function(a){var b=this;return function(){a.apply(b,arguments)}},init:function(c){var d,e,g=".select2-results";this.opts=c=this.prepareOpts(c),this.id=c.id,c.element.data("select2")!==b&&null!==c.element.data("select2")&&c.element.data("select2").destroy(),this.container=this.createContainer(),this.liveRegion=a(".select2-hidden-accessible"),0==this.liveRegion.length&&(this.liveRegion=a("",{role:"status","aria-live":"polite"}).addClass("select2-hidden-accessible").appendTo(document.body)),this.containerId="s2id_"+(c.element.attr("id")||"autogen"+f()),this.containerEventName=this.containerId.replace(/([.])/g,"_").replace(/([;&,\-\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1"),this.container.attr("id",this.containerId),this.container.attr("title",c.element.attr("title")),this.body=a(document.body),D(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.attr("style",c.element.attr("style")),this.container.css(K(c.containerCss,this.opts.element)),this.container.addClass(K(c.containerCssClass,this.opts.element)),this.elementTabIndex=this.opts.element.attr("tabindex"),this.opts.element.data("select2",this).attr("tabindex","-1").before(this.container).on("click.select2",A),this.container.data("select2",this),this.dropdown=this.container.find(".select2-drop"),D(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(K(c.dropdownCssClass,this.opts.element)),this.dropdown.data("select2",this),this.dropdown.on("click",A),this.results=d=this.container.find(g),this.search=e=this.container.find("input.select2-input"),this.queryCount=0,this.resultsPage=0,this.context=null,this.initContainer(),this.container.on("click",A),v(this.results),this.dropdown.on("mousemove-filtered",g,this.bind(this.highlightUnderEvent)),this.dropdown.on("touchstart touchmove touchend",g,this.bind(function(a){this._touchEvent=!0,this.highlightUnderEvent(a)})),this.dropdown.on("touchmove",g,this.bind(this.touchMoved)),this.dropdown.on("touchstart touchend",g,this.bind(this.clearTouchMoved)),this.dropdown.on("click",this.bind(function(){this._touchEvent&&(this._touchEvent=!1,this.selectHighlighted())})),x(80,this.results),this.dropdown.on("scroll-debounced",g,this.bind(this.loadMoreIfNeeded)),a(this.container).on("change",".select2-input",function(a){a.stopPropagation()}),a(this.dropdown).on("change",".select2-input",function(a){a.stopPropagation()}),a.fn.mousewheel&&d.mousewheel(function(a,b,c,e){var f=d.scrollTop();e>0&&0>=f-e?(d.scrollTop(0),A(a)):0>e&&d.get(0).scrollHeight-d.scrollTop()+e<=d.height()&&(d.scrollTop(d.get(0).scrollHeight-d.height()),A(a))}),u(e),e.on("keyup-change input paste",this.bind(this.updateResults)),e.on("focus",function(){e.addClass("select2-focused")}),e.on("blur",function(){e.removeClass("select2-focused")}),this.dropdown.on("mouseup",g,this.bind(function(b){a(b.target).closest(".select2-result-selectable").length>0&&(this.highlightUnderEvent(b),this.selectHighlighted(b))})),this.dropdown.on("click mouseup mousedown touchstart touchend focusin",function(a){a.stopPropagation()}),this.nextSearchTerm=b,a.isFunction(this.opts.initSelection)&&(this.initSelection(),this.monitorSource()),null!==c.maximumInputLength&&this.search.attr("maxlength",c.maximumInputLength);var h=c.element.prop("disabled");h===b&&(h=!1),this.enable(!h);var i=c.element.prop("readonly");i===b&&(i=!1),this.readonly(i),j=j||q(),this.autofocus=c.element.prop("autofocus"),c.element.prop("autofocus",!1),this.autofocus&&this.focus(),this.search.attr("placeholder",c.searchInputPlaceholder)},destroy:function(){var a=this.opts.element,c=a.data("select2"),d=this;this.close(),a.length&&a[0].detachEvent&&d._sync&&a.each(function(){d._sync&&this.detachEvent("onpropertychange",d._sync)}),this.propertyObserver&&(this.propertyObserver.disconnect(),this.propertyObserver=null),this._sync=null,c!==b&&(c.container.remove(),c.liveRegion.remove(),c.dropdown.remove(),a.show().removeData("select2").off(".select2").prop("autofocus",this.autofocus||!1),this.elementTabIndex?a.attr({tabindex:this.elementTabIndex}):a.removeAttr("tabindex"),a.show()),N.call(this,"container","liveRegion","dropdown","results","search")},optionToData:function(a){return a.is("option")?{id:a.prop("value"),text:a.text(),element:a.get(),css:a.attr("class"),disabled:a.prop("disabled"),locked:r(a.attr("locked"),"locked")||r(a.data("locked"),!0)}:a.is("optgroup")?{text:a.attr("label"),children:[],element:a.get(),css:a.attr("class")}:void 0},prepareOpts:function(c){var d,e,g,h,i=this;if(d=c.element,"select"===d.get(0).tagName.toLowerCase()&&(this.select=e=c.element),e&&a.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],function(){if(this in c)throw new Error("Option '"+this+"' is not allowed for Select2 when attached to a ","
    "," ","
      ","
    ","
    "].join(""));return b},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.focusser.prop("disabled",!this.isInterfaceEnabled())},opening:function(){var c,d,e;this.opts.minimumResultsForSearch>=0&&this.showSearch(!0),this.parent.opening.apply(this,arguments),this.showSearchInput!==!1&&this.search.val(this.focusser.val()),this.opts.shouldFocusInput(this)&&(this.search.focus(),c=this.search.get(0),c.createTextRange?(d=c.createTextRange(),d.collapse(!1),d.select()):c.setSelectionRange&&(e=this.search.val().length,c.setSelectionRange(e,e))),""===this.search.val()&&this.nextSearchTerm!=b&&(this.search.val(this.nextSearchTerm),this.search.select()),this.focusser.prop("disabled",!0).val(""),this.updateResults(!0),this.opts.element.trigger(a.Event("select2-open"))},close:function(){this.opened()&&(this.parent.close.apply(this,arguments),this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus())},focus:function(){this.opened()?this.close():(this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus())},isFocused:function(){return this.container.hasClass("select2-container-active")},cancel:function(){this.parent.cancel.apply(this,arguments),this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus()},destroy:function(){a("label[for='"+this.focusser.attr("id")+"']").attr("for",this.opts.element.attr("id")),this.parent.destroy.apply(this,arguments),N.call(this,"selection","focusser")},initContainer:function(){var b,g,c=this.container,d=this.dropdown,e=f();this.opts.minimumResultsForSearch<0?this.showSearch(!1):this.showSearch(!0),this.selection=b=c.find(".select2-choice"),this.focusser=c.find(".select2-focusser"),b.find(".select2-chosen").attr("id","select2-chosen-"+e),this.focusser.attr("aria-labelledby","select2-chosen-"+e),this.results.attr("id","select2-results-"+e),this.search.attr("aria-owns","select2-results-"+e),this.focusser.attr("id","s2id_autogen"+e),g=a("label[for='"+this.opts.element.attr("id")+"']"),this.opts.element.focus(this.bind(function(){this.focus()})),this.focusser.prev().text(g.text()).attr("for",this.focusser.attr("id"));var h=this.opts.element.attr("title");this.opts.element.attr("title",h||g.text()),this.focusser.attr("tabindex",this.elementTabIndex),this.search.attr("id",this.focusser.attr("id")+"_search"),this.search.prev().text(a("label[for='"+this.focusser.attr("id")+"']").text()).attr("for",this.search.attr("id")),this.search.on("keydown",this.bind(function(a){if(this.isInterfaceEnabled()&&229!=a.keyCode){if(a.which===k.PAGE_UP||a.which===k.PAGE_DOWN)return A(a),void 0;switch(a.which){case k.UP:case k.DOWN:return this.moveHighlight(a.which===k.UP?-1:1),A(a),void 0;case k.ENTER:return this.selectHighlighted(),A(a),void 0;case k.TAB:return this.selectHighlighted({noFocus:!0}),void 0;case k.ESC:return this.cancel(a),A(a),void 0}}})),this.search.on("blur",this.bind(function(){document.activeElement===this.body.get(0)&&window.setTimeout(this.bind(function(){this.opened()&&this.search.focus()}),0)})),this.focusser.on("keydown",this.bind(function(a){if(this.isInterfaceEnabled()&&a.which!==k.TAB&&!k.isControl(a)&&!k.isFunctionKey(a)&&a.which!==k.ESC){if(this.opts.openOnEnter===!1&&a.which===k.ENTER)return A(a),void 0;if(a.which==k.DOWN||a.which==k.UP||a.which==k.ENTER&&this.opts.openOnEnter){if(a.altKey||a.ctrlKey||a.shiftKey||a.metaKey)return;return this.open(),A(a),void 0}return a.which==k.DELETE||a.which==k.BACKSPACE?(this.opts.allowClear&&this.clear(),A(a),void 0):void 0}})),u(this.focusser),this.focusser.on("keyup-change input",this.bind(function(a){if(this.opts.minimumResultsForSearch>=0){if(a.stopPropagation(),this.opened())return;this.open()}})),b.on("mousedown touchstart","abbr",this.bind(function(a){this.isInterfaceEnabled()&&(this.clear(),B(a),this.close(),this.selection&&this.selection.focus())})),b.on("mousedown touchstart",this.bind(function(c){n(b),this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.opened()?this.close():this.isInterfaceEnabled()&&this.open(),A(c)})),d.on("mousedown touchstart",this.bind(function(){this.opts.shouldFocusInput(this)&&this.search.focus()})),b.on("focus",this.bind(function(a){A(a)})),this.focusser.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.container.addClass("select2-container-active")})).on("blur",this.bind(function(){this.opened()||(this.container.removeClass("select2-container-active"),this.opts.element.trigger(a.Event("select2-blur")))})),this.search.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.container.addClass("select2-container-active")})),this.initContainerWidth(),this.opts.element.hide(),this.setPlaceholder()},clear:function(b){var c=this.selection.data("select2-data");if(c){var d=a.Event("select2-clearing");if(this.opts.element.trigger(d),d.isDefaultPrevented())return;var e=this.getPlaceholderOption();this.opts.element.val(e?e.val():""),this.selection.find(".select2-chosen").empty(),this.selection.removeData("select2-data"),this.setPlaceholder(),b!==!1&&(this.opts.element.trigger({type:"select2-removed",val:this.id(c),choice:c}),this.triggerChange({removed:c}))}},initSelection:function(){if(this.isPlaceholderOptionSelected())this.updateSelection(null),this.close(),this.setPlaceholder();else{var c=this;this.opts.initSelection.call(null,this.opts.element,function(a){a!==b&&null!==a&&(c.updateSelection(a),c.close(),c.setPlaceholder(),c.nextSearchTerm=c.opts.nextSearchTerm(a,c.search.val()))})}},isPlaceholderOptionSelected:function(){var a;return this.getPlaceholder()===b?!1:(a=this.getPlaceholderOption())!==b&&a.prop("selected")||""===this.opts.element.val()||this.opts.element.val()===b||null===this.opts.element.val()},prepareOpts:function(){var b=this.parent.prepareOpts.apply(this,arguments),c=this;return"select"===b.element.get(0).tagName.toLowerCase()?b.initSelection=function(a,b){var d=a.find("option").filter(function(){return this.selected&&!this.disabled});b(c.optionToData(d))}:"data"in b&&(b.initSelection=b.initSelection||function(c,d){var e=c.val(),f=null;b.query({matcher:function(a,c,d){var g=r(e,b.id(d));return g&&(f=d),g},callback:a.isFunction(d)?function(){d(f)}:a.noop})}),b},getPlaceholder:function(){return this.select&&this.getPlaceholderOption()===b?b:this.parent.getPlaceholder.apply(this,arguments)},setPlaceholder:function(){var a=this.getPlaceholder();if(this.isPlaceholderOptionSelected()&&a!==b){if(this.select&&this.getPlaceholderOption()===b)return;this.selection.find(".select2-chosen").html(this.opts.escapeMarkup(a)),this.selection.addClass("select2-default"),this.container.removeClass("select2-allowclear")}},postprocessResults:function(a,b,c){var d=0,e=this;if(this.findHighlightableChoices().each2(function(a,b){return r(e.id(b.data("select2-data")),e.opts.element.val())?(d=a,!1):void 0}),c!==!1&&(b===!0&&d>=0?this.highlight(d):this.highlight(0)),b===!0){var g=this.opts.minimumResultsForSearch;g>=0&&this.showSearch(L(a.results)>=g)}},showSearch:function(b){this.showSearchInput!==b&&(this.showSearchInput=b,this.dropdown.find(".select2-search").toggleClass("select2-search-hidden",!b),this.dropdown.find(".select2-search").toggleClass("select2-offscreen",!b),a(this.dropdown,this.container).toggleClass("select2-with-searchbox",b))},onSelect:function(a,b){if(this.triggerSelect(a)){var c=this.opts.element.val(),d=this.data();this.opts.element.val(this.id(a)),this.updateSelection(a),this.opts.element.trigger({type:"select2-selected",val:this.id(a),choice:a}),this.nextSearchTerm=this.opts.nextSearchTerm(a,this.search.val()),this.close(),b&&b.noFocus||!this.opts.shouldFocusInput(this)||this.focusser.focus(),r(c,this.id(a))||this.triggerChange({added:a,removed:d})}},updateSelection:function(a){var d,e,c=this.selection.find(".select2-chosen");this.selection.data("select2-data",a),c.empty(),null!==a&&(d=this.opts.formatSelection(a,c,this.opts.escapeMarkup)),d!==b&&c.append(d),e=this.opts.formatSelectionCssClass(a,c),e!==b&&c.addClass(e),this.selection.removeClass("select2-default"),this.opts.allowClear&&this.getPlaceholder()!==b&&this.container.addClass("select2-allowclear")},val:function(){var a,c=!1,d=null,e=this,f=this.data();if(0===arguments.length)return this.opts.element.val();if(a=arguments[0],arguments.length>1&&(c=arguments[1]),this.select)this.select.val(a).find("option").filter(function(){return this.selected}).each2(function(a,b){return d=e.optionToData(b),!1}),this.updateSelection(d),this.setPlaceholder(),c&&this.triggerChange({added:d,removed:f});else{if(!a&&0!==a)return this.clear(c),void 0;if(this.opts.initSelection===b)throw new Error("cannot call val() if initSelection() is not defined");this.opts.element.val(a),this.opts.initSelection(this.opts.element,function(a){e.opts.element.val(a?e.id(a):""),e.updateSelection(a),e.setPlaceholder(),c&&e.triggerChange({added:a,removed:f})})}},clearSearch:function(){this.search.val(""),this.focusser.val("")},data:function(a){var c,d=!1;return 0===arguments.length?(c=this.selection.data("select2-data"),c==b&&(c=null),c):(arguments.length>1&&(d=arguments[1]),a?(c=this.data(),this.opts.element.val(a?this.id(a):""),this.updateSelection(a),d&&this.triggerChange({added:a,removed:c})):this.clear(d),void 0)}}),e=O(c,{createContainer:function(){var b=a(document.createElement("div")).attr({"class":"select2-container select2-container-multi"}).html(["
      ","
    • "," "," ","
    • ","
    ","
    ","
      ","
    ","
    "].join(""));return b},prepareOpts:function(){var b=this.parent.prepareOpts.apply(this,arguments),c=this;return"select"===b.element.get(0).tagName.toLowerCase()?b.initSelection=function(a,b){var d=[];a.find("option").filter(function(){return this.selected&&!this.disabled}).each2(function(a,b){d.push(c.optionToData(b))}),b(d)}:"data"in b&&(b.initSelection=b.initSelection||function(c,d){var e=s(c.val(),b.separator,b.transformVal),f=[];b.query({matcher:function(c,d,g){var h=a.grep(e,function(a){return r(a,b.id(g))}).length;return h&&f.push(g),h},callback:a.isFunction(d)?function(){for(var a=[],c=0;c0||(this.selectChoice(null),this.clearPlaceholder(),this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.open(),this.focusSearch(),b.preventDefault()))})),this.container.on("focus",b,this.bind(function(){this.isInterfaceEnabled()&&(this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"),this.clearPlaceholder())})),this.initContainerWidth(),this.opts.element.hide(),this.clearSearch()},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.search.prop("disabled",!this.isInterfaceEnabled())},initSelection:function(){if(""===this.opts.element.val()&&""===this.opts.element.text()&&(this.updateSelection([]),this.close(),this.clearSearch()),this.select||""!==this.opts.element.val()){var c=this;this.opts.initSelection.call(null,this.opts.element,function(a){a!==b&&null!==a&&(c.updateSelection(a),c.close(),c.clearSearch())})}},clearSearch:function(){var a=this.getPlaceholder(),c=this.getMaxSearchWidth();a!==b&&0===this.getVal().length&&this.search.hasClass("select2-focused")===!1?(this.search.val(a).addClass("select2-default"),this.search.width(c>0?c:this.container.css("width"))):this.search.val("").width(10)},clearPlaceholder:function(){this.search.hasClass("select2-default")&&this.search.val("").removeClass("select2-default")},opening:function(){this.clearPlaceholder(),this.resizeSearch(),this.parent.opening.apply(this,arguments),this.focusSearch(),""===this.search.val()&&this.nextSearchTerm!=b&&(this.search.val(this.nextSearchTerm),this.search.select()),this.updateResults(!0),this.opts.shouldFocusInput(this)&&this.search.focus(),this.opts.element.trigger(a.Event("select2-open"))},close:function(){this.opened()&&this.parent.close.apply(this,arguments)},focus:function(){this.close(),this.search.focus()},isFocused:function(){return this.search.hasClass("select2-focused")},updateSelection:function(b){var c=[],d=[],e=this;a(b).each(function(){p(e.id(this),c)<0&&(c.push(e.id(this)),d.push(this))}),b=d,this.selection.find(".select2-search-choice").remove(),a(b).each(function(){e.addSelectedChoice(this)}),e.postprocessResults()},tokenize:function(){var a=this.search.val();a=this.opts.tokenizer.call(this,a,this.data(),this.bind(this.onSelect),this.opts),null!=a&&a!=b&&(this.search.val(a),a.length>0&&this.open())},onSelect:function(a,c){this.triggerSelect(a)&&""!==a.text&&(this.addSelectedChoice(a),this.opts.element.trigger({type:"selected",val:this.id(a),choice:a}),this.nextSearchTerm=this.opts.nextSearchTerm(a,this.search.val()),this.clearSearch(),this.updateResults(),(this.select||!this.opts.closeOnSelect)&&this.postprocessResults(a,!1,this.opts.closeOnSelect===!0),this.opts.closeOnSelect?(this.close(),this.search.width(10)):this.countSelectableResults()>0?(this.search.width(10),this.resizeSearch(),this.getMaximumSelectionSize()>0&&this.val().length>=this.getMaximumSelectionSize()?this.updateResults(!0):this.nextSearchTerm!=b&&(this.search.val(this.nextSearchTerm),this.updateResults(),this.search.select()),this.positionDropdown()):(this.close(),this.search.width(10)),this.triggerChange({added:a}),c&&c.noFocus||this.focusSearch())},cancel:function(){this.close(),this.focusSearch()},addSelectedChoice:function(c){var j,k,d=!c.locked,e=a("
  • "),f=a("
  • "),g=d?e:f,h=this.id(c),i=this.getVal();j=this.opts.formatSelection(c,g.find("div"),this.opts.escapeMarkup),j!=b&&g.find("div").replaceWith(a("
    ").html(j)),k=this.opts.formatSelectionCssClass(c,g.find("div")),k!=b&&g.addClass(k),d&&g.find(".select2-search-choice-close").on("mousedown",A).on("click dblclick",this.bind(function(b){this.isInterfaceEnabled()&&(this.unselect(a(b.target)),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"),A(b),this.close(),this.focusSearch())})).on("focus",this.bind(function(){this.isInterfaceEnabled()&&(this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"))})),g.data("select2-data",c),g.insertBefore(this.searchContainer),i.push(h),this.setVal(i)},unselect:function(b){var d,e,c=this.getVal();if(b=b.closest(".select2-search-choice"),0===b.length)throw"Invalid argument: "+b+". Must be .select2-search-choice";if(d=b.data("select2-data")){var f=a.Event("select2-removing");if(f.val=this.id(d),f.choice=d,this.opts.element.trigger(f),f.isDefaultPrevented())return!1;for(;(e=p(this.id(d),c))>=0;)c.splice(e,1),this.setVal(c),this.select&&this.postprocessResults();return b.remove(),this.opts.element.trigger({type:"select2-removed",val:this.id(d),choice:d}),this.triggerChange({removed:d}),!0}},postprocessResults:function(a,b,c){var d=this.getVal(),e=this.results.find(".select2-result"),f=this.results.find(".select2-result-with-children"),g=this;e.each2(function(a,b){var c=g.id(b.data("select2-data"));p(c,d)>=0&&(b.addClass("select2-selected"),b.find(".select2-result-selectable").addClass("select2-selected"))}),f.each2(function(a,b){b.is(".select2-result-selectable")||0!==b.find(".select2-result-selectable:not(.select2-selected)").length||b.addClass("select2-selected")}),-1==this.highlight()&&c!==!1&&this.opts.closeOnSelect===!0&&g.highlight(0),!this.opts.createSearchChoice&&!e.filter(".select2-result:not(.select2-selected)").length>0&&(!a||a&&!a.more&&0===this.results.find(".select2-no-results").length)&&J(g.opts.formatNoMatches,"formatNoMatches")&&this.results.append("
  • "+K(g.opts.formatNoMatches,g.opts.element,g.search.val())+"
  • ")},getMaxSearchWidth:function(){return this.selection.width()-t(this.search)},resizeSearch:function(){var a,b,c,d,e,f=t(this.search);a=C(this.search)+10,b=this.search.offset().left,c=this.selection.width(),d=this.selection.offset().left,e=c-(b-d)-f,a>e&&(e=c-f),40>e&&(e=c-f),0>=e&&(e=a),this.search.width(Math.floor(e))},getVal:function(){var a;return this.select?(a=this.select.val(),null===a?[]:a):(a=this.opts.element.val(),s(a,this.opts.separator,this.opts.transformVal))},setVal:function(b){var c;this.select?this.select.val(b):(c=[],a(b).each(function(){p(this,c)<0&&c.push(this)}),this.opts.element.val(0===c.length?"":c.join(this.opts.separator)))},buildChangeDetails:function(a,b){for(var b=b.slice(0),a=a.slice(0),c=0;c0&&c--,a.splice(d,1),d--);return{added:b,removed:a}},val:function(c,d){var e,f=this;if(0===arguments.length)return this.getVal();if(e=this.data(),e.length||(e=[]),!c&&0!==c)return this.opts.element.val(""),this.updateSelection([]),this.clearSearch(),d&&this.triggerChange({added:this.data(),removed:e}),void 0;if(this.setVal(c),this.select)this.opts.initSelection(this.select,this.bind(this.updateSelection)),d&&this.triggerChange(this.buildChangeDetails(e,this.data()));else{if(this.opts.initSelection===b)throw new Error("val() cannot be called if initSelection() is not defined");this.opts.initSelection(this.opts.element,function(b){var c=a.map(b,f.id);f.setVal(c),f.updateSelection(b),f.clearSearch(),d&&f.triggerChange(f.buildChangeDetails(e,f.data()))})}this.clearSearch()},onSortStart:function(){if(this.select)throw new Error("Sorting of elements is not supported when attached to instead.");this.search.width(0),this.searchContainer.hide()},onSortEnd:function(){var b=[],c=this;this.searchContainer.show(),this.searchContainer.appendTo(this.searchContainer.parent()),this.resizeSearch(),this.selection.find(".select2-search-choice").each(function(){b.push(c.opts.id(a(this).data("select2-data")))}),this.setVal(b),this.triggerChange()},data:function(b,c){var e,f,d=this;return 0===arguments.length?this.selection.children(".select2-search-choice").map(function(){return a(this).data("select2-data")}).get():(f=this.data(),b||(b=[]),e=a.map(b,function(a){return d.opts.id(a)}),this.setVal(e),this.updateSelection(b),this.clearSearch(),c&&this.triggerChange(this.buildChangeDetails(f,this.data())),void 0)}}),a.fn.select2=function(){var d,e,f,g,h,c=Array.prototype.slice.call(arguments,0),i=["val","destroy","opened","open","close","focus","isFocused","container","dropdown","onSortStart","onSortEnd","enable","disable","readonly","positionDropdown","data","search"],j=["opened","isFocused","container","dropdown"],k=["val","data"],l={search:"externalSearch"};return this.each(function(){if(0===c.length||"object"==typeof c[0])d=0===c.length?{}:a.extend({},c[0]),d.element=a(this),"select"===d.element.get(0).tagName.toLowerCase()?h=d.element.prop("multiple"):(h=d.multiple||!1,"tags"in d&&(d.multiple=h=!0)),e=h?new window.Select2["class"].multi:new window.Select2["class"].single,e.init(d);else{if("string"!=typeof c[0])throw"Invalid arguments to select2 plugin: "+c;if(p(c[0],i)<0)throw"Unknown method: "+c[0];if(g=b,e=a(this).data("select2"),e===b)return;if(f=c[0],"container"===f?g=e.container:"dropdown"===f?g=e.dropdown:(l[f]&&(f=l[f]),g=e[f].apply(e,c.slice(1))),p(c[0],j)>=0||p(c[0],k)>=0&&1==c.length)return!1}}),g===b?this:g},a.fn.select2.defaults={width:"copy",loadMorePadding:0,closeOnSelect:!0,openOnEnter:!0,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(a,b,c,d){var e=[];return E(this.text(a),c.term,e,d),e.join("")},transformVal:function(b){return a.trim(b)},formatSelection:function(a,c,d){return a?d(this.text(a)):b},sortResults:function(a){return a},formatResultCssClass:function(a){return a.css},formatSelectionCssClass:function(){return b},minimumResultsForSearch:0,minimumInputLength:0,maximumInputLength:null,maximumSelectionSize:0,id:function(a){return a==b?null:a.id},text:function(b){return b&&this.data&&this.data.text?a.isFunction(this.data.text)?this.data.text(b):b[this.data.text]:b.text +},matcher:function(a,b){return o(""+b).toUpperCase().indexOf(o(""+a).toUpperCase())>=0},separator:",",tokenSeparators:[],tokenizer:M,escapeMarkup:F,blurOnChange:!1,selectOnBlur:!1,adaptContainerCssClass:function(a){return a},adaptDropdownCssClass:function(){return null},nextSearchTerm:function(){return b},searchInputPlaceholder:"",createSearchChoicePosition:"top",shouldFocusInput:function(a){var b="ontouchstart"in window||navigator.msMaxTouchPoints>0;return b?a.opts.minimumResultsForSearch<0?!1:!0:!0}},a.fn.select2.locales=[],a.fn.select2.locales.en={formatMatches:function(a){return 1===a?"One result is available, press enter to select it.":a+" results are available, use up and down arrow keys to navigate."},formatNoMatches:function(){return"No matches found"},formatAjaxError:function(){return"Loading failed"},formatInputTooShort:function(a,b){var c=b-a.length;return"Please enter "+c+" or more character"+(1==c?"":"s")},formatInputTooLong:function(a,b){var c=a.length-b;return"Please delete "+c+" character"+(1==c?"":"s")},formatSelectionTooBig:function(a){return"You can only select "+a+" item"+(1==a?"":"s")},formatLoadMore:function(){return"Loading more results\u2026"},formatSearching:function(){return"Searching\u2026"}},a.extend(a.fn.select2.defaults,a.fn.select2.locales.en),a.fn.select2.ajaxDefaults={transport:a.ajax,params:{type:"GET",cache:!1,dataType:"json"}},window.Select2={query:{ajax:G,local:H,tags:I},util:{debounce:w,markMatch:E,escapeMarkup:F,stripDiacritics:o},"class":{"abstract":c,single:d,multi:e}}}}(jQuery); \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2.png b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2.png new file mode 100644 index 000000000..1d804ffb9 Binary files /dev/null and b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2.png differ diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_ar.js b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_ar.js new file mode 100644 index 000000000..e991b726c --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_ar.js @@ -0,0 +1,19 @@ +/** + * Select2 Arabic translation. + * + * Author: Adel KEDJOUR + */ +(function ($) { + "use strict"; + + $.fn.select2.locales['ar'] = { + formatNoMatches: function () { return "لم يتم العثور على مطابقات"; }, + formatInputTooShort: function (input, min) { var n = min - input.length; if (n == 1){ return "الرجاء إدخال حرف واحد على الأكثر"; } return n == 2 ? "الرجاء إدخال حرفين على الأكثر" : "الرجاء إدخال " + n + " على الأكثر"; }, + formatInputTooLong: function (input, max) { var n = input.length - max; if (n == 1){ return "الرجاء إدخال حرف واحد على الأقل"; } return n == 2 ? "الرجاء إدخال حرفين على الأقل" : "الرجاء إدخال " + n + " على الأقل "; }, + formatSelectionTooBig: function (limit) { if (limit == 1){ return "يمكنك أن تختار إختيار واحد فقط"; } return limit == 2 ? "يمكنك أن تختار إختيارين فقط" : "يمكنك أن تختار " + limit + " إختيارات فقط"; }, + formatLoadMore: function (pageNumber) { return "تحميل المزيد من النتائج…"; }, + formatSearching: function () { return "البحث…"; } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['ar']); +})(jQuery); diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_az.js b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_az.js new file mode 100644 index 000000000..19fd95b7a --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_az.js @@ -0,0 +1,20 @@ +/** + * Select2 Azerbaijani translation. + * + * Author: Farhad Safarov + */ +(function ($) { + "use strict"; + + $.fn.select2.locales['az'] = { + formatMatches: function (matches) { return matches + " nəticə mövcuddur, hərəkət etdirmək üçün yuxarı və aşağı düymələrindən istifadə edin."; }, + formatNoMatches: function () { return "Nəticə tapılmadı"; }, + formatInputTooShort: function (input, min) { var n = min - input.length; return n + " simvol daxil edin"; }, + formatInputTooLong: function (input, max) { var n = input.length - max; return n + " simvol silin"; }, + formatSelectionTooBig: function (limit) { return "Sadəcə " + limit + " element seçə bilərsiniz"; }, + formatLoadMore: function (pageNumber) { return "Daha çox nəticə yüklənir…"; }, + formatSearching: function () { return "Axtarılır…"; } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['az']); +})(jQuery); diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_bg.js b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_bg.js new file mode 100644 index 000000000..3283d0ae5 --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_bg.js @@ -0,0 +1,20 @@ +/** + * Select2 Bulgarian translation. + * + * @author Lubomir Vikev + * @author Uriy Efremochkin + */ +(function ($) { + "use strict"; + + $.fn.select2.locales['bg'] = { + formatNoMatches: function () { return "Няма намерени съвпадения"; }, + formatInputTooShort: function (input, min) { var n = min - input.length; return "Моля въведете още " + n + " символ" + (n > 1 ? "а" : ""); }, + formatInputTooLong: function (input, max) { var n = input.length - max; return "Моля въведете с " + n + " по-малко символ" + (n > 1 ? "а" : ""); }, + formatSelectionTooBig: function (limit) { return "Можете да направите до " + limit + (limit > 1 ? " избора" : " избор"); }, + formatLoadMore: function (pageNumber) { return "Зареждат се още…"; }, + formatSearching: function () { return "Търсене…"; } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['bg']); +})(jQuery); diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_ca.js b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_ca.js new file mode 100644 index 000000000..dbea39e93 --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_ca.js @@ -0,0 +1,19 @@ +/** + * Select2 Catalan translation. + * + * Author: David Planella + */ +(function ($) { + "use strict"; + + $.fn.select2.locales['ca'] = { + formatNoMatches: function () { return "No s'ha trobat cap coincidència"; }, + formatInputTooShort: function (input, min) { var n = min - input.length; return "Introduïu " + n + " caràcter" + (n == 1 ? "" : "s") + " més"; }, + formatInputTooLong: function (input, max) { var n = input.length - max; return "Introduïu " + n + " caràcter" + (n == 1? "" : "s") + "menys"; }, + formatSelectionTooBig: function (limit) { return "Només podeu seleccionar " + limit + " element" + (limit == 1 ? "" : "s"); }, + formatLoadMore: function (pageNumber) { return "S'estan carregant més resultats…"; }, + formatSearching: function () { return "S'està cercant…"; } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['ca']); +})(jQuery); diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_cs.js b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_cs.js new file mode 100644 index 000000000..ef1218564 --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_cs.js @@ -0,0 +1,51 @@ +/** + * Select2 Czech translation. + * + * Author: Michal Marek + * Author - sklonovani: David Vallner + */ +(function ($) { + "use strict"; + // use text for the numbers 2 through 4 + var smallNumbers = { + 2: function(masc) { return (masc ? "dva" : "dvě"); }, + 3: function() { return "tři"; }, + 4: function() { return "čtyři"; } + } + $.fn.select2.locales['cs'] = { + formatNoMatches: function () { return "Nenalezeny žádné položky"; }, + formatInputTooShort: function (input, min) { + var n = min - input.length; + if (n == 1) { + return "Prosím zadejte ještě jeden znak"; + } else if (n <= 4) { + return "Prosím zadejte ještě další "+smallNumbers[n](true)+" znaky"; + } else { + return "Prosím zadejte ještě dalších "+n+" znaků"; + } + }, + formatInputTooLong: function (input, max) { + var n = input.length - max; + if (n == 1) { + return "Prosím zadejte o jeden znak méně"; + } else if (n <= 4) { + return "Prosím zadejte o "+smallNumbers[n](true)+" znaky méně"; + } else { + return "Prosím zadejte o "+n+" znaků méně"; + } + }, + formatSelectionTooBig: function (limit) { + if (limit == 1) { + return "Můžete zvolit jen jednu položku"; + } else if (limit <= 4) { + return "Můžete zvolit maximálně "+smallNumbers[limit](false)+" položky"; + } else { + return "Můžete zvolit maximálně "+limit+" položek"; + } + }, + formatLoadMore: function (pageNumber) { return "Načítají se další výsledky…"; }, + formatSearching: function () { return "Vyhledávání…"; } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['cs']); +})(jQuery); diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_da.js b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_da.js new file mode 100644 index 000000000..702238b9a --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_da.js @@ -0,0 +1,19 @@ +/** + * Select2 Danish translation. + * + * Author: Anders Jenbo + */ +(function ($) { + "use strict"; + + $.fn.select2.locales['da'] = { + formatNoMatches: function () { return "Ingen resultater fundet"; }, + formatInputTooShort: function (input, min) { var n = min - input.length; return "Angiv venligst " + n + " tegn mere"; }, + formatInputTooLong: function (input, max) { var n = input.length - max; return "Angiv venligst " + n + " tegn mindre"; }, + formatSelectionTooBig: function (limit) { return "Du kan kun vælge " + limit + " emne" + (limit === 1 ? "" : "r"); }, + formatLoadMore: function (pageNumber) { return "Indlæser flere resultater…"; }, + formatSearching: function () { return "Søger…"; } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['da']); +})(jQuery); diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_de.js b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_de.js new file mode 100644 index 000000000..e27541720 --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_de.js @@ -0,0 +1,18 @@ +/** + * Select2 German translation + */ +(function ($) { + "use strict"; + + $.fn.select2.locales['de'] = { + formatNoMatches: function () { return "Keine Übereinstimmungen gefunden"; }, + formatInputTooShort: function (input, min) { var n = min - input.length; return "Bitte " + n + " Zeichen mehr eingeben"; }, + formatInputTooLong: function (input, max) { var n = input.length - max; return "Bitte " + n + " Zeichen weniger eingeben"; }, + formatSelectionTooBig: function (limit) { return "Sie können nur " + limit + " Eintr" + (limit === 1 ? "ag" : "äge") + " auswählen"; }, + formatLoadMore: function (pageNumber) { return "Lade mehr Ergebnisse…"; }, + formatSearching: function () { return "Suche…"; }, + formatMatches: function (matches) { return matches + " Ergebnis " + (matches > 1 ? "se" : "") + " verfügbar, zum Navigieren die Hoch-/Runter-Pfeiltasten verwenden."; } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['de']); +})(jQuery); \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_el.js b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_el.js new file mode 100644 index 000000000..d17459e1d --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_el.js @@ -0,0 +1,19 @@ +/** + * Select2 Greek translation. + * + * @author Uriy Efremochkin + */ +(function ($) { + "use strict"; + + $.fn.select2.locales['el'] = { + formatNoMatches: function () { return "Δεν βρέθηκαν αποτελέσματα"; }, + formatInputTooShort: function (input, min) { var n = min - input.length; return "Παρακαλούμε εισάγετε " + n + " περισσότερο" + (n > 1 ? "υς" : "") + " χαρακτήρ" + (n > 1 ? "ες" : "α"); }, + formatInputTooLong: function (input, max) { var n = input.length - max; return "Παρακαλούμε διαγράψτε " + n + " χαρακτήρ" + (n > 1 ? "ες" : "α"); }, + formatSelectionTooBig: function (limit) { return "Μπορείτε να επιλέξετε μόνο " + limit + " αντικείμεν" + (limit > 1 ? "α" : "ο"); }, + formatLoadMore: function (pageNumber) { return "Φόρτωση περισσότερων…"; }, + formatSearching: function () { return "Αναζήτηση…"; } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['el']); +})(jQuery); \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_en.js.template b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_en.js.template new file mode 100644 index 000000000..f758b1100 --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_en.js.template @@ -0,0 +1,20 @@ +/** + * Select2 translation. + * + * Author: Your Name + */ +(function ($) { + "use strict"; + + $.fn.select2.locales['en'] = { + formatMatches: function (matches) { if (matches === 1) { return "One result is available, press enter to select it."; } return matches + " results are available, use up and down arrow keys to navigate."; }, + formatNoMatches: function () { return "No matches found"; }, + formatInputTooShort: function (input, min) { var n = min - input.length; return "Please enter " + n + " or more character" + (n == 1 ? "" : "s"); }, + formatInputTooLong: function (input, max) { var n = input.length - max; return "Please delete " + n + " character" + (n == 1 ? "" : "s"); }, + formatSelectionTooBig: function (limit) { return "You can only select " + limit + " item" + (limit == 1 ? "" : "s"); }, + formatLoadMore: function (pageNumber) { return "Loading more results…"; }, + formatSearching: function () { return "Searching…"; } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['en']); +})(jQuery); diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_es.js b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_es.js new file mode 100644 index 000000000..92a19861e --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_es.js @@ -0,0 +1,19 @@ +/** + * Select2 Spanish translation + */ +(function ($) { + "use strict"; + + $.fn.select2.locales['es'] = { + formatMatches: function (matches) { if (matches === 1) { return "Un resultado disponible, presione enter para seleccionarlo."; } return matches + " resultados disponibles, use las teclas de dirección para navegar."; }, + formatNoMatches: function () { return "No se encontraron resultados"; }, + formatInputTooShort: function (input, min) { var n = min - input.length; return "Por favor, introduzca " + n + " car" + (n == 1? "ácter" : "acteres"); }, + formatInputTooLong: function (input, max) { var n = input.length - max; return "Por favor, elimine " + n + " car" + (n == 1? "ácter" : "acteres"); }, + formatSelectionTooBig: function (limit) { return "Sólo puede seleccionar " + limit + " elemento" + (limit == 1 ? "" : "s"); }, + formatLoadMore: function (pageNumber) { return "Cargando más resultados…"; }, + formatSearching: function () { return "Buscando…"; }, + formatAjaxError: function() { return "La carga falló"; } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['es']); +})(jQuery); diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_et.js b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_et.js new file mode 100644 index 000000000..4d69f55e3 --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_et.js @@ -0,0 +1,19 @@ +/** + * Select2 Estonian translation. + * + * Author: Kuldar Kalvik + */ +(function ($) { + "use strict"; + + $.fn.select2.locales['et'] = { + formatNoMatches: function () { return "Tulemused puuduvad"; }, + formatInputTooShort: function (input, min) { var n = min - input.length; return "Sisesta " + n + " täht" + (n == 1 ? "" : "e") + " rohkem"; }, + formatInputTooLong: function (input, max) { var n = input.length - max; return "Sisesta " + n + " täht" + (n == 1? "" : "e") + " vähem"; }, + formatSelectionTooBig: function (limit) { return "Saad vaid " + limit + " tulemus" + (limit == 1 ? "e" : "t") + " valida"; }, + formatLoadMore: function (pageNumber) { return "Laen tulemusi.."; }, + formatSearching: function () { return "Otsin.."; } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['et']); +})(jQuery); diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_eu.js b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_eu.js new file mode 100644 index 000000000..67ae8d05a --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_eu.js @@ -0,0 +1,45 @@ +/** + * Select2 Basque translation. + * + * Author: Julen Ruiz Aizpuru + */ +(function ($) { + "use strict"; + + $.fn.select2.locales['eu'] = { + formatNoMatches: function () { + return "Ez da bat datorrenik aurkitu"; + }, + formatInputTooShort: function (input, min) { + var n = min - input.length; + if (n === 1) { + return "Idatzi karaktere bat gehiago"; + } else { + return "Idatzi " + n + " karaktere gehiago"; + } + }, + formatInputTooLong: function (input, max) { + var n = input.length - max; + if (n === 1) { + return "Idatzi karaktere bat gutxiago"; + } else { + return "Idatzi " + n + " karaktere gutxiago"; + } + }, + formatSelectionTooBig: function (limit) { + if (limit === 1 ) { + return "Elementu bakarra hauta dezakezu"; + } else { + return limit + " elementu hauta ditzakezu soilik"; + } + }, + formatLoadMore: function (pageNumber) { + return "Emaitza gehiago kargatzen…"; + }, + formatSearching: function () { + return "Bilatzen…"; + } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['eu']); +})(jQuery); diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_fa.js b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_fa.js new file mode 100644 index 000000000..b3ffd8b7d --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_fa.js @@ -0,0 +1,21 @@ +/** + * Select2 Persian translation. + * + * Author: Ali Choopan + * Author: Ebrahim Byagowi + */ +(function ($) { + "use strict"; + + $.fn.select2.locales['fa'] = { + formatMatches: function (matches) { return matches + " نتیجه موجود است، کلیدهای جهت بالا و پایین را برای گشتن استفاده کنید."; }, + formatNoMatches: function () { return "نتیجه‌ای یافت نشد."; }, + formatInputTooShort: function (input, min) { var n = min - input.length; return "لطفاً " + n + " نویسه بیشتر وارد نمایید"; }, + formatInputTooLong: function (input, max) { var n = input.length - max; return "لطفاً " + n + " نویسه را حذف کنید."; }, + formatSelectionTooBig: function (limit) { return "شما فقط می‌توانید " + limit + " مورد را انتخاب کنید"; }, + formatLoadMore: function (pageNumber) { return "در حال بارگیری موارد بیشتر…"; }, + formatSearching: function () { return "در حال جستجو…"; } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['fa']); +})(jQuery); diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_fi.js b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_fi.js new file mode 100644 index 000000000..6487fbdad --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_fi.js @@ -0,0 +1,30 @@ +/** + * Select2 Finnish translation + */ +(function ($) { + "use strict"; + $.fn.select2.locales['fi'] = { + formatNoMatches: function () { + return "Ei tuloksia"; + }, + formatInputTooShort: function (input, min) { + var n = min - input.length; + return "Ole hyvä ja anna " + n + " merkkiä lisää"; + }, + formatInputTooLong: function (input, max) { + var n = input.length - max; + return "Ole hyvä ja anna " + n + " merkkiä vähemmän"; + }, + formatSelectionTooBig: function (limit) { + return "Voit valita ainoastaan " + limit + " kpl"; + }, + formatLoadMore: function (pageNumber) { + return "Ladataan lisää tuloksia…"; + }, + formatSearching: function () { + return "Etsitään…"; + } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['fi']); +})(jQuery); diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_fr.js b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_fr.js new file mode 100644 index 000000000..d5485d6be --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_fr.js @@ -0,0 +1,18 @@ +/** + * Select2 French translation + */ +(function ($) { + "use strict"; + + $.fn.select2.locales['fr'] = { + formatMatches: function (matches) { return matches + " résultats sont disponibles, utilisez les flèches haut et bas pour naviguer."; }, + formatNoMatches: function () { return "Aucun résultat trouvé"; }, + formatInputTooShort: function (input, min) { var n = min - input.length; return "Saisissez " + n + " caractère" + (n == 1? "" : "s") + " supplémentaire" + (n == 1? "" : "s") ; }, + formatInputTooLong: function (input, max) { var n = input.length - max; return "Supprimez " + n + " caractère" + (n == 1? "" : "s"); }, + formatSelectionTooBig: function (limit) { return "Vous pouvez seulement sélectionner " + limit + " élément" + (limit == 1 ? "" : "s"); }, + formatLoadMore: function (pageNumber) { return "Chargement de résultats supplémentaires…"; }, + formatSearching: function () { return "Recherche en cours…"; } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['fr']); +})(jQuery); diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_gl.js b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_gl.js new file mode 100644 index 000000000..9335167da --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_gl.js @@ -0,0 +1,45 @@ +/** + * Select2 Galician translation + * + * Author: Leandro Regueiro + */ +(function ($) { + "use strict"; + + $.fn.select2.locales['gl'] = { + formatNoMatches: function () { + return "Non se atoparon resultados"; + }, + formatInputTooShort: function (input, min) { + var n = min - input.length; + if (n === 1) { + return "Engada un carácter"; + } else { + return "Engada " + n + " caracteres"; + } + }, + formatInputTooLong: function (input, max) { + var n = input.length - max; + if (n === 1) { + return "Elimine un carácter"; + } else { + return "Elimine " + n + " caracteres"; + } + }, + formatSelectionTooBig: function (limit) { + if (limit === 1 ) { + return "Só pode seleccionar un elemento"; + } else { + return "Só pode seleccionar " + limit + " elementos"; + } + }, + formatLoadMore: function (pageNumber) { + return "Cargando máis resultados…"; + }, + formatSearching: function () { + return "Buscando…"; + } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['gl']); +})(jQuery); diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_he.js b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_he.js new file mode 100644 index 000000000..789dcdcaa --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_he.js @@ -0,0 +1,19 @@ +/** +* Select2 Hebrew translation. +* +* Author: Yakir Sitbon +*/ +(function ($) { + "use strict"; + + $.fn.select2.locales['he'] = { + formatNoMatches: function () { return "לא נמצאו התאמות"; }, + formatInputTooShort: function (input, min) { var n = min - input.length; return "נא להזין עוד " + n + " תווים נוספים"; }, + formatInputTooLong: function (input, max) { var n = input.length - max; return "נא להזין פחות " + n + " תווים"; }, + formatSelectionTooBig: function (limit) { return "ניתן לבחור " + limit + " פריטים"; }, + formatLoadMore: function (pageNumber) { return "טוען תוצאות נוספות…"; }, + formatSearching: function () { return "מחפש…"; } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['he']); +})(jQuery); diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_hr.js b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_hr.js new file mode 100644 index 000000000..ce8051c78 --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_hr.js @@ -0,0 +1,24 @@ +/** + * Select2 Croatian translation. + * + * @author Edi Modrić + * @author Uriy Efremochkin + */ +(function ($) { + "use strict"; + + $.fn.select2.locales['hr'] = { + formatNoMatches: function () { return "Nema rezultata"; }, + formatInputTooShort: function (input, min) { return "Unesite još" + character(min - input.length); }, + formatInputTooLong: function (input, max) { return "Unesite" + character(input.length - max) + " manje"; }, + formatSelectionTooBig: function (limit) { return "Maksimalan broj odabranih stavki je " + limit; }, + formatLoadMore: function (pageNumber) { return "Učitavanje rezultata…"; }, + formatSearching: function () { return "Pretraga…"; } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['hr']); + + function character (n) { + return " " + n + " znak" + (n%10 < 5 && n%10 > 0 && (n%100 < 5 || n%100 > 19) ? n%10 > 1 ? "a" : "" : "ova"); + } +})(jQuery); diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_hu.js b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_hu.js new file mode 100644 index 000000000..f431f2463 --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_hu.js @@ -0,0 +1,17 @@ +/** + * Select2 Hungarian translation + */ +(function ($) { + "use strict"; + + $.fn.select2.locales['hu'] = { + formatNoMatches: function () { return "Nincs találat."; }, + formatInputTooShort: function (input, min) { var n = min - input.length; return "Túl rövid. Még " + n + " karakter hiányzik."; }, + formatInputTooLong: function (input, max) { var n = input.length - max; return "Túl hosszú. " + n + " karakterrel több, mint kellene."; }, + formatSelectionTooBig: function (limit) { return "Csak " + limit + " elemet lehet kiválasztani."; }, + formatLoadMore: function (pageNumber) { return "Töltés…"; }, + formatSearching: function () { return "Keresés…"; } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['hu']); +})(jQuery); diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_id.js b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_id.js new file mode 100644 index 000000000..e9c1fd9b9 --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_id.js @@ -0,0 +1,19 @@ +/** + * Select2 Indonesian translation. + * + * Author: Ibrahim Yusuf + */ +(function ($) { + "use strict"; + + $.fn.select2.locales['id'] = { + formatNoMatches: function () { return "Tidak ada data yang sesuai"; }, + formatInputTooShort: function (input, min) { var n = min - input.length; return "Masukkan " + n + " huruf lagi" + (n == 1 ? "" : "s"); }, + formatInputTooLong: function (input, max) { var n = input.length - max; return "Hapus " + n + " huruf" + (n == 1 ? "" : "s"); }, + formatSelectionTooBig: function (limit) { return "Anda hanya dapat memilih " + limit + " pilihan" + (limit == 1 ? "" : "s"); }, + formatLoadMore: function (pageNumber) { return "Mengambil data…"; }, + formatSearching: function () { return "Mencari…"; } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['id']); +})(jQuery); diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_is.js b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_is.js new file mode 100644 index 000000000..273f33de8 --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_is.js @@ -0,0 +1,17 @@ +/** + * Select2 Icelandic translation. + */ +(function ($) { + "use strict"; + + $.fn.select2.locales['is'] = { + formatNoMatches: function () { return "Ekkert fannst"; }, + formatInputTooShort: function (input, min) { var n = min - input.length; return "Vinsamlegast skrifið " + n + " staf" + (n > 1 ? "i" : "") + " í viðbót"; }, + formatInputTooLong: function (input, max) { var n = input.length - max; return "Vinsamlegast styttið texta um " + n + " staf" + (n > 1 ? "i" : ""); }, + formatSelectionTooBig: function (limit) { return "Þú getur aðeins valið " + limit + " atriði"; }, + formatLoadMore: function (pageNumber) { return "Sæki fleiri niðurstöður…"; }, + formatSearching: function () { return "Leita…"; } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['is']); +})(jQuery); diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_it.js b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_it.js new file mode 100644 index 000000000..6e2b8e237 --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_it.js @@ -0,0 +1,17 @@ +/** + * Select2 Italian translation + */ +(function ($) { + "use strict"; + + $.fn.select2.locales['it'] = { + formatNoMatches: function () { return "Nessuna corrispondenza trovata"; }, + formatInputTooShort: function (input, min) { var n = min - input.length; return "Inserisci ancora " + n + " caratter" + (n == 1? "e" : "i"); }, + formatInputTooLong: function (input, max) { var n = input.length - max; return "Inserisci " + n + " caratter" + (n == 1? "e" : "i") + " in meno"; }, + formatSelectionTooBig: function (limit) { return "Puoi selezionare solo " + limit + " element" + (limit == 1 ? "o" : "i"); }, + formatLoadMore: function (pageNumber) { return "Caricamento in corso…"; }, + formatSearching: function () { return "Ricerca…"; } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['it']); +})(jQuery); \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_ja.js b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_ja.js new file mode 100644 index 000000000..7dbd8d7ee --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_ja.js @@ -0,0 +1,17 @@ +/** + * Select2 Japanese translation. + */ +(function ($) { + "use strict"; + + $.fn.select2.locales['ja'] = { + formatNoMatches: function () { return "該当なし"; }, + formatInputTooShort: function (input, min) { var n = min - input.length; return "後" + n + "文字入れてください"; }, + formatInputTooLong: function (input, max) { var n = input.length - max; return "検索文字列が" + n + "文字長すぎます"; }, + formatSelectionTooBig: function (limit) { return "最多で" + limit + "項目までしか選択できません"; }, + formatLoadMore: function (pageNumber) { return "読込中・・・"; }, + formatSearching: function () { return "検索中・・・"; } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['ja']); +})(jQuery); diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_ka.js b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_ka.js new file mode 100644 index 000000000..6cbe1d8f3 --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_ka.js @@ -0,0 +1,19 @@ +/** + * Select2 Georgian (Kartuli) translation. + * + * Author: Dimitri Kurashvili dimakura@gmail.com + */ +(function ($) { + "use strict"; + + $.fn.select2.locales['ka'] = { + formatNoMatches: function () { return "ვერ მოიძებნა"; }, + formatInputTooShort: function (input, min) { var n = min - input.length; return "გთხოვთ შეიყვანოთ კიდევ " + n + " სიმბოლო"; }, + formatInputTooLong: function (input, max) { var n = input.length - max; return "გთხოვთ წაშალოთ " + n + " სიმბოლო"; }, + formatSelectionTooBig: function (limit) { return "თქვენ შეგიძლიათ მხოლოდ " + limit + " ჩანაწერის მონიშვნა"; }, + formatLoadMore: function (pageNumber) { return "შედეგის ჩატვირთვა…"; }, + formatSearching: function () { return "ძებნა…"; } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['ka']); +})(jQuery); diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_ko.js b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_ko.js new file mode 100644 index 000000000..bf036e09e --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_ko.js @@ -0,0 +1,19 @@ +/** + * Select2 Korean translation. + * + * @author Swen Mun + */ +(function ($) { + "use strict"; + + $.fn.select2.locales['ko'] = { + formatNoMatches: function () { return "결과 없음"; }, + formatInputTooShort: function (input, min) { var n = min - input.length; return "너무 짧습니다. "+n+"글자 더 입력해주세요."; }, + formatInputTooLong: function (input, max) { var n = input.length - max; return "너무 깁니다. "+n+"글자 지워주세요."; }, + formatSelectionTooBig: function (limit) { return "최대 "+limit+"개까지만 선택하실 수 있습니다."; }, + formatLoadMore: function (pageNumber) { return "불러오는 중…"; }, + formatSearching: function () { return "검색 중…"; } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['ko']); +})(jQuery); diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_lt.js b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_lt.js new file mode 100644 index 000000000..7d7040f72 --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_lt.js @@ -0,0 +1,26 @@ +/** + * Select2 Lithuanian translation. + * + * @author CRONUS Karmalakas + * @author Uriy Efremochkin + */ +(function ($) { + "use strict"; + + $.fn.select2.locales['lt'] = { + formatNoMatches: function () { return "Atitikmenų nerasta"; }, + formatInputTooShort: function (input, min) { return "Įrašykite dar" + character(min - input.length); }, + formatInputTooLong: function (input, max) { return "Pašalinkite" + character(input.length - max); }, + formatSelectionTooBig: function (limit) { + return "Jūs galite pasirinkti tik " + limit + " element" + ((limit%100 > 9 && limit%100 < 21) || limit%10 == 0 ? "ų" : limit%10 > 1 ? "us" : "ą"); + }, + formatLoadMore: function (pageNumber) { return "Kraunama daugiau rezultatų…"; }, + formatSearching: function () { return "Ieškoma…"; } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['lt']); + + function character (n) { + return " " + n + " simbol" + ((n%100 > 9 && n%100 < 21) || n%10 == 0 ? "ių" : n%10 > 1 ? "ius" : "į"); + } +})(jQuery); diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_lv.js b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_lv.js new file mode 100644 index 000000000..4afc5b41c --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_lv.js @@ -0,0 +1,19 @@ +/** + * Select2 Latvian translation. + * + * @author Uriy Efremochkin + */ +(function ($) { + "use strict"; + + $.fn.select2.locales['lv'] = { + formatNoMatches: function () { return "Sakritību nav"; }, + formatInputTooShort: function (input, min) { var n = min - input.length; return "Lūdzu ievadiet vēl " + n + " simbol" + (n == 11 ? "us" : n%10 == 1 ? "u" : "us"); }, + formatInputTooLong: function (input, max) { var n = input.length - max; return "Lūdzu ievadiet par " + n + " simbol" + (n == 11 ? "iem" : n%10 == 1 ? "u" : "iem") + " mazāk"; }, + formatSelectionTooBig: function (limit) { return "Jūs varat izvēlēties ne vairāk kā " + limit + " element" + (limit == 11 ? "us" : limit%10 == 1 ? "u" : "us"); }, + formatLoadMore: function (pageNumber) { return "Datu ielāde…"; }, + formatSearching: function () { return "Meklēšana…"; } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['lv']); +})(jQuery); diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_mk.js b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_mk.js new file mode 100644 index 000000000..8a51a9e0b --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_mk.js @@ -0,0 +1,19 @@ +/** + * Select2 Macedonian translation. + * + * Author: Marko Aleksic + */ +(function ($) { + "use strict"; + + $.fn.select2.locales['mk'] = { + formatNoMatches: function () { return "Нема пронајдено совпаѓања"; }, + formatInputTooShort: function (input, min) { var n = min - input.length; return "Ве молиме внесете уште " + n + " карактер" + (n == 1 ? "" : "и"); }, + formatInputTooLong: function (input, max) { var n = input.length - max; return "Ве молиме внесете " + n + " помалку карактер" + (n == 1? "" : "и"); }, + formatSelectionTooBig: function (limit) { return "Можете да изберете само " + limit + " ставк" + (limit == 1 ? "а" : "и"); }, + formatLoadMore: function (pageNumber) { return "Вчитување резултати…"; }, + formatSearching: function () { return "Пребарување…"; } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['mk']); +})(jQuery); \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_ms.js b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_ms.js new file mode 100644 index 000000000..46588d6d7 --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_ms.js @@ -0,0 +1,19 @@ +/** + * Select2 Malay translation. + * + * Author: Kepoweran + */ +(function ($) { + "use strict"; + + $.fn.select2.locales['ms'] = { + formatNoMatches: function () { return "Tiada padanan yang ditemui"; }, + formatInputTooShort: function (input, min) { var n = min - input.length; return "Sila masukkan " + n + " aksara lagi"; }, + formatInputTooLong: function (input, max) { var n = input.length - max; return "Sila hapuskan " + n + " aksara"; }, + formatSelectionTooBig: function (limit) { return "Anda hanya boleh memilih " + limit + " pilihan"; }, + formatLoadMore: function (pageNumber) { return "Sedang memuatkan keputusan…"; }, + formatSearching: function () { return "Mencari…"; } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['ms']); +})(jQuery); diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_nb.js b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_nb.js new file mode 100644 index 000000000..cb5dfaeef --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_nb.js @@ -0,0 +1,22 @@ +/** + * Select2 Norwegian Bokmål translation. + * + * Author: Torgeir Veimo + * Author: Bjørn Johansen + */ +(function ($) { + "use strict"; + + $.fn.select2.locales['nb'] = { + formatMatches: function (matches) { if (matches === 1) { return "Ett resultat er tilgjengelig, trykk enter for å velge det."; } return matches + " resultater er tilgjengelig. Bruk piltastene opp og ned for å navigere."; }, + formatNoMatches: function () { return "Ingen treff"; }, + formatInputTooShort: function (input, min) { var n = min - input.length; return "Vennligst skriv inn " + n + (n>1 ? " flere tegn" : " tegn til"); }, + formatInputTooLong: function (input, max) { var n = input.length - max; return "Vennligst fjern " + n + " tegn"; }, + formatSelectionTooBig: function (limit) { return "Du kan velge maks " + limit + " elementer"; }, + formatLoadMore: function (pageNumber) { return "Laster flere resultater …"; }, + formatSearching: function () { return "Søker …"; } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['no']); +})(jQuery); + diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_nl.js b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_nl.js new file mode 100644 index 000000000..985741ec2 --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_nl.js @@ -0,0 +1,17 @@ +/** + * Select2 Dutch translation + */ +(function ($) { + "use strict"; + + $.fn.select2.locales['nl'] = { + formatNoMatches: function () { return "Geen resultaten gevonden"; }, + formatInputTooShort: function (input, min) { var n = min - input.length; return "Vul nog " + n + " karakter" + (n == 1? "" : "s") + " in"; }, + formatInputTooLong: function (input, max) { var n = input.length - max; return "Haal " + n + " karakter" + (n == 1? "" : "s") + " weg"; }, + formatSelectionTooBig: function (limit) { return "Maximaal " + limit + " item" + (limit == 1 ? "" : "s") + " toegestaan"; }, + formatLoadMore: function (pageNumber) { return "Meer resultaten laden…"; }, + formatSearching: function () { return "Zoeken…"; } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['nl']); +})(jQuery); diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_pl.js b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_pl.js new file mode 100644 index 000000000..87c261941 --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_pl.js @@ -0,0 +1,54 @@ +/** + * Select2 Polish translation. + * + * @author Jan Kondratowicz + * @author Uriy Efremochkin + * @author Michał Połtyn + * @author Damian Zajkowski + */ +(function($) { + "use strict"; + + $.fn.select2.locales['pl'] = { + formatNoMatches: function() { + return "Brak wyników"; + }, + formatInputTooShort: function(input, min) { + return "Wpisz co najmniej" + character(min - input.length, "znak", "i"); + }, + formatInputTooLong: function(input, max) { + return "Wpisana fraza jest za długa o" + character(input.length - max, "znak", "i"); + }, + formatSelectionTooBig: function(limit) { + return "Możesz zaznaczyć najwyżej" + character(limit, "element", "y"); + }, + formatLoadMore: function(pageNumber) { + return "Ładowanie wyników…"; + }, + formatSearching: function() { + return "Szukanie…"; + } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['pl']); + + function character(n, word, pluralSuffix) { + //Liczba pojedyncza - brak suffiksu + //jeden znak + //jeden element + var suffix = ''; + if (n > 1 && n < 5) { + //Liczaba mnoga ilość od 2 do 4 - własny suffiks + //Dwa znaki, trzy znaki, cztery znaki. + //Dwa elementy, trzy elementy, cztery elementy + suffix = pluralSuffix; + } else if (n == 0 || n >= 5) { + //Ilość 0 suffiks ów + //Liczaba mnoga w ilości 5 i więcej - suffiks ów (nie poprawny dla wszystkich wyrazów, np. 100 wiadomości) + //Zero znaków, Pięć znaków, sześć znaków, siedem znaków, osiem znaków. + //Zero elementów Pięć elementów, sześć elementów, siedem elementów, osiem elementów. + suffix = 'ów'; + } + return " " + n + " " + word + suffix; + } +})(jQuery); diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_pt-BR.js b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_pt-BR.js new file mode 100644 index 000000000..51b037de5 --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_pt-BR.js @@ -0,0 +1,18 @@ +/** + * Select2 Brazilian Portuguese translation + */ +(function ($) { + "use strict"; + + $.fn.select2.locales['pt-BR'] = { + formatNoMatches: function () { return "Nenhum resultado encontrado"; }, + formatAjaxError: function () { return "Erro na busca"; }, + formatInputTooShort: function (input, min) { var n = min - input.length; return "Digite " + (min == 1 ? "" : "mais") + " " + n + " caracter" + (n == 1? "" : "es"); }, + formatInputTooLong: function (input, max) { var n = input.length - max; return "Apague " + n + " caracter" + (n == 1? "" : "es"); }, + formatSelectionTooBig: function (limit) { return "Só é possível selecionar " + limit + " elemento" + (limit == 1 ? "" : "s"); }, + formatLoadMore: function (pageNumber) { return "Carregando mais resultados…"; }, + formatSearching: function () { return "Buscando…"; } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['pt-BR']); +})(jQuery); diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_pt-PT.js b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_pt-PT.js new file mode 100644 index 000000000..ae55a4fc4 --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_pt-PT.js @@ -0,0 +1,17 @@ +/** + * Select2 Portuguese (Portugal) translation + */ +(function ($) { + "use strict"; + + $.fn.select2.locales['pt-PT'] = { + formatNoMatches: function () { return "Nenhum resultado encontrado"; }, + formatInputTooShort: function (input, min) { var n = min - input.length; return "Introduza " + n + " car" + (n == 1 ? "ácter" : "acteres"); }, + formatInputTooLong: function (input, max) { var n = input.length - max; return "Apague " + n + " car" + (n == 1 ? "ácter" : "acteres"); }, + formatSelectionTooBig: function (limit) { return "Só é possível selecionar " + limit + " elemento" + (limit == 1 ? "" : "s"); }, + formatLoadMore: function (pageNumber) { return "A carregar mais resultados…"; }, + formatSearching: function () { return "A pesquisar…"; } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['pt-PT']); +})(jQuery); diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_ro.js b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_ro.js new file mode 100644 index 000000000..21b0cf181 --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_ro.js @@ -0,0 +1,17 @@ +/** + * Select2 Romanian translation. + */ +(function ($) { + "use strict"; + + $.fn.select2.locales['ro'] = { + formatNoMatches: function () { return "Nu a fost găsit nimic"; }, + formatInputTooShort: function (input, min) { var n = min - input.length; return "Vă rugăm să introduceți incă " + n + " caracter" + (n == 1 ? "" : "e"); }, + formatInputTooLong: function (input, max) { var n = input.length - max; return "Vă rugăm să introduceți mai puțin de " + n + " caracter" + (n == 1? "" : "e"); }, + formatSelectionTooBig: function (limit) { return "Aveți voie să selectați cel mult " + limit + " element" + (limit == 1 ? "" : "e"); }, + formatLoadMore: function (pageNumber) { return "Se încarcă…"; }, + formatSearching: function () { return "Căutare…"; } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['ro']); +})(jQuery); diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_rs.js b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_rs.js new file mode 100644 index 000000000..72c16389c --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_rs.js @@ -0,0 +1,19 @@ +/** + * Select2 Serbian translation. + * + * @author Limon Monte + */ +(function ($) { + "use strict"; + + $.fn.select2.locales['rs'] = { + formatNoMatches: function () { return "Ništa nije pronađeno"; }, + formatInputTooShort: function (input, min) { var n = min - input.length; return "Ukucajte bar još " + n + " simbol" + (n % 10 == 1 && n % 100 != 11 ? "" : "a"); }, + formatInputTooLong: function (input, max) { var n = input.length - max; return "Obrišite " + n + " simbol" + (n % 10 == 1 && n % 100 != 11 ? "" : "a"); }, + formatSelectionTooBig: function (limit) { return "Možete izabrati samo " + limit + " stavk" + (limit % 10 == 1 && limit % 100 != 11 ? "u" : (limit % 10 >= 2 && limit % 10 <= 4 && (limit % 100 < 12 || limit % 100 > 14)? "e" : "i")); }, + formatLoadMore: function (pageNumber) { return "Preuzimanje još rezultata…"; }, + formatSearching: function () { return "Pretraga…"; } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['rs']); +})(jQuery); diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_ru.js b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_ru.js new file mode 100644 index 000000000..2a6c7702c --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_ru.js @@ -0,0 +1,23 @@ +/** + * Select2 Russian translation. + * + * @author Uriy Efremochkin + */ +(function ($) { + "use strict"; + + $.fn.select2.locales['ru'] = { + formatNoMatches: function () { return "Совпадений не найдено"; }, + formatInputTooShort: function (input, min) { return "Пожалуйста, введите еще хотя бы" + character(min - input.length); }, + formatInputTooLong: function (input, max) { return "Пожалуйста, введите на" + character(input.length - max) + " меньше"; }, + formatSelectionTooBig: function (limit) { return "Вы можете выбрать не более " + limit + " элемент" + (limit%10 == 1 && limit%100 != 11 ? "а" : "ов"); }, + formatLoadMore: function (pageNumber) { return "Загрузка данных…"; }, + formatSearching: function () { return "Поиск…"; } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['ru']); + + function character (n) { + return " " + n + " символ" + (n%10 < 5 && n%10 > 0 && (n%100 < 5 || n%100 > 20) ? n%10 > 1 ? "a" : "" : "ов"); + } +})(jQuery); diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_sk.js b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_sk.js new file mode 100644 index 000000000..027530c93 --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_sk.js @@ -0,0 +1,50 @@ +/** + * Select2 Slovak translation. + * + * Author: David Vallner + */ +(function ($) { + "use strict"; + // use text for the numbers 2 through 4 + var smallNumbers = { + 2: function(masc) { return (masc ? "dva" : "dve"); }, + 3: function() { return "tri"; }, + 4: function() { return "štyri"; } + }; + $.fn.select2.locales['sk'] = { + formatNoMatches: function () { return "Nenašli sa žiadne položky"; }, + formatInputTooShort: function (input, min) { + var n = min - input.length; + if (n == 1) { + return "Prosím, zadajte ešte jeden znak"; + } else if (n <= 4) { + return "Prosím, zadajte ešte ďalšie "+smallNumbers[n](true)+" znaky"; + } else { + return "Prosím, zadajte ešte ďalších "+n+" znakov"; + } + }, + formatInputTooLong: function (input, max) { + var n = input.length - max; + if (n == 1) { + return "Prosím, zadajte o jeden znak menej"; + } else if (n >= 2 && n <= 4) { + return "Prosím, zadajte o "+smallNumbers[n](true)+" znaky menej"; + } else { + return "Prosím, zadajte o "+n+" znakov menej"; + } + }, + formatSelectionTooBig: function (limit) { + if (limit == 1) { + return "Môžete zvoliť len jednu položku"; + } else if (limit >= 2 && limit <= 4) { + return "Môžete zvoliť najviac "+smallNumbers[limit](false)+" položky"; + } else { + return "Môžete zvoliť najviac "+limit+" položiek"; + } + }, + formatLoadMore: function (pageNumber) { return "Načítavajú sa ďalšie výsledky…"; }, + formatSearching: function () { return "Vyhľadávanie…"; } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['sk']); +})(jQuery); diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_sv.js b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_sv.js new file mode 100644 index 000000000..96f8c0a88 --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_sv.js @@ -0,0 +1,19 @@ +/** + * Select2 Swedish translation. + * + * Author: Jens Rantil + */ +(function ($) { + "use strict"; + + $.fn.select2.locales['sv'] = { + formatNoMatches: function () { return "Inga träffar"; }, + formatInputTooShort: function (input, min) { var n = min - input.length; return "Var god skriv in " + n + (n>1 ? " till tecken" : " tecken till"); }, + formatInputTooLong: function (input, max) { var n = input.length - max; return "Var god sudda ut " + n + " tecken"; }, + formatSelectionTooBig: function (limit) { return "Du kan max välja " + limit + " element"; }, + formatLoadMore: function (pageNumber) { return "Laddar fler resultat…"; }, + formatSearching: function () { return "Söker…"; } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['sv']); +})(jQuery); diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_th.js b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_th.js new file mode 100644 index 000000000..7f3e6ef8c --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_th.js @@ -0,0 +1,19 @@ +/** + * Select2 Thai translation. + * + * Author: Atsawin Chaowanakritsanakul + */ +(function ($) { + "use strict"; + + $.fn.select2.locales['th'] = { + formatNoMatches: function () { return "ไม่พบข้อมูล"; }, + formatInputTooShort: function (input, min) { var n = min - input.length; return "โปรดพิมพ์เพิ่มอีก " + n + " ตัวอักษร"; }, + formatInputTooLong: function (input, max) { var n = input.length - max; return "โปรดลบออก " + n + " ตัวอักษร"; }, + formatSelectionTooBig: function (limit) { return "คุณสามารถเลือกได้ไม่เกิน " + limit + " รายการ"; }, + formatLoadMore: function (pageNumber) { return "กำลังค้นข้อมูลเพิ่ม…"; }, + formatSearching: function () { return "กำลังค้นข้อมูล…"; } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['th']); +})(jQuery); diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_tr.js b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_tr.js new file mode 100644 index 000000000..1dda95ca3 --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_tr.js @@ -0,0 +1,19 @@ +/** + * Select2 Turkish translation. + * + * Author: Salim KAYABAŞI + */ +(function ($) { + "use strict"; + + $.fn.select2.locales['tr'] = { + formatNoMatches: function () { return "Sonuç bulunamadı"; }, + formatInputTooShort: function (input, min) { var n = min - input.length; return "En az " + n + " karakter daha girmelisiniz"; }, + formatInputTooLong: function (input, max) { var n = input.length - max; return n + " karakter azaltmalısınız"; }, + formatSelectionTooBig: function (limit) { return "Sadece " + limit + " seçim yapabilirsiniz"; }, + formatLoadMore: function (pageNumber) { return "Daha fazla…"; }, + formatSearching: function () { return "Aranıyor…"; } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['tr']); +})(jQuery); diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_ug-CN.js b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_ug-CN.js new file mode 100644 index 000000000..579588a7a --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_ug-CN.js @@ -0,0 +1,16 @@ +/** + * Select2 Uyghur translation + */ +(function ($) { + "use strict"; + $.fn.select2.locales['ug-CN'] = { + formatNoMatches: function () { return "ماس كېلىدىغان ئۇچۇر تېپىلمىدى"; }, + formatInputTooShort: function (input, min) { var n = min - input.length; return "يەنە " + n + " ھەرپ كىرگۈزۈڭ";}, + formatInputTooLong: function (input, max) { var n = input.length - max; return "" + n + "ھەرپ ئۆچۈرۈڭ";}, + formatSelectionTooBig: function (limit) { return "ئەڭ كۆپ بولغاندا" + limit + " تال ئۇچۇر تاللىيالايسىز"; }, + formatLoadMore: function (pageNumber) { return "ئۇچۇرلار ئوقۇلىۋاتىدۇ…"; }, + formatSearching: function () { return "ئىزدەۋاتىدۇ…"; } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['ug-CN']); +})(jQuery); diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_uk.js b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_uk.js new file mode 100644 index 000000000..b5bd0e02d --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_uk.js @@ -0,0 +1,25 @@ +/** + * Select2 Ukrainian translation. + * + * @author bigmihail + * @author Uriy Efremochkin + */ +(function ($) { + "use strict"; + + $.fn.select2.locales['uk'] = { + formatMatches: function (matches) { return character(matches, "результат") + " знайдено, використовуйте клавіші зі стрілками вверх та вниз для навігації."; }, + formatNoMatches: function () { return "Нічого не знайдено"; }, + formatInputTooShort: function (input, min) { return "Введіть буль ласка ще " + character(min - input.length, "символ"); }, + formatInputTooLong: function (input, max) { return "Введіть буль ласка на " + character(input.length - max, "символ") + " менше"; }, + formatSelectionTooBig: function (limit) { return "Ви можете вибрати лише " + character(limit, "елемент"); }, + formatLoadMore: function (pageNumber) { return "Завантаження даних…"; }, + formatSearching: function () { return "Пошук…"; } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['uk']); + + function character (n, word) { + return n + " " + word + (n%10 < 5 && n%10 > 0 && (n%100 < 5 || n%100 > 19) ? n%10 > 1 ? "и" : "" : "ів"); + } +})(jQuery); diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_vi.js b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_vi.js new file mode 100644 index 000000000..cc67065f9 --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_vi.js @@ -0,0 +1,20 @@ +/** + * Select2 Vietnamese translation. + * + * Author: Long Nguyen + */ +(function ($) { + "use strict"; + + $.fn.select2.locales['vi'] = { + formatNoMatches: function () { return "Không tìm thấy kết quả"; }, + formatInputTooShort: function (input, min) { var n = min - input.length; return "Vui lòng nhập nhiều hơn " + n + " ký tự" + (n == 1 ? "" : "s"); }, + formatInputTooLong: function (input, max) { var n = input.length - max; return "Vui lòng nhập ít hơn " + n + " ký tự" + (n == 1? "" : "s"); }, + formatSelectionTooBig: function (limit) { return "Chỉ có thể chọn được " + limit + " tùy chọn" + (limit == 1 ? "" : "s"); }, + formatLoadMore: function (pageNumber) { return "Đang lấy thêm kết quả…"; }, + formatSearching: function () { return "Đang tìm…"; } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['vi']); +})(jQuery); + diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_zh-CN.js b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_zh-CN.js new file mode 100644 index 000000000..e988dac1a --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_zh-CN.js @@ -0,0 +1,16 @@ +/** + * Select2 Chinese translation + */ +(function ($) { + "use strict"; + $.fn.select2.locales['zh-CN'] = { + formatNoMatches: function () { return "没有找到匹配项"; }, + formatInputTooShort: function (input, min) { var n = min - input.length; return "请再输入" + n + "个字符";}, + formatInputTooLong: function (input, max) { var n = input.length - max; return "请删掉" + n + "个字符";}, + formatSelectionTooBig: function (limit) { return "你只能选择最多" + limit + "项"; }, + formatLoadMore: function (pageNumber) { return "加载结果中…"; }, + formatSearching: function () { return "搜索中…"; } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['zh-CN']); +})(jQuery); diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_zh-TW.js b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_zh-TW.js new file mode 100644 index 000000000..85dbd5afc --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2_locale_zh-TW.js @@ -0,0 +1,16 @@ +/** + * Select2 Traditional Chinese translation + */ +(function ($) { + "use strict"; + $.fn.select2.locales['zh-TW'] = { + formatNoMatches: function () { return "沒有找到相符的項目"; }, + formatInputTooShort: function (input, min) { var n = min - input.length; return "請再輸入" + n + "個字元";}, + formatInputTooLong: function (input, max) { var n = input.length - max; return "請刪掉" + n + "個字元";}, + formatSelectionTooBig: function (limit) { return "你只能選擇最多" + limit + "項"; }, + formatLoadMore: function (pageNumber) { return "載入中…"; }, + formatSearching: function () { return "搜尋中…"; } + }; + + $.extend($.fn.select2.defaults, $.fn.select2.locales['zh-TW']); +})(jQuery); diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2x2.png b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2x2.png new file mode 100644 index 000000000..4bdd5c961 Binary files /dev/null and b/plugins/legacy-admin/framework/core/assets/js/vendor/select2/select2x2.png differ diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/spectrum/redux-spectrum.js b/plugins/legacy-admin/framework/core/assets/js/vendor/spectrum/redux-spectrum.js new file mode 100644 index 000000000..4ed8f7b39 --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/spectrum/redux-spectrum.js @@ -0,0 +1,2088 @@ +// Spectrum Colorpicker v1.3.3 +// https://github.com/bgrins/spectrum +// Author: Brian Grinstead +// License: MIT + +(function (window, $, undefined) { + var defaultOpts = { + + // Callbacks + beforeShow: noop, + move: noop, + change: noop, + show: noop, + hide: noop, + + // Options + color: false, + flat: false, + showInput: false, + allowEmpty: false, + showButtons: true, + clickoutFiresChange: false, + showInitial: false, + showPalette: false, + showPaletteOnly: false, + showSelectionPalette: true, + localStorageKey: false, + appendTo: "body", + maxSelectionSize: 7, + cancelText: "cancel", + chooseText: "choose", + clearText: "Clear Color Selection", + preferredFormat: false, + className: "", // Deprecated - use containerClassName and replacerClassName instead. + containerClassName: "", + replacerClassName: "", + showAlpha: false, + theme: "sp-light", + palette: [["#ffffff", "#000000", "#ff0000", "#ff8000", "#ffff00", "#008000", "#0000ff", "#4b0082", "#9400d3"]], + selectionPalette: [], + disabled: false, + inputText: '' + }, + spectrums = [], + IE = !!/msie/i.exec( window.navigator.userAgent ), + rgbaSupport = (function() { + function contains( str, substr ) { + return !!~('' + str).indexOf(substr); + } + + var elem = document.createElement('div'); + var style = elem.style; + style.cssText = 'background-color:rgba(0,0,0,.5)'; + return contains(style.backgroundColor, 'rgba') || contains(style.backgroundColor, 'hsla'); + })(), + inputTypeColorSupport = (function() { + var colorInput = $("")[0]; + return colorInput.type === "color" && colorInput.value !== "!"; + })(), + replaceInput = [ + "
    ", + "
    ", + "
    ", + //"
    " + opts.inputText + "
    ", + "
    " + ].join(''), + markup = (function () { + + // IE does not support gradients with multiple stops, so we need to simulate + // that for the rainbow slider with 8 divs that each have a single gradient + var gradientFix = ""; + if (IE) { + for (var i = 1; i <= 6; i++) { + gradientFix += "
    "; + } + } + + return [ + "
    ", + "
    ", + "
    ", + "
    ", + "
    ", + "
    ", + "
    ", + "
    ", + "
    ", + "
    ", + "
    ", + "
    ", + "
    ", + "
    ", + "
    ", + "
    ", + "
    ", + "
    ", + "
    ", + gradientFix, + "
    ", + "
    ", + "
    ", + "
    ", + "
    ", + "", + "
    ", + "
    ", + "
    ", + "", + "", + "
    ", + "
    ", + "
    " + ].join(""); + })(); + + function paletteTemplate (p, color, className, tooltipFormat) { + var html = []; + for (var i = 0; i < p.length; i++) { + var current = p[i]; + if(current) { + var tiny = tinycolor(current); + var c = tiny.toHsl().l < 0.5 ? "sp-thumb-el sp-thumb-dark" : "sp-thumb-el sp-thumb-light"; + c += (tinycolor.equals(color, current)) ? " sp-thumb-active" : ""; + + var formattedString = tiny.toString(tooltipFormat || "rgb"); + var swatchStyle = rgbaSupport ? ("background-color:" + tiny.toRgbString()) : "filter:" + tiny.toFilter(); + html.push(''); + } else { + var cls = 'sp-clear-display'; + html.push(''); + } + } + return "
    " + html.join('') + "
    "; + } + + function hideAll() { + for (var i = 0; i < spectrums.length; i++) { + if (spectrums[i]) { + spectrums[i].hide(); + } + } + } + + function instanceOptions(o, callbackContext) { + var opts = $.extend({}, defaultOpts, o); + opts.callbacks = { + 'move': bind(opts.move, callbackContext), + 'change': bind(opts.change, callbackContext), + 'show': bind(opts.show, callbackContext), + 'hide': bind(opts.hide, callbackContext), + 'beforeShow': bind(opts.beforeShow, callbackContext) + }; + + return opts; + } + + function spectrum(element, o) { + + var opts = instanceOptions(o, element), + flat = opts.flat, + showSelectionPalette = opts.showSelectionPalette, + localStorageKey = opts.localStorageKey, + theme = opts.theme, + callbacks = opts.callbacks, + resize = throttle(reflow, 10), + visible = false, + dragWidth = 0, + dragHeight = 0, + dragHelperHeight = 0, + slideHeight = 0, + slideWidth = 0, + alphaWidth = 0, + alphaSlideHelperWidth = 0, + slideHelperHeight = 0, + currentHue = 0, + currentSaturation = 0, + currentValue = 0, + currentAlpha = 1, + palette = [], + paletteArray = [], + paletteLookup = {}, + selectionPalette = opts.selectionPalette.slice(0), + maxSelectionSize = opts.maxSelectionSize, + draggingClass = "sp-dragging", + inputText = opts.inputText, + shiftMovementDirection = null; + + var doc = element.ownerDocument, + body = doc.body, + boundElement = $(element), + disabled = false, + container = $(markup, doc).addClass(theme), + dragger = container.find(".sp-color"), + dragHelper = container.find(".sp-dragger"), + slider = container.find(".sp-hue"), + slideHelper = container.find(".sp-slider"), + alphaSliderInner = container.find(".sp-alpha-inner"), + alphaSlider = container.find(".sp-alpha"), + alphaSlideHelper = container.find(".sp-alpha-handle"), + textInput = container.find(".sp-input"), + paletteContainer = container.find(".sp-palette"), + initialColorContainer = container.find(".sp-initial"), + cancelButton = container.find(".sp-cancel"), + clearButton = container.find(".sp-clear"), + chooseButton = container.find(".sp-choose"), + isInput = boundElement.is("input"), + isInputTypeColor = isInput && inputTypeColorSupport && boundElement.attr("type") === "color", + shouldReplace = isInput && !flat, + replacer = (shouldReplace) ? $(replaceInput).addClass(theme).addClass(opts.className).addClass(opts.replacerClassName) : $([]), + offsetElement = (shouldReplace) ? replacer : boundElement, + previewElement = replacer.find(".sp-preview-inner"), + initialColor = opts.color || (isInput && boundElement.val()), + colorOnShow = false, + preferredFormat = opts.preferredFormat, + currentPreferredFormat = preferredFormat, + clickoutFiresChange = !opts.showButtons || opts.clickoutFiresChange, + isEmpty = !initialColor, + allowEmpty = opts.allowEmpty && !isInputTypeColor; + + if (inputText !== '') { + var x = $(offsetElement).find('div.sp-dd'); + x.text(inputText); + } + + function applyOptions() { + + if (opts.showPaletteOnly) { + opts.showPalette = true; + } + + if (opts.palette) { + palette = opts.palette.slice(0); + paletteArray = $.isArray(palette[0]) ? palette : [palette]; + paletteLookup = {}; + for (var i = 0; i < paletteArray.length; i++) { + for (var j = 0; j < paletteArray[i].length; j++) { + var rgb = tinycolor(paletteArray[i][j]).toRgbString(); + paletteLookup[rgb] = true; + } + } + } + + container.toggleClass("sp-flat", flat); + container.toggleClass("sp-input-disabled", !opts.showInput); + container.toggleClass("sp-alpha-enabled", opts.showAlpha); + container.toggleClass("sp-clear-enabled", allowEmpty); + container.toggleClass("sp-buttons-disabled", !opts.showButtons); + container.toggleClass("sp-palette-disabled", !opts.showPalette); + container.toggleClass("sp-palette-only", opts.showPaletteOnly); + container.toggleClass("sp-initial-disabled", !opts.showInitial); + container.addClass(opts.className).addClass(opts.containerClassName); + + reflow(); + } + + function initialize() { + + if (IE) { + container.find("*:not(input)").attr("unselectable", "on"); + } + + applyOptions(); + + if (shouldReplace) { + boundElement.after(replacer).hide(); + } + + if (!allowEmpty) { + clearButton.hide(); + } + + if (flat) { + boundElement.after(container).hide(); + } + else { + + var appendTo = opts.appendTo === "parent" ? boundElement.parent() : $(opts.appendTo); + if (appendTo.length !== 1) { + appendTo = $("body"); + } + + appendTo.append(container); + } + + updateSelectionPaletteFromStorage(); + + offsetElement.bind("click.spectrum touchstart.spectrum", function (e) { + if (!disabled) { + toggle(); + } + + e.stopPropagation(); + + if (!$(e.target).is("input")) { + e.preventDefault(); + } + }); + + if(boundElement.is(":disabled") || (opts.disabled === true)) { + disable(); + } + + // Prevent clicks from bubbling up to document. This would cause it to be hidden. + container.click(stopPropagation); + + // Handle user typed input + textInput.change(setFromTextInput); + textInput.bind("paste", function () { + setTimeout(setFromTextInput, 1); + }); + textInput.keydown(function (e) { if (e.keyCode == 13) { setFromTextInput(); } }); + + cancelButton.text(opts.cancelText); + cancelButton.bind("click.spectrum", function (e) { + e.stopPropagation(); + e.preventDefault(); + hide("cancel"); + }); + + clearButton.attr("title", opts.clearText); + clearButton.bind("click.spectrum", function (e) { + e.stopPropagation(); + e.preventDefault(); + isEmpty = true; + move(); + + if(flat) { + //for the flat style, this is a change event + updateOriginalInput(true); + } + }); + + chooseButton.text(opts.chooseText); + chooseButton.bind("click.spectrum", function (e) { + e.stopPropagation(); + e.preventDefault(); + + if (isValid()) { + updateOriginalInput(true); + hide(); + } + }); + + draggable(alphaSlider, function (dragX, dragY, e) { + currentAlpha = (dragX / alphaWidth); + isEmpty = false; + if (e.shiftKey) { + currentAlpha = Math.round(currentAlpha * 10) / 10; + } + + move(); + }, dragStart, dragStop); + + draggable(slider, function (dragX, dragY) { + currentHue = parseFloat(dragY / slideHeight); + isEmpty = false; + if (!opts.showAlpha) { + currentAlpha = 1; + } + move(); + }, dragStart, dragStop); + + draggable(dragger, function (dragX, dragY, e) { + + // shift+drag should snap the movement to either the x or y axis. + if (!e.shiftKey) { + shiftMovementDirection = null; + } + else if (!shiftMovementDirection) { + var oldDragX = currentSaturation * dragWidth; + var oldDragY = dragHeight - (currentValue * dragHeight); + var furtherFromX = Math.abs(dragX - oldDragX) > Math.abs(dragY - oldDragY); + + shiftMovementDirection = furtherFromX ? "x" : "y"; + } + + var setSaturation = !shiftMovementDirection || shiftMovementDirection === "x"; + var setValue = !shiftMovementDirection || shiftMovementDirection === "y"; + + if (setSaturation) { + currentSaturation = parseFloat(dragX / dragWidth); + } + if (setValue) { + currentValue = parseFloat((dragHeight - dragY) / dragHeight); + } + + isEmpty = false; + if (!opts.showAlpha) { + currentAlpha = 1; + } + + move(); + + }, dragStart, dragStop); + + if (!!initialColor) { + set(initialColor); + + // In case color was black - update the preview UI and set the format + // since the set function will not run (default color is black). + updateUI(); + currentPreferredFormat = preferredFormat || tinycolor(initialColor).format; + + addColorToSelectionPalette(initialColor); + } + else { + updateUI(); + } + + if (flat) { + show(); + } + + function palletElementClick(e) { + if (e.data && e.data.ignore) { + set($(this).data("color")); + move(); + } + else { + set($(this).data("color")); + move(); + updateOriginalInput(true); + hide(); + } + + return false; + } + + var paletteEvent = IE ? "mousedown.spectrum" : "click.spectrum touchstart.spectrum"; + paletteContainer.delegate(".sp-thumb-el", paletteEvent, palletElementClick); + initialColorContainer.delegate(".sp-thumb-el:nth-child(1)", paletteEvent, { ignore: true }, palletElementClick); + } + + function updateSelectionPaletteFromStorage() { + + if (localStorageKey && window.localStorage) { + + // Migrate old palettes over to new format. May want to remove this eventually. + try { + var oldPalette = window.localStorage[localStorageKey].split(",#"); + if (oldPalette.length > 1) { + delete window.localStorage[localStorageKey]; + $.each(oldPalette, function(i, c) { + addColorToSelectionPalette(c); + }); + } + } + catch(e) { } + + try { + selectionPalette = window.localStorage[localStorageKey].split(";"); + } + catch (e) { } + } + } + + function addColorToSelectionPalette(color) { + if (showSelectionPalette) { + var rgb = tinycolor(color).toRgbString(); + if (!paletteLookup[rgb] && $.inArray(rgb, selectionPalette) === -1) { + selectionPalette.push(rgb); + while(selectionPalette.length > maxSelectionSize) { + selectionPalette.shift(); + } + } + + if (localStorageKey && window.localStorage) { + try { + window.localStorage[localStorageKey] = selectionPalette.join(";"); + } + catch(e) { } + } + } + } + + function getUniqueSelectionPalette() { + var unique = []; + if (opts.showPalette) { + for (i = 0; i < selectionPalette.length; i++) { + var rgb = tinycolor(selectionPalette[i]).toRgbString(); + + if (!paletteLookup[rgb]) { + unique.push(selectionPalette[i]); + } + } + } + + return unique.reverse().slice(0, opts.maxSelectionSize); + } + + function drawPalette() { + + var currentColor = get(); + + var html = $.map(paletteArray, function (palette, i) { + return paletteTemplate(palette, currentColor, "sp-palette-row sp-palette-row-" + i, opts.preferredFormat); + }); + + updateSelectionPaletteFromStorage(); + + if (selectionPalette) { + html.push(paletteTemplate(getUniqueSelectionPalette(), currentColor, "sp-palette-row sp-palette-row-selection", opts.preferredFormat)); + } + + paletteContainer.html(html.join("")); + } + + function drawInitial() { + if (opts.showInitial) { + var initial = colorOnShow; + var current = get(); + initialColorContainer.html(paletteTemplate([initial, current], current, "sp-palette-row-initial", opts.preferredFormat)); + } + } + + function dragStart() { + if (dragHeight <= 0 || dragWidth <= 0 || slideHeight <= 0) { + reflow(); + } + container.addClass(draggingClass); + shiftMovementDirection = null; + boundElement.trigger('dragstart.spectrum', [ get() ]); + } + + function dragStop() { + container.removeClass(draggingClass); + boundElement.trigger('dragstop.spectrum', [ get() ]); + } + + function setFromTextInput() { + + var value = textInput.val(); + + if ((value === null || value === "") && allowEmpty) { + set(null); + updateOriginalInput(true); + } + else { + var tiny = tinycolor(value); + if (tiny.ok) { + set(tiny); + updateOriginalInput(true); + } + else { + textInput.addClass("sp-validation-error"); + } + } + } + + function toggle() { + if (visible) { + hide(); + } + else { + show(); + } + } + + function show() { + var event = $.Event('beforeShow.spectrum'); + + if (visible) { + reflow(); + return; + } + + boundElement.trigger(event, [ get() ]); + + if (callbacks.beforeShow(get()) === false || event.isDefaultPrevented()) { + return; + } + + hideAll(); + visible = true; + + $(doc).bind("click.spectrum", hide); + $(window).bind("resize.spectrum", resize); + replacer.addClass("sp-active"); + container.removeClass("sp-hidden"); + + reflow(); + updateUI(); + + colorOnShow = get(); + + drawInitial(); + callbacks.show(colorOnShow); + boundElement.trigger('show.spectrum', [ colorOnShow ]); + } + + function hide(e) { + + // Return on right click + if (e && e.type == "click" && e.button == 2) { return; } + + // Return if hiding is unnecessary + if (!visible || flat) { return; } + visible = false; + + $(doc).unbind("click.spectrum", hide); + $(window).unbind("resize.spectrum", resize); + + replacer.removeClass("sp-active"); + container.addClass("sp-hidden"); + + var colorHasChanged = !tinycolor.equals(get(), colorOnShow); + + if (colorHasChanged) { + if (clickoutFiresChange && e !== "cancel") { + updateOriginalInput(true); + } + else { + revert(); + } + } + + callbacks.hide(get()); + boundElement.trigger('hide.spectrum', [ get() ]); + } + + function revert() { + set(colorOnShow, true); + } + + function set(color, ignoreFormatChange) { + if (tinycolor.equals(color, get())) { + // Update UI just in case a validation error needs + // to be cleared. + updateUI(); + return; + } + + var newColor, newHsv; + if (!color && allowEmpty) { + isEmpty = true; + } else { + isEmpty = false; + newColor = tinycolor(color); + newHsv = newColor.toHsv(); + + currentHue = (newHsv.h % 360) / 360; + currentSaturation = newHsv.s; + currentValue = newHsv.v; + currentAlpha = newHsv.a; + } + updateUI(); + + if (newColor && newColor.ok && !ignoreFormatChange) { + currentPreferredFormat = preferredFormat || newColor.format; + } + } + + function get(opts) { + opts = opts || { }; + + if (allowEmpty && isEmpty) { + return null; + } + + return tinycolor.fromRatio({ + h: currentHue, + s: currentSaturation, + v: currentValue, + a: Math.round(currentAlpha * 100) / 100 + }, { format: opts.format || currentPreferredFormat }); + } + + function isValid() { + return !textInput.hasClass("sp-validation-error"); + } + + function move() { + updateUI(); + + callbacks.move(get()); + boundElement.trigger('move.spectrum', [ get() ]); + } + + function updateUI() { + + textInput.removeClass("sp-validation-error"); + + updateHelperLocations(); + + // Update dragger background color (gradients take care of saturation and value). + var flatColor = tinycolor.fromRatio({ h: currentHue, s: 1, v: 1 }); + dragger.css("background-color", flatColor.toHexString()); + + // Get a format that alpha will be included in (hex and names ignore alpha) + var format = currentPreferredFormat; + if (currentAlpha < 1 && !(currentAlpha === 0 && format === "name")) { + if (format === "hex" || format === "hex3" || format === "hex6" || format === "name") { + format = "rgb"; + } + } + + var realColor = get({ format: format }), + displayColor = ''; + + //reset background info for preview element + previewElement.removeClass("sp-clear-display"); + previewElement.css('background-color', 'transparent'); + + if (!realColor && allowEmpty) { + // Update the replaced elements background with icon indicating no color selection + previewElement.addClass("sp-clear-display"); + } + else { + var realHex = realColor.toHexString(), + realRgb = realColor.toRgbString(); + + // Update the replaced elements background color (with actual selected color) + if (rgbaSupport || realColor.alpha === 1) { + previewElement.css("background-color", realRgb); + } + else { + previewElement.css("background-color", "transparent"); + previewElement.css("filter", realColor.toFilter()); + } + + if (opts.showAlpha) { + var rgb = realColor.toRgb(); + rgb.a = 0; + var realAlpha = tinycolor(rgb).toRgbString(); + var gradient = "linear-gradient(left, " + realAlpha + ", " + realHex + ")"; + + if (IE) { + alphaSliderInner.css("filter", tinycolor(realAlpha).toFilter({ gradientType: 1 }, realHex)); + } + else { + alphaSliderInner.css("background", "-webkit-" + gradient); + alphaSliderInner.css("background", "-moz-" + gradient); + alphaSliderInner.css("background", "-ms-" + gradient); + // Use current syntax gradient on unprefixed property. + alphaSliderInner.css("background", + "linear-gradient(to right, " + realAlpha + ", " + realHex + ")"); + } + } + + displayColor = realColor.toString(format); + } + + // Update the text entry input as it changes happen + if (opts.showInput) { + textInput.val(displayColor); + } + + if (opts.showPalette) { + drawPalette(); + } + + drawInitial(); + } + + function updateHelperLocations() { + var s = currentSaturation; + var v = currentValue; + + if(allowEmpty && isEmpty) { + //if selected color is empty, hide the helpers + alphaSlideHelper.hide(); + slideHelper.hide(); + dragHelper.hide(); + } + else { + //make sure helpers are visible + alphaSlideHelper.show(); + slideHelper.show(); + dragHelper.show(); + + // Where to show the little circle in that displays your current selected color + var dragX = s * dragWidth; + var dragY = dragHeight - (v * dragHeight); + dragX = Math.max( + -dragHelperHeight, + Math.min(dragWidth - dragHelperHeight, dragX - dragHelperHeight) + ); + dragY = Math.max( + -dragHelperHeight, + Math.min(dragHeight - dragHelperHeight, dragY - dragHelperHeight) + ); + dragHelper.css({ + "top": dragY + "px", + "left": dragX + "px" + }); + + var alphaX = currentAlpha * alphaWidth; + alphaSlideHelper.css({ + "left": (alphaX - (alphaSlideHelperWidth / 2)) + "px" + }); + + // Where to show the bar that displays your current selected hue + var slideY = (currentHue) * slideHeight; + slideHelper.css({ + "top": (slideY - slideHelperHeight) + "px" + }); + } + } + + function updateOriginalInput(fireCallback) { + var color = get(), + displayColor = '', + hasChanged = !tinycolor.equals(color, colorOnShow); + + if (color) { + displayColor = color.toString(currentPreferredFormat); + // Update the selection palette with the current color + addColorToSelectionPalette(color); + } + + if (isInput) { + boundElement.val(displayColor); + } + + colorOnShow = color; + + if (fireCallback && hasChanged) { + callbacks.change(color); + boundElement.trigger('change', [ color ]); + } + } + + function reflow() { + dragWidth = dragger.width(); + dragHeight = dragger.height(); + dragHelperHeight = dragHelper.height(); + slideWidth = slider.width(); + slideHeight = slider.height(); + slideHelperHeight = slideHelper.height(); + alphaWidth = alphaSlider.width(); + alphaSlideHelperWidth = alphaSlideHelper.width(); + + if (!flat) { + container.css("position", "absolute"); + container.offset(getOffset(container, offsetElement)); + } + + updateHelperLocations(); + + if (opts.showPalette) { + drawPalette(); + } + + boundElement.trigger('reflow.spectrum'); + } + + function destroy() { + boundElement.show(); + offsetElement.unbind("click.spectrum touchstart.spectrum"); + container.remove(); + replacer.remove(); + spectrums[spect.id] = null; + } + + function option(optionName, optionValue) { + if (optionName === undefined) { + return $.extend({}, opts); + } + if (optionValue === undefined) { + return opts[optionName]; + } + + opts[optionName] = optionValue; + applyOptions(); + } + + function enable() { + disabled = false; + boundElement.attr("disabled", false); + offsetElement.removeClass("sp-disabled"); + } + + function disable() { + hide(); + disabled = true; + boundElement.attr("disabled", true); + offsetElement.addClass("sp-disabled"); + } + + initialize(); + + var spect = { + show: show, + hide: hide, + toggle: toggle, + reflow: reflow, + option: option, + enable: enable, + disable: disable, + set: function (c) { + set(c); + updateOriginalInput(); + }, + get: get, + destroy: destroy, + container: container + }; + + spect.id = spectrums.push(spect) - 1; + + return spect; + } + + /** + * checkOffset - get the offset below/above and left/right element depending on screen position + * Thanks https://github.com/jquery/jquery-ui/blob/master/ui/jquery.ui.datepicker.js + */ + function getOffset(picker, input) { + var extraY = 0; + var dpWidth = picker.outerWidth(); + var dpHeight = picker.outerHeight(); + var inputHeight = input.outerHeight(); + var doc = picker[0].ownerDocument; + var docElem = doc.documentElement; + var viewWidth = docElem.clientWidth + $(doc).scrollLeft(); + var viewHeight = docElem.clientHeight + $(doc).scrollTop(); + var offset = input.offset(); + offset.top += inputHeight; + + offset.left -= + Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ? + Math.abs(offset.left + dpWidth - viewWidth) : 0); + + offset.top -= + Math.min(offset.top, ((offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ? + Math.abs(dpHeight + inputHeight - extraY) : extraY)); + + return offset; + } + + /** + * noop - do nothing + */ + function noop() { + + } + + /** + * stopPropagation - makes the code only doing this a little easier to read in line + */ + function stopPropagation(e) { + e.stopPropagation(); + } + + /** + * Create a function bound to a given object + * Thanks to underscore.js + */ + function bind(func, obj) { + var slice = Array.prototype.slice; + var args = slice.call(arguments, 2); + return function () { + return func.apply(obj, args.concat(slice.call(arguments))); + }; + } + + /** + * Lightweight drag helper. Handles containment within the element, so that + * when dragging, the x is within [0,element.width] and y is within [0,element.height] + */ + function draggable(element, onmove, onstart, onstop) { + onmove = onmove || function () { }; + onstart = onstart || function () { }; + onstop = onstop || function () { }; + var doc = element.ownerDocument || document; + var dragging = false; + var offset = {}; + var maxHeight = 0; + var maxWidth = 0; + var hasTouch = ('ontouchstart' in window); + + var duringDragEvents = {}; + duringDragEvents["selectstart"] = prevent; + duringDragEvents["dragstart"] = prevent; + duringDragEvents["touchmove mousemove"] = move; + duringDragEvents["touchend mouseup"] = stop; + + function prevent(e) { + if (e.stopPropagation) { + e.stopPropagation(); + } + if (e.preventDefault) { + e.preventDefault(); + } + e.returnValue = false; + } + + function move(e) { + if (dragging) { + // Mouseup happened outside of window + if (IE && document.documentMode < 9 && !e.button) { + return stop(); + } + + var touches = e.originalEvent.touches; + var pageX = touches ? touches[0].pageX : e.pageX; + var pageY = touches ? touches[0].pageY : e.pageY; + + var dragX = Math.max(0, Math.min(pageX - offset.left, maxWidth)); + var dragY = Math.max(0, Math.min(pageY - offset.top, maxHeight)); + + if (hasTouch) { + // Stop scrolling in iOS + prevent(e); + } + + onmove.apply(element, [dragX, dragY, e]); + } + } + + function start(e) { + var rightclick = (e.which) ? (e.which == 3) : (e.button == 2); + var touches = e.originalEvent.touches; + + if (!rightclick && !dragging) { + if (onstart.apply(element, arguments) !== false) { + dragging = true; + maxHeight = $(element).height(); + maxWidth = $(element).width(); + offset = $(element).offset(); + + $(doc).bind(duringDragEvents); + $(doc.body).addClass("sp-dragging"); + + if (!hasTouch) { + move(e); + } + + prevent(e); + } + } + } + + function stop() { + if (dragging) { + $(doc).unbind(duringDragEvents); + $(doc.body).removeClass("sp-dragging"); + onstop.apply(element, arguments); + } + dragging = false; + } + + $(element).bind("touchstart mousedown", start); + } + + function throttle(func, wait, debounce) { + var timeout; + return function () { + var context = this, args = arguments; + var throttler = function () { + timeout = null; + func.apply(context, args); + }; + if (debounce) clearTimeout(timeout); + if (debounce || !timeout) timeout = setTimeout(throttler, wait); + }; + } + + function log(){/* jshint -W021 */if(window.console){if(Function.prototype.bind)log=Function.prototype.bind.call(console.log,console);else log=function(){Function.prototype.apply.call(console.log,console,arguments);};log.apply(this,arguments);}} + + /** + * Define a jQuery plugin + */ + var dataID = "spectrum.id"; + $.fn.spectrum = function (opts, extra) { + + if (typeof opts == "string") { + + var returnValue = this; + var args = Array.prototype.slice.call( arguments, 1 ); + + this.each(function () { + var spect = spectrums[$(this).data(dataID)]; + if (spect) { + var method = spect[opts]; + if (!method) { + throw new Error( "Spectrum: no such method: '" + opts + "'" ); + } + + if (opts == "get") { + returnValue = spect.get(); + } + else if (opts == "container") { + returnValue = spect.container; + } + else if (opts == "option") { + returnValue = spect.option.apply(spect, args); + } + else if (opts == "destroy") { + spect.destroy(); + $(this).removeData(dataID); + } + else { + method.apply(spect, args); + } + } + }); + + return returnValue; + } + + // Initializing a new instance of spectrum + return this.spectrum("destroy").each(function () { + var options = $.extend({}, opts, $(this).data()); + var spect = spectrum(this, options); + $(this).data(dataID, spect.id); + }); + }; + + $.fn.spectrum.load = true; + $.fn.spectrum.loadOpts = {}; + $.fn.spectrum.draggable = draggable; + $.fn.spectrum.defaults = defaultOpts; + + $.spectrum = { }; + $.spectrum.localization = { }; + $.spectrum.palettes = { }; + + $.fn.spectrum.processNativeColorInputs = function () { + if (!inputTypeColorSupport) { + $("input[type=color]").spectrum({ + preferredFormat: "hex6" + }); + } + }; + + // TinyColor v0.9.17 + // https://github.com/bgrins/TinyColor + // 2013-08-10, Brian Grinstead, MIT License + + (function() { + + var trimLeft = /^[\s,#]+/, + trimRight = /\s+$/, + tinyCounter = 0, + math = Math, + mathRound = math.round, + mathMin = math.min, + mathMax = math.max, + mathRandom = math.random; + + function tinycolor (color, opts) { + + color = (color) ? color : ''; + opts = opts || { }; + + // If input is already a tinycolor, return itself + if (typeof color == "object" && color.hasOwnProperty("_tc_id")) { + return color; + } + + var rgb = inputToRGB(color); + var r = rgb.r, + g = rgb.g, + b = rgb.b, + a = rgb.a, + roundA = mathRound(100*a) / 100, + format = opts.format || rgb.format; + + // Don't let the range of [0,255] come back in [0,1]. + // Potentially lose a little bit of precision here, but will fix issues where + // .5 gets interpreted as half of the total, instead of half of 1 + // If it was supposed to be 128, this was already taken care of by `inputToRgb` + if (r < 1) { r = mathRound(r); } + if (g < 1) { g = mathRound(g); } + if (b < 1) { b = mathRound(b); } + + return { + ok: rgb.ok, + format: format, + _tc_id: tinyCounter++, + alpha: a, + getAlpha: function() { + return a; + }, + setAlpha: function(value) { + a = boundAlpha(value); + roundA = mathRound(100*a) / 100; + }, + toHsv: function() { + var hsv = rgbToHsv(r, g, b); + return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: a }; + }, + toHsvString: function() { + var hsv = rgbToHsv(r, g, b); + var h = mathRound(hsv.h * 360), s = mathRound(hsv.s * 100), v = mathRound(hsv.v * 100); + return (a == 1) ? + "hsv(" + h + ", " + s + "%, " + v + "%)" : + "hsva(" + h + ", " + s + "%, " + v + "%, "+ roundA + ")"; + }, + toHsl: function() { + var hsl = rgbToHsl(r, g, b); + return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: a }; + }, + toHslString: function() { + var hsl = rgbToHsl(r, g, b); + var h = mathRound(hsl.h * 360), s = mathRound(hsl.s * 100), l = mathRound(hsl.l * 100); + return (a == 1) ? + "hsl(" + h + ", " + s + "%, " + l + "%)" : + "hsla(" + h + ", " + s + "%, " + l + "%, "+ roundA + ")"; + }, + toHex: function(allow3Char) { + return rgbToHex(r, g, b, allow3Char); + }, + toHexString: function(allow3Char) { + return '#' + this.toHex(allow3Char); + }, + toHex8: function() { + return rgbaToHex(r, g, b, a); + }, + toHex8String: function() { + return '#' + this.toHex8(); + }, + toRgb: function() { + return { r: mathRound(r), g: mathRound(g), b: mathRound(b), a: a }; + }, + toRgbString: function() { + return (a == 1) ? + "rgb(" + mathRound(r) + ", " + mathRound(g) + ", " + mathRound(b) + ")" : + "rgba(" + mathRound(r) + ", " + mathRound(g) + ", " + mathRound(b) + ", " + roundA + ")"; + }, + toPercentageRgb: function() { + return { r: mathRound(bound01(r, 255) * 100) + "%", g: mathRound(bound01(g, 255) * 100) + "%", b: mathRound(bound01(b, 255) * 100) + "%", a: a }; + }, + toPercentageRgbString: function() { + return (a == 1) ? + "rgb(" + mathRound(bound01(r, 255) * 100) + "%, " + mathRound(bound01(g, 255) * 100) + "%, " + mathRound(bound01(b, 255) * 100) + "%)" : + "rgba(" + mathRound(bound01(r, 255) * 100) + "%, " + mathRound(bound01(g, 255) * 100) + "%, " + mathRound(bound01(b, 255) * 100) + "%, " + roundA + ")"; + }, + toName: function() { + if (a === 0) { + return "transparent"; + } + + return hexNames[rgbToHex(r, g, b, true)] || false; + }, + toFilter: function(secondColor) { + var hex8String = '#' + rgbaToHex(r, g, b, a); + var secondHex8String = hex8String; + var gradientType = opts && opts.gradientType ? "GradientType = 1, " : ""; + + if (secondColor) { + var s = tinycolor(secondColor); + secondHex8String = s.toHex8String(); + } + + return "progid:DXImageTransform.Microsoft.gradient("+gradientType+"startColorstr="+hex8String+",endColorstr="+secondHex8String+")"; + }, + toString: function(format) { + var formatSet = !!format; + format = format || this.format; + + var formattedString = false; + var hasAlphaAndFormatNotSet = !formatSet && a < 1 && a > 0; + var formatWithAlpha = hasAlphaAndFormatNotSet && (format === "hex" || format === "hex6" || format === "hex3" || format === "name"); + + if (format === "rgb") { + formattedString = this.toRgbString(); + } + if (format === "prgb") { + formattedString = this.toPercentageRgbString(); + } + if (format === "hex" || format === "hex6") { + formattedString = this.toHexString(); + } + if (format === "hex3") { + formattedString = this.toHexString(true); + } + if (format === "hex8") { + formattedString = this.toHex8String(); + } + if (format === "name") { + formattedString = this.toName(); + } + if (format === "hsl") { + formattedString = this.toHslString(); + } + if (format === "hsv") { + formattedString = this.toHsvString(); + } + + if (formatWithAlpha) { + return this.toRgbString(); + } + + return formattedString || this.toHexString(); + } + }; + } + + // If input is an object, force 1 into "1.0" to handle ratios properly + // String input requires "1.0" as input, so 1 will be treated as 1 + tinycolor.fromRatio = function(color, opts) { + if (typeof color == "object") { + var newColor = {}; + for (var i in color) { + if (color.hasOwnProperty(i)) { + if (i === "a") { + newColor[i] = color[i]; + } + else { + newColor[i] = convertToPercentage(color[i]); + } + } + } + color = newColor; + } + + return tinycolor(color, opts); + }; + + // Given a string or object, convert that input to RGB + // Possible string inputs: + // + // "red" + // "#f00" or "f00" + // "#ff0000" or "ff0000" + // "#ff000000" or "ff000000" + // "rgb 255 0 0" or "rgb (255, 0, 0)" + // "rgb 1.0 0 0" or "rgb (1, 0, 0)" + // "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1" + // "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1" + // "hsl(0, 100%, 50%)" or "hsl 0 100% 50%" + // "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1" + // "hsv(0, 100%, 100%)" or "hsv 0 100% 100%" + // + function inputToRGB(color) { + + var rgb = { r: 0, g: 0, b: 0 }; + var a = 1; + var ok = false; + var format = false; + + if (typeof color == "string") { + color = stringInputToObject(color); + } + + if (typeof color == "object") { + if (color.hasOwnProperty("r") && color.hasOwnProperty("g") && color.hasOwnProperty("b")) { + rgb = rgbToRgb(color.r, color.g, color.b); + ok = true; + format = String(color.r).substr(-1) === "%" ? "prgb" : "rgb"; + } + else if (color.hasOwnProperty("h") && color.hasOwnProperty("s") && color.hasOwnProperty("v")) { + color.s = convertToPercentage(color.s); + color.v = convertToPercentage(color.v); + rgb = hsvToRgb(color.h, color.s, color.v); + ok = true; + format = "hsv"; + } + else if (color.hasOwnProperty("h") && color.hasOwnProperty("s") && color.hasOwnProperty("l")) { + color.s = convertToPercentage(color.s); + color.l = convertToPercentage(color.l); + rgb = hslToRgb(color.h, color.s, color.l); + ok = true; + format = "hsl"; + } + + if (color.hasOwnProperty("a")) { + a = color.a; + } + } + + a = boundAlpha(a); + + return { + ok: ok, + format: color.format || format, + r: mathMin(255, mathMax(rgb.r, 0)), + g: mathMin(255, mathMax(rgb.g, 0)), + b: mathMin(255, mathMax(rgb.b, 0)), + a: a + }; + } + + + // Conversion Functions + // -------------------- + + // `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from: + // + + // `rgbToRgb` + // Handle bounds / percentage checking to conform to CSS color spec + // + // *Assumes:* r, g, b in [0, 255] or [0, 1] + // *Returns:* { r, g, b } in [0, 255] + function rgbToRgb(r, g, b){ + return { + r: bound01(r, 255) * 255, + g: bound01(g, 255) * 255, + b: bound01(b, 255) * 255 + }; + } + + // `rgbToHsl` + // Converts an RGB color value to HSL. + // *Assumes:* r, g, and b are contained in [0, 255] or [0, 1] + // *Returns:* { h, s, l } in [0,1] + function rgbToHsl(r, g, b) { + + r = bound01(r, 255); + g = bound01(g, 255); + b = bound01(b, 255); + + var max = mathMax(r, g, b), min = mathMin(r, g, b); + var h, s, l = (max + min) / 2; + + if(max == min) { + h = s = 0; // achromatic + } + else { + var d = max - min; + s = l > 0.5 ? d / (2 - max - min) : d / (max + min); + switch(max) { + case r: h = (g - b) / d + (g < b ? 6 : 0); break; + case g: h = (b - r) / d + 2; break; + case b: h = (r - g) / d + 4; break; + } + + h /= 6; + } + + return { h: h, s: s, l: l }; + } + + // `hslToRgb` + // Converts an HSL color value to RGB. + // *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100] + // *Returns:* { r, g, b } in the set [0, 255] + function hslToRgb(h, s, l) { + var r, g, b; + + h = bound01(h, 360); + s = bound01(s, 100); + l = bound01(l, 100); + + function hue2rgb(p, q, t) { + if(t < 0) t += 1; + if(t > 1) t -= 1; + if(t < 1/6) return p + (q - p) * 6 * t; + if(t < 1/2) return q; + if(t < 2/3) return p + (q - p) * (2/3 - t) * 6; + return p; + } + + if(s === 0) { + r = g = b = l; // achromatic + } + else { + var q = l < 0.5 ? l * (1 + s) : l + s - l * s; + var p = 2 * l - q; + r = hue2rgb(p, q, h + 1/3); + g = hue2rgb(p, q, h); + b = hue2rgb(p, q, h - 1/3); + } + + return { r: r * 255, g: g * 255, b: b * 255 }; + } + + // `rgbToHsv` + // Converts an RGB color value to HSV + // *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1] + // *Returns:* { h, s, v } in [0,1] + function rgbToHsv(r, g, b) { + + r = bound01(r, 255); + g = bound01(g, 255); + b = bound01(b, 255); + + var max = mathMax(r, g, b), min = mathMin(r, g, b); + var h, s, v = max; + + var d = max - min; + s = max === 0 ? 0 : d / max; + + if(max == min) { + h = 0; // achromatic + } + else { + switch(max) { + case r: h = (g - b) / d + (g < b ? 6 : 0); break; + case g: h = (b - r) / d + 2; break; + case b: h = (r - g) / d + 4; break; + } + h /= 6; + } + return { h: h, s: s, v: v }; + } + + // `hsvToRgb` + // Converts an HSV color value to RGB. + // *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100] + // *Returns:* { r, g, b } in the set [0, 255] + function hsvToRgb(h, s, v) { + + h = bound01(h, 360) * 6; + s = bound01(s, 100); + v = bound01(v, 100); + + var i = math.floor(h), + f = h - i, + p = v * (1 - s), + q = v * (1 - f * s), + t = v * (1 - (1 - f) * s), + mod = i % 6, + r = [v, q, p, p, t, v][mod], + g = [t, v, v, q, p, p][mod], + b = [p, p, t, v, v, q][mod]; + + return { r: r * 255, g: g * 255, b: b * 255 }; + } + + // `rgbToHex` + // Converts an RGB color to hex + // Assumes r, g, and b are contained in the set [0, 255] + // Returns a 3 or 6 character hex + function rgbToHex(r, g, b, allow3Char) { + + var hex = [ + pad2(mathRound(r).toString(16)), + pad2(mathRound(g).toString(16)), + pad2(mathRound(b).toString(16)) + ]; + + // Return a 3 character hex if possible + if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) { + return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0); + } + + return hex.join(""); + } + // `rgbaToHex` + // Converts an RGBA color plus alpha transparency to hex + // Assumes r, g, b and a are contained in the set [0, 255] + // Returns an 8 character hex + function rgbaToHex(r, g, b, a) { + + var hex = [ + pad2(convertDecimalToHex(a)), + pad2(mathRound(r).toString(16)), + pad2(mathRound(g).toString(16)), + pad2(mathRound(b).toString(16)) + ]; + + return hex.join(""); + } + + // `equals` + // Can be called with any tinycolor input + tinycolor.equals = function (color1, color2) { + if (!color1 || !color2) { return false; } + return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString(); + }; + tinycolor.random = function() { + return tinycolor.fromRatio({ + r: mathRandom(), + g: mathRandom(), + b: mathRandom() + }); + }; + + + // Modification Functions + // ---------------------- + // Thanks to less.js for some of the basics here + // + + tinycolor.desaturate = function (color, amount) { + amount = (amount === 0) ? 0 : (amount || 10); + var hsl = tinycolor(color).toHsl(); + hsl.s -= amount / 100; + hsl.s = clamp01(hsl.s); + return tinycolor(hsl); + }; + tinycolor.saturate = function (color, amount) { + amount = (amount === 0) ? 0 : (amount || 10); + var hsl = tinycolor(color).toHsl(); + hsl.s += amount / 100; + hsl.s = clamp01(hsl.s); + return tinycolor(hsl); + }; + tinycolor.greyscale = function(color) { + return tinycolor.desaturate(color, 100); + }; + tinycolor.lighten = function(color, amount) { + amount = (amount === 0) ? 0 : (amount || 10); + var hsl = tinycolor(color).toHsl(); + hsl.l += amount / 100; + hsl.l = clamp01(hsl.l); + return tinycolor(hsl); + }; + tinycolor.darken = function (color, amount) { + amount = (amount === 0) ? 0 : (amount || 10); + var hsl = tinycolor(color).toHsl(); + hsl.l -= amount / 100; + hsl.l = clamp01(hsl.l); + return tinycolor(hsl); + }; + tinycolor.complement = function(color) { + var hsl = tinycolor(color).toHsl(); + hsl.h = (hsl.h + 180) % 360; + return tinycolor(hsl); + }; + + + // Combination Functions + // --------------------- + // Thanks to jQuery xColor for some of the ideas behind these + // + + tinycolor.triad = function(color) { + var hsl = tinycolor(color).toHsl(); + var h = hsl.h; + return [ + tinycolor(color), + tinycolor({ h: (h + 120) % 360, s: hsl.s, l: hsl.l }), + tinycolor({ h: (h + 240) % 360, s: hsl.s, l: hsl.l }) + ]; + }; + tinycolor.tetrad = function(color) { + var hsl = tinycolor(color).toHsl(); + var h = hsl.h; + return [ + tinycolor(color), + tinycolor({ h: (h + 90) % 360, s: hsl.s, l: hsl.l }), + tinycolor({ h: (h + 180) % 360, s: hsl.s, l: hsl.l }), + tinycolor({ h: (h + 270) % 360, s: hsl.s, l: hsl.l }) + ]; + }; + tinycolor.splitcomplement = function(color) { + var hsl = tinycolor(color).toHsl(); + var h = hsl.h; + return [ + tinycolor(color), + tinycolor({ h: (h + 72) % 360, s: hsl.s, l: hsl.l}), + tinycolor({ h: (h + 216) % 360, s: hsl.s, l: hsl.l}) + ]; + }; + tinycolor.analogous = function(color, results, slices) { + results = results || 6; + slices = slices || 30; + + var hsl = tinycolor(color).toHsl(); + var part = 360 / slices; + var ret = [tinycolor(color)]; + + for (hsl.h = ((hsl.h - (part * results >> 1)) + 720) % 360; --results; ) { + hsl.h = (hsl.h + part) % 360; + ret.push(tinycolor(hsl)); + } + return ret; + }; + tinycolor.monochromatic = function(color, results) { + results = results || 6; + var hsv = tinycolor(color).toHsv(); + var h = hsv.h, s = hsv.s, v = hsv.v; + var ret = []; + var modification = 1 / results; + + while (results--) { + ret.push(tinycolor({ h: h, s: s, v: v})); + v = (v + modification) % 1; + } + + return ret; + }; + + + // Readability Functions + // --------------------- + // + + // `readability` + // Analyze the 2 colors and returns an object with the following properties: + // `brightness`: difference in brightness between the two colors + // `color`: difference in color/hue between the two colors + tinycolor.readability = function(color1, color2) { + var a = tinycolor(color1).toRgb(); + var b = tinycolor(color2).toRgb(); + var brightnessA = (a.r * 299 + a.g * 587 + a.b * 114) / 1000; + var brightnessB = (b.r * 299 + b.g * 587 + b.b * 114) / 1000; + var colorDiff = ( + Math.max(a.r, b.r) - Math.min(a.r, b.r) + + Math.max(a.g, b.g) - Math.min(a.g, b.g) + + Math.max(a.b, b.b) - Math.min(a.b, b.b) + ); + + return { + brightness: Math.abs(brightnessA - brightnessB), + color: colorDiff + }; + }; + + // `readable` + // http://www.w3.org/TR/AERT#color-contrast + // Ensure that foreground and background color combinations provide sufficient contrast. + // *Example* + // tinycolor.readable("#000", "#111") => false + tinycolor.readable = function(color1, color2) { + var readability = tinycolor.readability(color1, color2); + return readability.brightness > 125 && readability.color > 500; + }; + + // `mostReadable` + // Given a base color and a list of possible foreground or background + // colors for that base, returns the most readable color. + // *Example* + // tinycolor.mostReadable("#123", ["#fff", "#000"]) => "#000" + tinycolor.mostReadable = function(baseColor, colorList) { + var bestColor = null; + var bestScore = 0; + var bestIsReadable = false; + for (var i=0; i < colorList.length; i++) { + + // We normalize both around the "acceptable" breaking point, + // but rank brightness constrast higher than hue. + + var readability = tinycolor.readability(baseColor, colorList[i]); + var readable = readability.brightness > 125 && readability.color > 500; + var score = 3 * (readability.brightness / 125) + (readability.color / 500); + + if ((readable && ! bestIsReadable) || + (readable && bestIsReadable && score > bestScore) || + ((! readable) && (! bestIsReadable) && score > bestScore)) { + bestIsReadable = readable; + bestScore = score; + bestColor = tinycolor(colorList[i]); + } + } + return bestColor; + }; + + + // Big List of Colors + // ------------------ + // + var names = tinycolor.names = { + aliceblue: "f0f8ff", + antiquewhite: "faebd7", + aqua: "0ff", + aquamarine: "7fffd4", + azure: "f0ffff", + beige: "f5f5dc", + bisque: "ffe4c4", + black: "000", + blanchedalmond: "ffebcd", + blue: "00f", + blueviolet: "8a2be2", + brown: "a52a2a", + burlywood: "deb887", + burntsienna: "ea7e5d", + cadetblue: "5f9ea0", + chartreuse: "7fff00", + chocolate: "d2691e", + coral: "ff7f50", + cornflowerblue: "6495ed", + cornsilk: "fff8dc", + crimson: "dc143c", + cyan: "0ff", + darkblue: "00008b", + darkcyan: "008b8b", + darkgoldenrod: "b8860b", + darkgray: "a9a9a9", + darkgreen: "006400", + darkgrey: "a9a9a9", + darkkhaki: "bdb76b", + darkmagenta: "8b008b", + darkolivegreen: "556b2f", + darkorange: "ff8c00", + darkorchid: "9932cc", + darkred: "8b0000", + darksalmon: "e9967a", + darkseagreen: "8fbc8f", + darkslateblue: "483d8b", + darkslategray: "2f4f4f", + darkslategrey: "2f4f4f", + darkturquoise: "00ced1", + darkviolet: "9400d3", + deeppink: "ff1493", + deepskyblue: "00bfff", + dimgray: "696969", + dimgrey: "696969", + dodgerblue: "1e90ff", + firebrick: "b22222", + floralwhite: "fffaf0", + forestgreen: "228b22", + fuchsia: "f0f", + gainsboro: "dcdcdc", + ghostwhite: "f8f8ff", + gold: "ffd700", + goldenrod: "daa520", + gray: "808080", + green: "008000", + greenyellow: "adff2f", + grey: "808080", + honeydew: "f0fff0", + hotpink: "ff69b4", + indianred: "cd5c5c", + indigo: "4b0082", + ivory: "fffff0", + khaki: "f0e68c", + lavender: "e6e6fa", + lavenderblush: "fff0f5", + lawngreen: "7cfc00", + lemonchiffon: "fffacd", + lightblue: "add8e6", + lightcoral: "f08080", + lightcyan: "e0ffff", + lightgoldenrodyellow: "fafad2", + lightgray: "d3d3d3", + lightgreen: "90ee90", + lightgrey: "d3d3d3", + lightpink: "ffb6c1", + lightsalmon: "ffa07a", + lightseagreen: "20b2aa", + lightskyblue: "87cefa", + lightslategray: "789", + lightslategrey: "789", + lightsteelblue: "b0c4de", + lightyellow: "ffffe0", + lime: "0f0", + limegreen: "32cd32", + linen: "faf0e6", + magenta: "f0f", + maroon: "800000", + mediumaquamarine: "66cdaa", + mediumblue: "0000cd", + mediumorchid: "ba55d3", + mediumpurple: "9370db", + mediumseagreen: "3cb371", + mediumslateblue: "7b68ee", + mediumspringgreen: "00fa9a", + mediumturquoise: "48d1cc", + mediumvioletred: "c71585", + midnightblue: "191970", + mintcream: "f5fffa", + mistyrose: "ffe4e1", + moccasin: "ffe4b5", + navajowhite: "ffdead", + navy: "000080", + oldlace: "fdf5e6", + olive: "808000", + olivedrab: "6b8e23", + orange: "ffa500", + orangered: "ff4500", + orchid: "da70d6", + palegoldenrod: "eee8aa", + palegreen: "98fb98", + paleturquoise: "afeeee", + palevioletred: "db7093", + papayawhip: "ffefd5", + peachpuff: "ffdab9", + peru: "cd853f", + pink: "ffc0cb", + plum: "dda0dd", + powderblue: "b0e0e6", + purple: "800080", + red: "f00", + rosybrown: "bc8f8f", + royalblue: "4169e1", + saddlebrown: "8b4513", + salmon: "fa8072", + sandybrown: "f4a460", + seagreen: "2e8b57", + seashell: "fff5ee", + sienna: "a0522d", + silver: "c0c0c0", + skyblue: "87ceeb", + slateblue: "6a5acd", + slategray: "708090", + slategrey: "708090", + snow: "fffafa", + springgreen: "00ff7f", + steelblue: "4682b4", + tan: "d2b48c", + teal: "008080", + thistle: "d8bfd8", + tomato: "ff6347", + turquoise: "40e0d0", + violet: "ee82ee", + wheat: "f5deb3", + white: "fff", + whitesmoke: "f5f5f5", + yellow: "ff0", + yellowgreen: "9acd32" + }; + + // Make it easy to access colors via `hexNames[hex]` + var hexNames = tinycolor.hexNames = flip(names); + + + // Utilities + // --------- + + // `{ 'name1': 'val1' }` becomes `{ 'val1': 'name1' }` + function flip(o) { + var flipped = { }; + for (var i in o) { + if (o.hasOwnProperty(i)) { + flipped[o[i]] = i; + } + } + return flipped; + } + + // Return a valid alpha value [0,1] with all invalid values being set to 1 + function boundAlpha(a) { + a = parseFloat(a); + + if (isNaN(a) || a < 0 || a > 1) { + a = 1; + } + + return a; + } + + // Take input from [0, n] and return it as [0, 1] + function bound01(n, max) { + if (isOnePointZero(n)) { n = "100%"; } + + var processPercent = isPercentage(n); + n = mathMin(max, mathMax(0, parseFloat(n))); + + // Automatically convert percentage into number + if (processPercent) { + n = parseInt(n * max, 10) / 100; + } + + // Handle floating point rounding errors + if ((math.abs(n - max) < 0.000001)) { + return 1; + } + + // Convert into [0, 1] range if it isn't already + return (n % max) / parseFloat(max); + } + + // Force a number between 0 and 1 + function clamp01(val) { + return mathMin(1, mathMax(0, val)); + } + + // Parse a base-16 hex value into a base-10 integer + function parseIntFromHex(val) { + return parseInt(val, 16); + } + + // Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1 + // + function isOnePointZero(n) { + return typeof n == "string" && n.indexOf('.') != -1 && parseFloat(n) === 1; + } + + // Check to see if string passed in is a percentage + function isPercentage(n) { + return typeof n === "string" && n.indexOf('%') != -1; + } + + // Force a hex value to have 2 characters + function pad2(c) { + return c.length == 1 ? '0' + c : '' + c; + } + + // Replace a decimal with it's percentage value + function convertToPercentage(n) { + if (n <= 1) { + n = (n * 100) + "%"; + } + + return n; + } + + // Converts a decimal to a hex value + function convertDecimalToHex(d) { + return Math.round(parseFloat(d) * 255).toString(16); + } + // Converts a hex value to a decimal + function convertHexToDecimal(h) { + return (parseIntFromHex(h) / 255); + } + + var matchers = (function() { + + // + var CSS_INTEGER = "[-\\+]?\\d+%?"; + + // + var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?"; + + // Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome. + var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")"; + + // Actual matching. + // Parentheses and commas are optional, but not required. + // Whitespace can take the place of commas or opening paren + var PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?"; + var PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?"; + + return { + rgb: new RegExp("rgb" + PERMISSIVE_MATCH3), + rgba: new RegExp("rgba" + PERMISSIVE_MATCH4), + hsl: new RegExp("hsl" + PERMISSIVE_MATCH3), + hsla: new RegExp("hsla" + PERMISSIVE_MATCH4), + hsv: new RegExp("hsv" + PERMISSIVE_MATCH3), + hex3: /^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, + hex6: /^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/, + hex8: /^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/ + }; + })(); + + // `stringInputToObject` + // Permissive string parsing. Take in a number of formats, and output an object + // based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}` + function stringInputToObject(color) { + + color = color.replace(trimLeft,'').replace(trimRight, '').toLowerCase(); + var named = false; + if (names[color]) { + color = names[color]; + named = true; + } + else if (color == 'transparent') { + return { r: 0, g: 0, b: 0, a: 0, format: "name" }; + } + + // Try to match string input using regular expressions. + // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360] + // Just return an object and let the conversion functions handle that. + // This way the result will be the same whether the tinycolor is initialized with string or object. + var match; + if ((match = matchers.rgb.exec(color))) { + return { r: match[1], g: match[2], b: match[3] }; + } + if ((match = matchers.rgba.exec(color))) { + return { r: match[1], g: match[2], b: match[3], a: match[4] }; + } + if ((match = matchers.hsl.exec(color))) { + return { h: match[1], s: match[2], l: match[3] }; + } + if ((match = matchers.hsla.exec(color))) { + return { h: match[1], s: match[2], l: match[3], a: match[4] }; + } + if ((match = matchers.hsv.exec(color))) { + return { h: match[1], s: match[2], v: match[3] }; + } + if ((match = matchers.hex8.exec(color))) { + return { + a: convertHexToDecimal(match[1]), + r: parseIntFromHex(match[2]), + g: parseIntFromHex(match[3]), + b: parseIntFromHex(match[4]), + format: named ? "name" : "hex8" + }; + } + if ((match = matchers.hex6.exec(color))) { + return { + r: parseIntFromHex(match[1]), + g: parseIntFromHex(match[2]), + b: parseIntFromHex(match[3]), + format: named ? "name" : "hex" + }; + } + if ((match = matchers.hex3.exec(color))) { + return { + r: parseIntFromHex(match[1] + '' + match[1]), + g: parseIntFromHex(match[2] + '' + match[2]), + b: parseIntFromHex(match[3] + '' + match[3]), + format: named ? "name" : "hex" + }; + } + + return false; + } + + // Expose tinycolor to window, does not need to run in non-browser context. + window.tinycolor = tinycolor; + + })(); + + + $(function () { + if ($.fn.spectrum.load) { + $.fn.spectrum.processNativeColorInputs(); + } + }); + +})(window, jQuery); diff --git a/plugins/legacy-admin/framework/core/assets/js/vendor/spectrum/redux-spectrum.min.js b/plugins/legacy-admin/framework/core/assets/js/vendor/spectrum/redux-spectrum.min.js new file mode 100644 index 000000000..b3a3a6cda --- /dev/null +++ b/plugins/legacy-admin/framework/core/assets/js/vendor/spectrum/redux-spectrum.min.js @@ -0,0 +1 @@ +!function(a,b,c){function d(a,b,c,d){for(var e=[],f=0;f')}else{var l="sp-clear-display";e.push('')}}return"
    "+e.join("")+"
    "}function e(){for(var a=0;aMath.abs(b-e);sa=f?"x":"y"}}else sa=null;var g=!sa||"x"===sa,h=!sa||"y"===sa;g&&(ia=parseFloat(a/_)),h&&(ja=parseFloat((aa-b)/aa)),Va=!1,T.showAlpha||(ka=1),K()},A,B),Qa?(H(Qa),L(),Ta=Sa||tinycolor(Qa).format,w(Qa)):L(),U&&E();var d=q?"mousedown.spectrum":"click.spectrum touchstart.spectrum";Fa.delegate(".sp-thumb-el",d,a),Ga.delegate(".sp-thumb-el:nth-child(1)",d,{ignore:!0},a)}function v(){if(W&&a.localStorage){try{var c=a.localStorage[W].split(",#");c.length>1&&(delete a.localStorage[W],b.each(c,function(a,b){w(b)}))}catch(d){}try{oa=a.localStorage[W].split(";")}catch(d){}}}function w(c){if(V){var d=tinycolor(c).toRgbString();if(!na[d]&&-1===b.inArray(d,oa))for(oa.push(d);oa.length>pa;)oa.shift();if(W&&a.localStorage)try{a.localStorage[W]=oa.join(";")}catch(e){}}}function x(){var a=[];if(T.showPalette)for(i=0;i=aa||0>=_||0>=ca)&&O(),wa.addClass(qa),sa=null,ua.trigger("dragstart.spectrum",[I()])}function B(){wa.removeClass(qa),ua.trigger("dragstop.spectrum",[I()])}function C(){var a=Ea.val();if(null!==a&&""!==a||!Wa){var b=tinycolor(a);b.ok?(H(b),N(!0)):Ea.addClass("sp-validation-error")}else H(null),N(!0)}function D(){$?F():E()}function E(){var c=b.Event("beforeShow.spectrum");return $?void O():(ua.trigger(c,[I()]),void(Y.beforeShow(I())===!1||c.isDefaultPrevented()||(e(),$=!0,b(ta).bind("click.spectrum",F),b(a).bind("resize.spectrum",Z),Na.addClass("sp-active"),wa.removeClass("sp-hidden"),O(),L(),Ra=I(),z(),Y.show(Ra),ua.trigger("show.spectrum",[Ra]))))}function F(c){if((!c||"click"!=c.type||2!=c.button)&&$&&!U){$=!1,b(ta).unbind("click.spectrum",F),b(a).unbind("resize.spectrum",Z),Na.removeClass("sp-active"),wa.addClass("sp-hidden");var d=!tinycolor.equals(I(),Ra);d&&(Ua&&"cancel"!==c?N(!0):G()),Y.hide(I()),ua.trigger("hide.spectrum",[I()])}}function G(){H(Ra,!0)}function H(a,b){if(tinycolor.equals(a,I()))return void L();var c,d;!a&&Wa?Va=!0:(Va=!1,c=tinycolor(a),d=c.toHsv(),ha=d.h%360/360,ia=d.s,ja=d.v,ka=d.a),L(),c&&c.ok&&!b&&(Ta=Sa||c.format)}function I(a){return a=a||{},Wa&&Va?null:tinycolor.fromRatio({h:ha,s:ia,v:ja,a:Math.round(100*ka)/100},{format:a.format||Ta})}function J(){return!Ea.hasClass("sp-validation-error")}function K(){L(),Y.move(I()),ua.trigger("move.spectrum",[I()])}function L(){Ea.removeClass("sp-validation-error"),M();var a=tinycolor.fromRatio({h:ha,s:1,v:1});xa.css("background-color",a.toHexString());var b=Ta;1>ka&&(0!==ka||"name"!==b)&&("hex"===b||"hex3"===b||"hex6"===b||"name"===b)&&(b="rgb");var c=I({format:b}),d="";if(Pa.removeClass("sp-clear-display"),Pa.css("background-color","transparent"),!c&&Wa)Pa.addClass("sp-clear-display");else{var e=c.toHexString(),f=c.toRgbString();if(r||1===c.alpha?Pa.css("background-color",f):(Pa.css("background-color","transparent"),Pa.css("filter",c.toFilter())),T.showAlpha){var g=c.toRgb();g.a=0;var h=tinycolor(g).toRgbString(),i="linear-gradient(left, "+h+", "+e+")";q?Ba.css("filter",tinycolor(h).toFilter({gradientType:1},e)):(Ba.css("background","-webkit-"+i),Ba.css("background","-moz-"+i),Ba.css("background","-ms-"+i),Ba.css("background","linear-gradient(to right, "+h+", "+e+")"))}d=c.toString(b)}T.showInput&&Ea.val(d),T.showPalette&&y(),z()}function M(){var a=ia,b=ja;if(Wa&&Va)Da.hide(),Aa.hide(),ya.hide();else{Da.show(),Aa.show(),ya.show();var c=a*_,d=aa-b*aa;c=Math.max(-ba,Math.min(_-ba,c-ba)),d=Math.max(-ba,Math.min(aa-ba,d-ba)),ya.css({top:d+"px",left:c+"px"});var e=ka*ea;Da.css({left:e-fa/2+"px"});var f=ha*ca;Aa.css({top:f-ga+"px"})}}function N(a){var b=I(),c="",d=!tinycolor.equals(b,Ra);b&&(c=b.toString(Ta),w(b)),Ka&&ua.val(c),Ra=b,a&&d&&(Y.change(b),ua.trigger("change",[b]))}function O(){_=xa.width(),aa=xa.height(),ba=ya.height(),da=za.width(),ca=za.height(),ga=Aa.height(),ea=Ca.width(),fa=Da.width(),U||(wa.css("position","absolute"),wa.offset(h(wa,Oa))),M(),T.showPalette&&y(),ua.trigger("reflow.spectrum")}function P(){ua.show(),Oa.unbind("click.spectrum touchstart.spectrum"),wa.remove(),Na.remove(),p[Ya.id]=null}function Q(a,d){return a===c?b.extend({},T):d===c?T[a]:(T[a]=d,void l())}function R(){va=!1,ua.attr("disabled",!1),Oa.removeClass("sp-disabled")}function S(){F(),va=!0,ua.attr("disabled",!0),Oa.addClass("sp-disabled")}var T=f(j,g),U=T.flat,V=T.showSelectionPalette,W=T.localStorageKey,X=T.theme,Y=T.callbacks,Z=n(O,10),$=!1,_=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=1,la=[],ma=[],na={},oa=T.selectionPalette.slice(0),pa=T.maxSelectionSize,qa="sp-dragging",ra=T.inputText,sa=null,ta=g.ownerDocument,ua=(ta.body,b(g)),va=!1,wa=b(u,ta).addClass(X),xa=wa.find(".sp-color"),ya=wa.find(".sp-dragger"),za=wa.find(".sp-hue"),Aa=wa.find(".sp-slider"),Ba=wa.find(".sp-alpha-inner"),Ca=wa.find(".sp-alpha"),Da=wa.find(".sp-alpha-handle"),Ea=wa.find(".sp-input"),Fa=wa.find(".sp-palette"),Ga=wa.find(".sp-initial"),Ha=wa.find(".sp-cancel"),Ia=wa.find(".sp-clear"),Ja=wa.find(".sp-choose"),Ka=ua.is("input"),La=Ka&&s&&"color"===ua.attr("type"),Ma=Ka&&!U,Na=Ma?b(t).addClass(X).addClass(T.className).addClass(T.replacerClassName):b([]),Oa=Ma?Na:ua,Pa=Na.find(".sp-preview-inner"),Qa=T.color||Ka&&ua.val(),Ra=!1,Sa=T.preferredFormat,Ta=Sa,Ua=!T.showButtons||T.clickoutFiresChange,Va=!Qa,Wa=T.allowEmpty&&!La;if(""!==ra){var Xa=b(Oa).find("div.sp-dd");Xa.text(ra)}o();var Ya={show:E,hide:F,toggle:D,reflow:O,option:Q,enable:R,disable:S,set:function(a){H(a),N()},get:I,destroy:P,container:wa};return Ya.id=p.push(Ya)-1,Ya}function h(a,c){var d=0,e=a.outerWidth(),f=a.outerHeight(),g=c.outerHeight(),h=a[0].ownerDocument,i=h.documentElement,j=i.clientWidth+b(h).scrollLeft(),k=i.clientHeight+b(h).scrollTop(),l=c.offset();return l.top+=g,l.left-=Math.min(l.left,l.left+e>j&&j>e?Math.abs(l.left+e-j):0),l.top-=Math.min(l.top,l.top+f>k&&k>f?Math.abs(f+g-d):d),l}function j(){}function k(a){a.stopPropagation()}function l(a,b){var c=Array.prototype.slice,d=c.call(arguments,2);return function(){return a.apply(b,d.concat(c.call(arguments)))}}function m(c,d,e,f){function g(a){a.stopPropagation&&a.stopPropagation(),a.preventDefault&&a.preventDefault(),a.returnValue=!1}function h(a){if(l){if(q&&document.documentMode<9&&!a.button)return j();var b=a.originalEvent.touches,e=b?b[0].pageX:a.pageX,f=b?b[0].pageY:a.pageY,h=Math.max(0,Math.min(e-m.left,o)),i=Math.max(0,Math.min(f-m.top,n));p&&g(a),d.apply(c,[h,i,a])}}function i(a){{var d=a.which?3==a.which:2==a.button;a.originalEvent.touches}d||l||e.apply(c,arguments)!==!1&&(l=!0,n=b(c).height(),o=b(c).width(),m=b(c).offset(),b(k).bind(r),b(k.body).addClass("sp-dragging"),p||h(a),g(a))}function j(){l&&(b(k).unbind(r),b(k.body).removeClass("sp-dragging"),f.apply(c,arguments)),l=!1}d=d||function(){},e=e||function(){},f=f||function(){};var k=c.ownerDocument||document,l=!1,m={},n=0,o=0,p="ontouchstart"in a,r={};r.selectstart=g,r.dragstart=g,r["touchmove mousemove"]=h,r["touchend mouseup"]=j,b(c).bind("touchstart mousedown",i)}function n(a,b,c){var d;return function(){var e=this,f=arguments,g=function(){d=null,a.apply(e,f)};c&&clearTimeout(d),(c||!d)&&(d=setTimeout(g,b))}}var o={beforeShow:j,move:j,change:j,show:j,hide:j,color:!1,flat:!1,showInput:!1,allowEmpty:!1,showButtons:!0,clickoutFiresChange:!1,showInitial:!1,showPalette:!1,showPaletteOnly:!1,showSelectionPalette:!0,localStorageKey:!1,appendTo:"body",maxSelectionSize:7,cancelText:"cancel",chooseText:"choose",clearText:"Clear Color Selection",preferredFormat:!1,className:"",containerClassName:"",replacerClassName:"",showAlpha:!1,theme:"sp-light",palette:[["#ffffff","#000000","#ff0000","#ff8000","#ffff00","#008000","#0000ff","#4b0082","#9400d3"]],selectionPalette:[],disabled:!1,inputText:""},p=[],q=!!/msie/i.exec(a.navigator.userAgent),r=function(){function a(a,b){return!!~(""+a).indexOf(b)}var b=document.createElement("div"),c=b.style;return c.cssText="background-color:rgba(0,0,0,.5)",a(c.backgroundColor,"rgba")||a(c.backgroundColor,"hsla")}(),s=function(){var a=b("")[0];return"color"===a.type&&"!"!==a.value}(),t=["
    ","
    ","
    ","
    "].join(""),u=function(){var a="";if(q)for(var b=1;6>=b;b++)a+="
    ";return["
    ","
    ","
    ","
    ","
    ","
    ","
    ","
    ","
    ","
    ","
    ","
    ","
    ","
    ","
    ","
    ","
    ","
    ","
    ",a,"
    ","
    ","
    ","
    ","
    ","","
    ","
    ","
    ","","","
    ","
    ","
    "].join("")}(),v="spectrum.id";b.fn.spectrum=function(a){if("string"==typeof a){var c=this,d=Array.prototype.slice.call(arguments,1);return this.each(function(){var e=p[b(this).data(v)];if(e){var f=e[a];if(!f)throw new Error("Spectrum: no such method: '"+a+"'");"get"==a?c=e.get():"container"==a?c=e.container:"option"==a?c=e.option.apply(e,d):"destroy"==a?(e.destroy(),b(this).removeData(v)):f.apply(e,d)}}),c}return this.spectrum("destroy").each(function(){var c=b.extend({},a,b(this).data()),d=g(this,c);b(this).data(v,d.id)})},b.fn.spectrum.load=!0,b.fn.spectrum.loadOpts={},b.fn.spectrum.draggable=m,b.fn.spectrum.defaults=o,b.spectrum={},b.spectrum.localization={},b.spectrum.palettes={},b.fn.spectrum.processNativeColorInputs=function(){s||b("input[type=color]").spectrum({preferredFormat:"hex6"})},function(){function b(a,d){if(a=a?a:"",d=d||{},"object"==typeof a&&a.hasOwnProperty("_tc_id"))return a;var f=c(a),h=f.r,k=f.g,n=f.b,o=f.a,p=A(100*o)/100,q=d.format||f.format;return 1>h&&(h=A(h)),1>k&&(k=A(k)),1>n&&(n=A(n)),{ok:f.ok,format:q,_tc_id:y++,alpha:o,getAlpha:function(){return o},setAlpha:function(a){o=l(a),p=A(100*o)/100},toHsv:function(){var a=g(h,k,n);return{h:360*a.h,s:a.s,v:a.v,a:o}},toHsvString:function(){var a=g(h,k,n),b=A(360*a.h),c=A(100*a.s),d=A(100*a.v);return 1==o?"hsv("+b+", "+c+"%, "+d+"%)":"hsva("+b+", "+c+"%, "+d+"%, "+p+")"},toHsl:function(){var a=e(h,k,n);return{h:360*a.h,s:a.s,l:a.l,a:o}},toHslString:function(){var a=e(h,k,n),b=A(360*a.h),c=A(100*a.s),d=A(100*a.l);return 1==o?"hsl("+b+", "+c+"%, "+d+"%)":"hsla("+b+", "+c+"%, "+d+"%, "+p+")"},toHex:function(a){return i(h,k,n,a)},toHexString:function(a){return"#"+this.toHex(a)},toHex8:function(){return j(h,k,n,o)},toHex8String:function(){return"#"+this.toHex8()},toRgb:function(){return{r:A(h),g:A(k),b:A(n),a:o}},toRgbString:function(){return 1==o?"rgb("+A(h)+", "+A(k)+", "+A(n)+")":"rgba("+A(h)+", "+A(k)+", "+A(n)+", "+p+")"},toPercentageRgb:function(){return{r:A(100*m(h,255))+"%",g:A(100*m(k,255))+"%",b:A(100*m(n,255))+"%",a:o}},toPercentageRgbString:function(){return 1==o?"rgb("+A(100*m(h,255))+"%, "+A(100*m(k,255))+"%, "+A(100*m(n,255))+"%)":"rgba("+A(100*m(h,255))+"%, "+A(100*m(k,255))+"%, "+A(100*m(n,255))+"%, "+p+")"},toName:function(){return 0===o?"transparent":F[i(h,k,n,!0)]||!1},toFilter:function(a){var c="#"+j(h,k,n,o),e=c,f=d&&d.gradientType?"GradientType = 1, ":"";if(a){var g=b(a);e=g.toHex8String()}return"progid:DXImageTransform.Microsoft.gradient("+f+"startColorstr="+c+",endColorstr="+e+")"},toString:function(a){var b=!!a;a=a||this.format;var c=!1,d=!b&&1>o&&o>0,e=d&&("hex"===a||"hex6"===a||"hex3"===a||"name"===a);return"rgb"===a&&(c=this.toRgbString()),"prgb"===a&&(c=this.toPercentageRgbString()),("hex"===a||"hex6"===a)&&(c=this.toHexString()),"hex3"===a&&(c=this.toHexString(!0)),"hex8"===a&&(c=this.toHex8String()),"name"===a&&(c=this.toName()),"hsl"===a&&(c=this.toHslString()),"hsv"===a&&(c=this.toHsvString()),e?this.toRgbString():c||this.toHexString()}}}function c(a){var b={r:0,g:0,b:0},c=1,e=!1,g=!1;return"string"==typeof a&&(a=v(a)),"object"==typeof a&&(a.hasOwnProperty("r")&&a.hasOwnProperty("g")&&a.hasOwnProperty("b")?(b=d(a.r,a.g,a.b),e=!0,g="%"===String(a.r).substr(-1)?"prgb":"rgb"):a.hasOwnProperty("h")&&a.hasOwnProperty("s")&&a.hasOwnProperty("v")?(a.s=s(a.s),a.v=s(a.v),b=h(a.h,a.s,a.v),e=!0,g="hsv"):a.hasOwnProperty("h")&&a.hasOwnProperty("s")&&a.hasOwnProperty("l")&&(a.s=s(a.s),a.l=s(a.l),b=f(a.h,a.s,a.l),e=!0,g="hsl"),a.hasOwnProperty("a")&&(c=a.a)),c=l(c),{ok:e,format:a.format||g,r:B(255,C(b.r,0)),g:B(255,C(b.g,0)),b:B(255,C(b.b,0)),a:c}}function d(a,b,c){return{r:255*m(a,255),g:255*m(b,255),b:255*m(c,255)}}function e(a,b,c){a=m(a,255),b=m(b,255),c=m(c,255);var d,e,f=C(a,b,c),g=B(a,b,c),h=(f+g)/2;if(f==g)d=e=0;else{var i=f-g;switch(e=h>.5?i/(2-f-g):i/(f+g),f){case a:d=(b-c)/i+(c>b?6:0);break;case b:d=(c-a)/i+2;break;case c:d=(a-b)/i+4}d/=6}return{h:d,s:e,l:h}}function f(a,b,c){function d(a,b,c){return 0>c&&(c+=1),c>1&&(c-=1),1/6>c?a+6*(b-a)*c:.5>c?b:2/3>c?a+(b-a)*(2/3-c)*6:a}var e,f,g;if(a=m(a,360),b=m(b,100),c=m(c,100),0===b)e=f=g=c;else{var h=.5>c?c*(1+b):c+b-c*b,i=2*c-h;e=d(i,h,a+1/3),f=d(i,h,a),g=d(i,h,a-1/3)}return{r:255*e,g:255*f,b:255*g}}function g(a,b,c){a=m(a,255),b=m(b,255),c=m(c,255);var d,e,f=C(a,b,c),g=B(a,b,c),h=f,i=f-g;if(e=0===f?0:i/f,f==g)d=0;else{switch(f){case a:d=(b-c)/i+(c>b?6:0);break;case b:d=(c-a)/i+2;break;case c:d=(a-b)/i+4}d/=6}return{h:d,s:e,v:h}}function h(a,b,c){a=6*m(a,360),b=m(b,100),c=m(c,100);var d=z.floor(a),e=a-d,f=c*(1-b),g=c*(1-e*b),h=c*(1-(1-e)*b),i=d%6,j=[c,g,f,f,h,c][i],k=[h,c,c,g,f,f][i],l=[f,f,h,c,c,g][i];return{r:255*j,g:255*k,b:255*l}}function i(a,b,c,d){var e=[r(A(a).toString(16)),r(A(b).toString(16)),r(A(c).toString(16))];return d&&e[0].charAt(0)==e[0].charAt(1)&&e[1].charAt(0)==e[1].charAt(1)&&e[2].charAt(0)==e[2].charAt(1)?e[0].charAt(0)+e[1].charAt(0)+e[2].charAt(0):e.join("")}function j(a,b,c,d){var e=[r(t(d)),r(A(a).toString(16)),r(A(b).toString(16)),r(A(c).toString(16))];return e.join("")}function k(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[a[c]]=c);return b}function l(a){return a=parseFloat(a),(isNaN(a)||0>a||a>1)&&(a=1),a}function m(a,b){p(a)&&(a="100%");var c=q(a);return a=B(b,C(0,parseFloat(a))),c&&(a=parseInt(a*b,10)/100),z.abs(a-b)<1e-6?1:a%b/parseFloat(b)}function n(a){return B(1,C(0,a))}function o(a){return parseInt(a,16)}function p(a){return"string"==typeof a&&-1!=a.indexOf(".")&&1===parseFloat(a)}function q(a){return"string"==typeof a&&-1!=a.indexOf("%")}function r(a){return 1==a.length?"0"+a:""+a}function s(a){return 1>=a&&(a=100*a+"%"),a}function t(a){return Math.round(255*parseFloat(a)).toString(16)}function u(a){return o(a)/255}function v(a){a=a.replace(w,"").replace(x,"").toLowerCase();var b=!1;if(E[a])a=E[a],b=!0;else if("transparent"==a)return{r:0,g:0,b:0,a:0,format:"name"};var c;return(c=G.rgb.exec(a))?{r:c[1],g:c[2],b:c[3]}:(c=G.rgba.exec(a))?{r:c[1],g:c[2],b:c[3],a:c[4]}:(c=G.hsl.exec(a))?{h:c[1],s:c[2],l:c[3]}:(c=G.hsla.exec(a))?{h:c[1],s:c[2],l:c[3],a:c[4]}:(c=G.hsv.exec(a))?{h:c[1],s:c[2],v:c[3]}:(c=G.hex8.exec(a))?{a:u(c[1]),r:o(c[2]),g:o(c[3]),b:o(c[4]),format:b?"name":"hex8"}:(c=G.hex6.exec(a))?{r:o(c[1]),g:o(c[2]),b:o(c[3]),format:b?"name":"hex"}:(c=G.hex3.exec(a))?{r:o(c[1]+""+c[1]),g:o(c[2]+""+c[2]),b:o(c[3]+""+c[3]),format:b?"name":"hex"}:!1}var w=/^[\s,#]+/,x=/\s+$/,y=0,z=Math,A=z.round,B=z.min,C=z.max,D=z.random;b.fromRatio=function(a,c){if("object"==typeof a){var d={};for(var e in a)a.hasOwnProperty(e)&&(d[e]="a"===e?a[e]:s(a[e]));a=d}return b(a,c)},b.equals=function(a,c){return a&&c?b(a).toRgbString()==b(c).toRgbString():!1},b.random=function(){return b.fromRatio({r:D(),g:D(),b:D()})},b.desaturate=function(a,c){c=0===c?0:c||10;var d=b(a).toHsl();return d.s-=c/100,d.s=n(d.s),b(d)},b.saturate=function(a,c){c=0===c?0:c||10;var d=b(a).toHsl();return d.s+=c/100,d.s=n(d.s),b(d)},b.greyscale=function(a){return b.desaturate(a,100)},b.lighten=function(a,c){c=0===c?0:c||10;var d=b(a).toHsl();return d.l+=c/100,d.l=n(d.l),b(d)},b.darken=function(a,c){c=0===c?0:c||10;var d=b(a).toHsl();return d.l-=c/100,d.l=n(d.l),b(d)},b.complement=function(a){var c=b(a).toHsl();return c.h=(c.h+180)%360,b(c)},b.triad=function(a){var c=b(a).toHsl(),d=c.h;return[b(a),b({h:(d+120)%360,s:c.s,l:c.l}),b({h:(d+240)%360,s:c.s,l:c.l})]},b.tetrad=function(a){var c=b(a).toHsl(),d=c.h;return[b(a),b({h:(d+90)%360,s:c.s,l:c.l}),b({h:(d+180)%360,s:c.s,l:c.l}),b({h:(d+270)%360,s:c.s,l:c.l})]},b.splitcomplement=function(a){var c=b(a).toHsl(),d=c.h;return[b(a),b({h:(d+72)%360,s:c.s,l:c.l}),b({h:(d+216)%360,s:c.s,l:c.l})]},b.analogous=function(a,c,d){c=c||6,d=d||30;var e=b(a).toHsl(),f=360/d,g=[b(a)];for(e.h=(e.h-(f*c>>1)+720)%360;--c;)e.h=(e.h+f)%360,g.push(b(e));return g},b.monochromatic=function(a,c){c=c||6;for(var d=b(a).toHsv(),e=d.h,f=d.s,g=d.v,h=[],i=1/c;c--;)h.push(b({h:e,s:f,v:g})),g=(g+i)%1;return h},b.readability=function(a,c){var d=b(a).toRgb(),e=b(c).toRgb(),f=(299*d.r+587*d.g+114*d.b)/1e3,g=(299*e.r+587*e.g+114*e.b)/1e3,h=Math.max(d.r,e.r)-Math.min(d.r,e.r)+Math.max(d.g,e.g)-Math.min(d.g,e.g)+Math.max(d.b,e.b)-Math.min(d.b,e.b);return{brightness:Math.abs(f-g),color:h}},b.readable=function(a,c){var d=b.readability(a,c);return d.brightness>125&&d.color>500},b.mostReadable=function(a,c){for(var d=null,e=0,f=!1,g=0;g125&&h.color>500,j=3*(h.brightness/125)+h.color/500;(i&&!f||i&&f&&j>e||!i&&!f&&j>e)&&(f=i,e=j,d=b(c[g]))}return d};var E=b.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},F=b.hexNames=k(E),G=function(){var a="[-\\+]?\\d+%?",b="[-\\+]?\\d*\\.\\d+%?",c="(?:"+b+")|(?:"+a+")",d="[\\s|\\(]+("+c+")[,|\\s]+("+c+")[,|\\s]+("+c+")\\s*\\)?",e="[\\s|\\(]+("+c+")[,|\\s]+("+c+")[,|\\s]+("+c+")[,|\\s]+("+c+")\\s*\\)?";return{rgb:new RegExp("rgb"+d),rgba:new RegExp("rgba"+e),hsl:new RegExp("hsl"+d),hsla:new RegExp("hsla"+e),hsv:new RegExp("hsv"+d),hex3:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex8:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();a.tinycolor=b}(),b(function(){b.fn.spectrum.load&&b.fn.spectrum.processNativeColorInputs()})}(window,jQuery); \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/core/dashboard.php b/plugins/legacy-admin/framework/core/core/dashboard.php new file mode 100644 index 000000000..0b4c5fc75 --- /dev/null +++ b/plugins/legacy-admin/framework/core/core/dashboard.php @@ -0,0 +1,32 @@ +'; + wp_widget_rss_output(array( + 'url' => 'http://reduxframework.com/feed/', + 'title' => 'REDUX_NEWS', + 'items' => 3, + 'show_summary' => 1, + 'show_author' => 0, + 'show_date' => 1 + )); + echo '
    '; + } + } + + new reduxDashboardWidget(); + } \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/core/enqueue.php b/plugins/legacy-admin/framework/core/core/enqueue.php new file mode 100644 index 000000000..6d1e7fe9b --- /dev/null +++ b/plugins/legacy-admin/framework/core/core/enqueue.php @@ -0,0 +1,456 @@ +parent = $parent; + + Redux_Functions::$_parent = $parent; + } + + public function init() { + $this->min = Redux_Functions::isMin(); + + $this->timestamp = ReduxFramework::$_version; + if ( $this->parent->args['dev_mode'] ) { + $this->timestamp .= '.' . time(); + } + + $this->register_styles(); + $this->register_scripts(); + + add_thickbox(); + + $this->enqueue_fields(); + + $this->set_localized_data(); + + /** + * action 'redux-enqueue-{opt_name}' + * + * @deprecated + * + * @param object $this ReduxFramework + */ + do_action( "redux-enqueue-{$this->parent->args['opt_name']}", $this->parent ); // REMOVE + + /** + * action 'redux/page/{opt_name}/enqueue' + */ + do_action( "redux/page/{$this->parent->args['opt_name']}/enqueue" ); + } + + private function register_styles() { + + //***************************************************************** + // Redux Admin CSS + //***************************************************************** + wp_enqueue_style( + 'redux-admin-css', + ReduxFramework::$_url . 'assets/css/redux-admin.css', + array(), + $this->timestamp, + 'all' + ); + + //***************************************************************** + // Redux Fields CSS + //***************************************************************** + if ( ! $this->parent->args['dev_mode'] ) { + wp_enqueue_style( + 'redux-fields-css', + ReduxFramework::$_url . 'assets/css/redux-fields.css', + array(), + $this->timestamp, + 'all' + ); + } + + //***************************************************************** + // Select2 CSS + //***************************************************************** + wp_register_style( + 'select2-css', + ReduxFramework::$_url . 'assets/js/vendor/select2/select2.css', + array(), + $this->timestamp, + 'all' + ); + + //***************************************************************** + // Spectrum CSS + //***************************************************************** + wp_register_style( + 'redux-spectrum-css', + ReduxFramework::$_url . 'assets/css/vendor/spectrum/redux-spectrum.css', + array(), + $this->timestamp, + 'all' + ); + + //***************************************************************** + // Elusive Icon CSS + //***************************************************************** + wp_enqueue_style( + 'redux-elusive-icon', + ReduxFramework::$_url . 'assets/css/vendor/elusive-icons/elusive-icons.css', + array(), + $this->timestamp, + 'all' + ); + + //***************************************************************** + // QTip CSS + //***************************************************************** + wp_enqueue_style( + 'qtip-css', + ReduxFramework::$_url . 'assets/css/vendor/qtip/jquery.qtip.css', + array(), + $this->timestamp, + 'all' + ); + + //***************************************************************** + // JQuery UI CSS + //***************************************************************** + wp_enqueue_style( + 'jquery-ui-css', + apply_filters( "redux/page/{$this->parent->args['opt_name']}/enqueue/jquery-ui-css", ReduxFramework::$_url . 'assets/css/vendor/jquery-ui-bootstrap/jquery-ui-1.10.0.custom.css' ), + array(), + $this->timestamp, + 'all' + ); + + //***************************************************************** + // Iris CSS + //***************************************************************** + wp_enqueue_style( 'wp-color-picker' ); + + if ( $this->parent->args['dev_mode'] ) { + + //***************************************************************** + // Color Picker CSS + //***************************************************************** + wp_register_style( + 'redux-color-picker-css', + ReduxFramework::$_url . 'assets/css/color-picker/color-picker.css', + array( 'wp-color-picker' ), + $this->timestamp, + 'all' + ); + + //***************************************************************** + // Media CSS + //***************************************************************** + wp_enqueue_style( + 'redux-field-media-css', + ReduxFramework::$_url . 'assets/css/media/media.css', + array(), + time(), + 'all' + ); + } + + //***************************************************************** + // RTL CSS + //***************************************************************** + if ( is_rtl() ) { + wp_enqueue_style( + 'redux-rtl-css', + ReduxFramework::$_url . 'assets/css/rtl.css', + array( 'redux-admin-css' ), + $this->timestamp, + 'all' + ); + } + + } + + private function register_scripts() { + //***************************************************************** + // JQuery / JQuery UI JS + //***************************************************************** + wp_enqueue_script( 'jquery' ); + wp_enqueue_script( 'jquery-ui-core' ); + wp_enqueue_script( 'jquery-ui-dialog' ); + + //***************************************************************** + // Select2 Sortable JS + //***************************************************************** + wp_register_script( + 'redux-select2-sortable-js', + ReduxFramework::$_url . 'assets/js/vendor/redux.select2.sortable' . $this->min . '.js', + array( 'jquery' ), + $this->timestamp, + true + ); + + //***************************************************************** + // Select2 JS + //***************************************************************** + wp_register_script( + 'select2-js', + ReduxFramework::$_url . 'assets/js/vendor/select2/select2.js', + array( 'jquery', 'redux-select2-sortable-js' ), + $this->timestamp, + true + ); + + $depArray = array( 'jquery' ); + + //***************************************************************** + // Vendor JS + //***************************************************************** + if ( $this->parent->args['dev_mode'] ) { + wp_register_script( + 'redux-vendor', + ReduxFramework::$_url . 'assets/js/vendor.min.js', + array( 'jquery' ), + $this->timestamp, + true + ); + + array_push( $depArray, 'redux-vendor' ); + } + + //***************************************************************** + // Redux JS + //***************************************************************** + wp_register_script( + 'redux-js', + ReduxFramework::$_url . 'assets/js/redux' . $this->min . '.js', + $depArray, + $this->timestamp, + true + ); + + wp_enqueue_script( + 'webfontloader', + 'https://ajax.googleapis.com/ajax/libs/webfont/1.5.0/webfont.js', + array( 'jquery' ), + '1.5.0', + true + ); + } + + private function enqueue_fields() { + foreach ( $this->parent->sections as $section ) { + if ( isset( $section['fields'] ) ) { + foreach ( $section['fields'] as $field ) { + // TODO AFTER GROUP WORKS - Revert IF below + // if( isset( $field['type'] ) && $field['type'] != 'callback' ) { + if ( isset( $field['type'] ) && $field['type'] != 'callback' ) { + + $field_class = 'ReduxFramework_' . $field['type']; + + /** + * Field class file + * filter 'redux/{opt_name}/field/class/{field.type} + * + * @param string field class file path + * @param array $field field config data + */ + $class_file = apply_filters( "redux/{$this->parent->args['opt_name']}/field/class/{$field['type']}", ReduxFramework::$_dir . "inc/fields/{$field['type']}/field_{$field['type']}.php", $field ); + if ( $class_file ) { + if ( ! class_exists( $field_class ) ) { + if ( file_exists( $class_file ) ) { + require_once( $class_file ); + } + } + + if ( ( method_exists( $field_class, 'enqueue' ) ) || method_exists( $field_class, 'localize' ) ) { + + if ( ! isset( $this->parent->options[ $field['id'] ] ) ) { + $this->parent->options[ $field['id'] ] = ""; + } + $theField = new $field_class( $field, $this->parent->options[ $field['id'] ], $this->parent ); + + // Move dev_mode check to a new if/then block + if ( ! wp_script_is( 'redux-field-' . $field['type'] . '-js', 'enqueued' ) && class_exists( $field_class ) && method_exists( $field_class, 'enqueue' ) ) { + $theField->enqueue(); + } + + if ( method_exists( $field_class, 'localize' ) ) { + $params = $theField->localize( $field ); + if ( ! isset( $this->parent->localize_data[ $field['type'] ] ) ) { + $this->parent->localize_data[ $field['type'] ] = array(); + } + $this->parent->localize_data[ $field['type'] ][ $field['id'] ] = $theField->localize( $field ); + } + + unset( $theField ); + } + } + } + } + } + } + } + + public function get_warnings_and_errors_array() { + // Construct the errors array. + if ( isset( $this->parent->transients['last_save_mode'] ) && ! empty( $this->parent->transients['notices']['errors'] ) ) { + $theTotal = 0; + $theErrors = array(); + + foreach ( $this->parent->transients['notices']['errors'] as $error ) { + $theErrors[ $error['section_id'] ]['errors'][] = $error; + + if ( ! isset( $theErrors[ $error['section_id'] ]['total'] ) ) { + $theErrors[ $error['section_id'] ]['total'] = 0; + } + + $theErrors[ $error['section_id'] ]['total'] ++; + $theTotal ++; + } + + $this->parent->localize_data['errors'] = array( 'total' => $theTotal, 'errors' => $theErrors ); + unset( $this->parent->transients['notices']['errors'] ); + } + + // Construct the warnings array. + if ( isset( $this->parent->transients['last_save_mode'] ) && ! empty( $this->parent->transients['notices']['warnings'] ) ) { + $theTotal = 0; + $theWarnings = array(); + + foreach ( $this->parent->transients['notices']['warnings'] as $warning ) { + $theWarnings[ $warning['section_id'] ]['warnings'][] = $warning; + + if ( ! isset( $theWarnings[ $warning['section_id'] ]['total'] ) ) { + $theWarnings[ $warning['section_id'] ]['total'] = 0; + } + + $theWarnings[ $warning['section_id'] ]['total'] ++; + $theTotal ++; + } + + unset( $this->parent->transients['notices']['warnings'] ); + $this->parent->localize_data['warnings'] = array( + 'total' => $theTotal, + 'warnings' => $theWarnings + ); + } + + if ( empty( $this->parent->transients['notices'] ) ) { + unset( $this->parent->transients['notices'] ); + } + } + + private function set_localized_data() { + $this->parent->localize_data['required'] = $this->parent->required; + $this->parent->localize_data['fonts'] = $this->parent->fonts; + $this->parent->localize_data['required_child'] = $this->parent->required_child; + $this->parent->localize_data['fields'] = $this->parent->fields; + + if ( isset( $this->parent->font_groups['google'] ) ) { + $this->parent->localize_data['googlefonts'] = $this->parent->font_groups['google']; + } + + if ( isset( $this->parent->font_groups['std'] ) ) { + $this->parent->localize_data['stdfonts'] = $this->parent->font_groups['std']; + } + + if ( isset( $this->parent->font_groups['customfonts'] ) ) { + $this->parent->localize_data['customfonts'] = $this->parent->font_groups['customfonts']; + } + + $this->parent->localize_data['folds'] = $this->parent->folds; + + // Make sure the children are all hidden properly. + foreach ( $this->parent->fields as $key => $value ) { + if ( in_array( $key, $this->parent->fieldsHidden ) ) { + foreach ( $value as $k => $v ) { + if ( ! in_array( $k, $this->parent->fieldsHidden ) ) { + $this->parent->fieldsHidden[] = $k; + $this->parent->folds[ $k ] = "hide"; + } + } + } + } + + if ( isset( $this->parent->args['dev_mode'] ) && $this->parent->args['dev_mode'] == true ) { + $nonce = wp_create_nonce( 'redux-ads-nonce' ); + $base = admin_url( 'admin-ajax.php' ) . '?action=redux_p&nonce=' . $nonce . '&url='; + $url = $base . urlencode( 'http://ads.reduxframework.com/api/index.php?js&g&1&v=2' ) . '&proxy=' . urlencode( $base ) . ''; + $this->parent->localize_data['rAds'] = ''; + } + + $this->parent->localize_data['fieldsHidden'] = $this->parent->fieldsHidden; + $this->parent->localize_data['options'] = $this->parent->options; + $this->parent->localize_data['defaults'] = $this->parent->options_defaults; + + /** + * Save pending string + * filter 'redux/{opt_name}/localize/save_pending + * + * @param string save_pending string + */ + $save_pending = apply_filters( "redux/{$this->parent->args['opt_name']}/localize/save_pending", __( 'You have changes that are not saved. Would you like to save them now?', 'legacy_framework' ) ); + + /** + * Reset all string + * filter 'redux/{opt_name}/localize/reset + * + * @param string reset all string + */ + $reset_all = apply_filters( "redux/{$this->parent->args['opt_name']}/localize/reset", __( 'Are you sure? Resetting will lose all custom values.', 'legacy_framework' ) ); + + /** + * Reset section string + * filter 'redux/{opt_name}/localize/reset_section + * + * @param string reset section string + */ + $reset_section = apply_filters( "redux/{$this->parent->args['opt_name']}/localize/reset_section", __( 'Are you sure? Resetting will lose all custom values in this section.', 'legacy_framework' ) ); + + /** + * Preset confirm string + * filter 'redux/{opt_name}/localize/preset + * + * @param string preset confirm string + */ + $preset_confirm = apply_filters( "redux/{$this->parent->args['opt_name']}/localize/preset", __( 'Your current options will be replaced with the values of this preset. Would you like to proceed?', 'legacy_framework' ) ); + global $pagenow; + $this->parent->localize_data['args'] = array( + 'save_pending' => $save_pending, + 'reset_confirm' => $reset_all, + 'reset_section_confirm' => $reset_section, + 'preset_confirm' => $preset_confirm, + 'please_wait' => __( 'Please Wait', 'legacy_framework' ), + 'opt_name' => $this->parent->args['opt_name'], + 'slug' => $this->parent->args['page_slug'], + 'hints' => $this->parent->args['hints'], + 'disable_save_warn' => $this->parent->args['disable_save_warn'], + 'class' => $this->parent->args['class'], + 'ajax_save' => $this->parent->args['ajax_save'], + 'menu_search' => $pagenow . '?page=' . $this->parent->args['page_slug'] . "&tab=" + ); + + $this->parent->localize_data['ajax'] = array( + 'console' => __( 'There was an error saving. Here is the result of your action:', 'legacy_framework' ), + 'alert' => __( 'There was a problem with your action. Please try again or reload the page.', 'legacy_framework' ), + ); + + + $this->get_warnings_and_errors_array(); + + wp_localize_script( + 'redux-js', + 'redux', + $this->parent->localize_data + ); + + wp_enqueue_script( 'redux-js' ); // Enque the JS now + + } + } + } \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/core/newsflash.php b/plugins/legacy-admin/framework/core/core/newsflash.php new file mode 100644 index 000000000..e435ce6e3 --- /dev/null +++ b/plugins/legacy-admin/framework/core/core/newsflash.php @@ -0,0 +1,131 @@ +parent = $parent; + + extract($params); + $this->server_file = $server_file; + $this->interval = isset($interval) ? $interval: 3; + $this->cookie_id = isset($cookie_id) ? $cookie_id : $parent->args['opt_name'] . '_blast'; + + // set notice file location + $notice_dir = ReduxFramework::$_upload_dir . $dir_name;// 'notice'; + $this->notice_json = $notice_dir . '/notice.json'; + + // verify notice dir exists + if (!is_dir ( $notice_dir )) { + + // create notice dir + $parent->filesystem->execute('mkdir', $notice_dir); + } + + // if notice file does not exists + if (!file_exists($this->notice_json)) { + + // get notice data from server and create cache file + $this->get_notice_json(); + } else { + + // check expiry time + if ( ! isset( $_COOKIE[$this->cookie_id] ) ) { + + // expired! get notice data from server + $this->get_notice_json(); + } + } + + // set the admin notice msg + $this->display_message(); + } + + private function get_notice_json() { + + // filesystem object + $filesystem = $this->parent->filesystem; + + // get notice data from server + $data = $filesystem->execute('get_contents', $this->server_file);// 'http://www.reduxframework.com/' . 'wp-content/uploads/redux/redux_notice.json'); + + // if some data exists + if ($data != '' || !empty($data)) { + + // if local notice file exists + if (file_exists($this->notice_json)) { + + // get cached data + $cache_data = $filesystem->execute('get_contents', $this->notice_json); + + // if local and server data are same, then return + if ( strcmp ( $data, $cache_data ) == 0) { + return; + } + } + + // set server data + $params = array( + 'content' => $data + ); + + // write local notice file with new data + $filesystem->execute('put_contents', $this->notice_json, $params); + + // set cookie for three day expiry + setcookie( $this->cookie_id, 1, time() + (86400 * $this->interval), '/' ); + } + } + + private function display_message(){ + // notice file exists? + if (file_exists($this->notice_json)) { + // get cached data + $data = $this->parent->filesystem->execute('get_contents', $this->notice_json); + + // decode json string + $data = (Array)json_decode($data); + + // must be array and not empty + if (is_array($data) && !empty($data)) { + + // No message means nothing to display. + if (!isset($data['message']) || $data['message'] == '' || empty($data['message'])) { + return; + } + + // validate data + $data['type'] = isset($data['type']) && $data['type'] != '' ? $data['type'] : 'updated'; + $data['title'] = isset($data['title']) && $data['title'] != '' ? $data['title'] : ''; + + if ($data['type'] == 'redux-message') { + $data['type'] = 'updated redux-message'; + } + + $data['color'] = isset($data['color']) ? $data['color'] : '#00A2E3'; + + // set admin notice array + $this->parent->admin_notices[] = array( + 'type' => $data['type'], + 'msg' => $data['title'] . $data['message'], + 'id' => $this->cookie_id . '_' . filemtime($this->notice_json), + 'dismiss' => true, + 'color' => $data['color'] + ); + } + } + } + } + } \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/core/panel.php b/plugins/legacy-admin/framework/core/core/panel.php new file mode 100644 index 000000000..04f738b95 --- /dev/null +++ b/plugins/legacy-admin/framework/core/core/panel.php @@ -0,0 +1,360 @@ +parent = $parent; + Redux_Functions::$_parent = $parent; + $this->template_path = $this->original_path = ReduxFramework::$_dir . 'templates/panel/'; + if ( ! empty( $this->parent->args['templates_path'] ) ) { + $this->template_path = trailingslashit( $this->parent->args['templates_path'] ); + } + $this->template_path = trailingslashit( apply_filters( "redux/{$this->parent->args['opt_name']}/panel/templates_path", $this->template_path ) ); + } + + public function init() { + $this->panel_template(); + } + + + /** + * Loads the panel templates where needed and provides the container for Redux + */ + private function panel_template() { + + if ( $this->parent->args['dev_mode'] ) { + $this->template_file_check_notice(); + } + + /** + * action 'redux/{opt_name}/panel/before' + */ + do_action( "redux/{$this->parent->args['opt_name']}/panel/before" ); + + echo '

    '; // Stupid hack for Wordpress alerts and warnings + + echo '
    '; + echo '
    '; + + // Do we support JS? + echo ''; + + // Security is vital! + echo ''; + + /** + * action 'redux-page-before-form-{opt_name}' + * + * @deprecated + */ + do_action( "redux-page-before-form-{$this->parent->args['opt_name']}" ); // Remove + + /** + * action 'redux/page/{opt_name}/form/before' + * + * @param object $this ReduxFramework + */ + do_action( "redux/page/{$this->parent->args['opt_name']}/form/before", $this ); + + $this->get_template( 'container.tpl.php' ); + + /** + * action 'redux-page-after-form-{opt_name}' + * + * @deprecated + */ + do_action( "redux-page-after-form-{$this->parent->args['opt_name']}" ); // REMOVE + + /** + * action 'redux/page/{opt_name}/form/after' + * + * @param object $this ReduxFramework + */ + do_action( "redux/page/{$this->parent->args['opt_name']}/form/after", $this ); + echo '
    '; + echo '
    '; + + if ( $this->parent->args['dev_mode'] == true ) { + if ( current_user_can( 'administrator' ) ) { + global $wpdb; + echo "
    ";
    +                        print_r( $wpdb->queries );
    +                        echo "
    "; + } + + echo '
    ' . get_num_queries() . ' queries in ' . timer_stop( 0 ) . ' seconds
    Redux is currently set to developer mode.
    '; + } + + /** + * action 'redux/{opt_name}/panel/after' + */ + do_action( "redux/{$this->parent->args['opt_name']}/panel/after" ); + + } + + + /** + * Calls the various notification bars and sets the appropriate templates. + */ + function notification_bar() { + + if ( isset( $this->parent->transients['last_save_mode'] ) ) { + + if ( $this->parent->transients['last_save_mode'] == "import" ) { + /** + * action 'redux/options/{opt_name}/import' + * + * @param object $this ReduxFramework + */ + do_action( "redux/options/{$this->parent->args['opt_name']}/import", $this, $this->parent->transients['changed_values'] ); + + /** + * filter 'redux-imported-text-{opt_name}' + * + * @param string translated "settings imported" text + */ + echo '
    ' . apply_filters( "redux-imported-text-{$this->parent->args['opt_name']}", __( 'Settings Imported!', 'legacy_framework' ) ) . '
    '; + //exit(); + } else if ( $this->parent->transients['last_save_mode'] == "defaults" ) { + /** + * action 'redux/options/{opt_name}/reset' + * + * @param object $this ReduxFramework + */ + do_action( "redux/options/{$this->parent->args['opt_name']}/reset", $this ); + + /** + * filter 'redux-defaults-text-{opt_name}' + * + * @param string translated "settings imported" text + */ + echo '
    ' . apply_filters( "redux-defaults-text-{$this->parent->args['opt_name']}", __( 'All Defaults Restored!', 'legacy_framework' ) ) . '
    '; + } else if ( $this->parent->transients['last_save_mode'] == "defaults_section" ) { + /** + * action 'redux/options/{opt_name}/section/reset' + * + * @param object $this ReduxFramework + */ + do_action( "redux/options/{$this->parent->args['opt_name']}/section/reset", $this ); + + /** + * filter 'redux-defaults-section-text-{opt_name}' + * + * @param string translated "settings imported" text + */ + echo '
    ' . apply_filters( "redux-defaults-section-text-{$this->parent->args['opt_name']}", __( 'Section Defaults Restored!', 'legacy_framework' ) ) . '
    '; + } else if ( $this->parent->transients['last_save_mode'] == "normal" ) { + /** + * action 'redux/options/{opt_name}/saved' + * + * @param mixed $value set/saved option value + */ + do_action( "redux/options/{$this->parent->args['opt_name']}/saved", $this->parent->options, $this->parent->transients['changed_values'] ); + + /** + * filter 'redux-saved-text-{opt_name}' + * + * @param string translated "settings saved" text + */ + echo '
    ' . apply_filters( "redux-saved-text-{$this->parent->args['opt_name']}", __( 'Settings Saved!', 'legacy_framework' ) ) . '
    '; + } + + unset( $this->parent->transients['last_save_mode'] ); + //$this->parent->transients['last_save_mode'] = 'remove'; + $this->parent->set_transients(); + } + + /** + * action 'redux/options/{opt_name}/settings/changes' + * + * @param mixed $value set/saved option value + */ + do_action( "redux/options/{$this->parent->args['opt_name']}/settings/change", $this->parent->options, $this->parent->transients['changed_values'] ); + + /** + * filter 'redux-changed-text-{opt_name}' + * + * @param string translated "settings have changed" text + */ + echo '
    ' . apply_filters( "redux-changed-text-{$this->parent->args['opt_name']}", __( 'Settings have changed, you should save them!', 'legacy_framework' ) ) . '
    '; + + /** + * action 'redux/options/{opt_name}/errors' + * + * @param array $this ->errors error information + */ + do_action( "redux/options/{$this->parent->args['opt_name']}/errors", $this->parent->errors ); + echo '
    ' . __( 'error(s) were found!', 'legacy_framework' ) . '
    '; + + /** + * action 'redux/options/{opt_name}/warnings' + * + * @param array $this ->warnings warning information + */ + do_action( "redux/options/{$this->parent->args['opt_name']}/warnings", $this->parent->warnings ); + echo '
    ' . __( 'warning(s) were found!', 'legacy_framework' ) . '
    '; + + } + + /** + * Used to intitialize the settings fields for this panel. Required for saving and redirect. + */ + function init_settings_fields() { + // Must run or the page won't redirect properly + settings_fields( "{$this->parent->args['opt_name']}_group" ); + } + + + /** + * Used to select the proper template. If it doesn't exist in the path, then the original template file is used. + * + * @param $file + */ + function get_template( $file ) { + + if ( empty( $file ) ) { + return; + } + + if ( file_exists( $this->template_path . $file ) ) { + $path = $this->template_path . $file; + } else { + $path = $this->original_path . $file; + } + + $path = apply_filters( "redux/{$this->parent->args['opt_name']}/panel/template/" . $file, $path ); + + include( $path ); + + } + + /** + * Retrieve metadata from a file. Based on WP Core's get_file_data function + * + * @since 2.1.1 + * + * @param string $file Path to the file + * + * @return string + */ + public function get_file_version( $file ) { + // We don't need to write to the file, so just open for reading. + $fp = fopen( $file, 'r' ); + + // Pull only the first 8kiB of the file in. + $file_data = fread( $fp, 8192 ); + + // PHP will close file handle, but we are good citizens. + fclose( $fp ); + + // Make sure we catch CR-only line endings. + $file_data = str_replace( "\r", "\n", $file_data ); + $version = ''; + + if ( preg_match( '/^[ \t\/*#@]*' . preg_quote( '@version', '/' ) . '(.*)$/mi', $file_data, $match ) && $match[1] ) { + $version = _cleanup_header_comment( $match[1] ); + } + + return $version; + } + + /** + * Scan the template files + * + * @param string $template_path + * + * @return array + */ + public function scan_template_files( $template_path ) { + $files = scandir( $template_path ); + $result = array(); + if ( $files ) { + foreach ( $files as $key => $value ) { + if ( ! in_array( $value, array( ".", ".." ) ) ) { + if ( is_dir( $template_path . DIRECTORY_SEPARATOR . $value ) ) { + $sub_files = self::scan_template_files( $template_path . DIRECTORY_SEPARATOR . $value ); + foreach ( $sub_files as $sub_file ) { + $result[] = $value . DIRECTORY_SEPARATOR . $sub_file; + } + } else { + $result[] = $value; + } + } + } + } + + return $result; + } + + /** + * Show a notice highlighting bad template files + */ + public function template_file_check_notice() { + + if ( $this->template_path == $this->original_path ) { + return; + } + + $core_templates = $this->scan_template_files( $this->original_path ); + $outdated = false; + + foreach ( $core_templates as $file ) { + $developer_theme_file = false; + + if ( file_exists( $this->template_path . $file ) ) { + $developer_theme_file = $this->template_path . $file; + } + + if ( $developer_theme_file ) { + $core_version = $this->get_file_version( $this->original_path . $file ); + $developer_version = $this->get_file_version( $developer_theme_file ); + + if ( $core_version && $developer_version && version_compare( $developer_version, $core_version, '<' ) ) { + ?> +
    +

    Your panel has bundled outdated copies of Redux Framework template files – if you encounter functionality issues this could be the reason. Ensure you update or remove them.', 'legacy_framework' ); ?>

    +
    + parent->args['opt_name'] . $k . '_section_group' ); + } + + } + } \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/core/required.php b/plugins/legacy-admin/framework/core/core/required.php new file mode 100644 index 000000000..08b33c1f1 --- /dev/null +++ b/plugins/legacy-admin/framework/core/core/required.php @@ -0,0 +1,25 @@ +parent = $parent; + Redux_Functions::$_parent = $parent; + + + /** + * action 'redux/page/{opt_name}/' + */ + do_action( "redux/page/{$parent->args['opt_name']}/" ); + + } + + + } + } \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/framework.php b/plugins/legacy-admin/framework/core/framework.php new file mode 100644 index 000000000..d18e032ba --- /dev/null +++ b/plugins/legacy-admin/framework/core/framework.php @@ -0,0 +1,3736 @@ +. + * + * @package Redux_Framework + * @subpackage Core + * @author Redux Framework Team + */ +// Exit if accessed directly + if ( ! defined( 'ABSPATH' ) ) { + exit; + } + +// Fix for the GT3 page builder: http://www.gt3themes.com/wordpress-gt3-page-builder-plugin/ + /** @global string $pagenow */ + if ( has_action( 'ecpt_field_options_' ) ) { + global $pagenow; + if ( $pagenow === 'admin.php' ) { + /** @noinspection PhpUndefinedCallbackInspection */ + remove_action( 'admin_init', 'pb_admin_init' ); + } + } + + if ( ! class_exists( 'ReduxFrameworkInstances' ) ) { + // Instance Container + require_once( dirname( __FILE__ ) . '/inc/class.redux_instances.php' ); + require_once( dirname( __FILE__ ) . '/inc/lib.redux_instances.php' ); + } + + if ( class_exists( 'ReduxFrameworkInstances' ) ) { + add_action( 'redux/init', 'ReduxFrameworkInstances::get_instance' ); + } + +// Don't duplicate me! + if ( ! class_exists( 'ReduxFramework' ) ) { + + // Redux API class :) + require_once( dirname( __FILE__ ) . '/inc/class.redux_api.php' ); + + // General helper functions + require_once( dirname( __FILE__ ) . '/inc/class.redux_helpers.php' ); + + // General functions + require_once( dirname( __FILE__ ) . '/inc/class.redux_functions.php' ); + require_once( dirname( __FILE__ ) . '/inc/class.p.php' ); + + require_once( dirname( __FILE__ ) . '/inc/class.redux_filesystem.php' ); + + // ThemeCheck checks + require_once( dirname( __FILE__ ) . '/inc/class.redux_themecheck.php' ); + + // Welcome + require_once( dirname( __FILE__ ) . '/inc/welcome/welcome.php' ); + + //require_once( dirname( __FILE__ ) . '/inc/class.redux_sass.php' ); + + /** + * Main ReduxFramework class + * + * @since 1.0.0 + */ + class ReduxFramework { + + // ATTENTION DEVS + // Please update the build number with each push, no matter how small. + // This will make for easier support when we ask users what version they are using. + + public static $_version = '3.5.0.2'; + public static $_dir; + public static $_url; + public static $_upload_dir; + public static $_upload_url; + public static $wp_content_url; + public static $base_wp_content_url; + public static $_is_plugin = true; + public static $_as_plugin = false; + + public static function init() { + $dir = Redux_Helpers::cleanFilePath( dirname( __FILE__ ) ); + + // Windows-proof constants: replace backward by forward slashes. Thanks to: @peterbouwmeester + self::$_dir = trailingslashit( $dir ); + self::$wp_content_url = trailingslashit( Redux_Helpers::cleanFilePath( ( is_ssl() ? str_replace( 'http://', 'https://', WP_CONTENT_URL ) : WP_CONTENT_URL ) ) ); + + // See if Redux is a plugin or not + if ( strpos( Redux_Helpers::cleanFilePath( __FILE__ ), Redux_Helpers::cleanFilePath( get_stylesheet_directory() ) ) !== false || strpos( Redux_Helpers::cleanFilePath( __FILE__ ), Redux_Helpers::cleanFilePath( get_template_directory_uri() ) ) !== false || strpos( Redux_Helpers::cleanFilePath( __FILE__ ), Redux_Helpers::cleanFilePath( WP_CONTENT_DIR . '/themes/' ) ) !== false ) { + self::$_is_plugin = false; + } else { + // Check if plugin is a symbolic link, see if it's a plugin. If embedded, we can't do a thing. + if ( strpos( self::$_dir, ABSPATH ) === false ) { + if ( ! function_exists( 'get_plugins' ) ) { + require_once ABSPATH . 'wp-admin/includes/plugin.php'; + } + + $is_plugin = false; + foreach ( get_plugins() as $key => $value ) { + if ( strpos( $key, 'legacy_framework.php' ) !== false ) { + self::$_dir = trailingslashit( Redux_Helpers::cleanFilePath( WP_CONTENT_DIR . '/plugins/' . plugin_dir_path( $key ) . 'ReduxCore/' ) ); + $is_plugin = true; + } + } + if ( ! $is_plugin ) { + self::$_is_plugin = false; + } + } + } + + if ( self::$_is_plugin == true || self::$_as_plugin == true ) { + self::$_url = plugin_dir_url( __FILE__ ); + } else { + if ( strpos( Redux_Helpers::cleanFilePath( __FILE__ ), Redux_Helpers::cleanFilePath( get_template_directory() ) ) !== false ) { + $relative_url = str_replace( Redux_Helpers::cleanFilePath( get_template_directory() ), '', self::$_dir ); + self::$_url = trailingslashit( get_template_directory_uri() . $relative_url ); + } else if ( strpos( Redux_Helpers::cleanFilePath( __FILE__ ), Redux_Helpers::cleanFilePath( get_stylesheet_directory() ) ) !== false ) { + $relative_url = str_replace( Redux_Helpers::cleanFilePath( get_stylesheet_directory() ), '', self::$_dir ); + self::$_url = trailingslashit( get_stylesheet_directory_uri() . $relative_url ); + } else { + $wp_content_dir = trailingslashit( Redux_Helpers::cleanFilePath( WP_CONTENT_DIR ) ); + $wp_content_dir = trailingslashit( str_replace( '//', '/', $wp_content_dir ) ); + $relative_url = str_replace( $wp_content_dir, '', self::$_dir ); + self::$_url = trailingslashit( self::$wp_content_url . $relative_url ); + } + } + + self::$_url = apply_filters( "redux/_url", self::$_url ); + self::$_dir = apply_filters( "redux/_dir", self::$_dir ); + self::$_is_plugin = apply_filters( "redux/_is_plugin", self::$_is_plugin ); + } + + // ::init() + + public $framework_url = 'http://www.reduxframework.com/'; + public static $instance = null; + public $admin_notices = array(); + public $page = ''; + public $saved = false; + public $fields = array(); // Fields by type used in the panel + public $field_sections = array(); // Section id's by field type, then field ID + public $current_tab = ''; // Current section to display, cookies + public $extensions = array(); // Extensions by type used in the panel + public $sections = array(); // Sections and fields + public $errors = array(); // Errors + public $warnings = array(); // Warnings + public $options = array(); // Option values + public $options_defaults = null; // Option defaults + public $notices = array(); // Option defaults + public $compiler_fields = array(); // Fields that trigger the compiler hook + public $required = array(); // Information that needs to be localized + public $required_child = array(); // Information that needs to be localized + public $localize_data = array(); // Information that needs to be localized + public $fonts = array(); // Information that needs to be localized + public $folds = array(); // The itms that need to fold. + public $path = ''; + public $changed_values = array(); // Values that have been changed on save. Orig values. + public $output = array(); // Fields with CSS output selectors + public $outputCSS = null; // CSS that get auto-appended to the header + public $compilerCSS = null; // CSS that get sent to the compiler hook + public $customizerCSS = null; // CSS that goes to the customizer + public $fieldsValues = array(); //all fields values in an id=>value array so we can check dependencies + public $fieldsHidden = array(); //all fields that didn't pass the dependency test and are hidden + public $toHide = array(); // Values to hide on page load + public $typography = null; //values to generate google font CSS + public $import_export = null; + public $debug = null; + public $no_panel = array(); // Fields that are not visible in the panel + private $show_hints = false; + public $hidden_perm_fields = array(); // Hidden fields specified by 'permissions' arg. + public $hidden_perm_sections = array(); // Hidden sections specified by 'permissions' arg. + public $typography_preview = array(); + public $args = array(); + public $filesystem = null; + public $font_groups = array(); + public $lang = ""; + + /** + * Class Constructor. Defines the args for the theme options class + * + * @since 1.0.0 + * + * @param array $sections Panel sections. + * @param array $args Class constructor arguments. + * @param array $extra_tabs Extra panel tabs. // REMOVE + * + * @return \ReduxFramework + */ + public function __construct( $sections = array(), $args = array(), $extra_tabs = array() ) { + // Disregard WP AJAX 'heartbeat'call. Why waste resources? + if ( isset ( $_POST ) && isset ( $_POST['action'] ) && $_POST['action'] == 'heartbeat' ) { + + // Hook, for purists. + if ( ! has_action( 'redux/ajax/heartbeat' ) ) { + do_action( 'redux/ajax/heartbeat', $this ); + } + + // Buh bye! + return; + } + + // Pass parent pointer to function helper. + Redux_Functions::$_parent = $this; + + // Set values + $this->set_default_args(); + $this->args = wp_parse_args( $args, $this->args ); + + if ( empty ( $this->args['transient_time'] ) ) { + $this->args['transient_time'] = 60 * MINUTE_IN_SECONDS; + } + + if ( empty ( $this->args['footer_credit'] ) ) { + $this->args['footer_credit'] = '' . sprintf( __( 'Options panel created using %1$s', 'legacy_framework' ), '' . __( 'Redux Framework', 'legacy_framework' ) . ' v' . self::$_version ) . ''; + } + + if ( empty ( $this->args['menu_title'] ) ) { + $this->args['menu_title'] = __( 'Options', 'legacy_framework' ); + } + + if ( empty ( $this->args['page_title'] ) ) { + $this->args['page_title'] = __( 'Options', 'legacy_framework' ); + } + + /** + * filter 'redux/args/{opt_name}' + * + * @param array $args ReduxFramework configuration + */ + $this->args = apply_filters( "redux/args/{$this->args['opt_name']}", $this->args ); + + /** + * filter 'redux/options/{opt_name}/args' + * + * @param array $args ReduxFramework configuration + */ + $this->args = apply_filters( "redux/options/{$this->args['opt_name']}/args", $this->args ); + + // Do not save the defaults if we're on a live preview! + if ( $GLOBALS['pagenow'] == "customize" && isset( $_GET['theme'] ) && ! empty( $_GET['theme'] ) ) { + $this->args['save_defaults'] = false; + } + + if ( ! empty ( $this->args['opt_name'] ) ) { + /** + * SHIM SECTION + * Old variables and ways of doing things that need correcting. ;) + * */ + // Variable name change + if ( ! empty ( $this->args['page_cap'] ) ) { + $this->args['page_permissions'] = $this->args['page_cap']; + unset ( $this->args['page_cap'] ); + } + + if ( ! empty ( $this->args['page_position'] ) ) { + $this->args['page_priority'] = $this->args['page_position']; + unset ( $this->args['page_position'] ); + } + + if ( ! empty ( $this->args['page_type'] ) ) { + $this->args['menu_type'] = $this->args['page_type']; + unset ( $this->args['page_type'] ); + } + + // Get rid of extra_tabs! Not needed. + if ( is_array( $extra_tabs ) && ! empty ( $extra_tabs ) ) { + foreach ( $extra_tabs as $tab ) { + array_push( $this->sections, $tab ); + } + } + + // Move to the first loop area! + /** + * filter 'redux-sections' + * + * @deprecated + * + * @param array $sections field option sections + */ + $this->sections = apply_filters( 'redux-sections', $sections ); // REMOVE LATER + /** + * filter 'redux-sections-{opt_name}' + * + * @deprecated + * + * @param array $sections field option sections + */ + $this->sections = apply_filters( "redux-sections-{$this->args['opt_name']}", $this->sections ); // REMOVE LATER + /** + * filter 'redux/options/{opt_name}/sections' + * + * @param array $sections field option sections + */ + $this->sections = apply_filters( "redux/options/{$this->args['opt_name']}/sections", $this->sections ); + + /** + * Construct hook + * action 'redux/construct' + * + * @param object $this ReduxFramework + */ + do_action( 'redux/construct', $this ); + + // Set the default values + $this->_default_cleanup(); + + // Internataionalization + $this->_internationalization(); + + $this->filesystem = new Redux_Filesystem ( $this ); + + //set redux upload folder + $this->set_redux_content(); + + // Register extra extensions + $this->_register_extensions(); + + // Grab database values + $this->get_options(); + + // Tracking + if ( true != Redux_Helpers::isTheme( __FILE__ ) || ( true == Redux_Helpers::isTheme( __FILE__ ) && ! $this->args['disable_tracking'] ) ) { + $this->_tracking(); + } + + // Options page + add_action( 'admin_menu', array( $this, '_options_page' ) ); + + // Add a network menu + if ( $this->args['database'] == "network" && $this->args['network_admin'] ) { + add_action( 'network_admin_menu', array( $this, '_options_page' ) ); + } + + // Admin Bar menu + add_action( 'admin_bar_menu', array( + $this, + '_admin_bar_menu' + ), $this->args['admin_bar_priority'] ); + + // Register setting + add_action( 'admin_init', array( $this, '_register_settings' ) ); + + // Display admin notices in dev_mode + if ( true == $this->args['dev_mode'] ) { + require_once( self::$_dir . 'inc/debug.php' ); + $this->debug = new ReduxDebugObject ( $this ); + + if ( true == $this->args['update_notice'] ) { + add_action( 'admin_init', array( $this, '_update_check' ) ); + } + } + + // Display admin notices + add_action( 'admin_notices', array( $this, '_admin_notices' ), 99 ); + + // Check for dismissed admin notices. + add_action( 'admin_init', array( $this, '_dismiss_admin_notice' ), 9 ); + + // Enqueue the admin page CSS and JS + if ( isset ( $_GET['page'] ) && $_GET['page'] == $this->args['page_slug'] ) { + add_action( 'admin_enqueue_scripts', array( $this, '_enqueue' ), 1 ); + } + + // Output dynamic CSS + // Frontend: Maybe enqueue dynamic CSS and Google fonts + if ( empty ( $this->args['output_location'] ) || in_array( 'frontend', $this->args['output_location'] ) ) { + add_action( 'wp_head', array( &$this, '_output_css' ), 150 ); + add_action( 'wp_enqueue_scripts', array( &$this, '_enqueue_output' ), 150 ); + } + + // Login page: Maybe enqueue dynamic CSS and Google fonts + if ( in_array( 'login', $this->args['output_location'] ) ) { + add_action( 'login_head', array( &$this, '_output_css' ), 150 ); + add_action( 'login_enqueue_scripts', array( &$this, '_enqueue_output' ), 150 ); + } + + // Admin area: Maybe enqueue dynamic CSS and Google fonts + if ( in_array( 'admin', $this->args['output_location'] ) ) { + add_action( 'admin_head', array( &$this, '_output_css' ), 150 ); + add_action( 'admin_enqueue_scripts', array( &$this, '_enqueue_output' ), 150 ); + } + + + add_action( 'wp_print_scripts', array( $this, 'vc_fixes' ), 100 ); + add_action( 'admin_enqueue_scripts', array( $this, 'vc_fixes' ), 100 ); + + + if ( $this->args['database'] == "network" && $this->args['network_admin'] ) { + add_action( 'network_admin_edit_redux_' . $this->args['opt_name'], array( + $this, + 'save_network_page' + ), 10, 0 ); + add_action( 'admin_bar_menu', array( $this, 'network_admin_bar' ), 999 ); + } + // Ajax saving!!! + add_action( "wp_ajax_" . $this->args['opt_name'] . '_ajax_save', array( $this, "ajax_save" ) ); + + //include_once 'core/dashboard.php'; + + if ( $this->args['dev_mode'] == true || Redux_Helpers::isLocalHost() === true ) { + if ( ! isset ( $GLOBALS['redux_notice_check'] ) ) { + include_once 'core/newsflash.php'; + + $params = array( + 'dir_name' => 'notice', + 'server_file' => 'http://www.reduxframework.com/' . 'wp-content/uploads/redux/redux_notice.json', + 'interval' => 3, + 'cookie_id' => 'redux_blast', + ); + + new reduxNewsflash( $this, $params ); + $GLOBALS['redux_notice_check'] = 1; + } + } + } + + /** + * Loaded hook + * action 'redux/loaded' + * + * @param object $this ReduxFramework + */ + do_action( 'redux/loaded', $this ); + } + +// __construct() + + private function set_redux_content() { + $upload_dir = wp_upload_dir(); + self::$_upload_dir = $upload_dir['basedir'] . '/redux/'; + self::$_upload_url = $upload_dir['baseurl'] . '/redux/'; + if ( ! is_dir( self::$_upload_dir ) ) { + $this->filesystem->execute( 'mkdir', self::$_upload_dir ); + } + } + + private function set_default_args() { + $this->args = array( + 'opt_name' => '', + // Must be defined by theme/plugin + 'google_api_key' => '', + // Must be defined to update the google fonts cache for the typography module + 'google_update_weekly' => false, + // Set to keep your google fonts updated weekly + 'last_tab' => '', + // force a specific tab to always show on reload + 'menu_icon' => '', + // menu icon + 'menu_title' => '', + // menu title/text + 'page_title' => '', + // option page title + 'page_slug' => '_options', + 'page_permissions' => 'manage_options', + 'menu_type' => 'menu', + // ('menu'|'submenu') + 'page_parent' => 'themes.php', + // requires menu_type = 'submenu + 'page_priority' => null, + 'allow_sub_menu' => true, + // allow submenus to be added if menu_type == menu + 'save_defaults' => true, + // Save defaults to the DB on it if empty + 'footer_credit' => '', + 'async_typography' => false, + 'disable_google_fonts_link' => false, + 'class' => '', + // Class that gets appended to all redux-containers + 'admin_bar' => true, + 'admin_bar_priority' => 999, + // Show the panel pages on the admin bar + 'admin_bar_icon' => '', + // admin bar icon + 'help_tabs' => array(), + 'help_sidebar' => '', + 'database' => '', + // possible: options, theme_mods, theme_mods_expanded, transient, network + 'customizer' => false, + // setting to true forces get_theme_mod_expanded + 'global_variable' => '', + // Changes global variable from $GLOBALS['YOUR_OPT_NAME'] to whatever you set here. false disables the global variable + 'output' => true, + // Dynamically generate CSS + 'compiler' => true, + // Initiate the compiler hook + 'output_tag' => true, + // Print Output Tag + 'output_location' => array( 'frontend' ), + // Where the dynamic CSS will be added. Can be any combination from: 'frontend', 'login', 'admin' + 'transient_time' => '', + 'default_show' => false, + // If true, it shows the default value + 'default_mark' => '', + // What to print by the field's title if the value shown is default + 'update_notice' => true, + // Recieve an update notice of new commits when in dev mode + 'disable_save_warn' => false, + // Disable the save warn + 'open_expanded' => false, + 'hide_expand' => false, + // Start the panel fully expanded to start with + 'network_admin' => true, + // Enable network admin when using network database mode + 'network_sites' => true, + // Enable sites as well as admin when using network database mode + 'hide_reset' => false, + 'hints' => array( + 'icon' => 'el el-question-sign', + 'icon_position' => 'right', + 'icon_color' => 'lightgray', + 'icon_size' => 'normal', + 'tip_style' => array( + 'color' => 'light', + 'shadow' => true, + 'rounded' => false, + 'style' => '', + ), + 'tip_position' => array( + 'my' => 'top_left', + 'at' => 'bottom_right', + ), + 'tip_effect' => array( + 'show' => array( + 'effect' => 'slide', + 'duration' => '500', + 'event' => 'mouseover', + ), + 'hide' => array( + 'effect' => 'fade', + 'duration' => '500', + 'event' => 'click mouseleave', + ), + ), + ), + 'show_import_export' => true, + 'dev_mode' => false, + 'system_info' => true, + 'disable_tracking' => false, + 'templates_path' => '', + // Path to the templates file for various Redux elements + 'ajax_save' => false, + // Disable the use of ajax saving for the panel + ); + } + + // Fix conflicts with Visual Composer. + public function vc_fixes() { + if ( redux_helpers::isFieldInUse( $this, 'ace_editor' ) ) { + wp_dequeue_script( 'wpb_ace' ); + wp_deregister_script( 'wpb_ace' ); + } + } + + public function network_admin_bar( $wp_admin_bar ) { + + $args = array( + 'id' => $this->args['opt_name'] . '_network_admin', + 'title' => $this->args['menu_title'], + 'parent' => 'network-admin', + 'href' => network_admin_url( 'settings.php' ) . '?page=' . $this->args['page_slug'], + 'meta' => array( 'class' => 'redux-network-admin' ) + ); + $wp_admin_bar->add_node( $args ); + } + + private function stripslashes_deep( $value ) { + $value = is_array( $value ) ? + array_map( 'stripslashes_deep', $value ) : + stripslashes( $value ); + + return $value; + } + + public function save_network_page() { + + $data = $this->_validate_options( $_POST[ $this->args['opt_name'] ] ); + + if ( ! empty ( $data ) ) { + $this->set_options( $data ); + } + + wp_redirect( add_query_arg( array( + 'page' => $this->args['page_slug'], + 'updated' => 'true' + ), network_admin_url( 'settings.php' ) ) ); + exit (); + } + + public function _update_check() { + // Only one notice per instance please + if ( ! isset ( $GLOBALS['redux_update_check'] ) ) { + Redux_Functions::updateCheck( self::$_version ); + $GLOBALS['redux_update_check'] = 1; + } + } + + public function _admin_notices() { + Redux_Functions::adminNotices( $this->admin_notices ); + } + + public function _dismiss_admin_notice() { + Redux_Functions::dismissAdminNotice(); + } + + /** + * Load the plugin text domain for translation. + * + * @since 3.0.5 + */ + private function _internationalization() { + + /** + * Locale for text domain + * filter 'redux/textdomain/{opt_name}' + * + * @param string The locale of the blog or from the 'locale' hook + * @param string 'legacy_framework' text domain + */ + $locale = apply_filters( "redux/textdomain/{$this->args['opt_name']}", get_locale(), 'legacy_framework' ); + + if ( strpos( $locale, '_' ) === false ) { + if ( file_exists( self::$_dir . 'languages/' . strtolower( $locale ) . '_' . strtoupper( $locale ) . '.mo' ) ) { + $locale = strtolower( $locale ) . '_' . strtoupper( $locale ); + } + } + load_textdomain( 'legacy_framework', self::$_dir . 'languages/' . $locale . '.mo' ); + } +// _internationalization() + + /** + * @return ReduxFramework + */ + public function get_instance() { + //self::$_instance = $this; + return self::$instance; + } + +// get_instance() + + private function _tracking() { + require_once( dirname( __FILE__ ) . '/inc/tracking.php' ); + $tracking = Redux_Tracking::get_instance(); + $tracking->load( $this ); + } +// _tracking() + + /** + * ->_get_default(); This is used to return the default value if default_show is set + * + * @since 1.0.1 + * @access public + * + * @param string $opt_name The option name to return + * @param mixed $default (null) The value to return if default not set + * + * @return mixed $default + */ + public function _get_default( $opt_name, $default = null ) { + if ( $this->args['default_show'] == true ) { + + if ( empty ( $this->options_defaults ) ) { + $this->_default_values(); // fill cache + } + + $default = array_key_exists( $opt_name, $this->options_defaults ) ? $this->options_defaults[ $opt_name ] : $default; + } + + return $default; + } +// _get_default() + + /** + * ->get(); This is used to return and option value from the options array + * + * @since 1.0.0 + * @access public + * + * @param string $opt_name The option name to return + * @param mixed $default (null) The value to return if option not set + * + * @return mixed + */ + public function get( $opt_name, $default = null ) { + return ( ! empty ( $this->options[ $opt_name ] ) ) ? $this->options[ $opt_name ] : $this->_get_default( $opt_name, $default ); + } +// get() + + /** + * ->set(); This is used to set an arbitrary option in the options array + * + * @since 1.0.0 + * @access public + * + * @param string $opt_name The name of the option being added + * @param mixed $value The value of the option being added + * + * @return void + */ + public function set( $opt_name = '', $value = '' ) { + if ( $opt_name != '' ) { + $this->options[ $opt_name ] = $value; + $this->set_options( $this->options ); + } + } +// set() + + /** + * Set a global variable by the global_variable argument + * + * @since 3.1.5 + * @return bool (global was set) + */ + private function set_global_variable() { + if ( $this->args['global_variable'] ) { + $option_global = $this->args['global_variable']; + /** + * filter 'redux/options/{opt_name}/global_variable' + * + * @param array $value option value to set global_variable with + */ + $GLOBALS[ $this->args['global_variable'] ] = apply_filters( "redux/options/{$this->args['opt_name']}/global_variable", $this->options ); + if ( isset ( $this->transients['last_save'] ) ) { + // Deprecated + $GLOBALS[ $this->args['global_variable'] ]['REDUX_last_saved'] = $this->transients['last_save']; + // Last save key + $GLOBALS[ $this->args['global_variable'] ]['REDUX_LAST_SAVE'] = $this->transients['last_save']; + } + if ( isset ( $this->transients['last_compiler'] ) ) { + // Deprecated + $GLOBALS[ $this->args['global_variable'] ]['REDUX_COMPILER'] = $this->transients['last_compiler']; + // Last compiler hook key + $GLOBALS[ $this->args['global_variable'] ]['REDUX_LAST_COMPILER'] = $this->transients['last_compiler']; + } + + return true; + } + + return false; + } +// set_global_variable() + + /** + * ->set_options(); This is used to set an arbitrary option in the options array + * + * @since ReduxFramework 3.0.0 + * + * @param mixed $value the value of the option being added + */ + public function set_options( $value = '' ) { + + $this->transients['last_save'] = time(); + + if ( ! empty ( $value ) ) { + + $this->options = $value; + + if ( $this->args['database'] === 'transient' ) { + set_transient( $this->args['opt_name'] . '-transient', $value, $this->args['transient_time'] ); + } else if ( $this->args['database'] === 'theme_mods' ) { + set_theme_mod( $this->args['opt_name'] . '-mods', $value ); + } else if ( $this->args['database'] === 'theme_mods_expanded' ) { + foreach ( $value as $k => $v ) { + set_theme_mod( $k, $v ); + } + } else if ( $this->args['database'] === 'network' ) { + // Strip those slashes! + $value = json_decode( stripslashes( json_encode( $value ) ), true ); + update_site_option( $this->args['opt_name'], $value ); + } else { + update_option( $this->args['opt_name'], $value ); + } + + // Store the changed values in the transient + if ( $value != $this->options ) { + foreach ( $value as $k => $v ) { + if ( ! isset ( $this->options[ $k ] ) ) { + $this->options[ $k ] = ""; + } else if ( $v == $this->options[ $k ] ) { + unset ( $this->options[ $k ] ); + } + } + $this->transients['changed_values'] = $this->options; + } + + $this->options = $value; + + // Set a global variable by the global_variable argument. + $this->set_global_variable(); + + // Saving the transient values + $this->set_transients(); + + //do_action( "redux-saved-{$this->args['opt_name']}", $value ); // REMOVE + //do_action( "redux/options/{$this->args['opt_name']}/saved", $value, $this->transients['changed_values'] ); + } + } +// set_options() + + /** + * ->get_options(); This is used to get options from the database + * + * @since ReduxFramework 3.0.0 + */ + public function get_options() { + $defaults = false; + + if ( ! empty ( $this->defaults ) ) { + $defaults = $this->defaults; + } + + if ( $this->args['database'] === "transient" ) { + $result = get_transient( $this->args['opt_name'] . '-transient' ); + } else if ( $this->args['database'] === "theme_mods" ) { + $result = get_theme_mod( $this->args['opt_name'] . '-mods' ); + } else if ( $this->args['database'] === 'theme_mods_expanded' ) { + $result = get_theme_mods(); + } else if ( $this->args['database'] === 'network' ) { + $result = get_site_option( $this->args['opt_name'], array() ); + $result = json_decode( stripslashes( json_encode( $result ) ), true ); + } else { + $result = get_option( $this->args['opt_name'], array() ); + } + + if ( empty ( $result ) && ! empty ( $defaults ) ) { + $results = $defaults; + $this->set_options( $results ); + } else { + $this->options = $result; + } + + /** + * action 'redux/options/{opt_name}/options' + * + * @param mixed $value option values + */ + $this->options = apply_filters( "redux/options/{$this->args['opt_name']}/options", $this->options ); + + // Get transient values + $this->get_transients(); + + // Set a global variable by the global_variable argument. + $this->set_global_variable(); + } +// get_options() + + /** + * ->get_wordpress_date() - Get Wordpress specific data from the DB and return in a usable array + * + * @since ReduxFramework 3.0.0 + */ + public function get_wordpress_data( $type = false, $args = array() ) { + $data = ""; +//return $data; + /** + * filter 'redux/options/{opt_name}/wordpress_data/{type}/' + * + * @deprecated + * + * @param string $data + */ + $data = apply_filters( "redux/options/{$this->args['opt_name']}/wordpress_data/$type/", $data ); // REMOVE LATER + + /** + * filter 'redux/options/{opt_name}/data/{type}' + * + * @param string $data + */ + $data = apply_filters( "redux/options/{$this->args['opt_name']}/data/$type", $data ); + + $argsKey = ""; + foreach ( $args as $key => $value ) { + if ( ! is_array( $value ) ) { + $argsKey .= $value . "-"; + } else { + $argsKey .= implode( "-", $value ); + } + } + + if ( empty ( $data ) && isset ( $this->wp_data[ $type . $argsKey ] ) ) { + $data = $this->wp_data[ $type . $argsKey ]; + } + + if ( empty ( $data ) && ! empty ( $type ) ) { + + /** + * Use data from Wordpress to populate options array + * */ + if ( ! empty ( $type ) && empty ( $data ) ) { + if ( empty ( $args ) ) { + $args = array(); + } + + $data = array(); + $args = wp_parse_args( $args, array() ); + + if ( $type == "categories" || $type == "category" ) { + $cats = get_categories( $args ); + if ( ! empty ( $cats ) ) { + foreach ( $cats as $cat ) { + $data[ $cat->term_id ] = $cat->name; + } + //foreach + } // If + } else if ( $type == "menus" || $type == "menu" ) { + $menus = wp_get_nav_menus( $args ); + if ( ! empty ( $menus ) ) { + foreach ( $menus as $item ) { + $data[ $item->term_id ] = $item->name; + } + //foreach + } + //if + } else if ( $type == "pages" || $type == "page" ) { + if ( ! isset ( $args['posts_per_page'] ) ) { + $args['posts_per_page'] = 20; + } + $pages = get_pages( $args ); + if ( ! empty ( $pages ) ) { + foreach ( $pages as $page ) { + $data[ $page->ID ] = $page->post_title; + } + //foreach + } + //if + } else if ( $type == "terms" || $type == "term" ) { + $taxonomies = $args['taxonomies']; + unset ( $args['taxonomies'] ); + $terms = get_terms( $taxonomies, $args ); // this will get nothing + if ( ! empty ( $terms ) ) { + foreach ( $terms as $term ) { + $data[ $term->term_id ] = $term->name; + } + //foreach + } // If + } else if ( $type == "taxonomy" || $type == "taxonomies" ) { + $taxonomies = get_taxonomies( $args ); + if ( ! empty ( $taxonomies ) ) { + foreach ( $taxonomies as $key => $taxonomy ) { + $data[ $key ] = $taxonomy; + } + //foreach + } // If + } else if ( $type == "posts" || $type == "post" ) { + $posts = get_posts( $args ); + if ( ! empty ( $posts ) ) { + foreach ( $posts as $post ) { + $data[ $post->ID ] = $post->post_title; + } + //foreach + } + //if + } else if ( $type == "post_type" || $type == "post_types" ) { + global $wp_post_types; + + $defaults = array( + 'public' => true, + 'exclude_from_search' => false, + ); + $args = wp_parse_args( $args, $defaults ); + $output = 'names'; + $operator = 'and'; + $post_types = get_post_types( $args, $output, $operator ); + + ksort( $post_types ); + + foreach ( $post_types as $name => $title ) { + if ( isset ( $wp_post_types[ $name ]->labels->menu_name ) ) { + $data[ $name ] = $wp_post_types[ $name ]->labels->menu_name; + } else { + $data[ $name ] = ucfirst( $name ); + } + } + } else if ( $type == "tags" || $type == "tag" ) { // NOT WORKING! + $tags = get_tags( $args ); + if ( ! empty ( $tags ) ) { + foreach ( $tags as $tag ) { + $data[ $tag->term_id ] = $tag->name; + } + //foreach + } + //if + } else if ( $type == "menu_location" || $type == "menu_locations" ) { + global $_wp_registered_nav_menus; + + foreach ( $_wp_registered_nav_menus as $k => $v ) { + $data[ $k ] = $v; + } + } else if ( $type == "image_size" || $type == "image_sizes" ) { + global $_wp_additional_image_sizes; + + foreach ( $_wp_additional_image_sizes as $size_name => $size_attrs ) { + $data[ $size_name ] = $size_name . ' - ' . $size_attrs['width'] . ' x ' . $size_attrs['height']; + } + } else if ( $type == "elusive-icons" || $type == "elusive-icon" || $type == "elusive" || + $type == "font-icon" || $type == "font-icons" || $type == "icons" + ) { + + /** + * filter 'redux-font-icons' + * + * @deprecated + * + * @param array $font_icons array of elusive icon classes + */ + $font_icons = apply_filters( 'redux-font-icons', array() ); // REMOVE LATER + + /** + * filter 'redux/font-icons' + * + * @deprecated + * + * @param array $font_icons array of elusive icon classes + */ + $font_icons = apply_filters( 'redux/font-icons', $font_icons ); + + /** + * filter 'redux/{opt_name}/field/font/icons' + * + * @deprecated + * + * @param array $font_icons array of elusive icon classes + */ + $font_icons = apply_filters( "redux/{$this->args['opt_name']}/field/font/icons", $font_icons ); + + foreach ( $font_icons as $k ) { + $data[ $k ] = $k; + } + } else if ( $type == "roles" ) { + /** @global WP_Roles $wp_roles */ + global $wp_roles; + + $data = $wp_roles->get_names(); + } else if ( $type == "sidebars" || $type == "sidebar" ) { + /** @global array $wp_registered_sidebars */ + global $wp_registered_sidebars; + + foreach ( $wp_registered_sidebars as $key => $value ) { + $data[ $key ] = $value['name']; + } + } else if ( $type == "capabilities" ) { + /** @global WP_Roles $wp_roles */ + global $wp_roles; + + foreach ( $wp_roles->roles as $role ) { + foreach ( $role['capabilities'] as $key => $cap ) { + $data[ $key ] = ucwords( str_replace( '_', ' ', $key ) ); + } + } + } else if ( $type == "callback" ) { + if ( ! is_array( $args ) ) { + $args = array( $args ); + } + $data = call_user_func( $args[0] ); + } + //if + } + //if + + $this->wp_data[ $type . $argsKey ] = $data; + } + + //if + + return $data; + } +// get_wordpress_data() + + /** + * ->show(); This is used to echo and option value from the options array + * + * @since 1.0.0 + * @access public + * + * @param string $opt_name The name of the option being shown + * @param mixed $default The value to show if $opt_name isn't set + * + * @return void + */ + public function show( $opt_name, $default = '' ) { + $option = $this->get( $opt_name ); + if ( ! is_array( $option ) && $option != '' ) { + echo $option; + } elseif ( $default != '' ) { + echo $this->_get_default( $opt_name, $default ); + } + } +// show() + + /** + * Get the default value for an option + * + * @since 3.3.6 + * @access public + * + * @param string $key The option's ID + * @param string $array_key The key of the default's array + * + * @return mixed + */ + public function get_default_value( $key, $array_key = false ) { + if ( empty ( $this->options_defaults ) ) { + $this->options_defaults = $this->_default_values(); + } + + $defaults = $this->options_defaults; + $value = ''; + + if ( isset ( $defaults[ $key ] ) ) { + if ( $array_key !== false && isset ( $defaults[ $key ][ $array_key ] ) ) { + $value = $defaults[ $key ][ $array_key ]; + } else { + $value = $defaults[ $key ]; + } + } + + return $value; + } + + /** + * Get default options into an array suitable for the settings API + * + * @since 1.0.0 + * @access public + * @return array $this->options_defaults + */ + public function _default_values() { + if ( ! is_null( $this->sections ) && is_null( $this->options_defaults ) ) { + + // fill the cache + foreach ( $this->sections as $sk => $section ) { + if ( ! isset ( $section['id'] ) ) { + if ( ! is_numeric( $sk ) || ! isset ( $section['title'] ) ) { + $section['id'] = $sk; + } else { + $section['id'] = sanitize_title( $section['title'], $sk ); + } + $this->sections[ $sk ] = $section; + } + if ( isset ( $section['fields'] ) ) { + foreach ( $section['fields'] as $k => $field ) { + if ( empty ( $field['id'] ) && empty ( $field['type'] ) ) { + continue; + } + + if ( in_array( $field['type'], array( 'ace_editor' ) ) && isset ( $field['options'] ) ) { + $this->sections[ $sk ]['fields'][ $k ]['args'] = $field['options']; + unset ( $this->sections[ $sk ]['fields'][ $k ]['options'] ); + } + + if ( $field['type'] == "section" && isset ( $field['indent'] ) && $field['indent'] == "true" ) { + $field['class'] = isset ( $field['class'] ) ? $field['class'] : ''; + $field['class'] .= "redux-section-indent-start"; + $this->sections[ $sk ]['fields'][ $k ] = $field; + } + // Detect what field types are being used + if ( ! isset ( $this->fields[ $field['type'] ][ $field['id'] ] ) ) { + $this->fields[ $field['type'] ][ $field['id'] ] = 1; + } else { + $this->fields[ $field['type'] ] = array( $field['id'] => 1 ); + } + if ( isset ( $field['default'] ) ) { + $this->options_defaults[ $field['id'] ] = $field['default']; + } elseif ( isset ( $field['options'] ) && ( $field['type'] != "ace_editor" ) ) { + // Sorter data filter + + if ( $field['type'] == "sorter" && isset ( $field['data'] ) && ! empty ( $field['data'] ) && is_array( $field['data'] ) ) { + if ( ! isset ( $field['args'] ) ) { + $field['args'] = array(); + } + foreach ( $field['data'] as $key => $data ) { + if ( ! isset ( $field['args'][ $key ] ) ) { + $field['args'][ $key ] = array(); + } + $field['options'][ $key ] = $this->get_wordpress_data( $data, $field['args'][ $key ] ); + } + } + + if ( $field['type'] == "sortable" ) { + $this->options_defaults[ $field['id'] ] = array(); + } elseif ( $field['type'] == "image_select" ) { + $this->options_defaults[ $field['id'] ] = ''; + } elseif ( $field['type'] == "select" ) { + $this->options_defaults[ $field['id'] ] = ''; + } else { + $this->options_defaults[ $field['id'] ] = $field['options']; + } + } + } + } + } + } + + /** + * filter 'redux/options/{opt_name}/defaults' + * + * @param array $defaults option default values + */ + $this->transients['changed_values'] = isset ( $this->transients['changed_values'] ) ? $this->transients['changed_values'] : array(); + $this->options_defaults = apply_filters( "redux/options/{$this->args['opt_name']}/defaults", $this->options_defaults, $this->transients['changed_values'] ); + + return $this->options_defaults; + } + + /** + * Set default options on admin_init if option doesn't exist + * + * @since 1.0.0 + * @access public + * @return void + */ + private function _default_cleanup() { + + // Fix the global variable name + if ( $this->args['global_variable'] == "" && $this->args['global_variable'] !== false ) { + $this->args['global_variable'] = str_replace( '-', '_', $this->args['opt_name'] ); + } + } + + /** + * Class Add Sub Menu Function, creates options submenu in Wordpress admin area. + * + * @since 3.1.9 + * @access private + * @return void + */ + private function add_submenu( $page_parent, $page_title, $menu_title, $page_permissions, $page_slug ) { + global $submenu; + + // Just in case. One never knows. + $page_parent = strtolower( $page_parent ); + + $test = array( + 'index.php' => 'dashboard', + 'edit.php' => 'posts', + 'upload.php' => 'media', + 'link-manager.php' => 'links', + 'edit.php?post_type=page' => 'pages', + 'edit-comments.php' => 'comments', + 'themes.php' => 'theme', + 'plugins.php' => 'plugins', + 'users.php' => 'users', + 'tools.php' => 'management', + 'options-general.php' => 'options', + ); + + if ( isset ( $test[ $page_parent ] ) ) { + $function = 'add_' . $test[ $page_parent ] . '_page'; + $this->page = $function ( + $page_title, $menu_title, $page_permissions, $page_slug, array( $this, 'generate_panel' ) + ); + } else { + // Network settings and Post type menus. These do not have + // wrappers and need to be appened to using add_submenu_page. + // Okay, since we've left the post type menu appending + // as default, we need to validate it, so anything that + // isn't post_type= doesn't get through and mess + // things up. + $addMenu = false; + if ( 'settings.php' != $page_parent ) { + // Establish the needle + $needle = '?post_type='; + + // Check if it exists in the page_parent (how I miss instr) + $needlePos = strrpos( $page_parent, $needle ); + + // It's there, so... + if ( $needlePos > 0 ) { + + // Get the post type. + $postType = substr( $page_parent, $needlePos + strlen( $needle ) ); + + // Ensure it exists. + if ( post_type_exists( $postType ) ) { + // Set flag to add the menu page + $addMenu = true; + } + // custom menu + } elseif ( isset ( $submenu[ $this->args['page_parent'] ] ) ) { + $addMenu = true; + } else { + global $menu; + + foreach ( $menu as $menupriority => $menuitem ) { + $needle_menu_slug = isset ( $menuitem ) ? $menuitem[2] : false; + if ( $needle_menu_slug != false ) { + + // check if the current needle menu equals page_parent + if ( strcasecmp( $needle_menu_slug, $page_parent ) == 0 ) { + + // found an empty parent menu + $addMenu = true; + } + } + } + } + } else { + // The page_parent was settings.php, so set menu add + // flag to true. + $addMenu = true; + } + // Add the submenu if it's permitted. + if ( true == $addMenu ) { + $this->page = add_submenu_page( + $page_parent, $page_title, $menu_title, $page_permissions, $page_slug, array( + &$this, + 'generate_panel' + ) + ); + } + } + } + + /** + * Class Options Page Function, creates main options page. + * + * @since 1.0.0 + * @access public + * @return void + */ + public function _options_page() { + + if ( $this->args['menu_type'] == 'hidden' ) { + + // No menu to add! + } else if ( $this->args['menu_type'] == 'submenu' ) { + $this->add_submenu( + $this->args['page_parent'], $this->args['page_title'], $this->args['menu_title'], $this->args['page_permissions'], $this->args['page_slug'] + ); + } else { + $this->page = add_menu_page( + $this->args['page_title'], $this->args['menu_title'], $this->args['page_permissions'], $this->args['page_slug'], array( + &$this, + 'generate_panel' + ), $this->args['menu_icon'], $this->args['page_priority'] + ); + + if ( true === $this->args['allow_sub_menu'] ) { + if ( ! isset ( $section['type'] ) || $section['type'] != 'divide' ) { + foreach ( $this->sections as $k => $section ) { + $canBeSubSection = ( $k > 0 && ( ! isset ( $this->sections[ ( $k ) ]['type'] ) || $this->sections[ ( $k ) ]['type'] != "divide" ) ) ? true : false; + + if ( ! isset ( $section['title'] ) || ( $canBeSubSection && ( isset ( $section['subsection'] ) && $section['subsection'] == true ) ) ) { + continue; + } + + if ( isset ( $section['submenu'] ) && $section['submenu'] == false ) { + continue; + } + + if ( isset ( $section['customizer_only'] ) && $section['customizer_only'] == true ) { + continue; + } + + if ( isset ( $section['hidden'] ) && $section['hidden'] == true ) { + continue; + } + + add_submenu_page( + $this->args['page_slug'], $section['title'], $section['title'], $this->args['page_permissions'], $this->args['page_slug'] . '&tab=' . $k, + //create_function( '$a', "return null;" ) + '__return_null' + ); + } + + // Remove parent submenu item instead of adding null item. + remove_submenu_page( $this->args['page_slug'], $this->args['page_slug'] ); + } + + if ( true == $this->args['dev_mode'] ) { + $this->debug->add_submenu(); + } + + if ( true == $this->args['system_info'] ) { + add_submenu_page( + $this->args['page_slug'], __( 'System Info', 'legacy_framework' ), __( 'System Info', 'legacy_framework' ), $this->args['page_permissions'], $this->args['page_slug'] . '&tab=system_info_default', '__return_null' + ); + } + } + } + + add_action( "load-{$this->page}", array( &$this, '_load_page' ) ); + } +// _options_page() + + /** + * Add admin bar menu + * + * @since 3.1.5.16 + * @access public + * @global $menu , $submenu, $wp_admin_bar + * @return void + */ + public function _admin_bar_menu() { + global $menu, $submenu, $wp_admin_bar; + + $ct = wp_get_theme(); + $theme_data = $ct; + + if ( ! is_super_admin() || ! is_admin_bar_showing() || ! $this->args['admin_bar'] || $this->args['menu_type'] == 'hidden' ) { + return; + } + + if ( $menu ) { + foreach ( $menu as $menu_item ) { + if ( isset ( $menu_item[2] ) && $menu_item[2] === $this->args["page_slug"] ) { + + // Fetch the title + $title = empty ( $this->args['admin_bar_icon'] ) ? $menu_item[0] : '' . $menu_item[0]; + + $nodeargs = array( + 'id' => $menu_item[2], + 'title' => $title, + 'href' => admin_url( 'admin.php?page=' . $menu_item[2] ), + 'meta' => array() + ); + $wp_admin_bar->add_node( $nodeargs ); + + break; + } + } + + if ( isset ( $submenu[ $this->args["page_slug"] ] ) && is_array( $submenu[ $this->args["page_slug"] ] ) ) { + foreach ( $submenu[ $this->args["page_slug"] ] as $index => $redux_options_submenu ) { + $subnodeargs = array( + 'id' => $this->args["page_slug"] . '_' . $index, + 'title' => $redux_options_submenu[0], + 'parent' => $this->args["page_slug"], + 'href' => admin_url( 'admin.php?page=' . $redux_options_submenu[2] ), + ); + + $wp_admin_bar->add_node( $subnodeargs ); + } + } + + // Let's deal with external links + if ( isset ( $this->args['admin_bar_links'] ) ) { + + // Group for Main Root Menu (External Group) + $wp_admin_bar->add_node( array( + 'id' => $this->args["page_slug"] . '-external', + 'parent' => $this->args["page_slug"], + 'group' => true, + 'meta' => array( 'class' => 'ab-sub-secondary' ) + ) ); + + // Add Child Menus to External Group Menu + foreach ( $this->args['admin_bar_links'] as $link ) { + if ( ! isset ( $link['id'] ) ) { + $link['id'] = $this->args["page_slug"] . '-sub-' . sanitize_html_class( $link['title'] ); + } + $externalnodeargs = array( + 'id' => $link['id'], + 'title' => $link['title'], + 'parent' => $this->args["page_slug"] . '-external', + 'href' => $link['href'], + 'meta' => array( 'target' => '_blank' ) + ); + + $wp_admin_bar->add_node( $externalnodeargs ); + } + } + } else { + // Fetch the title + $title = empty ( $this->args['admin_bar_icon'] ) ? $this->args['menu_title'] : '' . $this->args['menu_title']; + + $nodeargs = array( + 'id' => $this->args["page_slug"], + 'title' => $title, + // $theme_data->get( 'Name' ) . " " . __( 'Options', 'legacy_framework' ), + 'href' => admin_url( 'admin.php?page=' . $this->args["page_slug"] ), + 'meta' => array() + ); + + $wp_admin_bar->add_node( $nodeargs ); + } + } +// _admin_bar_menu() + + /** + * Output dynamic CSS at bottom of HEAD + * + * @since 3.2.8 + * @access public + * @return void + */ + public function _output_css() { + if ( $this->args['output'] == false && $this->args['compiler'] == false ) { + return; + } + + if ( isset ( $this->no_output ) ) { + return; + } + + if ( ! empty ( $this->outputCSS ) && ( $this->args['output_tag'] == true || ( isset ( $_POST['customized'] ) ) ) ) { + echo ''; + } + } + + /** + * Enqueue CSS and Google fonts for front end + * + * @since 1.0.0 + * @access public + * @return void + */ + public function _enqueue_output() { + if ( $this->args['output'] == false && $this->args['compiler'] == false ) { + return; + } + + /** @noinspection PhpUnusedLocalVariableInspection */ + foreach ( $this->sections as $k => $section ) { + if ( isset ( $section['type'] ) && ( $section['type'] == 'divide' ) ) { + continue; + } + + if ( isset ( $section['fields'] ) ) { + /** @noinspection PhpUnusedLocalVariableInspection */ + foreach ( $section['fields'] as $fieldk => $field ) { + if ( isset ( $field['type'] ) && $field['type'] != "callback" ) { + $field_class = "ReduxFramework_{$field['type']}"; + if ( ! class_exists( $field_class ) ) { + + if ( ! isset ( $field['compiler'] ) ) { + $field['compiler'] = ""; + } + + /** + * Field class file + * filter 'redux/{opt_name}/field/class/{field.type} + * + * @param string field class file + * @param array $field field config data + */ + $class_file = apply_filters( "redux/{$this->args['opt_name']}/field/class/{$field['type']}", self::$_dir . "inc/fields/{$field['type']}/field_{$field['type']}.php", $field ); + + if ( $class_file && file_exists( $class_file ) && ! class_exists( $field_class ) ) { + /** @noinspection PhpIncludeInspection */ + require_once( $class_file ); + } + } + + if ( ! empty ( $this->options[ $field['id'] ] ) && class_exists( $field_class ) && method_exists( $field_class, 'output' ) && $this->_can_output_css( $field ) ) { + $field = apply_filters( "redux/field/{$this->args['opt_name']}/output_css", $field ); + + if ( ! empty ( $field['output'] ) && ! is_array( $field['output'] ) ) { + $field['output'] = array( $field['output'] ); + } + + $value = isset ( $this->options[ $field['id'] ] ) ? $this->options[ $field['id'] ] : ''; + $enqueue = new $field_class ( $field, $value, $this ); + + if ( ( ( isset ( $field['output'] ) && ! empty ( $field['output'] ) ) || ( isset ( $field['compiler'] ) && ! empty ( $field['compiler'] ) ) || $field['type'] == "typography" || $field['type'] == "icon_select" ) ) { + $enqueue->output(); + } + } + } + } + } + } + + // For use like in the customizer. Stops the output, but passes the CSS in the variable for the compiler + if ( isset ( $this->no_output ) ) { + return; + } + + if ( ! empty ( $this->typography ) && ! empty ( $this->typography ) && filter_var( $this->args['output'], FILTER_VALIDATE_BOOLEAN ) ) { + $version = ! empty ( $this->transients['last_save'] ) ? $this->transients['last_save'] : ''; + $typography = new ReduxFramework_typography ( null, null, $this ); + + if ( $this->args['async_typography'] && ! empty ( $this->typography ) ) { + $families = array(); + foreach ( $this->typography as $key => $value ) { + $families[] = $key; + } + ?> + + args['disable_google_fonts_link'] ) { + $protocol = ( ! empty ( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443 ) ? "https:" : "http:"; + + //echo ''; + wp_register_style( 'redux-google-fonts-' . $this->args['opt_name'], $protocol . $typography->makeGoogleWebfontLink( $this->typography ), '', $version ); + wp_enqueue_style( 'redux-google-fonts-' . $this->args['opt_name'] ); + } + } + } +// _enqueue_output() + + /** + * Enqueue CSS/JS for options page + * + * @since 1.0.0 + * @access public + * @global $wp_styles + * @return void + */ + public function _enqueue() { + include_once( 'core/enqueue.php' ); + $enqueue = new reduxCoreEnqueue ( $this ); + $enqueue->init(); + + +// if ($this->args['sass']['enabled']) { +// $ret = reduxSassCompiler::compile_sass($this); +// +// if ($ret == reduxSassCompiler::SASS_FILE_COMPILE || $ret == reduxSassCompiler::SASS_NO_COMPILE) { +// if (file_exists(ReduxFramework::$_upload_dir . $this->args['opt_name'] . '-redux.css')) { +// wp_enqueue_style( +// 'redux-fields-css', +// ReduxFramework::$_upload_url . $this->args['opt_name'] . '-redux.css', +// array(), +// $timestamp, +// 'all' +// ); +// } +// } +// } + } +// _enqueue() + + /** + * Show page help + * + * @since 1.0.0 + * @access public + * @return void + */ + public function _load_page() { + + // Do admin head action for this page + add_action( 'admin_head', array( &$this, 'admin_head' ) ); + + // Do admin footer text hook + add_filter( 'admin_footer_text', array( &$this, 'admin_footer_text' ) ); + + $screen = get_current_screen(); + + if ( is_array( $this->args['help_tabs'] ) ) { + foreach ( $this->args['help_tabs'] as $tab ) { + $screen->add_help_tab( $tab ); + } + } + + // If hint argument is set, display hint tab + if ( true == $this->show_hints ) { + global $current_user; + + // Users enable/disable hint choice + $hint_status = get_user_meta( $current_user->ID, 'ignore_hints' ) ? get_user_meta( $current_user->ID, 'ignore_hints', true ) : 'true'; + + // current page parameters + $curPage = $_GET['page']; + + $curTab = '0'; + if ( isset ( $_GET['tab'] ) ) { + $curTab = $_GET['tab']; + } + + // Default url values for enabling hints. + $dismiss = 'true'; + $s = __( 'Enable', 'legacy_framework' ); + + // Values for disabling hints. + if ( 'true' == $hint_status ) { + $dismiss = 'false'; + $s = __( 'Disable', 'legacy_framework' ); + } + + // Make URL + $url = '' . $s . ' hints'; + + $event = __( 'moving the mouse over', 'legacy_framework' ); + if ( 'click' == $this->args['hints']['tip_effect']['show']['event'] ) { + $event = __( 'clicking', 'legacy_framework' ); + } + + // Construct message + $msg = sprintf( __( 'Hints are tooltips that popup when %d the hint icon, offering addition information about the field in which they appear. They can be %d d by using the link below.', 'legacy_framework' ), $event, strtolower( $s ) ) . '

    ' . $url; + + // Construct hint tab + $tab = array( + 'id' => 'redux-hint-tab', + 'title' => __( 'Hints', 'legacy_framework' ), + 'content' => '

    ' . $msg . '

    ' + ); + + $screen->add_help_tab( $tab ); + } + + // Sidebar text + if ( $this->args['help_sidebar'] != '' ) { + + // Specify users text from arguments + $screen->set_help_sidebar( $this->args['help_sidebar'] ); + } else { + + // If sidebar text is empty and hints are active, display text + // about hints. + if ( true == $this->show_hints ) { + $screen->set_help_sidebar( '

    Redux Framework

    Hint Tooltip Preferences

    ' ); + } + } + + /** + * action 'redux-load-page-{opt_name}' + * + * @deprecated + * + * @param object $screen WP_Screen + */ + do_action( "redux-load-page-{$this->args['opt_name']}", $screen ); // REMOVE + + /** + * action 'redux/page/{opt_name}/load' + * + * @param object $screen WP_Screen + */ + do_action( "redux/page/{$this->args['opt_name']}/load", $screen ); + } +// _load_page() + + /** + * Do action redux-admin-head for options page + * + * @since 1.0.0 + * @access public + * @return void + */ + public function admin_head() { + /** + * action 'redux-admin-head-{opt_name}' + * + * @deprecated + * + * @param object $this ReduxFramework + */ + do_action( "redux-admin-head-{$this->args['opt_name']}", $this ); // REMOVE + + /** + * action 'redux/page/{opt_name}/header' + * + * @param object $this ReduxFramework + */ + do_action( "redux/page/{$this->args['opt_name']}/header", $this ); + } +// admin_head() + + /** + * Return footer text + * + * @since 2.0.0 + * @access public + * @return string $this->args['footer_credit'] + */ + public function admin_footer_text() { + return $this->args['footer_credit']; + } +// admin_footer_text() + + /** + * Return default output string for use in panel + * + * @since 3.1.5 + * @access public + * @return string default_output + */ + private function get_default_output_string( $field ) { + $default_output = ""; + + if ( ! isset ( $field['default'] ) ) { + $field['default'] = ""; + } + + if ( ! is_array( $field['default'] ) ) { + if ( ! empty ( $field['options'][ $field['default'] ] ) ) { + if ( ! empty ( $field['options'][ $field['default'] ]['alt'] ) ) { + $default_output .= $field['options'][ $field['default'] ]['alt'] . ', '; + } else { + // TODO: This serialize fix may not be the best solution. Look into it. PHP 5.4 error without serialize + if ( ! is_array( $field['options'][ $field['default'] ] ) ) { + $default_output .= $field['options'][ $field['default'] ] . ", "; + } else { + $default_output .= serialize( $field['options'][ $field['default'] ] ) . ", "; + } + } + } else if ( ! empty ( $field['options'][ $field['default'] ] ) ) { + $default_output .= $field['options'][ $field['default'] ] . ", "; + } else if ( ! empty ( $field['default'] ) ) { + if ( $field['type'] == 'switch' && isset ( $field['on'] ) && isset ( $field['off'] ) ) { + $default_output .= ( $field['default'] == 1 ? $field['on'] : $field['off'] ) . ', '; + } else { + $default_output .= $field['default'] . ', '; + } + } + } else { + foreach ( $field['default'] as $defaultk => $defaultv ) { + if ( ! empty ( $field['options'][ $defaultv ]['alt'] ) ) { + $default_output .= $field['options'][ $defaultv ]['alt'] . ', '; + } else if ( ! empty ( $field['options'][ $defaultv ] ) ) { + $default_output .= $field['options'][ $defaultv ] . ", "; + } else if ( ! empty ( $field['options'][ $defaultk ] ) ) { + $default_output .= $field['options'][ $defaultk ] . ", "; + } else if ( ! empty ( $defaultv ) ) { + $default_output .= $defaultv . ', '; + } + } + } + + if ( ! empty ( $default_output ) ) { + $default_output = __( 'Default', 'legacy_framework' ) . ": " . substr( $default_output, 0, - 2 ); + } + + if ( ! empty ( $default_output ) ) { + $default_output = '' . $default_output . '
    '; + } + + return $default_output; + } + +// get_default_output_string() + + public function get_header_html( $field ) { + global $current_user; + + // Set to empty string to avoid wanrings. + $hint = ''; + $th = ""; + + if ( isset ( $field['title'] ) && isset ( $field['type'] ) && $field['type'] !== "info" && $field['type'] !== "section" ) { + $default_mark = ( ! empty ( $field['default'] ) && isset ( $this->options[ $field['id'] ] ) && $this->options[ $field['id'] ] == $field['default'] && ! empty ( $this->args['default_mark'] ) && isset ( $field['default'] ) ) ? $this->args['default_mark'] : ''; + + // If a hint is specified in the field, process it. + if ( isset ( $field['hint'] ) && ! '' == $field['hint'] ) { + + // Set show_hints flag to true, so helptab will be displayed. + $this->show_hints = true; + + // Get user pref for displaying hints. + $metaVal = get_user_meta( $current_user->ID, 'ignore_hints', true ); + if ( 'true' == $metaVal || empty ( $metaVal ) ) { + + // Set hand cursor for clickable hints + $pointer = ''; + if ( isset ( $this->args['hints']['tip_effect']['show']['event'] ) && 'click' == $this->args['hints']['tip_effect']['show']['event'] ) { + $pointer = 'pointer'; + } + + $size = '16px'; + if ( 'large' == $this->args['hints']['icon_size'] ) { + $size = '18px'; + } + + // In case docs are ignored. + $titleParam = isset ( $field['hint']['title'] ) ? $field['hint']['title'] : ''; + $contentParam = isset ( $field['hint']['content'] ) ? $field['hint']['content'] : ''; + + $hint_color = isset ( $this->args['hints']['icon_color'] ) ? $this->args['hints']['icon_color'] : '#d3d3d3'; + + // Set hint html with appropriate position css + $hint = '
      
    '; + } + } + + if ( ! empty ( $field['title'] ) ) { + if ( 'left' == $this->args['hints']['icon_position'] ) { + $th = $hint . $field['title'] . $default_mark . ""; + } else { + $th = $field['title'] . $default_mark . "" . $hint; + } + } + + if ( isset ( $field['subtitle'] ) ) { + $th .= '' . $field['subtitle'] . ''; + } + } + + if ( ! empty ( $th ) ) { + $th = '
    ' . $th . '
    '; + } + + if ( $this->args['default_show'] === true && isset ( $field['default'] ) && isset ( $this->options[ $field['id'] ] ) && $this->options[ $field['id'] ] != $field['default'] && $field['type'] !== "info" && $field['type'] !== "group" && $field['type'] !== "section" && $field['type'] !== "editor" && $field['type'] !== "ace_editor" ) { + $th .= $this->get_default_output_string( $field ); + } + + return $th; + } + + /** + * Register Option for use + * + * @since 1.0.0 + * @access public + * @return void + */ + public function _register_settings() { + + // TODO - REMOVE + // Not used by new sample-config, but in here for legacy builds + // This is bad and can break things. Hehe. + if ( ! function_exists( 'wp_get_current_user' ) ) { + include( ABSPATH . "wp-includes/pluggable.php" ); + } + + register_setting( $this->args['opt_name'] . '_group', $this->args['opt_name'], array( + $this, + '_validate_options' + ) ); + + if ( is_null( $this->sections ) ) { + return; + } + + if ( empty( $this->options_defaults ) ) { + $this->options_defaults = $this->_default_values(); + } + + $runUpdate = false; + + foreach ( $this->sections as $k => $section ) { + if ( isset ( $section['type'] ) && $section['type'] == 'divide' ) { + continue; + } + + $display = true; + + if ( isset ( $_GET['page'] ) && $_GET['page'] == $this->args['page_slug'] ) { + if ( isset ( $section['panel'] ) && $section['panel'] == false ) { + $display = false; + } + } + + + // DOVY! Replace $k with $section['id'] when ready + /** + * filter 'redux-section-{index}-modifier-{opt_name}' + * + * @param array $section section configuration + */ + $section = apply_filters( "redux-section-{$k}-modifier-{$this->args['opt_name']}", $section ); + + /** + * filter 'redux/options/{opt_name}/section/{section.id}' + * + * @param array $section section configuration + */ + if ( isset ( $section['id'] ) ) { + $section = apply_filters( "redux/options/{$this->args['opt_name']}/section/{$section['id']}", $section ); + } + + if ( empty ( $section ) ) { + unset ( $this->sections[ $k ] ); + continue; + } + + if ( ! isset ( $section['title'] ) ) { + $section['title'] = ""; + } + + $heading = isset ( $section['heading'] ) ? $section['heading'] : $section['title']; + + if ( isset ( $section['permissions'] ) ) { + if ( ! current_user_can( $section['permissions'] ) ) { + $this->hidden_perm_sections[] = $section['title']; + + foreach ( $section['fields'] as $num => $field_data ) { + $field_type = $field_data['type']; + + if ( $field_type != 'section' || $field_type != 'divide' || $field_type != 'info' || $field_type != 'raw' ) { + $field_id = $field_data['id']; + $default = isset ( $this->options_defaults[ $field_id ] ) ? $this->options_defaults[ $field_id ] : ''; + $data = isset ( $this->options[ $field_id ] ) ? $this->options[ $field_id ] : $default; + + $this->hidden_perm_fields[ $field_id ] = $data; + } + } + + continue; + } + } + + if ( ! $display ) { + $this->no_panel_section[ $k ] = $section; + } else { + add_settings_section( $this->args['opt_name'] . $k . '_section', $heading, array( + &$this, + '_section_desc' + ), $this->args['opt_name'] . $k . '_section_group' ); + } + + $sectionIndent = false; + if ( isset ( $section['fields'] ) ) { + foreach ( $section['fields'] as $fieldk => $field ) { + if ( ! isset ( $field['type'] ) ) { + continue; // You need a type! + } + + if ( $field['type'] == "info" && isset( $field['raw_html'] ) && $field['raw_html'] == true ) { + $field['type'] = "raw"; + $field['content'] = $field['desc']; + $field['desc'] = ""; + $this->sections[ $k ]['fields'][ $fieldk ] = $field; + } else if ( $field['type'] == "info" ) { + if ( ! isset( $field['full_width'] ) ) { + $field['full_width'] = true; + $this->sections[ $k ]['fields'][ $fieldk ] = $field; + } + } + + if ( $field['type'] == "raw" ) { + if ( isset( $field['align'] ) ) { + $field['full_width'] = $field['align'] ? false : true; + unset( $field['align'] ); + } else if ( ! isset( $field['full_width'] ) ) { + $field['full_width'] = true; + } + $this->sections[ $k ]['fields'][ $fieldk ] = $field; + } + + + /** + * filter 'redux/options/{opt_name}/field/{field.id}' + * + * @param array $field field config + */ + $field = apply_filters( "redux/options/{$this->args['opt_name']}/field/{$field['id']}/register", $field ); + + + $this->field_types[ $field['type'] ] = isset ( $this->field_types[ $field['type'] ] ) ? $this->field_types[ $field['type'] ] : array(); + + $this->field_sections[ $field['type'] ][ $field['id'] ] = $k; + + $display = true; + + if ( isset ( $_GET['page'] ) && $_GET['page'] == $this->args['page_slug'] ) { + if ( isset ( $field['panel'] ) && $field['panel'] == false ) { + $display = false; + } + } + if ( isset ( $field['customizer_only'] ) && $field['customizer_only'] == true ) { + //$display = false; + } + + if ( isset ( $field['permissions'] ) ) { + + if ( ! current_user_can( $field['permissions'] ) ) { + $data = isset ( $this->options[ $field['id'] ] ) ? $this->options[ $field['id'] ] : $this->options_defaults[ $field['id'] ]; + + $this->hidden_perm_fields[ $field['id'] ] = $data; + + continue; + } + } + + if ( ! isset ( $field['id'] ) ) { + echo '

    No field ID is set.

    ';
    +                                print_r( $field );
    +                                echo "

    "; + continue; + } + + if ( isset ( $field['type'] ) && $field['type'] == "section" ) { + if ( isset ( $field['indent'] ) && $field['indent'] == true ) { + $sectionIndent = true; + } else { + $sectionIndent = false; + } + } + + if ( isset ( $field['type'] ) && $field['type'] == "info" && $sectionIndent ) { + $field['indent'] = $sectionIndent; + } + + $th = $this->get_header_html( $field ); + + $field['name'] = $this->args['opt_name'] . '[' . $field['id'] . ']'; + + // Set the default value if present + $this->options_defaults[ $field['id'] ] = isset ( $this->options_defaults[ $field['id'] ] ) ? $this->options_defaults[ $field['id'] ] : ''; + + // Set the defaults to the value if not present + $doUpdate = false; + + // Check fields for values in the default parameter + if ( ! isset ( $this->options[ $field['id'] ] ) && isset ( $field['default'] ) ) { + $this->options_defaults[ $field['id'] ] = $this->options[ $field['id'] ] = $field['default']; + $doUpdate = true; + + // Check fields that hae no default value, but an options value with settings to + // be saved by default + } elseif ( ! isset ( $this->options[ $field['id'] ] ) && isset ( $field['options'] ) ) { + + // If sorter field, check for options as save them as defaults + if ( $field['type'] == 'sorter' || $field['type'] == 'sortable' ) { + $this->options_defaults[ $field['id'] ] = $this->options[ $field['id'] ] = $field['options']; + $doUpdate = true; + } + } + + // CORRECT URLS if media URLs are wrong, but attachment IDs are present. + if ( $field['type'] == "media" ) { + if ( isset ( $this->options[ $field['id'] ]['id'] ) && isset ( $this->options[ $field['id'] ]['url'] ) && ! empty ( $this->options[ $field['id'] ]['url'] ) && strpos( $this->options[ $field['id'] ]['url'], str_replace( 'http://', '', WP_CONTENT_URL ) ) === false ) { + $data = wp_get_attachment_url( $this->options[ $field['id'] ]['id'] ); + + if ( isset ( $data ) && ! empty ( $data ) ) { + $this->options[ $field['id'] ]['url'] = $data; + $data = wp_get_attachment_image_src( $this->options[ $field['id'] ]['id'], array( + 150, + 150 + ) ); + $this->options[ $field['id'] ]['thumbnail'] = $data[0]; + $doUpdate = true; + } + } + } + + if ( $field['type'] == "background" ) { + if ( isset ( $this->options[ $field['id'] ]['media']['id'] ) && isset ( $this->options[ $field['id'] ]['background-image'] ) && ! empty ( $this->options[ $field['id'] ]['background-image'] ) && strpos( $this->options[ $field['id'] ]['background-image'], str_replace( 'http://', '', WP_CONTENT_URL ) ) === false ) { + $data = wp_get_attachment_url( $this->options[ $field['id'] ]['media']['id'] ); + + if ( isset ( $data ) && ! empty ( $data ) ) { + $this->options[ $field['id'] ]['background-image'] = $data; + $data = wp_get_attachment_image_src( $this->options[ $field['id'] ]['media']['id'], array( + 150, + 150 + ) ); + $this->options[ $field['id'] ]['media']['thumbnail'] = $data[0]; + $doUpdate = true; + } + } + } + + if ( $field['type'] == "slides" ) { + if ( isset ( $this->options[ $field['id'] ] ) && is_array( $this->options[ $field['id'] ] ) && isset ( $this->options[ $field['id'] ][0]['attachment_id'] ) && isset ( $this->options[ $field['id'] ][0]['image'] ) && ! empty ( $this->options[ $field['id'] ][0]['image'] ) && strpos( $this->options[ $field['id'] ][0]['image'], str_replace( 'http://', '', WP_CONTENT_URL ) ) === false ) { + foreach ( $this->options[ $field['id'] ] as $key => $val ) { + $data = wp_get_attachment_url( $val['attachment_id'] ); + + if ( isset ( $data ) && ! empty ( $data ) ) { + $this->options[ $field['id'] ][ $key ]['image'] = $data; + $data = wp_get_attachment_image_src( $val['attachment_id'], array( + 150, + 150 + ) ); + $this->options[ $field['id'] ][ $key ]['thumb'] = $data[0]; + $doUpdate = true; + } + } + } + } + // END -> CORRECT URLS if media URLs are wrong, but attachment IDs are present. + + if ( true == $doUpdate && ! isset ( $this->never_save_to_db ) ) { + if ( $this->args['save_defaults'] ) { // Only save that to the DB if allowed to + $runUpdate = true; + } + // elseif($this->saved != '' && $this->saved != false) { + // $runUpdate = true; + //} + } + + if ( ! isset ( $field['class'] ) ) { // No errors please + $field['class'] = ""; + } + $id = $field['id']; + + /** + * filter 'redux-field-{field.id}modifier-{opt_name}' + * + * @deprecated + * + * @param array $field field config + */ + $field = apply_filters( "redux-field-{$field['id']}modifier-{$this->args['opt_name']}", $field ); // REMOVE LATER + + /** + * filter 'redux/options/{opt_name}/field/{field.id}' + * + * @param array $field field config + */ + $field = apply_filters( "redux/options/{$this->args['opt_name']}/field/{$field['id']}", $field ); + + if ( empty ( $field ) || ! $field || $field == false ) { + unset ( $this->sections[ $k ]['fields'][ $fieldk ] ); + continue; + } + + if ( ! empty ( $this->folds[ $field['id'] ]['parent'] ) ) { // This has some fold items, hide it by default + $field['class'] .= " fold"; + } + + if ( ! empty ( $this->folds[ $field['id'] ]['children'] ) ) { // Sets the values you shoe fold children on + $field['class'] .= " foldParent"; + } + + if ( ! empty ( $field['compiler'] ) ) { + $field['class'] .= " compiler"; + $this->compiler_fields[ $field['id'] ] = 1; + } + + if ( isset ( $field['unit'] ) && ! isset ( $field['units'] ) ) { + $field['units'] = $field['unit']; + unset ( $field['unit'] ); + } + + $this->sections[ $k ]['fields'][ $fieldk ] = $field; + + if ( isset ( $this->args['display_source'] ) ) { + $th .= ''; + $th .= '
    View Source'; + } + + /** + * action 'redux/options/{opt_name}/field/field.type}/register' + */ + do_action( "redux/options/{$this->args['opt_name']}/field/{$field['type']}/register", $field ); + + $this->check_dependencies( $field ); + + if ( ! $display || isset ( $this->no_panel_section[ $k ] ) ) { + $this->no_panel[] = $field['id']; + } else { + if ( isset ( $field['hidden'] ) && $field['hidden'] ) { + $field['label_for'] = 'redux_hide_field'; + } + + add_settings_field( + "{$fieldk}_field", $th, array( + &$this, + '_field_input' + ), "{$this->args['opt_name']}{$k}_section_group", "{$this->args['opt_name']}{$k}_section", $field + ); + + } + } + } + } + + /** + * action 'redux-register-settings-{opt_name}' + * + * @deprecated + */ + do_action( "redux-register-settings-{$this->args['opt_name']}" ); // REMOVE + + /** + * action 'redux/options/{opt_name}/register' + * + * @param array option sections + */ + do_action( "redux/options/{$this->args['opt_name']}/register", $this->sections ); + + if ( $runUpdate && ! isset ( $this->never_save_to_db ) ) { // Always update the DB with new fields + $this->set_options( $this->options ); + } + + if ( isset ( $this->transients['run_compiler'] ) && $this->transients['run_compiler'] ) { + + $this->no_output = true; + $this->_enqueue_output(); + + + /** + * action 'redux-compiler-{opt_name}' + * + * @deprecated + * + * @param array options + * @param string CSS that get sent to the compiler hook + */ + do_action( "redux-compiler-{$this->args['opt_name']}", $this->options, $this->compilerCSS, $this->transients['changed_values'] ); // REMOVE + + /** + * action 'redux/options/{opt_name}a' + * + * @param array options + * @param string CSS that get sent to the compiler hook + */ + do_action( "redux/options/{$this->args['opt_name']}/compiler", $this->options, $this->compilerCSS, $this->transients['changed_values'] ); + + /** + * action 'redux/options/{opt_name}/compiler/advanced' + * + * @param array options + * @param string CSS that get sent to the compiler hook, which sends the full Redux object + */ + do_action( "redux/options/{$this->args['opt_name']}/compiler/advanced", $this ); + + unset ( $this->transients['run_compiler'] ); + $this->set_transients(); + } + } +// _register_settings() + + /** + * Register Extensions for use + * + * @since 3.0.0 + * @access public + * @return void + */ + private function _register_extensions() { + $path = dirname( __FILE__ ) . '/inc/extensions/'; + $folders = scandir( $path, 1 ); + + /** + * action 'redux/extensions/{opt_name}/before' + * + * @param object $this ReduxFramework + */ + do_action( "redux/extensions/{$this->args['opt_name']}/before", $this ); + + foreach ( $folders as $folder ) { if($folder != "customizer"){ + if ( $folder === '.' || $folder === '..' || ! is_dir( $path . $folder ) || substr( $folder, 0, 1 ) === '.' || substr( $folder, 0, 1 ) === '@' || substr( $folder, 0, 4 ) === '_vti' ) { + continue; + } + + $extension_class = 'ReduxFramework_Extension_' . $folder; + + /** + * filter 'redux-extensionclass-load' + * + * @deprecated + * + * @param string extension class file path + * @param string $extension_class extension class name + */ + $class_file = apply_filters( "redux-extensionclass-load", "$path/$folder/extension_{$folder}.php", $extension_class ); // REMOVE LATER + + /** + * filter 'redux/extension/{opt_name}/{folder}' + * + * @param string extension class file path + * @param string $extension_class extension class name + */ + $class_file = apply_filters( "redux/extension/{$this->args['opt_name']}/$folder", "$path/$folder/extension_{$folder}.php", $class_file ); + + if ( $class_file ) { + if ( file_exists( $class_file ) ) { + require_once( $class_file ); + } + + $this->extensions[ $folder ] = new $extension_class ( $this ); + } + }} + + /** + * action 'redux-register-extensions-{opt_name}' + * + * @deprecated + * + * @param object $this ReduxFramework + */ + do_action( "redux-register-extensions-{$this->args['opt_name']}", $this ); // REMOVE + + /** + * action 'redux/extensions/{opt_name}' + * + * @param object $this ReduxFramework + */ + do_action( "redux/extensions/{$this->args['opt_name']}", $this ); + } + + private function get_transients() { + if ( ! isset ( $this->transients ) ) { + $this->transients = get_option( $this->args['opt_name'] . '-transients', array() ); + $this->transients_check = $this->transients; + } + } + + public function set_transients() { + if ( ! isset ( $this->transients ) || ! isset ( $this->transients_check ) || $this->transients != $this->transients_check ) { + update_option( $this->args['opt_name'] . '-transients', $this->transients ); + $this->transients_check = $this->transients; + } + } + + /** + * Validate the Options options before insertion + * + * @since 3.0.0 + * @access public + * + * @param array $plugin_options The options array + * + * @return array|mixed|string|void + */ + public function _validate_options( $plugin_options ) { +//print_r($plugin_options); + // exit(); + if ( isset ( $this->validation_ran ) ) { + return $plugin_options; + } + $this->validation_ran = 1; + + // Save the values not in the panel + if ( isset ( $plugin_options['redux-no_panel'] ) ) { + $keys = explode( '|', $plugin_options['redux-no_panel'] ); + foreach ( $keys as $key ) { + $plugin_options[ $key ] = $this->options[ $key ]; + } + if ( isset ( $plugin_options['redux-no_panel'] ) ) { + unset ( $plugin_options['redux-no_panel'] ); + } + } + + if ( ! empty ( $this->hidden_perm_fields ) && is_array( $this->hidden_perm_fields ) ) { + foreach ( $this->hidden_perm_fields as $id => $data ) { + $plugin_options[ $id ] = $data; + } + } + + if ( $plugin_options == $this->options ) { + return $plugin_options; + } + + $time = time(); + + // Sets last saved time + $this->transients['last_save'] = $time; + + // Import + if ( ( isset( $plugin_options['import_code'] ) && ! empty( $plugin_options['import_code'] ) ) || ( isset( $plugin_options['import_link'] ) && ! empty( $plugin_options['import_link'] ) ) ) { + $this->transients['last_save_mode'] = "import"; // Last save mode + $this->transients['last_compiler'] = $time; + $this->transients['last_import'] = $time; + $this->transients['run_compiler'] = 1; + + if ( $plugin_options['import_code'] != '' ) { + $import = $plugin_options['import_code']; + } elseif ( $plugin_options['import_link'] != '' ) { + $import = wp_remote_retrieve_body( wp_remote_get( $plugin_options['import_link'] ) ); + } + + if ( ! empty ( $import ) ) { + $imported_options = json_decode( $import, true ); + } + + if ( ! empty ( $imported_options ) && is_array( $imported_options ) && isset ( $imported_options['redux-backup'] ) && $imported_options['redux-backup'] == '1' ) { + + $this->transients['changed_values'] = array(); + foreach ( $plugin_options as $key => $value ) { + if ( isset ( $imported_options[ $key ] ) && $imported_options[ $key ] != $value ) { + $this->transients['changed_values'][ $key ] = $value; + $plugin_options[ $key ] = $value; + } + } + + /** + * action 'redux/options/{opt_name}/import' + * + * @param &array [&$plugin_options, redux_options] + */ + do_action_ref_array( "redux/options/{$this->args['opt_name']}/import", array( + &$plugin_options, + $imported_options, + $this->transients['changed_values'] + ) ); + + setcookie( 'redux_current_tab', '', 1, '/', $time + 1000, "/" ); + $_COOKIE['redux_current_tab'] = 1; + + unset ( $plugin_options['defaults'], $plugin_options['compiler'], $plugin_options['import'], $plugin_options['import_code'] ); + if ( $this->args['database'] == 'transient' || $this->args['database'] == 'theme_mods' || $this->args['database'] == 'theme_mods_expanded' || $this->args['database'] == 'network' ) { + $this->set_options( $plugin_options ); + + return; + } + + $plugin_options = wp_parse_args( $imported_options, $plugin_options ); + + $this->set_transients(); // Update the transients + + return $plugin_options; + } + } + + // Reset all to defaults + if ( ! empty ( $plugin_options['defaults'] ) ) { + if ( empty ( $this->options_defaults ) ) { + $this->options_defaults = $this->_default_values(); + } + + /** + * apply_filters 'redux/validate/{opt_name}/defaults' + * + * @param &array [ $this->options_defaults, $plugin_options] + */ + $plugin_options = apply_filters( "redux/validate/{$this->args['opt_name']}/defaults", $this->options_defaults ); + + // Section reset + //setcookie('redux-compiler-' . $this->args['opt_name'], 1, time() + 3000, '/'); + + + $this->transients['changed_values'] = array(); + + if ( empty ( $this->options ) ) { + $this->options = $this->options_defaults; + } + + foreach ( $this->options as $key => $value ) { + if ( isset ( $plugin_options[ $key ] ) && $value != $plugin_options[ $key ] ) { + $this->transients['changed_values'][ $key ] = $value; + } + } + + $this->transients['run_compiler'] = 1; + $this->transients['last_save_mode'] = "defaults"; // Last save mode + //setcookie('redux-compiler-' . $this->args['opt_name'], 1, time() + 1000, "/"); + //setcookie("redux-saved-{$this->args['opt_name']}", 'defaults', time() + 1000, "/"); + + $this->set_transients(); // Update the transients + + return $plugin_options; + } + + // Section reset to defaults + if ( ! empty ( $plugin_options['defaults-section'] ) ) { + if ( isset ( $plugin_options['redux-section'] ) && isset ( $this->sections[ $plugin_options['redux-section'] ]['fields'] ) ) { + /** + * apply_filters 'redux/validate/{opt_name}/defaults_section' + * + * @param &array [ $this->options_defaults, $plugin_options] + */ + foreach ( $this->sections[ $plugin_options['redux-section'] ]['fields'] as $field ) { + if ( isset ( $this->options_defaults[ $field['id'] ] ) ) { + $plugin_options[ $field['id'] ] = $this->options_defaults[ $field['id'] ]; + } else { + $plugin_options[ $field['id'] ] = ""; + } + + if ( isset ( $field['compiler'] ) ) { + $compiler = true; + } + } + + $plugin_options = apply_filters( "redux/validate/{$this->args['opt_name']}/defaults_section", $plugin_options ); + } + + $this->transients['changed_values'] = array(); + foreach ( $this->options as $key => $value ) { + if ( isset ( $plugin_options[ $key ] ) && $value != $plugin_options[ $key ] ) { + $this->transients['changed_values'][ $key ] = $value; + } + } + + if ( isset ( $compiler ) ) { + //$this->run_compiler = true; + //setcookie('redux-compiler-' . $this->args['opt_name'], 1, time()+1000, '/'); + //$plugin_options['REDUX_COMPILER'] = time(); + $this->transients['last_compiler'] = $time; + $this->transients['run_compiler'] = 1; + } + + $this->transients['last_save_mode'] = "defaults_section"; // Last save mode + //setcookie("redux-saved-{$this->args['opt_name']}", 'defaults_section', time() + 1000, "/"); + unset ( $plugin_options['defaults'], $plugin_options['defaults_section'], $plugin_options['import'], $plugin_options['import_code'], $plugin_options['import_link'], $plugin_options['compiler'], $plugin_options['redux-section'] ); + + $this->set_transients(); + + return $plugin_options; + } + +// if ($this->transients['last_save_mode'] != 'remove') { + $this->transients['last_save_mode'] = "normal"; // Last save mode +// } else { +// $this->transients['last_save_mode'] = ''; +// } + + /** + * apply_filters 'redux/validate/{opt_name}/before_validation' + * + * @param &array [&$plugin_options, redux_options] + */ + $plugin_options = apply_filters( "redux/validate/{$this->args['opt_name']}/before_validation", $plugin_options, $this->options ); + + // Validate fields (if needed) + $plugin_options = $this->_validate_values( $plugin_options, $this->options, $this->sections ); + + if ( ! empty ( $this->errors ) || ! empty ( $this->warnings ) ) { + $this->transients['notices'] = array( 'errors' => $this->errors, 'warnings' => $this->warnings ); + } + + /** + * action 'redux-validate-{opt_name}' + * + * @deprecated + * + * @param &array [&$plugin_options, redux_options] + */ + do_action_ref_array( "redux-validate-{$this->args['opt_name']}", array( + &$plugin_options, + $this->options + ) ); // REMOVE + + if ( ! isset ( $this->transients['changed_values'] ) ) { + $this->transients['changed_values'] = array(); + } + + /** + * action 'redux/options/{opt_name}/validate' + * + * @param &array [&$plugin_options, redux_options] + */ + do_action_ref_array( "redux/options/{$this->args['opt_name']}/validate", array( + &$plugin_options, + $this->options, + $this->transients['changed_values'] + ) ); + + if ( ! empty ( $plugin_options['compiler'] ) ) { + unset ( $plugin_options['compiler'] ); + + $this->transients['last_compiler'] = $time; + $this->transients['run_compiler'] = 1; + } + + $this->transients['changed_values'] = array(); // Changed values since last save + foreach ( $this->options as $key => $value ) { + if ( isset ( $plugin_options[ $key ] ) && $value != $plugin_options[ $key ] ) { + $this->transients['changed_values'][ $key ] = $value; + } + } + + unset ( $plugin_options['defaults'], $plugin_options['defaults_section'], $plugin_options['import'], $plugin_options['import_code'], $plugin_options['import_link'], $plugin_options['compiler'], $plugin_options['redux-section'] ); + if ( $this->args['database'] == 'transient' || $this->args['database'] == 'theme_mods' || $this->args['database'] == 'theme_mods_expanded' ) { + $this->set_options( $plugin_options ); + + return; + } + + if ( defined( 'WP_CACHE' ) && WP_CACHE && class_exists( 'W3_ObjectCache' ) ) { + //echo "here"; + $w3 = W3_ObjectCache::instance(); + $key = $w3->_get_cache_key( $this->args['opt_name'] . '-transients', 'transient' ); + //echo $key; + $w3->delete( $key, 'transient', true ); + //set_transient($this->args['opt_name'].'-transients', $this->transients); + //exit(); + } + + $this->set_transients( $this->transients ); + + return $plugin_options; + } + + public function ajax_save() { + + if ( ! wp_verify_nonce( $_REQUEST['nonce'], "redux_ajax_nonce" ) ) { + json_encode( array( + 'status' => __( 'Invalid security credential, please reload the page and try again.', 'legacy_framework' ), + 'action' => 'reload' + ) ); + die(); + } + $redux = ReduxFrameworkInstances::get_instance( $_POST['opt_name'] ); + + if ( ! empty ( $_POST['data'] ) && ! empty ( $redux->args['opt_name'] ) ) { + + $values = array(); + //if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) { + // $process = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST); + // while (list($key, $val) = each($process)) { + // foreach ($val as $k => $v) { + // unset($process[$key][$k]); + // if (is_array($v)) { + // $process[$key][stripslashes($k)] = $v; + // $process[] = &$process[$key][stripslashes($k)]; + // } else { + // $process[$key][stripslashes($k)] = stripslashes($v); + // } + // } + // } + // unset($process); + //} + $_POST['data'] = stripslashes( $_POST['data'] ); + parse_str( $_POST['data'], $values ); + $values = $values[ $redux->args['opt_name'] ]; + + + if ( function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc() ) { + $values = array_map( 'stripslashes_deep', $values ); + } + + //$beforeDeep = $values; + //// Ace editor hack for < PHP 5.4. Oy + //if ( isset( $this->fields['ace_editor'] ) ) { + // if ( function_exists( 'get_magic_quotes_gpc' ) && get_magic_quotes_gpc() ) { + // foreach ( $this->fields['ace_editor'] as $id => $v ) { + // if ( version_compare( phpversion(), '5.4', '<' ) ) { + // $values[ $id ] = stripslashes( $beforeDeep[ $id ] ); + // } else { + // $values[ $id ] = $beforeDeep[ $id ]; + // } + // } + // } + //} + + if ( ! empty ( $values ) ) { + + try { + if ( isset ( $redux->validation_ran ) ) { + unset ( $redux->validation_ran ); + } + $redux->set_options( $redux->_validate_options( $values ) ); + + if ( ( isset ( $values['defaults'] ) && ! empty ( $values['defaults'] ) ) || ( isset ( $values['defaults-section'] ) && ! empty ( $values['defaults-section'] ) ) ) { + echo json_encode( array( 'status' => 'success', 'action' => 'reload' ) ); + die (); + } + + include_once( 'core/enqueue.php' ); + $enqueue = new reduxCoreEnqueue ( $redux ); + $enqueue->get_warnings_and_errors_array(); + + include_once( 'core/panel.php' ); + $panel = new reduxCorePanel ( $redux ); + ob_start(); + $panel->notification_bar(); + $notification_bar = ob_get_contents(); + ob_end_clean(); + + $success = array( + 'status' => 'success', + 'options' => $redux->options, + 'errors' => isset ( $redux->localize_data['errors'] ) ? $redux->localize_data['errors'] : null, + 'warnings' => isset ( $redux->localize_data['warnings'] ) ? $redux->localize_data['warnings'] : null, + 'notification_bar' => $notification_bar + ); + + + echo json_encode( $success ); + } catch ( Exception $e ) { + echo json_encode( array( 'status' => $e->getMessage() ) ); + } + } else { + echo json_encode( array( 'status' => __( 'Your panel has no fields. Nothing to save.', 'legacy_framework' ) ) ); + } + } + if ( isset ( $this->transients['run_compiler'] ) && $this->transients['run_compiler'] ) { + + $this->no_output = true; + $this->_enqueue_output(); + + + /** + * action 'redux-compiler-{opt_name}' + * + * @deprecated + * + * @param array options + * @param string CSS that get sent to the compiler hook + */ + do_action( "redux-compiler-{$this->args['opt_name']}", $this->options, $this->compilerCSS, $this->transients['changed_values'] ); // REMOVE + + /** + * action 'redux/options/{opt_name}/compiler' + * + * @param array options + * @param string CSS that get sent to the compiler hook + */ + do_action( "redux/options/{$this->args['opt_name']}/compiler", $this->options, $this->compilerCSS, $this->transients['changed_values'] ); + + /** + * action 'redux/options/{opt_name}/compiler/advanced' + * + * @param array options + * @param string CSS that get sent to the compiler hook, which sends the full Redux object + */ + do_action( "redux/options/{$this->args['opt_name']}/compiler/advanced", $this ); + + unset ( $this->transients['run_compiler'] ); + $this->set_transients(); + } + + die (); + } + + /** + * Validate values from options form (used in settings api validate function) + * calls the custom validation class for the field so authors can override with custom classes + * + * @since 1.0.0 + * @access public + * + * @param array $plugin_options + * @param array $options + * + * @return array $plugin_options + */ + public function _validate_values( $plugin_options, $options, $sections ) { + foreach ( $sections as $k => $section ) { + if ( isset ( $section['fields'] ) ) { + foreach ( $section['fields'] as $fkey => $field ) { + + if ( is_array( $field ) ) { + $field['section_id'] = $k; + } + + if ( isset ( $field['type'] ) && ( $field['type'] == 'checkbox' || $field['type'] == 'checkbox_hide_below' || $field['type'] == 'checkbox_hide_all' ) ) { + if ( ! isset ( $plugin_options[ $field['id'] ] ) ) { + $plugin_options[ $field['id'] ] = 0; + } + } + + // Default 'not_empty 'flag to false. + $isNotEmpty = false; + + // Make sure 'validate' field is set. + if ( isset ( $field['validate'] ) ) { + + // Make sure 'validate field' is set to 'not_empty' or 'email_not_empty' + if ( $field['validate'] == 'not_empty' || $field['validate'] == 'email_not_empty' || $field['validate'] == 'numeric_not_empty' ) { + + // Set the flag. + $isNotEmpty = true; + } + } + + // Check for empty id value + + if ( ! isset ( $field['id'] ) || ! isset ( $plugin_options[ $field['id'] ] ) || ( isset ( $plugin_options[ $field['id'] ] ) && $plugin_options[ $field['id'] ] == '' ) ) { + + // If we are looking for an empty value, in the case of 'not_empty' + // then we need to keep processing. + if ( ! $isNotEmpty ) { + + // Empty id and not checking for 'not_empty. Bail out... + continue; + } + } + + // Force validate of custom field types + if ( isset ( $field['type'] ) && ! isset ( $field['validate'] ) ) { + if ( $field['type'] == 'color' || $field['type'] == 'color_gradient' ) { + $field['validate'] = 'color'; + } elseif ( $field['type'] == 'date' ) { + $field['validate'] = 'date'; + } + } + + if ( isset ( $field['validate'] ) ) { + $validate = 'Redux_Validation_' . $field['validate']; + + if ( ! class_exists( $validate ) ) { + /** + * filter 'redux-validateclass-load' + * + * @deprecated + * + * @param string validation class file path + * @param string $validate validation class name + */ + $class_file = apply_filters( "redux-validateclass-load", self::$_dir . "inc/validation/{$field['validate']}/validation_{$field['validate']}.php", $validate ); // REMOVE LATER + + /** + * filter 'redux/validate/{opt_name}/class/{field.validate}' + * + * @param string validation class file path + * @param string $class_file validation class file path + */ + $class_file = apply_filters( "redux/validate/{$this->args['opt_name']}/class/{$field['validate']}", self::$_dir . "inc/validation/{$field['validate']}/validation_{$field['validate']}.php", $class_file ); + + if ( $class_file ) { + if ( file_exists( $class_file ) ) { + require_once( $class_file ); + } + } + } + + if ( class_exists( $validate ) ) { + + //!DOVY - DB saving stuff. Is this right? + if ( empty ( $options[ $field['id'] ] ) ) { + $options[ $field['id'] ] = ''; + } + + if ( isset ( $plugin_options[ $field['id'] ] ) && is_array( $plugin_options[ $field['id'] ] ) && ! empty ( $plugin_options[ $field['id'] ] ) ) { + foreach ( $plugin_options[ $field['id'] ] as $key => $value ) { + $before = $after = null; + if ( isset ( $plugin_options[ $field['id'] ][ $key ] ) && ( ! empty ( $plugin_options[ $field['id'] ][ $key ] ) || $plugin_options[ $field['id'] ][ $key ] == '0' ) ) { + if ( is_array( $plugin_options[ $field['id'] ][ $key ] ) ) { + $before = $plugin_options[ $field['id'] ][ $key ]; + } else { + $before = trim( $plugin_options[ $field['id'] ][ $key ] ); + } + } + + if ( isset ( $options[ $field['id'] ][ $key ] ) && ( ! empty ( $plugin_options[ $field['id'] ][ $key ] ) || $plugin_options[ $field['id'] ][ $key ] == '0' ) ) { + $after = $options[ $field['id'] ][ $key ]; + } + + $validation = new $validate ( $this, $field, $before, $after ); + if ( ! empty ( $validation->value ) || $validation->value == '0' ) { + $plugin_options[ $field['id'] ][ $key ] = $validation->value; + } else { + unset ( $plugin_options[ $field['id'] ][ $key ] ); + } + + if ( isset ( $validation->error ) ) { + $this->errors[] = $validation->error; + } + + if ( isset ( $validation->warning ) ) { + $this->warnings[] = $validation->warning; + } + } + } else { + if ( is_array( $plugin_options[ $field['id'] ] ) ) { + $pofi = $plugin_options[ $field['id'] ]; + } else { + $pofi = trim( $plugin_options[ $field['id'] ] ); + } + + $validation = new $validate ( $this, $field, $pofi, $options[ $field['id'] ] ); + $plugin_options[ $field['id'] ] = $validation->value; + + if ( isset ( $validation->error ) ) { + $this->errors[] = $validation->error; + } + + if ( isset ( $validation->warning ) ) { + $this->warnings[] = $validation->warning; + } + } + + continue; + } + } + if ( isset ( $field['validate_callback'] ) && ( is_callable( $field['validate_callback'] ) || ( is_string( $field['validate_callback'] ) && function_exists( $field['validate_callback'] ) ) ) ) { + $callback = $field['validate_callback']; + unset ( $field['validate_callback'] ); + + $callbackvalues = call_user_func( $callback, $field, $plugin_options[ $field['id'] ], $options[ $field['id'] ] ); + $plugin_options[ $field['id'] ] = $callbackvalues['value']; + + if ( isset ( $callbackvalues['error'] ) ) { + $this->errors[] = $callbackvalues['error']; + } + // TODO - This warning message is failing. Hmm. + if ( isset ( $callbackvalues['warning'] ) ) { + $this->warnings[] = $callbackvalues['warning']; + } + } + } + } + } + + return $plugin_options; + } + + /** + * Return Section Menu HTML + * + * @since 3.1.5 + * @access public + * @return void + */ + public function section_menu( $k, $section, $suffix = "", $sections = array() ) { + $display = true; + + $section['class'] = isset ( $section['class'] ) ? ' ' . $section['class'] : ''; + + if ( isset ( $_GET['page'] ) && $_GET['page'] == $this->args['page_slug'] ) { + if ( isset ( $section['panel'] ) && $section['panel'] == false ) { + $display = false; + } + } + + if ( ! $display ) { + return ""; + } + + if ( empty ( $sections ) ) { + $sections = $this->sections; + } + + $string = ""; + if ( ( isset ( $this->args['icon_type'] ) && $this->args['icon_type'] == 'image' ) || ( isset ( $section['icon_type'] ) && $section['icon_type'] == 'image' ) ) { + //if( !empty( $this->args['icon_type'] ) && $this->args['icon_type'] == 'image' ) { + $icon = ( ! isset ( $section['icon'] ) ) ? '' : ' '; + } else { + if ( ! empty ( $section['icon_class'] ) ) { + $icon_class = ' ' . $section['icon_class']; + } elseif ( ! empty ( $this->args['default_icon_class'] ) ) { + $icon_class = ' ' . $this->args['default_icon_class']; + } else { + $icon_class = ''; + } + $icon = ( ! isset ( $section['icon'] ) ) ? ' ' : ' '; + } + if ( strpos( $icon, 'el-icon-' ) !== false ) { + $icon = str_replace( 'el-icon-', 'el el-', $icon ); + } + + $hide_section = ''; + if ( isset ( $section['hidden'] ) ) { + $hide_section = ( $section['hidden'] == true ) ? ' hidden ' : ''; + } + + $canBeSubSection = ( $k > 0 && ( ! isset ( $sections[ ( $k ) ]['type'] ) || $sections[ ( $k ) ]['type'] != "divide" ) ) ? true : false; + + if ( ! $canBeSubSection && isset ( $section['subsection'] ) && $section['subsection'] == true ) { + unset ( $section['subsection'] ); + } + + if ( isset ( $section['type'] ) && $section['type'] == "divide" ) { + $string .= '
  •  
  • '; + } else if ( ! isset ( $section['subsection'] ) || $section['subsection'] != true ) { + + // DOVY! REPLACE $k with $section['ID'] when used properly. + //$active = ( ( is_numeric($this->current_tab) && $this->current_tab == $k ) || ( !is_numeric($this->current_tab) && $this->current_tab === $k ) ) ? ' active' : ''; + $subsections = ( isset ( $sections[ ( $k + 1 ) ] ) && isset ( $sections[ ( $k + 1 ) ]['subsection'] ) && $sections[ ( $k + 1 ) ]['subsection'] == true ) ? true : false; + $subsectionsClass = $subsections ? ' hasSubSections' : ''; + $subsectionsClass .= ( ! isset ( $section['fields'] ) || empty ( $section['fields'] ) ) ? ' empty_section' : ''; + $extra_icon = $subsections ? ' ' : ''; + $string .= ''; + } + + return $string; + } +// section_menu() + + /** + * HTML OUTPUT. + * + * @since 1.0.0 + * @access public + * @return void + */ + public function generate_panel() { + include_once( 'core/panel.php' ); + $panel = new reduxCorePanel ( $this ); + $panel->init(); + $this->set_transients(); + } + + /** + * Section HTML OUTPUT. + * + * @since 1.0.0 + * @access public + * + * @param array $section + * + * @return void + */ + public function _section_desc( $section ) { + $id = trim( rtrim( $section['id'], '_section' ), $this->args['opt_name'] ); + + if ( isset ( $this->sections[ $id ]['desc'] ) && ! empty ( $this->sections[ $id ]['desc'] ) ) { + echo '
    ' . $this->sections[ $id ]['desc'] . '
    '; + } + } + + /** + * Field HTML OUTPUT. + * Gets option from options array, then calls the specific field type class - allows extending by other devs + * + * @since 1.0.0 + * + * @param array $field + * @param string $v + * + * @return void + */ + public function _field_input( $field, $v = null ) { + + if ( isset ( $field['callback'] ) && ( is_callable( $field['callback'] ) || ( is_string( $field['callback'] ) && function_exists( $field['callback'] ) ) ) ) { + + $value = ( isset ( $this->options[ $field['id'] ] ) ) ? $this->options[ $field['id'] ] : ''; + + /** + * action 'redux-before-field-{opt_name}' + * + * @deprecated + * + * @param array $field field data + * @param string $value field.id + */ + do_action( "redux-before-field-{$this->args['opt_name']}", $field, $value ); // REMOVE + + /** + * action 'redux/field/{opt_name}/{field.type}/callback/before' + * + * @param array $field field data + * @param string $value field.id + */ + do_action( "redux/field/{$this->args['opt_name']}/{$field['type']}/callback/before", $field, $value ); + + /** + * action 'redux/field/{opt_name}/callback/before' + * + * @param array $field field data + * @param string $value field.id + */ + do_action( "redux/field/{$this->args['opt_name']}/callback/before", $field, $value ); + + call_user_func( $field['callback'], $field, $value ); + + + /** + * action 'redux-after-field-{opt_name}' + * + * @deprecated + * + * @param array $field field data + * @param string $value field.id + */ + do_action( "redux-after-field-{$this->args['opt_name']}", $field, $value ); // REMOVE + + /** + * action 'redux/field/{opt_name}/{field.type}/callback/after' + * + * @param array $field field data + * @param string $value field.id + */ + do_action( "redux/field/{$this->args['opt_name']}/{$field['type']}/callback/after", $field, $value ); + + /** + * action 'redux/field/{opt_name}/callback/after' + * + * @param array $field field data + * @param string $value field.id + */ + do_action( "redux/field/{$this->args['opt_name']}/callback/after", $field, $value ); + + return; + } + + if ( isset ( $field['type'] ) ) { + + // If the field is set not to display in the panel + $display = true; + if ( isset ( $_GET['page'] ) && $_GET['page'] == $this->args['page_slug'] ) { + if ( isset ( $field['panel'] ) && $field['panel'] == false ) { + $display = false; + } + } + + if ( ! $display ) { + return; + } + + $field_class = "ReduxFramework_{$field['type']}"; + + if ( ! class_exists( $field_class ) ) { +// $class_file = apply_filters( 'redux/field/class/'.$field['type'], self::$_dir . 'inc/fields/' . $field['type'] . '/field_' . $field['type'] . '.php', $field ); // REMOVE + /** + * filter 'redux/{opt_name}/field/class/{field.type}' + * + * @param string field class file path + * @param array $field field data + */ + $class_file = apply_filters( "redux/{$this->args['opt_name']}/field/class/{$field['type']}", self::$_dir . "inc/fields/{$field['type']}/field_{$field['type']}.php", $field ); + + if ( $class_file ) { + if ( file_exists( $class_file ) ) { + require_once( $class_file ); + } + } + } + + if ( class_exists( $field_class ) ) { + $value = isset ( $this->options[ $field['id'] ] ) ? $this->options[ $field['id'] ] : ''; + + if ( $v !== null ) { + $value = $v; + } + + /** + * action 'redux-before-field-{opt_name}' + * + * @deprecated + * + * @param array $field field data + * @param string $value field id + */ + do_action( "redux-before-field-{$this->args['opt_name']}", $field, $value ); // REMOVE + + /** + * action 'redux/field/{opt_name}/{field.type}/render/before' + * + * @param array $field field data + * @param string $value field id + */ + do_action( "redux/field/{$this->args['opt_name']}/{$field['type']}/render/before", $field, $value ); + + /** + * action 'redux/field/{$this->args['opt_name']}/render/before' + * + * @param array $field field data + * @param string $value field id + */ + do_action( "redux/field/{$this->args['opt_name']}/render/before", $field, $value ); + + if ( ! isset ( $field['name_suffix'] ) ) { + $field['name_suffix'] = ""; + } + + $render = new $field_class ( $field, $value, $this ); + ob_start(); + + $render->render(); + + /* + + echo "
    ";
    +                      print_r($value);
    +                      echo "
    "; + */ + + /** + * filter 'redux-field-{opt_name}' + * + * @deprecated + * + * @param string rendered field markup + * @param array $field field data + */ + $_render = apply_filters( "redux-field-{$this->args['opt_name']}", ob_get_contents(), $field ); // REMOVE + + /** + * filter 'redux/field/{opt_name}/{field.type}/render/after' + * + * @param string rendered field markup + * @param array $field field data + */ + $_render = apply_filters( "redux/field/{$this->args['opt_name']}/{$field['type']}/render/after", $_render, $field ); + + /** + * filter 'redux/field/{opt_name}/render/after' + * + * @param string rendered field markup + * @param array $field field data + */ + $_render = apply_filters( "redux/field/{$this->args['opt_name']}/render/after", $_render, $field ); + + ob_end_clean(); + + //save the values into a unique array in case we need it for dependencies + $this->fieldsValues[ $field['id'] ] = ( isset ( $value['url'] ) && is_array( $value ) ) ? $value['url'] : $value; + + //create default data und class string and checks the dependencies of an object + $class_string = ''; + $data_string = ''; + + $this->check_dependencies( $field ); + + /** + * action 'redux/field/{opt_name}/{field.type}/fieldset/before/{opt_name}' + * + * @param array $field field data + * @param string $value field id + */ + do_action( "redux/field/{$this->args['opt_name']}/{$field['type']}/fieldset/before/{$this->args['opt_name']}", $field, $value ); + + /** + * action 'redux/field/{opt_name}/fieldset/before/{opt_name}' + * + * @param array $field field data + * @param string $value field id + */ + do_action( "redux/field/{$this->args['opt_name']}/fieldset/before/{$this->args['opt_name']}", $field, $value ); + + //if ( ! isset( $field['fields'] ) || empty( $field['fields'] ) ) { + $hidden = ''; + if ( isset ( $field['hidden'] ) && $field['hidden'] ) { + $hidden = 'hidden '; + } + + if ( isset( $field['full_width'] ) && $field['full_width'] == true ) { + $class_string .= "redux_remove_th"; + } + + echo '
    '; + //} + + echo $_render; + + if ( ! empty ( $field['desc'] ) ) { + $field['description'] = $field['desc']; + } + + echo ( isset ( $field['description'] ) && $field['type'] != "info" && $field['type'] !== "section" && ! empty ( $field['description'] ) ) ? '
    ' . $field['description'] . '
    ' : ''; + + //if ( ! isset( $field['fields'] ) || empty( $field['fields'] ) ) { + echo '
    '; + //} + + /** + * action 'redux-after-field-{opt_name}' + * + * @deprecated + * + * @param array $field field data + * @param string $value field id + */ + do_action( "redux-after-field-{$this->args['opt_name']}", $field, $value ); // REMOVE + + /** + * action 'redux/field/{opt_name}/{field.type}/fieldset/after/{opt_name}' + * + * @param array $field field data + * @param string $value field id + */ + do_action( "redux/field/{$this->args['opt_name']}/{$field['type']}/fieldset/after/{$this->args['opt_name']}", $field, $value ); + + /** + * action 'redux/field/{opt_name}/fieldset/after/{opt_name}' + * + * @param array $field field data + * @param string $value field id + */ + do_action( "redux/field/{$this->args['opt_name']}/fieldset/after/{$this->args['opt_name']}", $field, $value ); + } + } + } +// _field_input() + + /** + * Can Output CSS + * Check if a field meets its requirements before outputting to CSS + * + * @param $field + * + * @return bool + */ + public function _can_output_css( $field ) { + $return = true; + + $field = apply_filters( "redux/field/{$this->args['opt_name']}/_can_output_css", $field ); + if ( isset ( $field['force_output'] ) && $field['force_output'] == true ) { + return $return; + } + + if ( ! empty ( $field['required'] ) ) { + if ( isset ( $field['required'][0] ) ) { + if ( ! is_array( $field['required'][0] ) && count( $field['required'] ) == 3 ) { + $parentValue = $GLOBALS[ $this->args['global_variable'] ][ $field['required'][0] ]; + $checkValue = $field['required'][2]; + $operation = $field['required'][1]; + $return = $this->compareValueDependencies( $parentValue, $checkValue, $operation ); + } else if ( is_array( $field['required'][0] ) ) { + foreach ( $field['required'] as $required ) { + if ( ! is_array( $required[0] ) && count( $required ) == 3 ) { + $parentValue = $GLOBALS[ $this->args['global_variable'] ][ $required[0] ]; + $checkValue = $required[2]; + $operation = $required[1]; + $return = $this->compareValueDependencies( $parentValue, $checkValue, $operation ); + } + if ( ! $return ) { + return $return; + } + } + } + } + } + + return $return; + } +// _can_output_css + + /** + * Checks dependencies between objects based on the $field['required'] array + * If the array is set it needs to have exactly 3 entries. + * The first entry describes which field should be monitored by the current field. eg: "content" + * The second entry describes the comparison parameter. eg: "equals, not, is_larger, is_smaller ,contains" + * The third entry describes the value that we are comparing against. + * Example: if the required array is set to array('content','equals','Hello World'); then the current + * field will only be displayed if the field with id "content" has exactly the value "Hello World" + * + * @param array $field + * + * @return array $params + */ + public function check_dependencies( $field ) { + //$params = array('data_string' => "", 'class_string' => ""); + + if ( ! empty ( $field['required'] ) ) { + + //$this->folds[$field['id']] = $this->folds[$field['id']] ? $this->folds[$field['id']] : array(); + if ( ! isset ( $this->required_child[ $field['id'] ] ) ) { + $this->required_child[ $field['id'] ] = array(); + } + + if ( ! isset ( $this->required[ $field['id'] ] ) ) { + $this->required[ $field['id'] ] = array(); + } + + if ( is_array( $field['required'][0] ) ) { + foreach ( $field['required'] as $value ) { + if ( is_array( $value ) && count( $value ) == 3 ) { + $data = array(); + $data['parent'] = $value[0]; + $data['operation'] = $value[1]; + $data['checkValue'] = $value[2]; + + $this->required[ $data['parent'] ][ $field['id'] ][] = $data; + + if ( ! in_array( $data['parent'], $this->required_child[ $field['id'] ] ) ) { + $this->required_child[ $field['id'] ][] = $data; + } + + $this->checkRequiredDependencies( $field, $data ); + } + } + } else { + $data = array(); + $data['parent'] = $field['required'][0]; + $data['operation'] = $field['required'][1]; + $data['checkValue'] = $field['required'][2]; + + $this->required[ $data['parent'] ][ $field['id'] ][] = $data; + + if ( ! in_array( $data['parent'], $this->required_child[ $field['id'] ] ) ) { + $this->required_child[ $field['id'] ][] = $data; + } + + $this->checkRequiredDependencies( $field, $data ); + } + } + //return $params; + } + + // Compare data for required field + private function compareValueDependencies( $parentValue, $checkValue, $operation ) { + $return = false; + switch ( $operation ) { + case '=': + case 'equals': + $data['operation'] = "="; + + if ( is_array( $parentValue ) ) { + foreach ( $parentValue as $idx => $val ) { + if ( is_array( $checkValue ) ) { + foreach ( $checkValue as $i => $v ) { + if ( $val == $v ) { + $return = true; + } + } + } else { + if ( $val == $checkValue ) { + $return = true; + } + } + } + } else { + if ( is_array( $checkValue ) ) { + foreach ( $checkValue as $i => $v ) { + if ( $parentValue == $v ) { + $return = true; + } + } + } else { + if ( $parentValue == $checkValue ) { + $return = true; + } + } + } + break; + + case '!=': + case 'not': + $data['operation'] = "!=="; + if ( is_array( $parentValue ) ) { + foreach ( $parentValue as $idx => $val ) { + if ( is_array( $checkValue ) ) { + foreach ( $checkValue as $i => $v ) { + if ( $val != $v ) { + $return = true; + } + } + } else { + if ( $val != $checkValue ) { + $return = true; + } + } + } + } else { + if ( is_array( $checkValue ) ) { + foreach ( $checkValue as $i => $v ) { + if ( $parentValue != $v ) { + $return = true; + } + } + } else { + if ( $parentValue != $checkValue ) { + $return = true; + } + } + } + +// if ( is_array( $checkValue ) ) { +// if ( ! in_array( $parentValue, $checkValue ) ) { +// $return = true; +// } +// } else { +// if ( $parentValue != $checkValue ) { +// $return = true; +// } else if ( is_array( $parentValue ) ) { +// if ( ! in_array( $checkValue, $parentValue ) ) { +// $return = true; +// } +// } +// } + break; + case '>': + case 'greater': + case 'is_larger': + $data['operation'] = ">"; + if ( $parentValue > $checkValue ) { + $return = true; + } + break; + case '>=': + case 'greater_equal': + case 'is_larger_equal': + $data['operation'] = ">="; + if ( $parentValue >= $checkValue ) { + $return = true; + } + break; + case '<': + case 'less': + case 'is_smaller': + $data['operation'] = "<"; + if ( $parentValue < $checkValue ) { + $return = true; + } + break; + case '<=': + case 'less_equal': + case 'is_smaller_equal': + $data['operation'] = "<="; + if ( $parentValue <= $checkValue ) { + $return = true; + } + break; + case 'contains': + if ( is_array( $parentValue ) ) { + $parentValue = implode( ',', $parentValue ); + } + + if ( is_array( $checkValue ) ) { + foreach ( $checkValue as $idx => $opt ) { + if ( strpos( $parentValue, $opt ) !== false ) { + $return = true; + } + } + } else { + if ( strpos( $parentValue, $checkValue ) !== false ) { + $return = true; + } + } + + break; + case 'doesnt_contain': + case 'not_contain': + if ( is_array( $parentValue ) ) { + $parentValue = implode( ',', $parentValue ); + } + + if ( is_array( $checkValue ) ) { + foreach ( $checkValue as $idx => $opt ) { + if ( strpos( $parentValue, $opt ) === false ) { + $return = true; + } + } + } else { + if ( strpos( $parentValue, $checkValue ) === false ) { + $return = true; + } + } + + break; + case 'is_empty_or': + if ( empty ( $parentValue ) || $parentValue == $checkValue ) { + $return = true; + } + break; + case 'not_empty_and': + if ( ! empty ( $parentValue ) && $parentValue != $checkValue ) { + $return = true; + } + break; + case 'is_empty': + case 'empty': + case '!isset': + if ( empty ( $parentValue ) || $parentValue == "" || $parentValue == null ) { + $return = true; + } + break; + case 'not_empty': + case '!empty': + case 'isset': + if ( ! empty ( $parentValue ) && $parentValue != "" && $parentValue != null ) { + $return = true; + } + break; + } + + return $return; + } + + private function checkRequiredDependencies( $field, $data ) { + //required field must not be hidden. otherwise hide this one by default + + if ( ! in_array( $data['parent'], $this->fieldsHidden ) && ( ! isset ( $this->folds[ $field['id'] ] ) || $this->folds[ $field['id'] ] != "hide" ) ) { + if ( isset ( $this->options[ $data['parent'] ] ) ) { + //echo $data['parent']; + $return = $this->compareValueDependencies( $this->options[ $data['parent'] ], $data['checkValue'], $data['operation'] ); + //$return = $this->compareValueDependencies( $data['parent'], $data['checkValue'], $data['operation'] ); + } + } + + if ( ( isset ( $return ) && $return ) && ( ! isset ( $this->folds[ $field['id'] ] ) || $this->folds[ $field['id'] ] != "hide" ) ) { + $this->folds[ $field['id'] ] = "show"; + } else { + $this->folds[ $field['id'] ] = "hide"; + if ( ! in_array( $field['id'], $this->fieldsHidden ) ) { + $this->fieldsHidden[] = $field['id']; + } + } + } + + /** + * converts an array into a html data string + * + * @param array $data example input: array('id'=>'true') + * + * @return string $data_string example output: data-id='true' + */ + public function create_data_string( $data = array() ) { + $data_string = ""; + + foreach ( $data as $key => $value ) { + if ( is_array( $value ) ) { + $value = implode( "|", $value ); + } + $data_string .= " data-$key='$value' "; + } + + return $data_string; + } + } + + // ReduxFramework + + /** + * action 'redux/init' + * + * @param null + */ + do_action( 'redux/init', ReduxFramework::init() ); + } // class_exists('ReduxFramework') diff --git a/plugins/legacy-admin/framework/core/inc/browser.php b/plugins/legacy-admin/framework/core/inc/browser.php new file mode 100644 index 000000000..99e9b695b --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/browser.php @@ -0,0 +1,1195 @@ +getBrowser() == Browser::BROWSER_FIREFOX && $browser->getVersion() >= 2 ) { + * echo 'You have Firefox version 2 or greater'; + * } + * User agents sampled from: http://www.useragentstring.com/ + * Based on original work from Gary White (http://apptools.com/phptools/browser/ + * CHANGELOG: + * 2012-12-26 (v1.9c by Chris Christoff): + * + Changed vars to publics + * 2012-12-23 (v1.9b by Chris Christoff): + * + Removed the browser string return and added spacing. + * + Also removed return HTML formatting. + * 2012-12-23 (v1.9a by Chris Christoff): + * + Split user string and add formatting so we can print a nicely + * formatted user agent string + * 2010-08-20 (v1.9): + * + Added MSN Explorer Browser (legacy) + * + Added Bing/MSN Robot (Thanks Rob MacDonald) + * + Added the Android Platform (PLATFORM_ANDROID) + * + Fixed issue with Android 1.6/2.2 (Thanks Tom Hirashima) + * 2010-04-27 (v1.8): + * + Added iPad Support + * 2010-03-07 (v1.7): + * + *MAJOR* Rebuild (preg_match and other "slow" routine removal(s)) + * + Almost allof Gary's original code has been replaced + * + Large PHPUNIT testing environment created to validate new releases and additions + * + Added FreeBSD Platform + * + Added OpenBSD Platform + * + Added NetBSD Platform + * + Added SunOS Platform + * + Added OpenSolaris Platform + * + Added support of the Iceweazel Browser + * + Added isChromeFrame() call to check if chromeframe is in use + * + Moved the Opera check in front of the Firefox check due to legacy Opera User Agents + * + Added the __toString() method (Thanks Deano) + * 2009-11-15: + * + Updated the checkes for Firefox + * + Added the NOKIA platform + * + Added Checks for the NOKIA brower(s) + * 2009-11-08: + * + PHP 5.3 Support + * + Added support for BlackBerry OS and BlackBerry browser + * + Added support for the Opera Mini browser + * + Added additional documenation + * + Added support for isRobot() and isMobile() + * + Added support for Opera version 10 + * + Added support for deprecated Netscape Navigator version 9 + * + Added support for IceCat + * + Added support for Shiretoko + * 2010-04-27 (v1.8): + * + Added iPad Support + * 2009-08-18: + * + Updated to support PHP 5.3 - removed all deprecated function calls + * + Updated to remove all double quotes (") -- converted to single quotes (') + * 2009-04-27: + * + Updated the IE check to remove a typo and bug (thanks John) + * 2009-04-22: + * + Added detection for GoogleBot + * + Added detection for the W3C Validator. + * + Added detection for Yahoo! Slurp + * 2009-03-14: + * + Added detection for iPods. + * + Added Platform detection for iPhones + * + Added Platform detection for iPods + * 2009-02-16: (Rick Hale) + * + Added version detection for Android phones. + * 2008-12-09: + * + Removed unused constant + * 2008-11-07: + * + Added Google's Chrome to the detection list + * + Added isBrowser(string) to the list of functions special thanks to + * Daniel 'mavrick' Lang for the function concept (http://mavrick.id.au) + * Gary White noted: "Since browser detection is so unreliable, I am + * no longer maintaining this script. You are free to use and or + * modify/update it as you want, however the author assumes no + * responsibility for the accuracy of the detected values." + * Anyone experienced with Gary's script might be interested in these notes: + * Added class constants + * Added detection and version detection for Google's Chrome + * Updated the version detection for Amaya + * Updated the version detection for Firefox + * Updated the version detection for Lynx + * Updated the version detection for WebTV + * Updated the version detection for NetPositive + * Updated the version detection for IE + * Updated the version detection for OmniWeb + * Updated the version detection for iCab + * Updated the version detection for Safari + * Updated Safari to remove mobile devices (iPhone) + * Added detection for iPhone + * Added detection for robots + * Added detection for mobile devices + * Added detection for BlackBerry + * Removed Netscape checks (matches heavily with firefox & mozilla) + */ + + + // Exit if accessed directly + if ( ! defined( 'ABSPATH' ) ) { + exit; + } + + if ( ! class_exists( 'Browser' ) ) { + + /** + * Browser detection class + * + * @author Chris Schuld + * @since 1.0 + */ + class Browser { + public $_agent = ''; + public $_browser_name = ''; + public $_version = ''; + public $_platform = ''; + public $_os = ''; + public $_is_aol = false; + public $_is_mobile = false; + public $_is_robot = false; + public $_aol_version = ''; + + public $BROWSER_UNKNOWN = 'unknown'; + public $VERSION_UNKNOWN = 'unknown'; + + public $BROWSER_OPERA = 'Opera'; // Http://www.opera.com/ + public $BROWSER_OPERA_MINI = 'Opera Mini'; // Http://www.opera.com/mini/ + public $BROWSER_WEBTV = 'WebTV'; // Http://www.webtv.net/pc/ + public $BROWSER_IE = 'Internet Explorer'; // Http://www.microsoft.com/ie/ + public $BROWSER_POCKET_IE = 'Pocket Internet Explorer'; // Http://en.wikipedia.org/wiki/Internet_Explorer_Mobile + public $BROWSER_KONQUEROR = 'Konqueror'; // Http://www.konqueror.org/ + public $BROWSER_ICAB = 'iCab'; // Http://www.icab.de/ + public $BROWSER_OMNIWEB = 'OmniWeb'; // Http://www.omnigroup.com/applications/omniweb/ + public $BROWSER_FIREBIRD = 'Firebird'; // Http://www.ibphoenix.com/ + public $BROWSER_FIREFOX = 'Firefox'; // Http://www.mozilla.com/en-US/firefox/firefox.html + public $BROWSER_ICEWEASEL = 'Iceweasel'; // Http://www.geticeweasel.org/ + public $BROWSER_SHIRETOKO = 'Shiretoko'; // Http://wiki.mozilla.org/Projects/shiretoko + public $BROWSER_MOZILLA = 'Mozilla'; // Http://www.mozilla.com/en-US/ + public $BROWSER_AMAYA = 'Amaya'; // Http://www.w3.org/Amaya/ + public $BROWSER_LYNX = 'Lynx'; // Http://en.wikipedia.org/wiki/Lynx + public $BROWSER_SAFARI = 'Safari'; // Http://apple.com + public $BROWSER_IPHONE = 'iPhone'; // Http://apple.com + public $BROWSER_IPOD = 'iPod'; // Http://apple.com + public $BROWSER_IPAD = 'iPad'; // Http://apple.com + public $BROWSER_CHROME = 'Chrome'; // Http://www.google.com/chrome + public $BROWSER_ANDROID = 'Android'; // Http://www.android.com/ + public $BROWSER_GOOGLEBOT = 'GoogleBot'; // Http://en.wikipedia.org/wiki/Googlebot + public $BROWSER_SLURP = 'Yahoo! Slurp'; // Http://en.wikipedia.org/wiki/Yahoo!_Slurp + public $BROWSER_W3CVALIDATOR = 'W3C Validator'; // Http://validator.w3.org/ + public $BROWSER_BLACKBERRY = 'BlackBerry'; // Http://www.blackberry.com/ + public $BROWSER_ICECAT = 'IceCat'; // Http://en.wikipedia.org/wiki/GNU_IceCat + public $BROWSER_NOKIA_S60 = 'Nokia S60 OSS Browser'; // Http://en.wikipedia.org/wiki/Web_Browser_for_S60 + public $BROWSER_NOKIA = 'Nokia Browser'; // * all other WAP-based browsers on the Nokia Platform + public $BROWSER_MSN = 'MSN Browser'; // Http://explorer.msn.com/ + public $BROWSER_MSNBOT = 'MSN Bot'; // Http://search.msn.com/msnbot.htm + // Http://en.wikipedia.org/wiki/Msnbot (used for Bing as well) + + public $BROWSER_NETSCAPE_NAVIGATOR = 'Netscape Navigator'; // Http://browser.netscape.com/ (DEPRECATED) + public $BROWSER_GALEON = 'Galeon'; // Http://galeon.sourceforge.net/ (DEPRECATED) + public $BROWSER_NETPOSITIVE = 'NetPositive'; // Http://en.wikipedia.org/wiki/NetPositive (DEPRECATED) + public $BROWSER_PHOENIX = 'Phoenix'; // Http://en.wikipedia.org/wiki/History_of_Mozilla_Firefox (DEPRECATED) + + public $PLATFORM_UNKNOWN = 'unknown'; + public $PLATFORM_WINDOWS = 'Windows'; + public $PLATFORM_WINDOWS_CE = 'Windows CE'; + public $PLATFORM_APPLE = 'Apple'; + public $PLATFORM_LINUX = 'Linux'; + public $PLATFORM_OS2 = 'OS/2'; + public $PLATFORM_BEOS = 'BeOS'; + public $PLATFORM_IPHONE = 'iPhone'; + public $PLATFORM_IPOD = 'iPod'; + public $PLATFORM_IPAD = 'iPad'; + public $PLATFORM_BLACKBERRY = 'BlackBerry'; + public $PLATFORM_NOKIA = 'Nokia'; + public $PLATFORM_FREEBSD = 'FreeBSD'; + public $PLATFORM_OPENBSD = 'OpenBSD'; + public $PLATFORM_NETBSD = 'NetBSD'; + public $PLATFORM_SUNOS = 'SunOS'; + public $PLATFORM_OPENSOLARIS = 'OpenSolaris'; + public $PLATFORM_ANDROID = 'Android'; + + public $OPERATING_SYSTEM_UNKNOWN = 'unknown'; + + function Browser( $useragent = '' ) { + $this->reset(); + + if ( $useragent != '' ) { + $this->setUserAgent( $useragent ); + } else { + $this->determine(); + } + } + + /** + * Reset all properties + */ + function reset() { + $this->_agent = isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : ''; + $this->_browser_name = $this->BROWSER_UNKNOWN; + $this->_version = $this->VERSION_UNKNOWN; + $this->_platform = $this->PLATFORM_UNKNOWN; + $this->_os = $this->OPERATING_SYSTEM_UNKNOWN; + $this->_is_aol = false; + $this->_is_mobile = false; + $this->_is_robot = false; + $this->_aol_version = $this->VERSION_UNKNOWN; + } + + /** + * Check to see if the specific browser is valid + * + * @param string $browserName + * + * @return True if the browser is the specified browser + */ + function isBrowser( $browserName ) { + return ( 0 == strcasecmp( $this->_browser_name, trim( $browserName ) ) ); + } + + /** + * The name of the browser. All return types are from the class contants + * + * @return string Name of the browser + */ + function getBrowser() { + return $this->_browser_name; + } + + /** + * Set the name of the browser + * + * @param $browser The name of the Browser + */ + function setBrowser( $browser ) { + return $this->_browser_name = $browser; + } + + /** + * The name of the platform. All return types are from the class contants + * + * @return string Name of the browser + */ + function getPlatform() { + return $this->_platform; + } + + /** + * Set the name of the platform + * + * @param $platform The name of the Platform + */ + function setPlatform( $platform ) { + return $this->_platform = $platform; + } + + /** + * The version of the browser. + * + * @return string Version of the browser (will only contain alpha-numeric characters and a period) + */ + function getVersion() { + return $this->_version; + } + + /** + * Set the version of the browser + * + * @param $version The version of the Browser + */ + function setVersion( $version ) { + $this->_version = preg_replace( '/[^0-9,.,a-z,A-Z-]/', '', $version ); + } + + /** + * The version of AOL. + * + * @return string Version of AOL (will only contain alpha-numeric characters and a period) + */ + function getAolVersion() { + return $this->_aol_version; + } + + /** + * Set the version of AOL + * + * @param $version The version of AOL + */ + function setAolVersion( $version ) { + $this->_aol_version = preg_replace( '/[^0-9,.,a-z,A-Z]/', '', $version ); + } + + /** + * Is the browser from AOL? + * + * @return boolean True if the browser is from AOL otherwise false + */ + function isAol() { + return $this->_is_aol; + } + + /** + * Is the browser from a mobile device? + * + * @return boolean True if the browser is from a mobile device otherwise false + */ + function isMobile() { + return $this->_is_mobile; + } + + /** + * Is the browser from a robot (ex Slurp,GoogleBot)? + * + * @return boolean True if the browser is from a robot otherwise false + */ + function isRobot() { + return $this->_is_robot; + } + + /** + * Set the browser to be from AOL + * + * @param $isAol + */ + function setAol( $isAol ) { + $this->_is_aol = $isAol; + } + + /** + * Set the Browser to be mobile + * + * @param boolean $value is the browser a mobile brower or not + */ + function setMobile( $value = true ) { + $this->_is_mobile = $value; + } + + /** + * Set the Browser to be a robot + * + * @param boolean $value is the browser a robot or not + */ + function setRobot( $value = true ) { + $this->_is_robot = $value; + } + + /** + * Get the user agent value in use to determine the browser + * + * @return string The user agent from the HTTP header + */ + function getUserAgent() { + return $this->_agent; + } + + /** + * Set the user agent value (the construction will use the HTTP header value - this will overwrite it) + * + * @param $agent_string The value for the User Agent + */ + function setUserAgent( $agent_string ) { + $this->reset(); + $this->_agent = $agent_string; + $this->determine(); + } + + /** + * Used to determine if the browser is actually "chromeframe" + * + * @since 1.7 + * @return boolean True if the browser is using chromeframe + */ + function isChromeFrame() { + return ( strpos( $this->_agent, 'chromeframe' ) !== false ); + } + + /** + * Returns a formatted string with a summary of the details of the browser. + * + * @return string formatted string with a summary of the browser + */ + function __toString() { + $text1 = $this->getUserAgent(); // Grabs the UA string + $UAline1 = substr( $text1, 0, 32 ); // The first line we print should only be the first 32 characters of the UA string + $text2 = $this->getUserAgent(); // Now we grab it again and save it to a string + $towrapUA = str_replace( $UAline1, '', $text2 ); // The rest of the printoff (other than first line) is equivalent + // to the whole string minus the part we printed off. IE + // User Agent: thefirst32charactersfromUAline1 + // the rest of it is now stored in + // $text2 to be printed off + // But we need to add spaces before each line that is split other than line 1 + $space = ''; + for ( $i = 0; $i < 25; $i ++ ) { + $space .= ' '; + } + + // Now we split the remaining string of UA ($text2) into lines that are prefixed by spaces for formatting + $wordwrapped = chunk_split( $towrapUA, 32, "\n $space" ); + + return "Platform: {$this->getPlatform()} \n" . + "Browser Name: {$this->getBrowser()} \n" . + "Browser Version: {$this->getVersion()} \n" . + "User Agent String: $UAline1 \n\t\t\t " . + "$wordwrapped"; + } + + /** + * Protected routine to calculate and determine what the browser is in use (including platform) + */ + function determine() { + $this->checkPlatform(); + $this->checkBrowsers(); + $this->checkForAol(); + } + + /** + * Protected routine to determine the browser type + * + * @return boolean True if the browser was detected otherwise false + */ + function checkBrowsers() { + return ( + // Well-known, well-used + // Special Notes: + // (1) Opera must be checked before FireFox due to the odd + // user agents used in some older versions of Opera + // (2) WebTV is strapped onto Internet Explorer so we must + // check for WebTV before IE + // (3) (deprecated) Galeon is based on Firefox and needs to be + // tested before Firefox is tested + // (4) OmniWeb is based on Safari so OmniWeb check must occur + // before Safari + // (5) Netscape 9+ is based on Firefox so Netscape checks + // before FireFox are necessary + $this->checkBrowserWebTv() || + $this->checkBrowserInternetExplorer() || + $this->checkBrowserOpera() || + $this->checkBrowserGaleon() || + $this->checkBrowserNetscapeNavigator9Plus() || + $this->checkBrowserFirefox() || + $this->checkBrowserChrome() || + $this->checkBrowserOmniWeb() || + + // Common mobile + $this->checkBrowserAndroid() || + $this->checkBrowseriPad() || + $this->checkBrowseriPod() || + $this->checkBrowseriPhone() || + $this->checkBrowserBlackBerry() || + $this->checkBrowserNokia() || + + // Common bots + $this->checkBrowserGoogleBot() || + $this->checkBrowserMSNBot() || + $this->checkBrowserSlurp() || + + // WebKit base check (post mobile and others) + $this->checkBrowserSafari() || + + // Everyone else + $this->checkBrowserNetPositive() || + $this->checkBrowserFirebird() || + $this->checkBrowserKonqueror() || + $this->checkBrowserIcab() || + $this->checkBrowserPhoenix() || + $this->checkBrowserAmaya() || + $this->checkBrowserLynx() || + + $this->checkBrowserShiretoko() || + $this->checkBrowserIceCat() || + $this->checkBrowserW3CValidator() || + $this->checkBrowserMozilla() /* Mozilla is such an open standard that you must check it last */ + ); + } + + /** + * Determine if the user is using a BlackBerry (last updated 1.7) + * + * @return boolean True if the browser is the BlackBerry browser otherwise false + */ + function checkBrowserBlackBerry() { + if ( stripos( $this->_agent, 'blackberry' ) !== false ) { + $aresult = explode( "/", stristr( $this->_agent, "BlackBerry" ) ); + $aversion = explode( ' ', $aresult[1] ); + $this->setVersion( $aversion[0] ); + $this->_browser_name = $this->BROWSER_BLACKBERRY; + $this->setMobile( true ); + + return true; + } + + return false; + } + + /** + * Determine if the user is using an AOL User Agent (last updated 1.7) + * + * @return boolean True if the browser is from AOL otherwise false + */ + function checkForAol() { + $this->setAol( false ); + $this->setAolVersion( $this->VERSION_UNKNOWN ); + + if ( stripos( $this->_agent, 'aol' ) !== false ) { + $aversion = explode( ' ', stristr( $this->_agent, 'AOL' ) ); + $this->setAol( true ); + $this->setAolVersion( preg_replace( '/[^0-9\.a-z]/i', '', $aversion[1] ) ); + + return true; + } + + return false; + } + + /** + * Determine if the browser is the GoogleBot or not (last updated 1.7) + * + * @return boolean True if the browser is the GoogletBot otherwise false + */ + function checkBrowserGoogleBot() { + if ( stripos( $this->_agent, 'googlebot' ) !== false ) { + $aresult = explode( '/', stristr( $this->_agent, 'googlebot' ) ); + $aversion = explode( ' ', $aresult[1] ); + $this->setVersion( str_replace( ';', '', $aversion[0] ) ); + $this->_browser_name = $this->BROWSER_GOOGLEBOT; + $this->setRobot( true ); + + return true; + } + + return false; + } + + /** + * Determine if the browser is the MSNBot or not (last updated 1.9) + * + * @return boolean True if the browser is the MSNBot otherwise false + */ + function checkBrowserMSNBot() { + if ( stripos( $this->_agent, "msnbot" ) !== false ) { + $aresult = explode( "/", stristr( $this->_agent, "msnbot" ) ); + $aversion = explode( " ", $aresult[1] ); + $this->setVersion( str_replace( ";", "", $aversion[0] ) ); + $this->_browser_name = $this->BROWSER_MSNBOT; + $this->setRobot( true ); + + return true; + } + + return false; + } + + /** + * Determine if the browser is the W3C Validator or not (last updated 1.7) + * + * @return boolean True if the browser is the W3C Validator otherwise false + */ + function checkBrowserW3CValidator() { + if ( stripos( $this->_agent, 'W3C-checklink' ) !== false ) { + $aresult = explode( '/', stristr( $this->_agent, 'W3C-checklink' ) ); + $aversion = explode( ' ', $aresult[1] ); + $this->setVersion( $aversion[0] ); + $this->_browser_name = $this->BROWSER_W3CVALIDATOR; + + return true; + } else if ( stripos( $this->_agent, 'W3C_Validator' ) !== false ) { + // Some of the Validator versions do not delineate w/ a slash - add it back in + $ua = str_replace( "W3C_Validator ", "W3C_Validator/", $this->_agent ); + $aresult = explode( '/', stristr( $ua, 'W3C_Validator' ) ); + $aversion = explode( ' ', $aresult[1] ); + $this->setVersion( $aversion[0] ); + $this->_browser_name = $this->BROWSER_W3CVALIDATOR; + + return true; + } + + return false; + } + + /** + * Determine if the browser is the Yahoo! Slurp Robot or not (last updated 1.7) + * + * @return boolean True if the browser is the Yahoo! Slurp Robot otherwise false + */ + function checkBrowserSlurp() { + if ( stripos( $this->_agent, 'slurp' ) !== false ) { + $aresult = explode( '/', stristr( $this->_agent, 'Slurp' ) ); + $aversion = explode( ' ', $aresult[1] ); + $this->setVersion( $aversion[0] ); + $this->_browser_name = $this->BROWSER_SLURP; + $this->setRobot( true ); + $this->setMobile( false ); + + return true; + } + + return false; + } + + /** + * Determine if the browser is Internet Explorer or not (last updated 1.7) + * + * @return boolean True if the browser is Internet Explorer otherwise false + */ + function checkBrowserInternetExplorer() { + + // Test for v1 - v1.5 IE + if ( stripos( $this->_agent, 'microsoft internet explorer' ) !== false ) { + $this->setBrowser( $this->BROWSER_IE ); + $this->setVersion( '1.0' ); + $aresult = stristr( $this->_agent, '/' ); + if ( preg_match( '/308|425|426|474|0b1/i', $aresult ) ) { + $this->setVersion( '1.5' ); + } + + return true; + // Test for versions > 1.5 + } else if ( stripos( $this->_agent, 'msie' ) !== false && stripos( $this->_agent, 'opera' ) === false ) { + // See if the browser is the odd MSN Explorer + if ( stripos( $this->_agent, 'msnb' ) !== false ) { + $aresult = explode( ' ', stristr( str_replace( ';', '; ', $this->_agent ), 'MSN' ) ); + $this->setBrowser( $this->BROWSER_MSN ); + $this->setVersion( str_replace( array( '(', ')', ';' ), '', $aresult[1] ) ); + + return true; + } + $aresult = explode( ' ', stristr( str_replace( ';', '; ', $this->_agent ), 'msie' ) ); + $this->setBrowser( $this->BROWSER_IE ); + $this->setVersion( str_replace( array( '(', ')', ';' ), '', $aresult[1] ) ); + + return true; + // Test for Pocket IE + } else if ( stripos( $this->_agent, 'mspie' ) !== false || stripos( $this->_agent, 'pocket' ) !== false ) { + $aresult = explode( ' ', stristr( $this->_agent, 'mspie' ) ); + $this->setPlatform( $this->PLATFORM_WINDOWS_CE ); + $this->setBrowser( $this->BROWSER_POCKET_IE ); + $this->setMobile( true ); + + if ( stripos( $this->_agent, 'mspie' ) !== false ) { + $this->setVersion( $aresult[1] ); + } else { + $aversion = explode( '/', $this->_agent ); + $this->setVersion( $aversion[1] ); + } + + return true; + } + + return false; + } + + /** + * Determine if the browser is Opera or not (last updated 1.7) + * + * @return boolean True if the browser is Opera otherwise false + */ + function checkBrowserOpera() { + if ( stripos( $this->_agent, 'opera mini' ) !== false ) { + $resultant = stristr( $this->_agent, 'opera mini' ); + if ( preg_match( '/\//', $resultant ) ) { + $aresult = explode( '/', $resultant ); + $aversion = explode( ' ', $aresult[1] ); + $this->setVersion( $aversion[0] ); + } else { + $aversion = explode( ' ', stristr( $resultant, 'opera mini' ) ); + $this->setVersion( $aversion[1] ); + } + $this->_browser_name = $this->BROWSER_OPERA_MINI; + $this->setMobile( true ); + + return true; + } else if ( stripos( $this->_agent, 'opera' ) !== false ) { + $resultant = stristr( $this->_agent, 'opera' ); + if ( preg_match( '/Version\/(10.*)$/', $resultant, $matches ) ) { + $this->setVersion( $matches[1] ); + } else if ( preg_match( '/\//', $resultant ) ) { + $aresult = explode( '/', str_replace( "(", " ", $resultant ) ); + $aversion = explode( ' ', $aresult[1] ); + $this->setVersion( $aversion[0] ); + } else { + $aversion = explode( ' ', stristr( $resultant, 'opera' ) ); + $this->setVersion( isset( $aversion[1] ) ? $aversion[1] : "" ); + } + $this->_browser_name = $this->BROWSER_OPERA; + + return true; + } + + return false; + } + + /** + * Determine if the browser is Chrome or not (last updated 1.7) + * + * @return boolean True if the browser is Chrome otherwise false + */ + function checkBrowserChrome() { + if ( stripos( $this->_agent, 'Chrome' ) !== false ) { + $aresult = explode( '/', stristr( $this->_agent, 'Chrome' ) ); + $aversion = explode( ' ', $aresult[1] ); + $this->setVersion( $aversion[0] ); + $this->setBrowser( $this->BROWSER_CHROME ); + + return true; + } + + return false; + } + + + /** + * Determine if the browser is WebTv or not (last updated 1.7) + * + * @return boolean True if the browser is WebTv otherwise false + */ + function checkBrowserWebTv() { + if ( stripos( $this->_agent, 'webtv' ) !== false ) { + $aresult = explode( '/', stristr( $this->_agent, 'webtv' ) ); + $aversion = explode( ' ', $aresult[1] ); + $this->setVersion( $aversion[0] ); + $this->setBrowser( $this->BROWSER_WEBTV ); + + return true; + } + + return false; + } + + /** + * Determine if the browser is NetPositive or not (last updated 1.7) + * + * @return boolean True if the browser is NetPositive otherwise false + */ + function checkBrowserNetPositive() { + if ( stripos( $this->_agent, 'NetPositive' ) !== false ) { + $aresult = explode( '/', stristr( $this->_agent, 'NetPositive' ) ); + $aversion = explode( ' ', $aresult[1] ); + $this->setVersion( str_replace( array( '(', ')', ';' ), '', $aversion[0] ) ); + $this->setBrowser( $this->BROWSER_NETPOSITIVE ); + + return true; + } + + return false; + } + + /** + * Determine if the browser is Galeon or not (last updated 1.7) + * + * @return boolean True if the browser is Galeon otherwise false + */ + function checkBrowserGaleon() { + if ( stripos( $this->_agent, 'galeon' ) !== false ) { + $aresult = explode( ' ', stristr( $this->_agent, 'galeon' ) ); + $aversion = explode( '/', $aresult[0] ); + $this->setVersion( $aversion[1] ); + $this->setBrowser( $this->BROWSER_GALEON ); + + return true; + } + + return false; + } + + /** + * Determine if the browser is Konqueror or not (last updated 1.7) + * + * @return boolean True if the browser is Konqueror otherwise false + */ + function checkBrowserKonqueror() { + if ( stripos( $this->_agent, 'Konqueror' ) !== false ) { + $aresult = explode( ' ', stristr( $this->_agent, 'Konqueror' ) ); + $aversion = explode( '/', $aresult[0] ); + $this->setVersion( $aversion[1] ); + $this->setBrowser( $this->BROWSER_KONQUEROR ); + + return true; + } + + return false; + } + + /** + * Determine if the browser is iCab or not (last updated 1.7) + * + * @return boolean True if the browser is iCab otherwise false + */ + function checkBrowserIcab() { + if ( stripos( $this->_agent, 'icab' ) !== false ) { + $aversion = explode( ' ', stristr( str_replace( '/', ' ', $this->_agent ), 'icab' ) ); + $this->setVersion( $aversion[1] ); + $this->setBrowser( $this->BROWSER_ICAB ); + + return true; + } + + return false; + } + + /** + * Determine if the browser is OmniWeb or not (last updated 1.7) + * + * @return boolean True if the browser is OmniWeb otherwise false + */ + function checkBrowserOmniWeb() { + if ( stripos( $this->_agent, 'omniweb' ) !== false ) { + $aresult = explode( '/', stristr( $this->_agent, 'omniweb' ) ); + $aversion = explode( ' ', isset( $aresult[1] ) ? $aresult[1] : "" ); + $this->setVersion( $aversion[0] ); + $this->setBrowser( $this->BROWSER_OMNIWEB ); + + return true; + } + + return false; + } + + /** + * Determine if the browser is Phoenix or not (last updated 1.7) + * + * @return boolean True if the browser is Phoenix otherwise false + */ + function checkBrowserPhoenix() { + if ( stripos( $this->_agent, 'Phoenix' ) !== false ) { + $aversion = explode( '/', stristr( $this->_agent, 'Phoenix' ) ); + $this->setVersion( $aversion[1] ); + $this->setBrowser( $this->BROWSER_PHOENIX ); + + return true; + } + + return false; + } + + /** + * Determine if the browser is Firebird or not (last updated 1.7) + * + * @return boolean True if the browser is Firebird otherwise false + */ + function checkBrowserFirebird() { + if ( stripos( $this->_agent, 'Firebird' ) !== false ) { + $aversion = explode( '/', stristr( $this->_agent, 'Firebird' ) ); + $this->setVersion( $aversion[1] ); + $this->setBrowser( $this->BROWSER_FIREBIRD ); + + return true; + } + + return false; + } + + /** + * Determine if the browser is Netscape Navigator 9+ or not (last updated 1.7) + * NOTE: (http://browser.netscape.com/ - Official support ended on March 1st, 2008) + * + * @return boolean True if the browser is Netscape Navigator 9+ otherwise false + */ + function checkBrowserNetscapeNavigator9Plus() { + if ( stripos( $this->_agent, 'Firefox' ) !== false && preg_match( '/Navigator\/([^ ]*)/i', $this->_agent, $matches ) ) { + $this->setVersion( $matches[1] ); + $this->setBrowser( $this->BROWSER_NETSCAPE_NAVIGATOR ); + + return true; + } else if ( stripos( $this->_agent, 'Firefox' ) === false && preg_match( '/Netscape6?\/([^ ]*)/i', $this->_agent, $matches ) ) { + $this->setVersion( $matches[1] ); + $this->setBrowser( $this->BROWSER_NETSCAPE_NAVIGATOR ); + + return true; + } + + return false; + } + + /** + * Determine if the browser is Shiretoko or not (https://wiki.mozilla.org/Projects/shiretoko) (last updated 1.7) + * + * @return boolean True if the browser is Shiretoko otherwise false + */ + function checkBrowserShiretoko() { + if ( stripos( $this->_agent, 'Mozilla' ) !== false && preg_match( '/Shiretoko\/([^ ]*)/i', $this->_agent, $matches ) ) { + $this->setVersion( $matches[1] ); + $this->setBrowser( $this->BROWSER_SHIRETOKO ); + + return true; + } + + return false; + } + + /** + * Determine if the browser is Ice Cat or not (http://en.wikipedia.org/wiki/GNU_IceCat) (last updated 1.7) + * + * @return boolean True if the browser is Ice Cat otherwise false + */ + function checkBrowserIceCat() { + if ( stripos( $this->_agent, 'Mozilla' ) !== false && preg_match( '/IceCat\/([^ ]*)/i', $this->_agent, $matches ) ) { + $this->setVersion( $matches[1] ); + $this->setBrowser( $this->BROWSER_ICECAT ); + + return true; + } + + return false; + } + + /** + * Determine if the browser is Nokia or not (last updated 1.7) + * + * @return boolean True if the browser is Nokia otherwise false + */ + function checkBrowserNokia() { + if ( preg_match( "/Nokia([^\/]+)\/([^ SP]+)/i", $this->_agent, $matches ) ) { + $this->setVersion( $matches[2] ); + if ( stripos( $this->_agent, 'Series60' ) !== false || strpos( $this->_agent, 'S60' ) !== false ) { + $this->setBrowser( $this->BROWSER_NOKIA_S60 ); + } else { + $this->setBrowser( $this->BROWSER_NOKIA ); + } + $this->setMobile( true ); + + return true; + } + + return false; + } + + /** + * Determine if the browser is Firefox or not (last updated 1.7) + * + * @return boolean True if the browser is Firefox otherwise false + */ + function checkBrowserFirefox() { + if ( stripos( $this->_agent, 'safari' ) === false ) { + if ( preg_match( "/Firefox[\/ \(]([^ ;\)]+)/i", $this->_agent, $matches ) ) { + $this->setVersion( $matches[1] ); + $this->setBrowser( $this->BROWSER_FIREFOX ); + + return true; + } else if ( preg_match( "/Firefox$/i", $this->_agent, $matches ) ) { + $this->setVersion( "" ); + $this->setBrowser( $this->BROWSER_FIREFOX ); + + return true; + } + } + + return false; + } + + /** + * Determine if the browser is Firefox or not (last updated 1.7) + * + * @return boolean True if the browser is Firefox otherwise false + */ + function checkBrowserIceweasel() { + if ( stripos( $this->_agent, 'Iceweasel' ) !== false ) { + $aresult = explode( '/', stristr( $this->_agent, 'Iceweasel' ) ); + $aversion = explode( ' ', $aresult[1] ); + $this->setVersion( $aversion[0] ); + $this->setBrowser( $this->BROWSER_ICEWEASEL ); + + return true; + } + + return false; + } + + /** + * Determine if the browser is Mozilla or not (last updated 1.7) + * + * @return boolean True if the browser is Mozilla otherwise false + */ + function checkBrowserMozilla() { + if ( stripos( $this->_agent, 'mozilla' ) !== false && preg_match( '/rv:[0-9].[0-9][a-b]?/i', $this->_agent ) && stripos( $this->_agent, 'netscape' ) === false ) { + $aversion = explode( ' ', stristr( $this->_agent, 'rv:' ) ); + preg_match( '/rv:[0-9].[0-9][a-b]?/i', $this->_agent, $aversion ); + $this->setVersion( str_replace( 'rv:', '', $aversion[0] ) ); + $this->setBrowser( $this->BROWSER_MOZILLA ); + + return true; + } else if ( stripos( $this->_agent, 'mozilla' ) !== false && preg_match( '/rv:[0-9]\.[0-9]/i', $this->_agent ) && stripos( $this->_agent, 'netscape' ) === false ) { + $aversion = explode( '', stristr( $this->_agent, 'rv:' ) ); + $this->setVersion( str_replace( 'rv:', '', $aversion[0] ) ); + $this->setBrowser( $this->BROWSER_MOZILLA ); + + return true; + } else if ( stripos( $this->_agent, 'mozilla' ) !== false && preg_match( '/mozilla\/([^ ]*)/i', $this->_agent, $matches ) && stripos( $this->_agent, 'netscape' ) === false ) { + $this->setVersion( $matches[1] ); + $this->setBrowser( $this->BROWSER_MOZILLA ); + + return true; + } + + return false; + } + + /** + * Determine if the browser is Lynx or not (last updated 1.7) + * + * @return boolean True if the browser is Lynx otherwise false + */ + function checkBrowserLynx() { + if ( stripos( $this->_agent, 'lynx' ) !== false ) { + $aresult = explode( '/', stristr( $this->_agent, 'Lynx' ) ); + $aversion = explode( ' ', ( isset( $aresult[1] ) ? $aresult[1] : "" ) ); + $this->setVersion( $aversion[0] ); + $this->setBrowser( $this->BROWSER_LYNX ); + + return true; + } + + return false; + } + + /** + * Determine if the browser is Amaya or not (last updated 1.7) + * + * @return boolean True if the browser is Amaya otherwise false + */ + function checkBrowserAmaya() { + if ( stripos( $this->_agent, 'amaya' ) !== false ) { + $aresult = explode( '/', stristr( $this->_agent, 'Amaya' ) ); + $aversion = explode( ' ', $aresult[1] ); + $this->setVersion( $aversion[0] ); + $this->setBrowser( $this->BROWSER_AMAYA ); + + return true; + } + + return false; + } + + /** + * Determine if the browser is Safari or not (last updated 1.7) + * + * @return boolean True if the browser is Safari otherwise false + */ + function checkBrowserSafari() { + if ( stripos( $this->_agent, 'Safari' ) !== false && stripos( $this->_agent, 'iPhone' ) === false && stripos( $this->_agent, 'iPod' ) === false ) { + $aresult = explode( '/', stristr( $this->_agent, 'Version' ) ); + if ( isset( $aresult[1] ) ) { + $aversion = explode( ' ', $aresult[1] ); + $this->setVersion( $aversion[0] ); + } else { + $this->setVersion( $this->VERSION_UNKNOWN ); + } + $this->setBrowser( $this->BROWSER_SAFARI ); + + return true; + } + + return false; + } + + /** + * Determine if the browser is iPhone or not (last updated 1.7) + * + * @return boolean True if the browser is iPhone otherwise false + */ + function checkBrowseriPhone() { + if ( stripos( $this->_agent, 'iPhone' ) !== false ) { + $aresult = explode( '/', stristr( $this->_agent, 'Version' ) ); + if ( isset( $aresult[1] ) ) { + $aversion = explode( ' ', $aresult[1] ); + $this->setVersion( $aversion[0] ); + } else { + $this->setVersion( $this->VERSION_UNKNOWN ); + } + $this->setMobile( true ); + $this->setBrowser( $this->BROWSER_IPHONE ); + + return true; + } + + return false; + } + + /** + * Determine if the browser is iPod or not (last updated 1.7) + * + * @return boolean True if the browser is iPod otherwise false + */ + function checkBrowseriPad() { + if ( stripos( $this->_agent, 'iPad' ) !== false ) { + $aresult = explode( '/', stristr( $this->_agent, 'Version' ) ); + if ( isset( $aresult[1] ) ) { + $aversion = explode( ' ', $aresult[1] ); + $this->setVersion( $aversion[0] ); + } else { + $this->setVersion( $this->VERSION_UNKNOWN ); + } + $this->setMobile( true ); + $this->setBrowser( $this->BROWSER_IPAD ); + + return true; + } + + return false; + } + + /** + * Determine if the browser is iPod or not (last updated 1.7) + * + * @return boolean True if the browser is iPod otherwise false + */ + function checkBrowseriPod() { + if ( stripos( $this->_agent, 'iPod' ) !== false ) { + $aresult = explode( '/', stristr( $this->_agent, 'Version' ) ); + if ( isset( $aresult[1] ) ) { + $aversion = explode( ' ', $aresult[1] ); + $this->setVersion( $aversion[0] ); + } else { + $this->setVersion( $this->VERSION_UNKNOWN ); + } + $this->setMobile( true ); + $this->setBrowser( $this->BROWSER_IPOD ); + + return true; + } + + return false; + } + + /** + * Determine if the browser is Android or not (last updated 1.7) + * + * @return boolean True if the browser is Android otherwise false + */ + function checkBrowserAndroid() { + if ( stripos( $this->_agent, 'Android' ) !== false ) { + $aresult = explode( ' ', stristr( $this->_agent, 'Android' ) ); + if ( isset( $aresult[1] ) ) { + $aversion = explode( ' ', $aresult[1] ); + $this->setVersion( $aversion[0] ); + } else { + $this->setVersion( $this->VERSION_UNKNOWN ); + } + $this->setMobile( true ); + $this->setBrowser( $this->BROWSER_ANDROID ); + + return true; + } + + return false; + } + + /** + * Determine the user's platform (last updated 1.7) + */ + function checkPlatform() { + if ( stripos( $this->_agent, 'windows' ) !== false ) { + $this->_platform = $this->PLATFORM_WINDOWS; + } elseif ( stripos( $this->_agent, 'iPad' ) !== false ) { + $this->_platform = $this->PLATFORM_IPAD; + } elseif ( stripos( $this->_agent, 'iPod' ) !== false ) { + $this->_platform = $this->PLATFORM_IPOD; + } elseif ( stripos( $this->_agent, 'iPhone' ) !== false ) { + $this->_platform = $this->PLATFORM_IPHONE; + } elseif ( stripos( $this->_agent, 'mac' ) !== false ) { + $this->_platform = $this->PLATFORM_APPLE; + } elseif ( stripos( $this->_agent, 'android' ) !== false ) { + $this->_platform = $this->PLATFORM_ANDROID; + } elseif ( stripos( $this->_agent, 'linux' ) !== false ) { + $this->_platform = $this->PLATFORM_LINUX; + } elseif ( stripos( $this->_agent, 'Nokia' ) !== false ) { + $this->_platform = $this->PLATFORM_NOKIA; + } elseif ( stripos( $this->_agent, 'BlackBerry' ) !== false ) { + $this->_platform = $this->PLATFORM_BLACKBERRY; + } elseif ( stripos( $this->_agent, 'FreeBSD' ) !== false ) { + $this->_platform = $this->PLATFORM_FREEBSD; + } elseif ( stripos( $this->_agent, 'OpenBSD' ) !== false ) { + $this->_platform = $this->PLATFORM_OPENBSD; + } elseif ( stripos( $this->_agent, 'NetBSD' ) !== false ) { + $this->_platform = $this->PLATFORM_NETBSD; + } elseif ( stripos( $this->_agent, 'OpenSolaris' ) !== false ) { + $this->_platform = $this->PLATFORM_OPENSOLARIS; + } elseif ( stripos( $this->_agent, 'SunOS' ) !== false ) { + $this->_platform = $this->PLATFORM_SUNOS; + } elseif ( stripos( $this->_agent, 'OS\/2' ) !== false ) { + $this->_platform = $this->PLATFORM_OS2; + } elseif ( stripos( $this->_agent, 'BeOS' ) !== false ) { + $this->_platform = $this->PLATFORM_BEOS; + } elseif ( stripos( $this->_agent, 'win' ) !== false ) { + $this->_platform = $this->PLATFORM_WINDOWS; + } + } + } + } +?> diff --git a/plugins/legacy-admin/framework/core/inc/class.p.php b/plugins/legacy-admin/framework/core/inc/class.p.php new file mode 100644 index 000000000..0e919cf01 --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/class.p.php @@ -0,0 +1,301 @@ + and +// are disabled by default, see for more information. +// callback - If specified, the response JSON will be wrapped in this named +// function call. This parameter and are disabled by +// default, see for more information. +// user_agent - This value will be sent to the remote URL request as the +// `User-Agent:` HTTP request header. If omitted, the browser user agent +// will be passed through. +// send_cookies - If send_cookies=1, all cookies will be forwarded through to +// the remote URL request. +// send_session - If send_session=1 and send_cookies=1, the SID cookie will be +// forwarded through to the remote URL request. +// full_headers - If a JSON request and full_headers=1, the JSON response will +// contain detailed header information. +// full_status - If a JSON request and full_status=1, the JSON response will +// contain detailed cURL status information, otherwise it will just contain +// the `http_code` property. +// +// Topic: POST Parameters +// +// All POST parameters are automatically passed through to the remote URL +// request. +// +// Topic: JSON requests +// +// This request will return the contents of the specified url in JSON format. +// +// Request: +// +// > ba-simple-proxy.php?url=http://example.com/ +// +// Response: +// +// > { "contents": "...", "headers": {...}, "status": {...} } +// +// JSON object properties: +// +// contents - (String) The contents of the remote URL resource. +// headers - (Object) A hash of HTTP headers returned by the remote URL +// resource. +// status - (Object) A hash of status codes returned by cURL. +// +// Topic: JSONP requests +// +// This request will return the contents of the specified url in JSONP format +// (but only if $enable_jsonp is enabled in the PHP script). +// +// Request: +// +// > ba-simple-proxy.php?url=http://example.com/&callback=foo +// +// Response: +// +// > foo({ "contents": "...", "headers": {...}, "status": {...} }) +// +// JSON object properties: +// +// contents - (String) The contents of the remote URL resource. +// headers - (Object) A hash of HTTP headers returned by the remote URL +// resource. +// status - (Object) A hash of status codes returned by cURL. +// +// Topic: Native requests +// +// This request will return the contents of the specified url in the format it +// was received in, including the same content-type and other headers (but only +// if $enable_native is enabled in the PHP script). +// +// Request: +// +// > ba-simple-proxy.php?url=http://example.com/&mode=native +// +// Response: +// +// > ... +// +// Topic: Notes +// +// * Assumes magic_quotes_gpc = Off in php.ini +// +// Topic: Configuration Options +// +// These variables can be manually edited in the PHP file if necessary. +// +// $enable_jsonp - Only enable if you really need to. If you +// install this script on the same server as the page you're calling it +// from, plain JSON will work. Defaults to false. +// $enable_native - You can enable , but you should only do +// this if you also whitelist specific URLs using $valid_url_regex, to avoid +// possible XSS vulnerabilities. Defaults to false. +// $valid_url_regex - This regex is matched against the url parameter to +// ensure that it is valid. This setting only needs to be used if either +// $enable_jsonp or $enable_native are enabled. Defaults to '/.*/' which +// validates all URLs. +// +// ############################################################################ + + + $_GET['mode'] = "native"; + $_GET['full_headers'] = 1; + $_GET['full_status'] = 1; + $_GET['send_cookies'] = 1; + + +// Change these configuration options if needed, see above descriptions for info. + $enable_jsonp = false; + $enable_native = true; + $valid_url_regex = '/.*/'; + +// ############################################################################ + $url = $_GET['url']; + + if ( isset( $_GET['nonce'] ) ) { + $url = str_replace( 'nonce=' . $_GET['nonce'] . '&', '', $url ); + } + + + if ( ! $url ) { + + // Passed url not specified. + $contents = 'ERROR: url not specified'; + $status = array( 'http_code' => 'ERROR' ); + + } else if ( ! preg_match( $valid_url_regex, $url ) ) { + + // Passed url doesn't match $valid_url_regex. + $contents = 'ERROR: invalid url'; + $status = array( 'http_code' => 'ERROR' ); + + } else { + $url = urldecode( $url ); + if ( isset( $_GET['proxy'] ) ) { + $url .= '&proxy=' . $_GET['proxy']; + } + + // Ad URL rewrite + if ( strpos( $url, 'http' ) === false ) { + $url = 'http:' . $url; + } + + if ( isset( $_GET['callback'] ) ) { + foreach ( $_GET as $key => $value ) { + if ( in_array( $key, array( 'url', 'mode', 'full_headers', 'full_status', 'send_cookies' ) ) ) { + continue; + } + $url .= "&" . $key . '=' . $value; + } + } + + + $args = array( + 'user-agent' => isset( $_GET['user_agent'] ) ? $_GET['user_agent'] : $_SERVER['HTTP_USER_AGENT'], + 'method' => 'GET', + ); + + if ( isset( $_GET['send_cookies'] ) && $_GET['send_cookies'] ) { + $cookie = array(); + foreach ( $_COOKIE as $key => $value ) { + $cookie[] = $key . '=' . $value; + } + if ( isset( $_GET['send_session'] ) && $_GET['send_session'] ) { + $cookie[] = SID; + } + $args['cookies'] = $cookie; + + } + if ( strtolower( $_SERVER['REQUEST_METHOD'] ) == 'post' ) { + $args['body'] = $_POST; + $args['method'] = 'POST'; + + } + + + $response = wp_remote_request( + $url, + $args + ); + + if ( ! is_wp_error( $response ) ) { + $status = $response['response']['code']; + $contents = $response['body']; + } + + } + + + if ( isset( $_GET['mode'] ) && $_GET['mode'] == 'native' ) { + if ( ! $enable_native ) { + $contents = 'ERROR: invalid mode'; + $status = array( 'http_code' => 'ERROR' ); + } + + if ( isset( $response['headers']['content-type'] ) ) { + header( 'Content-Type: ' . $response['headers']['content-type'] ); + } + if ( isset( $response['headers']['content-language'] ) ) { + header( 'Content-Language: ' . $response['headers']['content-language'] ); + } + if ( isset( $response['headers']['set-cookie'] ) ) { + header( 'Set-Cookie: ' . $response['headers']['set-cookie'] ); + } + + print str_replace( 'ads.reduxframework.com', 'look.reduxframework.com', $contents ); + + } else { + + // $data will be serialized into JSON data. + $data = array(); + + // Propagate all HTTP headers into the JSON data object. + if ( isset( $_GET['full_headers'] ) && $_GET['full_headers'] ) { + $data['headers'] = array(); + + } + + // Propagate all cURL request / response info to the JSON data object. + if ( isset( $_GET['full_status'] ) && $_GET['full_status'] ) { + $data['status'] = $status; + } else { + $data['status'] = array(); + $data['status']['http_code'] = $status['http_code']; + } + + // Set the JSON data object contents, decoding it from JSON if possible. + $decoded_json = json_decode( $contents ); + $data['contents'] = str_replace( 'e(window).width()', 'window.innerWidth||e(window).width()', $decoded_json ? $decoded_json : $contents ); + + // Generate appropriate content-type header. + + $is_xhr = isset( $_SERVER['HTTP_X_REQUESTED_WITH'] ) ? strtolower( $_SERVER['HTTP_X_REQUESTED_WITH'] ) : 'xmlhttprequest'; + header( 'Content-type: application/' . ( $is_xhr ? 'json' : 'x-javascript' ) ); + + // Get JSONP callback. + $jsonp_callback = $enable_jsonp && isset( $_GET['callback'] ) ? $_GET['callback'] : null; + + // Generate JSON/JSONP string + $json = json_encode( $data ); + + print $jsonp_callback ? "$jsonp_callback($json)" : $json; + + } + + } + } + + new Redux_P(); + diff --git a/plugins/legacy-admin/framework/core/inc/class.redux_api.php b/plugins/legacy-admin/framework/core/inc/class.redux_api.php new file mode 100644 index 000000000..2ed7e3f48 --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/class.redux_api.php @@ -0,0 +1,462 @@ +{$closure}->bindTo( $this ), $args ); + } + + public function __toString() { + return call_user_func( $this->{"__toString"}->bindTo( $this ) ); + } + + public static function load() { + add_action( 'after_setup_theme', array( 'Redux', 'createRedux' ) ); + add_action( 'init', array( 'Redux', 'createRedux' ) ); + } + + public static function init( $opt_name = "" ) { + if ( ! empty( $opt_name ) ) { + self::loadRedux( $opt_name ); + remove_action( 'setup_theme', array( 'Redux', 'createRedux' ) ); + } + } + + public static function loadExtensions( $ReduxFramework ) { + if ( $instanceExtensions = self::getExtensions( $ReduxFramework->args['opt_name'], "" ) ) { + foreach ( $instanceExtensions as $name => $extension ) { + if ( ! class_exists( $extension['class'] ) ) { + // In case you wanted override your override, hah. + $extension['path'] = apply_filters( 'redux/extension/' . $ReduxFramework->args['opt_name'] . '/' . $name, $extension['path'] ); + if ( file_exists( $extension['path'] ) ) { + require_once( $extension['path'] ); + } + } + if ( ! isset( $ReduxFramework->extensions[ $name ] ) ) { + if ( class_exists( $extension['class'] ) ) { + $ReduxFramework->extensions[ $name ] = new $extension['class']( $ReduxFramework ); + } else { + echo '

    No class named ' . $extension['class'] . ' exists. Please verify your extension path.

    '; + } + + } + } + } + } + + public static function extensionPath( $extension, $folder = true ) { + if ( ! isset( Redux::$extensions[ $extension ] ) ) { + return; + } + $path = end( Redux::$extensions[ $extension ] ); + if ( ! $folder ) { + return $path; + } + + return str_replace( 'extension_' . $extension . '.php', '', $path ); + } + + + public static function loadRedux( $opt_name = "" ) { + + if ( empty( $opt_name ) ) { + return; + } + + $check = ReduxFrameworkInstances::get_instance( $opt_name ); + if ( isset( $check->apiHasRun ) ) { + return; + } + + $args = self::constructArgs( $opt_name ); + $sections = self::constructSections( $opt_name ); + if ( ! class_exists( 'ReduxFramework' ) ) { + echo '

    Redux Framework is not installed. Please install it.

    '; + + return; + } + if ( isset( self::$uses_extensions[ $opt_name ] ) && ! empty( self::$uses_extensions[ $opt_name ] ) ) { + add_action( "redux/extensions/{$opt_name}/before", array( 'Redux', 'loadExtensions' ), 0 ); + } + + $redux = new ReduxFramework( $sections, $args ); + $redux->apiHasRun = 1; + self::$init[ $opt_name ] = 1; + if ( isset( $redux->args['opt_name'] ) && $redux->args['opt_name'] != $opt_name ) { + self::$init[ $redux->args['opt_name'] ] = 1; + } + + } + + public static function createRedux() { + foreach ( self::$sections as $opt_name => $theSections ) { + if ( ! self::$init[ $opt_name ] ) { + self::loadRedux( $opt_name ); + } + } + } + + public static function constructArgs( $opt_name ) { + $args = isset( self::$args[ $opt_name ] ) ? self::$args[ $opt_name ] : array(); + + $args['opt_name'] = $opt_name; + if ( ! isset( $args['menu_title'] ) ) { + $args['menu_title'] = ucfirst( $opt_name ) . ' Options'; + } + if ( ! isset( $args['page_title'] ) ) { + $args['page_title'] = ucfirst( $opt_name ) . ' Options'; + } + if ( ! isset( $args['page_slug'] ) ) { + $args['page_slug'] = $opt_name . '_options'; + } + + return $args; + } + + public static function constructSections( $opt_name ) { + $sections = array(); + if ( ! isset( self::$sections[ $opt_name ] ) ) { + return $sections; + + } + foreach ( self::$sections[ $opt_name ] as $section_id => $section ) { + $section['fields'] = self::constructFields( $opt_name, $section_id ); + $p = $section['priority']; + while ( isset( $sections[ $p ] ) ) { + echo $p ++; + } + $sections[ $p ] = $section; + } + ksort( $sections ); + + return $sections; + } + + public static function constructFields( $opt_name = "", $section_id = "" ) { + $fields = array(); + if ( ! empty( self::$fields[ $opt_name ] ) ) { + foreach ( self::$fields[ $opt_name ] as $key => $field ) { + if ( $field['section_id'] == $section_id ) { + $p = $field['priority']; + while ( isset( $fields[ $p ] ) ) { + echo $p ++; + } + $fields[ $p ] = $field; + } + } + } + ksort( $fields ); + + return $fields; + } + + public static function getSection( $opt_name = '', $id = '' ) { + self::check_opt_name( $opt_name ); + if ( ! empty( $opt_name ) && ! empty( $id ) ) { + if ( ! isset( self::$sections[ $opt_name ][ $id ] ) ) { + $id = strtolower( sanitize_html_class( $id ) ); + } + + return isset( self::$sections[ $opt_name ][ $id ] ) ? self::$sections[ $opt_name ][ $id ] : false; + } + + return false; + } + + public static function setSections( $opt_name = '', $sections = array() ) { + self::check_opt_name( $opt_name ); + if ( ! empty( $sections ) ) { + foreach ( $sections as $section ) { + Redux::setSection( $opt_name, $section ); + } + } + } + + public static function setSection( $opt_name = '', $section = array() ) { + self::check_opt_name( $opt_name ); + if ( ! isset( $section['id'] ) ) { + $section['id'] = strtolower( sanitize_html_class( $section['title'] ) ); + if ( isset( self::$sections[ $opt_name ][ $section['id'] ] ) ) { + $orig = $section['id']; + $i = 0; + while ( isset( self::$sections[ $opt_name ][ $section['id'] ] ) ) { + $section['id'] = $orig . '_' . $i; + } + } + } + + if ( ! empty( $opt_name ) && is_array( $section ) && ! empty( $section ) ) { + if ( ! isset( $section['id'] ) && ! isset( $section['title'] ) ) { + self::$errors[ $opt_name ]['section']['missing_title'] = "Unable to create a section due to missing id and title."; + + return; + } + if ( ! isset( $section['priority'] ) ) { + $section['priority'] = self::getPriority( $opt_name, 'sections' ); + } + if ( isset( $section['fields'] ) ) { + if ( ! empty( $section['fields'] ) && is_array( $section['fields'] ) ) { + self::processFieldsArray( $opt_name, $section['id'], $section['fields'] ); + } + unset( $section['fields'] ); + } + self::$sections[ $opt_name ][ $section['id'] ] = $section; + } else { + self::$errors[ $opt_name ]['section']['empty'] = "Unable to create a section due an empty section array or the section variable passed was not an array."; + + return; + } + } + + public static function processFieldsArray( $opt_name = "", $section_id = "", $fields = array() ) { + if ( ! empty( $opt_name ) && ! empty( $section_id ) && is_array( $fields ) && ! empty( $fields ) ) { + foreach ( $fields as $field ) { + if ( ! is_array( $field ) ) { + continue; + } + $field['section_id'] = $section_id; + self::setField( $opt_name, $field ); + } + } + } + + public static function getField( $opt_name = '', $id = '' ) { + self::check_opt_name( $opt_name ); + if ( ! empty( $opt_name ) && ! empty( $id ) ) { + return isset( self::$fields[ $opt_name ][ $id ] ) ? self::$fields[ $opt_name ][ $id ] : false; + } + + return false; + } + + public static function setField( $opt_name = '', $field = array() ) { + self::check_opt_name( $opt_name ); + + if ( ! empty( $opt_name ) && is_array( $field ) && ! empty( $field ) ) { + + if ( ! isset( $field['priority'] ) ) { + $field['priority'] = self::getPriority( $opt_name, 'fields' ); + } + self::$fields[ $opt_name ][ $field['id'] ] = $field; + } + } + + public static function setHelpTab( $opt_name = "", $tab = array() ) { + self::check_opt_name( $opt_name ); + if ( ! empty( $opt_name ) && ! empty( $tab ) ) { + if ( ! isset( self::$args[ $opt_name ]['help_tabs'] ) ) { + self::$args[ $opt_name ]['help_tabs'] = array(); + } + if ( isset( $tab['id'] ) ) { + self::$args[ $opt_name ]['help_tabs'][] = $tab; + } else if ( is_array( end( $tab ) ) ) { + foreach ( $tab as $tab_item ) { + self::$args[ $opt_name ]['help_tabs'][] = $tab_item; + } + } + } + } + + public static function setHelpSidebar( $opt_name = "", $content = "" ) { + self::check_opt_name( $opt_name ); + if ( ! empty( $opt_name ) && ! empty( $content ) ) { + self::$args[ $opt_name ]['help_sidebar'] = $content; + } + } + + public static function setArgs( $opt_name = "", $args = array() ) { + self::check_opt_name( $opt_name ); + if ( ! empty( $opt_name ) && ! empty( $args ) && is_array( $args ) ) { + self::$args[ $opt_name ] = wp_parse_args( $args, self::$args[ $opt_name ] ); + } + } + + public static function getArgs( $opt_name = "" ) { + self::check_opt_name( $opt_name ); + if ( ! empty( $opt_name ) && ! empty( self::$args[ $opt_name ] ) ) { + return self::$args[ $opt_name ]; + } + } + + public static function getArg( $opt_name = "", $key = "" ) { + self::check_opt_name( $opt_name ); + if ( ! empty( $opt_name ) && ! empty( $key ) && ! empty( self::$args[ $opt_name ] ) ) { + return self::$args[ $opt_name ][ $key ]; + } else { + return; + } + } + + public static function getPriority( $opt_name, $type ) { + $priority = self::$priority[ $opt_name ][ $type ]; + self::$priority[ $opt_name ][ $type ] += 1; + + return $priority; + } + + public static function check_opt_name( $opt_name = "" ) { + if ( empty( $opt_name ) || is_array( $opt_name ) ) { + return; + } + if ( ! isset( self::$args[ $opt_name ] ) ) { + self::$args[ $opt_name ] = array(); + self::$priority[ $opt_name ]['args'] = 1; + } + if ( ! isset( self::$sections[ $opt_name ] ) ) { + self::$sections[ $opt_name ] = array(); + self::$priority[ $opt_name ]['sections'] = 1; + } + if ( ! isset( self::$fields[ $opt_name ] ) ) { + self::$fields[ $opt_name ] = array(); + self::$priority[ $opt_name ]['fields'] = 1; + } + if ( ! isset( self::$help[ $opt_name ] ) ) { + self::$help[ $opt_name ] = array(); + self::$priority[ $opt_name ]['help'] = 1; + } + if ( ! isset( self::$errors[ $opt_name ] ) ) { + self::$errors[ $opt_name ] = array(); + } + if ( ! isset( self::$init[ $opt_name ] ) ) { + self::$init[ $opt_name ] = false; + } + } + + /** + * Retrieve metadata from a file. Based on WP Core's get_file_data function + * + * @since 2.1.1 + * + * @param string $file Path to the file + * + * @return string + */ + public static function getFileVersion( $file, $size = 8192 ) { + // We don't need to write to the file, so just open for reading. + $fp = fopen( $file, 'r' ); + + // Pull only the first 8kiB of the file in. + $file_data = fread( $fp, $size ); + + // PHP will close file handle, but we are good citizens. + fclose( $fp ); + + // Make sure we catch CR-only line endings. + $file_data = str_replace( "\r", "\n", $file_data ); + $version = ''; + + if ( preg_match( '/^[ \t\/*#@]*' . preg_quote( '@version', '/' ) . '(.*)$/mi', $file_data, $match ) && $match[1] ) { + $version = _cleanup_header_comment( $match[1] ); + } + + return $version; + } + + public static function checkExtensionClassFile( $opt_name, $name = "", $class_file = "" ) { + if ( file_exists( $class_file ) ) { + self::$uses_extensions[ $opt_name ] = isset( self::$uses_extensions[ $opt_name ] ) ? self::$uses_extensions[ $opt_name ] : array(); + if ( ! in_array( $name, self::$uses_extensions[ $opt_name ] ) ) { + self::$uses_extensions[ $opt_name ][] = $name; + } + + self::$extensions[ $name ] = isset( self::$extensions[ $name ] ) ? self::$extensions[ $name ] : array(); + $version = self::getFileVersion( $class_file ); + self::$extensions[ $name ][ $version ] = isset( self::$extensions[ $name ][ $version ] ) ? self::$extensions[ $name ][ $version ] : $class_file; + } + } + + public static function setExtensions( $opt_name, $path ) { + if ( is_dir( $path ) ) { + $path = trailingslashit( $path ); + $folder = str_replace( '.php', '', basename( $path ) ); + if ( file_exists( $path . 'extension_' . $folder . '.php' ) ) { + self::checkExtensionClassFile( $opt_name, $folder, $path . 'extension_' . $folder . '.php' ); + } else { + $folders = scandir( $path, 1 ); + foreach ( $folders as $folder ) { + if ( $folder === '.' or $folder === '..' ) { + continue; + } + if ( file_exists( $path . $folder . '/extension_' . $folder . '.php' ) ) { + self::checkExtensionClassFile( $opt_name, $folder, $path . $folder . '/extension_' . $folder . '.php' ); + } else if ( is_dir( $path . $folder ) ) { + self::setExtensions( $opt_name, $path . $folder ); + continue; + } + } + } + } else if ( file_exists( $path ) ) { + $name = explode( 'extension_', basename( $path ) ); + if ( isset( $name[1] ) && ! empty( $name[1] ) ) { + $name = str_replace( '.php', '', $name[1] ); + self::checkExtensionClassFile( $opt_name, $name, $path ); + } + } + } + + public static function getExtensions( $opt_name = "", $key = "" ) { + if ( empty( $opt_name ) ) { + if ( empty( $key ) ) { + return self::$extension_paths[ $key ]; + } else { + if ( isset( self::$extension_paths[ $key ] ) ) { + return self::$extension_paths[ $key ]; + } + } + } else { + if ( empty( self::$uses_extensions[ $opt_name ] ) ) { + return false; + } + $instanceExtensions = array(); + foreach ( self::$uses_extensions[ $opt_name ] as $extension ) { + $class_file = end( self::$extensions[ $extension ] ); + $name = str_replace( '.php', '', basename( $extension ) ); + $extension_class = 'ReduxFramework_Extension_' . $name; + $instanceExtensions[ $extension ] = array( + 'path' => $class_file, + 'class' => $extension_class + ); + } + + return $instanceExtensions; + } + + return false; + } + } + + Redux::load(); + } diff --git a/plugins/legacy-admin/framework/core/inc/class.redux_filesystem.php b/plugins/legacy-admin/framework/core/inc/class.redux_filesystem.php new file mode 100644 index 000000000..e41075176 --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/class.redux_filesystem.php @@ -0,0 +1,215 @@ +filesystem = $this; + $this->parent = $parent; + } + + public function ftp_form() { + if ( isset( $this->parent->ftp_form ) && ! empty( $this->parent->ftp_form ) ) { + echo '

    '; + echo __( 'Unable to modify required files. Please ensure that', 'legacy_framework' ); + echo ' ' . Redux_Helpers::cleanFilePath( trailingslashit( WP_CONTENT_DIR ) ) . '/uploads/ '; + echo __( 'has the proper read/write permissions or enter your FTP information below.', 'legacy_framework' ); + echo '

    ' . $this->parent->ftp_form . '
    '; + } + } + + function filesystem_init( $form_url, $method = '', $context = false, $fields = null ) { + global $wp_filesystem; + if ( ! empty( $this->creds ) ) { + return true; + } + + ob_start(); + + /* first attempt to get credentials */ + if ( false === ( $this->creds = request_filesystem_credentials( $form_url, $method, false, $context ) ) ) { + $this->creds = array(); + $this->parent->ftp_form = ob_get_contents(); + ob_end_clean(); + + /** + * if we comes here - we don't have credentials + * so the request for them is displaying + * no need for further processing + **/ + + return false; + } + + /* now we got some credentials - try to use them*/ + if ( ! WP_Filesystem( $this->creds ) ) { + $this->creds = array(); + /* incorrect connection data - ask for credentials again, now with error message */ + request_filesystem_credentials( $form_url, '', true, $context ); + $this->parent->ftp_form = ob_get_contents(); + ob_end_clean(); + + return false; + } + + return true; + } + + public function execute( $action, $file = '', $params = '' ) { + + if ( empty( $this->parent->args ) ) { + return; + } + + if ( ! empty ( $params ) ) { + extract( $params ); + } + + // Setup the filesystem with creds + require_once( ABSPATH . '/wp-admin/includes/template.php' ); + require_once( ABSPATH . '/wp-admin/includes/file.php' ); + + if ( $this->parent->args['menu_type'] == 'submenu' ) { + $page_parent = $this->parent->args['page_parent']; + $base = $page_parent . '?page=' . $this->parent->args['page_slug']; + } else { + $base = 'admin.php?page=' . $this->parent->args['page_slug']; + } + + $url = wp_nonce_url( $base, 'redux-options' ); + + $this->filesystem_init( $url, 'direct', dirname( $file ) ); + + return $this->do_action( $action, $file, $params ); + } + + public function do_action( $action, $file = '', $params = '' ) { + + if ( ! empty ( $params ) ) { + extract( $params ); + } + + global $wp_filesystem; + + if ( ! isset( $params['chmod'] ) || ( isset( $params['chmod'] ) && empty( $params['chmod'] ) ) ) { + if ( defined( 'FS_CHMOD_FILE' ) ) { + $chmod = FS_CHMOD_FILE; + } else { + $chmod = 0644; + } + } + $res = false; + if ( ! isset( $recursive ) ) { + $recursive = false; + } + + //$target_dir = $wp_filesystem->find_folder( dirname( $file ) ); + + // Do unique stuff + if ( $action == 'mkdir' ) { + + if ( defined( 'FS_CHMOD_DIR' ) ) { + $chmod = FS_CHMOD_DIR; + } else { + $chmod = 0755; + } + $res = $wp_filesystem->mkdir( $file ); + if ( ! $res ) { + wp_mkdir_p( $file ); + + $res = file_exists( $file ); + if ( ! $res ) { + mkdir( $file, $chmod, true ); + $res = file_exists( $file ); + } + } + } elseif ( $action == 'rmdir' ) { + $res = $wp_filesystem->rmdir( $file, $recursive ); + } elseif ( $action == 'copy' && ! isset( $this->filesystem->killswitch ) ) { + if ( isset( $this->parent->ftp_form ) && ! empty( $this->parent->ftp_form ) ) { + $res = copy( $file, $destination ); + if ( $res ) { + chmod( $destination, $chmod ); + } + } else { + $res = $wp_filesystem->copy( $file, $destination, $overwrite, $chmod ); + } + } elseif ( $action == 'move' && ! isset( $this->filesystem->killswitch ) ) { + $res = $wp_filesystem->copy( $file, $destination, $overwrite ); + } elseif ( $action == 'delete' ) { + $res = $wp_filesystem->delete( $file, $recursive ); + } elseif ( $action == 'rmdir' ) { + $res = $wp_filesystem->rmdir( $file, $recursive ); + } elseif ( $action == 'dirlist' ) { + if ( ! isset( $include_hidden ) ) { + $include_hidden = true; + } + $res = $wp_filesystem->dirlist( $file, $include_hidden, $recursive ); + } elseif ( $action == 'put_contents' && ! isset( $this->filesystem->killswitch ) ) { + // Write a string to a file + if ( isset( $this->parent->ftp_form ) && ! empty( $this->parent->ftp_form ) ) { + $res = file_put_contents( $file, $content, $chmod ); + if ( $res ) { + chmod( $file, $chmod ); + } + } else { + $res = $wp_filesystem->put_contents( $file, $content, $chmod ); + } + } elseif ( $action == 'chown' ) { + // Changes file owner + if ( isset( $owner ) && ! empty( $owner ) ) { + $res = $wp_filesystem->chmod( $file, $chmod, $recursive ); + } + } elseif ( $action == 'owner' ) { + // Gets file owner + $res = $wp_filesystem->owner( $file ); + } elseif ( $action == 'chmod' ) { + + if ( ! isset( $params['chmod'] ) || ( isset( $params['chmod'] ) && empty( $params['chmod'] ) ) ) { + $chmod = false; + } + + $res = $wp_filesystem->chmod( $file, $chmod, $recursive ); + + } elseif ( $action == 'get_contents' ) { + // Reads entire file into a string + if ( isset( $this->parent->ftp_form ) && ! empty( $this->parent->ftp_form ) ) { + $res = file_get_contents( $file ); + } else { + $res = $wp_filesystem->get_contents( $file ); + } + } elseif ( $action == 'get_contents_array' ) { + // Reads entire file into an array + $res = $wp_filesystem->get_contents_array( $file ); + } elseif ( $action == 'object' ) { + $res = $wp_filesystem; + } elseif ( $action == 'unzip' ) { + $unzipfile = unzip_file( $file, $destination ); + if ( $unzipfile ) { + $res = true; + } + } + if ( isset( $res ) && ! $res ) { + $this->killswitch = true; + } + + if ( ! $res ) { + add_action( "redux/page/{$this->parent->args['opt_name']}/form/before", array( + $this, + 'ftp_form' + ) ); + } + + return $res; + } + } + } diff --git a/plugins/legacy-admin/framework/core/inc/class.redux_functions.php b/plugins/legacy-admin/framework/core/inc/class.redux_functions.php new file mode 100644 index 000000000..02d21e24f --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/class.redux_functions.php @@ -0,0 +1,278 @@ +args['dev_mode'] ) { + $min = '.min'; + } + + return $min; + } + + /** + * Parse CSS from output/compiler array + * + * @since 3.2.8 + * @access private + * @return $css CSS string + */ + public static function parseCSS( $cssArray = array(), $style = '', $value = '' ) { + + // Something wrong happened + if ( count( $cssArray ) == 0 ) { + return; + } else { //if ( count( $cssArray ) >= 1 ) { + $css = ''; + + foreach ( $cssArray as $element => $selector ) { + + // The old way + if ( $element === 0 ) { + $css = self::theOldWay( $cssArray, $style ); + + return $css; + } + + // New way continued + $cssStyle = $element . ':' . $value . ';'; + + $css .= $selector . '{' . $cssStyle . '}'; + } + } + + return $css; + } + + private static function theOldWay( $cssArray, $style ) { + $keys = implode( ",", $cssArray ); + $css = $keys . "{" . $style . '}'; + + return $css; + } + + /** + * initWpFilesystem - Initialized the Wordpress filesystem, if it already isn't. + * + * @since 3.2.3 + * @access public + * @return void + */ + public static function initWpFilesystem() { + global $wp_filesystem; + + // Initialize the Wordpress filesystem, no more using file_put_contents function + if ( empty( $wp_filesystem ) ) { + require_once( ABSPATH . '/wp-admin/includes/file.php' ); + WP_Filesystem(); + } + } + + /** + * verFromGit - Retrives latest Redux version from GIT + * + * @since 3.2.0 + * @access private + * @return string $ver + */ + private static function verFromGit() { + // Get the raw framework.php from github + $gitpage = wp_remote_get( + 'https://raw.github.com/ReduxFramework/legacy_framework/master/ReduxCore/framework.php', array( + 'headers' => array( + 'Accept-Encoding' => '' + ), + 'sslverify' => true, + 'timeout' => 300 + ) ); + + // Is the response code the corect one? + if ( ! is_wp_error( $gitpage ) ) { + if ( isset( $gitpage['body'] ) ) { + // Get the page text. + $body = $gitpage['body']; + + // Find version line in framework.php + $needle = 'public static $_version ='; + $pos = strpos( $body, $needle ); + + // If it's there, continue. We don't want errors if $pos = 0. + if ( $pos > 0 ) { + + // Look for the semi-colon at the end of the version line + $semi = strpos( $body, ";", $pos ); + + // Error avoidance. If the semi-colon is there, continue. + if ( $semi > 0 ) { + + // Extract the version line + $text = substr( $body, $pos, ( $semi - $pos ) ); + + // Find the first quote around the veersion number. + $quote = strpos( $body, "'", $pos ); + + // Extract the version number + $ver = substr( $body, $quote, ( $semi - $quote ) ); + + // Strip off quotes. + $ver = str_replace( "'", '', $ver ); + + return $ver; + } + } + } + } + } + + /** + * updateCheck - Checks for updates to Redux Framework + * + * @since 3.2.0 + * @access public + * + * @param string $curVer Current version of Redux Framework + * + * @return void - Admin notice is diaplyed if new version is found + */ + public static function updateCheck( $curVer ) { + + // If no cookie, check for new ver + if ( ! isset( $_COOKIE['redux_update_check'] ) ) { // || 1 == strcmp($_COOKIE['redux_update_check'], self::$_version)) { + // actual ver number from git repo + $ver = self::verFromGit(); + + // hour long cookie. + setcookie( "redux_update_check", $ver, time() + 3600, '/' ); + } else { + + // saved value from cookie. If it's different from current ver + // we can still show the update notice. + $ver = $_COOKIE['redux_update_check']; + } + + // Set up admin notice on new version + //if ( 1 == strcmp( $ver, $curVer ) ) { + if ( version_compare( $ver, $curVer, '>' ) ) { + self::$_parent->admin_notices[] = array( + 'type' => 'updated', + 'msg' => 'A new build of Redux is now available!

    Your version: ' . $curVer . '
    New version: ' . $ver . '

    If you are not a developer, your theme/plugin author shipped with dev_mode on. Contact them to fix it, but in the meantime you can use our dev_mode disabler.

    Get it now  |', + 'id' => 'dev_notice_' . $ver, + 'dismiss' => true, + ); + } + } + + /** + * adminNotices - Evaluates user dismiss option for displaying admin notices + * + * @since 3.2.0 + * @access public + * @return void + */ + public static function adminNotices($notices = array()) { + global $current_user, $pagenow; + + // Check for an active admin notice array + if ( ! empty( $notices ) ) { + + // Enum admin notices + foreach ( $notices as $notice ) { + + $add_style = ''; + if (strpos($notice['type'], 'redux-message') != false) { + $add_style = 'style="border-left: 4px solid ' . $notice['color'] . '!important;"'; + } + + if ( true == $notice['dismiss'] ) { + + // Get user ID + $userid = $current_user->ID; + + if ( ! get_user_meta( $userid, 'ignore_' . $notice['id'] ) ) { + + // Check if we are on admin.php. If we are, we have + // to get the current page slug and tab, so we can + // feed it back to Wordpress. Why> admin.php cannot + // be accessed without the page parameter. We add the + // tab to return the user to the last panel they were + // on. + $pageName = ''; + $curTab = ''; + if ( $pagenow == 'admin.php' || $pagenow == 'themes.php' ) { + + // Get the current page. To avoid errors, we'll set + // the redux page slug if the GET is empty. + $pageName = empty( $_GET['page'] ) ? '&page=' . self::$_parent->args['page_slug'] : '&page=' . $_GET['page']; + + // Ditto for the current tab. + $curTab = empty( $_GET['tab'] ) ? '&tab=0' : '&tab=' . $_GET['tab']; + } + + // Print the notice with the dismiss link + echo ''; + } + } else { + + // Standard notice + echo '

    ' . $notice['msg'] . '.

    '; + } + } + + // Clear the admin notice array + self::$_parent->admin_notices = array(); + } + } + + /** + * dismissAdminNotice - Updates user meta to store dismiss notice preference + * + * @since 3.2.0 + * @access public + * @return void + */ + public static function dismissAdminNotice() { + global $current_user; + + // Verify the dismiss and id parameters are present. + if ( isset( $_GET['dismiss'] ) && isset( $_GET['id'] ) ) { + if ( 'true' == $_GET['dismiss'] || 'false' == $_GET['dismiss'] ) { + + // Get the user id + $userid = $current_user->ID; + + // Get the notice id + $id = $_GET['id']; + $val = $_GET['dismiss']; + + // Add the dismiss request to the user meta. + update_user_meta( $userid, 'ignore_' . $id, $val ); + } + } + } + } +} \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/inc/class.redux_helpers.php b/plugins/legacy-admin/framework/core/inc/class.redux_helpers.php new file mode 100644 index 000000000..1786f3f9b --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/class.redux_helpers.php @@ -0,0 +1,661 @@ +sections as $k => $section ) { + if ( ! isset( $section['title'] ) ) { + continue; + } + + if ( isset( $section['fields'] ) && ! empty( $section['fields'] ) ) { + if ( Redux_Helpers::recursive_array_search( $field, $section['fields'] ) ) { + return $k; + continue; + } + } + } + } + + public static function isFieldInUseByType( $fields, $field = array() ) { + foreach ( $field as $name ) { + if ( array_key_exists( $name, $fields ) ) { + return true; + } + } + + return false; + } + + public static function isFieldInUse( $parent, $field ) { + foreach ( $parent->sections as $k => $section ) { + if ( ! isset( $section['title'] ) ) { + continue; + } + + if ( isset( $section['fields'] ) && ! empty( $section['fields'] ) ) { + if ( Redux_Helpers::recursive_array_search( $field, $section['fields'] ) ) { + return true; + continue; + } + } + } + } + + public static function major_version( $v ) { + $version = explode( '.', $v ); + if ( count( $version ) > 1 ) { + return $version[0] . '.' . $version[1]; + } else { + return $v; + } + } + + public static function isLocalHost(){ + return ($_SERVER['REMOTE_ADDR'] === '127.0.0.1' || $_SERVER['REMOTE_ADDR'] === 'localhost' ) ? 1 : 0; + } + + public static function getTrackingObject() { + $hash = md5( network_site_url() . '-' . $_SERVER['REMOTE_ADDR'] ); + + global $blog_id, $wpdb; + $pts = array(); + + foreach ( get_post_types( array( 'public' => true ) ) as $pt ) { + $count = wp_count_posts( $pt ); + $pts[ $pt ] = $count->publish; + } + + $comments_count = wp_count_comments(); + $theme_data = wp_get_theme(); + $theme = array( + 'version' => $theme_data->Version, + 'name' => $theme_data->Name, + 'author' => $theme_data->Author, + 'template' => $theme_data->Template, + ); + + if ( ! function_exists( 'get_plugin_data' ) ) { + require_once( ABSPATH . 'wp-admin/includes/admin.php' ); + } + + $plugins = array(); + foreach ( get_option( 'active_plugins', array() ) as $plugin_path ) { + $plugin_info = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin_path ); + + $slug = str_replace( '/' . basename( $plugin_path ), '', $plugin_path ); + $plugins[ $slug ] = array( + 'version' => $plugin_info['Version'], + 'name' => $plugin_info['Name'], + 'plugin_uri' => $plugin_info['PluginURI'], + 'author' => $plugin_info['AuthorName'], + 'author_uri' => $plugin_info['AuthorURI'], + ); + } + if ( is_multisite() ) { + foreach ( get_option( 'active_sitewide_plugins', array() ) as $plugin_path ) { + $plugin_info = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin_path ); + $slug = str_replace( '/' . basename( $plugin_path ), '', $plugin_path ); + $plugins[ $slug ] = array( + 'version' => $plugin_info['Version'], + 'name' => $plugin_info['Name'], + 'plugin_uri' => $plugin_info['PluginURI'], + 'author' => $plugin_info['AuthorName'], + 'author_uri' => $plugin_info['AuthorURI'], + ); + } + } + + + $version = explode( '.', PHP_VERSION ); + $version = array( + 'major' => $version[0], + 'minor' => $version[0] . '.' . $version[1], + 'release' => PHP_VERSION + ); + + $user_query = new WP_User_Query( array( 'blog_id' => $blog_id, 'count_total' => true, ) ); + $comments_query = new WP_Comment_Query(); + + $data = array( + '_id' => $hash, + 'localhost' => ( $_SERVER['REMOTE_ADDR'] === '127.0.0.1' ) ? 1 : 0, + 'php' => $version, + 'site' => array( + 'hash' => $hash, + 'version' => get_bloginfo( 'version' ), + 'multisite' => is_multisite(), + 'users' => $user_query->get_total(), + 'lang' => get_locale(), + 'wp_debug' => ( defined( 'WP_DEBUG' ) ? WP_DEBUG ? true : false : false ), + 'memory' => WP_MEMORY_LIMIT, + ), + 'pts' => $pts, + 'comments' => array( + 'total' => $comments_count->total_comments, + 'approved' => $comments_count->approved, + 'spam' => $comments_count->spam, + 'pings' => $comments_query->query( array( 'count' => true, 'type' => 'pingback' ) ), + ), + 'options' => apply_filters( 'redux/tracking/options', array() ), + 'theme' => $theme, + 'redux' => array( + 'mode' => ReduxFramework::$_is_plugin ? 'plugin' : 'theme', + 'version' => ReduxFramework::$_version, + 'demo_mode' => get_option( 'ReduxFrameworkPlugin' ), + ), + 'developer' => apply_filters( 'redux/tracking/developer', array() ), + 'plugins' => $plugins, + ); + + $parts = explode( ' ', $_SERVER['SERVER_SOFTWARE'] ); + $software = array(); + foreach ( $parts as $part ) { + if ( $part[0] == "(" ) { + continue; + } + if ( strpos( $part, '/' ) !== false ) { + $chunk = explode( "/", $part ); + $software[ strtolower( $chunk[0] ) ] = $chunk[1]; + } + } + $software['full'] = $_SERVER['SERVER_SOFTWARE']; + $data['environment'] = $software; + if ( function_exists( 'mysqli_get_server_info' ) ) { + $link = mysqli_connect() or die( "Error " . mysqli_error( $link ) ); + $data['environment']['mysql'] = mysqli_get_server_info( $link ); + } else if ( class_exists( 'PDO' ) && method_exists( 'PDO', 'getAttribute' ) ) { + $data['environment']['mysql'] = PDO::getAttribute( PDO::ATTR_SERVER_VERSION ); + } else { + $data['environment']['mysql'] = mysql_get_server_info(); + } + if ( empty( $data['developer'] ) ) { + unset( $data['developer'] ); + } + + return $data; + } + + public static function trackingObject() { + + $data = wp_remote_post( + 'http://verify.redux.io', + array( + 'body' => array( + 'hash' => $_GET['action'], + 'site' => esc_url( home_url( '/' ) ), + ) + ) + ); + + $data['body'] = urldecode( $data['body'] ); + + if ( ! isset( $_GET['code'] ) || $data['body'] != $_GET['code'] ) { + die(); + } + + return Redux_Helpers::getTrackingObject(); + } + + public static function isParentTheme( $file ) { + $file = self::cleanFilePath( $file ); + $dir = self::cleanFilePath( get_template_directory() ); + + $file = str_replace( '//', '/', $file ); + $dir = str_replace( '//', '/', $dir ); + + if ( strpos( $file, $dir ) !== false ) { + return true; + } + + return false; + } + + public static function isChildTheme( $file ) { + $file = self::cleanFilePath( $file ); + $dir = self::cleanFilePath( get_stylesheet_directory() ); + + $file = str_replace( '//', '/', $file ); + $dir = str_replace( '//', '/', $dir ); + + if ( strpos( $file, $dir ) !== false ) { + return true; + } + + return false; + } + + private static function reduxAsPlugin() { + return ReduxFramework::$_as_plugin; + } + + public static function isTheme( $file ) { + + if ( true == self::isChildTheme( $file ) || true == self::isParentTheme( $file ) ) { + return true; + } + + return false; + } + + public static function array_in_array( $needle, $haystack ) { + //Make sure $needle is an array for foreach + if ( ! is_array( $needle ) ) { + $needle = array( $needle ); + } + //For each value in $needle, return TRUE if in $haystack + foreach ( $needle as $pin ) //echo 'needle' . $pin; + { + if ( in_array( $pin, $haystack ) ) { + return true; + } + } + + //Return FALSE if none of the values from $needle are found in $haystack + return false; + } + + public static function recursive_array_search( $needle, $haystack ) { + foreach ( $haystack as $key => $value ) { + if ( $needle === $value || ( is_array( $value ) && self::recursive_array_search( $needle, $value ) !== false ) ) { + return true; + } + } + + return false; + } + + /** + * Take a path and return it clean + * + * @param string $path + * + * @since 3.1.7 + */ + public static function cleanFilePath( $path ) { + $path = str_replace( '', '', str_replace( array( "\\", "\\\\" ), '/', $path ) ); + + if ( $path[ strlen( $path ) - 1 ] === '/' ) { + $path = rtrim( $path, '/' ); + } + + return $path; + } + + /** + * Take a path and delete it + * + * @param string $path + * + * @since 3.3.3 + */ + public static function rmdir( $dir ) { + if ( is_dir( $dir ) ) { + $objects = scandir( $dir ); + foreach ( $objects as $object ) { + if ( $object != "." && $object != ".." ) { + if ( filetype( $dir . "/" . $object ) == "dir" ) { + rrmdir( $dir . "/" . $object ); + } else { + unlink( $dir . "/" . $object ); + } + } + } + reset( $objects ); + rmdir( $dir ); + } + } + + /** + * Field Render Function. + * Takes the color hex value and converts to a rgba. + * + * @since ReduxFramework 3.0.4 + */ + public static function hex2rgba( $hex, $alpha = '' ) { + $hex = str_replace( "#", "", $hex ); + if ( strlen( $hex ) == 3 ) { + $r = hexdec( substr( $hex, 0, 1 ) . substr( $hex, 0, 1 ) ); + $g = hexdec( substr( $hex, 1, 1 ) . substr( $hex, 1, 1 ) ); + $b = hexdec( substr( $hex, 2, 1 ) . substr( $hex, 2, 1 ) ); + } else { + $r = hexdec( substr( $hex, 0, 2 ) ); + $g = hexdec( substr( $hex, 2, 2 ) ); + $b = hexdec( substr( $hex, 4, 2 ) ); + } + $rgb = $r . ',' . $g . ',' . $b; + + if ( '' == $alpha ) { + return $rgb; + } else { + $alpha = floatval( $alpha ); + + return 'rgba(' . $rgb . ',' . $alpha . ')'; + } + } + + public static function makeBoolStr( $var ) { + if ( $var == false || $var == 'false' || $var == 0 || $var == '0' || $var == '' || empty( $var ) ) { + return 'false'; + } else { + return 'true'; + } + } + + public static function compileSystemStatus( $json_output = false, $remote_checks = false ) { + global $wpdb; + + $sysinfo = array(); + + $sysinfo['home_url'] = home_url(); + $sysinfo['site_url'] = site_url(); + $sysinfo['redux_ver'] = esc_html( ReduxFramework::$_version ); + $sysinfo['redux_data_dir'] = ReduxFramework::$_upload_dir; + $sysinfo['redux_data_writeable'] = self::makeBoolStr( @fopen( ReduxFramework::$_upload_dir . 'test-log.log', 'a' ) ); + $sysinfo['wp_ver'] = get_bloginfo( 'version' ); + $sysinfo['wp_multisite'] = is_multisite(); + $sysinfo['permalink_structure'] = get_option( 'permalink_structure' ) ? get_option( 'permalink_structure' ) : 'Default'; + $sysinfo['front_page_display'] = get_option( 'show_on_front' ); + if ( $sysinfo['front_page_display'] == 'page' ) { + $front_page_id = get_option( 'page_on_front' ); + $blog_page_id = get_option( 'page_for_posts' ); + + $sysinfo['front_page'] = $front_page_id != 0 ? get_the_title( $front_page_id ) . ' (#' . $front_page_id . ')' : 'Unset'; + $sysinfo['posts_page'] = $blog_page_id != 0 ? get_the_title( $blog_page_id ) . ' (#' . $blog_page_id . ')' : 'Unset'; + } + + $sysinfo['wp_mem_limit']['raw'] = self::let_to_num( WP_MEMORY_LIMIT ); + $sysinfo['wp_mem_limit']['size'] = size_format( $sysinfo['wp_mem_limit']['raw'] ); + + $sysinfo['db_table_prefix'] = 'Length: ' . strlen( $wpdb->prefix ) . ' - Status: ' . ( strlen( $wpdb->prefix ) > 16 ? 'ERROR: Too long' : 'Acceptable' ); + + $sysinfo['wp_debug'] = 'false'; + if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { + $sysinfo['wp_debug'] = 'true'; + } + + $sysinfo['wp_lang'] = get_locale(); + + if ( ! class_exists( 'Browser' ) ) { + require_once ReduxFramework::$_dir . 'inc/browser.php'; + } + + $browser = new Browser(); + + $sysinfo['browser'] = array( + 'agent' => $browser->getUserAgent(), + 'browser' => $browser->getBrowser(), + 'version' => $browser->getVersion(), + 'platform' => $browser->getPlatform(), + //'mobile' => $browser->isMobile() ? 'true' : 'false', + ); + + $sysinfo['server_info'] = esc_html( $_SERVER['SERVER_SOFTWARE'] ); + $sysinfo['localhost'] = self::makeBoolStr( self::isLocalHost()); + $sysinfo['php_ver'] = function_exists( 'phpversion' ) ? esc_html( phpversion() ) : 'phpversion() function does not exist.'; + + if ( function_exists( 'ini_get' ) ) { + $sysinfo['php_mem_limit'] = size_format( self::let_to_num( ini_get( 'memory_limit' ) ) ); + $sysinfo['php_post_max_size'] = size_format( self::let_to_num( ini_get( 'post_max_size' ) ) ); + $sysinfo['php_time_limit'] = ini_get( 'max_execution_time' ); + $sysinfo['php_max_input_var'] = ini_get( 'max_input_vars' ); + $sysinfo['php_display_errors'] = self::makeBoolStr( ini_get( 'display_errors' ) ); + } + + $sysinfo['suhosin_installed'] = extension_loaded( 'suhosin' ); + $sysinfo['mysql_ver'] = $wpdb->db_version(); + $sysinfo['max_upload_size'] = size_format( wp_max_upload_size() ); + + $sysinfo['def_tz_is_utc'] = 'true'; + if ( date_default_timezone_get() !== 'UTC' ) { + $sysinfo['def_tz_is_utc'] = 'false'; + } + + $sysinfo['fsockopen_curl'] = 'false'; + if ( function_exists( 'fsockopen' ) || function_exists( 'curl_init' ) ) { + $sysinfo['fsockopen_curl'] = 'true'; + } + + //$sysinfo['soap_client'] = 'false'; + //if ( class_exists( 'SoapClient' ) ) { + // $sysinfo['soap_client'] = 'true'; + //} + // + //$sysinfo['dom_document'] = 'false'; + //if ( class_exists( 'DOMDocument' ) ) { + // $sysinfo['dom_document'] = 'true'; + //} + + //$sysinfo['gzip'] = 'false'; + //if ( is_callable( 'gzopen' ) ) { + // $sysinfo['gzip'] = 'true'; + //} + + if ( $remote_checks == true ) { + $response = wp_remote_post( 'https://www.paypal.com/cgi-bin/webscr', array( + 'sslverify' => false, + 'timeout' => 60, + 'user-agent' => 'ReduxFramework/' . ReduxFramework::$_version, + 'body' => array( + 'cmd' => '_notify-validate' + ) + ) ); + + if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) { + $sysinfo['wp_remote_post'] = 'true'; + $sysinfo['wp_remote_post_error'] = ''; + } else { + $sysinfo['wp_remote_post'] = 'false'; + $sysinfo['wp_remote_post_error'] = $response->get_error_message(); + } + + $response = wp_remote_get( 'http://reduxframework.com/wp-admin/admin-ajax.php?action=get_redux_extensions' ); + + if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) { + $sysinfo['wp_remote_get'] = 'true'; + $sysinfo['wp_remote_get_error'] = ''; + } else { + $sysinfo['wp_remote_get'] = 'false'; + $sysinfo['wp_remote_get_error'] = $response->get_error_message(); + } + } + + $active_plugins = (array) get_option( 'active_plugins', array() ); + + if ( is_multisite() ) { + $active_plugins = array_merge( $active_plugins, get_site_option( 'active_sitewide_plugins', array() ) ); + } + + $sysinfo['plugins'] = array(); + + foreach ( $active_plugins as $plugin ) { + $plugin_data = @get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin ); + $plugin_name = esc_html( $plugin_data['Name'] ); + + $sysinfo['plugins'][ $plugin_name ] = $plugin_data; + } + + $redux = ReduxFrameworkInstances::get_all_instances(); + + $sysinfo['redux_instances'] = array(); + + if ( ! empty( $redux ) && is_array( $redux ) ) { + foreach ( $redux as $inst => $data ) { + Redux::init( $inst ); + + $sysinfo['redux_instances'][ $inst ]['args'] = $data->args; + $sysinfo['redux_instances'][ $inst ]['sections'] = $data->sections; + foreach ( $sysinfo['redux_instances'][ $inst ]['sections'] as $sKey => $section ) { + if ( isset( $section['fields'] ) && is_array( $section['fields'] ) ) { + foreach ( $section['fields'] as $fKey => $field ) { + if ( isset( $field['validate_callback'] ) ) { + unset( $sysinfo['redux_instances'][ $inst ]['sections'][ $sKey ]['fields'][ $fKey ]['validate_callback'] ); + } + if ( $field['type'] == "js_button" ) { + if ( isset( $field['script'] ) && isset( $field['script']['ver'] ) ) { + unset( $sysinfo['redux_instances'][ $inst ]['sections'][ $sKey ]['fields'][ $fKey ]['script']['ver'] ); + } + } + + } + } + } + $sysinfo['redux_instances'][ $inst ]['extensions'] = Redux::getExtensions( $inst ); + + if ( isset( $data->args['templates_path'] ) && $data->args['templates_path'] != '' ) { + $sysinfo['redux_instances'][ $inst ]['templates'] = self::getReduxTemplates( $data->args['templates_path'] ); + } + } + } + + $active_theme = wp_get_theme(); + + $sysinfo['theme']['name'] = $active_theme->Name; + $sysinfo['theme']['version'] = $active_theme->Version; + $sysinfo['theme']['author_uri'] = $active_theme->{'Author URI'}; + $sysinfo['theme']['is_child'] = self::makeBoolStr( is_child_theme() ); + + if ( is_child_theme() ) { + $parent_theme = wp_get_theme( $active_theme->Template ); + + $sysinfo['theme']['parent_name'] = $parent_theme->Name; + $sysinfo['theme']['parent_version'] = $parent_theme->Version; + $sysinfo['theme']['parent_author_uri'] = $parent_theme->{'Author URI'}; + } + + //if ( $json_output ) { + // $sysinfo = json_encode( $sysinfo ); + //} + + //print_r($sysinfo); + //exit(); + + return $sysinfo; + } + + private static function getReduxTemplates( $custom_template_path ) { + $template_paths = array( 'ReduxFramework' => ReduxFramework::$_dir . 'templates/panel' ); + $scanned_files = array(); + $found_files = array(); + $outdated_templates = false; + + foreach ( $template_paths as $plugin_name => $template_path ) { + $scanned_files[ $plugin_name ] = self::scan_template_files( $template_path ); + } + + foreach ( $scanned_files as $plugin_name => $files ) { + foreach ( $files as $file ) { + if ( file_exists( $custom_template_path . '/' . $file ) ) { + $theme_file = $custom_template_path . '/' . $file; + } else { + $theme_file = false; + } + + if ( $theme_file ) { + $core_version = self::get_template_version( ReduxFramework::$_dir . 'templates/panel/' . $file ); + $theme_version = self::get_template_version( $theme_file ); + + if ( $core_version && ( empty( $theme_version ) || version_compare( $theme_version, $core_version, '<' ) ) ) { + if ( ! $outdated_templates ) { + $outdated_templates = true; + } + + $found_files[ $plugin_name ][] = sprintf( __( '%s version %s is out of date. The core version is %s', 'legacy_framework' ), str_replace( WP_CONTENT_DIR . '/themes/', '', $theme_file ), $theme_version ? $theme_version : '-', $core_version ); + } else { + $found_files[ $plugin_name ][] = sprintf( '%s', str_replace( WP_CONTENT_DIR . '/themes/', '', $theme_file ) ); + } + } + } + } + + return $found_files; + } + + private static function scan_template_files( $template_path ) { + $files = scandir( $template_path ); + $result = array(); + + if ( $files ) { + foreach ( $files as $key => $value ) { + if ( ! in_array( $value, array( ".", ".." ) ) ) { + if ( is_dir( $template_path . DIRECTORY_SEPARATOR . $value ) ) { + $sub_files = redux_scan_template_files( $template_path . DIRECTORY_SEPARATOR . $value ); + foreach ( $sub_files as $sub_file ) { + $result[] = $value . DIRECTORY_SEPARATOR . $sub_file; + } + } else { + $result[] = $value; + } + } + } + } + + return $result; + } + + private static function get_template_version( $file ) { + + // Avoid notices if file does not exist + if ( ! file_exists( $file ) ) { + return ''; + } + + // We don't need to write to the file, so just open for reading. + $fp = fopen( $file, 'r' ); + + // Pull only the first 8kiB of the file in. + $file_data = fread( $fp, 8192 ); + + // PHP will close file handle, but we are good citizens. + fclose( $fp ); + + // Make sure we catch CR-only line endings. + $file_data = str_replace( "\r", "\n", $file_data ); + $version = ''; + + if ( preg_match( '/^[ \t\/*#@]*' . preg_quote( '@version', '/' ) . '(.*)$/mi', $file_data, $match ) && $match[1] ) { + $version = _cleanup_header_comment( $match[1] ); + } + + return $version; + } + + private static function let_to_num( $size ) { + $l = substr( $size, - 1 ); + $ret = substr( $size, 0, - 1 ); + + switch ( strtoupper( $l ) ) { + case 'P': + $ret *= 1024; + case 'T': + $ret *= 1024; + case 'G': + $ret *= 1024; + case 'M': + $ret *= 1024; + case 'K': + $ret *= 1024; + } + + return $ret; + } + + } + } + + + diff --git a/plugins/legacy-admin/framework/core/inc/class.redux_instances.php b/plugins/legacy-admin/framework/core/inc/class.redux_instances.php new file mode 100644 index 000000000..18c15dfab --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/class.redux_instances.php @@ -0,0 +1,164 @@ +options = get_option( 'legacy_framework-tracking' ); + $this->options['dev_mode'] = false; + + if ( ! isset( $this->options['hash'] ) || ! $this->options['hash'] || empty( $this->options['hash'] ) ) { + $this->options['hash'] = md5( network_site_url() . '-' . $_SERVER['REMOTE_ADDR'] ); + update_option( 'legacy_framework-tracking', $this->options ); + } + + if ( isset( $_GET['redux_framework_disable_tracking'] ) && ! empty( $_GET['redux_framework_disable_tracking'] ) ) { + $this->options['allow_tracking'] = false; + update_option( 'legacy_framework-tracking', $this->options ); + } + + if ( isset( $_GET['redux_framework_enable_tracking'] ) && ! empty( $_GET['redux_framework_enable_tracking'] ) ) { + $this->options['allow_tracking'] = true; + update_option( 'legacy_framework-tracking', $this->options ); + } + + header( "Expires: Mon, 26 Jul 1997 05:00:00 GMT" ); + header( "Last-Modified: " . gmdate( "D, d M Y H:i:s" ) . "GMT" ); + header( 'Expires: Sat, 26 Jul 1997 05:00:00 GMT' ); + header( 'Cache-Control: no-store, no-cache, must-revalidate' ); + header( 'Cache-Control: post-check=0, pre-check=0', false ); + header( 'Pragma: no-cache' ); + $instances = ReduxFrameworkInstances::get_all_instances(); + + if ( isset( $_REQUEST['i'] ) && ! empty( $_REQUEST['i'] ) ) { + if ( is_array( $instances ) && ! empty( $instances ) ) { + foreach ( $instances as $opt_name => $data ) { + if ( md5( $opt_name . '-debug' ) == $_REQUEST['i'] ) { + $array = $instances[ $opt_name ]; + } + if ($data->args['dev_mode']) { + $this->options['dev_mode'] = $data->args['dev_mode']; + } + } + } + if ( isset( $array ) ) { + if ( isset( $array->extensions ) && is_array( $array->extensions ) && ! empty( $array->extensions ) ) { + foreach ( $array->extensions as $key => $extension ) { + if ( isset( $extension->$version ) ) { + $array->extensions[ $key ] = $extension->$version; + } else { + $array->extensions[ $key ] = true; + } + } + } + if ( isset( $array->import_export ) ) { + unset( $array->import_export ); + } + if ( isset( $array->debug ) ) { + unset( $array->debug ); + } + } else { + die(); + } + + } else { + $array = Redux_Helpers::trackingObject(); + if ( is_array( $instances ) && ! empty( $instances ) ) { + $array['instances'] = array(); + foreach ( $instances as $opt_name => $data ) { + $array['instances'][] = $opt_name; + } + } + $array['key'] = md5( AUTH_KEY . SECURE_AUTH_KEY ); + } + + echo @json_encode( $array, true ); + die(); + } + + function capture( $ReduxFramework ) { + $this->store( $ReduxFramework ); + } + + private function store( $ReduxFramework ) { + if ( $ReduxFramework instanceof ReduxFramework ) { + $key = $ReduxFramework->args['opt_name']; + self::$instances[ $key ] = $ReduxFramework; + } + } + } diff --git a/plugins/legacy-admin/framework/core/inc/class.redux_sass.php b/plugins/legacy-admin/framework/core/inc/class.redux_sass.php new file mode 100644 index 000000000..75412f56f --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/class.redux_sass.php @@ -0,0 +1,255 @@ +args['sass']['enabled'] && !$parent->args['sass']['page_output']) { + $ids = ''; + + foreach($parent->options as $id => $opts) { + $ids .= $id . '|'; + } + + $ids = rtrim($ids,'|'); + + return $ids; + } + } + + public static function get_id_matrix(){ + if (!file_exists(self::$matrix_file)) { + $ids = get_option(self::$matrix_key); + } else { + $ids = file_get_contents(self::$matrix_file); + } + + return $ids; + } + + public static function set_id_matrix($ids) { + $ret = @file_put_contents(self::$matrix_file, $ids); + + if ($ret == false) { + return update_option(self::$matrix_key, $ids); + } + } + + public static function add_path ($path) { + if (!in_array($path, self::$path)) { + array_push(self::$path, $path); + } + } + + public static function add_import($import) { + if (!in_array($import, self::$import)) { + array_push (self::$import, $import); + } + } + + public static function is_scss_newer($dir, $filename){ + $css_time = filemtime($dir . '/' . $filename . '.css'); + $scss_time = filemtime($dir . '/' . $filename . '.scss'); + + if ($scss_time > $css_time) { + echo 'css: ' . $css_time . '
    '; + echo 'scss: ' . $scss_time . '
    '; + + return true; + } + + return false; + } + + public static function compile_sass($parent) { + if (!empty(self::$path)) { + + $do_compile = false; + $as_output = false; + + if (!self::is_sass_dir ( ReduxFramework::$_upload_dir . 'sass' )){ + $as_output = true; + } + + if ($parent->args['sass']['page_output']) { + $as_output = true; + } + + $mb = $parent->extensions['metaboxes']; + if (!empty($mb->boxes)) { + $as_output = true; + } + + $opt_name = $parent->args['opt_name']; + + self::$matrix_file = ReduxFramework::$_upload_dir . 'sass/' . $opt_name . '-id-matrix'; + self::$matrix_key = 'redux-sass-' . $opt_name . '-id-matrix'; + + if (!$as_output) { + $current_ids = self::get_current_id_matrix($parent); + $saved_ids = self::get_id_matrix(); + + if ($saved_ids == '' || empty($saved_ids)) { + $ret = self::set_id_matrix($current_ids); + $do_compile = true; + } else { + if ($current_ids != $saved_ids) { + logconsole('not the same'); + self::set_id_matrix($current_ids); + $do_compile = true; + } else { + logconsole('the same'); + } + } + } else { + $do_compile = true; + } + + if ($do_compile || self::$_do_compile) { + logconsole('compiler run'); + if ( !class_exists( 'scssc' ) && !isset( $GLOBALS['redux_scss_compiler'] ) ) { + $GLOBALS['redux_scss_compiler'] = true; + require( "scssphp/scss.inc.php" ); + } + + $scss = new scssc(); + + $scss->setImportPaths( self::$path ); + + if (!$parent->args['dev_mode']) { + $scss->setFormatter ( "scss_formatter_compressed" ); + } + + $new_css = ''; + + foreach (self::$import as $import) { + $new_css .= $scss->compile( $import ); + } + + unset ($scss); + + if ($new_css != '') { + if ($as_output) { + self::css_to_page($opt_name, $new_css); + return self::SASS_PAGE_OUTPUT; + } else { + $css_file = Redux_Helpers::cleanFilePath( ReduxFramework::$_upload_dir . $parent->args['opt_name'] . '-redux.css'); + + $ret = @file_put_contents($css_file, $new_css); + + if ($ret == false) { + self::css_to_page($opt_name, $new_css); + return self::SASS_PAGE_OUTPUT; + } + + return self::SASS_FILE_COMPILE; + } + } + } // do_compile + } + + return self::SASS_NO_COMPILE; + } + + private static function css_to_page($opt_name, $css) { + echo ''; + } + + public static function compile_single_field($parent, $scss_path, $filename) { + echo 'single field compile: ' . $scss_path . ' ' . $filename; + + if ( !class_exists( 'scssc' ) && !isset( $GLOBALS['redux_scss_compiler'] ) ) { + $GLOBALS['redux_scss_compiler'] = true; + require( "scssphp/scss.inc.php" ); + } + + $scss = new scssc(); + + $scss->setImportPaths( $scss_path ); + + if (!$parent->args['dev_mode']) { + $scss->setFormatter ( "scss_formatter_compressed" ); + } + + $new_css = $scss->compile( '@import "' . $filename . '.scss"' ); + + unset ($scss); + + $ret = @file_put_contents($scss_path . '/' . $filename . '.css', $new_css); + } + } +} + +if (!function_exists ( 'redux_enqueue_style')) { + /** + * Enqueues style for SASS comnpile or WP enqueue, depending on 'use_sass' arg. + * + * @since 3.3.9 + * @access public + * @param string $handle Name of the stylesheet. + * @param string $css_src Path to the stylesheet from the root directory of WordPress. Example: '/css/mystyle.css'. + * @param string $scss_dir Directory path to SCSS file. + * @param array $deps An array of registered style handles this stylesheet depends on. Default empty array. + * @param string $ver String specifying the stylesheet version number, if it has one. This parameter is used to ensure that the correct version is sent to the client regardless of caching, and so should be included if a version number is available and makes sense for the stylesheet. + * @param string $media Optional. The media for which this stylesheet has been defined. Default 'all'. Accepts 'all', 'aural', 'braille', 'handheld', 'projection', 'print', 'screen', 'tty', or 'tv'. + * @return void + */ + function redux_enqueue_style ($parent, $handle, $css_src, $scss_dir, $deps = array(), $ver = '', $media = false){ + if ($parent->args['sass']['enabled']) { + //if ($parent->args['dev_mode'] || $parent->args['sass']['page_output']) { + $path_parts = pathinfo($css_src); + + $filename = $path_parts['filename']; +//echo $filename . '
    '; + $scss_dir = Redux_Helpers::cleanFilePath($scss_dir); + $scss_dir = untrailingslashit($scss_dir); + + $is_diff = reduxSassCompiler::is_scss_newer($scss_dir, $filename); + + if ($is_diff) { + reduxSassCompiler::compile_single_field($parent, $scss_dir, $filename); + reduxSassCompiler::$_do_compile = true; + } + + reduxSassCompiler::add_path($scss_dir); + reduxSassCompiler::add_import('@import "' . $filename . '.scss"'); + //} + } else { + wp_enqueue_style( + $handle, + $css_src, + $deps, + $ver, + $media + ); + } + } +} \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/inc/class.redux_themecheck.php b/plugins/legacy-admin/framework/core/inc/class.redux_themecheck.php new file mode 100644 index 000000000..89fe3bb4d --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/class.redux_themecheck.php @@ -0,0 +1,123 @@ +load(); + } + } + + public function load() { + + $redux = new ReduxFramework(); + $redux->init(); + + + + //if ( ! empty( $redux ) ) { + + + $dir = ReduxFramework::$_dir . '../'; + + if ( isset( $_POST['themename'] ) && ! empty( $_POST['themename'] ) ) { + if ( strpos( $dir, $_POST['themename'] ) !== false ) { + ?> +
    +

    Redux Framework', '', '' ); + ?> +

    +
    +

    Redux directory. They may cause errors in Theme-Check.', 'legacy_framework' ); + echo '

      '; + foreach ( $errors as $error ) { + echo '
    • ~/' . $error . '
    • '; + } + ?> +
    . + * + * @package ReduxFramework + * @subpackage debug object + * @author Dovy Paukstys + * @author Kevin Provance (kprovance) + * @version 3.1.8 + */ + +// Exit if accessed directly + if ( ! defined( 'ABSPATH' ) ) { + exit; + } + + if ( ! class_exists( 'ReduxDebugObject' ) ) { + + /** + * Main ReduxFramework_import_export class + * + * @since 1.0.0 + */ + class ReduxDebugObject { + public function __construct( $parent ) { + $this->parent = $parent; + } + + public function render() { + echo '
    '; + echo '

    ' . __( 'Options Object', 'legacy_framework' ) . '

    '; + echo '
    '; + echo '
    '; + echo '
    '; + + if ( version_compare( phpversion(), "5.3.0", ">=" ) ) { + $json = json_encode( $this->parent->options, true ); + } else { + $json = json_encode( $this->parent->options ); + } + + echo '
    ' . $json . '
    '; + + echo '' . __( 'Show Object in Javascript Console Object', 'legacy_framework' ) . ''; + + echo '
    '; + } + + public function render_tab() { + echo ''; + } + + public function add_submenu() { + add_submenu_page( + $this->parent->args['page_slug'], + __( 'Options Object', 'legacy_framework' ), + __( 'Options Object', 'legacy_framework' ), + $this->parent->args['page_permissions'], + $this->parent->args['page_slug'] . '&tab=dev_mode_default', + '__return_null' + ); + } + } + } diff --git a/plugins/legacy-admin/framework/core/inc/extensions/README.txt b/plugins/legacy-admin/framework/core/inc/extensions/README.txt new file mode 100644 index 000000000..ea1d54cf6 --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/extensions/README.txt @@ -0,0 +1 @@ +This directory is a placeholder for Redux Framework extensions. diff --git a/plugins/legacy-admin/framework/core/inc/extensions/customizer/extension_customizer.php b/plugins/legacy-admin/framework/core/inc/extensions/customizer/extension_customizer.php new file mode 100644 index 000000000..8541f504a --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/extensions/customizer/extension_customizer.php @@ -0,0 +1,683 @@ +. + * + * @package ReduxFramework + * @author Dovy Paukstys (dovy) + * @version 3.0.0 + */ + +// Exit if accessed directly + if ( ! defined( 'ABSPATH' ) ) { + exit; + } + +// Don't duplicate me! + if ( ! class_exists( 'ReduxFramework_extension_customizer' ) ) { + + /** + * Main ReduxFramework customizer extension class + * + * @since 1.0.0 + */ + class ReduxFramework_extension_customizer { + + // Protected vars + protected $redux; + private $_extension_url; + private $_extension_dir; + private $parent; + private $orig_options = array(); + private static $post_values = array(); + public static $version = "2.0"; + + /** + * Class Constructor. Defines the args for the extions class + * + * @since 1.0.0 + * @access public + * + * @param array $sections Panel sections. + * @param array $args Class constructor arguments. + * @param array $extra_tabs Extra panel tabs. + * + * @return void + */ + public function __construct( $parent ) { + //add_action('wp_head', array( $this, '_enqueue_new' )); + + global $pagenow, $wp_customize; + if ( ! isset( $wp_customize ) && $pagenow !== "customize.php" && $pagenow !== "admin-ajax.php" ) { + return; + } + if ( ( $pagenow !== "customize.php" && $pagenow !== "admin-ajax.php" && ! isset( $GLOBALS['wp_customize'] ) ) ) { + //return; + } + + $this->parent = $parent; + + if ( empty( $this->_extension_dir ) ) { + $this->_extension_dir = trailingslashit( str_replace( '\\', '/', dirname( __FILE__ ) ) ); + $this->_extension_url = site_url( str_replace( trailingslashit( str_replace( '\\', '/', ABSPATH ) ), '', $this->_extension_dir ) ); + } + + self::get_post_values(); + + + // Create defaults array + $defaults = array(); + /* + customize_controls_init + customize_controls_enqueue_scripts + customize_controls_print_styles + customize_controls_print_scripts + customize_controls_print_footer_scripts + */ + + + if ( ! ( isset( $_POST['action'] ) || ( isset( $_POST['action'] ) && $_POST['action'] != "customize_save" ) ) ) { + + add_action( "redux/options/{$this->parent->args['opt_name']}/options", array( + $this, + '_override_values' + ), 100 ); + + //if ( ! isset( $_POST['customized'] ) || $pagenow == "admin-ajax.php" ) { + if ( current_user_can( $this->parent->args['page_permissions'] ) ) { + add_action( 'customize_register', array( + $this, + '_register_customizer_controls' + ) ); // Create controls + } + //} + + + add_action( 'wp_head', array( $this, 'customize_preview_init' ) ); + } + + + //add_action( 'customize_save', array( $this, 'customizer_save_before' ) ); // Before save + add_action( 'customize_save_after', array( &$this, 'customizer_save_after' ) ); // After save + + + //add_action( 'wp_enqueue_scripts', array( &$this, '_enqueue_previewer_css' ) ); // Enqueue previewer css + //add_action( 'wp_enqueue_scripts', array( &$this, '_enqueue_previewer_js' ) ); // Enqueue previewer javascript + //add_action( "wp_footer", array( $this, '_enqueue_new' ), 100 ); + //$this->_enqueue_new(); + } + + function customize_preview_init() { + do_action( 'redux/customizer/live_preview' ); + } + + protected static function get_post_values() { + if ( empty( self::$post_values ) && isset( $_POST['customized'] ) && ! empty( $_POST['customized'] ) ) { + self::$post_values = json_decode( stripslashes_deep( $_POST['customized'] ), true ); + } + } + + public function _override_values( $data ) { + + self::get_post_values(); + + if ( isset( $_POST['customized'] ) && ! empty( self::$post_values ) ) { + + if ( is_array( self::$post_values ) ) { + foreach ( self::$post_values as $key => $value ) { + if ( strpos( $key, $this->parent->args['opt_name'] ) !== false ) { + $key = str_replace( $this->parent->args['opt_name'] . '[', '', rtrim( $key, "]" ) ); + $data[ $key ] = $value; + $GLOBALS[ $this->parent->args['global_variable'] ][ $key ] = $value; + $this->parent->options[ $key ] = $value; + } + } + } + + } + + return $data; + } + + public function _enqueue_new() { + //echo ""; + //echo ""; + //echo ""; + //echo ""; + //echo ""; + //echo ""; + //echo ""; + //echo ""; + //echo ""; + //echo ""; + //echo ""; + //echo ""; + + /* + wp_enqueue_script('redux-extension-customizer-codemirror-js', $this->_extension_url . 'new/codemirror.min.js'); + wp_enqueue_script('redux-extension-customizer-color-js', $this->_extension_url . 'new/colors-control.js'); + wp_enqueue_script('redux-extension-customizer-controls-js', $this->_extension_url . 'new/customizer-control.js'); + wp_enqueue_script('redux-extension-customizer-fonts-js', $this->_extension_url . 'new/fonts-customizer-admin.js'); + wp_enqueue_script('redux-extension-customizer-header-js', $this->_extension_url . 'new/header-control.js'); + wp_enqueue_script('redux-extension-customizer-models-js', $this->_extension_url . 'new/header-models.js'); + wp_enqueue_script('redux-extension-customizer-slimscroll-js', $this->_extension_url . 'new/jquery.slimscroll.js'); + wp_enqueue_script('redux-extension-customizer-droppable-js', $this->_extension_url . 'new/jquery.ui.droppable.min.js'); + wp_enqueue_script('redux-extension-customizer-editor-js', $this->_extension_url . 'new/media-editor.min.js'); + wp_enqueue_script('redux-extension-customizer-new-js', $this->_extension_url . 'new/new-customizer.js'); + wp_enqueue_script('redux-extension-customizer-previewing-js', $this->_extension_url . 'new/previewing.js'); + wp_enqueue_script('redux-extension-customizer-theme-js', $this->_extension_url . 'new/theme-customizer.js'); + */ + } + + // All sections, settings, and controls will be added here + public function _register_customizer_controls( $wp_customize ) { + $order = array( + 'heading' => - 500, + 'option' => - 500, + ); + $defaults = array( + 'default-color' => '', + 'default-image' => '', + 'wp-head-callback' => '', + 'admin-head-callback' => '', + 'admin-preview-callback' => '' + ); + $panel = ""; + + foreach ( $this->parent->sections as $key => $section ) { + + // Not a type that should go on the customizer + if ( empty( $section['fields'] ) || ( isset( $section['type'] ) && $section['type'] == "divide" ) ) { + continue; + } + + // If section customizer is set to false + if ( isset( $section['customizer'] ) && $section['customizer'] === false ) { + continue; + } + + // Evaluate section permissions + if ( isset( $section['permissions'] ) ) { + if ( ! current_user_can( $section['permissions'] ) ) { + continue; + } + } + + // No errors please + if ( ! isset( $section['desc'] ) ) { + $section['desc'] = ""; + } + + // Fill the description if there is a subtitle + if ( empty( $section['desc'] ) && ! empty( $section['subtitle'] ) ) { + $section['desc'] = $section['subtitle']; + } + + // Let's make a section ID from the title + if ( empty( $section['id'] ) ) { + $section['id'] = strtolower( str_replace( " ", "", $section['title'] ) ); + } + + // No title is present, let's show what section is missing a title + if ( ! isset( $section['title'] ) ) { + //print_r( $section ); + } + + // Let's set a default priority + if ( empty( $section['priority'] ) ) { + $section['priority'] = $order['heading']; + $order['heading'] ++; + } + + if ( method_exists( $wp_customize, 'add_panel' ) && ( ! isset( $section['subsection'] ) || ( isset( $section['subsection'] ) && $section['subsection'] != true ) ) && isset( $this->parent->sections[ ( $key + 1 ) ]['subsection'] ) && $this->parent->sections[ ( $key + 1 ) ]['subsection'] ) { + + $wp_customize->add_panel( $section['id'], array( + 'priority' => $section['priority'], + 'capability' => 'customize', + 'theme_supports' => '', + 'title' => $section['title'], + 'description' => $section['desc'], + ) ); + $panel = $section['id']; + + $wp_customize->add_section( $section['id'], array( + 'title' => $section['title'], + 'priority' => $section['priority'], + 'description' => $section['desc'], + 'panel' => $panel + ) ); + + + } else { + if ( ! isset( $section['subsection'] ) || ( isset( $section['subsection'] ) && $section['subsection'] != true ) ) { + $panel = ""; + } + $wp_customize->add_section( $section['id'], array( + 'title' => $section['title'], + 'priority' => $section['priority'], + 'description' => $section['desc'], + 'panel' => $panel + ) ); + } + + + foreach ( $section['fields'] as $skey => $option ) { + + // Evaluate section permissions + if ( isset( $option['permissions'] ) ) { + if ( ! current_user_can( $option['permissions'] ) ) { + continue; + } + } + if ( isset( $option['validate'] ) && $option['validate'] != false ) { + continue; + } + + if ( isset( $option['validate_callback'] ) && !empty( $option['validate_callback'] ) ) { + continue; + } + + if ( isset( $option['customizer'] ) && $option['customizer'] === false ) { + continue; + } + if ( $this->parent->args['customizer'] === false && ( ! isset( $option['customizer'] ) || $option['customizer'] !== true ) ) { + continue; + } + + //Change the item priority if not set + if ( $option['type'] != 'heading' && ! isset( $option['priority'] ) ) { + $option['priority'] = $order['option']; + $order['option'] ++; + } + + if ( ! empty( $this->options_defaults[ $option['id'] ] ) ) { + $option['default'] = $this->options_defaults['option']['id']; + } + + //$option['id'] = $this->parent->args['opt_name'].'['.$option['id'].']'; + //echo $option['id']; + + if ( ! isset( $option['default'] ) ) { + $option['default'] = ""; + } + if ( ! isset( $option['title'] ) ) { + $option['title'] = ""; + } + + // Wordpress doesn't support multi-select + if ( $option['type'] == "select" && isset( $option['multi'] ) && $option['multi'] == true ) { + continue; + } + + $option['id'] = $this->parent->args['opt_name'] . '[' . $option['id'] . ']'; + + if ( $option['type'] != "heading" || ! empty( $option['type'] ) ) { + $wp_customize->add_setting( $option['id'], + array( + 'default' => $option['default'], + 'type' => 'option', + 'capabilities' => 'edit_theme_options', + //'capabilities' => $this->parent->args['page_permissions'], + 'transport' => 'refresh', + 'theme_supports' => '', + //'sanitize_callback' => '__return_false', + 'sanitize_callback' => array( $this, '_field_validation' ), + //'sanitize_js_callback' =>array( &$parent, '_field_input' ), + ) + ); + } + + if ( ! empty( $option['data'] ) && empty( $option['options'] ) ) { + if ( empty( $option['args'] ) ) { + $option['args'] = array(); + } + + if ( $option['data'] == "elusive-icons" || $option['data'] == "elusive-icon" || $option['data'] == "elusive" ) { + $icons_file = ReduxFramework::$_dir . 'inc/fields/select/elusive-icons.php'; + $icons_file = apply_filters( 'redux-font-icons-file', $icons_file ); + + if ( file_exists( $icons_file ) ) { + require_once $icons_file; + } + } + $option['options'] = $this->parent->get_wordpress_data( $option['data'], $option['args'] ); + } + + switch ( $option['type'] ) { + case 'heading': + // We don't want to put up the section unless it's used by something visible in the customizer + $section = $option; + $section['id'] = strtolower( str_replace( " ", "", $option['title'] ) ); + $order['heading'] = - 500; + + if ( ! empty( $option['priority'] ) ) { + $section['priority'] = $option['priority']; + } else { + $section['priority'] = $order['heading']; + $order['heading'] ++; + } + break; + + case 'text': + if ( isset( $option['data'] ) && $option['data'] ) { + continue; + } + //if ($option['title'] == "Twitter Publisher Username") { + // print_r($option); + // $trueID = str_replace(array(']', 'redux_demo['),'',$option['id']); + // $data = get_option($this->parent->args['opt_name']); + // print_r($data[$trueID]); + // print_r($this->parent->options[$trueID]); + // exit(); + //} + $wp_customize->add_control( $option['id'], array( + 'label' => $option['title'], + 'section' => $section['id'], + 'settings' => $option['id'], + 'priority' => $option['priority'], + 'type' => 'text', + ) ); + break; + + case 'select': + case 'button_set': + if ( ! isset( $option['options'] ) ) { + continue; + } + + $newOptions = array(); + foreach ( $option['options'] as $key => $value ) { + if ( is_array( $value ) ) { + foreach ( $value as $key => $v ) { + $newOptions[] = $v; + } + + } + } + + if ( ! empty( $newOptions ) ) { + $option['options'] = $newOptions; + } + + if ( ( isset( $option['sortable'] ) && $option['sortable'] ) ) { + continue; + } + + if ( ( isset( $option['multi'] ) && $option['multi'] ) ) { + continue; + } + + $wp_customize->add_control( $option['id'], array( + 'label' => $option['title'], + 'section' => $section['id'], + 'settings' => $option['id'], + 'priority' => $option['priority'], + 'type' => 'select', + 'choices' => $option['options'] + ) ); + break; + + case 'radio': + //continue; + $wp_customize->add_control( $option['id'], array( + 'label' => $option['title'], + 'section' => $section['id'], + 'settings' => $option['id'], + 'priority' => $option['priority'], + 'type' => 'radio', + 'choices' => $option['options'] + ) ); + break; + + case 'checkbox': + if ( ( isset( $option['data'] ) && $option['data'] ) || ( ( isset( $option['multi'] ) && $option['multi'] ) ) || ( ( isset( $option['options'] ) && ! empty( $option['options'] ) ) ) ) { + continue; + } + $wp_customize->add_control( $option['id'], array( + 'label' => $option['title'], + 'section' => $section['id'], + 'settings' => $option['id'], + 'priority' => $option['priority'], + 'type' => 'checkbox', + ) ); + break; + + case 'media': + continue; + $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, $option['id'], array( + 'label' => $option['title'], + 'section' => $section['id'], + 'settings' => $option['id'], + 'priority' => $option['priority'] + ) ) ); + break; + + case 'color': + $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, $option['id'], array( + 'label' => $option['title'], + 'section' => $section['id'], + 'settings' => $option['id'], + 'priority' => $option['priority'] + ) ) ); + break; + + case 'switch': + continue; + $wp_customize->add_control( new Redux_customizer_switch( $wp_customize, $option['id'], array( + 'label' => $option['title'], + 'section' => $section['id'], + 'settings' => $option['id'], + 'field' => $option, + 'ReduxFramework' => $this->parent, + 'priority' => $option['priority'], + ) ) ); + + break; + + default: + break; + } + } + } + + /* + title_tagline - Site Title & Tagline + colors - Colors + header_image - Header Image + background_image - Background Image + nav - Navigation + static_front_page - Static Front Page + */ + } + + public function customizer_save_before( $plugin_options ) { + $this->before_save = $this->parent->options; + //$parent->_field_input( $plugin_options ); + } + + public function customizer_save_after( $wp_customize ) { + + if ( empty( $this->parent->options ) ) { + $this->parent->get_options(); + } + if ( empty( $this->orig_options ) && ! empty( $this->parent->options ) ) { + $this->orig_options = $this->parent->options; + } + + $options = json_decode( stripslashes_deep( $_POST['customized'] ), true ); + $compiler = false; + $changed = false; + + foreach ( $options as $key => $value ) { + if ( strpos( $key, $this->parent->args['opt_name'] ) !== false ) { + $key = str_replace( $this->parent->args['opt_name'] . '[', '', rtrim( $key, "]" ) ); + + if ( ! isset( $this->orig_options[ $key ] ) || $this->orig_options[ $key ] != $value || ( isset( $this->orig_options[ $key ] ) && ! empty( $this->orig_options[ $key ] ) && empty( $value ) ) ) { + $this->parent->options[ $key ] = $value; + $changed = true; + if ( isset( $this->parent->compiler_fields[ $key ] ) ) { + $compiler = true; + } + } + } + } + + if ( $changed ) { + $this->parent->set_options( $this->parent->options ); + if ( $compiler ) { + // Have to set this to stop the output of the CSS and typography stuff. + $this->parent->no_output = true; + $this->parent->_enqueue_output(); + do_action( "redux/options/{$this->parent->args['opt_name']}/compiler", $this->parent->options, $this->parent->compilerCSS ); + do_action( "redux/options/{$this->args['opt_name']}/compiler/advanced", $this->parent ); + } + } + + } + + /** + * Enqueue CSS/JS for preview pane + * + * @since 1.0.0 + * @access public + * @global $wp_styles + * @return void + */ + public function _enqueue_previewer() { + wp_enqueue_script( + 'redux-extension-previewer-js', + $this->_extension_url . 'assets/js/preview.js' + ); + + $localize = array( + 'save_pending' => __( 'You have changes that are not saved. Would you like to save them now?', 'legacy_framework' ), + 'reset_confirm' => __( 'Are you sure? Resetting will lose all custom values.', 'legacy_framework' ), + 'preset_confirm' => __( 'Your current options will be replaced with the values of this preset. Would you like to proceed?', 'legacy_framework' ), + 'opt_name' => $this->args['opt_name'], + //'folds' => $this->folds, + 'options' => $this->parent->options, + 'defaults' => $this->parent->options_defaults, + ); + + wp_localize_script( + 'redux-extension-previewer-js', + 'reduxPost', + $localize + ); + } + + /** + * Enqueue CSS/JS for the customizer controls + * + * @since 1.0.0 + * @access public + * @global $wp_styles + * @return void + */ + public function _enqueue() { + global $wp_styles; + + //wp_enqueue_style( 'wp-pointer' ); + //wp_enqueue_script( 'wp-pointer' ); + // Remove when code is in place! + //wp_enqueue_script('redux-extension-customizer-js', $this->_extension_url . 'assets/js/customizer.js'); + // Get styles + //wp_enqueue_style('redux-extension-customizer-css', $this->_extension_url . 'assets/css/customizer.css'); + + $localize = array( + 'save_pending' => __( 'You have changes that are not saved. Would you like to save them now?', 'legacy_framework' ), + 'reset_confirm' => __( 'Are you sure? Resetting will lose all custom values.', 'legacy_framework' ), + 'preset_confirm' => __( 'Your current options will be replaced with the values of this preset. Would you like to proceed?', 'legacy_framework' ), + 'opt_name' => $this->args['opt_name'], + //'folds' => $this->folds, + 'field' => $this->parent->options, + 'defaults' => $this->parent->options_defaults, + ); + + // Values used by the javascript + wp_localize_script( + 'redux-js', + 'redux_opts', + $localize + ); + + do_action( 'redux-enqueue-' . $this->args['opt_name'] ); + + foreach ( $this->sections as $section ) { + if ( isset( $section['fields'] ) ) { + foreach ( $section['fields'] as $field ) { + if ( isset( $field['type'] ) ) { + $field_class = 'ReduxFramework_' . $field['type']; + + if ( ! class_exists( $field_class ) ) { + $class_file = apply_filters( 'redux-typeclass-load', $this->path . 'inc/fields/' . $field['type'] . '/field_' . $field['type'] . '.php', $field_class ); + if ( $class_file ) { + /** @noinspection PhpIncludeInspection */ + require_once( $class_file ); + } + } + + if ( class_exists( $field_class ) && method_exists( $field_class, 'enqueue' ) ) { + $enqueue = new $field_class( '', '', $this ); + $enqueue->enqueue(); + } + } + } + } + } + } + + /** + * Register Option for use + * + * @since 1.0.0 + * @access public + * @return void + */ + public function _register_setting() { + + } + + /** + * Validate the options before insertion + * + * @since 3.0.0 + * @access public + * + * @param array $plugin_options The options array + * + * @return + */ + public function _field_validation( $value ) { + //print_r( $value ); + //print_r( $_POST ); + + return $value; + + //return $this->parent->_validate_options( $plugin_options ); + } + + /** + * HTML OUTPUT. + * + * @since 1.0.0 + * @access public + * @return void + */ + public function _customizer_html_output() { + + } + } // class + function redux_customizer_custom_validation( $field ) { + return $field; + } + } // if diff --git a/plugins/legacy-admin/framework/core/inc/extensions/import_export/extension_import_export.php b/plugins/legacy-admin/framework/core/inc/extensions/import_export/extension_import_export.php new file mode 100644 index 000000000..c8d6b8961 --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/extensions/import_export/extension_import_export.php @@ -0,0 +1,207 @@ +. + * + * @package ReduxFramework + * @author Dovy Paukstys (dovy) + * @version 4.0.0 + */ + +// Exit if accessed directly + if ( ! defined( 'ABSPATH' ) ) { + exit; + } + +// Don't duplicate me! + if ( ! class_exists( 'ReduxFramework_extension_import_export' ) ) { + + + /** + * Main ReduxFramework import_export extension class + * + * @since 3.1.6 + */ + class ReduxFramework_extension_import_export extends ReduxFramework { + + // Protected vars + protected $parent; + public $extension_url; + public $extension_dir; + public static $theInstance; + public static $version = "4.0"; + public $is_field = false; + + /** + * Class Constructor. Defines the args for the extions class + * + * @since 1.0.0 + * @access public + * + * @param array $sections Panel sections. + * @param array $args Class constructor arguments. + * @param array $extra_tabs Extra panel tabs. + * + * @return void + */ + public function __construct( $parent ) { + + $this->parent = $parent; + if ( empty( $this->extension_dir ) ) { + $this->extension_dir = trailingslashit( str_replace( '\\', '/', dirname( __FILE__ ) ) ); + } + $this->field_name = 'import_export'; + + + self::$theInstance = $this; + + add_action( "wp_ajax_redux_link_options-" . $this->parent->args['opt_name'], array( + $this, + "link_options" + ) ); + add_action( "wp_ajax_nopriv_redux_link_options-" . $this->parent->args['opt_name'], array( + $this, + "link_options" + ) ); + + add_action( "wp_ajax_redux_download_options-" . $this->parent->args['opt_name'], array( + $this, + "download_options" + ) ); + add_action( "wp_ajax_nopriv_redux_download_options-" . $this->parent->args['opt_name'], array( + $this, + "download_options" + ) ); + + do_action("redux/options/{$this->parent->args['opt_name']}/import", array($this, 'remove_cookie')); + + $this->is_field = Redux_Helpers::isFieldInUse($parent, 'import_export'); + + if ( !$this->is_field && $this->parent->args['show_import_export'] ) { + $this->add_section(); + } + + add_filter( 'redux/' . $this->parent->args['opt_name'] . '/field/class/' . $this->field_name, array( + &$this, + 'overload_field_path' + ) ); // Adds the local field + + //add_filter( 'upload_mimes', array( + // $this, + // 'custom_upload_mimes' + //) ); + + } + + /** + * Adds the appropriate mime types to WordPress + * + * @param array $existing_mimes + * + * @return array + */ + function custom_upload_mimes( $existing_mimes = array() ) { + $existing_mimes['redux'] = 'application/json'; + return $existing_mimes; + } + + public function add_section() { + $this->parent->sections[] = array( + 'id' => 'import/export', + 'title' => __( 'Import / Export', 'legacy_framework' ), + 'heading' => '', + 'icon' => 'el el-refresh', + 'fields' => array( + array( + 'id' => 'redux_import_export', + 'type'=> 'import_export', + 'title' => '', + ) + ), + ); + } + + function link_options() { + if ( ! isset( $_GET['secret'] ) || $_GET['secret'] != md5( md5( AUTH_KEY . SECURE_AUTH_KEY ) . '-' . $this->parent->args['opt_name'] ) ) { + wp_die( 'Invalid Secret for options use' ); + exit; + } + + $var = $this->parent->options; + $var['redux-backup'] = '1'; + if ( isset( $var['REDUX_imported'] ) ) { + unset( $var['REDUX_imported'] ); + } + + echo json_encode( $var ); + + die(); + } + + public function download_options() { + if ( ! isset( $_GET['secret'] ) || $_GET['secret'] != md5( md5( AUTH_KEY . SECURE_AUTH_KEY ) . '-' . $this->parent->args['opt_name'] ) ) { + wp_die( 'Invalid Secret for options use' ); + exit; + } + + $this->parent->get_options(); + $backup_options = $this->parent->options; + $backup_options['redux-backup'] = '1'; + if ( isset( $var['REDUX_imported'] ) ) { + unset( $var['REDUX_imported'] ); + } + + $content = json_encode( $backup_options ); + + if ( isset( $_GET['action'] ) && $_GET['action'] == 'redux_download_options-'.$this->parent->args['opt_name'] ) { + header( 'Content-Description: File Transfer' ); + header( 'Content-type: application/txt' ); + header( 'Content-Disposition: attachment; filename="redux_options_' . $this->parent->args['opt_name'] . '_backup_' . date( 'd-m-Y' ) . '.json"' ); + header( 'Content-Transfer-Encoding: binary' ); + header( 'Expires: 0' ); + header( 'Cache-Control: must-revalidate' ); + header( 'Pragma: public' ); + + echo $content; + + exit; + } else { + header( "Expires: Mon, 26 Jul 1997 05:00:00 GMT" ); + header( "Last-Modified: " . gmdate( "D, d M Y H:i:s" ) . "GMT" ); + header( 'Expires: Sat, 26 Jul 1997 05:00:00 GMT' ); + header( 'Cache-Control: no-store, no-cache, must-revalidate' ); + header( 'Cache-Control: post-check=0, pre-check=0', false ); + header( 'Pragma: no-cache' ); + + // Can't include the type. Thanks old Firefox and IE. BAH. + //header("Content-type: application/json"); + echo $content; + exit; + } + } + + // Forces the use of the embeded field path vs what the core typically would use + public function overload_field_path( $field ) { + return dirname( __FILE__ ) . '/' . $this->field_name . '/field_' . $this->field_name . '.php'; + } + + public function remove_cookie() { + + // Remove the import/export tab cookie. + if ( $_COOKIE['redux_current_tab'] == 'import_export_default' ) { + setcookie( 'redux_current_tab', '', 1, '/' ); + $_COOKIE['redux_current_tab'] = 1; + } + } + + } // class + } // if diff --git a/plugins/legacy-admin/framework/core/inc/extensions/import_export/import_export/field_import_export.css b/plugins/legacy-admin/framework/core/inc/extensions/import_export/import_export/field_import_export.css new file mode 100644 index 000000000..70f310d35 --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/extensions/import_export/import_export/field_import_export.css @@ -0,0 +1 @@ +#redux-import-link-wrapper,#redux-import-code-wrapper{display:none}#redux-export-code,#redux-export-link-value{display:none}#redux-import-action span{color:#B94A48} diff --git a/plugins/legacy-admin/framework/core/inc/extensions/import_export/import_export/field_import_export.js b/plugins/legacy-admin/framework/core/inc/extensions/import_export/import_export/field_import_export.js new file mode 100644 index 000000000..5b2cac8d8 --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/extensions/import_export/import_export/field_import_export.js @@ -0,0 +1,195 @@ +/*global redux_change, redux*/ + +(function( $ ) { + "use strict"; + + redux.field_objects = redux.field_objects || {}; + redux.field_objects.import_export = redux.field_objects.import_export || {}; + + $( document ).ready( + function() { + redux.field_objects.import_export.init(); + } + ); + + redux.field_objects.import_export.init = function( selector ) { + + if ( !selector ) { + selector = $( document ).find( '.redux-container-import_export' ); + } + + var parent = selector; + + if ( !selector.hasClass( 'redux-field-container' ) ) { + parent = selector.parents( '.redux-field-container:first' ); + } + + if ( parent.hasClass( 'redux-field-init' ) ) { + parent.removeClass( 'redux-field-init' ); + } else { + return; + } + + $( '#redux-import' ).click( + function( e ) { + if ( $( '#import-code-value' ).val() === "" && $( '#import-link-value' ).val() === "" ) { + e.preventDefault(); + return false; + } + window.onbeforeunload = null; + redux.args.ajax_save = false; + } + ); + + $( '#redux-import-code-button' ).click( + function() { + var $el = $( '#redux-import-code-wrapper' ); + if ( $( '#redux-import-link-wrapper' ).is( ':visible' ) ) { + $( '#import-link-value' ).text( '' ); + $( '#redux-import-link-wrapper' ).slideUp( + 'fast', function() { + $el.slideDown( + 'fast', function() { + $( '#import-code-value' ).focus(); + } + ); + } + ); + } else { + if ( $el.is( ':visible' ) ) { + $el.slideUp(); + } else { + $el.slideDown( + 'medium', function() { + $( '#import-code-value' ).focus(); + } + ); + } + } + } + ); + + $( '#redux-import-link-button' ).click( + function() { + var $el = $( '#redux-import-link-wrapper' ); + if ( $( '#redux-import-code-wrapper' ).is( ':visible' ) ) { + $( '#import-code-value' ).text( '' ); + $( '#redux-import-code-wrapper' ).slideUp( + 'fast', function() { + $el.slideDown( + 'fast', function() { + $( '#import-link-value' ).focus(); + } + ); + } + ); + } else { + if ( $el.is( ':visible' ) ) { + $el.slideUp(); + } else { + $el.slideDown( + 'medium', function() { + $( '#import-link-value' ).focus(); + } + ); + } + } + } + ); + + $( '#redux-export-code-copy' ).click( + function() { + var $el = $( '#redux-export-code' ); + if ( $( '#redux-export-link-value' ).is( ':visible' ) ) { + $( '#redux-export-link-value' ).slideUp( + 'fast', function() { + $el.slideDown( + 'medium', function() { + var options = redux.options; + options['redux-backup'] = 1; + $( this ).text( JSON.stringify( options ) ).focus().select(); + } + ); + } + ); + } else { + if ( $el.is( ':visible' ) ) { + $el.slideUp().text( '' ); + } else { + $el.slideDown( + 'medium', function() { + var options = redux.options; + options['redux-backup'] = 1; + $( this ).text( JSON.stringify( options ) ).focus().select(); + } + ); + } + } + } + ); + + $( '.redux-container-import_export textarea' ).focusout( + function() { + var $id = $( this ).attr( 'id' ); + var $el = $( this ); + var $container = $el; + if ( $id == "import-link-value" || $id == "import-code-value" ) { + $container = $( this ).parent(); + } + $container.slideUp( + 'medium', function() { + if ( $id != "redux-export-link-value" ) { + $el.text( '' ); + } + } + ); + } + ); + + + $( '#redux-export-link' ).click( + function() { + var $el = $( '#redux-export-link-value' ); + if ( $( '#redux-export-code' ).is( ':visible' ) ) { + $( '#redux-export-code' ).slideUp( + 'fast', function() { + $el.slideDown().focus().select(); + } + ); + } else { + if ( $el.is( ':visible' ) ) { + $el.slideUp(); + } else { + $el.slideDown( + 'medium', function() { + $( this ).focus().select(); + } + ); + } + + } + } + ); + + var textBox1 = document.getElementById( "redux-export-code" ); + textBox1.onfocus = function() { + textBox1.select(); + // Work around Chrome's little problem + textBox1.onmouseup = function() { + // Prevent further mouseup intervention + textBox1.onmouseup = null; + return false; + }; + }; + var textBox2 = document.getElementById( "import-code-value" ); + textBox2.onfocus = function() { + textBox2.select(); + // Work around Chrome's little problem + textBox2.onmouseup = function() { + // Prevent further mouseup intervention + textBox2.onmouseup = null; + return false; + }; + }; + }; +})( jQuery ); \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/inc/extensions/import_export/import_export/field_import_export.min.js b/plugins/legacy-admin/framework/core/inc/extensions/import_export/import_export/field_import_export.min.js new file mode 100644 index 000000000..468e6e8db --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/extensions/import_export/import_export/field_import_export.min.js @@ -0,0 +1 @@ +!function(a){"use strict";redux.field_objects=redux.field_objects||{},redux.field_objects.import_export=redux.field_objects.import_export||{},a(document).ready(function(){redux.field_objects.import_export.init()}),redux.field_objects.import_export.init=function(b){b||(b=a(document).find(".redux-container-import_export"));var c=b;if(b.hasClass("redux-field-container")||(c=b.parents(".redux-field-container:first")),c.hasClass("redux-field-init")){c.removeClass("redux-field-init"),a("#redux-import").click(function(b){return""===a("#import-code-value").val()&&""===a("#import-link-value").val()?(b.preventDefault(),!1):(window.onbeforeunload=null,void(redux.args.ajax_save=!1))}),a("#redux-import-code-button").click(function(){var b=a("#redux-import-code-wrapper");a("#redux-import-link-wrapper").is(":visible")?(a("#import-link-value").text(""),a("#redux-import-link-wrapper").slideUp("fast",function(){b.slideDown("fast",function(){a("#import-code-value").focus()})})):b.is(":visible")?b.slideUp():b.slideDown("medium",function(){a("#import-code-value").focus()})}),a("#redux-import-link-button").click(function(){var b=a("#redux-import-link-wrapper");a("#redux-import-code-wrapper").is(":visible")?(a("#import-code-value").text(""),a("#redux-import-code-wrapper").slideUp("fast",function(){b.slideDown("fast",function(){a("#import-link-value").focus()})})):b.is(":visible")?b.slideUp():b.slideDown("medium",function(){a("#import-link-value").focus()})}),a("#redux-export-code-copy").click(function(){var b=a("#redux-export-code");a("#redux-export-link-value").is(":visible")?a("#redux-export-link-value").slideUp("fast",function(){b.slideDown("medium",function(){var b=redux.options;b["redux-backup"]=1,a(this).text(JSON.stringify(b)).focus().select()})}):b.is(":visible")?b.slideUp().text(""):b.slideDown("medium",function(){var b=redux.options;b["redux-backup"]=1,a(this).text(JSON.stringify(b)).focus().select()})}),a(".redux-container-import_export textarea").focusout(function(){var b=a(this).attr("id"),c=a(this),d=c;("import-link-value"==b||"import-code-value"==b)&&(d=a(this).parent()),d.slideUp("medium",function(){"redux-export-link-value"!=b&&c.text("")})}),a("#redux-export-link").click(function(){var b=a("#redux-export-link-value");a("#redux-export-code").is(":visible")?a("#redux-export-code").slideUp("fast",function(){b.slideDown().focus().select()}):b.is(":visible")?b.slideUp():b.slideDown("medium",function(){a(this).focus().select()})});var d=document.getElementById("redux-export-code");d.onfocus=function(){d.select(),d.onmouseup=function(){return d.onmouseup=null,!1}};var e=document.getElementById("import-code-value");e.onfocus=function(){e.select(),e.onmouseup=function(){return e.onmouseup=null,!1}}}}}(jQuery); \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/inc/extensions/import_export/import_export/field_import_export.php b/plugins/legacy-admin/framework/core/inc/extensions/import_export/import_export/field_import_export.php new file mode 100644 index 000000000..5d0c9e85a --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/extensions/import_export/import_export/field_import_export.php @@ -0,0 +1,194 @@ +. + * + * @package ReduxFramework + * @author Dovy Paukstys + * @version 3.1.5 + */ + +// Exit if accessed directly + if ( ! defined( 'ABSPATH' ) ) { + exit; + } + +// Don't duplicate me! + if ( ! class_exists( 'ReduxFramework_import_export' ) ) { + + /** + * Main ReduxFramework_import_export class + * + * @since 1.0.0 + */ + class ReduxFramework_import_export extends ReduxFramework { + + /** + * Field Constructor. + * Required - must call the parent constructor, then assign field and value to vars, and obviously call the render field function + * + * @since 1.0.0 + * @access public + * @return void + */ + function __construct( $field = array(), $value = '', $parent ) { + + + $this->parent = $parent; + $this->field = $field; + $this->value = $value; + $this->is_field = $this->parent->extensions['import_export']->is_field; + + if ( empty( $this->extension_dir ) ) { + $this->extension_dir = trailingslashit( str_replace( '\\', '/', dirname( __FILE__ ) ) ); + $this->extension_url = site_url( str_replace( trailingslashit( str_replace( '\\', '/', ABSPATH ) ), '', $this->extension_dir ) ); + } + + // Set default args for this field to avoid bad indexes. Change this to anything you use. + $defaults = array( + 'options' => array(), + 'stylesheet' => '', + 'output' => true, + 'enqueue' => true, + 'enqueue_frontend' => true + ); + $this->field = wp_parse_args( $this->field, $defaults ); + + } + + /** + * Field Render Function. + * Takes the vars and outputs the HTML for the field in the settings + * + * @since 1.0.0 + * @access public + * @return void + */ + public function render() { + + $secret = md5( md5( AUTH_KEY . SECURE_AUTH_KEY ) . '-' . $this->parent->args['opt_name'] ); + + // No errors please + $defaults = array( + 'full_width' => true, + 'overflow' => 'inherit', + ); + + $this->field = wp_parse_args( $this->field, $defaults ); + + if ( $this->is_field ) { + $fullWidth = $this->field['full_width']; + } + + $bDoClose = false; + + $id = $this->parent->args['opt_name'] . '-' . $this->field['id']; + + if ( ! $this->is_field || ( $this->is_field && false == $fullWidth ) ) : ?> + + + +
    + +
    + +

    +

    + +
    +

    + +
    + + + +

      

    + +
     
    +

    +
    +

    +
    + parent->args['opt_name'] . '&secret=' . $secret ); + ?> +

    +

    + + + + + +
    + +
    + + + + + \nsnippet cite\n ${1}\nsnippet code\n ${1}\nsnippet col\n ${1}\nsnippet col+\n \n col+${1}\nsnippet colgroup\n \n ${1}\n \nsnippet colgroup+\n \n \n col+${1}\n \nsnippet command\n \nsnippet command:c\n \nsnippet command:r\n \nsnippet datagrid\n \n ${1}\n \nsnippet datalist\n \n ${1}\n \nsnippet datatemplate\n \n ${1}\n \nsnippet dd\n
    ${1}
    \nsnippet dd.\n
    ${2}
    \nsnippet dd#\n
    ${2}
    \nsnippet del\n ${1}\nsnippet details\n
    ${1}
    \nsnippet dfn\n ${1}\nsnippet dialog\n \n ${1}\n \nsnippet div\n
    \n ${1}\n
    \nsnippet div.\n
    \n ${2}\n
    \nsnippet div#\n
    \n ${2}\n
    \nsnippet dl\n
    \n ${1}\n
    \nsnippet dl.\n
    \n ${2}\n
    \nsnippet dl#\n
    \n ${2}\n
    \nsnippet dl+\n
    \n
    ${1}
    \n
    ${2}
    \n dt+${3}\n
    \nsnippet dt\n
    ${1}
    \nsnippet dt.\n
    ${2}
    \nsnippet dt#\n
    ${2}
    \nsnippet dt+\n
    ${1}
    \n
    ${2}
    \n dt+${3}\nsnippet em\n ${1}\nsnippet embed\n \n ${2}\n \nsnippet fieldset#\n
    \n ${2}\n
    \nsnippet fieldset+\n
    \n ${1}\n ${2}\n
    \n fieldset+${3}\nsnippet figcaption\n
    ${1}
    \nsnippet figure\n
    ${1}
    \nsnippet footer\n
    \n ${1}\n
    \nsnippet footer.\n
    \n ${2}\n
    \nsnippet footer#\n
    \n ${2}\n
    \nsnippet form\n
    \n ${3}\n \nsnippet form.\n
    \n ${4}\n \nsnippet form#\n
    \n ${4}\n \nsnippet h1\n

    ${1}

    \nsnippet h1.\n

    ${2}

    \nsnippet h1#\n

    ${2}

    \nsnippet h2\n

    ${1}

    \nsnippet h2.\n

    ${2}

    \nsnippet h2#\n

    ${2}

    \nsnippet h3\n

    ${1}

    \nsnippet h3.\n

    ${2}

    \nsnippet h3#\n

    ${2}

    \nsnippet h4\n

    ${1}

    \nsnippet h4.\n

    ${2}

    \nsnippet h4#\n

    ${2}

    \nsnippet h5\n
    ${1}
    \nsnippet h5.\n
    ${2}
    \nsnippet h5#\n
    ${2}
    \nsnippet h6\n
    ${1}
    \nsnippet h6.\n
    ${2}
    \nsnippet h6#\n
    ${2}
    \nsnippet head\n \n \n\n ${1:`substitute(Filename(\'\', \'Page Title\'), \'^.\', \'\\u&\', \'\')`}\n ${2}\n \nsnippet header\n
    \n ${1}\n
    \nsnippet header.\n
    \n ${2}\n
    \nsnippet header#\n
    \n ${2}\n
    \nsnippet hgroup\n
    \n ${1}\n
    \nsnippet hgroup.\n
    \n ${1}\n \nsnippet html5\n \n \n \n \n ${1:`substitute(Filename(\'\', \'Page Title\'), \'^.\', \'\\u&\', \'\')`}\n ${2:meta}\n \n \n ${3:body}\n \n \nsnippet i\n ${1}\nsnippet iframe\n ${2}\nsnippet iframe.\n ${3}\nsnippet iframe#\n ${3}\nsnippet img\n ${2}${3}\nsnippet img.\n ${3}${4}\nsnippet img#\n ${3}${4}\nsnippet input\n ${5}\nsnippet input.\n ${6}\nsnippet input:text\n ${4}\nsnippet input:submit\n ${4}\nsnippet input:hidden\n ${4}\nsnippet input:button\n ${4}\nsnippet input:image\n ${5}\nsnippet input:checkbox\n ${3}\nsnippet input:radio\n ${3}\nsnippet input:color\n ${4}\nsnippet input:date\n ${4}\nsnippet input:datetime\n ${4}\nsnippet input:datetime-local\n ${4}\nsnippet input:email\n ${4}\nsnippet input:file\n ${4}\nsnippet input:month\n ${4}\nsnippet input:number\n ${4}\nsnippet input:password\n ${4}\nsnippet input:range\n ${4}\nsnippet input:reset\n ${4}\nsnippet input:search\n ${4}\nsnippet input:time\n ${4}\nsnippet input:url\n ${4}\nsnippet input:week\n ${4}\nsnippet ins\n ${1}\nsnippet kbd\n ${1}\nsnippet keygen\n ${1}\nsnippet label\n \nsnippet label:i\n \n ${7}\nsnippet label:s\n \n \nsnippet legend\n ${1}\nsnippet legend+\n ${1}\nsnippet li\n
  • ${1}
  • \nsnippet li.\n
  • ${2}
  • \nsnippet li+\n
  • ${1}
  • \n li+${2}\nsnippet lia\n
  • ${1}
  • \nsnippet lia+\n
  • ${1}
  • \n lia+${3}\nsnippet link\n ${5}\nsnippet link:atom\n ${2}\nsnippet link:css\n ${4}\nsnippet link:favicon\n ${2}\nsnippet link:rss\n ${2}\nsnippet link:touch\n ${2}\nsnippet map\n \n ${2}\n \nsnippet map.\n \n ${3}\n \nsnippet map#\n \n ${5}${6}\n ${7}\nsnippet mark\n ${1}\nsnippet menu\n \n ${1}\n \nsnippet menu:c\n \n ${1}\n \nsnippet menu:t\n \n ${1}\n \nsnippet meta\n ${3}\nsnippet meta:compat\n ${3}\nsnippet meta:refresh\n ${3}\nsnippet meta:utf\n ${3}\nsnippet meter\n ${1}\nsnippet nav\n \nsnippet nav.\n \nsnippet nav#\n \nsnippet noscript\n \nsnippet object\n \n ${3}\n ${4}\n# Embed QT Movie\nsnippet movie\n \n \n \n \n \n ${6}\nsnippet ol\n
      \n ${1}\n
    \nsnippet ol.\n
      \n ${2}\n
    \nsnippet ol+\n
      \n
    1. ${1}
    2. \n li+${2}\n
    \nsnippet opt\n \nsnippet opt+\n \n opt+${3}\nsnippet optt\n \nsnippet optgroup\n \n \n opt+${3}\n \nsnippet output\n ${1}\nsnippet p\n

    ${1}

    \nsnippet param\n ${3}\nsnippet pre\n
    \n		${1}\n	
    \nsnippet progress\n ${1}\nsnippet q\n ${1}\nsnippet rp\n ${1}\nsnippet rt\n ${1}\nsnippet ruby\n \n ${1}\n \nsnippet s\n ${1}\nsnippet samp\n \n ${1}\n \nsnippet script\n + parent->args['dev_mode'] ) { + wp_enqueue_style( + 'redux-field-section-css', + ReduxFramework::$_url . 'inc/fields/section/field_section.css', + array(), + time(), + 'all' + ); + } + } + } + } \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/inc/fields/section/field_section.scss b/plugins/legacy-admin/framework/core/inc/fields/section/field_section.scss new file mode 100644 index 000000000..2a70c87e3 --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/fields/section/field_section.scss @@ -0,0 +1,24 @@ +.redux-main { + .form-table-section-indented { + width: 95%; + margin-left: 5%; + } + + .form-table-section tr:first-of-type th:first-of-type { + padding: 0px !important; + } + + h3 { + margin-top: 10px; + } + + .form-table-section-indented > tbody > tr{ + &:first-child { + display: none; + } + + &:nth-last-child(2) { + border-bottom: 0; + } + } +} \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/inc/fields/select/elusive-icons.php b/plugins/legacy-admin/framework/core/inc/fields/select/elusive-icons.php new file mode 100644 index 000000000..a10d67613 --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/fields/select/elusive-icons.php @@ -0,0 +1,312 @@ + 0 ) { + var select2_params = $( this ).siblings( '.select2_params' ).val(); + select2_params = JSON.parse( select2_params ); + default_params = $.extend( {}, default_params, select2_params ); + } + + if ( $( this ).hasClass( 'font-icons' ) ) { + default_params = $.extend( + {}, { + formatResult: redux.field_objects.select.addIcon, + formatSelection: redux.field_objects.select.addIcon, + escapeMarkup: function( m ) { + return m; + } + }, default_params + ); + } + + $( this ).select2( default_params ); + + if ( $( this ).hasClass( 'select2-sortable' ) ) { + default_params = {}; + default_params.bindOrder = 'sortableStop'; + default_params.sortableOptions = {placeholder: 'ui-state-highlight'}; + $( this ).select2Sortable( default_params ); + } + + $( this ).on( + "change", function() { + redux_change( $( $( this ) ) ); + $( this ).select2SortableOrder(); + } + ); + } + ); + } + ); + }; + + redux.field_objects.select.addIcon = function( icon ) { + if ( icon.hasOwnProperty( 'id' ) ) { + return "" + "  " + icon.text + ""; + } + }; +})( jQuery ); \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/inc/fields/select/field_select.min.js b/plugins/legacy-admin/framework/core/inc/fields/select/field_select.min.js new file mode 100644 index 000000000..4f1aa049d --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/fields/select/field_select.min.js @@ -0,0 +1 @@ +!function(a){"use strict";redux.field_objects=redux.field_objects||{},redux.field_objects.select=redux.field_objects.select||{},redux.field_objects.select.init=function(b){b||(b=a(document).find(".redux-container-select:visible")),a(b).each(function(){var b=a(this),c=b;b.hasClass("redux-field-container")||(c=b.parents(".redux-field-container:first")),c.is(":hidden")||c.hasClass("redux-field-init")&&(c.removeClass("redux-field-init"),b.find("select.redux-select-item").each(function(){var b={width:"resolve",triggerChange:!0,allowClear:!0};if(a(this).siblings(".select2_params").size()>0){var c=a(this).siblings(".select2_params").val();c=JSON.parse(c),b=a.extend({},b,c)}a(this).hasClass("font-icons")&&(b=a.extend({},{formatResult:redux.field_objects.select.addIcon,formatSelection:redux.field_objects.select.addIcon,escapeMarkup:function(a){return a}},b)),a(this).select2(b),a(this).hasClass("select2-sortable")&&(b={},b.bindOrder="sortableStop",b.sortableOptions={placeholder:"ui-state-highlight"},a(this).select2Sortable(b)),a(this).on("change",function(){redux_change(a(a(this))),a(this).select2SortableOrder()})}))})},redux.field_objects.select.addIcon=function(a){return a.hasOwnProperty("id")?"  "+a.text+"":void 0}}(jQuery); \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/inc/fields/select/field_select.php b/plugins/legacy-admin/framework/core/inc/fields/select/field_select.php new file mode 100644 index 000000000..4c3fa41be --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/fields/select/field_select.php @@ -0,0 +1,176 @@ +parent = $parent; + $this->field = $field; + $this->value = $value; + } + + /** + * Field Render Function. + * Takes the vars and outputs the HTML for the field in the settings + * + * @since ReduxFramework 1.0.0 + */ + public function render() { + $sortable = ( isset( $this->field['sortable'] ) && $this->field['sortable'] ) ? ' select2-sortable"' : ""; + + if ( ! empty( $sortable ) ) { // Dummy proofing :P + $this->field['multi'] = true; + } + + if ( ! empty( $this->field['data'] ) && empty( $this->field['options'] ) ) { + if ( empty( $this->field['args'] ) ) { + $this->field['args'] = array(); + } + + if ( $this->field['data'] == "elusive-icons" || $this->field['data'] == "elusive-icon" || $this->field['data'] == "elusive" ) { + $icons_file = ReduxFramework::$_dir . 'inc/fields/select/elusive-icons.php'; + /** + * filter 'redux-font-icons-file}' + * + * @param array $icon_file File for the icons + */ + $icons_file = apply_filters( 'redux-font-icons-file', $icons_file ); + + /** + * filter 'redux/{opt_name}/field/font/icons/file' + * + * @param array $icon_file File for the icons + */ + $icons_file = apply_filters( "redux/{$this->parent->args['opt_name']}/field/font/icons/file", $icons_file ); + if ( file_exists( $icons_file ) ) { + require_once( $icons_file ); + } + } + + $this->field['options'] = $this->parent->get_wordpress_data( $this->field['data'], $this->field['args'] ); + } + + if ( ! empty( $this->field['data'] ) && ( $this->field['data'] == "elusive-icons" || $this->field['data'] == "elusive-icon" || $this->field['data'] == "elusive" ) ) { + $this->field['class'] = " font-icons"; + } + //if + + if ( ! empty( $this->field['options'] ) ) { + $multi = ( isset( $this->field['multi'] ) && $this->field['multi'] ) ? ' multiple="multiple"' : ""; + + if ( ! empty( $this->field['width'] ) ) { + $width = ' style="' . $this->field['width'] . '"'; + } else { + $width = ' style="width: 40%;"'; + } + + $nameBrackets = ""; + if ( ! empty( $multi ) ) { + $nameBrackets = "[]"; + } + + $placeholder = ( isset( $this->field['placeholder'] ) ) ? esc_attr( $this->field['placeholder'] ) : __( 'Select an item', 'legacy_framework' ); + + if ( isset( $this->field['select2'] ) ) { // if there are any let's pass them to js + $select2_params = json_encode( $this->field['select2'] ); + $select2_params = htmlspecialchars( $select2_params, ENT_QUOTES ); + + echo ''; + } + + if ( isset( $this->field['multi'] ) && $this->field['multi'] && isset( $this->field['sortable'] ) && $this->field['sortable'] && ! empty( $this->value ) && is_array( $this->value ) ) { + $origOption = $this->field['options']; + $this->field['options'] = array(); + + foreach ( $this->value as $value ) { + $this->field['options'][ $value ] = $origOption[ $value ]; + } + + if ( count( $this->field['options'] ) < count( $origOption ) ) { + foreach ( $origOption as $key => $value ) { + if ( ! in_array( $key, $this->field['options'] ) ) { + $this->field['options'][ $key ] = $value; + } + } + } + } + + $sortable = ( isset( $this->field['sortable'] ) && $this->field['sortable'] ) ? ' select2-sortable"' : ""; + + echo ''; + } else { + echo '' . __( 'No items of this type were found.', 'legacy_framework' ) . ''; + } + } //function + + private function make_option($id, $value, $group_name = '') { + if ( is_array( $this->value ) ) { + $selected = ( is_array( $this->value ) && in_array( $id, $this->value ) ) ? ' selected="selected"' : ''; + } else { + $selected = selected( $this->value, $id, false ); + } + + echo ''; + } + + /** + * Enqueue Function. + * If this field requires any scripts, or css define this function and register/enqueue the scripts/css + * + * @since ReduxFramework 1.0.0 + */ + public function enqueue() { + wp_enqueue_style( 'select2-css' ); + + wp_enqueue_script( + 'redux-field-select-js', + ReduxFramework::$_url . 'inc/fields/select/field_select' . Redux_Functions::isMin() . '.js', + array( 'jquery', 'select2-js', 'redux-js' ), + time(), + true + ); + + if ($this->parent->args['dev_mode']) { + wp_enqueue_style( + 'redux-field-select-css', + ReduxFramework::$_url . 'inc/fields/select/field_select.css', + array(), + time(), + 'all' + ); + } + } //function + } //class +} \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/inc/fields/select/field_select.scss b/plugins/legacy-admin/framework/core/inc/fields/select/field_select.scss new file mode 100644 index 000000000..066386e75 --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/fields/select/field_select.scss @@ -0,0 +1,9 @@ +.redux-container-select { + li.ui-state-highlight { + height: 20px; + margin-top: 2px; + margin-left: 5px; + width: 64px; + margin-bottom: 0; + } +} \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/inc/fields/select_image/field_select_image.css b/plugins/legacy-admin/framework/core/inc/fields/select_image/field_select_image.css new file mode 100644 index 000000000..b4a9459ca --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/fields/select_image/field_select_image.css @@ -0,0 +1 @@ +.redux-container-select_image{margin-top:2px;margin-left:5px;width:100%;margin-bottom:0}.redux-preview-image{max-height:250px;max-width:250px;padding:5px;margin-top:10px;border:1px solid #e3e3e3;background:#f7f7f7;-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px} diff --git a/plugins/legacy-admin/framework/core/inc/fields/select_image/field_select_image.js b/plugins/legacy-admin/framework/core/inc/fields/select_image/field_select_image.js new file mode 100644 index 000000000..296f41ec6 --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/fields/select_image/field_select_image.js @@ -0,0 +1,72 @@ +/*global redux_change, redux*/ + +(function( $ ) { + "use strict"; + + redux.field_objects = redux.field_objects || {}; + redux.field_objects.select_image = redux.field_objects.select_image || {}; + + $( document ).ready( + function() { + //redux.field_objects.select_image.init(); + } + ); + + redux.field_objects.select_image.init = function( selector ) { + + if ( !selector ) { + selector = $( document ).find( ".redux-group-tab:visible" ).find( '.redux-container-select_image:visible' ); + } + + $( selector ).each( + function() { + var el = $( this ); + var parent = el; + if ( !el.hasClass( 'redux-field-container' ) ) { + parent = el.parents( '.redux-field-container:first' ); + } + if ( parent.is( ":hidden" ) ) { // Skip hidden fields + return; + } + if ( parent.hasClass( 'redux-field-init' ) ) { + parent.removeClass( 'redux-field-init' ); + } else { + return; + } + var default_params = { + width: 'resolve', + triggerChange: true, + allowClear: true + }; + + var select2_handle = el.find( '.redux-container-select_image' ).find( '.select2_params' ); + + if ( select2_handle.size() > 0 ) { + var select2_params = select2_handle.val(); + + select2_params = JSON.parse( select2_params ); + default_params = $.extend( {}, default_params, select2_params ); + } + + el.find( 'select.redux-select-images' ).select2( default_params ); + + el.find( '.redux-select-images' ).on( + 'change', function() { + var preview = $( this ).parents( '.redux-field:first' ).find( '.redux-preview-image' ); + + if ( $( this ).val() === "" ) { + preview.fadeOut( + 'medium', function() { + preview.attr( 'src', '' ); + } + ); + } else { + preview.attr( 'src', $( this ).val() ); + preview.fadeIn().css( 'visibility', 'visible' ); + } + } + ); + } + ); + }; +})( jQuery ); \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/inc/fields/select_image/field_select_image.min.js b/plugins/legacy-admin/framework/core/inc/fields/select_image/field_select_image.min.js new file mode 100644 index 000000000..613a6d88f --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/fields/select_image/field_select_image.min.js @@ -0,0 +1 @@ +!function(a){"use strict";redux.field_objects=redux.field_objects||{},redux.field_objects.select_image=redux.field_objects.select_image||{},a(document).ready(function(){}),redux.field_objects.select_image.init=function(b){b||(b=a(document).find(".redux-group-tab:visible").find(".redux-container-select_image:visible")),a(b).each(function(){var b=a(this),c=b;if(b.hasClass("redux-field-container")||(c=b.parents(".redux-field-container:first")),!c.is(":hidden")&&c.hasClass("redux-field-init")){c.removeClass("redux-field-init");var d={width:"resolve",triggerChange:!0,allowClear:!0},e=b.find(".redux-container-select_image").find(".select2_params");if(e.size()>0){var f=e.val();f=JSON.parse(f),d=a.extend({},d,f)}b.find("select.redux-select-images").select2(d),b.find(".redux-select-images").on("change",function(){var b=a(this).parents(".redux-field:first").find(".redux-preview-image");""===a(this).val()?b.fadeOut("medium",function(){b.attr("src","")}):(b.attr("src",a(this).val()),b.fadeIn().css("visibility","visible"))})}})}}(jQuery); \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/inc/fields/select_image/field_select_image.php b/plugins/legacy-admin/framework/core/inc/fields/select_image/field_select_image.php new file mode 100644 index 000000000..a007d0b07 --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/fields/select_image/field_select_image.php @@ -0,0 +1,176 @@ + + */ + +// Exit if accessed directly +if ( ! defined( 'ABSPATH' ) ) { + exit; +} + +if ( ! class_exists( 'ReduxFramework_select_image' ) ) { + class ReduxFramework_select_image { + + /** + * Field Constructor. + * Required - must call the parent constructor, then assign field and value to vars, and obviously call the render field function + * + * @since ReduxFramework 1.0.0 + */ + function __construct( $field = array(), $value = '', $parent ) { + $this->parent = $parent; + $this->field = $field; + $this->value = $value; + } + + /** + * Field Render Function. + * Takes the vars and outputs the HTML for the field in the settings + * + * @since ReduxFramework 1.0.0 + */ + function render() { + + // If options is NOT empty, the process + if ( ! empty( $this->field['options'] ) ) { + + // Strip off the file ext + if ( isset( $this->value ) ) { + $name = explode( ".", $this->value ); + $name = str_replace( '.' . end( $name ), '', $this->value ); + $name = basename( $name ); + //$this->value = trim( $name ); + $filename = trim($name); + } + + // beancounter + $x = 1; + + // Process width + if ( ! empty( $this->field['width'] ) ) { + $width = ' style="width:' . $this->field['width'] . ';"'; + } else { + $width = ' style="width: 40%;"'; + } + + // Process placeholder + $placeholder = ( isset( $this->field['placeholder'] ) ) ? esc_attr( $this->field['placeholder'] ) : __( 'Select an item', 'legacy_framework' ); + + if ( isset( $this->field['select2'] ) ) { // if there are any let's pass them to js + $select2_params = json_encode( $this->field['select2'] ); + $select2_params = htmlspecialchars( $select2_params, ENT_QUOTES ); + + echo ''; + } + + // Begin the '; + echo ''; + + + // Enum through the options array + foreach ( $this->field['options'] as $k => $v ) { + + // No array? No problem! + if ( ! is_array( $v ) ) { + $v = array( 'img' => $v ); + } + + // No title set? Make it blank. + if ( ! isset( $v['title'] ) ) { + $v['title'] = ''; + } + + // No alt? Set it to title. We do this so the alt tag shows + // something. It also makes HTML/SEO purists happy. + if ( ! isset( $v['alt'] ) ) { + $v['alt'] = $v['title']; + } + + // Set the selected entry + $selected = selected( $this->value, $v['img'], false ); + + // If selected returns something other than a blank space, we + // found our default/saved name. Save the array number in a + // variable to use later on when we want to extract its associted + // url. + if ( '' != $selected ) { + $arrNum = $x; + } + + // Add the option tag, with values. + echo ''; + + // Add a bean + $x ++; + } + + // Close the '; + + // Some space + echo '

    '; + + // Show the preview image. + echo '
    '; + + // just in case. You never know. + if ( ! isset( $arrNum ) ) { + $this->value = ''; + } + + // Set the default image. To get the url from the default name, + // we save the array count from the for/each loop, when the default image + // is mark as selected. Since the for/each loop starts at one, we must + // substract one from the saved array number. We then pull the url + // out of the options array, and there we go. + if ( '' == $this->value ) { + echo ''; + } else { + echo ''; + } + + // Close the
    tag. + echo '
    '; + } else { + + // No options specified. Really? + echo '' . __( 'No items of this type were found.', 'legacy_framework' ) . ''; + } + } //function + + /** + * Enqueue Function. + * If this field requires any scripts, or css define this function and register/enqueue the scripts/css + * + * @since ReduxFramework 1.0.0 + */ + function enqueue() { + wp_enqueue_style( 'select2-css' ); + + wp_enqueue_script( + 'field-select-image-js', + ReduxFramework::$_url . 'inc/fields/select_image/field_select_image' . Redux_Functions::isMin() . '.js', + array('jquery', 'select2-js', 'redux-js'), + time(), + true + ); + + if ($this->parent->args['dev_mode']) { + wp_enqueue_style( + 'redux-field-select-image-css', + ReduxFramework::$_url . 'inc/fields/select_image/field_select_image.css', + array(), + time(), + 'all' + ); + } + } //function + } //class +} \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/inc/fields/select_image/field_select_image.scss b/plugins/legacy-admin/framework/core/inc/fields/select_image/field_select_image.scss new file mode 100644 index 000000000..97e859725 --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/fields/select_image/field_select_image.scss @@ -0,0 +1,19 @@ +.redux-container-select_image { + margin-top: 2px; + margin-left: 5px; + width: 100%; + margin-bottom: 0; +} + +.redux-preview-image { + max-height: 250px; + max-width: 250px; + padding: 5px; + margin-top: 10px; + border: 1px solid #e3e3e3; + background: #f7f7f7; + -moz-border-radius: 3px; + -khtml-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; +} \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/inc/fields/slider/field_slider.css b/plugins/legacy-admin/framework/core/inc/fields/slider/field_slider.css new file mode 100644 index 000000000..dcbeb1c12 --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/fields/slider/field_slider.css @@ -0,0 +1 @@ +.redux-container-slider .redux-slider-container{margin-left:25px;margin-right:25px;width:200px;display:inline-block;vertical-align:middle}.redux-container-slider .redux-slider-input,.redux-container-slider .redux-slider-select-one,.redux-container-slider .redux-slider-select-two{width:100px !important;text-align:center}.redux-container-slider .redux-slider-label{position:absolute;margin-left:-5px}.redux-container-slider .redux-slider-label-one{position:absolute;margin-left:-22px}.redux-container-slider .redux-slider-label-two{position:absolute;margin-top:-21px;margin-left:245px}@media screen and (max-width: 782px){.redux-container-slider input{display:inline-block !important}}@media screen and (max-width: 570px){.redux-container-slider{text-align:center}.redux-container-slider input,.redux-container-slider select,.redux-container-slider .redux-slider-label,.redux-container-slider .select2-container{display:block !important;position:inherit;margin:10px auto}.redux-container-slider .redux-slider-container{margin-top:3px;width:80%}} diff --git a/plugins/legacy-admin/framework/core/inc/fields/slider/field_slider.js b/plugins/legacy-admin/framework/core/inc/fields/slider/field_slider.js new file mode 100644 index 000000000..215f6299b --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/fields/slider/field_slider.js @@ -0,0 +1,268 @@ +/*global redux_change, redux*/ + +(function( $ ) { + "use strict"; + + redux.field_objects = redux.field_objects || {}; + redux.field_objects.slider = redux.field_objects.slider || {}; + + $( document ).ready( + function() { + + } + ); + + redux.field_objects.slider.init = function( selector ) { + + if ( !selector ) { + selector = $( document ).find( ".redux-group-tab:visible" ).find( '.redux-container-slider:visible' ); + } + + $( selector ).each( + function() { + var el = $( this ); + var parent = el; + + if ( !el.hasClass( 'redux-field-container' ) ) { + parent = el.parents( '.redux-field-container:first' ); + } + if ( parent.is( ":hidden" ) ) { // Skip hidden fields + return; + } + if ( parent.hasClass( 'redux-field-init' ) ) { + parent.removeClass( 'redux-field-init' ); + } else { + return; + } + + el.find( 'div.redux-slider-container' ).each( + function() { + + var start, toClass, defClassOne, defClassTwo, connectVal; + var DISPLAY_NONE = 0; + var DISPLAY_LABEL = 1; + var DISPLAY_TEXT = 2; + var DISPLAY_SELECT = 3; + + var mainID = $( this ).data( 'id' ); + var minVal = $( this ).data( 'min' ); + var maxVal = $( this ).data( 'max' ); + var stepVal = $( this ).data( 'step' ); + var handles = $( this ).data( 'handles' ); + var defValOne = $( this ).data( 'default-one' ); + var defValTwo = $( this ).data( 'default-two' ); + var resVal = $( this ).data( 'resolution' ); + var displayValue = parseInt( ($( this ).data( 'display' )) ); + var rtlVal = Boolean( $( this ).data( 'rtl' ) ); + var floatMark = ($( this ).data( 'float-mark' )); + + var rtl; + if ( rtlVal === true ) { + rtl = 'rtl'; + } else { + rtl = 'ltr'; + } + + // range array + var range = [minVal, maxVal]; + + // Set default values for dual slides. + var startTwo = [defValOne, defValTwo]; + + // Set default value for single slide + var startOne = [defValOne]; + + var inputOne, inputTwo; + if ( displayValue == DISPLAY_TEXT ) { + defClassOne = el.find( '.redux-slider-input-one-' + mainID ); + defClassTwo = el.find( '.redux-slider-input-two-' + mainID ); + + inputOne = defClassOne; + inputTwo = defClassTwo; + } else if ( displayValue == DISPLAY_SELECT ) { + defClassOne = el.find( '.redux-slider-select-one-' + mainID ); + defClassTwo = el.find( '.redux-slider-select-two-' + mainID ); + + redux.field_objects.slider.loadSelect( defClassOne, minVal, maxVal, resVal, stepVal ); + + if ( handles === 2 ) { + redux.field_objects.slider.loadSelect( defClassTwo, minVal, maxVal, resVal, stepVal ); + } + + } else if ( displayValue == DISPLAY_LABEL ) { + defClassOne = el.find( '#redux-slider-label-one-' + mainID ); + defClassTwo = el.find( '#redux-slider-label-two-' + mainID ); + } else if ( displayValue == DISPLAY_NONE ) { + defClassOne = el.find( '.redux-slider-value-one-' + mainID ); + defClassTwo = el.find( '.redux-slider-value-two-' + mainID ); + } + + var classOne, classTwo; + if ( displayValue == DISPLAY_LABEL ) { + var x = [defClassOne, 'html']; + var y = [defClassTwo, 'html']; + + classOne = [x]; + classTwo = [x, y]; + } else { + classOne = [defClassOne]; + classTwo = [defClassOne, defClassTwo]; + } + + if ( handles === 2 ) { + start = startTwo; + toClass = classTwo; + connectVal = true; + } else { + start = startOne; + toClass = classOne; + connectVal = 'lower'; + } + + var slider = $( this ).noUiSlider( + { + range: range, + start: start, + handles: handles, + step: stepVal, + connect: connectVal, + behaviour: "tap-drag", + direction: rtl, + serialization: { + resolution: resVal, + to: toClass, + mark: floatMark, + }, + slide: function() { + if ( displayValue == DISPLAY_LABEL ) { + if ( handles === 2 ) { + var inpSliderVal = slider.val(); + el.find( 'input.redux-slider-value-one-' + mainID ).attr( + 'value', inpSliderVal[0] + ); + el.find( 'input.redux-slider-value-two-' + mainID ).attr( + 'value', inpSliderVal[1] + ); + } else { + el.find( 'input.redux-slider-value-one-' + mainID ).attr( + 'value', slider.val() + ); + } + } + + if ( displayValue == DISPLAY_SELECT ) { + if ( handles === 2 ) { + el.find( '.redux-slider-select-one' ).select2( 'val', slider.val()[0] ); + el.find( '.redux-slider-select-two' ).select2( 'val', slider.val()[1] ); + } else { + el.find( '.redux-slider-select-one' ).select2( 'val', slider.val() ); + } + } + + redux_change( $( this ).parents( '.redux-field-container:first' ).find( 'input' ) ); + } + } + ); + + if ( displayValue === DISPLAY_TEXT ) { + inputOne.keydown( + function( e ) { + + var sliderOne = slider.val(); + var value = parseInt( sliderOne[0] ); + + switch ( e.which ) { + case 38: + slider.val( [value + 1, null] ); + break; + case 40: + slider.val( [value - 1, null] ); + break; + case 13: + e.preventDefault(); + break; + } + } + ); + + if ( handles === 2 ) { + inputTwo.keydown( + function( e ) { + var sliderTwo = slider.val(); + var value = parseInt( sliderTwo[1] ); + + switch ( e.which ) { + case 38: + slider.val( [null, value + 1] ); + break; + case 40: + slider.val( [null, value - 1] ); + break; + case 13: + e.preventDefault(); + break; + } + } + ); + } + } + } + ); + + var default_params = { + width: 'resolve', + triggerChange: true, + allowClear: true + }; + + var select2_handle = el.find( '.select2_params' ); + if ( select2_handle.size() > 0 ) { + var select2_params = select2_handle.val(); + + select2_params = JSON.parse( select2_params ); + default_params = $.extend( {}, default_params, select2_params ); + } + + el.find( 'select.redux-slider-select-one, select.redux-slider-select-two' ).select2( default_params ); + + } + ); + + }; + + // Return true for float value, false otherwise + redux.field_objects.slider.isFloat = function( mixed_var ) { + return +mixed_var === mixed_var && (!(isFinite( mixed_var ))) || Boolean( (mixed_var % 1) ); + }; + + // Return number of integers after the decimal point. + redux.field_objects.slider.decimalCount = function( res ) { + var q = res.toString().split( '.' ); + return q[1].length; + }; + + redux.field_objects.slider.loadSelect = function( myClass, min, max, res, step ) { + + //var j = step + ((decCount ) - (step )); // 18; + + for ( var i = min; i <= max; i = i + res ) { + //var step = 2; + + //if (j === (step + ((decCount ) - (step )))) { + var n = i; + if ( redux.field_objects.slider.isFloat( res ) ) { + var decCount = redux.field_objects.slider.decimalCount( res ); + n = i.toFixed( decCount ); + } + + $( myClass ).append( + '' + ); + //j = 0; + //} + //j++; + } + }; + + +})( jQuery ); diff --git a/plugins/legacy-admin/framework/core/inc/fields/slider/field_slider.min.js b/plugins/legacy-admin/framework/core/inc/fields/slider/field_slider.min.js new file mode 100644 index 000000000..aca94ada3 --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/fields/slider/field_slider.min.js @@ -0,0 +1 @@ +!function(a){"use strict";redux.field_objects=redux.field_objects||{},redux.field_objects.slider=redux.field_objects.slider||{},a(document).ready(function(){}),redux.field_objects.slider.init=function(b){b||(b=a(document).find(".redux-group-tab:visible").find(".redux-container-slider:visible")),a(b).each(function(){var b=a(this),c=b;if(b.hasClass("redux-field-container")||(c=b.parents(".redux-field-container:first")),!c.is(":hidden")&&c.hasClass("redux-field-init")){c.removeClass("redux-field-init"),b.find("div.redux-slider-container").each(function(){var c,d,e,f,g,h,i=0,j=1,k=2,l=3,m=a(this).data("id"),n=a(this).data("min"),o=a(this).data("max"),p=a(this).data("step"),q=a(this).data("handles"),r=a(this).data("default-one"),s=a(this).data("default-two"),t=a(this).data("resolution"),u=parseInt(a(this).data("display")),v=Boolean(a(this).data("rtl")),w=a(this).data("float-mark");h=v===!0?"rtl":"ltr";var x,y,z=[n,o],A=[r,s],B=[r];u==k?(e=b.find(".redux-slider-input-one-"+m),f=b.find(".redux-slider-input-two-"+m),x=e,y=f):u==l?(e=b.find(".redux-slider-select-one-"+m),f=b.find(".redux-slider-select-two-"+m),redux.field_objects.slider.loadSelect(e,n,o,t,p),2===q&&redux.field_objects.slider.loadSelect(f,n,o,t,p)):u==j?(e=b.find("#redux-slider-label-one-"+m),f=b.find("#redux-slider-label-two-"+m)):u==i&&(e=b.find(".redux-slider-value-one-"+m),f=b.find(".redux-slider-value-two-"+m));var C,D;if(u==j){var E=[e,"html"],F=[f,"html"];C=[E],D=[E,F]}else C=[e],D=[e,f];2===q?(c=A,d=D,g=!0):(c=B,d=C,g="lower");var G=a(this).noUiSlider({range:z,start:c,handles:q,step:p,connect:g,behaviour:"tap-drag",direction:h,serialization:{resolution:t,to:d,mark:w},slide:function(){if(u==j)if(2===q){var c=G.val();b.find("input.redux-slider-value-one-"+m).attr("value",c[0]),b.find("input.redux-slider-value-two-"+m).attr("value",c[1])}else b.find("input.redux-slider-value-one-"+m).attr("value",G.val());u==l&&(2===q?(b.find(".redux-slider-select-one").select2("val",G.val()[0]),b.find(".redux-slider-select-two").select2("val",G.val()[1])):b.find(".redux-slider-select-one").select2("val",G.val())),redux_change(a(this).parents(".redux-field-container:first").find("input"))}});u===k&&(x.keydown(function(a){var b=G.val(),c=parseInt(b[0]);switch(a.which){case 38:G.val([c+1,null]);break;case 40:G.val([c-1,null]);break;case 13:a.preventDefault()}}),2===q&&y.keydown(function(a){var b=G.val(),c=parseInt(b[1]);switch(a.which){case 38:G.val([null,c+1]);break;case 40:G.val([null,c-1]);break;case 13:a.preventDefault()}}))});var d={width:"resolve",triggerChange:!0,allowClear:!0},e=b.find(".select2_params");if(e.size()>0){var f=e.val();f=JSON.parse(f),d=a.extend({},d,f)}b.find("select.redux-slider-select-one, select.redux-slider-select-two").select2(d)}})},redux.field_objects.slider.isFloat=function(a){return+a===a&&!isFinite(a)||Boolean(a%1)},redux.field_objects.slider.decimalCount=function(a){var b=a.toString().split(".");return b[1].length},redux.field_objects.slider.loadSelect=function(b,c,d,e){for(var f=c;d>=f;f+=e){var g=f;if(redux.field_objects.slider.isFloat(e)){var h=redux.field_objects.slider.decimalCount(e);g=f.toFixed(h)}a(b).append('")}}}(jQuery); \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/inc/fields/slider/field_slider.php b/plugins/legacy-admin/framework/core/inc/fields/slider/field_slider.php new file mode 100644 index 000000000..5935898c0 --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/fields/slider/field_slider.php @@ -0,0 +1,412 @@ +. + * + * @package ReduxFramework + * @subpackage Field_Slider + * @author Kevin Provance (kprovance) + * @version 2.0.0 + */ + +// Exit if accessed directly +if ( ! defined( 'ABSPATH' ) ) { + exit; +} + +if ( ! class_exists( 'ReduxFramework_slider' ) ) { + class ReduxFramework_slider { + + /** + * Field Constructor. + * Required - must call the parent constructor, then assign field and value to vars, and obviously call the render field function + * + * @since ReduxFramework 3.1.8 + */ + private $display_none = 0; + private $display_label = 1; + private $display_text = 2; + private $display_select = 3; + + function __construct( $field = array(), $value = '', $parent ) { + + //parent::__construct( $parent->sections, $parent->args ); + $this->parent = $parent; + $this->field = $field; + $this->value = $value; + + // Set defaults + $defaults = array( + 'handles' => 1, + 'resolution' => 1, + 'display_value' => 'text', + 'float_mark' => '.', + ); + + $this->field = wp_parse_args( $this->field, $defaults ); + + // Sanitize float mark + switch ( $this->field['float_mark'] ) { + case ',': + case '.': + break; + default: + $this->field['float_mark'] = '.'; + break; + } + + // Sanitize resolution value + $this->field['resolution'] = $this->cleanVal( $this->field['resolution'] ); + + // Sanitize handle value + switch ( $this->field['handles'] ) { + case 0: + case 1: + $this->field['handles'] = 1; + break; + default: + $this->field['handles'] = 2; + break; + } + + // Sanitize display value + switch ( $this->field['display_value'] ) { + case 'label': + $this->field['display_value'] = $this->display_label; + break; + case 'text': + default: + $this->field['display_value'] = $this->display_text; + break; + case 'select': + $this->field['display_value'] = $this->display_select; + break; + case 'none': + $this->field['display_value'] = $this->display_none; + break; + } + } + + private function cleanVal( $var ) { + if ( is_float( $var ) ) { + $cleanVar = floatval( $var ); + } else { + $cleanVar = intval( $var ); + } + + return $cleanVar; + } + + private function cleanDefault( $val ) { + if ( empty( $val ) && ! empty( $this->field['default'] ) && $this->cleanVal( $this->field['min'] ) >= 1 ) { + $val = $this->cleanVal( $this->field['default'] ); + } + + if ( empty( $val ) && $this->cleanVal( $this->field['min'] ) >= 1 ) { + $val = $this->cleanVal( $this->field['min'] ); + } + + if ( empty( $val ) ) { + $val = 0; + } + + // Extra Validation + if ( $val < $this->field['min'] ) { + $val = $this->cleanVal( $this->field['min'] ); + } else if ( $val > $this->field['max'] ) { + $val = $this->cleanVal( $this->field['max'] ); + } + + return $val; + } + + private function cleanDefaultArray( $val ) { + $one = $this->value[1]; + $two = $this->value[2]; + + if ( empty( $one ) && ! empty( $this->field['default'][1] ) && $this->cleanVal( $this->field['min'] ) >= 1 ) { + $one = $this->cleanVal( $this->field['default'][1] ); + } + + if ( empty( $one ) && $this->cleanVal( $this->field['min'] ) >= 1 ) { + $one = $this->cleanVal( $this->field['min'] ); + } + + if ( empty( $one ) ) { + $one = 0; + } + + if ( empty( $two ) && ! empty( $this->field['default'][2] ) && $this->cleanVal( $this->field['min'] ) >= 1 ) { + $two = $this->cleanVal( $this->field['default'][1] + 1 ); + } + + if ( empty( $two ) && $this->cleanVal( $this->field['min'] ) >= 1 ) { + $two = $this->cleanVal( $this->field['default'][1] + 1 ); + } + + if ( empty( $two ) ) { + $two = $this->field['default'][1] + 1; + } + + $val[0] = $one; + $val[1] = $two; + + return $val; + } + + + /** + * Clean the field data to the fields defaults given the parameters. + * + * @since Redux_Framework 3.1.8 + */ + function clean() { + + // Set min to 0 if no value is set. + $this->field['min'] = empty( $this->field['min'] ) ? 0 : $this->cleanVal( $this->field['min'] ); + + // Set max to min + 1 if empty. + $this->field['max'] = empty( $this->field['max'] ) ? $this->field['min'] + 1 : $this->cleanVal( $this->field['max'] ); + + // Set step to 1 if step is empty ot step > max. + $this->field['step'] = empty( $this->field['step'] ) || $this->field['step'] > $this->field['max'] ? 1 : $this->cleanVal( $this->field['step'] ); + + if ( 2 == $this->field['handles'] ) { + if ( ! is_array( $this->value ) ) { + $this->value[1] = 0; + $this->value[2] = 1; + } + $this->value = $this->cleanDefaultArray( $this->value ); + } else { + if ( is_array( $this->value ) ) { + $this->value = 0; + } + $this->value = $this->cleanDefault( $this->value ); + } + + // More dummy checks + //if ( ! is_array( $this->field['default'] ) && 2 == $this->field['handles'] ) { + if ( ! is_array( $this->value ) && 2 == $this->field['handles'] ) { + $this->value[0] = $this->field['min']; + $this->value[1] = $this->field['min'] + 1; + } + + //if ( is_array( $this->field['default'] ) && 1 == $this->field['handles'] ) { + if ( is_array( $this->value ) && 1 == $this->field['handles'] ) { + $this->value = $this->field['min']; + } + + } + + /** + * Enqueue Function. + * If this field requires any scripts, or css define this function and register/enqueue the scripts/css + * + * @since ReduxFramework 3.1.8 + */ + function enqueue() { + + $min = Redux_Functions::isMin(); + + wp_enqueue_style( 'select2-css' ); + + wp_enqueue_style( + 'redux-nouislider-css', + ReduxFramework::$_url . 'inc/fields/slider/vendor/nouislider/redux.jquery.nouislider.css', + array(), + '5.0.0', + 'all' + ); + + wp_register_script( + 'redux-nouislider-js', + ReduxFramework::$_url . 'inc/fields/slider/vendor/nouislider/redux.jquery.nouislider' . $min . '.js', + array( 'jquery' ), + '5.0.0', + true + ); + + wp_enqueue_script( + 'redux-field-slider-js', + ReduxFramework::$_url . 'inc/fields/slider/field_slider' . $min . '.js', + array( 'jquery', 'redux-nouislider-js', 'redux-js', 'select2-js' ), + time(), + true + ); + + if ($this->parent->args['dev_mode']) { + wp_enqueue_style( + 'redux-field-slider-css', + ReduxFramework::$_url . 'inc/fields/slider/field_slider.css', + array(), + time(), + 'all' + ); + } + } + + //function + + /** + * Field Render Function. + * Takes the vars and outputs the HTML for the field in the settings + * + * @since ReduxFramework 0.0.4 + */ + function render() { + + $this->clean(); + + $fieldID = $this->field['id']; + $fieldName = $this->field['name'] . $this->field['name_suffix']; + //$fieldName = $this->parent->args['opt_name'] . '[' . $this->field['id'] . ']'; + + // Set handle number variable. + $twoHandles = false; + if ( 2 == $this->field['handles'] ) { + $twoHandles = true; + } + + // Set default values(s) + if ( true == $twoHandles ) { + $valOne = $this->value[0]; + $valTwo = $this->value[1]; + + $html = 'data-default-one="' . $valOne . '" '; + $html .= 'data-default-two="' . $valTwo . '" '; + + $nameOne = $fieldName . '[1]'; + $nameTwo = $fieldName . '[2]'; + + $idOne = $fieldID . '[1]'; + $idTwo = $fieldID . '[2]'; + } else { + $valOne = $this->value; + $valTwo = ''; + + $html = 'data-default-one="' . $valOne . '"'; + + $nameOne = $fieldName; + $nameTwo = ''; + + $idOne = $fieldID; + $idTwo = ''; + } + + $showInput = false; + $showLabel = false; + $showSelect = false; + + // TEXT output + if ( $this->display_text == $this->field['display_value'] ) { + $showInput = true; + echo ''; + + // LABEL output + } elseif ( $this->display_label == $this->field['display_value'] ) { + $showLabel = true; + + $labelNum = $twoHandles ? '-one' : ''; + + echo '
    +
    '; + + // SELECT output + } elseif ( $this->display_select == $this->field['display_value'] ) { + $showSelect = true; + + if ( isset( $this->field['select2'] ) ) { // if there are any let's pass them to js + $select2_params = json_encode( $this->field['select2'] ); + $select2_params = htmlspecialchars( $select2_params, ENT_QUOTES ); + + echo ''; + } + + + echo ''; + } + + // DIV output + echo + '
    +
    '; + + // Double slider output + if ( true == $twoHandles ) { + + // TEXT + if ( true == $showInput ) { + echo ''; + } + + // LABEL + if ( true == $showLabel ) { + echo '
    +
    '; + } + + // SELECT + if ( true == $showSelect ) { + echo ''; + + } + } + + // NO output (input hidden) + if ( $this->display_none == $this->field['display_value'] || $this->display_label == $this->field['display_value'] ) { + echo ''; + + // double slider hidden output + if ( true == $twoHandles ) { + echo ''; + } + } + } + } +} \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/inc/fields/slider/field_slider.scss b/plugins/legacy-admin/framework/core/inc/fields/slider/field_slider.scss new file mode 100644 index 000000000..2887e42bf --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/fields/slider/field_slider.scss @@ -0,0 +1,61 @@ +.redux-container-slider { + .redux-slider-container { + margin-left: 25px; + margin-right: 25px; + width: 200px; + display: inline-block; + vertical-align: middle; + } + + .redux-slider-input, + .redux-slider-select-one, + .redux-slider-select-two { + width: 100px !important; + text-align: center; + } + + .redux-slider-label { + position: absolute; + margin-left: -5px; + } + + .redux-slider-label-one { + position: absolute; + margin-left: -22px; + } + + .redux-slider-label-two { + position: absolute; + margin-top: -21px; + margin-left: 245px; + } +} + +@media screen and (max-width: 782px) { + .redux-container-slider { + input { + display: inline-block !important; + } + } +} + +// Select Slider +@media screen and (max-width: 570px) { + .redux-container-slider { + text-align: center; + + input, + select, + .redux-slider-label, + .select2-container { + display: block !important; + position: inherit; + margin: 10px auto; + } + + .redux-slider-container { + margin-top: 3px; + width: 80%; + } + } +} diff --git a/plugins/legacy-admin/framework/core/inc/fields/slider/vendor/nouislider/redux.jquery.nouislider.css b/plugins/legacy-admin/framework/core/inc/fields/slider/vendor/nouislider/redux.jquery.nouislider.css new file mode 100644 index 000000000..995bbd103 --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/fields/slider/vendor/nouislider/redux.jquery.nouislider.css @@ -0,0 +1,172 @@ + +/* Functional styling; + * These styles are required for noUiSlider to function. + * You don't need to change these rules to apply your design. + */ +.noUi-target, +.noUi-target * { +-webkit-touch-callout: none; +-webkit-user-select: none; +-ms-touch-action: none; +-ms-user-select: none; +-moz-user-select: none; +-moz-box-sizing: border-box; + box-sizing: border-box; +} +.noUi-base { + width: 100%; + height: 100%; + position: relative; +} +.noUi-origin { + position: absolute; + right: 0; + top: 0; + left: 0; + bottom: 0; +} +.noUi-handle { + position: relative; + z-index: 1; +} +.noUi-stacking .noUi-handle { +/* This class is applied to the lower origin when + its values is > 50%. */ + z-index: 10; +} +.noUi-stacking + .noUi-origin { +/* Fix stacking order in IE7, which incorrectly + creates a new context for the origins. */ + *z-index: -1; +} +.noUi-state-tap .noUi-origin { +-webkit-transition: left 0.3s, top 0.3s; + transition: left 0.3s, top 0.3s; +} +.noUi-state-drag * { + cursor: inherit !important; +} + +/* Slider size and handle placement; + */ +.noUi-horizontal { + height: 18px; +} +.noUi-horizontal .noUi-handle { + width: 34px; + height: 28px; + left: -17px; + top: -6px; +} +.noUi-horizontal.noUi-extended { + padding: 0 15px; +} +.noUi-horizontal.noUi-extended .noUi-origin { + right: -15px; +} +.noUi-vertical { + width: 18px; +} +.noUi-vertical .noUi-handle { + width: 28px; + height: 34px; + left: -6px; + top: -17px; +} +.noUi-vertical.noUi-extended { + padding: 15px 0; +} +.noUi-vertical.noUi-extended .noUi-origin { + bottom: -15px; +} + +/* Styling; + */ +.noUi-background { + background: #FAFAFA; + box-shadow: inset 0 1px 1px #f0f0f0; +} +.noUi-connect { + background: #3FB8AF; + box-shadow: inset 0 0 3px rgba(51,51,51,0.45); +-webkit-transition: background 450ms; + transition: background 450ms; +} +.noUi-origin { + border-radius: 2px; +} +.noUi-target { + border-radius: 4px; + border: 1px solid #D3D3D3; + box-shadow: inset 0 1px 1px #F0F0F0, 0 3px 6px -5px #BBB; +} +.noUi-target.noUi-connect { + box-shadow: inset 0 0 3px rgba(51,51,51,0.45), 0 3px 6px -5px #BBB; +} + +/* Handles and cursors; + */ +.noUi-dragable { + cursor: w-resize; +} +.noUi-vertical .noUi-dragable { + cursor: n-resize; +} +.noUi-handle { + border: 1px solid #D9D9D9; + border-radius: 3px; + background: #FFF; + cursor: default; + box-shadow: inset 0 0 1px #FFF, + inset 0 1px 7px #EBEBEB, + 0 3px 6px -3px #BBB; +} +.noUi-active { + box-shadow: inset 0 0 1px #FFF, + inset 0 1px 7px #DDD, + 0 3px 6px -3px #BBB; +} + +/* Handle stripes; + */ +.noUi-handle:before, +.noUi-handle:after { + content: ""; + display: block; + position: absolute; + height: 14px; + width: 1px; + background: #E8E7E6; + left: 14px; + top: 6px; +} +.noUi-handle:after { + left: 17px; +} +.noUi-vertical .noUi-handle:before, +.noUi-vertical .noUi-handle:after { + width: 14px; + height: 1px; + left: 6px; + top: 14px; +} +.noUi-vertical .noUi-handle:after { + top: 17px; +} + +/* Disabled state; + */ +[disabled].noUi-connect, +[disabled] .noUi-connect { + background: #B8B8B8; +} +[disabled] .noUi-handle { + cursor: not-allowed; +} + +/* Blocked state; + */ +.noUi-state-blocked.noUi-connect, +.noUi-state-blocked .noUi-connect { + background: #4FDACF; +} diff --git a/plugins/legacy-admin/framework/core/inc/fields/slider/vendor/nouislider/redux.jquery.nouislider.js b/plugins/legacy-admin/framework/core/inc/fields/slider/vendor/nouislider/redux.jquery.nouislider.js new file mode 100644 index 000000000..4c05d20f8 --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/fields/slider/vendor/nouislider/redux.jquery.nouislider.js @@ -0,0 +1,1420 @@ +/*! $.noUiSlider + @version 5.0.0 + @author Leon Gersen https://twitter.com/LeonGersen + @license WTFPL http://www.wtfpl.net/about/ + @documentation http://refreshless.com/nouislider/ +*/ + +// ==ClosureCompiler== +// @externs_url http://refreshless.com/externs/jquery-1.8.js +// @compilation_level ADVANCED_OPTIMIZATIONS +// @warning_level VERBOSE +// ==/ClosureCompiler== + +/*jshint laxcomma: true */ +/*jshint smarttabs: true */ +/*jshint sub: true */ + +/*jslint browser: true */ +/*jslint continue: true */ +/*jslint plusplus: true */ +/*jslint white: true */ +/*jslint sub: true */ + +(function( $ ){ + + 'use strict'; + + if ( $['zepto'] && !$.fn.removeData ) { + throw new ReferenceError('Zepto is loaded without the data module.'); + } + + $.fn['noUiSlider'] = function( options, rebuild ){ + + var + // Cache the document and body selectors; + doc = $(document) + ,body = $('body') + + // Namespace for binding and unbinding slider events; + ,namespace = '.nui' + + // Copy of the current value function; + ,$VAL = $.fn.val + + // Re-usable list of classes; + ,clsList = [ + /* 0 */ 'noUi-base' + /* 1 */ ,'noUi-origin' + /* 2 */ ,'noUi-handle' + /* 3 */ ,'noUi-input' + /* 4 */ ,'noUi-active' + /* 5 */ ,'noUi-state-tap' + /* 6 */ ,'noUi-target' + /* 7 */ ,'-lower' + /* 8 */ ,'-upper' + /* 9 */ ,'noUi-connect' + /* 10 */ ,'noUi-horizontal' + /* 11 */ ,'noUi-vertical' + /* 12 */ ,'noUi-background' + /* 13 */ ,'noUi-stacking' + /* 14 */ ,'noUi-block' + /* 15 */ ,'noUi-state-blocked' + /* 16 */ ,'noUi-ltr' + /* 17 */ ,'noUi-rtl' + /* 18 */ ,'noUi-dragable' + /* 19 */ ,'noUi-extended' + /* 20 */ ,'noUi-state-drag' + ] + + // Determine the events to bind. IE11 implements pointerEvents without + // a prefix, which breaks compatibility with the IE10 implementation. + ,actions = window.navigator['pointerEnabled'] ? { + start: 'pointerdown' + ,move: 'pointermove' + ,end: 'pointerup' + } : window.navigator['msPointerEnabled'] ? { + start: 'MSPointerDown' + ,move: 'MSPointerMove' + ,end: 'MSPointerUp' + } : { + start: 'mousedown touchstart' + ,move: 'mousemove touchmove' + ,end: 'mouseup touchend' + }; + + +// Percentage calculation + + // (percentage) How many percent is this value of this range? + function fromPercentage ( range, value ) { + return (value * 100) / ( range[1] - range[0] ); + } + + // (percentage) Where is this value on this range? + function toPercentage ( range, value ) { + return fromPercentage( range, range[0] < 0 ? + value + Math.abs(range[0]) : + value - range[0] ); + } + + // (value) How much is this percentage on this range? + function isPercentage ( range, value ) { + return ((value * ( range[1] - range[0] )) / 100) + range[0]; + } + + +// Type tests + + // Test in an object is an instance of jQuery or Zepto. + function isInstance ( a ) { + return a instanceof $ || ( $['zepto'] && $['zepto']['isZ'](a) ); + } + + // Checks whether a value is numerical. + function isNumeric ( a ) { + return !isNaN( parseFloat( a ) ) && isFinite( a ); + } + + +// General helper functions + + // Test an array of objects, and calls them if they are a function. + function call ( functions, scope ) { + + // Allow the passing of an unwrapped function. + // Leaves other code a more comprehensible. + if( !$.isArray( functions ) ){ + functions = [ functions ]; + } + + $.each( functions, function(){ + if (typeof this === 'function') { + this.call(scope); + } + }); + } + + // Returns a proxy to set a target using the public value method. + function setN ( target, number ) { + + return function(){ + + // Determine the correct position to set, + // leave the other one unchanged. + var val = [null, null]; + val[ number ] = $(this).val(); + + // Trigger the 'set' callback + target.val(val, true); + }; + } + + // Round a value to the closest 'to'. + function closest ( value, to ){ + return Math.round(value / to) * to; + } + + // Format output value to specified standards. + function format ( value, options ) { + + // Round the value to the resolution that was set + // with the serialization options. + value = value.toFixed( options['decimals'] ); + + // Rounding away decimals might cause a value of -0 + // when using very small ranges. Remove those cases. + if ( parseFloat(value) === 0 ) { + value = value.replace('-0', '0'); + } + + // Apply the proper decimal mark to the value. + return value.replace( '.', options['serialization']['mark'] ); + } + + // Determine the handle closest to an event. + function closestHandle ( handles, location, style ) { + + if ( handles.length === 1 ) { + return handles[0]; + } + + var total = handles[0].offset()[style] + + handles[1].offset()[style]; + + return handles[ location < total / 2 ? 0 : 1 ]; + } + + // Round away small numbers in floating point implementation. + function digits ( value, round ) { + return parseFloat(value.toFixed(round)); + } + +// Event abstraction + + // Provide a clean event with standardized offset values. + function fixEvent ( e ) { + + // Prevent scrolling and panning on touch events, while + // attempting to slide. The tap event also depends on this. + e.preventDefault(); + + // Filter the event to register the type, which can be + // touch, mouse or pointer. Offset changes need to be + // made on an event specific basis. + var touch = e.type.indexOf('touch') === 0 + ,mouse = e.type.indexOf('mouse') === 0 + ,pointer = e.type.indexOf('pointer') === 0 + ,x,y, event = e; + + // IE10 implemented pointer events with a prefix; + if ( e.type.indexOf('MSPointer') === 0 ) { + pointer = true; + } + + // Get the originalEvent, if the event has been wrapped + // by jQuery. Zepto doesn't wrap the event. + if ( e.originalEvent ) { + e = e.originalEvent; + } + + if ( touch ) { + // noUiSlider supports one movement at a time, + // so we can select the first 'changedTouch'. + x = e.changedTouches[0].pageX; + y = e.changedTouches[0].pageY; + } + if ( mouse || pointer ) { + + // Polyfill the pageXOffset and pageYOffset + // variables for IE7 and IE8; + if( !pointer && window.pageXOffset === undefined ){ + window.pageXOffset = document.documentElement.scrollLeft; + window.pageYOffset = document.documentElement.scrollTop; + } + + x = e.clientX + window.pageXOffset; + y = e.clientY + window.pageYOffset; + } + + return $.extend( event, { + 'pointX': x + ,'pointY': y + ,cursor: mouse + }); + } + + // Handler for attaching events trough a proxy + function attach ( events, element, callback, pass ) { + + var target = pass.target; + + // Add the noUiSlider namespace to all events. + events = events.replace( /\s/g, namespace + ' ' ) + namespace; + + // Bind a closure on the target. + return element.on( events, function( e ){ + + // jQuery and Zepto handle unset attributes differently. + var disabled = target.attr('disabled'); + disabled = !( disabled === undefined || disabled === null ); + + // Test if there is anything that should prevent an event + // from being handled, such as a disabled state or an active + // 'tap' transition. + if( target.hasClass('noUi-state-tap') || disabled ) { + return false; + } + + // Call the event handler with three arguments: + // - The event; + // - An object with data for the event; + // - The slider options; + // Having the slider options as a function parameter prevents + // getting it in every function, which muddies things up. + callback ( + fixEvent( e ) + ,pass + ,target.data('base').data('options') + ); + }); + } + + +// Serialization and value storage + + // Store a value on all serialization targets, or get the current value. + function serialize ( a ) { + + /*jshint validthis: true */ + + // Re-scope target for availability within .each; + var target = this.target; + + // Get the value for this handle + if ( a === undefined ) { + return this.element.data('value'); + } + + // Write the value to all serialization objects + // or store a new value on the handle + if ( a === true ) { + a = this.element.data('value'); + } else { + this.element.data('value', a); + } + + // Prevent a serialization call if the value wasn't initialized. + if ( a === undefined ) { + return; + } + + // If the provided element was a function, + // call it with the slider as scope. Otherwise, + // simply call the function on the object. + $.each( this.elements, function() { + if ( typeof this === 'function' ) { + this.call(target, a); + } else { + this[0][this[1]](a); + } + }); + } + + // Map serialization to [ element, method ]. Attach events where required. + function storeElement ( handle, item, number ) { + + // Add a change event to the supplied jQuery objects, + // which triggers the value-setting function on the target. + if ( isInstance( item ) ) { + + var elements = [], target = handle.data('target'); + + // Link the field to the other handle if the + // slider is inverted. + if ( handle.data('options').direction ) { + number = number ? 0 : 1; + } + + // Loop all items so the change event is properly bound, + // and the items can individually be added to the array. + item.each(function(){ + + // Bind the change event. + $(this).on('change' + namespace, setN( target, number )); + + // Store the element with the proper handler. + elements.push([ $(this), 'val' ]); + }); + + return elements; + } + + // Append a new input to the noUiSlider base. + // Prevent the change event from flowing upward. + if ( typeof item === 'string' ) { + + item = [ $('') + .appendTo(handle) + .addClass(clsList[3]) + .change(function ( e ) { + e.stopPropagation(); + }), 'val']; + } + + return [item]; + } + + // Access point and abstraction for serialization. + function store ( handle, i, serialization ) { + + var elements = []; + + // Loops all items in the provided serialization setting, + // add the proper events to them or create new input fields, + // and add them as data to the handle so they can be kept + // in sync with the slider value. + $.each( serialization['to'][i], function( index ){ + elements = elements.concat( + storeElement( handle, serialization['to'][i][index], i ) + ); + }); + + return { + element: handle + ,elements: elements + ,target: handle.data('target') + ,'val': serialize + }; + } + + +// Handle placement + + // Fire callback on unsuccessful handle movement. + function block ( base, stateless ) { + + var target = base.data('target'); + + if ( !target.hasClass(clsList[14]) ){ + + // The visual effects should not always be applied. + if ( !stateless ) { + target.addClass(clsList[15]); + setTimeout(function(){ + target.removeClass(clsList[15]); + }, 450); + } + + target.addClass(clsList[14]); + call( base.data('options').block, target ); + } + } + + // Change inline style and apply proper classes. + function placeHandle ( handle, to ) { + + var settings = handle.data('options'); + + to = digits(to, 7); + + // If the slider can move, remove the class + // indicating the block state. + handle.data('target').removeClass(clsList[14]); + + // Set handle to new location + handle.css( settings['style'], to + '%' ).data('pct', to); + + // Force proper handle stacking + if ( handle.is(':first-child') ) { + handle.toggleClass(clsList[13], to > 50 ); + } + + if ( settings['direction'] ) { + to = 100 - to; + } + + // Write the value to the serialization object. + handle.data('store').val( + format ( isPercentage( settings['range'], to ), settings ) + ); + } + + // Test suggested values and apply margin, step. + function setHandle ( handle, to ) { + + var base = handle.data('base'), settings = base.data('options'), + handles = base.data('handles'), lower = 0, upper = 100; + + // Catch invalid user input + if ( !isNumeric( to ) ){ + return false; + } + + // Handle the step option. + if ( settings['step'] ){ + to = closest( to, settings['step'] ); + } + + if ( handles.length > 1 ){ + if ( handle[0] !== handles[0][0] ) { + lower = digits(handles[0].data('pct')+settings['margin'],7); + } else { + upper = digits(handles[1].data('pct')-settings['margin'],7); + } + } + + // Limit position to boundaries. When the handles aren't set yet, + // they return -1 as a percentage value. + to = Math.min( Math.max( to, lower ), upper < 0 ? 100 : upper ); + + // Stop handling this call if the handle can't move past another. + // Return an array containing the hit limit, so the caller can + // provide feedback. ( block callback ). + if ( to === handle.data('pct') ) { + return [!lower ? false : lower, upper === 100 ? false : upper]; + } + + placeHandle ( handle, to ); + return true; + } + + // Handles movement by tapping + function jump ( base, handle, to, callbacks ) { + + // Flag the slider as it is now in a transitional state. + // Transition takes 300 ms, so re-enable the slider afterwards. + base.addClass(clsList[5]); + setTimeout(function(){ + base.removeClass(clsList[5]); + }, 300); + + // Move the handle to the new position. + setHandle( handle, to ); + + // Trigger the 'slide' and 'set' callbacks, + // pass the target so that it is 'this'. + call( callbacks, base.data('target') ); + + base.data('target').change(); + } + + +// Event handlers + + // Handle movement on document for handle and range drag. + function move ( event, Dt, Op ) { + + // Map event movement to a slider percentage. + var handles = Dt.handles, limits, + proposal = event[ Dt.point ] - Dt.start[ Dt.point ]; + + proposal = ( proposal * 100 ) / Dt.size; + + if ( handles.length === 1 ) { + + // Run handle placement, receive true for success or an + // array with potential limits. + limits = setHandle( handles[0], Dt.positions[0] + proposal ); + + if ( limits !== true ) { + + if ( $.inArray ( handles[0].data('pct'), limits ) >= 0 ){ + block ( Dt.base, !Op['margin'] ); + } + return; + } + + } else { + + // Dragging the range could be implemented by forcing the + // 'move' event on both handles, but this solution proved + // lagging on slower devices, resulting in range errors. The + // slightly ugly solution below is considerably faster, and + // it can't move the handle out of sync. Bypass the standard + // setting method, as other checks are needed. + + var l1, u1, l2, u2; + + // Round the proposal to the step setting. + if ( Op['step'] ) { + proposal = closest( proposal, Op['step'] ); + } + + // Determine the new position, store it twice. Once for + // limiting, once for checking whether placement should occur. + l1 = l2 = Dt.positions[0] + proposal; + u1 = u2 = Dt.positions[1] + proposal; + + // Round the values within a sensible range. + if ( l1 < 0 ) { + u1 += -1 * l1; + l1 = 0; + } else if ( u1 > 100 ) { + l1 -= ( u1 - 100 ); + u1 = 100; + } + + // Don't perform placement if no handles are to be changed. + // Check if the lowest value is set to zero. + if ( l2 < 0 && !l1 && !handles[0].data('pct') ) { + return; + } + // The highest value is limited to 100%. + if ( u1 === 100 && u2 > 100 && handles[1].data('pct') === 100 ){ + return; + } + + placeHandle ( handles[0], l1 ); + placeHandle ( handles[1], u1 ); + } + + // Trigger the 'slide' event, if the handle was moved. + call( Op['slide'], Dt.target ); + } + + // Unbind move events on document, call callbacks. + function end ( event, Dt, Op ) { + + // The handle is no longer active, so remove the class. + if ( Dt.handles.length === 1 ) { + Dt.handles[0].data('grab').removeClass(clsList[4]); + } + + // Remove cursor styles and text-selection events bound to the body. + if ( event.cursor ) { + body.css('cursor', '').off( namespace ); + } + + // Unbind the move and end events, which are added on 'start'. + doc.off( namespace ); + + // Trigger the change event. + Dt.target.removeClass( clsList[14] +' '+ clsList[20]).change(); + + // Trigger the 'end' callback. + call( Op['set'], Dt.target ); + } + + // Bind move events on document. + function start ( event, Dt, Op ) { + + // Mark the handle as 'active' so it can be styled. + if( Dt.handles.length === 1 ) { + Dt.handles[0].data('grab').addClass(clsList[4]); + } + + // A drag should never propagate up to the 'tap' event. + event.stopPropagation(); + + // Attach the move event. + attach ( actions.move, doc, move, { + start: event + ,base: Dt.base + ,target: Dt.target + ,handles: Dt.handles + ,positions: [ Dt.handles[0].data('pct') + ,Dt.handles[ Dt.handles.length - 1 ].data('pct') ] + ,point: Op['orientation'] ? 'pointY' : 'pointX' + ,size: Op['orientation'] ? Dt.base.height() : Dt.base.width() + }); + + // Unbind all movement when the drag ends. + attach ( actions.end, doc, end, { + target: Dt.target + ,handles: Dt.handles + }); + + // Text selection isn't an issue on touch devices, + // so adding additional callbacks isn't required. + if ( event.cursor ) { + + // Prevent the 'I' cursor and extend the range-drag cursor. + body.css('cursor', $(event.target).css('cursor')); + + // Mark the target with a dragging state. + if ( Dt.handles.length > 1 ) { + Dt.target.addClass(clsList[20]); + } + + // Prevent text selection when dragging the handles. + body.on('selectstart' + namespace, function( ){ + return false; + }); + } + } + + // Move closest handle to tapped location. + function tap ( event, Dt, Op ) { + + var base = Dt.base, handle, to, point, size; + + // The tap event shouldn't propagate up to trigger 'edge'. + event.stopPropagation(); + + // Determine the direction of the slider. + if ( Op['orientation'] ) { + point = event['pointY']; + size = base.height(); + } else { + point = event['pointX']; + size = base.width(); + } + + // Find the closest handle and calculate the tapped point. + handle = closestHandle( base.data('handles'), point, Op['style'] ); + to = (( point - base.offset()[ Op['style'] ] ) * 100 ) / size; + + // The set handle to the new position. + jump( base, handle, to, [ Op['slide'], Op['set'] ]); + } + + // Move handle to edges when target gets tapped. + function edge ( event, Dt, Op ) { + + var handles = Dt.base.data('handles'), to, i; + + i = Op['orientation'] ? event['pointY'] : event['pointX']; + i = i < Dt.base.offset()[Op['style']]; + + to = i ? 0 : 100; + i = i ? 0 : handles.length - 1; + + jump ( Dt.base, handles[i], to, [ Op['slide'], Op['set'] ]); + } + +// API + + // Validate and standardize input. + function test ( input, sliders ){ + + /* Every input option is tested and parsed. This'll prevent + endless validation in internal methods. These tests are + structured with an item for every option available. An + option can be marked as required by setting the 'r' flag. + The testing function is provided with three arguments: + - The provided value for the option; + - A reference to the options object; + - The name for the option; + + The testing function returns false when an error is detected, + or true when everything is OK. It can also modify the option + object, to make sure all values can be correctly looped elsewhere. */ + + function values ( a ) { + + if ( a.length !== 2 ){ + return false; + } + + // Convert the array to floats + a = [ parseFloat(a[0]), parseFloat(a[1]) ]; + + // Test if all values are numerical + if( !isNumeric(a[0]) || !isNumeric(a[1]) ){ + return false; + } + + // The lowest value must really be the lowest value. + if( a[1] < a[0] ){ + return false; + } + + return a; + } + + var serialization = { + resolution: function(q,o){ + + // Parse the syntactic sugar that is the serialization + // resolution option to a usable integer. + // Checking for a string '1', since the resolution needs + // to be cast to a string to split in on the period. + switch( q ){ + case 1: + case 0.1: + case 0.01: + case 0.001: + case 0.0001: + case 0.00001: + q = q.toString().split('.'); + o['decimals'] = q[0] === '1' ? 0 : q[1].length; + break; + case undefined: + o['decimals'] = 2; + break; + default: + return false; + } + + return true; + } + ,mark: function(q,o,w){ + + if ( !q ) { + o[w]['mark'] = '.'; + return true; + } + + switch( q ){ + case '.': + case ',': + return true; + default: + return false; + } + } + ,to: function(q,o,w){ + + // Checks whether a variable is a candidate to be a + // valid serialization target. + function ser(r){ + return isInstance ( r ) || + typeof r === 'string' || + typeof r === 'function' || + r === false || + ( isInstance ( r[0] ) && + typeof r[0][r[1]] === 'function' ); + } + + // Flatten the serialization array into a reliable + // set of elements, which can be tested and looped. + function filter ( value ) { + + var items = [[],[]]; + + // If a single value is provided it can be pushed + // immediately. + if ( ser(value) ) { + items[0].push(value); + } else { + + // Otherwise, determine whether this is an + // array of single elements or sets. + $.each(value, function(i, val) { + + // Don't handle an overflow of elements. + if( i > 1 ){ + return; + } + + // Decide if this is a group or not + if( ser(val) ){ + items[i].push(val); + } else { + items[i] = items[i].concat(val); + } + }); + } + + return items; + } + + if ( !q ) { + o[w]['to'] = [[],[]]; + } else { + + var i, j; + + // Flatten the serialization array + q = filter ( q ); + + // Reverse the API for RTL sliders. + if ( o['direction'] && q[1].length ) { + q.reverse(); + } + + // Test all elements in the flattened array. + for ( i = 0; i < o['handles']; i++ ) { + for ( j = 0; j < q[i].length; j++ ) { + + // Return false on invalid input + if( !ser(q[i][j]) ){ + return false; + } + + // Remove 'false' elements, since those + // won't be handled anyway. + if( !q[i][j] ){ + q[i].splice(j, 1); + } + } + } + + // Write the new values back + o[w]['to'] = q; + } + + return true; + } + }, tests = { + /* Handles. + * Has default, can be 1 or 2. + */ + 'handles': { + 'r': true + ,'t': function(q){ + q = parseInt(q, 10); + return ( q === 1 || q === 2 ); + } + } + /* Range. + * Must be an array of two numerical floats, + * which can't be identical. + */ + ,'range': { + 'r': true + ,'t': function(q,o,w){ + + o[w] = values(q); + + // The values can't be identical. + return o[w] && o[w][0] !== o[w][1]; + } + } + /* Start. + * Must be an array of two numerical floats when handles = 2; + * Uses 'range' test. + * When handles = 1, a single float is also allowed. + */ + ,'start': { + 'r': true + ,'t': function(q,o,w){ + if( o['handles'] === 1 ){ + if( $.isArray(q) ){ + q = q[0]; + } + q = parseFloat(q); + o.start = [q]; + return isNumeric(q); + } + + o[w] = values(q); + return !!o[w]; + } + } + /* Connect. + * Must be true or false when handles = 2; + * Can use 'lower' and 'upper' when handles = 1. + */ + ,'connect': { + 'r': true + ,'t': function(q,o,w){ + + if ( q === 'lower' ) { + o[w] = 1; + } else if ( q === 'upper' ) { + o[w] = 2; + } else if ( q === true ) { + o[w] = 3; + } else if ( q === false ) { + o[w] = 0; + } else { + return false; + } + + return true; + } + } + /* Connect. + * Will default to horizontal, not required. + */ + ,'orientation': { + 't': function(q,o,w){ + switch (q){ + case 'horizontal': + o[w] = 0; + break; + case 'vertical': + o[w] = 1; + break; + default: return false; + } + return true; + } + } + /* Margin. + * Must be a float, has a default value. + */ + ,'margin': { + 'r': true + ,'t': function(q,o,w){ + q = parseFloat(q); + o[w] = fromPercentage(o['range'], q); + return isNumeric(q); + } + } + /* Direction. + * Required, can be 'ltr' or 'rtl'. + */ + ,'direction': { + 'r': true + ,'t': function(q,o,w){ + + switch ( q ) { + case 'ltr': o[w] = 0; + break; + case 'rtl': o[w] = 1; + // Invert connection for RTL sliders; + o['connect'] = [0,2,1,3][o['connect']]; + break; + default: + return false; + } + + return true; + } + } + /* Behaviour. + * Required, defines responses to tapping and + * dragging elements. + */ + ,'behaviour': { + 'r': true + ,'t': function(q,o,w){ + + o[w] = { + 'tap': q !== (q = q.replace('tap', '')) + ,'extend': q !== (q = q.replace('extend', '')) + ,'drag': q !== (q = q.replace('drag', '')) + ,'fixed': q !== (q = q.replace('fixed', '')) + }; + + return !q.replace('none','').replace(/\-/g,''); + } + } + /* Serialization. + * Required, but has default. Must be an array + * when using two handles, can be a single value when using + * one handle. 'mark' can be period (.) or comma (,). + */ + ,'serialization': { + 'r': true + ,'t': function(q,o,w){ + + return serialization.to( q['to'], o, w ) && + serialization.resolution( q['resolution'], o ) && + serialization.mark( q['mark'], o, w ); + } + } + /* Slide. + * Not required. Must be a function. + */ + ,'slide': { + 't': function(q){ + return $.isFunction(q); + } + } + /* Set. + * Not required. Must be a function. + * Tested using the 'slide' test. + */ + ,'set': { + 't': function(q){ + return $.isFunction(q); + } + } + /* Block. + * Not required. Must be a function. + * Tested using the 'slide' test. + */ + ,'block': { + 't': function(q){ + return $.isFunction(q); + } + } + /* Step. + * Not required. + */ + ,'step': { + 't': function(q,o,w){ + q = parseFloat(q); + o[w] = fromPercentage ( o['range'], q ); + return isNumeric(q); + } + } + }; + + $.each( tests, function( name, test ){ + + /*jslint devel: true */ + + var value = input[name], isSet = value !== undefined; + + // If the value is required but not set, fail. + if( ( test['r'] && !isSet ) || + // If the test returns false, fail. + ( isSet && !test['t']( value, input, name ) ) ){ + + // For debugging purposes it might be very useful to know + // what option caused the trouble. Since throwing an error + // will prevent further script execution, log the error + // first. Test for console, as it might not be available. + if( console && console.log && console.group ){ + console.group( 'Invalid noUiSlider initialisation:' ); + console.log( 'Option:\t', name ); + console.log( 'Value:\t', value ); + console.log( 'Slider(s):\t', sliders ); + console.groupEnd(); + } + + throw new RangeError('noUiSlider'); + } + }); + } + + // Parse options, add classes, attach events, create HTML. + function create ( options ) { + + /*jshint validthis: true */ + + // Store the original set of options on all targets, + // so they can be re-used and re-tested later. + // Make sure to break the relation with the options, + // which will be changed by the 'test' function. + this.data('options', $.extend(true, {}, options)); + + // Set defaults where applicable; + options = $.extend({ + 'handles': 2 + ,'margin': 0 + ,'connect': false + ,'direction': 'ltr' + ,'behaviour': 'tap' + ,'orientation': 'horizontal' + }, options); + + // Make sure the test for serialization runs. + options['serialization'] = options['serialization'] || {}; + + // Run all options through a testing mechanism to ensure correct + // input. The test function will throw errors, so there is + // no need to capture the result of this call. It should be noted + // that options might get modified to be handled properly. E.g. + // wrapping integers in arrays. + test( options, this ); + + // Pre-define the styles. + options['style'] = options['orientation'] ? 'top' : 'left'; + + return this.each(function(){ + + var target = $(this), i, dragable, handles = [], handle, + base = $('
    ').appendTo(target); + + // Throw an error if the slider was already initialized. + if ( target.data('base') ) { + throw new Error('Slider was already initialized.'); + } + + // Apply classes and data to the target. + target.data('base', base).addClass([ + clsList[6] + ,clsList[16 + options['direction']] + ,clsList[10 + options['orientation']] ].join(' ')); + + for (i = 0; i < options['handles']; i++ ) { + + handle = $('
    ').appendTo(base); + + // Add all default and option-specific classes to the + // origins and handles. + handle.addClass( clsList[1] ); + + handle.children().addClass([ + clsList[2] + ,clsList[2] + clsList[ 7 + options['direction'] + + ( options['direction'] ? -1 * i : i ) ]].join(' ') ); + + // Make sure every handle has access to all variables. + handle.data({ + 'base': base + ,'target': target + ,'options': options + ,'grab': handle.children() + ,'pct': -1 + }).attr('data-style', options['style']); + + // Every handle has a storage point, which takes care + // of triggering the proper serialization callbacks. + handle.data({ + 'store': store(handle, i, options['serialization']) + }); + + // Store handles on the base + handles.push(handle); + } + + // Apply the required connection classes to the elements + // that need them. Some classes are made up for several + // segments listed in the class list, to allow easy + // renaming and provide a minor compression benefit. + switch ( options['connect'] ) { + case 1: target.addClass( clsList[9] ); + handles[0].addClass( clsList[12] ); + break; + case 3: handles[1].addClass( clsList[12] ); + /* falls through */ + case 2: handles[0].addClass( clsList[9] ); + /* falls through */ + case 0: target.addClass(clsList[12]); + break; + } + + // Merge base classes with default, + // and store relevant data on the base element. + base.addClass( clsList[0] ).data({ + 'target': target + ,'options': options + ,'handles': handles + }); + + // Use the public value method to set the start values. + target.val( options['start'] ); + + // Attach the standard drag event to the handles. + if ( !options['behaviour']['fixed'] ) { + for ( i = 0; i < handles.length; i++ ) { + + // These events are only bound to the visual handle + // element, not the 'real' origin element. + attach ( actions.start, handles[i].children(), start, { + base: base + ,target: target + ,handles: [ handles[i] ] + }); + } + } + + // Attach the tap event to the slider base. + if ( options['behaviour']['tap'] ) { + attach ( actions.start, base, tap, { + base: base + ,target: target + }); + } + + // Extend tapping behaviour to target + if ( options['behaviour']['extend'] ) { + + target.addClass( clsList[19] ); + + if ( options['behaviour']['tap'] ) { + attach ( actions.start, target, edge, { + base: base + ,target: target + }); + } + } + + // Make the range dragable. + if ( options['behaviour']['drag'] ){ + + dragable = base.find('.'+clsList[9]).addClass(clsList[18]); + + // When the range is fixed, the entire range can + // be dragged by the handles. The handle in the first + // origin will propagate the start event upward, + // but it needs to be bound manually on the other. + if ( options['behaviour']['fixed'] ) { + dragable = dragable + .add( base.children().not(dragable).data('grab') ); + } + + attach ( actions.start, dragable, start, { + base: base + ,target: target + ,handles: handles + }); + } + }); + } + + // Return value for the slider, relative to 'range'. + function getValue ( ) { + + /*jshint validthis: true */ + + var base = $(this).data('base'), answer = []; + + // Loop the handles, and get the value from the input + // for every handle on its' own. + $.each( base.data('handles'), function(){ + answer.push( $(this).data('store').val() ); + }); + + // If the slider has just one handle, return a single value. + // Otherwise, return an array, which is in reverse order + // if the slider is used RTL. + if ( answer.length === 1 ) { + return answer[0]; + } + + if ( base.data('options').direction ) { + return answer.reverse(); + } + + return answer; + } + + // Set value for the slider, relative to 'range'. + function setValue ( args, set ) { + + /*jshint validthis: true */ + + // If the value is to be set to a number, which is valid + // when using a one-handle slider, wrap it in an array. + if( !$.isArray(args) ){ + args = [args]; + } + + // Setting is handled properly for each slider in the data set. + return this.each(function(){ + + var b = $(this).data('base'), to, i, + handles = Array.prototype.slice.call(b.data('handles'),0), + settings = b.data('options'); + + // If there are multiple handles to be set run the setting + // mechanism twice for the first handle, to make sure it + // can be bounced of the second one properly. + if ( handles.length > 1) { + handles[2] = handles[0]; + } + + // The RTL settings is implemented by reversing the front-end, + // internal mechanisms are the same. + if ( settings['direction'] ) { + args.reverse(); + } + + for ( i = 0; i < handles.length; i++ ){ + + // Calculate a new position for the handle. + to = args[ i%2 ]; + + // The set request might want to ignore this handle. + // Test for 'undefined' too, as a two-handle slider + // can still be set with an integer. + if( to === null || to === undefined ) { + continue; + } + + // Add support for the comma (,) as a decimal symbol. + // Replace it by a period so it is handled properly by + // parseFloat. Omitting this would result in a removal + // of decimals. This way, the developer can also + // input a comma separated string. + if( $.type(to) === 'string' ) { + to = to.replace(',', '.'); + } + + // Calculate the new handle position + to = toPercentage( settings['range'], parseFloat( to ) ); + + // Invert the value if this is an right-to-left slider. + if ( settings['direction'] ) { + to = 100 - to; + } + + // If the value of the input doesn't match the slider, + // reset it. Sometimes the input is changed to a value the + // slider has rejected. This can occur when using 'select' + // or 'input[type="number"]' elements. In this case, set + // the value back to the input. + if ( setHandle( handles[i], to ) !== true ){ + handles[i].data('store').val( true ); + } + + // Optionally trigger the 'set' event. + if( set === true ) { + call( settings['set'], $(this) ); + } + } + }); + } + + // Unbind all attached events, remove classed and HTML. + function destroy ( target ) { + + // Start the list of elements to be unbound with the target. + var elements = [[target,'']]; + + // Get the fields bound to both handles. + $.each(target.data('base').data('handles'), function(){ + elements = elements.concat( $(this).data('store').elements ); + }); + + // Remove all events added by noUiSlider. + $.each(elements, function(){ + if( this.length > 1 ){ + this[0].off( namespace ); + } + }); + + // Remove all classes from the target. + target.removeClass(clsList.join(' ')); + + // Empty the target and remove all data. + target.empty().removeData('base options'); + } + + // Merge options with current initialization, destroy slider + // and reinitialize. + function build ( options ) { + + /*jshint validthis: true */ + + return this.each(function(){ + + // When uninitialised, jQuery will return '', + // Zepto returns undefined. Both are falsy. + var values = $(this).val() || false, + current = $(this).data('options'), + // Extend the current setup with the new options. + setup = $.extend( {}, current, options ); + + // If there was a slider initialised, remove it first. + if ( values !== false ) { + destroy( $(this) ); + } + + // Make the destroy method publicly accessible. + if( !options ) { + return; + } + + // Create a new slider + $(this)['noUiSlider']( setup ); + + // Set the slider values back. If the start options changed, + // it gets precedence. + if ( values !== false && setup.start === current.start ) { + $(this).val( values ); + } + }); + } + + // Overwrite the native jQuery value function + // with a simple handler. noUiSlider will use the internal + // value method, anything else will use the standard method. + $.fn.val = function(){ + + // If the function is called without arguments, + // act as a 'getter'. Call the getValue function + // in the same scope as this call. + if ( this.hasClass( clsList[6] ) ){ + return arguments.length ? + setValue.apply( this, arguments ) : + getValue.apply( this ); + } + + // If this isn't noUiSlider, continue with jQuery's + // original method. + return $VAL.apply( this, arguments ); + }; + + return ( rebuild ? build : create ).call( this, options ); + }; + +}( window['jQuery'] || window['Zepto'] )); diff --git a/plugins/legacy-admin/framework/core/inc/fields/slider/vendor/nouislider/redux.jquery.nouislider.min.js b/plugins/legacy-admin/framework/core/inc/fields/slider/vendor/nouislider/redux.jquery.nouislider.min.js new file mode 100644 index 000000000..73dfa3ce5 --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/fields/slider/vendor/nouislider/redux.jquery.nouislider.min.js @@ -0,0 +1,20 @@ +(function(f){if(f.zepto&&!f.fn.removeData)throw new ReferenceError("Zepto is loaded without the data module.");f.fn.noUiSlider=function(C,D){function s(a,b){return 100*b/(a[1]-a[0])}function E(a,b){return b*(a[1]-a[0])/100+a[0]}function t(a){return a instanceof f||f.zepto&&f.zepto.isZ(a)}function n(a){return!isNaN(parseFloat(a))&&isFinite(a)}function r(a,b){f.isArray(a)||(a=[a]);f.each(a,function(){"function"===typeof this&&this.call(b)})}function F(a,b){return function(){var c=[null,null];c[b]=f(this).val(); +a.val(c,!0)}}function G(a,b){a=a.toFixed(b.decimals);0===parseFloat(a)&&(a=a.replace("-0","0"));return a.replace(".",b.serialization.mark)}function u(a){return parseFloat(a.toFixed(7))}function p(a,b,c,d){var e=d.target;a=a.replace(/\s/g,h+" ")+h;b.on(a,function(a){var b=e.attr("disabled");if(e.hasClass("noUi-state-tap")||void 0!==b&&null!==b)return!1;var g;a.preventDefault();var b=0===a.type.indexOf("touch"),h=0===a.type.indexOf("mouse"),l=0===a.type.indexOf("pointer"),v,H=a;0===a.type.indexOf("MSPointer")&& +(l=!0);a.originalEvent&&(a=a.originalEvent);b&&(g=a.changedTouches[0].pageX,v=a.changedTouches[0].pageY);if(h||l)l||void 0!==window.pageXOffset||(window.pageXOffset=document.documentElement.scrollLeft,window.pageYOffset=document.documentElement.scrollTop),g=a.clientX+window.pageXOffset,v=a.clientY+window.pageYOffset;g=f.extend(H,{pointX:g,pointY:v,cursor:h});c(g,d,e.data("base").data("options"))})}function I(a){var b=this.target;if(void 0===a)return this.element.data("value");!0===a?a=this.element.data("value"): +this.element.data("value",a);void 0!==a&&f.each(this.elements,function(){if("function"===typeof this)this.call(b,a);else this[0][this[1]](a)})}function J(a,b,c){if(t(b)){var d=[],e=a.data("target");a.data("options").direction&&(c=c?0:1);b.each(function(){f(this).on("change"+h,F(e,c));d.push([f(this),"val"])});return d}"string"===typeof b&&(b=[f('').appendTo(a).addClass(g[3]).change(function(a){a.stopPropagation()}),"val"]);return[b]}function K(a,b,c){var d=[];f.each(c.to[b], +function(e){d=d.concat(J(a,c.to[b][e],b))});return{element:a,elements:d,target:a.data("target"),val:I}}function L(a,b){var c=a.data("target");c.hasClass(g[14])||(b||(c.addClass(g[15]),setTimeout(function(){c.removeClass(g[15])},450)),c.addClass(g[14]),r(a.data("options").h,c))}function w(a,b){var c=a.data("options");b=u(b);a.data("target").removeClass(g[14]);a.css(c.style,b+"%").data("pct",b);a.is(":first-child")&&a.toggleClass(g[13],50k?100:k);if(b===a.data("pct"))return[e?e:!1,100===k?!1:k];w(a,b);return!0}function A(a,b,c,d){a.addClass(g[5]);setTimeout(function(){a.removeClass(g[5])},300);x(b,c);r(d,a.data("target"));a.data("target").change()}function M(a,b,c){var d= +b.a,e=a[b.d]-b.start[b.d],e=100*e/b.size;if(1===d.length){if(a=x(d[0],b.c[0]+e),!0!==a){0<=f.inArray(d[0].data("pct"),a)&&L(b.b,!c.margin);return}}else{var k,m;c.step&&(a=c.step,e=Math.round(e/a)*a);a=k=b.c[0]+e;e=m=b.c[1]+e;0>a?(e+=-1*a,a=0):100k&&!a&&!d[0].data("pct")||100===e&&100").appendTo(b);if(b.data("base"))throw Error("Slider was already initialized.");b.data("base",k).addClass([g[6],g[16+a.direction],g[10+a.orientation]].join(" "));for(c=0;c
    ").appendTo(k),e.addClass(g[1]),e.children().addClass([g[2], +g[2]+g[7+a.direction+(a.direction?-1*c:c)]].join(" ")),e.data({base:k,target:b,options:a,grab:e.children(),pct:-1}).attr("data-style",a.style),e.data({store:K(e,c,a.serialization)}),d.push(e);switch(a.connect){case 1:b.addClass(g[9]);d[0].addClass(g[12]);break;case 3:d[1].addClass(g[12]);case 2:d[0].addClass(g[9]);case 0:b.addClass(g[12])}k.addClass(g[0]).data({target:b,options:a,handles:d});b.val(a.start);if(!a.behaviour.fixed)for(c=0;ch[0]?d+Math.abs(h[0]):d-h[0]);g.direction&&(d=100-d);!0!==x(e[c],d)&&e[c].data("store").val(!0);!0===b&&r(g.set,f(this))}})}function U(a){var b=[[a,""]];f.each(a.data("base").data("handles"), +function(){b=b.concat(f(this).data("store").elements)});f.each(b,function(){1
    + extension_url . 'field_import_export' . Redux_Functions::isMin() . '.js', + array( 'jquery' ), + ReduxFramework_extension_import_export::$version, + true + ); + + wp_enqueue_style( + 'redux-import-export', + $this->extension_url . 'field_import_export.css', + time(), + true + ); + + } + + /** + * Output Function. + * Used to enqueue to the front-end + * + * @since 1.0.0 + * @access public + * @return void + */ + public function output() { + + if ( $this->field['enqueue_frontend'] ) { + + } + + } + + } + } diff --git a/plugins/legacy-admin/framework/core/inc/extensions/import_export/import_export/field_import_export.scss b/plugins/legacy-admin/framework/core/inc/extensions/import_export/import_export/field_import_export.scss new file mode 100644 index 000000000..ca285843d --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/extensions/import_export/import_export/field_import_export.scss @@ -0,0 +1,13 @@ +#redux-import-link-wrapper, +#redux-import-code-wrapper { + display: none; +} + +#redux-export-code, +#redux-export-link-value { + display: none; +} + +#redux-import-action span { + color: #B94A48; +} \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/inc/fields/ace_editor/field_ace_editor.css b/plugins/legacy-admin/framework/core/inc/fields/ace_editor/field_ace_editor.css new file mode 100644 index 000000000..01f9e6f9e --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/fields/ace_editor/field_ace_editor.css @@ -0,0 +1 @@ +.redux-container-ace_editor .ace-wrapper{position:static}.redux-container-ace_editor .ace_editor{height:200px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.redux-container-ace_editor .ace_gutter{z-index:1 !important} diff --git a/plugins/legacy-admin/framework/core/inc/fields/ace_editor/field_ace_editor.js b/plugins/legacy-admin/framework/core/inc/fields/ace_editor/field_ace_editor.js new file mode 100644 index 000000000..4c2e398fe --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/fields/ace_editor/field_ace_editor.js @@ -0,0 +1,58 @@ +/*global jQuery, document, redux*/ + +(function( $ ) { + "use strict"; + + redux.field_objects = redux.field_objects || {}; + redux.field_objects.ace_editor = redux.field_objects.ace_editor || {}; + + redux.field_objects.ace_editor.init = function( selector ) { + if ( !selector ) { + selector = $( document ).find( ".redux-group-tab:visible" ).find( '.redux-container-ace_editor:visible' ); + } + + $( selector ).each( + function() { + var el = $( this ); + var parent = el; + if ( !el.hasClass( 'redux-field-container' ) ) { + parent = el.parents( '.redux-field-container:first' ); + } + if ( parent.is( ":hidden" ) ) { // Skip hidden fields + return; + } + if ( parent.hasClass( 'redux-field-init' ) ) { + parent.removeClass( 'redux-field-init' ); + } else { + return; + } + el.find( '.ace-editor' ).each( + function( index, element ) { + var area = element; + var params = JSON.parse( $( this ).parent().find( '.localize_data' ).val() ); + var editor = $( element ).attr( 'data-editor' ); + + var aceeditor = ace.edit( editor ); + aceeditor.setTheme( "ace/theme/" + jQuery( element ).attr( 'data-theme' ) ); + aceeditor.getSession().setMode( "ace/mode/" + $( element ).attr( 'data-mode' ) ); + var parent = ''; + if ( el.hasClass( 'redux-field-container' ) ) { + parent = el.attr( 'data-id' ); + } else { + parent = el.parents( '.redux-field-container:first' ).attr( 'data-id' ); + } + + aceeditor.setOptions( params ); + aceeditor.on( + 'change', function( e ) { + $( '#' + area.id ).val( aceeditor.getSession().getValue() ); + redux_change( $( element ) ); + aceeditor.resize(); + } + ); + } + ); + } + ); + }; +})( jQuery ); \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/inc/fields/ace_editor/field_ace_editor.min.js b/plugins/legacy-admin/framework/core/inc/fields/ace_editor/field_ace_editor.min.js new file mode 100644 index 000000000..3aef5fbec --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/fields/ace_editor/field_ace_editor.min.js @@ -0,0 +1 @@ +!function(a){"use strict";redux.field_objects=redux.field_objects||{},redux.field_objects.ace_editor=redux.field_objects.ace_editor||{},redux.field_objects.ace_editor.init=function(b){b||(b=a(document).find(".redux-group-tab:visible").find(".redux-container-ace_editor:visible")),a(b).each(function(){var b=a(this),c=b;b.hasClass("redux-field-container")||(c=b.parents(".redux-field-container:first")),c.is(":hidden")||c.hasClass("redux-field-init")&&(c.removeClass("redux-field-init"),b.find(".ace-editor").each(function(c,d){var e=d,f=JSON.parse(a(this).parent().find(".localize_data").val()),g=a(d).attr("data-editor"),h=ace.edit(g);h.setTheme("ace/theme/"+jQuery(d).attr("data-theme")),h.getSession().setMode("ace/mode/"+a(d).attr("data-mode"));var i="";i=b.hasClass("redux-field-container")?b.attr("data-id"):b.parents(".redux-field-container:first").attr("data-id"),h.setOptions(f),h.on("change",function(){a("#"+e.id).val(h.getSession().getValue()),redux_change(a(d)),h.resize()})}))})}}(jQuery); \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/inc/fields/ace_editor/field_ace_editor.php b/plugins/legacy-admin/framework/core/inc/fields/ace_editor/field_ace_editor.php new file mode 100644 index 000000000..58f78ec63 --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/fields/ace_editor/field_ace_editor.php @@ -0,0 +1,132 @@ +. + * + * @package Redux_Field + * @subpackage ACE_Editor + * @version 3.0.0 + */ + +// Exit if accessed directly +if ( ! defined( 'ABSPATH' ) ) { + exit; +} + +// Don't duplicate me! +if ( ! class_exists( 'ReduxFramework_ace_editor' ) ) { + class ReduxFramework_ace_editor { + + /** + * Field Constructor. + * Required - must call the parent constructor, then assign field and value to vars, and obviously call the render field function + * + * @since ReduxFramework 1.0.0 + */ + function __construct( $field = array(), $value = '', $parent ) { + $this->parent = $parent; + $this->field = $field; + $this->value = $value; + + if ( is_array( $this->value ) ) { + $this->value = ''; + } else { + $this->value = trim( $this->value ); + } + + if ( ! empty( $this->field['options'] ) ) { + $this->field['args'] = $this->field['options']; + unset( $this->field['options'] ); + } + + } + + /** + * Field Render Function. + * Takes the vars and outputs the HTML for the field in the settings + * + * @since ReduxFramework 1.0.0 + */ + function render() { + + if ( ! isset( $this->field['mode'] ) ) { + $this->field['mode'] = 'javascript'; + } + if ( ! isset( $this->field['theme'] ) ) { + $this->field['theme'] = 'monokai'; + } + + $params = array( + 'minLines' => 10, + 'maxLines' => 30, + ); + + if ( isset( $this->field['args'] ) && ! empty( $this->field['args'] ) && is_array( $this->field['args'] ) ) { + $params = wp_parse_args( $this->field['args'], $params ); + } + + ?> +
    + + +
    value ); ?>
    +
    + parent->args['dev_mode']) { + wp_enqueue_style( + 'redux-field-ace-editor-css', + ReduxFramework::$_url . 'inc/fields/ace_editor/field_ace_editor.css', + array(), + time(), + 'all' + ); + } + + wp_enqueue_script( + 'ace-editor-js', + ReduxFramework::$_url . 'inc/fields/ace_editor/vendor/ace.js', + array( 'jquery' ), + time(), + true + ); + + wp_enqueue_script( + 'redux-field-ace-editor-js', + ReduxFramework::$_url . 'inc/fields/ace_editor/field_ace_editor' . Redux_Functions::isMin() . '.js', + array( 'jquery', 'ace-editor-js', 'redux-js' ), + time(), + true + ); + } + } +} \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/inc/fields/ace_editor/field_ace_editor.scss b/plugins/legacy-admin/framework/core/inc/fields/ace_editor/field_ace_editor.scss new file mode 100644 index 000000000..77d303717 --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/fields/ace_editor/field_ace_editor.scss @@ -0,0 +1,16 @@ +.redux-container-ace_editor { + .ace-wrapper { + position: static; + } + + .ace_editor { + height: 200px; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + } + + .ace_gutter { + z-index: 1 !important; + } +} \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/ace.js b/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/ace.js new file mode 100644 index 000000000..bd6ce3196 --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/ace.js @@ -0,0 +1,11 @@ +(function(){function s(r){var i=function(e,t){return n("",e,t)},s=e;r&&(e[r]||(e[r]={}),s=e[r]);if(!s.define||!s.define.packaged)t.original=s.define,s.define=t,s.define.packaged=!0;if(!s.require||!s.require.packaged)n.original=s.require,s.require=i,s.require.packaged=!0}var ACE_NAMESPACE = "ace",e=function(){return this}();if(!ACE_NAMESPACE&&typeof requirejs!="undefined")return;var t=function(e,n,r){if(typeof e!="string"){t.original?t.original.apply(window,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&(r=n),t.modules||(t.modules={},t.payloads={}),t.payloads[e]=r,t.modules[e]=null},n=function(e,t,r){if(Object.prototype.toString.call(t)==="[object Array]"){var s=[];for(var o=0,u=t.length;o1&&u(t,"")>-1&&(a=RegExp(this.source,r.replace.call(o(this),"g","")),r.replace.call(e.slice(t.index),a,function(){for(var e=1;et.index&&this.lastIndex--}return t},s||(RegExp.prototype.test=function(e){var t=r.exec.call(this,e);return t&&this.global&&!t[0].length&&this.lastIndex>t.index&&this.lastIndex--,!!t})}),ace.define("ace/lib/es5-shim",["require","exports","module"],function(e,t,n){function r(){}function w(e){try{return Object.defineProperty(e,"sentinel",{}),"sentinel"in e}catch(t){}}function H(e){return e=+e,e!==e?e=0:e!==0&&e!==1/0&&e!==-1/0&&(e=(e>0||-1)*Math.floor(Math.abs(e))),e}function B(e){var t=typeof e;return e===null||t==="undefined"||t==="boolean"||t==="number"||t==="string"}function j(e){var t,n,r;if(B(e))return e;n=e.valueOf;if(typeof n=="function"){t=n.call(e);if(B(t))return t}r=e.toString;if(typeof r=="function"){t=r.call(e);if(B(t))return t}throw new TypeError}Function.prototype.bind||(Function.prototype.bind=function(t){var n=this;if(typeof n!="function")throw new TypeError("Function.prototype.bind called on incompatible "+n);var i=u.call(arguments,1),s=function(){if(this instanceof s){var e=n.apply(this,i.concat(u.call(arguments)));return Object(e)===e?e:this}return n.apply(t,i.concat(u.call(arguments)))};return n.prototype&&(r.prototype=n.prototype,s.prototype=new r,r.prototype=null),s});var i=Function.prototype.call,s=Array.prototype,o=Object.prototype,u=s.slice,a=i.bind(o.toString),f=i.bind(o.hasOwnProperty),l,c,h,p,d;if(d=f(o,"__defineGetter__"))l=i.bind(o.__defineGetter__),c=i.bind(o.__defineSetter__),h=i.bind(o.__lookupGetter__),p=i.bind(o.__lookupSetter__);if([1,2].splice(0).length!=2)if(!function(){function e(e){var t=new Array(e+2);return t[0]=t[1]=0,t}var t=[],n;t.splice.apply(t,e(20)),t.splice.apply(t,e(26)),n=t.length,t.splice(5,0,"XXX"),n+1==t.length;if(n+1==t.length)return!0}())Array.prototype.splice=function(e,t){var n=this.length;e>0?e>n&&(e=n):e==void 0?e=0:e<0&&(e=Math.max(n+e,0)),e+ta)for(h=l;h--;)this[f+h]=this[a+h];if(s&&e===c)this.length=c,this.push.apply(this,i);else{this.length=c+s;for(h=0;h>>0;if(a(t)!="[object Function]")throw new TypeError;while(++s>>0,s=Array(i),o=arguments[1];if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");for(var u=0;u>>0,s=[],o,u=arguments[1];if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");for(var f=0;f>>0,s=arguments[1];if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");for(var o=0;o>>0,s=arguments[1];if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");for(var o=0;o>>0;if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");if(!i&&arguments.length==1)throw new TypeError("reduce of empty array with no initial value");var s=0,o;if(arguments.length>=2)o=arguments[1];else do{if(s in r){o=r[s++];break}if(++s>=i)throw new TypeError("reduce of empty array with no initial value")}while(!0);for(;s>>0;if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");if(!i&&arguments.length==1)throw new TypeError("reduceRight of empty array with no initial value");var s,o=i-1;if(arguments.length>=2)s=arguments[1];else do{if(o in r){s=r[o--];break}if(--o<0)throw new TypeError("reduceRight of empty array with no initial value")}while(!0);do o in this&&(s=t.call(void 0,s,r[o],o,n));while(o--);return s});if(!Array.prototype.indexOf||[0,1].indexOf(1,2)!=-1)Array.prototype.indexOf=function(t){var n=g&&a(this)=="[object String]"?this.split(""):F(this),r=n.length>>>0;if(!r)return-1;var i=0;arguments.length>1&&(i=H(arguments[1])),i=i>=0?i:Math.max(0,r+i);for(;i>>0;if(!r)return-1;var i=r-1;arguments.length>1&&(i=Math.min(i,H(arguments[1]))),i=i>=0?i:r-Math.abs(i);for(;i>=0;i--)if(i in n&&t===n[i])return i;return-1};Object.getPrototypeOf||(Object.getPrototypeOf=function(t){return t.__proto__||(t.constructor?t.constructor.prototype:o)});if(!Object.getOwnPropertyDescriptor){var y="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function(t,n){if(typeof t!="object"&&typeof t!="function"||t===null)throw new TypeError(y+t);if(!f(t,n))return;var r,i,s;r={enumerable:!0,configurable:!0};if(d){var u=t.__proto__;t.__proto__=o;var i=h(t,n),s=p(t,n);t.__proto__=u;if(i||s)return i&&(r.get=i),s&&(r.set=s),r}return r.value=t[n],r}}Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(t){return Object.keys(t)});if(!Object.create){var b;Object.prototype.__proto__===null?b=function(){return{__proto__:null}}:b=function(){var e={};for(var t in e)e[t]=null;return e.constructor=e.hasOwnProperty=e.propertyIsEnumerable=e.isPrototypeOf=e.toLocaleString=e.toString=e.valueOf=e.__proto__=null,e},Object.create=function(t,n){var r;if(t===null)r=b();else{if(typeof t!="object")throw new TypeError("typeof prototype["+typeof t+"] != 'object'");var i=function(){};i.prototype=t,r=new i,r.__proto__=t}return n!==void 0&&Object.defineProperties(r,n),r}}if(Object.defineProperty){var E=w({}),S=typeof document=="undefined"||w(document.createElement("div"));if(!E||!S)var x=Object.defineProperty}if(!Object.defineProperty||x){var T="Property description must be an object: ",N="Object.defineProperty called on non-object: ",C="getters & setters can not be defined on this javascript engine";Object.defineProperty=function(t,n,r){if(typeof t!="object"&&typeof t!="function"||t===null)throw new TypeError(N+t);if(typeof r!="object"&&typeof r!="function"||r===null)throw new TypeError(T+r);if(x)try{return x.call(Object,t,n,r)}catch(i){}if(f(r,"value"))if(d&&(h(t,n)||p(t,n))){var s=t.__proto__;t.__proto__=o,delete t[n],t[n]=r.value,t.__proto__=s}else t[n]=r.value;else{if(!d)throw new TypeError(C);f(r,"get")&&l(t,n,r.get),f(r,"set")&&c(t,n,r.set)}return t}}Object.defineProperties||(Object.defineProperties=function(t,n){for(var r in n)f(n,r)&&Object.defineProperty(t,r,n[r]);return t}),Object.seal||(Object.seal=function(t){return t}),Object.freeze||(Object.freeze=function(t){return t});try{Object.freeze(function(){})}catch(k){Object.freeze=function(t){return function(n){return typeof n=="function"?n:t(n)}}(Object.freeze)}Object.preventExtensions||(Object.preventExtensions=function(t){return t}),Object.isSealed||(Object.isSealed=function(t){return!1}),Object.isFrozen||(Object.isFrozen=function(t){return!1}),Object.isExtensible||(Object.isExtensible=function(t){if(Object(t)===t)throw new TypeError;var n="";while(f(t,n))n+="?";t[n]=!0;var r=f(t,n);return delete t[n],r});if(!Object.keys){var L=!0,A=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],O=A.length;for(var M in{toString:null})L=!1;Object.keys=function I(e){if(typeof e!="object"&&typeof e!="function"||e===null)throw new TypeError("Object.keys called on a non-object");var I=[];for(var t in e)f(e,t)&&I.push(t);if(L)for(var n=0,r=O;n=0?parseFloat((i.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((i.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),t.isOldIE=t.isIE&&t.isIE<9,t.isGecko=t.isMozilla=(window.Controllers||window.controllers)&&window.navigator.product==="Gecko",t.isOldGecko=t.isGecko&&parseInt((i.match(/rv\:(\d+)/)||[])[1],10)<4,t.isOpera=window.opera&&Object.prototype.toString.call(window.opera)=="[object Opera]",t.isWebKit=parseFloat(i.split("WebKit/")[1])||undefined,t.isChrome=parseFloat(i.split(" Chrome/")[1])||undefined,t.isAIR=i.indexOf("AdobeAIR")>=0,t.isIPad=i.indexOf("iPad")>=0,t.isTouchPad=i.indexOf("TouchPad")>=0,t.isChromeOS=i.indexOf(" CrOS ")>=0}),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t,n){"use strict";function o(e,t,n){var o=s(t);if(!i.isMac&&u){if(u[91]||u[92])o|=8;if(u.altGr){if((3&o)==3)return;u.altGr=0}if(n===18||n===17){var f="location"in t?t.location:t.keyLocation;if(n===17&&f===1)a=t.timeStamp;else if(n===18&&o===3&&f===2){var l=-a;a=t.timeStamp,l+=a,l<3&&(u.altGr=!0)}}}if(n in r.MODIFIER_KEYS){switch(r.MODIFIER_KEYS[n]){case"Alt":o=2;break;case"Shift":o=4;break;case"Ctrl":o=1;break;default:o=8}n=-1}o&8&&(n===91||n===93)&&(n=-1);if(!o&&n===13){var f="location"in t?t.location:t.keyLocation;if(f===3){e(t,o,-n);if(t.defaultPrevented)return}}if(i.isChromeOS&&o&8){e(t,o,n);if(t.defaultPrevented)return;o&=-9}return!!o||n in r.FUNCTION_KEYS||n in r.PRINTABLE_KEYS?e(t,o,n):!1}var r=e("./keys"),i=e("./useragent");t.addListener=function(e,t,n){if(e.addEventListener)return e.addEventListener(t,n,!1);if(e.attachEvent){var r=function(){n.call(e,window.event)};n._wrapper=r,e.attachEvent("on"+t,r)}},t.removeListener=function(e,t,n){if(e.removeEventListener)return e.removeEventListener(t,n,!1);e.detachEvent&&e.detachEvent("on"+t,n._wrapper||n)},t.stopEvent=function(e){return t.stopPropagation(e),t.preventDefault(e),!1},t.stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},t.preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},t.getButton=function(e){return e.type=="dblclick"?0:e.type=="contextmenu"||i.isMac&&e.ctrlKey&&!e.altKey&&!e.shiftKey?2:e.preventDefault?e.button:{1:0,2:2,4:1}[e.button]},t.capture=function(e,n,r){function i(e){n&&n(e),r&&r(e),t.removeListener(document,"mousemove",n,!0),t.removeListener(document,"mouseup",i,!0),t.removeListener(document,"dragstart",i,!0)}return t.addListener(document,"mousemove",n,!0),t.addListener(document,"mouseup",i,!0),t.addListener(document,"dragstart",i,!0),i},t.addMouseWheelListener=function(e,n){"onmousewheel"in e?t.addListener(e,"mousewheel",function(e){var t=8;e.wheelDeltaX!==undefined?(e.wheelX=-e.wheelDeltaX/t,e.wheelY=-e.wheelDeltaY/t):(e.wheelX=0,e.wheelY=-e.wheelDelta/t),n(e)}):"onwheel"in e?t.addListener(e,"wheel",function(e){var t=.35;switch(e.deltaMode){case e.DOM_DELTA_PIXEL:e.wheelX=e.deltaX*t||0,e.wheelY=e.deltaY*t||0;break;case e.DOM_DELTA_LINE:case e.DOM_DELTA_PAGE:e.wheelX=(e.deltaX||0)*5,e.wheelY=(e.deltaY||0)*5}n(e)}):t.addListener(e,"DOMMouseScroll",function(e){e.axis&&e.axis==e.HORIZONTAL_AXIS?(e.wheelX=(e.detail||0)*5,e.wheelY=0):(e.wheelX=0,e.wheelY=(e.detail||0)*5),n(e)})},t.addMultiMouseDownListener=function(e,n,r,s){var o=0,u,a,f,l={2:"dblclick",3:"tripleclick",4:"quadclick"};t.addListener(e,"mousedown",function(e){t.getButton(e)!==0?o=0:e.detail>1?(o++,o>4&&(o=1)):o=1;if(i.isIE){var c=Math.abs(e.clientX-u)>5||Math.abs(e.clientY-a)>5;if(!f||c)o=1;f&&clearTimeout(f),f=setTimeout(function(){f=null},n[o-1]||600),o==1&&(u=e.clientX,a=e.clientY)}e._clicks=o,r[s]("mousedown",e);if(o>4)o=0;else if(o>1)return r[s](l[o],e)}),i.isOldIE&&t.addListener(e,"dblclick",function(e){o=2,f&&clearTimeout(f),f=setTimeout(function(){f=null},n[o-1]||600),r[s]("mousedown",e),r[s](l[o],e)})};var s=!i.isMac||!i.isOpera||"KeyboardEvent"in window?function(e){return 0|(e.ctrlKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0)}:function(e){return 0|(e.metaKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.ctrlKey?8:0)};t.getModifierString=function(e){return r.KEY_MODS[s(e)]};var u=null,a=0;t.addCommandKeyListener=function(e,n){var r=t.addListener;if(i.isOldGecko||i.isOpera&&!("KeyboardEvent"in window)){var s=null;r(e,"keydown",function(e){s=e.keyCode}),r(e,"keypress",function(e){return o(n,e,s)})}else{var a=null;r(e,"keydown",function(e){u[e.keyCode]=!0;var t=o(n,e,e.keyCode);return a=e.defaultPrevented,t}),r(e,"keypress",function(e){a&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)&&(t.stopEvent(e),a=null)}),r(e,"keyup",function(e){u[e.keyCode]=null}),u||(u=Object.create(null),r(window,"focus",function(e){u=Object.create(null)}))}};if(window.postMessage&&!i.isOldIE){var f=1;t.nextTick=function(e,n){n=n||window;var r="zero-timeout-message-"+f;t.addListener(n,"message",function i(s){s.data==r&&(t.stopPropagation(s),t.removeListener(n,"message",i),e())}),n.postMessage(r,"*")}}t.nextFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame,t.nextFrame?t.nextFrame=t.nextFrame.bind(window):t.nextFrame=function(e){setTimeout(e,17)}}),ace.define("ace/lib/lang",["require","exports","module"],function(e,t,n){"use strict";t.last=function(e){return e[e.length-1]},t.stringReverse=function(e){return e.split("").reverse().join("")},t.stringRepeat=function(e,t){var n="";while(t>0){t&1&&(n+=e);if(t>>=1)e+=e}return n};var r=/^\s\s*/,i=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(r,"")},t.stringTrimRight=function(e){return e.replace(i,"")},t.copyObject=function(e){var t={};for(var n in e)t[n]=e[n];return t},t.copyArray=function(e){var t=[];for(var n=0,r=e.length;n1),e.preventDefault()},this.startSelect=function(e,t){e=e||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var n=this.editor;n.$blockScrolling++,this.mousedownEvent.getShiftKey()?n.selection.selectToPosition(e):t||n.selection.moveToPosition(e),t||this.select(),n.renderer.scroller.setCapture&&n.renderer.scroller.setCapture(),n.setStyle("ace_selecting"),this.setState("select"),n.$blockScrolling--},this.select=function(){var e,t=this.editor,n=t.renderer.screenToTextCoordinates(this.x,this.y);t.$blockScrolling++;if(this.$clickSelection){var r=this.$clickSelection.comparePoint(n);if(r==-1)e=this.$clickSelection.end;else if(r==1)e=this.$clickSelection.start;else{var i=f(this.$clickSelection,n);n=i.cursor,e=i.anchor}t.selection.setSelectionAnchor(e.row,e.column)}t.selection.selectToPosition(n),t.$blockScrolling--,t.renderer.scrollCursorIntoView()},this.extendSelectionBy=function(e){var t,n=this.editor,r=n.renderer.screenToTextCoordinates(this.x,this.y),i=n.selection[e](r.row,r.column);n.$blockScrolling++;if(this.$clickSelection){var s=this.$clickSelection.comparePoint(i.start),o=this.$clickSelection.comparePoint(i.end);if(s==-1&&o<=0){t=this.$clickSelection.end;if(i.end.row!=r.row||i.end.column!=r.column)r=i.start}else if(o==1&&s>=0){t=this.$clickSelection.start;if(i.start.row!=r.row||i.start.column!=r.column)r=i.end}else if(s==-1&&o==1)r=i.end,t=i.start;else{var u=f(this.$clickSelection,r);r=u.cursor,t=u.anchor}n.selection.setSelectionAnchor(t.row,t.column)}n.selection.selectToPosition(r),n.$blockScrolling--,n.renderer.scrollCursorIntoView()},this.selectEnd=this.selectAllEnd=this.selectByWordsEnd=this.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting"),this.editor.renderer.scroller.releaseCapture&&this.editor.renderer.scroller.releaseCapture()},this.focusWait=function(){var e=a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y),t=Date.now();(e>o||t-this.mousedownEvent.time>this.$focusTimout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},this.onDoubleClick=function(e){var t=e.getDocumentPosition(),n=this.editor,r=n.session,i=r.getBracketRange(t);i?(i.isEmpty()&&(i.start.column--,i.end.column++),this.setState("select")):(i=n.selection.getWordRange(t.row,t.column),this.setState("selectByWords")),this.$clickSelection=i,this.select()},this.onTripleClick=function(e){var t=e.getDocumentPosition(),n=this.editor;this.setState("selectByLines");var r=n.getSelectionRange();r.isMultiLine()&&r.contains(t.row,t.column)?(this.$clickSelection=n.selection.getLineRange(r.start.row),this.$clickSelection.end=n.selection.getLineRange(r.end.row).end):this.$clickSelection=n.selection.getLineRange(t.row),this.select()},this.onQuadClick=function(e){var t=this.editor;t.selectAll(),this.$clickSelection=t.getSelectionRange(),this.setState("selectAll")},this.onMouseWheel=function(e){if(e.getAccelKey())return;e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0);var t=e.domEvent.timeStamp,n=t-(this.$lastScrollTime||0),r=this.editor,i=r.renderer.isScrollableBy(e.wheelX*e.speed,e.wheelY*e.speed);if(i||n<200)return this.$lastScrollTime=t,r.renderer.scrollBy(e.wheelX*e.speed,e.wheelY*e.speed),e.stop()}}).call(u.prototype),t.DefaultHandlers=u}),ace.define("ace/tooltip",["require","exports","module","ace/lib/oop","ace/lib/dom"],function(e,t,n){"use strict";function s(e){this.isOpen=!1,this.$element=null,this.$parentNode=e}var r=e("./lib/oop"),i=e("./lib/dom");(function(){this.$init=function(){return this.$element=i.createElement("div"),this.$element.className="ace_tooltip",this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},this.getElement=function(){return this.$element||this.$init()},this.setText=function(e){i.setInnerText(this.getElement(),e)},this.setHtml=function(e){this.getElement().innerHTML=e},this.setPosition=function(e,t){this.getElement().style.left=e+"px",this.getElement().style.top=t+"px"},this.setClassName=function(e){i.addCssClass(this.getElement(),e)},this.show=function(e,t,n){e!=null&&this.setText(e),t!=null&&n!=null&&this.setPosition(t,n),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},this.hide=function(){this.isOpen&&(this.getElement().style.display="none",this.isOpen=!1)},this.getHeight=function(){return this.getElement().offsetHeight},this.getWidth=function(){return this.getElement().offsetWidth}}).call(s.prototype),t.Tooltip=s}),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event","ace/tooltip"],function(e,t,n){"use strict";function u(e){function l(){var r=u.getDocumentPosition().row,s=n.$annotations[r];if(!s)return c();var o=t.session.getLength();if(r==o){var a=t.renderer.pixelToScreenCoordinates(0,u.y).row,l=u.$pos;if(a>t.session.documentToScreenRow(l.row,l.column))return c()}if(f==s)return;f=s.text.join("
    "),i.setHtml(f),i.show(),t.on("mousewheel",c);if(e.$tooltipFollowsMouse)h(u);else{var p=n.$cells[t.session.documentToScreenRow(r,0)].element,d=p.getBoundingClientRect(),v=i.getElement().style;v.left=d.right+"px",v.top=d.bottom+"px"}}function c(){o&&(o=clearTimeout(o)),f&&(i.hide(),f=null,t.removeEventListener("mousewheel",c))}function h(e){i.setPosition(e.x,e.y)}var t=e.editor,n=t.renderer.$gutterLayer,i=new a(t.container);e.editor.setDefaultHandler("guttermousedown",function(r){if(!t.isFocused()||r.getButton()!=0)return;var i=n.getRegion(r);if(i=="foldWidgets")return;var s=r.getDocumentPosition().row,o=t.session.selection;if(r.getShiftKey())o.selectTo(s,0);else{if(r.domEvent.detail==2)return t.selectAll(),r.preventDefault();e.$clickSelection=t.selection.getLineRange(s)}return e.setState("selectByLines"),e.captureMouse(r),r.preventDefault()});var o,u,f;e.editor.setDefaultHandler("guttermousemove",function(t){var n=t.domEvent.target||t.domEvent.srcElement;if(r.hasCssClass(n,"ace_fold-widget"))return c();f&&e.$tooltipFollowsMouse&&h(t),u=t;if(o)return;o=setTimeout(function(){o=null,u&&!e.isMousePressed?l():c()},50)}),s.addListener(t.renderer.$gutter,"mouseout",function(e){u=null;if(!f||o)return;o=setTimeout(function(){o=null,c()},50)}),t.on("changeSession",c)}function a(e){o.call(this,e)}var r=e("../lib/dom"),i=e("../lib/oop"),s=e("../lib/event"),o=e("../tooltip").Tooltip;i.inherits(a,o),function(){this.setPosition=function(e,t){var n=window.innerWidth||document.documentElement.clientWidth,r=window.innerHeight||document.documentElement.clientHeight,i=this.getWidth(),s=this.getHeight();e+=15,t+=15,e+i>n&&(e-=e+i-n),t+s>r&&(t-=20+s),o.prototype.setPosition.call(this,e,t)}}.call(a.prototype),t.GutterHandler=u}),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/event"),i=e("../lib/useragent"),s=t.MouseEvent=function(e,t){this.domEvent=e,this.editor=t,this.x=this.clientX=e.clientX,this.y=this.clientY=e.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1};(function(){this.stopPropagation=function(){r.stopPropagation(this.domEvent),this.propagationStopped=!0},this.preventDefault=function(){r.preventDefault(this.domEvent),this.defaultPrevented=!0},this.stop=function(){this.stopPropagation(),this.preventDefault()},this.getDocumentPosition=function(){return this.$pos?this.$pos:(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY),this.$pos)},this.inSelection=function(){if(this.$inSelection!==null)return this.$inSelection;var e=this.editor,t=e.getSelectionRange();if(t.isEmpty())this.$inSelection=!1;else{var n=this.getDocumentPosition();this.$inSelection=t.contains(n.row,n.column)}return this.$inSelection},this.getButton=function(){return r.getButton(this.domEvent)},this.getShiftKey=function(){return this.domEvent.shiftKey},this.getAccelKey=i.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}).call(s.prototype)}),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(e,t,n){"use strict";function f(e){function T(e,n){var r=Date.now(),i=!n||e.row!=n.row,s=!n||e.column!=n.column;if(!S||i||s)t.$blockScrolling+=1,t.moveCursorToPosition(e),t.$blockScrolling-=1,S=r,x={x:p,y:d};else{var o=l(x.x,x.y,p,d);o>a?S=null:r-S>=u&&(t.renderer.scrollCursorIntoView(),S=null)}}function N(e,n){var r=Date.now(),i=t.renderer.layerConfig.lineHeight,s=t.renderer.layerConfig.characterWidth,u=t.renderer.scroller.getBoundingClientRect(),a={x:{left:p-u.left,right:u.right-p},y:{top:d-u.top,bottom:u.bottom-d}},f=Math.min(a.x.left,a.x.right),l=Math.min(a.y.top,a.y.bottom),c={row:e.row,column:e.column};f/s<=2&&(c.column+=a.x.left=o&&t.renderer.scrollCursorIntoView(c):E=r:E=null}function C(){var e=g;g=t.renderer.screenToTextCoordinates(p,d),T(g,e),N(g,e)}function k(){m=t.selection.toOrientedRange(),h=t.session.addMarker(m,"ace_selection",t.getSelectionStyle()),t.clearSelection(),t.isFocused()&&t.renderer.$cursorLayer.setBlinking(!1),clearInterval(v),C(),v=setInterval(C,20),y=0,i.addListener(document,"mousemove",O)}function L(){clearInterval(v),t.session.removeMarker(h),h=null,t.$blockScrolling+=1,t.selection.fromOrientedRange(m),t.$blockScrolling-=1,t.isFocused()&&!w&&t.renderer.$cursorLayer.setBlinking(!t.getReadOnly()),m=null,g=null,y=0,E=null,S=null,i.removeListener(document,"mousemove",O)}function O(){A==null&&(A=setTimeout(function(){A!=null&&h&&L()},20))}function M(e){var t=e.types;return!t||Array.prototype.some.call(t,function(e){return e=="text/plain"||e=="Text"})}function _(e){var t=["copy","copymove","all","uninitialized"],n=["move","copymove","linkmove","all","uninitialized"],r=s.isMac?e.altKey:e.ctrlKey,i="uninitialized";try{i=e.dataTransfer.effectAllowed.toLowerCase()}catch(e){}var o="none";return r&&t.indexOf(i)>=0?o="copy":n.indexOf(i)>=0?o="move":t.indexOf(i)>=0&&(o="copy"),o}var t=e.editor,n=r.createElement("img");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",s.isOpera&&(n.style.cssText="width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;");var f=["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"];f.forEach(function(t){e[t]=this[t]},this),t.addEventListener("mousedown",this.onMouseDown.bind(e));var c=t.container,h,p,d,v,m,g,y=0,b,w,E,S,x;this.onDragStart=function(e){if(this.cancelDrag||!c.draggable){var r=this;return setTimeout(function(){r.startSelect(),r.captureMouse(e)},0),e.preventDefault()}m=t.getSelectionRange();var i=e.dataTransfer;i.effectAllowed=t.getReadOnly()?"copy":"copyMove",s.isOpera&&(t.container.appendChild(n),n.scrollTop=0),i.setDragImage&&i.setDragImage(n,0,0),s.isOpera&&t.container.removeChild(n),i.clearData(),i.setData("Text",t.session.getTextRange()),w=!0,this.setState("drag")},this.onDragEnd=function(e){c.draggable=!1,w=!1,this.setState(null);if(!t.getReadOnly()){var n=e.dataTransfer.dropEffect;!b&&n=="move"&&t.session.remove(t.getSelectionRange()),t.renderer.$cursorLayer.setBlinking(!0)}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(e){if(t.getReadOnly()||!M(e.dataTransfer))return;return p=e.clientX,d=e.clientY,h||k(),y++,e.dataTransfer.dropEffect=b=_(e),i.preventDefault(e)},this.onDragOver=function(e){if(t.getReadOnly()||!M(e.dataTransfer))return;return p=e.clientX,d=e.clientY,h||(k(),y++),A!==null&&(A=null),e.dataTransfer.dropEffect=b=_(e),i.preventDefault(e)},this.onDragLeave=function(e){y--;if(y<=0&&h)return L(),b=null,i.preventDefault(e)},this.onDrop=function(e){if(!g)return;var n=e.dataTransfer;if(w)switch(b){case"move":m.contains(g.row,g.column)?m={start:g,end:g}:m=t.moveText(m,g);break;case"copy":m=t.moveText(m,g,!0)}else{var r=n.getData("Text");m={start:g,end:t.session.insert(g,r)},t.focus(),b=null}return L(),i.preventDefault(e)},i.addListener(c,"dragstart",this.onDragStart.bind(e)),i.addListener(c,"dragend",this.onDragEnd.bind(e)),i.addListener(c,"dragenter",this.onDragEnter.bind(e)),i.addListener(c,"dragover",this.onDragOver.bind(e)),i.addListener(c,"dragleave",this.onDragLeave.bind(e)),i.addListener(c,"drop",this.onDrop.bind(e));var A=null}function l(e,t,n,r){return Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2))}var r=e("../lib/dom"),i=e("../lib/event"),s=e("../lib/useragent"),o=200,u=200,a=5;(function(){this.dragWait=function(){var e=Date.now()-this.mousedownEvent.time;e>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){var e=this.editor.container;e.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(e){this.editor.renderer.$cursorLayer.setBlinking(!this.editor.getReadOnly()),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var e=this.editor,t=e.container;t.draggable=!0,e.renderer.$cursorLayer.setBlinking(!1),e.setStyle("ace_dragging");var n=s.isWin?"default":"move";e.renderer.setCursorStyle(n),this.setState("dragReady")},this.onMouseDrag=function(e){var t=this.editor.container;if(s.isIE&&this.state=="dragReady"){var n=l(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);n>3&&t.dragDrop()}if(this.state==="dragWait"){var n=l(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);n>0&&(t.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))}},this.onMouseDown=function(e){if(!this.$dragEnabled)return;this.mousedownEvent=e;var t=this.editor,n=e.inSelection(),r=e.getButton(),i=e.domEvent.detail||1;if(i===1&&r===0&&n){if(e.editor.inMultiSelectMode&&(e.getAccelKey()||e.getShiftKey()))return;this.mousedownEvent.time=Date.now();var o=e.domEvent.target||e.domEvent.srcElement;"unselectable"in o&&(o.unselectable="on");if(t.getDragDelay()){if(s.isWebKit){this.cancelDrag=!0;var u=t.container;u.draggable=!0}this.setState("dragWait")}else this.startDrag();this.captureMouse(e,this.onMouseDrag.bind(this)),e.defaultPrevented=!0}}}).call(f.prototype),t.DragdropHandler=f}),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";var r=e("./dom");t.get=function(e,t){var n=new XMLHttpRequest;n.open("GET",e,!0),n.onreadystatechange=function(){n.readyState===4&&t(n.responseText)},n.send(null)},t.loadScript=function(e,t){var n=r.getDocumentHead(),i=document.createElement("script");i.src=e,n.appendChild(i),i.onload=i.onreadystatechange=function(e,n){if(n||!i.readyState||i.readyState=="loaded"||i.readyState=="complete")i=i.onload=i.onreadystatechange=null,n||t()}},t.qualifyURL=function(e){var t=document.createElement("a");return t.href=e,t.href}}),ace.define("ace/lib/event_emitter",["require","exports","module"],function(e,t,n){"use strict";var r={},i=function(){this.propagationStopped=!0},s=function(){this.defaultPrevented=!0};r._emit=r._dispatchEvent=function(e,t){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var n=this._eventRegistry[e]||[],r=this._defaultHandlers[e];if(!n.length&&!r)return;if(typeof t!="object"||!t)t={};t.type||(t.type=e),t.stopPropagation||(t.stopPropagation=i),t.preventDefault||(t.preventDefault=s),n=n.slice();for(var o=0;o1&&(i=n[n.length-2]);var o=a[t+"Path"];return o==null?o=a.basePath:r=="/"&&(t=r=""),o&&o.slice(-1)!="/"&&(o+="/"),o+t+r+i+this.get("suffix")},t.setModuleUrl=function(e,t){return a.$moduleUrls[e]=t},t.$loading={},t.loadModule=function(n,r){var i,o;Array.isArray(n)&&(o=n[0],n=n[1]);try{i=e(n)}catch(u){}if(i&&!t.$loading[n])return r&&r(i);t.$loading[n]||(t.$loading[n]=[]),t.$loading[n].push(r);if(t.$loading[n].length>1)return;var a=function(){e([n],function(e){t._emit("load.module",{name:n,module:e});var r=t.$loading[n];t.$loading[n]=null,r.forEach(function(t){t&&t(e)})})};if(!t.get("packaged"))return a();s.loadScript(t.moduleUrl(n,o),a)},t.init=f}),ace.define("ace/mouse/mouse_handler",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/mouse/default_handlers","ace/mouse/default_gutter_handler","ace/mouse/mouse_event","ace/mouse/dragdrop_handler","ace/config"],function(e,t,n){"use strict";var r=e("../lib/event"),i=e("../lib/useragent"),s=e("./default_handlers").DefaultHandlers,o=e("./default_gutter_handler").GutterHandler,u=e("./mouse_event").MouseEvent,a=e("./dragdrop_handler").DragdropHandler,f=e("../config"),l=function(e){var t=this;this.editor=e,new s(this),new o(this),new a(this);var n=function(t){(!document.hasFocus||!document.hasFocus())&&window.focus(),e.focus()},u=e.renderer.getMouseEventTarget();r.addListener(u,"click",this.onMouseEvent.bind(this,"click")),r.addListener(u,"mousemove",this.onMouseMove.bind(this,"mousemove")),r.addMultiMouseDownListener(u,[400,300,250],this,"onMouseEvent"),e.renderer.scrollBarV&&(r.addMultiMouseDownListener(e.renderer.scrollBarV.inner,[400,300,250],this,"onMouseEvent"),r.addMultiMouseDownListener(e.renderer.scrollBarH.inner,[400,300,250],this,"onMouseEvent"),i.isIE&&(r.addListener(e.renderer.scrollBarV.element,"mousedown",n),r.addListener(e.renderer.scrollBarH.element,"mousedown",n))),r.addMouseWheelListener(e.container,this.onMouseWheel.bind(this,"mousewheel"));var f=e.renderer.$gutter;r.addListener(f,"mousedown",this.onMouseEvent.bind(this,"guttermousedown")),r.addListener(f,"click",this.onMouseEvent.bind(this,"gutterclick")),r.addListener(f,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick")),r.addListener(f,"mousemove",this.onMouseEvent.bind(this,"guttermousemove")),r.addListener(u,"mousedown",n),r.addListener(f,"mousedown",function(t){return e.focus(),r.preventDefault(t)}),e.on("mousemove",function(n){if(t.state||t.$dragDelay||!t.$dragEnabled)return;var r=e.renderer.screenToTextCoordinates(n.x,n.y),i=e.session.selection.getRange(),s=e.renderer;!i.isEmpty()&&i.insideStart(r.row,r.column)?s.setCursorStyle("default"):s.setCursorStyle("")})};(function(){this.onMouseEvent=function(e,t){this.editor._emit(e,new u(t,this.editor))},this.onMouseMove=function(e,t){var n=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;if(!n||!n.length)return;this.editor._emit(e,new u(t,this.editor))},this.onMouseWheel=function(e,t){var n=new u(t,this.editor);n.speed=this.$scrollSpeed*2,n.wheelX=t.wheelX,n.wheelY=t.wheelY,this.editor._emit(e,n)},this.setState=function(e){this.state=e},this.captureMouse=function(e,t){this.x=e.x,this.y=e.y,this.isMousePressed=!0;var n=this.editor.renderer;n.$keepTextAreaAtCursor&&(n.$keepTextAreaAtCursor=null);var s=this,o=function(e){if(!e)return;if(i.isWebKit&&!e.which&&s.releaseMouse)return s.releaseMouse();s.x=e.clientX,s.y=e.clientY,t&&t(e),s.mouseEvent=new u(e,s.editor),s.$mouseMoved=!0},a=function(e){clearInterval(l),f(),s[s.state+"End"]&&s[s.state+"End"](e),s.state="",n.$keepTextAreaAtCursor==null&&(n.$keepTextAreaAtCursor=!0,n.$moveTextAreaToCursor()),s.isMousePressed=!1,s.$onCaptureMouseMove=s.releaseMouse=null,e&&s.onMouseEvent("mouseup",e)},f=function(){s[s.state]&&s[s.state](),s.$mouseMoved=!1};if(i.isOldIE&&e.domEvent.type=="dblclick")return setTimeout(function(){a(e)});s.$onCaptureMouseMove=o,s.releaseMouse=r.capture(this.editor.container,o,a);var l=setInterval(f,20)},this.releaseMouse=null,this.cancelContextMenu=function(){var e=function(t){if(t&&t.domEvent&&t.domEvent.type!="contextmenu")return;this.editor.off("nativecontextmenu",e),t&&t.domEvent&&r.stopEvent(t.domEvent)}.bind(this);setTimeout(e,10),this.editor.on("nativecontextmenu",e)}}).call(l.prototype),f.defineOptions(l.prototype,"mouseHandler",{scrollSpeed:{initialValue:2},dragDelay:{initialValue:i.isMac?150:0},dragEnabled:{initialValue:!0},focusTimout:{initialValue:0},tooltipFollowsMouse:{initialValue:!0}}),t.MouseHandler=l}),ace.define("ace/mouse/fold_handler",["require","exports","module"],function(e,t,n){"use strict";function r(e){e.on("click",function(t){var n=t.getDocumentPosition(),r=e.session,i=r.getFoldAt(n.row,n.column,1);i&&(t.getAccelKey()?r.removeFold(i):r.expandFold(i),t.stop())}),e.on("gutterclick",function(t){var n=e.renderer.$gutterLayer.getRegion(t);if(n=="foldWidgets"){var r=t.getDocumentPosition().row,i=e.session;i.foldWidgets&&i.foldWidgets[r]&&e.session.onFoldWidgetClick(r,t),e.isFocused()||e.focus(),t.stop()}}),e.on("gutterdblclick",function(t){var n=e.renderer.$gutterLayer.getRegion(t);if(n=="foldWidgets"){var r=t.getDocumentPosition().row,i=e.session,s=i.getParentFoldRangeData(r,!0),o=s.range||s.firstRange;if(o){r=o.start.row;var u=i.getFoldAt(r,i.getLine(r).length,1);u?i.removeFold(u):(i.addFold("...",o),e.renderer.scrollCursorIntoView({row:o.start.row,column:0}))}t.stop()}})}t.FoldHandler=r}),ace.define("ace/keyboard/keybinding",["require","exports","module","ace/lib/keys","ace/lib/event"],function(e,t,n){"use strict";var r=e("../lib/keys"),i=e("../lib/event"),s=function(e){this.$editor=e,this.$data={editor:e},this.$handlers=[],this.setDefaultHandler(e.commands)};(function(){this.setDefaultHandler=function(e){this.removeKeyboardHandler(this.$defaultHandler),this.$defaultHandler=e,this.addKeyboardHandler(e,0)},this.setKeyboardHandler=function(e){var t=this.$handlers;if(t[t.length-1]==e)return;while(t[t.length-1]&&t[t.length-1]!=this.$defaultHandler)this.removeKeyboardHandler(t[t.length-1]);this.addKeyboardHandler(e,1)},this.addKeyboardHandler=function(e,t){if(!e)return;typeof e=="function"&&!e.handleKeyboard&&(e.handleKeyboard=e);var n=this.$handlers.indexOf(e);n!=-1&&this.$handlers.splice(n,1),t==undefined?this.$handlers.push(e):this.$handlers.splice(t,0,e),n==-1&&e.attach&&e.attach(this.$editor)},this.removeKeyboardHandler=function(e){var t=this.$handlers.indexOf(e);return t==-1?!1:(this.$handlers.splice(t,1),e.detach&&e.detach(this.$editor),!0)},this.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]},this.getStatusText=function(){var e=this.$data,t=e.editor;return this.$handlers.map(function(n){return n.getStatusText&&n.getStatusText(t,e)||""}).filter(Boolean).join(" ")},this.$callKeyboardHandlers=function(e,t,n,r){var s,o=!1,u=this.$editor.commands;for(var a=this.$handlers.length;a--;){s=this.$handlers[a].handleKeyboard(this.$data,e,t,n,r);if(!s||!s.command)continue;s.command=="null"?o=!0:o=u.exec(s.command,this.$editor,s.args,r),o&&r&&e!=-1&&s.passEvent!=1&&s.command.passEvent!=1&&i.stopEvent(r);if(o)break}return o},this.onCommandKey=function(e,t,n){var i=r.keyCodeToString(n);this.$callKeyboardHandlers(t,i,n,e)},this.onTextInput=function(e){var t=this.$callKeyboardHandlers(-1,e);t||this.$editor.commands.exec("insertstring",this.$editor,e)}}).call(s.prototype),t.KeyBinding=s}),ace.define("ace/range",["require","exports","module"],function(e,t,n){"use strict";var r=function(e,t){return e.row-t.row||e.column-t.column},i=function(e,t,n,r){this.start={row:e,column:t},this.end={row:n,column:r}};(function(){this.isEqual=function(e){return this.start.row===e.start.row&&this.end.row===e.end.row&&this.start.column===e.start.column&&this.end.column===e.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(e,t){return this.compare(e,t)==0},this.compareRange=function(e){var t,n=e.end,r=e.start;return t=this.compare(n.row,n.column),t==1?(t=this.compare(r.row,r.column),t==1?2:t==0?1:0):t==-1?-2:(t=this.compare(r.row,r.column),t==-1?-1:t==1?42:0)},this.comparePoint=function(e){return this.compare(e.row,e.column)},this.containsRange=function(e){return this.comparePoint(e.start)==0&&this.comparePoint(e.end)==0},this.intersects=function(e){var t=this.compareRange(e);return t==-1||t==0||t==1},this.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},this.isStart=function(e,t){return this.start.row==e&&this.start.column==t},this.setStart=function(e,t){typeof e=="object"?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},this.setEnd=function(e,t){typeof e=="object"?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},this.inside=function(e,t){return this.compare(e,t)==0?this.isEnd(e,t)||this.isStart(e,t)?!1:!0:!1},this.insideStart=function(e,t){return this.compare(e,t)==0?this.isEnd(e,t)?!1:!0:!1},this.insideEnd=function(e,t){return this.compare(e,t)==0?this.isStart(e,t)?!1:!0:!1},this.compare=function(e,t){return!this.isMultiLine()&&e===this.start.row?tthis.end.column?1:0:ethis.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row===e?t<=this.end.column?0:1:0},this.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},this.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.clipRows=function(e,t){if(this.end.row>t)var n={row:t+1,column:0};else if(this.end.rowt)var r={row:t+1,column:0};else if(this.start.rowt.row||e.row==t.row&&e.column>t.column},this.getRange=function(){var e=this.anchor,t=this.lead;return this.isEmpty()?o.fromPoints(t,t):this.isBackwards()?o.fromPoints(t,e):o.fromPoints(e,t)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){var e=this.doc.getLength()-1;this.setSelectionAnchor(0,0),this.moveCursorTo(e,this.doc.getLine(e).length)},this.setRange=this.setSelectionRange=function(e,t){t?(this.setSelectionAnchor(e.end.row,e.end.column),this.selectTo(e.start.row,e.start.column)):(this.setSelectionAnchor(e.start.row,e.start.column),this.selectTo(e.end.row,e.end.column)),this.getRange().isEmpty()&&(this.$isEmpty=!0),this.$desiredColumn=null},this.$moveSelection=function(e){var t=this.lead;this.$isEmpty&&this.setSelectionAnchor(t.row,t.column),e.call(this)},this.selectTo=function(e,t){this.$moveSelection(function(){this.moveCursorTo(e,t)})},this.selectToPosition=function(e){this.$moveSelection(function(){this.moveCursorToPosition(e)})},this.moveTo=function(e,t){this.clearSelection(),this.moveCursorTo(e,t)},this.moveToPosition=function(e){this.clearSelection(),this.moveCursorToPosition(e)},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.getWordRange=function(e,t){if(typeof t=="undefined"){var n=e||this.lead;e=n.row,t=n.column}return this.session.getWordRange(e,t)},this.selectWord=function(){this.setSelectionRange(this.getWordRange())},this.selectAWord=function(){var e=this.getCursor(),t=this.session.getAWordRange(e.row,e.column);this.setSelectionRange(t)},this.getLineRange=function(e,t){var n=typeof e=="number"?e:this.lead.row,r,i=this.session.getFoldLine(n);return i?(n=i.start.row,r=i.end.row):r=n,t===!0?new o(n,0,r,this.session.getLine(r).length):new o(n,0,r+1,0)},this.selectLine=function(){this.setSelectionRange(this.getLineRange())},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.moveCursorLeft=function(){var e=this.lead.getPosition(),t;if(t=this.session.getFoldAt(e.row,e.column,-1))this.moveCursorTo(t.start.row,t.start.column);else if(e.column===0)e.row>0&&this.moveCursorTo(e.row-1,this.doc.getLine(e.row-1).length);else{var n=this.session.getTabSize();this.session.isTabStop(e)&&this.doc.getLine(e.row).slice(e.column-n,e.column).split(" ").length-1==n?this.moveCursorBy(0,-n):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var e=this.lead.getPosition(),t;if(t=this.session.getFoldAt(e.row,e.column,1))this.moveCursorTo(t.end.row,t.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row0&&(t.column=r)}}this.moveCursorTo(t.row,t.column)},this.moveCursorFileEnd=function(){var e=this.doc.getLength()-1,t=this.doc.getLine(e).length;this.moveCursorTo(e,t)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorLongWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),r=n.substring(t),i;this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var s=this.session.getFoldAt(e,t,1);if(s){this.moveCursorTo(s.end.row,s.end.column);return}if(i=this.session.nonTokenRe.exec(r))t+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,r=n.substring(t);if(t>=n.length){this.moveCursorTo(e,n.length),this.moveCursorRight(),e0&&this.moveCursorWordLeft();return}if(o=this.session.tokenRe.exec(s))t-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0;this.moveCursorTo(e,t)},this.$shortWordEndIndex=function(e){var t,n=0,r,i=/\s/,s=this.session.tokenRe;s.lastIndex=0;if(t=this.session.tokenRe.exec(e))n=this.session.tokenRe.lastIndex;else{while((r=e[n])&&i.test(r))n++;if(n<1){s.lastIndex=0;while((r=e[n])&&!s.test(r)){s.lastIndex=0,n++;if(i.test(r)){if(n>2){n--;break}while((r=e[n])&&i.test(r))n++;if(n>2)break}}}}return s.lastIndex=0,n},this.moveCursorShortWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),r=n.substring(t),i=this.session.getFoldAt(e,t,1);if(i)return this.moveCursorTo(i.end.row,i.end.column);if(t==n.length){var s=this.doc.getLength();do e++,r=this.doc.getLine(e);while(e0&&/^\s*$/.test(r));t=r.length,/\s+$/.test(r)||(r="")}var s=i.stringReverse(r),o=this.$shortWordEndIndex(s);return this.moveCursorTo(e,t-o)},this.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},this.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},this.moveCursorBy=function(e,t){var n=this.session.documentToScreenPosition(this.lead.row,this.lead.column);t===0&&(this.$desiredColumn?n.column=this.$desiredColumn:this.$desiredColumn=n.column);var r=this.session.screenToDocumentPosition(n.row+e,n.column);e!==0&&t===0&&r.row===this.lead.row&&r.column===this.lead.column&&this.session.lineWidgets&&this.session.lineWidgets[r.row]&&r.row++,this.moveCursorTo(r.row,r.column+t,t===0)},this.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column)},this.moveCursorTo=function(e,t,n){var r=this.session.getFoldAt(e,t,1);r&&(e=r.start.row,t=r.start.column),this.$keepDesiredColumnOnChange=!0,this.lead.setPosition(e,t),this.$keepDesiredColumnOnChange=!1,n||(this.$desiredColumn=null)},this.moveCursorToScreen=function(e,t,n){var r=this.session.screenToDocumentPosition(e,t);this.moveCursorTo(r.row,r.column,n)},this.detach=function(){this.lead.detach(),this.anchor.detach(),this.session=this.doc=null},this.fromOrientedRange=function(e){this.setSelectionRange(e,e.cursor==e.start),this.$desiredColumn=e.desiredColumn||this.$desiredColumn},this.toOrientedRange=function(e){var t=this.getRange();return e?(e.start.column=t.start.column,e.start.row=t.start.row,e.end.column=t.end.column,e.end.row=t.end.row):e=t,e.cursor=this.isBackwards()?e.start:e.end,e.desiredColumn=this.$desiredColumn,e},this.getRangeOfMovements=function(e){var t=this.getCursor();try{e.call(null,this);var n=this.getCursor();return o.fromPoints(t,n)}catch(r){return o.fromPoints(t,t)}finally{this.moveCursorToPosition(t)}},this.toJSON=function(){if(this.rangeCount)var e=this.ranges.map(function(e){var t=e.clone();return t.isBackwards=e.cursor==e.start,t});else{var e=this.getRange();e.isBackwards=this.isBackwards()}return e},this.fromJSON=function(e){if(e.start==undefined){if(this.rangeList){this.toSingleRange(e[0]);for(var t=e.length;t--;){var n=o.fromPoints(e[t].start,e[t].end);e.isBackwards&&(n.cursor=n.start),this.addRange(n,!0)}return}e=e[0]}this.rangeList&&this.toSingleRange(e),this.setSelectionRange(e,e.isBackwards)},this.isEqual=function(e){if((e.length||this.rangeCount)&&e.length!=this.rangeCount)return!1;if(!e.length||!this.ranges)return this.getRange().isEqual(e);for(var t=this.ranges.length;t--;)if(!this.ranges[t].isEqual(e[t]))return!1;return!0}}).call(u.prototype),t.Selection=u}),ace.define("ace/tokenizer",["require","exports","module","ace/config"],function(e,t,n){"use strict";var r=e("./config"),i=2e3,s=function(e){this.states=e,this.regExps={},this.matchMappings={};for(var t in this.states){var n=this.states[t],r=[],i=0,s=this.matchMappings[t]={defaultToken:"text"},o="g",u=[];for(var a=0;a1?f.onMatch=this.$applyToken:f.onMatch=f.token),c>1&&(/\\\d/.test(f.regex)?l=f.regex.replace(/\\([0-9]+)/g,function(e,t){return"\\"+(parseInt(t,10)+i+1)}):(c=1,l=this.removeCapturingGroups(f.regex)),!f.splitRegex&&typeof f.token!="string"&&u.push(f)),s[i]=a,i+=c,r.push(l),f.onMatch||(f.onMatch=null)}r.length||(s[0]=0,r.push("$")),u.forEach(function(e){e.splitRegex=this.createSplitterRegexp(e.regex,o)},this),this.regExps[t]=new RegExp("("+r.join(")|(")+")|($)",o)}};(function(){this.$setMaxTokenCount=function(e){i=e|0},this.$applyToken=function(e){var t=this.splitRegex.exec(e).slice(1),n=this.token.apply(this,t);if(typeof n=="string")return[{type:n,value:e}];var r=[];for(var i=0,s=n.length;il){var g=e.substring(l,m-v.length);h.type==p?h.value+=g:(h.type&&f.push(h),h={type:p,value:g})}for(var y=0;yi){c>2*e.length&&this.reportError("infinite loop with in ace tokenizer",{startState:t,line:e});while(l1&&n[0]!==r&&n.unshift("#tmp",r),{tokens:f,state:n.length?n:r}},this.reportError=r.reportError}).call(s.prototype),t.Tokenizer=s}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/lang"],function(e,t,n){"use strict";var r=e("../lib/lang"),i=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}};(function(){this.addRules=function(e,t){if(!t){for(var n in e)this.$rules[n]=e[n];return}for(var n in e){var r=e[n];for(var i=0;i=this.$rowTokens.length){this.$row+=1,e||(e=this.$session.getLength());if(this.$row>=e)return this.$row=e-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},this.getCurrentTokenRow=function(){return this.$row},this.getCurrentTokenColumn=function(){var e=this.$rowTokens,t=this.$tokenIndex,n=e[t].start;if(n!==undefined)return n;n=0;while(t>0)t-=1,n+=e[t].value.length;return n}}).call(r.prototype),t.TokenIterator=r}),ace.define("ace/mode/text",["require","exports","module","ace/tokenizer","ace/mode/text_highlight_rules","ace/mode/behaviour","ace/unicode","ace/lib/lang","ace/token_iterator","ace/range"],function(e,t,n){"use strict";var r=e("../tokenizer").Tokenizer,i=e("./text_highlight_rules").TextHighlightRules,s=e("./behaviour").Behaviour,o=e("../unicode"),u=e("../lib/lang"),a=e("../token_iterator").TokenIterator,f=e("../range").Range,l=function(){this.HighlightRules=i,this.$behaviour=new s};(function(){this.tokenRe=new RegExp("^["+o.packages.L+o.packages.Mn+o.packages.Mc+o.packages.Nd+o.packages.Pc+"\\$_]+","g"),this.nonTokenRe=new RegExp("^(?:[^"+o.packages.L+o.packages.Mn+o.packages.Mc+o.packages.Nd+o.packages.Pc+"\\$_]|\\s])+","g"),this.getTokenizer=function(){return this.$tokenizer||(this.$highlightRules=this.$highlightRules||new this.HighlightRules,this.$tokenizer=new r(this.$highlightRules.getRules())),this.$tokenizer},this.lineCommentStart="",this.blockComment="",this.toggleCommentLines=function(e,t,n,r){function w(e){for(var t=n;t<=r;t++)e(i.getLine(t),t)}var i=t.doc,s=!0,o=!0,a=Infinity,f=t.getTabSize(),l=!1;if(!this.lineCommentStart){if(!this.blockComment)return!1;var c=this.blockComment.start,h=this.blockComment.end,p=new RegExp("^(\\s*)(?:"+u.escapeRegExp(c)+")"),d=new RegExp("(?:"+u.escapeRegExp(h)+")\\s*$"),v=function(e,t){if(g(e,t))return;if(!s||/\S/.test(e))i.insertInLine({row:t,column:e.length},h),i.insertInLine({row:t,column:a},c)},m=function(e,t){var n;(n=e.match(d))&&i.removeInLine(t,e.length-n[0].length,e.length),(n=e.match(p))&&i.removeInLine(t,n[1].length,n[0].length)},g=function(e,n){if(p.test(e))return!0;var r=t.getTokens(n);for(var i=0;i2?r%f!=f-1:r%f==0}}var E=Infinity;w(function(e,t){var n=e.search(/\S/);n!==-1?(ne.length&&(E=e.length)}),a==Infinity&&(a=E,s=!1,o=!1),l&&a%f!=0&&(a=Math.floor(a/f)*f),w(o?m:v)},this.toggleBlockComment=function(e,t,n,r){var i=this.blockComment;if(!i)return;!i.start&&i[0]&&(i=i[0]);var s=new a(t,r.row,r.column),o=s.getCurrentToken(),u=t.selection,l=t.selection.toOrientedRange(),c,h;if(o&&/comment/.test(o.type)){var p,d;while(o&&/comment/.test(o.type)){var v=o.value.indexOf(i.start);if(v!=-1){var m=s.getCurrentTokenRow(),g=s.getCurrentTokenColumn()+v;p=new f(m,g,m,g+i.start.length);break}o=s.stepBackward()}var s=new a(t,r.row,r.column),o=s.getCurrentToken();while(o&&/comment/.test(o.type)){var v=o.value.indexOf(i.end);if(v!=-1){var m=s.getCurrentTokenRow(),g=s.getCurrentTokenColumn()+v;d=new f(m,g,m,g+i.end.length);break}o=s.stepForward()}d&&t.remove(d),p&&(t.remove(p),c=p.start.row,h=-i.start.length)}else h=i.start.length,c=n.start.row,t.insert(n.end,i.end),t.insert(n.start,i.start);l.start.row==c&&(l.start.column+=h),l.end.row==c&&(l.end.column+=h),t.selection.fromOrientedRange(l)},this.getNextLineIndent=function(e,t,n){return this.$getIndent(t)},this.checkOutdent=function(e,t,n){return!1},this.autoOutdent=function(e,t,n){},this.$getIndent=function(e){return e.match(/^\s*/)[0]},this.createWorker=function(e){return null},this.createModeDelegates=function(e){this.$embeds=[],this.$modes={};for(var t in e)e[t]&&(this.$embeds.push(t),this.$modes[t]=new e[t]);var n=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"];for(var t=0;tthis.row)return;if(n.start.row==this.row&&n.start.column>this.column)return;var r=this.row,i=this.column,s=n.start,o=n.end;if(t.action==="insertText")if(s.row===r&&s.column<=i){if(s.column!==i||!this.$insertRight)s.row===o.row?i+=o.column-s.column:(i-=s.column,r+=o.row-s.row)}else s.row!==o.row&&s.row=i?i=s.column:i=Math.max(0,i-(o.column-s.column)):s.row!==o.row&&s.row=this.document.getLength()?(n.row=Math.max(0,this.document.getLength()-1),n.column=this.document.getLine(n.row).length):e<0?(n.row=0,n.column=0):(n.row=e,n.column=Math.min(this.document.getLine(n.row).length,Math.max(0,t))),t<0&&(n.column=0),n}}).call(s.prototype)}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/lib/event_emitter","ace/range","ace/anchor"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/event_emitter").EventEmitter,s=e("./range").Range,o=e("./anchor").Anchor,u=function(e){this.$lines=[],e.length===0?this.$lines=[""]:Array.isArray(e)?this._insertLines(0,e):this.insert({row:0,column:0},e)};(function(){r.implement(this,i),this.setValue=function(e){var t=this.getLength();this.remove(new s(0,0,t,this.getLine(t-1).length)),this.insert({row:0,column:0},e)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(e,t){return new o(this,e,t)},"aaa".split(/a/).length===0?this.$split=function(e){return e.replace(/\r\n|\r/g,"\n").split("\n")}:this.$split=function(e){return e.split(/\r\n|\r|\n/)},this.$detectNewLine=function(e){var t=e.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=t?t[1]:"\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(e){if(this.$newLineMode===e)return;this.$newLineMode=e,this._signal("changeNewLineMode")},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(e){return e=="\r\n"||e=="\r"||e=="\n"},this.getLine=function(e){return this.$lines[e]||""},this.getLines=function(e,t){return this.$lines.slice(e,t+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(e){if(e.start.row==e.end.row)return this.getLine(e.start.row).substring(e.start.column,e.end.column);var t=this.getLines(e.start.row,e.end.row);t[0]=(t[0]||"").substring(e.start.column);var n=t.length-1;return e.end.row-e.start.row==n&&(t[n]=t[n].substring(0,e.end.column)),t.join(this.getNewLineCharacter())},this.$clipPosition=function(e){var t=this.getLength();return e.row>=t?(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length):e.row<0&&(e.row=0),e},this.insert=function(e,t){if(!t||t.length===0)return e;e=this.$clipPosition(e),this.getLength()<=1&&this.$detectNewLine(t);var n=this.$split(t),r=n.splice(0,1)[0],i=n.length==0?null:n.splice(n.length-1,1)[0];return e=this.insertInLine(e,r),i!==null&&(e=this.insertNewLine(e),e=this._insertLines(e.row,n),e=this.insertInLine(e,i||"")),e},this.insertLines=function(e,t){return e>=this.getLength()?this.insert({row:e,column:0},"\n"+t.join("\n")):this._insertLines(Math.max(e,0),t)},this._insertLines=function(e,t){if(t.length==0)return{row:e,column:0};while(t.length>61440){var n=this._insertLines(e,t.slice(0,61440));t=t.slice(61440),e=n.row}var r=[e,0];r.push.apply(r,t),this.$lines.splice.apply(this.$lines,r);var i=new s(e,0,e+t.length,0),o={action:"insertLines",range:i,lines:t};return this._signal("change",{data:o}),i.end},this.insertNewLine=function(e){e=this.$clipPosition(e);var t=this.$lines[e.row]||"";this.$lines[e.row]=t.substring(0,e.column),this.$lines.splice(e.row+1,0,t.substring(e.column,t.length));var n={row:e.row+1,column:0},r={action:"insertText",range:s.fromPoints(e,n),text:this.getNewLineCharacter()};return this._signal("change",{data:r}),n},this.insertInLine=function(e,t){if(t.length==0)return e;var n=this.$lines[e.row]||"";this.$lines[e.row]=n.substring(0,e.column)+t+n.substring(e.column);var r={row:e.row,column:e.column+t.length},i={action:"insertText",range:s.fromPoints(e,r),text:t};return this._signal("change",{data:i}),r},this.remove=function(e){e instanceof s||(e=s.fromPoints(e.start,e.end)),e.start=this.$clipPosition(e.start),e.end=this.$clipPosition(e.end);if(e.isEmpty())return e.start;var t=e.start.row,n=e.end.row;if(e.isMultiLine()){var r=e.start.column==0?t:t+1,i=n-1;e.end.column>0&&this.removeInLine(n,0,e.end.column),i>=r&&this._removeLines(r,i),r!=t&&(this.removeInLine(t,e.start.column,this.getLine(t).length),this.removeNewLine(e.start.row))}else this.removeInLine(t,e.start.column,e.end.column);return e.start},this.removeInLine=function(e,t,n){if(t==n)return;var r=new s(e,t,e,n),i=this.getLine(e),o=i.substring(t,n),u=i.substring(0,t)+i.substring(n,i.length);this.$lines.splice(e,1,u);var a={action:"removeText",range:r,text:o};return this._signal("change",{data:a}),r.start},this.removeLines=function(e,t){return e<0||t>=this.getLength()?this.remove(new s(e,0,t+1,0)):this._removeLines(e,t)},this._removeLines=function(e,t){var n=new s(e,0,t+1,0),r=this.$lines.splice(e,t-e+1),i={action:"removeLines",range:n,nl:this.getNewLineCharacter(),lines:r};return this._signal("change",{data:i}),r},this.removeNewLine=function(e){var t=this.getLine(e),n=this.getLine(e+1),r=new s(e,t.length,e+1,0),i=t+n;this.$lines.splice(e,2,i);var o={action:"removeText",range:r,text:this.getNewLineCharacter()};this._signal("change",{data:o})},this.replace=function(e,t){e instanceof s||(e=s.fromPoints(e.start,e.end));if(t.length==0&&e.isEmpty())return e.start;if(t==this.getTextRange(e))return e.end;this.remove(e);if(t)var n=this.insert(e.start,t);else n=e.start;return n},this.applyDeltas=function(e){for(var t=0;t=0;t--){var n=e[t],r=s.fromPoints(n.range.start,n.range.end);n.action=="insertLines"?this._removeLines(r.start.row,r.end.row-1):n.action=="insertText"?this.remove(r):n.action=="removeLines"?this._insertLines(r.start.row,n.lines):n.action=="removeText"&&this.insert(r.start,n.text)}},this.indexToPosition=function(e,t){var n=this.$lines||this.getAllLines(),r=this.getNewLineCharacter().length;for(var i=t||0,s=n.length;i20){n.running=setTimeout(n.$worker,20);break}}n.currentLine=t,s<=r&&n.fireUpdateEvent(s,r)}};(function(){r.implement(this,i),this.setTokenizer=function(e){this.tokenizer=e,this.lines=[],this.states=[],this.start(0)},this.setDocument=function(e){this.doc=e,this.lines=[],this.states=[],this.stop()},this.fireUpdateEvent=function(e,t){var n={first:e,last:t};this._signal("update",{data:n})},this.start=function(e){this.currentLine=Math.min(e||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},this.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},this.$updateOnChange=function(e){var t=e.range,n=t.start.row,r=t.end.row-n;if(r===0)this.lines[n]=null;else if(e.action=="removeText"||e.action=="removeLines")this.lines.splice(n,r+1,null),this.states.splice(n,r+1,null);else{var i=Array(r+1);i.unshift(n,1),this.lines.splice.apply(this.lines,i),this.states.splice.apply(this.states,i)}this.currentLine=Math.min(n,this.currentLine,this.doc.getLength()),this.stop()},this.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},this.getTokens=function(e){return this.lines[e]||this.$tokenizeRow(e)},this.getState=function(e){return this.currentLine==e&&this.$tokenizeRow(e),this.states[e]||"start"},this.$tokenizeRow=function(e){var t=this.doc.getLine(e),n=this.states[e-1],r=this.tokenizer.getLineTokens(t,n,e);return this.states[e]+""!=r.state+""?(this.states[e]=r.state,this.lines[e+1]=null,this.currentLine>e+1&&(this.currentLine=e+1)):this.currentLine==e&&(this.currentLine=e+1),this.lines[e]=r.tokens}}).call(s.prototype),t.BackgroundTokenizer=s}),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,n){"use strict";var r=e("./lib/lang"),i=e("./lib/oop"),s=e("./range").Range,o=function(e,t,n){this.setRegexp(e),this.clazz=t,this.type=n||"text"};(function(){this.MAX_RANGES=500,this.setRegexp=function(e){if(this.regExp+""==e+"")return;this.regExp=e,this.cache=[]},this.update=function(e,t,n,i){if(!this.regExp)return;var o=i.firstRow,u=i.lastRow;for(var a=o;a<=u;a++){var f=this.cache[a];f==null&&(f=r.getMatchOffsets(n.getLine(a),this.regExp),f.length>this.MAX_RANGES&&(f=f.slice(0,this.MAX_RANGES)),f=f.map(function(e){return new s(a,e.offset,a,e.offset+e.length)}),this.cache[a]=f.length?f:"");for(var l=f.length;l--;)t.drawSingleLineMarker(e,f[l].toScreenRange(n),this.clazz,i)}}}).call(o.prototype),t.SearchHighlight=o}),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(e,t,n){"use strict";function i(e,t){this.foldData=e,Array.isArray(t)?this.folds=t:t=this.folds=[t];var n=t[t.length-1];this.range=new r(t[0].start.row,t[0].start.column,n.end.row,n.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(e){e.setFoldLine(this)},this)}var r=e("../range").Range;(function(){this.shiftRow=function(e){this.start.row+=e,this.end.row+=e,this.folds.forEach(function(t){t.start.row+=e,t.end.row+=e})},this.addFold=function(e){if(e.sameRow){if(e.start.rowthis.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(e),this.folds.sort(function(e,t){return-e.range.compareEnd(t.start.row,t.start.column)}),this.range.compareEnd(e.start.row,e.start.column)>0?(this.end.row=e.end.row,this.end.column=e.end.column):this.range.compareStart(e.end.row,e.end.column)<0&&(this.start.row=e.start.row,this.start.column=e.start.column)}else if(e.start.row==this.end.row)this.folds.push(e),this.end.row=e.end.row,this.end.column=e.end.column;else{if(e.end.row!=this.start.row)throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");this.folds.unshift(e),this.start.row=e.start.row,this.start.column=e.start.column}e.foldLine=this},this.containsRow=function(e){return e>=this.start.row&&e<=this.end.row},this.walk=function(e,t,n){var r=0,i=this.folds,s,o,u,a=!0;t==null&&(t=this.end.row,n=this.end.column);for(var f=0;f0)continue;var a=i(e,o.start);return u===0?t&&a!==0?-s-2:s:a>0||a===0&&!t?s:-s-1}return-s-1},this.add=function(e){var t=!e.isEmpty(),n=this.pointIndex(e.start,t);n<0&&(n=-n-1);var r=this.pointIndex(e.end,t,n);return r<0?r=-r-1:r++,this.ranges.splice(n,r-n,e)},this.addList=function(e){var t=[];for(var n=e.length;n--;)t.push.call(t,this.add(e[n]));return t},this.substractPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges.splice(t,1)},this.merge=function(){var e=[],t=this.ranges;t=t.sort(function(e,t){return i(e.start,t.start)});var n=t[0],r;for(var s=1;s=0},this.containsPoint=function(e){return this.pointIndex(e)>=0},this.rangeAtPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges[t]},this.clipRows=function(e,t){var n=this.ranges;if(n[0].start.row>t||n[n.length-1].start.rowi)break;c.start.row==i&&c.start.column>=n.column&&(c.start.column!=n.column||!this.$insertRight)&&(c.start.column+=u,c.start.row+=o);if(c.end.row==i&&c.end.column>=n.column){if(c.end.column==n.column&&this.$insertRight)continue;c.end.column==n.column&&u>0&&fc.start.column&&c.end.column==a[f+1].start.column&&(c.end.column-=u),c.end.column+=u,c.end.row+=o}}if(o!=0&&f=e)return i;if(i.end.row>e)return null}return null},this.getNextFoldLine=function(e,t){var n=this.$foldData,r=0;t&&(r=n.indexOf(t)),r==-1&&(r=0);for(r;r=e)return i}return null},this.getFoldedRowCount=function(e,t){var n=this.$foldData,r=t-e+1;for(var i=0;i=t){u=e?r-=t-u:r=0);break}o>=e&&(u>=e?r-=o-u:r-=o-e+1)}return r},this.$addFoldLine=function(e){return this.$foldData.push(e),this.$foldData.sort(function(e,t){return e.start.row-t.start.row}),e},this.addFold=function(e,t){var n=this.$foldData,r=!1,o;e instanceof s?o=e:(o=new s(t,e),o.collapseChildren=t.collapseChildren),this.$clipRangeToDocument(o.range);var u=o.start.row,a=o.start.column,f=o.end.row,l=o.end.column;if(u0&&(this.removeFolds(p),p.forEach(function(e){o.addSubFold(e)}));for(var d=0;d0&&this.foldAll(e.start.row+1,e.end.row,e.collapseChildren-1),e.subFolds=[]},this.expandFolds=function(e){e.forEach(function(e){this.expandFold(e)},this)},this.unfold=function(e,t){var n,i;e==null?(n=new r(0,0,this.getLength(),0),t=!0):typeof e=="number"?n=new r(e,0,e,this.getLine(e).length):"row"in e?n=r.fromPoints(e,e):n=e,i=this.getFoldsInRangeList(n);if(t)this.removeFolds(i);else{var s=i;while(s.length)this.expandFolds(s),s=this.getFoldsInRangeList(n)}if(i.length)return i},this.isRowFolded=function(e,t){return!!this.getFoldLine(e,t)},this.getRowFoldEnd=function(e,t){var n=this.getFoldLine(e,t);return n?n.end.row:e},this.getRowFoldStart=function(e,t){var n=this.getFoldLine(e,t);return n?n.start.row:e},this.getFoldDisplayLine=function(e,t,n,r,i){r==null&&(r=e.start.row),i==null&&(i=0),t==null&&(t=e.end.row),n==null&&(n=this.getLine(t).length);var s=this.doc,o="";return e.walk(function(e,t,n,u){if(t=e){i=s.end.row;try{var o=this.addFold("...",s);o&&(o.collapseChildren=n)}catch(u){}}}},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle="markbegin",this.setFoldStyle=function(e){if(!this.$foldStyles[e])throw new Error("invalid fold style: "+e+"["+Object.keys(this.$foldStyles).join(", ")+"]");if(this.$foldStyle==e)return;this.$foldStyle=e,e=="manual"&&this.unfold();var t=this.$foldMode;this.$setFolding(null),this.$setFolding(t)},this.$setFolding=function(e){if(this.$foldMode==e)return;this.$foldMode=e,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._emit("changeAnnotation");if(!e||this.$foldStyle=="manual"){this.foldWidgets=null;return}this.foldWidgets=[],this.getFoldWidget=e.getFoldWidget.bind(e,this,this.$foldStyle),this.getFoldWidgetRange=e.getFoldWidgetRange.bind(e,this,this.$foldStyle),this.$updateFoldWidgets=this.updateFoldWidgets.bind(this),this.$tokenizerUpdateFoldWidgets=this.tokenizerUpdateFoldWidgets.bind(this),this.on("change",this.$updateFoldWidgets),this.on("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets)},this.getParentFoldRangeData=function(e,t){var n=this.foldWidgets;if(!n||t&&n[e])return{};var r=e-1,i;while(r>=0){var s=n[r];s==null&&(s=n[r]=this.getFoldWidget(r));if(s=="start"){var o=this.getFoldWidgetRange(r);i||(i=o);if(o&&o.end.row>=e)break}r--}return{range:r!==-1&&o,firstRange:i}},this.onFoldWidgetClick=function(e,t){t=t.domEvent;var n={children:t.shiftKey,all:t.ctrlKey||t.metaKey,siblings:t.altKey},r=this.$toggleFoldWidget(e,n);if(!r){var i=t.target||t.srcElement;i&&/ace_fold-widget/.test(i.className)&&(i.className+=" ace_invalid")}},this.$toggleFoldWidget=function(e,t){if(!this.getFoldWidget)return;var n=this.getFoldWidget(e),r=this.getLine(e),i=n==="end"?-1:1,s=this.getFoldAt(e,i===-1?0:r.length,i);if(s){t.children||t.all?this.removeFold(s):this.expandFold(s);return}var o=this.getFoldWidgetRange(e,!0);if(o&&!o.isMultiLine()){s=this.getFoldAt(o.start.row,o.start.column,1);if(s&&o.isEqual(s.range)){this.removeFold(s);return}}if(t.siblings){var u=this.getParentFoldRangeData(e);if(u.range)var a=u.range.start.row+1,f=u.range.end.row;this.foldAll(a,f,t.all?1e4:0)}else t.children?(f=o?o.end.row:this.getLength(),this.foldAll(e+1,o.end.row,t.all?1e4:0)):o&&(t.all&&(o.collapseChildren=1e4),this.addFold("...",o));return o},this.toggleFoldWidget=function(e){var t=this.selection.getCursor().row;t=this.getRowFoldStart(t);var n=this.$toggleFoldWidget(t,{});if(n)return;var r=this.getParentFoldRangeData(t,!0);n=r.range||r.firstRange;if(n){t=n.start.row;var i=this.getFoldAt(t,this.getLine(t).length,1);i?this.removeFold(i):this.addFold("...",n)}},this.updateFoldWidgets=function(e){var t=e.data,n=t.range,r=n.start.row,i=n.end.row-r;if(i===0)this.foldWidgets[r]=null;else if(t.action=="removeText"||t.action=="removeLines")this.foldWidgets.splice(r,i+1,null);else{var s=Array(i+1);s.unshift(r,1),this.foldWidgets.splice.apply(this.foldWidgets,s)}},this.tokenizerUpdateFoldWidgets=function(e){var t=e.data;t.first!=t.last&&this.foldWidgets.length>t.first&&this.foldWidgets.splice(t.first,this.foldWidgets.length)}}var r=e("../range").Range,i=e("./fold_line").FoldLine,s=e("./fold").Fold,o=e("../token_iterator").TokenIterator;t.Folding=u}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(e,t,n){"use strict";function s(){this.findMatchingBracket=function(e,t){if(e.column==0)return null;var n=t||this.getLine(e.row).charAt(e.column-1);if(n=="")return null;var r=n.match(/([\(\[\{])|([\)\]\}])/);return r?r[1]?this.$findClosingBracket(r[1],e):this.$findOpeningBracket(r[2],e):null},this.getBracketRange=function(e){var t=this.getLine(e.row),n=!0,r,s=t.charAt(e.column-1),o=s&&s.match(/([\(\[\{])|([\)\]\}])/);o||(s=t.charAt(e.column),e={row:e.row,column:e.column+1},o=s&&s.match(/([\(\[\{])|([\)\]\}])/),n=!1);if(!o)return null;if(o[1]){var u=this.$findClosingBracket(o[1],e);if(!u)return null;r=i.fromPoints(e,u),n||(r.end.column++,r.start.column--),r.cursor=r.end}else{var u=this.$findOpeningBracket(o[2],e);if(!u)return null;r=i.fromPoints(u,e),n||(r.start.column++,r.end.column--),r.cursor=r.start}return r},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{"},this.$findOpeningBracket=function(e,t,n){var i=this.$brackets[e],s=1,o=new r(this,t.row,t.column),u=o.getCurrentToken();u||(u=o.stepForward());if(!u)return;n||(n=new RegExp("(\\.?"+u.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end|start|begin)\b/,"")+")+"));var a=t.column-o.getCurrentTokenColumn()-2,f=u.value;for(;;){while(a>=0){var l=f.charAt(a);if(l==i){s-=1;if(s==0)return{row:o.getCurrentTokenRow(),column:a+o.getCurrentTokenColumn()}}else l==e&&(s+=1);a-=1}do u=o.stepBackward();while(u&&!n.test(u.type));if(u==null)break;f=u.value,a=f.length-1}return null},this.$findClosingBracket=function(e,t,n){var i=this.$brackets[e],s=1,o=new r(this,t.row,t.column),u=o.getCurrentToken();u||(u=o.stepForward());if(!u)return;n||(n=new RegExp("(\\.?"+u.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:end|start|begin)\b/,"")+")+"));var a=t.column-o.getCurrentTokenColumn();for(;;){var f=u.value,l=f.length;while(a=4352&&e<=4447||e>=4515&&e<=4519||e>=4602&&e<=4607||e>=9001&&e<=9002||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12283||e>=12288&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12589||e>=12593&&e<=12686||e>=12688&&e<=12730||e>=12736&&e<=12771||e>=12784&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=13054||e>=13056&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=55216&&e<=55238||e>=55243&&e<=55291||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=65281&&e<=65376||e>=65504&&e<=65510}r.implement(this,o),this.setDocument=function(e){this.doc&&this.doc.removeListener("change",this.$onChange),this.doc=e,e.on("change",this.$onChange),this.bgTokenizer&&this.bgTokenizer.setDocument(this.getDocument()),this.resetCaches()},this.getDocument=function(){return this.doc},this.$resetRowCache=function(e){if(!e){this.$docRowCache=[],this.$screenRowCache=[];return}var t=this.$docRowCache.length,n=this.$getRowCacheIndex(this.$docRowCache,e)+1;t>n&&(this.$docRowCache.splice(n,t),this.$screenRowCache.splice(n,t))},this.$getRowCacheIndex=function(e,t){var n=0,r=e.length-1;while(n<=r){var i=n+r>>1,s=e[i];if(t>s)n=i+1;else{if(!(t=t)break}return r=n[s],r?(r.index=s,r.start=i-r.value.length,r):null},this.setUndoManager=function(e){this.$undoManager=e,this.$deltas=[],this.$deltasDoc=[],this.$deltasFold=[],this.$informUndoManager&&this.$informUndoManager.cancel();if(e){var t=this;this.$syncInformUndoManager=function(){t.$informUndoManager.cancel(),t.$deltasFold.length&&(t.$deltas.push({group:"fold",deltas:t.$deltasFold}),t.$deltasFold=[]),t.$deltasDoc.length&&(t.$deltas.push({group:"doc",deltas:t.$deltasDoc}),t.$deltasDoc=[]),t.$deltas.length>0&&e.execute({action:"aceupdate",args:[t.$deltas,t],merge:t.mergeUndoDeltas}),t.mergeUndoDeltas=!1,t.$deltas=[]},this.$informUndoManager=i.delayedCall(this.$syncInformUndoManager)}},this.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},this.$defaultUndoManager={undo:function(){},redo:function(){},reset:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?i.stringRepeat(" ",this.getTabSize()):" "},this.setUseSoftTabs=function(e){this.setOption("useSoftTabs",e)},this.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},this.setTabSize=function(e){this.setOption("tabSize",e)},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(e){return this.$useSoftTabs&&e.column%this.$tabSize===0},this.$overwrite=!1,this.setOverwrite=function(e){this.setOption("overwrite",e)},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.addGutterDecoration=function(e,t){this.$decorations[e]||(this.$decorations[e]=""),this.$decorations[e]+=" "+t,this._signal("changeBreakpoint",{})},this.removeGutterDecoration=function(e,t){this.$decorations[e]=(this.$decorations[e]||"").replace(" "+t,""),this._signal("changeBreakpoint",{})},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(e){this.$breakpoints=[];for(var t=0;t0&&(r=!!n.charAt(t-1).match(this.tokenRe)),r||(r=!!n.charAt(t).match(this.tokenRe));if(r)var i=this.tokenRe;else if(/^\s+$/.test(n.slice(t-1,t+1)))var i=/\s/;else var i=this.nonTokenRe;var s=t;if(s>0){do s--;while(s>=0&&n.charAt(s).match(i));s++}var o=t;while(oe&&(e=t.screenWidth)}),this.lineWidgetWidth=e},this.$computeWidth=function(e){if(this.$modified||e){this.$modified=!1;if(this.$useWrapMode)return this.screenWidth=this.$wrapLimit;var t=this.doc.getAllLines(),n=this.$rowLengthCache,r=0,i=0,s=this.$foldData[i],o=s?s.start.row:Infinity,u=t.length;for(var a=0;ao){a=s.end.row+1;if(a>=u)break;s=this.$foldData[i++],o=s?s.start.row:Infinity}n[a]==null&&(n[a]=this.$getStringScreenWidth(t[a])[0]),n[a]>r&&(r=n[a])}this.screenWidth=r}},this.getLine=function(e){return this.doc.getLine(e)},this.getLines=function(e,t){return this.doc.getLines(e,t)},this.getLength=function(){return this.doc.getLength()},this.getTextRange=function(e){return this.doc.getTextRange(e||this.selection.getRange())},this.insert=function(e,t){return this.doc.insert(e,t)},this.remove=function(e){return this.doc.remove(e)},this.undoChanges=function(e,t){if(!e.length)return;this.$fromUndo=!0;var n=null;for(var r=e.length-1;r!=-1;r--){var i=e[r];i.group=="doc"?(this.doc.revertDeltas(i.deltas),n=this.$getUndoSelection(i.deltas,!0,n)):i.deltas.forEach(function(e){this.addFolds(e.folds)},this)}return this.$fromUndo=!1,n&&this.$undoSelect&&!t&&this.selection.setSelectionRange(n),n},this.redoChanges=function(e,t){if(!e.length)return;this.$fromUndo=!0;var n=null;for(var r=0;re.end.column&&(s.start.column+=u),s.end.row==e.end.row&&s.end.column>e.end.column&&(s.end.column+=u)),o&&s.start.row>=e.end.row&&(s.start.row+=o,s.end.row+=o)}s.end=this.insert(s.start,r);if(i.length){var a=e.start,l=s.start,o=l.row-a.row,u=l.column-a.column;this.addFolds(i.map(function(e){return e=e.clone(),e.start.row==a.row&&(e.start.column+=u),e.end.row==a.row&&(e.end.column+=u),e.start.row+=o,e.end.row+=o,e}))}return s},this.indentRows=function(e,t,n){n=n.replace(/\t/g,this.getTabString());for(var r=e;r<=t;r++)this.insert({row:r,column:0},n)},this.outdentRows=function(e){var t=e.collapseRows(),n=new f(0,0,0,0),r=this.getTabSize();for(var i=t.start.row;i<=t.end.row;++i){var s=this.getLine(i);n.start.row=i,n.end.row=i;for(var o=0;o0){var r=this.getRowFoldEnd(t+n);if(r>this.doc.getLength()-1)return 0;var i=r-t}else{e=this.$clipRowToDocument(e),t=this.$clipRowToDocument(t);var i=t-e+1}var s=new f(e,0,t,Number.MAX_VALUE),o=this.getFoldsInRange(s).map(function(e){return e=e.clone(),e.start.row+=i,e.end.row+=i,e}),u=n==0?this.doc.getLines(e,t):this.doc.removeLines(e,t);return this.doc.insertLines(e+i,u),o.length&&this.addFolds(o),i},this.moveLinesUp=function(e,t){return this.$moveLines(e,t,-1)},this.moveLinesDown=function(e,t){return this.$moveLines(e,t,1)},this.duplicateLines=function(e,t){return this.$moveLines(e,t,0)},this.$clipRowToDocument=function(e){return Math.max(0,Math.min(e,this.doc.getLength()-1))},this.$clipColumnToRow=function(e,t){return t<0?0:Math.min(this.doc.getLine(e).length,t)},this.$clipPositionToDocument=function(e,t){t=Math.max(0,t);if(e<0)e=0,t=0;else{var n=this.doc.getLength();e>=n?(e=n-1,t=this.doc.getLine(n-1).length):t=Math.min(this.doc.getLine(e).length,t)}return{row:e,column:t}},this.$clipRangeToDocument=function(e){e.start.row<0?(e.start.row=0,e.start.column=0):e.start.column=this.$clipColumnToRow(e.start.row,e.start.column);var t=this.doc.getLength()-1;return e.end.row>t?(e.end.row=t,e.end.column=this.doc.getLine(t).length):e.end.column=this.$clipColumnToRow(e.end.row,e.end.column),e},this.$wrapLimit=80,this.$useWrapMode=!1,this.$wrapLimitRange={min:null,max:null},this.setUseWrapMode=function(e){if(e!=this.$useWrapMode){this.$useWrapMode=e,this.$modified=!0,this.$resetRowCache(0);if(e){var t=this.getLength();this.$wrapData=Array(t),this.$updateWrapData(0,t-1)}this._signal("changeWrapMode")}},this.getUseWrapMode=function(){return this.$useWrapMode},this.setWrapLimitRange=function(e,t){if(this.$wrapLimitRange.min!==e||this.$wrapLimitRange.max!==t)this.$wrapLimitRange={min:e,max:t},this.$modified=!0,this._signal("changeWrapMode")},this.adjustWrapLimit=function(e,t){var n=this.$wrapLimitRange;n.max<0&&(n={min:t,max:t});var r=this.$constrainWrapLimit(e,n.min,n.max);return r!=this.$wrapLimit&&r>1?(this.$wrapLimit=r,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0):!1},this.$constrainWrapLimit=function(e,t,n){return t&&(e=Math.max(t,e)),n&&(e=Math.min(n,e)),e},this.getWrapLimit=function(){return this.$wrapLimit},this.setWrapLimit=function(e){this.setWrapLimitRange(e,e)},this.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},this.$updateInternalDataOnChange=function(e){var t=this.$useWrapMode,n,r=e.data.action,i=e.data.range.start.row,s=e.data.range.end.row,o=e.data.range.start,u=e.data.range.end,a=null;r.indexOf("Lines")!=-1?(r=="insertLines"?s=i+e.data.lines.length:s=i,n=e.data.lines?e.data.lines.length:s-i):n=s-i,this.$updating=!0;if(n!=0)if(r.indexOf("remove")!=-1){this[t?"$wrapData":"$rowLengthCache"].splice(i,n);var f=this.$foldData;a=this.getFoldsInRange(e.data.range),this.removeFolds(a);var l=this.getFoldLine(u.row),c=0;if(l){l.addRemoveChars(u.row,u.column,o.column-u.column),l.shiftRow(-n);var h=this.getFoldLine(i);h&&h!==l&&(h.merge(l),l=h),c=f.indexOf(l)+1}for(c;c=u.row&&l.shiftRow(-n)}s=i}else{var p=Array(n);p.unshift(i,0);var d=t?this.$wrapData:this.$rowLengthCache;d.splice.apply(d,p);var f=this.$foldData,l=this.getFoldLine(i),c=0;if(l){var v=l.range.compareInside(o.row,o.column);v==0?(l=l.split(o.row,o.column),l&&(l.shiftRow(n),l.addRemoveChars(s,0,u.column-o.column))):v==-1&&(l.addRemoveChars(i,0,u.column-o.column),l.shiftRow(n)),c=f.indexOf(l)+1}for(c;c=i&&l.shiftRow(n)}}else{n=Math.abs(e.data.range.start.column-e.data.range.end.column),r.indexOf("remove")!=-1&&(a=this.getFoldsInRange(e.data.range),this.removeFolds(a),n=-n);var l=this.getFoldLine(i);l&&l.addRemoveChars(i,o.column,n)}return t&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,t?this.$updateWrapData(i,s):this.$updateRowLengthCache(i,s),a},this.$updateRowLengthCache=function(e,t,n){this.$rowLengthCache[e]=null,this.$rowLengthCache[t]=null},this.$updateWrapData=function(e,t){var r=this.doc.getAllLines(),i=this.getTabSize(),s=this.$wrapData,o=this.$wrapLimit,a,f,l=e;t=Math.min(t,r.length-1);while(l<=t)f=this.getFoldLine(l,f),f?(a=[],f.walk(function(e,t,i,s){var o;if(e!=null){o=this.$getDisplayTokens(e,a.length),o[0]=n;for(var f=1;fr){var h=o+r;if(e[h-1]>=p&&e[h]>=p){c(h);continue}if(e[h]==n||e[h]==u){for(h;h!=o-1;h--)if(e[h]==n)break;if(h>o){c(h);continue}h=o+r;for(h;h>2)),o-1);while(h>d&&e[h]d&&e[h]d&&e[h]==l)h--}else while(h>d&&e[h]d){c(++h);continue}h=o+r,e[h]==t&&h--,c(h)}return i},this.$getDisplayTokens=function(n,r){var i=[],s;r=r||0;for(var o=0;o39&&u<48||u>57&&u<64?i.push(l):u>=4352&&m(u)?i.push(e,t):i.push(e)}return i},this.$getStringScreenWidth=function(e,t,n){if(t==0)return[0,0];t==null&&(t=Infinity),n=n||0;var r,i;for(i=0;i=4352&&m(r)?n+=2:n+=1;if(n>t)break}return[n,i]},this.lineWidgets=null,this.getRowLength=function(e){if(this.lineWidgets)var t=this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0;else t=0;return!this.$useWrapMode||!this.$wrapData[e]?1+t:this.$wrapData[e].length+1+t},this.getRowLineCount=function(e){return!this.$useWrapMode||!this.$wrapData[e]?1:this.$wrapData[e].length+1},this.getScreenLastRowColumn=function(e){var t=this.screenToDocumentPosition(e,Number.MAX_VALUE);return this.documentToScreenColumn(t.row,t.column)},this.getDocumentLastRowColumn=function(e,t){var n=this.documentToScreenRow(e,t);return this.getScreenLastRowColumn(n)},this.getDocumentLastRowColumnPosition=function(e,t){var n=this.documentToScreenRow(e,t);return this.screenToDocumentPosition(n,Number.MAX_VALUE/10)},this.getRowSplitData=function(e){return this.$useWrapMode?this.$wrapData[e]:undefined},this.getScreenTabSize=function(e){return this.$tabSize-e%this.$tabSize},this.screenToDocumentRow=function(e,t){return this.screenToDocumentPosition(e,t).row},this.screenToDocumentColumn=function(e,t){return this.screenToDocumentPosition(e,t).column},this.screenToDocumentPosition=function(e,t){if(e<0)return{row:0,column:0};var n,r=0,i=0,s,o=0,u=0,a=this.$screenRowCache,f=this.$getRowCacheIndex(a,e),l=a.length;if(l&&f>=0)var o=a[f],r=this.$docRowCache[f],c=e>a[l-1];else var c=!l;var h=this.getLength()-1,p=this.getNextFoldLine(r),d=p?p.start.row:Infinity;while(o<=e){u=this.getRowLength(r);if(o+u>e||r>=h)break;o+=u,r++,r>d&&(r=p.end.row+1,p=this.getNextFoldLine(r,p),d=p?p.start.row:Infinity),c&&(this.$docRowCache.push(r),this.$screenRowCache.push(o))}if(p&&p.start.row<=r)n=this.getFoldDisplayLine(p),r=p.start.row;else{if(o+u<=e||r>h)return{row:h,column:this.getLine(h).length};n=this.getLine(r),p=null}if(this.$useWrapMode){var v=this.$wrapData[r];if(v){var m=Math.floor(e-o);s=v[m],m>0&&v.length&&(i=v[m-1]||v[v.length-1],n=n.substring(i))}}return i+=this.$getStringScreenWidth(n,t)[1],this.$useWrapMode&&i>=s&&(i=s-1),p?p.idxToPosition(i):{row:r,column:i}},this.documentToScreenPosition=function(e,t){if(typeof t=="undefined")var n=this.$clipPositionToDocument(e.row,e.column);else n=this.$clipPositionToDocument(e,t);e=n.row,t=n.column;var r=0,i=null,s=null;s=this.getFoldAt(e,t,1),s&&(e=s.start.row,t=s.start.column);var o,u=0,a=this.$docRowCache,f=this.$getRowCacheIndex(a,e),l=a.length;if(l&&f>=0)var u=a[f],r=this.$screenRowCache[f],c=e>a[l-1];else var c=!l;var h=this.getNextFoldLine(u),p=h?h.start.row:Infinity;while(u=p){o=h.end.row+1;if(o>e)break;h=this.getNextFoldLine(o,h),p=h?h.start.row:Infinity}else o=u+1;r+=this.getRowLength(u),u=o,c&&(this.$docRowCache.push(u),this.$screenRowCache.push(r))}var d="";h&&u>=p?(d=this.getFoldDisplayLine(h,e,t),i=h.start.row):(d=this.getLine(e).substring(0,t),i=e);if(this.$useWrapMode){var v=this.$wrapData[i];if(v){var m=0;while(d.length>=v[m])r++,m++;d=d.substring(v[m-1]||0,d.length)}}return{row:r,column:this.$getStringScreenWidth(d)[0]}},this.documentToScreenColumn=function(e,t){return this.documentToScreenPosition(e,t).column},this.documentToScreenRow=function(e,t){return this.documentToScreenPosition(e,t).row},this.getScreenLength=function(){var e=0,t=null;if(!this.$useWrapMode){e=this.getLength();var n=this.$foldData;for(var r=0;ro&&(s=t.end.row+1,t=this.$foldData[r++],o=t?t.start.row:Infinity)}}return this.lineWidgets&&(e+=this.$getWidgetScreenLength()),e},this.$setFontMetrics=function(e){},this.destroy=function(){this.bgTokenizer&&(this.bgTokenizer.setDocument(null),this.bgTokenizer=null),this.$stopWorker()}}).call(p.prototype),e("./edit_session/folding").Folding.call(p.prototype),e("./edit_session/bracket_match").BracketMatch.call(p.prototype),s.defineOptions(p.prototype,"session",{wrap:{set:function(e){!e||e=="off"?e=!1:e=="free"?e=!0:e=="printMargin"?e=-1:typeof e=="string"&&(e=parseInt(e,10)||!1);if(this.$wrap==e)return;if(!e)this.setUseWrapMode(!1);else{var t=typeof e=="number"?e:null;this.setWrapLimitRange(t,t),this.setUseWrapMode(!0)}this.$wrap=e},get:function(){return this.getUseWrapMode()?this.$wrap==-1?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(e){e=e=="auto"?this.$mode.type!="text":e!="text",e!=this.$wrapAsCode&&(this.$wrapAsCode=e,this.$useWrapMode&&(this.$modified=!0,this.$resetRowCache(0),this.$updateWrapData(0,this.getLength()-1)))},initialValue:"auto"},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(e){this.$useWorker=e,this.$stopWorker(),e&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(e){if(isNaN(e)||this.$tabSize===e)return;this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=e,this._signal("changeTabSize")},initialValue:4,handlesSet:!0},overwrite:{set:function(e){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(e){this.doc.setNewLineMode(e)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(e){this.setMode(e)},get:function(){return this.$modeId}}}),t.EditSession=p}),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t,n){"use strict";var r=e("./lib/lang"),i=e("./lib/oop"),s=e("./range").Range,o=function(){this.$options={}};(function(){this.set=function(e){return i.mixin(this.$options,e),this},this.getOptions=function(){return r.copyObject(this.$options)},this.setOptions=function(e){this.$options=e},this.find=function(e){var t=this.$options,n=this.$matchIterator(e,t);if(!n)return!1;var r=null;return n.forEach(function(e,n,i){if(!e.start){var o=e.offset+(i||0);r=new s(n,o,n,o+e.length);if(!e.length&&t.start&&t.start.start&&t.skipCurrent!=0&&r.isEqual(t.start))return r=null,!1}else r=e;return!0}),r},this.findAll=function(e){var t=this.$options;if(!t.needle)return[];this.$assembleRegExp(t);var n=t.range,i=n?e.getLines(n.start.row,n.end.row):e.doc.getAllLines(),o=[],u=t.re;if(t.$isMultiLine){var a=u.length,f=i.length-a,l;e:for(var c=u.offset||0;c<=f;c++){for(var h=0;hv)continue;o.push(l=new s(c,v,c+a-1,m)),a>2&&(c=c+a-2)}}else for(var g=0;gE&&o[h].end.row==n.end.row)h--;o=o.slice(g,h+1);for(g=0,h=o.length;g=0;u--)if(i(o[u],t,s))return!0};else var u=function(e,t,s){var o=r.getMatchOffsets(e,n);for(var u=0;u=o;r--)if(n(e.getLine(r),r))return;if(t.wrap==0)return;for(r=u,o=s.row;r>=o;r--)if(n(e.getLine(r),r))return}:function(n){var r=s.row,i=e.getLine(r).substr(s.column);if(n(i,r,s.column))return;for(r+=1;r<=u;r++)if(n(e.getLine(r),r))return;if(t.wrap==0)return;for(r=o,u=s.row;r<=u;r++)if(n(e.getLine(r),r))return};return{forEach:a}}}).call(o.prototype),t.Search=o}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t,n){"use strict";function o(e,t){this.platform=t||(i.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(e),this.$singleCommand=!0}function u(e,t){o.call(this,e,t),this.$singleCommand=!1}var r=e("../lib/keys"),i=e("../lib/useragent"),s=r.KEY_MODS;u.prototype=o.prototype,function(){this.addCommand=function(e){this.commands[e.name]&&this.removeCommand(e),this.commands[e.name]=e,e.bindKey&&this._buildKeyHash(e)},this.removeCommand=function(e,t){var n=e&&(typeof e=="string"?e:e.name);e=this.commands[n],t||delete this.commands[n];var r=this.commandKeyBinding;for(var i in r){var s=r[i];if(s==e)delete r[i];else if(Array.isArray(s)){var o=s.indexOf(e);o!=-1&&(s.splice(o,1),s.length==1&&(r[i]=s[0]))}}},this.bindKey=function(e,t,n){typeof e=="object"&&(e=e[this.platform]);if(!e)return;if(typeof t=="function")return this.addCommand({exec:t,bindKey:e,name:t.name||e});e.split("|").forEach(function(e){var r="";if(e.indexOf(" ")!=-1){var i=e.split(/\s+/);e=i.pop(),i.forEach(function(e){var t=this.parseKeys(e),n=s[t.hashId]+t.key;r+=(r?" ":"")+n,this._addCommandToBinding(r,"chainKeys")},this),r+=" "}var o=this.parseKeys(e),u=s[o.hashId]+o.key;this._addCommandToBinding(r+u,t,n)},this)},this._addCommandToBinding=function(e,t,n){var r=this.commandKeyBinding,i;t?!r[e]||this.$singleCommand?r[e]=t:(Array.isArray(r[e])?(i=r[e].indexOf(t))!=-1&&r[e].splice(i,1):r[e]=[r[e]],n||t.isDefault?r[e].unshift(t):r[e].push(t)):delete r[e]},this.addCommands=function(e){e&&Object.keys(e).forEach(function(t){var n=e[t];if(!n)return;if(typeof n=="string")return this.bindKey(n,t);typeof n=="function"&&(n={exec:n});if(typeof n!="object")return;n.name||(n.name=t),this.addCommand(n)},this)},this.removeCommands=function(e){Object.keys(e).forEach(function(t){this.removeCommand(e[t])},this)},this.bindKeys=function(e){Object.keys(e).forEach(function(t){this.bindKey(t,e[t])},this)},this._buildKeyHash=function(e){this.bindKey(e.bindKey,e)},this.parseKeys=function(e){var t=e.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(e){return e}),n=t.pop(),i=r[n];if(r.FUNCTION_KEYS[i])n=r.FUNCTION_KEYS[i].toLowerCase();else{if(!t.length)return{key:n,hashId:-1};if(t.length==1&&t[0]=="shift")return{key:n.toUpperCase(),hashId:-1}}var s=0;for(var o=t.length;o--;){var u=r.KEY_MODS[t[o]];if(u==null)return typeof console!="undefined"&&console.error("invalid modifier "+t[o]+" in "+e),!1;s|=u}return{key:n,hashId:s}},this.findKeyCommand=function(t,n){var r=s[t]+n;return this.commandKeyBinding[r]},this.handleKeyboard=function(e,t,n,r){var i=s[t]+n,o=this.commandKeyBinding[i];e.$keyChain&&(e.$keyChain+=" "+i,o=this.commandKeyBinding[e.$keyChain]||o);if(o)if(o=="chainKeys"||o[o.length-1]=="chainKeys")return e.$keyChain=e.$keyChain||i,{command:"null"};return e.$keyChain&&r>0&&(e.$keyChain=""),{command:o}}}.call(o.prototype),t.HashHandler=o,t.MultiHashHandler=u}),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../keyboard/hash_handler").MultiHashHandler,s=e("../lib/event_emitter").EventEmitter,o=function(e,t){i.call(this,t,e),this.byName=this.commands,this.setDefaultHandler("exec",function(e){return e.command.exec(e.editor,e.args||{})})};r.inherits(o,i),function(){r.implement(this,s),this.exec=function(e,t,n){if(Array.isArray(e)){for(var r=e.length;r--;)if(this.exec(e[r],t,n))return!0;return!1}typeof e=="string"&&(e=this.commands[e]);if(!e)return!1;if(t&&t.$readOnly&&!e.readOnly)return!1;var i={editor:t,command:e,args:n};return i.returnValue=this._emit("exec",i),this._signal("afterExec",i),i.returnValue===!1?!1:!0},this.toggleRecording=function(e){if(this.$inReplay)return;return e&&e._emit("changeStatus"),this.recording?(this.macro.pop(),this.removeEventListener("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=function(e){this.macro.push([e.command,e.args])}.bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},this.replay=function(e){if(this.$inReplay||!this.macro)return;if(this.recording)return this.toggleRecording(e);try{this.$inReplay=!0,this.macro.forEach(function(t){typeof t=="string"?this.exec(t,e):this.exec(t[0],e,t[1])},this)}finally{this.$inReplay=!1}},this.trimMacro=function(e){return e.map(function(e){return typeof e[0]!="string"&&(e[0]=e[0].name),e[1]||(e=e[0]),e})}}.call(o.prototype),t.CommandManager=o}),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(e,t,n){"use strict";function o(e,t){return{win:e,mac:t}}var r=e("../lib/lang"),i=e("../config"),s=e("../range").Range;t.commands=[{name:"showSettingsMenu",bindKey:o("Ctrl-,","Command-,"),exec:function(e){i.loadModule("ace/ext/settings_menu",function(t){t.init(e),e.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",bindKey:o("Alt-E","Ctrl-E"),exec:function(e){i.loadModule("ace/ext/error_marker",function(t){t.showErrorMarker(e,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",bindKey:o("Alt-Shift-E","Ctrl-Shift-E"),exec:function(e){i.loadModule("ace/ext/error_marker",function(t){t.showErrorMarker(e,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",bindKey:o("Ctrl-A","Command-A"),exec:function(e){e.selectAll()},readOnly:!0},{name:"centerselection",bindKey:o(null,"Ctrl-L"),exec:function(e){e.centerSelection()},readOnly:!0},{name:"gotoline",bindKey:o("Ctrl-L","Command-L"),exec:function(e){var t=parseInt(prompt("Enter line number:"),10);isNaN(t)||e.gotoLine(t)},readOnly:!0},{name:"fold",bindKey:o("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(e){e.session.toggleFold(!1)},scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:o("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(e){e.session.toggleFold(!0)},scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",bindKey:o("F2","F2"),exec:function(e){e.session.toggleFoldWidget()},scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",bindKey:o("Alt-F2","Alt-F2"),exec:function(e){e.session.toggleFoldWidget(!0)},scrollIntoView:"center",readOnly:!0},{name:"foldall",bindKey:o("Ctrl-Alt-0","Ctrl-Command-Option-0"),exec:function(e){e.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",bindKey:o("Alt-0","Command-Option-0"),exec:function(e){e.session.foldAll(),e.session.unfold(e.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",bindKey:o("Alt-Shift-0","Command-Option-Shift-0"),exec:function(e){e.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",bindKey:o("Ctrl-K","Command-G"),exec:function(e){e.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",bindKey:o("Ctrl-Shift-K","Command-Shift-G"),exec:function(e){e.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",bindKey:o("Alt-K","Ctrl-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findNext()},readOnly:!0},{name:"selectOrFindPrevious",bindKey:o("Alt-Shift-K","Ctrl-Shift-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findPrevious()},readOnly:!0},{name:"find",bindKey:o("Ctrl-F","Command-F"),exec:function(e){i.loadModule("ace/ext/searchbox",function(t){t.Search(e)})},readOnly:!0},{name:"overwrite",bindKey:"Insert",exec:function(e){e.toggleOverwrite()},readOnly:!0},{name:"selecttostart",bindKey:o("Ctrl-Shift-Home","Command-Shift-Up"),exec:function(e){e.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",bindKey:o("Ctrl-Home","Command-Home|Command-Up"),exec:function(e){e.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",bindKey:o("Shift-Up","Shift-Up"),exec:function(e){e.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",bindKey:o("Up","Up|Ctrl-P"),exec:function(e,t){e.navigateUp(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",bindKey:o("Ctrl-Shift-End","Command-Shift-Down"),exec:function(e){e.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",bindKey:o("Ctrl-End","Command-End|Command-Down"),exec:function(e){e.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",bindKey:o("Shift-Down","Shift-Down"),exec:function(e){e.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",bindKey:o("Down","Down|Ctrl-N"),exec:function(e,t){e.navigateDown(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",bindKey:o("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(e){e.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",bindKey:o("Ctrl-Left","Option-Left"),exec:function(e){e.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",bindKey:o("Alt-Shift-Left","Command-Shift-Left"),exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",bindKey:o("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(e){e.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",bindKey:o("Shift-Left","Shift-Left"),exec:function(e){e.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",bindKey:o("Left","Left|Ctrl-B"),exec:function(e,t){e.navigateLeft(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",bindKey:o("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(e){e.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",bindKey:o("Ctrl-Right","Option-Right"),exec:function(e){e.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",bindKey:o("Alt-Shift-Right","Command-Shift-Right"),exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",bindKey:o("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(e){e.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",bindKey:o("Shift-Right","Shift-Right"),exec:function(e){e.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",bindKey:o("Right","Right|Ctrl-F"),exec:function(e,t){e.navigateRight(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",bindKey:"Shift-PageDown",exec:function(e){e.selectPageDown()},readOnly:!0},{name:"pagedown",bindKey:o(null,"Option-PageDown"),exec:function(e){e.scrollPageDown()},readOnly:!0},{name:"gotopagedown",bindKey:o("PageDown","PageDown|Ctrl-V"),exec:function(e){e.gotoPageDown()},readOnly:!0},{name:"selectpageup",bindKey:"Shift-PageUp",exec:function(e){e.selectPageUp()},readOnly:!0},{name:"pageup",bindKey:o(null,"Option-PageUp"),exec:function(e){e.scrollPageUp()},readOnly:!0},{name:"gotopageup",bindKey:"PageUp",exec:function(e){e.gotoPageUp()},readOnly:!0},{name:"scrollup",bindKey:o("Ctrl-Up",null),exec:function(e){e.renderer.scrollBy(0,-2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",bindKey:o("Ctrl-Down",null),exec:function(e){e.renderer.scrollBy(0,2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",bindKey:"Shift-Home",exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",bindKey:"Shift-End",exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",bindKey:o("Ctrl-Alt-E","Command-Option-E"),exec:function(e){e.commands.toggleRecording(e)},readOnly:!0},{name:"replaymacro",bindKey:o("Ctrl-Shift-E","Command-Shift-E"),exec:function(e){e.commands.replay(e)},readOnly:!0},{name:"jumptomatching",bindKey:o("Ctrl-P","Ctrl-P"),exec:function(e){e.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",bindKey:o("Ctrl-Shift-P","Ctrl-Shift-P"),exec:function(e){e.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",bindKey:o("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(e){e.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",bindKey:o("null","null"),exec:function(){},passEvent:!0,readOnly:!0},{name:"cut",exec:function(e){var t=e.getSelectionRange();e._emit("cut",t),e.selection.isEmpty()||(e.session.remove(t),e.clearSelection())},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"removeline",bindKey:o("Ctrl-D","Command-D"),exec:function(e){e.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",bindKey:o("Ctrl-Shift-D","Command-Shift-D"),exec:function(e){e.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",bindKey:o("Ctrl-Alt-S","Command-Alt-S"),exec:function(e){e.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",bindKey:o("Ctrl-/","Command-/"),exec:function(e){e.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",bindKey:o("Ctrl-Shift-/","Command-Shift-/"),exec:function(e){e.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",bindKey:o("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(e){e.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",bindKey:o("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(e){e.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",bindKey:o("Ctrl-H","Command-Option-F"),exec:function(e){i.loadModule("ace/ext/searchbox",function(t){t.Search(e,!0)})}},{name:"undo",bindKey:o("Ctrl-Z","Command-Z"),exec:function(e){e.undo()}},{name:"redo",bindKey:o("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(e){e.redo()}},{name:"copylinesup",bindKey:o("Alt-Shift-Up","Command-Option-Up"),exec:function(e){e.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",bindKey:o("Alt-Up","Option-Up"),exec:function(e){e.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",bindKey:o("Alt-Shift-Down","Command-Option-Down"),exec:function(e){e.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",bindKey:o("Alt-Down","Option-Down"),exec:function(e){e.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",bindKey:o("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(e){e.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",bindKey:o("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(e){e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",bindKey:o("Shift-Delete",null),exec:function(e){if(!e.selection.isEmpty())return!1;e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",bindKey:o("Alt-Backspace","Command-Backspace"),exec:function(e){e.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",bindKey:o("Alt-Delete","Ctrl-K"),exec:function(e){e.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",bindKey:o("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(e){e.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",bindKey:o("Ctrl-Delete","Alt-Delete"),exec:function(e){e.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",bindKey:o("Shift-Tab","Shift-Tab"),exec:function(e){e.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",bindKey:o("Tab","Tab"),exec:function(e){e.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",bindKey:o("Ctrl-[","Ctrl-["),exec:function(e){e.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",bindKey:o("Ctrl-]","Ctrl-]"),exec:function(e){e.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",exec:function(e,t){e.insert(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",exec:function(e,t){e.insert(r.stringRepeat(t.text||"",t.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",bindKey:o(null,"Ctrl-O"),exec:function(e){e.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",bindKey:o("Ctrl-T","Ctrl-T"),exec:function(e){e.transposeLetters()},multiSelectAction:function(e){e.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",bindKey:o("Ctrl-U","Ctrl-U"),exec:function(e){e.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",bindKey:o("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(e){e.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"expandtoline",bindKey:o("Ctrl-Shift-L","Command-Shift-L"),exec:function(e){var t=e.selection.getRange();t.start.column=t.end.column=0,t.end.row++,e.selection.setRange(t,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"joinlines",bindKey:o(null,null),exec:function(e){var t=e.selection.isBackwards(),n=t?e.selection.getSelectionLead():e.selection.getSelectionAnchor(),i=t?e.selection.getSelectionAnchor():e.selection.getSelectionLead(),o=e.session.doc.getLine(n.row).length,u=e.session.doc.getTextRange(e.selection.getRange()),a=u.replace(/\n\s*/," ").length,f=e.session.doc.getLine(n.row);for(var l=n.row+1;l<=i.row+1;l++){var c=r.stringTrimLeft(r.stringTrimRight(e.session.doc.getLine(l)));c.length!==0&&(c=" "+c),f+=c}i.row+10?(e.selection.moveCursorTo(n.row,n.column),e.selection.selectTo(n.row,n.column+a)):(o=e.session.doc.getLine(n.row).length>o?o+1:o,e.selection.moveCursorTo(n.row,o))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",bindKey:o(null,null),exec:function(e){var t=e.session.doc.getLength()-1,n=e.session.doc.getLine(t).length,r=e.selection.rangeList.ranges,i=[];r.length<1&&(r=[e.selection.getRange()]);for(var o=0;o=r.lastRow||n.end.row<=r.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead);break;default:}t.scrollIntoView=="animate"&&this.renderer.animateScrolling(this.curOp.scrollTop)}this.prevOp=this.curOp,this.curOp=null}},this.$mergeableCommands=["backspace","del","insertstring"],this.$historyTracker=function(e){if(!this.$mergeUndoDeltas)return;var t=this.prevOp,n=this.$mergeableCommands,r=t.command&&e.command.name==t.command.name;if(e.command.name=="insertstring"){var i=e.args;this.mergeNextCommand===undefined&&(this.mergeNextCommand=!0),r=r&&this.mergeNextCommand&&(!/\s/.test(i)||/\s/.test(t.args)),this.mergeNextCommand=!0}else r=r&&n.indexOf(e.command.name)!==-1;this.$mergeUndoDeltas!="always"&&Date.now()-this.sequenceStartTime>2e3&&(r=!1),r?this.session.mergeUndoDeltas=!0:n.indexOf(e.command.name)!==-1&&(this.sequenceStartTime=Date.now())},this.setKeyboardHandler=function(e,t){if(e&&typeof e=="string"){this.$keybindingId=e;var n=this;g.loadModule(["keybinding",e],function(r){n.$keybindingId==e&&n.keyBinding.setKeyboardHandler(r&&r.handler),t&&t()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(e),t&&t()},this.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},this.setSession=function(e){if(this.session==e)return;var t=this.session;if(t){this.session.removeEventListener("change",this.$onDocumentChange),this.session.removeEventListener("changeMode",this.$onChangeMode),this.session.removeEventListener("tokenizerUpdate",this.$onTokenizerUpdate),this.session.removeEventListener("changeTabSize",this.$onChangeTabSize),this.session.removeEventListener("changeWrapLimit",this.$onChangeWrapLimit),this.session.removeEventListener("changeWrapMode",this.$onChangeWrapMode),this.session.removeEventListener("onChangeFold",this.$onChangeFold),this.session.removeEventListener("changeFrontMarker",this.$onChangeFrontMarker),this.session.removeEventListener("changeBackMarker",this.$onChangeBackMarker),this.session.removeEventListener("changeBreakpoint",this.$onChangeBreakpoint),this.session.removeEventListener("changeAnnotation",this.$onChangeAnnotation),this.session.removeEventListener("changeOverwrite",this.$onCursorChange),this.session.removeEventListener("changeScrollTop",this.$onScrollTopChange),this.session.removeEventListener("changeScrollLeft",this.$onScrollLeftChange);var n=this.session.getSelection();n.removeEventListener("changeCursor",this.$onCursorChange),n.removeEventListener("changeSelection",this.$onSelectionChange)}this.session=e,e?(this.$onDocumentChange=this.onDocumentChange.bind(this),e.addEventListener("change",this.$onDocumentChange),this.renderer.setSession(e),this.$onChangeMode=this.onChangeMode.bind(this),e.addEventListener("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),e.addEventListener("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),e.addEventListener("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),e.addEventListener("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),e.addEventListener("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),e.addEventListener("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.addEventListener("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.addEventListener("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.addEventListener("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.addEventListener("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.addEventListener("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.addEventListener("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.addEventListener("changeScrollLeft",this.$onScrollLeftChange),this.selection=e.getSelection(),this.selection.addEventListener("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.addEventListener("changeSelection",this.$onSelectionChange),this.onChangeMode(),this.$blockScrolling+=1,this.onCursorChange(),this.$blockScrolling-=1,this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(e)),this._signal("changeSession",{session:e,oldSession:t}),t&&t._signal("changeEditor",{oldEditor:this}),e&&e._signal("changeEditor",{editor:this})},this.getSession=function(){return this.session},this.setValue=function(e,t){return this.session.doc.setValue(e),t?t==1?this.navigateFileEnd():t==-1&&this.navigateFileStart():this.selectAll(),e},this.getValue=function(){return this.session.getValue()},this.getSelection=function(){return this.selection},this.resize=function(e){this.renderer.onResize(e)},this.setTheme=function(e,t){this.renderer.setTheme(e,t)},this.getTheme=function(){return this.renderer.getTheme()},this.setStyle=function(e){this.renderer.setStyle(e)},this.unsetStyle=function(e){this.renderer.unsetStyle(e)},this.getFontSize=function(){return this.getOption("fontSize")||i.computedStyle(this.container,"fontSize")},this.setFontSize=function(e){this.setOption("fontSize",e)},this.$highlightBrackets=function(){this.session.$bracketHighlight&&(this.session.removeMarker(this.session.$bracketHighlight),this.session.$bracketHighlight=null);if(this.$highlightPending)return;var e=this;this.$highlightPending=!0,setTimeout(function(){e.$highlightPending=!1;var t=e.session;if(!t||!t.bgTokenizer)return;var n=t.findMatchingBracket(e.getCursorPosition());if(n)var r=new p(n.row,n.column,n.row,n.column+1);else if(t.$mode.getMatching)var r=t.$mode.getMatching(e.session);r&&(t.$bracketHighlight=t.addMarker(r,"ace_bracket","text"))},50)},this.$highlightTags=function(){if(this.$highlightTagPending)return;var e=this;this.$highlightTagPending=!0,setTimeout(function(){e.$highlightTagPending=!1;var t=e.session;if(!t||!t.bgTokenizer)return;var n=e.getCursorPosition(),r=new y(e.session,n.row,n.column),i=r.getCurrentToken();if(!i||!/\b(?:tag-open|tag-name)/.test(i.type)){t.removeMarker(t.$tagHighlight),t.$tagHighlight=null;return}i.type.indexOf("tag-open")!=-1&&(i=r.stepForward());var s=i.value,o=0,u=r.stepBackward();if(u.value=="<"){do u=i,i=r.stepForward(),i&&i.value===s&&i.type.indexOf("tag-name")!==-1&&(u.value==="<"?o++:u.value==="=0)}else{do i=u,u=r.stepBackward(),i&&i.value===s&&i.type.indexOf("tag-name")!==-1&&(u.value==="<"?o++:u.value==="1)&&(t=!1)}if(e.$highlightLineMarker&&!t)e.removeMarker(e.$highlightLineMarker.id),e.$highlightLineMarker=null;else if(!e.$highlightLineMarker&&t){var n=new p(t.row,t.column,t.row,Infinity);n.id=e.addMarker(n,"ace_active-line","screenLine"),e.$highlightLineMarker=n}else t&&(e.$highlightLineMarker.start.row=t.row,e.$highlightLineMarker.end.row=t.row,e.$highlightLineMarker.start.column=t.column,e._signal("changeBackMarker"))},this.onSelectionChange=function(e){var t=this.session;t.$selectionMarker&&t.removeMarker(t.$selectionMarker),t.$selectionMarker=null;if(!this.selection.isEmpty()){var n=this.selection.getRange(),r=this.getSelectionStyle();t.$selectionMarker=t.addMarker(n,"ace_selection",r)}else this.$updateHighlightActiveLine();var i=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(i),this._signal("changeSelection")},this.$getSelectionHighLightRegexp=function(){var e=this.session,t=this.getSelectionRange();if(t.isEmpty()||t.isMultiLine())return;var n=t.start.column-1,r=t.end.column+1,i=e.getLine(t.start.row),s=i.length,o=i.substring(Math.max(n,0),Math.min(r,s));if(n>=0&&/^[\w\d]/.test(o)||r<=s&&/[\w\d]$/.test(o))return;o=i.substring(t.start.column,t.end.column);if(!/^[\w\d]+$/.test(o))return;var u=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:o});return u},this.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},this.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},this.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},this.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},this.onChangeMode=function(e){this.renderer.updateText(),this._emit("changeMode",e)},this.onChangeWrapLimit=function(){this.renderer.updateFull()},this.onChangeWrapMode=function(){this.renderer.onResize(!0)},this.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},this.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},this.getCopyText=function(){var e=this.getSelectedText();return this._signal("copy",e),e},this.onCopy=function(){this.commands.exec("copy",this)},this.onCut=function(){this.commands.exec("cut",this)},this.onPaste=function(e){if(this.$readOnly)return;var t={text:e};this._signal("paste",t),e=t.text;if(!this.inMultiSelectMode||this.inVirtualSelectionMode)this.insert(e);else{var n=e.split(/\r\n|\r|\n/),r=this.selection.rangeList.ranges;if(n.length>r.length||n.length<2||!n[1])return this.commands.exec("insertstring",this,e);for(var i=r.length;i--;){var s=r[i];s.isEmpty()||this.session.remove(s),this.session.insert(s.start,n[i])}}this.renderer.scrollCursorIntoView()},this.execCommand=function(e,t){return this.commands.exec(e,this,t)},this.insert=function(e,t){var n=this.session,r=n.getMode(),i=this.getCursorPosition();if(this.getBehavioursEnabled()&&!t){var s=r.transformAction(n.getState(i.row),"insertion",this,n,e);s&&(e!==s.text&&(this.session.mergeUndoDeltas=!1,this.$mergeNextCommand=!1),e=s.text)}e==" "&&(e=this.session.getTabString());if(!this.selection.isEmpty()){var o=this.getSelectionRange();i=this.session.remove(o),this.clearSelection()}else if(this.session.getOverwrite()){var o=new p.fromPoints(i,i);o.end.column+=e.length,this.session.remove(o)}if(e=="\n"||e=="\r\n"){var u=n.getLine(i.row);if(i.column>u.search(/\S|$/)){var a=u.substr(i.column).search(/\S|$/);n.doc.removeInLine(i.row,i.column,i.column+a)}}this.clearSelection();var f=i.column,l=n.getState(i.row),u=n.getLine(i.row),c=r.checkOutdent(l,u,e),h=n.insert(i,e);s&&s.selection&&(s.selection.length==2?this.selection.setSelectionRange(new p(i.row,f+s.selection[0],i.row,f+s.selection[1])):this.selection.setSelectionRange(new p(i.row+s.selection[0],s.selection[1],i.row+s.selection[2],s.selection[3])));if(n.getDocument().isNewLine(e)){var d=r.getNextLineIndent(l,u.slice(0,i.column),n.getTabString());n.insert({row:i.row+1,column:0},d)}c&&r.autoOutdent(l,n,i.row)},this.onTextInput=function(e){this.keyBinding.onTextInput(e)},this.onCommandKey=function(e,t,n){this.keyBinding.onCommandKey(e,t,n)},this.setOverwrite=function(e){this.session.setOverwrite(e)},this.getOverwrite=function(){return this.session.getOverwrite()},this.toggleOverwrite=function(){this.session.toggleOverwrite()},this.setScrollSpeed=function(e){this.setOption("scrollSpeed",e)},this.getScrollSpeed=function(){return this.getOption("scrollSpeed")},this.setDragDelay=function(e){this.setOption("dragDelay",e)},this.getDragDelay=function(){return this.getOption("dragDelay")},this.setSelectionStyle=function(e){this.setOption("selectionStyle",e)},this.getSelectionStyle=function(){return this.getOption("selectionStyle")},this.setHighlightActiveLine=function(e){this.setOption("highlightActiveLine",e)},this.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.setHighlightSelectedWord=function(e){this.setOption("highlightSelectedWord",e)},this.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},this.setAnimatedScroll=function(e){this.renderer.setAnimatedScroll(e)},this.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},this.setShowInvisibles=function(e){this.renderer.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setDisplayIndentGuides=function(e){this.renderer.setDisplayIndentGuides(e)},this.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},this.setShowPrintMargin=function(e){this.renderer.setShowPrintMargin(e)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(e){this.renderer.setPrintMarginColumn(e)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.setReadOnly=function(e){this.setOption("readOnly",e)},this.getReadOnly=function(){return this.getOption("readOnly")},this.setBehavioursEnabled=function(e){this.setOption("behavioursEnabled",e)},this.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},this.setWrapBehavioursEnabled=function(e){this.setOption("wrapBehavioursEnabled",e)},this.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},this.setShowFoldWidgets=function(e){this.setOption("showFoldWidgets",e)},this.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.remove=function(e){this.selection.isEmpty()&&(e=="left"?this.selection.selectLeft():this.selection.selectRight());var t=this.getSelectionRange();if(this.getBehavioursEnabled()){var n=this.session,r=n.getState(t.start.row),i=n.getMode().transformAction(r,"deletion",this,n,t);if(t.end.column===0){var s=n.getTextRange(t);if(s[s.length-1]=="\n"){var o=n.getLine(t.end.row);/^\s+$/.test(o)&&(t.end.column=o.length)}}i&&(t=i)}this.session.remove(t),this.clearSelection()},this.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var e=this.getSelectionRange();e.start.column==e.end.column&&e.start.row==e.end.row&&(e.end.column=0,e.end.row++),this.session.remove(e),this.clearSelection()},this.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var e=this.getCursorPosition();this.insert("\n"),this.moveCursorToPosition(e)},this.transposeLetters=function(){if(!this.selection.isEmpty())return;var e=this.getCursorPosition(),t=e.column;if(t===0)return;var n=this.session.getLine(e.row),r,i;tt.toLowerCase()?1:0});var r=new p(0,0,0,0);for(var i=e.first;i<=e.last;i++){var s=t.getLine(i);r.start.row=i,r.end.row=i,r.end.column=s.length,t.replace(r,n[i-e.first])}},this.toggleCommentLines=function(){var e=this.session.getState(this.getCursorPosition().row),t=this.$getSelectedRows();this.session.getMode().toggleCommentLines(e,this.session,t.first,t.last)},this.toggleBlockComment=function(){var e=this.getCursorPosition(),t=this.session.getState(e.row),n=this.getSelectionRange();this.session.getMode().toggleBlockComment(t,this.session,n,e)},this.getNumberAt=function(e,t){var n=/[\-]?[0-9]+(?:\.[0-9]+)?/g;n.lastIndex=0;var r=this.session.getLine(e);while(n.lastIndex=t){var s={value:i[0],start:i.index,end:i.index+i[0].length};return s}}return null},this.modifyNumber=function(e){var t=this.selection.getCursor().row,n=this.selection.getCursor().column,r=new p(t,n-1,t,n),i=this.session.getTextRange(r);if(!isNaN(parseFloat(i))&&isFinite(i)){var s=this.getNumberAt(t,n);if(s){var o=s.value.indexOf(".")>=0?s.start+s.value.indexOf(".")+1:s.end,u=s.start+s.value.length-o,a=parseFloat(s.value);a*=Math.pow(10,u),o!==s.end&&np+1)break;p=d.last}l--,u=this.session.$moveLines(h,p,t?0:e),t&&e==-1&&(c=l+1);while(c<=l)o[c].moveBy(u,0),c++;t||(u=0),a+=u}i.fromOrientedRange(i.ranges[0]),i.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},this.$getSelectedRows=function(e){return e=(e||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(e.start.row),last:this.session.getRowFoldEnd(e.end.row)}},this.onCompositionStart=function(e){this.renderer.showComposition(this.getCursorPosition())},this.onCompositionUpdate=function(e){this.renderer.setCompositionText(e)},this.onCompositionEnd=function(){this.renderer.hideComposition()},this.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},this.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},this.isRowVisible=function(e){return e>=this.getFirstVisibleRow()&&e<=this.getLastVisibleRow()},this.isRowFullyVisible=function(e){return e>=this.renderer.getFirstFullyVisibleRow()&&e<=this.renderer.getLastFullyVisibleRow()},this.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},this.$moveByPage=function(e,t){var n=this.renderer,r=this.renderer.layerConfig,i=e*Math.floor(r.height/r.lineHeight);this.$blockScrolling++,t===!0?this.selection.$moveSelection(function(){this.moveCursorBy(i,0)}):t===!1&&(this.selection.moveCursorBy(i,0),this.selection.clearSelection()),this.$blockScrolling--;var s=n.scrollTop;n.scrollBy(0,i*r.lineHeight),t!=null&&n.scrollCursorIntoView(null,.5),n.animateScrolling(s)},this.selectPageDown=function(){this.$moveByPage(1,!0)},this.selectPageUp=function(){this.$moveByPage(-1,!0)},this.gotoPageDown=function(){this.$moveByPage(1,!1)},this.gotoPageUp=function(){this.$moveByPage(-1,!1)},this.scrollPageDown=function(){this.$moveByPage(1)},this.scrollPageUp=function(){this.$moveByPage(-1)},this.scrollToRow=function(e){this.renderer.scrollToRow(e)},this.scrollToLine=function(e,t,n,r){this.renderer.scrollToLine(e,t,n,r)},this.centerSelection=function(){var e=this.getSelectionRange(),t={row:Math.floor(e.start.row+(e.end.row-e.start.row)/2),column:Math.floor(e.start.column+(e.end.column-e.start.column)/2)};this.renderer.alignCursor(t,.5)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},this.getSelectionRange=function(){return this.selection.getRange()},this.selectAll=function(){this.$blockScrolling+=1,this.selection.selectAll(),this.$blockScrolling-=1},this.clearSelection=function(){this.selection.clearSelection()},this.moveCursorTo=function(e,t){this.selection.moveCursorTo(e,t)},this.moveCursorToPosition=function(e){this.selection.moveCursorToPosition(e)},this.jumpToMatching=function(e,t){var n=this.getCursorPosition(),r=new y(this.session,n.row,n.column),i=r.getCurrentToken(),s=i||r.stepForward();if(!s)return;var o,u=!1,a={},f=n.column-s.start,l,c={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(s.value.match(/[{}()\[\]]/g))for(;f=0;--s)this.$tryReplace(n[s],e)&&r++;return this.selection.setSelectionRange(i),this.$blockScrolling-=1,r},this.$tryReplace=function(e,t){var n=this.session.getTextRange(e);return t=this.$search.replace(n,t),t!==null?(e.end=this.session.replace(e,t),e):null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(e,t,n){t||(t={}),typeof e=="string"||e instanceof RegExp?t.needle=e:typeof e=="object"&&r.mixin(t,e);var i=this.selection.getRange();t.needle==null&&(e=this.session.getTextRange(i)||this.$search.$options.needle,e||(i=this.session.getWordRange(i.start.row,i.start.column),e=this.session.getTextRange(i)),this.$search.set({needle:e})),this.$search.set(t),t.start||this.$search.set({start:i});var s=this.$search.find(this.session);if(t.preventScroll)return s;if(s)return this.revealRange(s,n),s;t.backwards?i.start=i.end:i.end=i.start,this.selection.setRange(i)},this.findNext=function(e,t){this.find({skipCurrent:!0,backwards:!1},e,t)},this.findPrevious=function(e,t){this.find(e,{skipCurrent:!0,backwards:!0},t)},this.revealRange=function(e,t){this.$blockScrolling+=1,this.session.unfold(e),this.selection.setSelectionRange(e),this.$blockScrolling-=1;var n=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(e.start,e.end,.5),t!==!1&&this.renderer.animateScrolling(n)},this.undo=function(){this.$blockScrolling++,this.session.getUndoManager().undo(),this.$blockScrolling--,this.renderer.scrollCursorIntoView(null,.5)},this.redo=function(){this.$blockScrolling++,this.session.getUndoManager().redo(),this.$blockScrolling--,this.renderer.scrollCursorIntoView(null,.5)},this.destroy=function(){this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy()},this.setAutoScrollEditorIntoView=function(e){if(!e)return;var t,n=this,r=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var i=this.$scrollAnchor;i.style.cssText="position:absolute",this.container.insertBefore(i,this.container.firstChild);var s=this.on("changeSelection",function(){r=!0}),o=this.renderer.on("beforeRender",function(){r&&(t=n.renderer.container.getBoundingClientRect())}),u=this.renderer.on("afterRender",function(){if(r&&t&&(n.isFocused()||n.searchBox&&n.searchBox.isFocused())){var e=n.renderer,s=e.$cursorLayer.$pixelPos,o=e.layerConfig,u=s.top-o.offset;s.top>=0&&u+t.top<0?r=!0:s.topwindow.innerHeight?r=!1:r=null,r!=null&&(i.style.top=u+"px",i.style.left=s.left+"px",i.style.height=o.lineHeight+"px",i.scrollIntoView(r)),r=t=null}});this.setAutoScrollEditorIntoView=function(e){if(e)return;delete this.setAutoScrollEditorIntoView,this.removeEventListener("changeSelection",s),this.renderer.removeEventListener("afterRender",u),this.renderer.removeEventListener("beforeRender",o)}},this.$resetCursorStyle=function(){var e=this.$cursorStyle||"ace",t=this.renderer.$cursorLayer;if(!t)return;t.setSmoothBlinking(/smooth/.test(e)),t.isBlinking=!this.$readOnly&&e!="wide",i.setCssClass(t.element,"ace_slim-cursors",/slim/.test(e))}}).call(b.prototype),g.defineOptions(b.prototype,"editor",{selectionStyle:{set:function(e){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:e})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(e){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(e){this.$resetCursorStyle()},initialValue:!1},cursorStyle:{set:function(e){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},autoScrollEditorIntoView:{set:function(e){this.setAutoScrollEditorIntoView(e)}},hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",showLineNumbers:"renderer",showGutter:"renderer",displayIndentGuides:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",tabSize:"session",wrap:"session",foldStyle:"session",mode:"session"}),t.Editor=b}),ace.define("ace/undomanager",["require","exports","module"],function(e,t,n){"use strict";var r=function(){this.reset()};(function(){this.execute=function(e){var t=e.args[0];this.$doc=e.args[1],e.merge&&this.hasUndo()&&(this.dirtyCounter--,t=this.$undoStack.pop().concat(t)),this.$undoStack.push(t),this.$redoStack=[],this.dirtyCounter<0&&(this.dirtyCounter=NaN),this.dirtyCounter++},this.undo=function(e){var t=this.$undoStack.pop(),n=null;return t&&(n=this.$doc.undoChanges(t,e),this.$redoStack.push(t),this.dirtyCounter--),n},this.redo=function(e){var t=this.$redoStack.pop(),n=null;return t&&(n=this.$doc.redoChanges(t,e),this.$undoStack.push(t),this.dirtyCounter++),n},this.reset=function(){this.$undoStack=[],this.$redoStack=[],this.dirtyCounter=0},this.hasUndo=function(){return this.$undoStack.length>0},this.hasRedo=function(){return this.$redoStack.length>0},this.markClean=function(){this.dirtyCounter=0},this.isClean=function(){return this.dirtyCounter===0}}).call(r.prototype),t.UndoManager=r}),ace.define("ace/layer/gutter",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=e("../lib/oop"),s=e("../lib/lang"),o=e("../lib/event_emitter").EventEmitter,u=function(e){this.element=r.createElement("div"),this.element.className="ace_layer ace_gutter-layer",e.appendChild(this.element),this.setShowFoldWidgets(this.$showFoldWidgets),this.gutterWidth=0,this.$annotations=[],this.$updateAnnotations=this.$updateAnnotations.bind(this),this.$cells=[]};(function(){i.implement(this,o),this.setSession=function(e){this.session&&this.session.removeEventListener("change",this.$updateAnnotations),this.session=e,e&&e.on("change",this.$updateAnnotations)},this.addGutterDecoration=function(e,t){window.console&&console.warn&&console.warn("deprecated use session.addGutterDecoration"),this.session.addGutterDecoration(e,t)},this.removeGutterDecoration=function(e,t){window.console&&console.warn&&console.warn("deprecated use session.removeGutterDecoration"),this.session.removeGutterDecoration(e,t)},this.setAnnotations=function(e){this.$annotations=[];for(var t=0;to&&(v=s.end.row+1,s=t.getNextFoldLine(v,s),o=s?s.start.row:Infinity);if(v>i){while(this.$cells.length>d+1)p=this.$cells.pop(),this.element.removeChild(p.element);break}p=this.$cells[++d],p||(p={element:null,textNode:null,foldWidget:null},p.element=r.createElement("div"),p.textNode=document.createTextNode(""),p.element.appendChild(p.textNode),this.element.appendChild(p.element),this.$cells[d]=p);var m="ace_gutter-cell ";a[v]&&(m+=a[v]),f[v]&&(m+=f[v]),this.$annotations[v]&&(m+=this.$annotations[v].className),p.element.className!=m&&(p.element.className=m);var g=t.getRowLength(v)*e.lineHeight+"px";g!=p.element.style.height&&(p.element.style.height=g);if(u){var y=u[v];y==null&&(y=u[v]=t.getFoldWidget(v))}if(y){p.foldWidget||(p.foldWidget=r.createElement("span"),p.element.appendChild(p.foldWidget));var m="ace_fold-widget ace_"+y;y=="start"&&v==o&&vn.right-t.right)return"foldWidgets"}}).call(u.prototype),t.Gutter=u}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(e,t,n){"use strict";var r=e("../range").Range,i=e("../lib/dom"),s=function(e){this.element=i.createElement("div"),this.element.className="ace_layer ace_marker-layer",e.appendChild(this.element)};(function(){this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setMarkers=function(e){this.markers=e},this.update=function(e){var e=e||this.config;if(!e)return;this.config=e;var t=[];for(var n in this.markers){var r=this.markers[n];if(!r.range){r.update(t,this,this.session,e);continue}var i=r.range.clipRows(e.firstRow,e.lastRow);if(i.isEmpty())continue;i=i.toScreenRange(this.session);if(r.renderer){var s=this.$getTop(i.start.row,e),o=this.$padding+i.start.column*e.characterWidth;r.renderer(t,i,o,s,e)}else r.type=="fullLine"?this.drawFullLineMarker(t,i,r.clazz,e):r.type=="screenLine"?this.drawScreenLineMarker(t,i,r.clazz,e):i.isMultiLine()?r.type=="text"?this.drawTextMarker(t,i,r.clazz,e):this.drawMultiLineMarker(t,i,r.clazz,e):this.drawSingleLineMarker(t,i,r.clazz+" ace_start",e)}this.element.innerHTML=t.join("")},this.$getTop=function(e,t){return(e-t.firstRowScreen)*t.lineHeight},this.drawTextMarker=function(e,t,n,i,s){var o=t.start.row,u=new r(o,t.start.column,o,this.session.getScreenLastRowColumn(o));this.drawSingleLineMarker(e,u,n+" ace_start",i,1,s),o=t.end.row,u=new r(o,0,o,t.end.column),this.drawSingleLineMarker(e,u,n,i,0,s);for(o=t.start.row+1;o"),u=this.$getTop(t.end.row,r);var f=t.end.column*r.characterWidth;e.push("
    "),o=(t.end.row-t.start.row-1)*r.lineHeight;if(o<0)return;u=this.$getTop(t.start.row+1,r),e.push("
    ")},this.drawSingleLineMarker=function(e,t,n,r,i,s){var o=r.lineHeight,u=(t.end.column+(i||0)-t.start.column)*r.characterWidth,a=this.$getTop(t.start.row,r),f=this.$padding+t.start.column*r.characterWidth;e.push("
    ")},this.drawFullLineMarker=function(e,t,n,r,i){var s=this.$getTop(t.start.row,r),o=r.lineHeight;t.start.row!=t.end.row&&(o+=this.$getTop(t.end.row,r)-s),e.push("
    ")},this.drawScreenLineMarker=function(e,t,n,r,i){var s=this.$getTop(t.start.row,r),o=r.lineHeight;e.push("
    ")}}).call(s.prototype),t.Marker=s}),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/dom"),s=e("../lib/lang"),o=e("../lib/useragent"),u=e("../lib/event_emitter").EventEmitter,a=function(e){this.element=i.createElement("div"),this.element.className="ace_layer ace_text-layer",e.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this)};(function(){r.implement(this,u),this.EOF_CHAR="\u00b6",this.EOL_CHAR_LF="\u00ac",this.EOL_CHAR_CRLF="\u00a4",this.EOL_CHAR=this.EOL_CHAR_LF,this.TAB_CHAR="\u2192",this.SPACE_CHAR="\u00b7",this.$padding=0,this.$updateEolChar=function(){var e=this.session.doc.getNewLineCharacter()=="\n"?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=e)return this.EOL_CHAR=e,!0},this.setPadding=function(e){this.$padding=e,this.element.style.padding="0 "+e+"px"},this.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},this.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},this.$setFontMetrics=function(e){this.$fontMetrics=e,this.$fontMetrics.on("changeCharacterSize",function(e){this._signal("changeCharacterSize",e)}.bind(this)),this.$pollSizeChanges()},this.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},this.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},this.setSession=function(e){this.session=e,e&&this.$computeTabString()},this.showInvisibles=!1,this.setShowInvisibles=function(e){return this.showInvisibles==e?!1:(this.showInvisibles=e,this.$computeTabString(),!0)},this.displayIndentGuides=!0,this.setDisplayIndentGuides=function(e){return this.displayIndentGuides==e?!1:(this.displayIndentGuides=e,this.$computeTabString(),!0)},this.$tabStrings=[],this.onChangeTabSize=this.$computeTabString=function(){var e=this.session.getTabSize();this.tabSize=e;var t=this.$tabStrings=[0];for(var n=1;n"+this.TAB_CHAR+s.stringRepeat("\u00a0",n-1)+""):t.push(s.stringRepeat("\u00a0",n));if(this.displayIndentGuides){this.$indentGuideRe=/\s\S| \t|\t |\s$/;var r="ace_indent-guide",i="",o="";if(this.showInvisibles){r+=" ace_invisible",i=" ace_invisible_space",o=" ace_invisible_tab";var u=s.stringRepeat(this.SPACE_CHAR,this.tabSize),a=this.TAB_CHAR+s.stringRepeat("\u00a0",this.tabSize-1)}else var u=s.stringRepeat("\u00a0",this.tabSize),a=u;this.$tabStrings[" "]=""+u+"",this.$tabStrings[" "]=""+a+""}},this.updateLines=function(e,t,n){(this.config.lastRow!=e.lastRow||this.config.firstRow!=e.firstRow)&&this.scrollLines(e),this.config=e;var r=Math.max(t,e.firstRow),i=Math.min(n,e.lastRow),s=this.element.childNodes,o=0;for(var u=e.firstRow;uf&&(u=a.end.row+1,a=this.session.getNextFoldLine(u,a),f=a?a.start.row:Infinity);if(u>i)break;var l=s[o++];if(l){var c=[];this.$renderLine(c,u,!this.$useLineGroups(),u==f?a:!1),l.style.height=e.lineHeight*this.session.getRowLength(u)+"px",l.innerHTML=c.join("")}u++}},this.scrollLines=function(e){var t=this.config;this.config=e;if(!t||t.lastRow0;r--)n.removeChild(n.firstChild);if(t.lastRow>e.lastRow)for(var r=this.session.getFoldedRowCount(e.lastRow+1,t.lastRow);r>0;r--)n.removeChild(n.lastChild);if(e.firstRowt.lastRow){var i=this.$renderLinesFragment(e,t.lastRow+1,e.lastRow);n.appendChild(i)}},this.$renderLinesFragment=function(e,t,n){var r=this.element.ownerDocument.createDocumentFragment(),s=t,o=this.session.getNextFoldLine(s),u=o?o.start.row:Infinity;for(;;){s>u&&(s=o.end.row+1,o=this.session.getNextFoldLine(s,o),u=o?o.start.row:Infinity);if(s>n)break;var a=i.createElement("div"),f=[];this.$renderLine(f,s,!1,s==u?o:!1),a.innerHTML=f.join("");if(this.$useLineGroups())a.className="ace_line_group",r.appendChild(a),a.style.height=e.lineHeight*this.session.getRowLength(s)+"px";else while(a.firstChild)r.appendChild(a.firstChild);s++}return r},this.update=function(e){this.config=e;var t=[],n=e.firstRow,r=e.lastRow,i=n,s=this.session.getNextFoldLine(i),o=s?s.start.row:Infinity;for(;;){i>o&&(i=s.end.row+1,s=this.session.getNextFoldLine(i,s),o=s?s.start.row:Infinity);if(i>r)break;this.$useLineGroups()&&t.push("
    "),this.$renderLine(t,i,!1,i==o?s:!1),this.$useLineGroups()&&t.push("
    "),i++}this.element.innerHTML=t.join("")},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderToken=function(e,t,n,r){var i=this,o=/\t|&|<|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\u3000\uFEFF])|[\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3000-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]/g,u=function(e,n,r,o,u){if(n)return i.showInvisibles?""+s.stringRepeat(i.SPACE_CHAR,e.length)+"":s.stringRepeat("\u00a0",e.length);if(e=="&")return"&";if(e=="<")return"<";if(e==" "){var a=i.session.getScreenTabSize(t+o);return t+=a-1,i.$tabStrings[a]}if(e=="\u3000"){var f=i.showInvisibles?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",l=i.showInvisibles?i.SPACE_CHAR:"";return t+=1,""+l+""}return r?""+i.SPACE_CHAR+"":(t+=1,""+e+"")},a=r.replace(o,u);if(!this.$textToken[n.type]){var f="ace_"+n.type.replace(/\./g," ace_"),l="";n.type=="fold"&&(l=" style='width:"+n.value.length*this.config.characterWidth+"px;' "),e.push("",a,"")}else e.push(a);return t+r.length},this.renderIndentGuide=function(e,t,n){var r=t.search(this.$indentGuideRe);return r<=0||r>=n?t:t[0]==" "?(r-=r%this.tabSize,e.push(s.stringRepeat(this.$tabStrings[" "],r/this.tabSize)),t.substr(r)):t[0]==" "?(e.push(s.stringRepeat(this.$tabStrings[" "],r)),t.substr(r)):t},this.$renderWrappedLine=function(e,t,n,r){var i=0,s=0,o=n[0],u=0;for(var a=0;a=o)u=this.$renderToken(e,u,f,l.substring(0,o-i)),l=l.substring(o-i),i=o,r||e.push("","
    "),s++,u=0,o=n[s]||Number.MAX_VALUE;l.length!=0&&(i+=l.length,u=this.$renderToken(e,u,f,l))}}},this.$renderSimpleLine=function(e,t){var n=0,r=t[0],i=r.value;this.displayIndentGuides&&(i=this.renderIndentGuide(e,i)),i&&(n=this.$renderToken(e,n,r,i));for(var s=1;s");if(i.length){var s=this.session.getRowSplitData(t);s&&s.length?this.$renderWrappedLine(e,i,s,n):this.$renderSimpleLine(e,i)}this.showInvisibles&&(r&&(t=r.end.row),e.push("",t==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,"")),n||e.push("
    ")},this.$getFoldLineTokens=function(e,t){function i(e,t,n){var i=0,s=0;while(s+e[i].value.lengthn-t&&(o=o.substring(0,n-t)),r.push({type:e[i].type,value:o}),s=t+o.length,i+=1}while(sn?r.push({type:e[i].type,value:o.substring(0,n-s)}):r.push(e[i]),s+=o.length,i+=1}}var n=this.session,r=[],s=n.getTokens(e);return t.walk(function(e,t,o,u,a){e!=null?r.push({type:"fold",value:e}):(a&&(s=n.getTokens(t)),s.length&&i(s,u,o))},t.end.row,this.session.getLine(t.end.row).length),r},this.$useLineGroups=function(){return this.session.getUseWrapMode()},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$measureNode&&this.$measureNode.parentNode.removeChild(this.$measureNode),delete this.$measureNode}}).call(a.prototype),t.Text=a}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";var r=e("../lib/dom"),i,s=function(e){this.element=r.createElement("div"),this.element.className="ace_layer ace_cursor-layer",e.appendChild(this.element),i===undefined&&(i="opacity"in this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),r.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateVisibility.bind(this)};(function(){this.$updateVisibility=function(e){var t=this.cursors;for(var n=t.length;n--;)t[n].style.visibility=e?"":"hidden"},this.$updateOpacity=function(e){var t=this.cursors;for(var n=t.length;n--;)t[n].style.opacity=e?"":"0"},this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setBlinking=function(e){e!=this.isBlinking&&(this.isBlinking=e,this.restartTimer())},this.setBlinkInterval=function(e){e!=this.blinkInterval&&(this.blinkInterval=e,this.restartTimer())},this.setSmoothBlinking=function(e){e!=this.smoothBlinking&&!i&&(this.smoothBlinking=e,r.setCssClass(this.element,"ace_smooth-blinking",e),this.$updateCursors(!0),this.$updateCursors=(e?this.$updateOpacity:this.$updateVisibility).bind(this),this.restartTimer())},this.addCursor=function(){var e=r.createElement("div");return e.className="ace_cursor",this.element.appendChild(e),this.cursors.push(e),e},this.removeCursor=function(){if(this.cursors.length>1){var e=this.cursors.pop();return e.parentNode.removeChild(e),e}},this.hideCursor=function(){this.isVisible=!1,r.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.showCursor=function(){this.isVisible=!0,r.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.restartTimer=function(){var e=this.$updateCursors;clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.smoothBlinking&&r.removeCssClass(this.element,"ace_smooth-blinking"),e(!0);if(!this.isBlinking||!this.blinkInterval||!this.isVisible)return;this.smoothBlinking&&setTimeout(function(){r.addCssClass(this.element,"ace_smooth-blinking")}.bind(this));var t=function(){this.timeoutId=setTimeout(function(){e(!1)},.6*this.blinkInterval)}.bind(this);this.intervalId=setInterval(function(){e(!0),t()},this.blinkInterval),t()},this.getPixelPosition=function(e,t){if(!this.config||!this.session)return{left:0,top:0};e||(e=this.session.selection.getCursor());var n=this.session.documentToScreenPosition(e),r=this.$padding+n.column*this.config.characterWidth,i=(n.row-(t?this.config.firstRowScreen:0))*this.config.lineHeight;return{left:r,top:i}},this.update=function(e){this.config=e;var t=this.session.$selectionMarkers,n=0,r=0;if(t===undefined||t.length===0)t=[{cursor:null}];for(var n=0,i=t.length;ne.height+e.offset||s.top<0)&&n>1)continue;var o=(this.cursors[r++]||this.addCursor()).style;this.drawCursor?this.drawCursor(o,s,e,t[n],this.session):(o.left=s.left+"px",o.top=s.top+"px",o.width=e.characterWidth+"px",o.height=e.lineHeight+"px")}while(this.cursors.length>r)this.removeCursor();var u=this.session.getOverwrite();this.$setOverwrite(u),this.$pixelPos=s,this.restartTimer()},this.drawCursor=null,this.$setOverwrite=function(e){e!=this.overwrite&&(this.overwrite=e,e?r.addCssClass(this.element,"ace_overwrite-cursors"):r.removeCssClass(this.element,"ace_overwrite-cursors"))},this.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)}}).call(s.prototype),t.Cursor=s}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/dom"),s=e("./lib/event"),o=e("./lib/event_emitter").EventEmitter,u=function(e){this.element=i.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+this.classSuffix,this.inner=i.createElement("div"),this.inner.className="ace_scrollbar-inner",this.element.appendChild(this.inner),e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,s.addListener(this.element,"scroll",this.onScroll.bind(this)),s.addListener(this.element,"mousedown",s.preventDefault)};(function(){r.implement(this,o),this.setVisible=function(e){this.element.style.display=e?"":"none",this.isVisible=e}}).call(u.prototype);var a=function(e,t){u.call(this,e),this.scrollTop=0,t.$scrollbarWidth=this.width=i.scrollbarWidth(e.ownerDocument),this.inner.style.width=this.element.style.width=(this.width||15)+5+"px"};r.inherits(a,u),function(){this.classSuffix="-v",this.onScroll=function(){this.skipEvent||(this.scrollTop=this.element.scrollTop,this._emit("scroll",{data:this.scrollTop})),this.skipEvent=!1},this.getWidth=function(){return this.isVisible?this.width:0},this.setHeight=function(e){this.element.style.height=e+"px"},this.setInnerHeight=function(e){this.inner.style.height=e+"px"},this.setScrollHeight=function(e){this.inner.style.height=e+"px"},this.setScrollTop=function(e){this.scrollTop!=e&&(this.skipEvent=!0,this.scrollTop=this.element.scrollTop=e)}}.call(a.prototype);var f=function(e,t){u.call(this,e),this.scrollLeft=0,this.height=t.$scrollbarWidth,this.inner.style.height=this.element.style.height=(this.height||15)+5+"px"};r.inherits(f,u),function(){this.classSuffix="-h",this.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},this.getHeight=function(){return this.isVisible?this.height:0},this.setWidth=function(e){this.element.style.width=e+"px"},this.setInnerWidth=function(e){this.inner.style.width=e+"px"},this.setScrollWidth=function(e){this.inner.style.width=e+"px"},this.setScrollLeft=function(e){this.scrollLeft!=e&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=e)}}.call(f.prototype),t.ScrollBar=a,t.ScrollBarV=a,t.ScrollBarH=f,t.VScrollBar=a,t.HScrollBar=f}),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(e,t,n){"use strict";var r=e("./lib/event"),i=function(e,t){this.onRender=e,this.pending=!1,this.changes=0,this.window=t||window};(function(){this.schedule=function(e){this.changes=this.changes|e;if(!this.pending&&this.changes){this.pending=!0;var t=this;r.nextFrame(function(){t.pending=!1;var e;while(e=t.changes)t.changes=0,t.onRender(e)},this.window)}}}).call(i.prototype),t.RenderLoop=i}),ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/lib/event_emitter"],function(e,t,n){var r=e("../lib/oop"),i=e("../lib/dom"),s=e("../lib/lang"),o=e("../lib/useragent"),u=e("../lib/event_emitter").EventEmitter,a=0,f=t.FontMetrics=function(e,t){this.el=i.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=i.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=i.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),e.appendChild(this.el),a||this.$testFractionalRect(),this.$measureNode.innerHTML=s.stringRepeat("X",a),this.$characterSize={width:0,height:0},this.checkForSizeChanges()};(function(){r.implement(this,u),this.$characterSize={width:0,height:0},this.$testFractionalRect=function(){var e=i.createElement("div");this.$setMeasureNodeStyles(e.style),e.style.width="0.2px",document.documentElement.appendChild(e);var t=e.getBoundingClientRect().width;t>0&&t<1?a=50:a=100,e.parentNode.removeChild(e)},this.$setMeasureNodeStyles=function(e,t){e.width=e.height="auto",e.left=e.top="0px",e.visibility="hidden",e.position="absolute",e.whiteSpace="pre",o.isIE<8?e["font-family"]="inherit":e.font="inherit",e.overflow=t?"hidden":"visible"},this.checkForSizeChanges=function(){var e=this.$measureSizes();if(e&&(this.$characterSize.width!==e.width||this.$characterSize.height!==e.height)){this.$measureNode.style.fontWeight="bold";var t=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=e,this.charSizes=Object.create(null),this.allowBoldFonts=t&&t.width===e.width&&t.height===e.height,this._emit("changeCharacterSize",{data:e})}},this.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer)return this.$pollSizeChangesTimer;var e=this;return this.$pollSizeChangesTimer=setInterval(function(){e.checkForSizeChanges()},500)},this.setPolling=function(e){e?this.$pollSizeChanges():this.$pollSizeChangesTimer&&this.$pollSizeChangesTimer},this.$measureSizes=function(){if(a===50){var e=null;try{e=this.$measureNode.getBoundingClientRect()}catch(t){e={width:0,height:0}}var n={height:e.height,width:e.width/a}}else var n={height:this.$measureNode.clientHeight,width:this.$measureNode.clientWidth/a};return n.width===0||n.height===0?null:n},this.$measureCharWidth=function(e){this.$main.innerHTML=s.stringRepeat(e,a);var t=this.$main.getBoundingClientRect();return t.width/a},this.getCharacterWidth=function(e){var t=this.charSizes[e];return t===undefined&&(this.charSizes[e]=this.$measureCharWidth(e)/this.$characterSize.width),t},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)}}).call(f.prototype)}),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/config","ace/lib/useragent","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/dom"),s=e("./config"),o=e("./lib/useragent"),u=e("./layer/gutter").Gutter,a=e("./layer/marker").Marker,f=e("./layer/text").Text,l=e("./layer/cursor").Cursor,c=e("./scrollbar").HScrollBar,h=e("./scrollbar").VScrollBar,p=e("./renderloop").RenderLoop,d=e("./layer/font_metrics").FontMetrics,v=e("./lib/event_emitter").EventEmitter,m='.ace_editor {position: relative;overflow: hidden;font: 12px/normal \'Monaco\', \'Menlo\', \'Ubuntu Mono\', \'Consolas\', \'source-code-pro\', monospace;direction: ltr;}.ace_scroller {position: absolute;overflow: hidden;top: 0;bottom: 0;background-color: inherit;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;cursor: text;}.ace_content {position: absolute;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;min-width: 100%;}.ace_dragging .ace_scroller:before{position: absolute;top: 0;left: 0;right: 0;bottom: 0;content: \'\';background: rgba(250, 250, 250, 0.01);z-index: 1000;}.ace_dragging.ace_dark .ace_scroller:before{background: rgba(0, 0, 0, 0.01);}.ace_selecting, .ace_selecting * {cursor: text !important;}.ace_gutter {position: absolute;overflow : hidden;width: auto;top: 0;bottom: 0;left: 0;cursor: default;z-index: 4;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;}.ace_gutter-active-line {position: absolute;left: 0;right: 0;}.ace_scroller.ace_scroll-left {box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;}.ace_gutter-cell {padding-left: 19px;padding-right: 6px;background-repeat: no-repeat;}.ace_gutter-cell.ace_error {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: 2px center;}.ace_gutter-cell.ace_warning {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");background-position: 2px center;}.ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");background-position: 2px center;}.ace_dark .ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");}.ace_scrollbar {position: absolute;right: 0;bottom: 0;z-index: 6;}.ace_scrollbar-inner {position: absolute;cursor: text;left: 0;top: 0;}.ace_scrollbar-v{overflow-x: hidden;overflow-y: scroll;top: 0;}.ace_scrollbar-h {overflow-x: scroll;overflow-y: hidden;left: 0;}.ace_print-margin {position: absolute;height: 100%;}.ace_text-input {position: absolute;z-index: 0;width: 0.5em;height: 1em;opacity: 0;background: transparent;-moz-appearance: none;appearance: none;border: none;resize: none;outline: none;overflow: hidden;font: inherit;padding: 0 1px;margin: 0 -1px;text-indent: -1em;-ms-user-select: text;-moz-user-select: text;-webkit-user-select: text;user-select: text;}.ace_text-input.ace_composition {background: inherit;color: inherit;z-index: 1000;opacity: 1;text-indent: 0;}.ace_layer {z-index: 1;position: absolute;overflow: hidden;white-space: pre;height: 100%;width: 100%;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;pointer-events: none;}.ace_gutter-layer {position: relative;width: auto;text-align: right;pointer-events: auto;}.ace_text-layer {font: inherit !important;}.ace_cjk {display: inline-block;text-align: center;}.ace_cursor-layer {z-index: 4;}.ace_cursor {z-index: 4;position: absolute;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;border-left: 2px solid}.ace_slim-cursors .ace_cursor {border-left-width: 1px;}.ace_overwrite-cursors .ace_cursor {border-left-width: 0;border-bottom: 1px solid;}.ace_hidden-cursors .ace_cursor {opacity: 0.2;}.ace_smooth-blinking .ace_cursor {-webkit-transition: opacity 0.18s;transition: opacity 0.18s;}.ace_editor.ace_multiselect .ace_cursor {border-left-width: 1px;}.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {position: absolute;z-index: 3;}.ace_marker-layer .ace_selection {position: absolute;z-index: 5;}.ace_marker-layer .ace_bracket {position: absolute;z-index: 6;}.ace_marker-layer .ace_active-line {position: absolute;z-index: 2;}.ace_marker-layer .ace_selected-word {position: absolute;z-index: 4;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;}.ace_line .ace_fold {-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;display: inline-block;height: 11px;margin-top: -2px;vertical-align: middle;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");background-repeat: no-repeat, repeat-x;background-position: center center, top left;color: transparent;border: 1px solid black;border-radius: 2px;cursor: pointer;pointer-events: auto;}.ace_dark .ace_fold {}.ace_fold:hover{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");}.ace_tooltip {background-color: #FFF;background-image: -webkit-linear-gradient(top, transparent, rgba(0, 0, 0, 0.1));background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));border: 1px solid gray;border-radius: 1px;box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);color: black;max-width: 100%;padding: 3px 4px;position: fixed;z-index: 999999;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;cursor: default;white-space: pre;word-wrap: break-word;line-height: normal;font-style: normal;font-weight: normal;letter-spacing: normal;pointer-events: none;}.ace_folding-enabled > .ace_gutter-cell {padding-right: 13px;}.ace_fold-widget {-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;margin: 0 -12px 0 1px;display: none;width: 11px;vertical-align: top;background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: center;border-radius: 3px;border: 1px solid transparent;cursor: pointer;}.ace_folding-enabled .ace_fold-widget {display: inline-block; }.ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");}.ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");}.ace_fold-widget:hover {border: 1px solid rgba(0, 0, 0, 0.3);background-color: rgba(255, 255, 255, 0.2);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);}.ace_fold-widget:active {border: 1px solid rgba(0, 0, 0, 0.4);background-color: rgba(0, 0, 0, 0.05);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);}.ace_dark .ace_fold-widget {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");}.ace_dark .ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget:hover {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);background-color: rgba(255, 255, 255, 0.1);}.ace_dark .ace_fold-widget:active {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);}.ace_fold-widget.ace_invalid {background-color: #FFB4B4;border-color: #DE5555;}.ace_fade-fold-widgets .ace_fold-widget {-webkit-transition: opacity 0.4s ease 0.05s;transition: opacity 0.4s ease 0.05s;opacity: 0;}.ace_fade-fold-widgets:hover .ace_fold-widget {-webkit-transition: opacity 0.05s ease 0.05s;transition: opacity 0.05s ease 0.05s;opacity:1;}.ace_underline {text-decoration: underline;}.ace_bold {font-weight: bold;}.ace_nobold .ace_bold {font-weight: normal;}.ace_italic {font-style: italic;}.ace_error-marker {background-color: rgba(255, 0, 0,0.2);position: absolute;z-index: 9;}.ace_highlight-marker {background-color: rgba(255, 255, 0,0.2);position: absolute;z-index: 8;}';i.importCssString(m,"ace_editor");var g=function(e,t){var n=this;this.container=e||i.createElement("div"),this.$keepTextAreaAtCursor=!o.isOldIE,i.addCssClass(this.container,"ace_editor"),this.setTheme(t),this.$gutter=i.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.scroller=i.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=i.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new u(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new a(this.content);var r=this.$textLayer=new f(this.content);this.canvas=r.element,this.$markerFront=new a(this.content),this.$cursorLayer=new l(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new h(this.container,this),this.scrollBarH=new c(this.container,this),this.scrollBarV.addEventListener("scroll",function(e){n.$scrollAnimation||n.session.setScrollTop(e.data-n.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(e){n.$scrollAnimation||n.session.setScrollLeft(e.data-n.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new d(this.container,500),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.addEventListener("changeCharacterSize",function(e){n.updateCharacterSize(),n.onResize(!0,n.gutterWidth,n.$size.width,n.$size.height),n._signal("changeCharacterSize",e)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$loop=new p(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),s.resetOptions(this),s._emit("renderer",this)};(function(){this.CHANGE_CURSOR=1,this.CHANGE_MARKER=2,this.CHANGE_GUTTER=4,this.CHANGE_SCROLL=8,this.CHANGE_LINES=16,this.CHANGE_TEXT=32,this.CHANGE_SIZE=64,this.CHANGE_MARKER_BACK=128,this.CHANGE_MARKER_FRONT=256,this.CHANGE_FULL=512,this.CHANGE_H_SCROLL=1024,r.implement(this,v),this.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin()},this.setSession=function(e){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=e,e&&this.scrollMargin.top&&e.getScrollTop()<=0&&e.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(e),this.$markerBack.setSession(e),this.$markerFront.setSession(e),this.$gutterLayer.setSession(e),this.$textLayer.setSession(e);if(!e)return;this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode)},this.updateLines=function(e,t,n){t===undefined&&(t=Infinity),this.$changedLines?(this.$changedLines.firstRow>e&&(this.$changedLines.firstRow=e),this.$changedLines.lastRowthis.layerConfig.lastRow)return;this.$loop.schedule(this.CHANGE_LINES)},this.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar()},this.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},this.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},this.updateFull=function(e){e?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},this.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},this.$changes=0,this.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},this.onResize=function(e,t,n,r){if(this.resizing>2)return;this.resizing>0?this.resizing++:this.resizing=e?1:0;var i=this.container;r||(r=i.clientHeight||i.scrollHeight),n||(n=i.clientWidth||i.scrollWidth);var s=this.$updateCachedSize(e,t,n,r);if(!this.$size.scrollerHeight||!n&&!r)return this.resizing=0;e&&(this.$gutterLayer.$padding=null),e?this.$renderChanges(s|this.$changes,!0):this.$loop.schedule(s|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarV.scrollLeft=this.scrollBarV.scrollTop=null},this.$updateCachedSize=function(e,t,n,r){r-=this.$extraHeight||0;var i=0,s=this.$size,o={width:s.width,height:s.height,scrollerHeight:s.scrollerHeight,scrollerWidth:s.scrollerWidth};r&&(e||s.height!=r)&&(s.height=r,i|=this.CHANGE_SIZE,s.scrollerHeight=s.height,this.$horizScroll&&(s.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",i|=this.CHANGE_SCROLL);if(n&&(e||s.width!=n)){i|=this.CHANGE_SIZE,s.width=n,t==null&&(t=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=t,this.scrollBarH.element.style.left=this.scroller.style.left=t+"px",s.scrollerWidth=Math.max(0,n-t-this.scrollBarV.getWidth()),this.scrollBarH.element.style.right=this.scroller.style.right=this.scrollBarV.getWidth()+"px",this.scroller.style.bottom=this.scrollBarH.getHeight()+"px";if(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||e)i|=this.CHANGE_FULL}return s.$dirty=!n||!r,i&&this._signal("resize",o),i},this.onGutterResize=function(){var e=this.$showGutter?this.$gutter.offsetWidth:0;e!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,e,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()?this.$loop.schedule(this.CHANGE_FULL):this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):(this.$computeLayerConfig(),this.$loop.schedule(this.CHANGE_MARKER))},this.adjustWrapLimit=function(){var e=this.$size.scrollerWidth-this.$padding*2,t=Math.floor(e/this.characterWidth);return this.session.adjustWrapLimit(t,this.$showPrintMargin&&this.$printMarginColumn)},this.setAnimatedScroll=function(e){this.setOption("animatedScroll",e)},this.getAnimatedScroll=function(){return this.$animatedScroll},this.setShowInvisibles=function(e){this.setOption("showInvisibles",e)},this.getShowInvisibles=function(){return this.getOption("showInvisibles")},this.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},this.setDisplayIndentGuides=function(e){this.setOption("displayIndentGuides",e)},this.setShowPrintMargin=function(e){this.setOption("showPrintMargin",e)},this.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},this.setPrintMarginColumn=function(e){this.setOption("printMarginColumn",e)},this.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},this.getShowGutter=function(){return this.getOption("showGutter")},this.setShowGutter=function(e){return this.setOption("showGutter",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.$updateGutterLineHighlight=function(){var e=this.$cursorLayer.$pixelPos,t=this.layerConfig.lineHeight;if(this.session.getUseWrapMode()){var n=this.session.selection.getCursor();n.column=0,e=this.$cursorLayer.getPixelPosition(n,!0),t*=this.session.getRowLength(n.row)}this.$gutterLineHighlight.style.top=e.top-this.layerConfig.offset+"px",this.$gutterLineHighlight.style.height=t+"px"},this.$updatePrintMargin=function(){if(!this.$showPrintMargin&&!this.$printMarginEl)return;if(!this.$printMarginEl){var e=i.createElement("div");e.className="ace_layer ace_print-margin-layer",this.$printMarginEl=i.createElement("div"),this.$printMarginEl.className="ace_print-margin",e.appendChild(this.$printMarginEl),this.content.insertBefore(e,this.content.firstChild)}var t=this.$printMarginEl.style;t.left=this.characterWidth*this.$printMarginColumn+this.$padding+"px",t.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&this.session.$wrap==-1&&this.adjustWrapLimit()},this.getContainerElement=function(){return this.container},this.getMouseEventTarget=function(){return this.content},this.getTextAreaContainer=function(){return this.container},this.$moveTextAreaToCursor=function(){if(!this.$keepTextAreaAtCursor)return;var e=this.layerConfig,t=this.$cursorLayer.$pixelPos.top,n=this.$cursorLayer.$pixelPos.left;t-=e.offset;var r=this.textarea.style,i=this.lineHeight;if(t<0||t>e.height-i){r.top=r.left="0";return}var s=this.characterWidth;if(this.$composition){var o=this.textarea.value.replace(/^\x01+/,"");s*=this.session.$getStringScreenWidth(o)[0]+2,i+=2}n-=this.scrollLeft,n>this.$size.scrollerWidth-s&&(n=this.$size.scrollerWidth-s),n+=this.gutterWidth,r.height=i+"px",r.width=s+"px",r.left=Math.min(n,this.$size.scrollerWidth-s)+"px",r.top=Math.min(t,this.$size.height-i)+"px"},this.getFirstVisibleRow=function(){return this.layerConfig.firstRow},this.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(this.layerConfig.offset===0?0:1)},this.getLastFullyVisibleRow=function(){var e=Math.floor((this.layerConfig.height+this.layerConfig.offset)/this.layerConfig.lineHeight);return this.layerConfig.firstRow-1+e},this.getLastVisibleRow=function(){return this.layerConfig.lastRow},this.$padding=null,this.setPadding=function(e){this.$padding=e,this.$textLayer.setPadding(e),this.$cursorLayer.setPadding(e),this.$markerFront.setPadding(e),this.$markerBack.setPadding(e),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},this.setScrollMargin=function(e,t,n,r){var i=this.scrollMargin;i.top=e|0,i.bottom=t|0,i.right=r|0,i.left=n|0,i.v=i.top+i.bottom,i.h=i.left+i.right,i.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-i.top),this.updateFull()},this.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},this.setHScrollBarAlwaysVisible=function(e){this.setOption("hScrollBarAlwaysVisible",e)},this.getVScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},this.setVScrollBarAlwaysVisible=function(e){this.setOption("vScrollBarAlwaysVisible",e)},this.$updateScrollBarV=function(){var e=this.layerConfig.maxHeight,t=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(e-=(t-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>e-t&&(e=this.scrollTop+t,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(e+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},this.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},this.$frozen=!1,this.freeze=function(){this.$frozen=!0},this.unfreeze=function(){this.$frozen=!1},this.$renderChanges=function(e,t){this.$changes&&(e|=this.$changes,this.$changes=0);if(!this.session||!this.container.offsetWidth||this.$frozen||!e&&!t){this.$changes|=e;return}if(this.$size.$dirty)return this.$changes|=e,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender");var n=this.layerConfig;if(e&this.CHANGE_FULL||e&this.CHANGE_SIZE||e&this.CHANGE_TEXT||e&this.CHANGE_LINES||e&this.CHANGE_SCROLL||e&this.CHANGE_H_SCROLL){e|=this.$computeLayerConfig();if(n.firstRow!=this.layerConfig.firstRow&&n.firstRowScreen==this.layerConfig.firstRowScreen){var r=this.scrollTop+(n.firstRow-this.layerConfig.firstRow)*this.lineHeight;r>0&&(this.scrollTop=r,e|=this.CHANGE_SCROLL,e|=this.$computeLayerConfig())}n=this.layerConfig,this.$updateScrollBarV(),e&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),this.$gutterLayer.element.style.marginTop=-n.offset+"px",this.content.style.marginTop=-n.offset+"px",this.content.style.width=n.width+2*this.$padding+"px",this.content.style.height=n.minHeight+"px"}e&this.CHANGE_H_SCROLL&&(this.content.style.marginLeft=-this.scrollLeft+"px",this.scroller.className=this.scrollLeft<=0?"ace_scroller":"ace_scroller ace_scroll-left");if(e&this.CHANGE_FULL){this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),this.$highlightGutterLine&&this.$updateGutterLineHighlight(),this._signal("afterRender");return}if(e&this.CHANGE_SCROLL){e&this.CHANGE_TEXT||e&this.CHANGE_LINES?this.$textLayer.update(n):this.$textLayer.scrollLines(n),this.$showGutter&&this.$gutterLayer.update(n),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$highlightGutterLine&&this.$updateGutterLineHighlight(),this.$moveTextAreaToCursor(),this._signal("afterRender");return}e&this.CHANGE_TEXT?(this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n)):e&this.CHANGE_LINES?(this.$updateLines()||e&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(n):(e&this.CHANGE_TEXT||e&this.CHANGE_GUTTER)&&this.$showGutter&&this.$gutterLayer.update(n),e&this.CHANGE_CURSOR&&(this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),this.$highlightGutterLine&&this.$updateGutterLineHighlight()),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(n),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(n),this._signal("afterRender")},this.$autosize=function(){var e=this.session.getScreenLength()*this.lineHeight,t=this.$maxLines*this.lineHeight,n=Math.max((this.$minLines||1)*this.lineHeight,Math.min(t,e))+this.scrollMargin.v+(this.$extraHeight||0),r=e>t;if(n!=this.desiredHeight||this.$size.height!=this.desiredHeight||r!=this.$vScroll){r!=this.$vScroll&&(this.$vScroll=r,this.scrollBarV.setVisible(r));var i=this.container.clientWidth;this.container.style.height=n+"px",this.$updateCachedSize(!0,this.$gutterWidth,i,n),this.desiredHeight=n,this._signal("autosize")}},this.$computeLayerConfig=function(){this.$maxLines&&this.lineHeight>1&&this.$autosize();var e=this.session,t=this.$size,n=t.height<=2*this.lineHeight,r=this.session.getScreenLength(),i=r*this.lineHeight,s=this.scrollTop%this.lineHeight,o=t.scrollerHeight+this.lineHeight,u=this.$getLongestLine(),a=!n&&(this.$hScrollBarAlwaysVisible||t.scrollerWidth-u-2*this.$padding<0),f=this.$horizScroll!==a;f&&(this.$horizScroll=a,this.scrollBarH.setVisible(a));var l=!this.$maxLines&&this.$scrollPastEnd?(t.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;i+=l,this.session.setScrollTop(Math.max(-this.scrollMargin.top,Math.min(this.scrollTop,i-t.scrollerHeight+this.scrollMargin.bottom))),this.session.setScrollLeft(Math.max(-this.scrollMargin.left,Math.min(this.scrollLeft,u+2*this.$padding-t.scrollerWidth+this.scrollMargin.right)));var c=!n&&(this.$vScrollBarAlwaysVisible||t.scrollerHeight-i+l<0||this.scrollTop),h=this.$vScroll!==c;h&&(this.$vScroll=c,this.scrollBarV.setVisible(c));var p=Math.ceil(o/this.lineHeight)-1,d=Math.max(0,Math.round((this.scrollTop-s)/this.lineHeight)),v=d+p,m,g,y=this.lineHeight;d=e.screenToDocumentRow(d,0);var b=e.getFoldLine(d);b&&(d=b.start.row),m=e.documentToScreenRow(d,0),g=e.getRowLength(d)*y,v=Math.min(e.screenToDocumentRow(v,0),e.getLength()-1),o=t.scrollerHeight+e.getRowLength(v)*y+g,s=this.scrollTop-m*y;var w=0;this.layerConfig.width!=u&&(w=this.CHANGE_H_SCROLL);if(f||h)w=this.$updateCachedSize(!0,this.gutterWidth,t.width,t.height),this._signal("scrollbarVisibilityChanged"),h&&(u=this.$getLongestLine());return this.layerConfig={width:u,padding:this.$padding,firstRow:d,firstRowScreen:m,lastRow:v,lineHeight:y,characterWidth:this.characterWidth,minHeight:o,maxHeight:i,offset:s,gutterOffset:Math.max(0,Math.ceil((s+t.height-t.scrollerHeight)/y)),height:this.$size.scrollerHeight},w},this.$updateLines=function(){var e=this.$changedLines.firstRow,t=this.$changedLines.lastRow;this.$changedLines=null;var n=this.layerConfig;if(e>n.lastRow+1)return;if(ts?(t&&(s-=t*this.$size.scrollerHeight),s===0&&(s=-this.scrollMargin.top),this.session.setScrollTop(s)):a+this.$size.scrollerHeight-ui?(i=1-this.scrollMargin.top)return!0;if(t>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom)return!0;if(e<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left)return!0;if(e>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right)return!0},this.pixelToScreenCoordinates=function(e,t){var n=this.scroller.getBoundingClientRect(),r=(e+this.scrollLeft-n.left-this.$padding)/this.characterWidth,i=Math.floor((t+this.scrollTop-n.top)/this.lineHeight),s=Math.round(r);return{row:i,column:s,side:r-s>0?1:-1}},this.screenToTextCoordinates=function(e,t){var n=this.scroller.getBoundingClientRect(),r=Math.round((e+this.scrollLeft-n.left-this.$padding)/this.characterWidth),i=(t+this.scrollTop-n.top)/this.lineHeight;return this.session.screenToDocumentPosition(i,Math.max(r,0))},this.textToScreenCoordinates=function(e,t){var n=this.scroller.getBoundingClientRect(),r=this.session.documentToScreenPosition(e,t),i=this.$padding+Math.round(r.column*this.characterWidth),s=r.row*this.lineHeight;return{pageX:n.left+i-this.scrollLeft,pageY:n.top+s-this.scrollTop}},this.visualizeFocus=function(){i.addCssClass(this.container,"ace_focus")},this.visualizeBlur=function(){i.removeCssClass(this.container,"ace_focus")},this.showComposition=function(e){this.$composition||(this.$composition={keepTextAreaAtCursor:this.$keepTextAreaAtCursor,cssText:this.textarea.style.cssText}),this.$keepTextAreaAtCursor=!0,i.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor()},this.setCompositionText=function(e){this.$moveTextAreaToCursor()},this.hideComposition=function(){if(!this.$composition)return;i.removeCssClass(this.textarea,"ace_composition"),this.$keepTextAreaAtCursor=this.$composition.keepTextAreaAtCursor,this.textarea.style.cssText=this.$composition.cssText,this.$composition=null},this.setTheme=function(e,t){function o(r){if(n.$themeId!=e)return t&&t();if(!r.cssClass)return;i.importCssString(r.cssText,r.cssClass,n.container.ownerDocument),n.theme&&i.removeCssClass(n.container,n.theme.cssClass);var s="padding"in r?r.padding:"padding"in(n.theme||{})?4:n.$padding;n.$padding&&s!=n.$padding&&n.setPadding(s),n.$theme=r.cssClass,n.theme=r,i.addCssClass(n.container,r.cssClass),i.setCssClass(n.container,"ace_dark",r.isDark),n.$size&&(n.$size.width=0,n.$updateSizeAsync()),n._dispatchEvent("themeLoaded",{theme:r}),t&&t()}var n=this;this.$themeId=e,n._dispatchEvent("themeChange",{theme:e});if(!e||typeof e=="string"){var r=e||this.$options.theme.initialValue;s.loadModule(["theme",r],o)}else o(e)},this.getTheme=function(){return this.$themeId},this.setStyle=function(e,t){i.setCssClass(this.container,e,t!==!1)},this.unsetStyle=function(e){i.removeCssClass(this.container,e)},this.setCursorStyle=function(e){this.scroller.style.cursor!=e&&(this.scroller.style.cursor=e)},this.setMouseCursor=function(e){this.scroller.style.cursor=e},this.destroy=function(){this.$textLayer.destroy(),this.$cursorLayer.destroy()}}).call(g.prototype),s.defineOptions(g.prototype,"renderer",{animatedScroll:{initialValue:!1},showInvisibles:{set:function(e){this.$textLayer.setShowInvisibles(e)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!1},showPrintMargin:{set:function(){this.$updatePrintMargin()},initialValue:!0},printMarginColumn:{set:function(){this.$updatePrintMargin()},initialValue:80},printMargin:{set:function(e){typeof e=="number"&&(this.$printMarginColumn=e),this.$showPrintMargin=!!e,this.$updatePrintMargin()},get:function(){return this.$showPrintMargin&&this.$printMarginColumn}},showGutter:{set:function(e){this.$gutter.style.display=e?"block":"none",this.$loop.schedule(this.CHANGE_FULL),this.onGutterResize()},initialValue:!0},fadeFoldWidgets:{set:function(e){i.setCssClass(this.$gutter,"ace_fade-fold-widgets",e)},initialValue:!1},showFoldWidgets:{set:function(e){this.$gutterLayer.setShowFoldWidgets(e)},initialValue:!0},showLineNumbers:{set:function(e){this.$gutterLayer.setShowLineNumbers(e),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},displayIndentGuides:{set:function(e){this.$textLayer.setDisplayIndentGuides(e)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!0},highlightGutterLine:{set:function(e){if(!this.$gutterLineHighlight){this.$gutterLineHighlight=i.createElement("div"),this.$gutterLineHighlight.className="ace_gutter-active-line",this.$gutter.appendChild(this.$gutterLineHighlight);return}this.$gutterLineHighlight.style.display=e?"":"none",this.$cursorLayer.$pixelPos&&this.$updateGutterLineHighlight()},initialValue:!1,value:!0},hScrollBarAlwaysVisible:{set:function(e){(!this.$hScrollBarAlwaysVisible||!this.$horizScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},vScrollBarAlwaysVisible:{set:function(e){(!this.$vScrollBarAlwaysVisible||!this.$vScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},fontSize:{set:function(e){typeof e=="number"&&(e+="px"),this.container.style.fontSize=e,this.updateFontSize()},initialValue:12},fontFamily:{set:function(e){this.container.style.fontFamily=e,this.updateFontSize()}},maxLines:{set:function(e){this.updateFull()}},minLines:{set:function(e){this.updateFull()}},scrollPastEnd:{set:function(e){e=+e||0;if(this.$scrollPastEnd==e)return;this.$scrollPastEnd=e,this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:0,handlesSet:!0},fixedWidthGutter:{set:function(e){this.$gutterLayer.$fixedWidth=!!e,this.$loop.schedule(this.CHANGE_GUTTER)}},theme:{set:function(e){this.setTheme(e)},get:function(){return this.$themeId||this.theme},initialValue:"./theme/textmate",handlesSet:!0}}),t.VirtualRenderer=g}),ace.define("ace/worker/worker_client",["require","exports","module","ace/lib/oop","ace/lib/net","ace/lib/event_emitter","ace/config"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/net"),s=e("../lib/event_emitter").EventEmitter,o=e("../config"),u=function(t,n,r,i){this.$sendDeltaQueue=this.$sendDeltaQueue.bind(this),this.changeListener=this.changeListener.bind(this),this.onMessage=this.onMessage.bind(this),e.nameToUrl&&!e.toUrl&&(e.toUrl=e.nameToUrl);if(o.get("packaged")||!e.toUrl)i=i||o.moduleUrl(n,"worker");else{var s=this.$normalizePath;i=i||s(e.toUrl("ace/worker/worker.js",null,"_"));var u={};t.forEach(function(t){u[t]=s(e.toUrl(t,null,"_").replace(/(\.js)?(\?.*)?$/,""))})}try{this.$worker=new Worker(i)}catch(a){if(!(a instanceof window.DOMException))throw a;var f=this.$workerBlob(i),l=window.URL||window.webkitURL,c=l.createObjectURL(f);this.$worker=new Worker(c),l.revokeObjectURL(c)}this.$worker.postMessage({init:!0,tlns:u,module:n,classname:r}),this.callbackId=1,this.callbacks={},this.$worker.onmessage=this.onMessage};(function(){r.implement(this,s),this.onMessage=function(e){var t=e.data;switch(t.type){case"event":this._signal(t.name,{data:t.data});break;case"call":var n=this.callbacks[t.id];n&&(n(t.data),delete this.callbacks[t.id]);break;case"error":this.reportError(t.data);break;case"log":window.console&&console.log&&console.log.apply(console,t.data)}},this.reportError=function(e){window.console&&console.error&&console.error(e)},this.$normalizePath=function(e){return i.qualifyURL(e)},this.terminate=function(){this._signal("terminate",{}),this.deltaQueue=null,this.$worker.terminate(),this.$worker=null,this.$doc&&this.$doc.off("change",this.changeListener),this.$doc=null},this.send=function(e,t){this.$worker.postMessage({command:e,args:t})},this.call=function(e,t,n){if(n){var r=this.callbackId++;this.callbacks[r]=n,t.push(r)}this.send(e,t)},this.emit=function(e,t){try{this.$worker.postMessage({event:e,data:{data:t.data}})}catch(n){console.error(n.stack)}},this.attachToDocument=function(e){this.$doc&&this.terminate(),this.$doc=e,this.call("setValue",[e.getValue()]),e.on("change",this.changeListener)},this.changeListener=function(e){this.deltaQueue?this.deltaQueue.push(e.data):(this.deltaQueue=[e.data],setTimeout(this.$sendDeltaQueue,0))},this.$sendDeltaQueue=function(){var e=this.deltaQueue;if(!e)return;this.deltaQueue=null,e.length>20&&e.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:e})},this.$workerBlob=function(e){var t="importScripts('"+i.qualifyURL(e)+"');";try{return new Blob([t],{type:"application/javascript"})}catch(n){var r=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder,s=new r;return s.append(t),s.getBlob("application/javascript")}}}).call(u.prototype);var a=function(e,t,n){this.$sendDeltaQueue=this.$sendDeltaQueue.bind(this),this.changeListener=this.changeListener.bind(this),this.callbackId=1,this.callbacks={},this.messageBuffer=[];var r=null,i=!1,u=Object.create(s),a=this;this.$worker={},this.$worker.terminate=function(){},this.$worker.postMessage=function(e){a.messageBuffer.push(e),r&&(i?setTimeout(f):f())},this.setEmitSync=function(e){i=e};var f=function(){var e=a.messageBuffer.shift();e.command?r[e.command].apply(r,e.args):e.event&&u._signal(e.event,e.data)};u.postMessage=function(e){a.onMessage({data:e})},u.callback=function(e,t){this.postMessage({type:"call",id:t,data:e})},u.emit=function(e,t){this.postMessage({type:"event",name:e,data:t})},o.loadModule(["worker",t],function(e){r=new e[n](u);while(a.messageBuffer.length)f()})};a.prototype=u.prototype,t.UIWorkerClient=a,t.WorkerClient=u}),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(e,t,n){"use strict";var r=e("./range").Range,i=e("./lib/event_emitter").EventEmitter,s=e("./lib/oop"),o=function(e,t,n,r,i,s){var o=this;this.length=t,this.session=e,this.doc=e.getDocument(),this.mainClass=i,this.othersClass=s,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate),this.$others=r,this.$onCursorChange=function(){setTimeout(function(){o.onCursorChange()})},this.$pos=n;var u=e.getUndoManager().$undoStack||e.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=u.length,this.setup(),e.selection.on("changeCursor",this.$onCursorChange)};(function(){s.implement(this,i),this.setup=function(){var e=this,t=this.doc,n=this.session,i=this.$pos;this.selectionBefore=n.selection.toJSON(),n.selection.inMultiSelectMode&&n.selection.toSingleRange(),this.pos=t.createAnchor(i.row,i.column),this.markerId=n.addMarker(new r(i.row,i.column,i.row,i.column+this.length),this.mainClass,null,!1),this.pos.on("change",function(t){n.removeMarker(e.markerId),e.markerId=n.addMarker(new r(t.value.row,t.value.column,t.value.row,t.value.column+e.length),e.mainClass,null,!1)}),this.others=[],this.$others.forEach(function(n){var r=t.createAnchor(n.row,n.column);e.others.push(r)}),n.setUndoSelect(!1)},this.showOtherMarkers=function(){if(this.othersActive)return;var e=this.session,t=this;this.othersActive=!0,this.others.forEach(function(n){n.markerId=e.addMarker(new r(n.row,n.column,n.row,n.column+t.length),t.othersClass,null,!1),n.on("change",function(i){e.removeMarker(n.markerId),n.markerId=e.addMarker(new r(i.value.row,i.value.column,i.value.row,i.value.column+t.length),t.othersClass,null,!1)})})},this.hideOtherMarkers=function(){if(!this.othersActive)return;this.othersActive=!1;for(var e=0;e=this.pos.column&&n.start.column<=this.pos.column+this.length+1){var s=n.start.column-this.pos.column;this.length+=i;if(!this.session.$fromUndo){if(t.action==="insertText")for(var o=this.others.length-1;o>=0;o--){var u=this.others[o],a={row:u.row,column:u.column+s};u.row===n.start.row&&n.start.column=0;o--){var u=this.others[o],a={row:u.row,column:u.column+s};u.row===n.start.row&&n.start.column=this.pos.column&&t.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",e)):(this.hideOtherMarkers(),this._emit("cursorLeave",e))},this.detach=function(){this.session.removeMarker(this.markerId),this.hideOtherMarkers(),this.doc.removeEventListener("change",this.$onUpdate),this.session.selection.removeEventListener("changeCursor",this.$onCursorChange),this.pos.detach();for(var e=0;e1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),t||this.fromOrientedRange(e)},this.toSingleRange=function(e){e=e||this.ranges[0];var t=this.rangeList.removeAll();t.length&&this.$onRemoveRange(t),e&&this.fromOrientedRange(e)},this.substractPoint=function(e){var t=this.rangeList.substractPoint(e);if(t)return this.$onRemoveRange(t),t[0]},this.mergeOverlappingRanges=function(){var e=this.rangeList.merge();e.length?this.$onRemoveRange(e):this.ranges[0]&&this.fromOrientedRange(this.ranges[0])},this.$onAddRange=function(e){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(e),this._signal("addRange",{range:e})},this.$onRemoveRange=function(e){this.rangeCount=this.rangeList.ranges.length;if(this.rangeCount==1&&this.inMultiSelectMode){var t=this.rangeList.ranges.pop();e.push(t),this.rangeCount=0}for(var n=e.length;n--;){var r=this.ranges.indexOf(e[n]);this.ranges.splice(r,1)}this._signal("removeRange",{ranges:e}),this.rangeCount===0&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),t=t||this.ranges[0],t&&!t.isEqual(this.getRange())&&this.fromOrientedRange(t)},this.$initRangeList=function(){if(this.rangeList)return;this.rangeList=new r,this.ranges=[],this.rangeCount=0},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){if(this.rangeCount>1){var e=this.rangeList.ranges,t=e[e.length-1],n=i.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(n,t.cursor==t.start)}else{var n=this.getRange(),r=this.isBackwards(),s=n.start.row,o=n.end.row;if(s==o){if(r)var u=n.end,a=n.start;else var u=n.start,a=n.end;this.addRange(i.fromPoints(a,a)),this.addRange(i.fromPoints(u,u));return}var f=[],l=this.getLineRange(s,!0);l.start.column=n.start.column,f.push(l);for(var c=s+1;c1){var e=this.rangeList.ranges,t=e[e.length-1],n=i.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(n,t.cursor==t.start)}else{var r=this.session.documentToScreenPosition(this.selectionLead),s=this.session.documentToScreenPosition(this.selectionAnchor),o=this.rectangularRangeBlock(r,s);o.forEach(this.addRange,this)}},this.rectangularRangeBlock=function(e,t,n){var r=[],s=e.column0)d--;if(d>0){var m=0;while(r[m].isEmpty())m++}for(var g=d;g>=m;g--)r[g].isEmpty()&&r.splice(g,1)}return r}}.call(s.prototype);var d=e("./editor").Editor;(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(e){e.cursor||(e.cursor=e.end);var t=this.getSelectionStyle();return e.marker=this.session.addMarker(e,"ace_selection",t),this.session.$selectionMarkers.push(e),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,e},this.removeSelectionMarker=function(e){if(!e.marker)return;this.session.removeMarker(e.marker);var t=this.session.$selectionMarkers.indexOf(e);t!=-1&&this.session.$selectionMarkers.splice(t,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length},this.removeSelectionMarkers=function(e){var t=this.session.$selectionMarkers;for(var n=e.length;n--;){var r=e[n];if(!r.marker)continue;this.session.removeMarker(r.marker);var i=t.indexOf(r);i!=-1&&t.splice(i,1)}this.session.selectionMarkerCount=t.length},this.$onAddRange=function(e){this.addSelectionMarker(e.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(e){this.removeSelectionMarkers(e.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(e){if(this.inMultiSelectMode)return;this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(f.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onSingleSelect=function(e){if(this.session.multiSelect.inVirtualMode)return;this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(f.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection")},this.$onMultiSelectExec=function(e){var t=e.command,n=e.editor;if(!n.multiSelect)return;if(!t.multiSelectAction){var r=t.exec(n,e.args||{});n.multiSelect.addRange(n.multiSelect.toOrientedRange()),n.multiSelect.mergeOverlappingRanges()}else t.multiSelectAction=="forEach"?r=n.forEachSelection(t,e.args):t.multiSelectAction=="forEachLine"?r=n.forEachSelection(t,e.args,!0):t.multiSelectAction=="single"?(n.exitMultiSelectMode(),r=t.exec(n,e.args||{})):r=t.multiSelectAction(n,e.args||{});return r},this.forEachSelection=function(e,t,n){if(this.inVirtualSelectionMode)return;var r=n&&n.keepOrder,i=n==1||n&&n.$byLines,o=this.session,u=this.selection,a=u.rangeList,f=(r?u:a).ranges,l;if(!f.length)return e.exec?e.exec(this,t||{}):e(this,t||{});var c=u._eventRegistry;u._eventRegistry={};var h=new s(o);this.inVirtualSelectionMode=!0;for(var p=f.length;p--;){if(i)while(p>0&&f[p].start.row==f[p-1].end.row)p--;h.fromOrientedRange(f[p]),h.index=p,this.selection=o.selection=h;var d=e.exec?e.exec(this,t||{}):e(this,t||{});!l&&d!==undefined&&(l=d),h.toOrientedRange(f[p])}h.detach(),this.selection=o.selection=u,this.inVirtualSelectionMode=!1,u._eventRegistry=c,u.mergeOverlappingRanges();var v=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),v&&v.from==v.to&&this.renderer.animateScrolling(v.from),l},this.exitMultiSelectMode=function(){if(!this.inMultiSelectMode||this.inVirtualSelectionMode)return;this.multiSelect.toSingleRange()},this.getSelectedText=function(){var e="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){var t=this.multiSelect.rangeList.ranges,n=[];for(var r=0;r0);u<0&&(u=0),f>=c&&(f=c-1)}var p=this.session.doc.removeLines(u,f);p=this.$reAlignText(p,l),this.session.doc.insert({row:u,column:0},p.join("\n")+"\n"),l||(o.start.column=0,o.end.column=p[p.length-1].length),this.selection.setRange(o)}else{s.forEach(function(e){t.substractPoint(e.cursor)});var d=0,v=Infinity,m=n.map(function(t){var n=t.cursor,r=e.getLine(n.row),i=r.substr(n.column).search(/\S/g);return i==-1&&(i=0),n.column>d&&(d=n.column),io?e.insert(r,a.stringRepeat(" ",s-o)):e.remove(new i(r.row,r.column,r.row,r.column-s+o)),t.start.column=t.end.column=d,t.start.row=t.end.row=r.row,t.cursor=t.end}),t.fromOrientedRange(n[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}},this.$reAlignText=function(e,t){function u(e){return a.stringRepeat(" ",e)}function f(e){return e[2]?u(i)+e[2]+u(s-e[2].length+o)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}function l(e){return e[2]?u(i+s-e[2].length)+e[2]+u(o," ")+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}function c(e){return e[2]?u(i)+e[2]+u(o)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}var n=!0,r=!0,i,s,o;return e.map(function(e){var t=e.match(/(\s*)(.*?)(\s*)([=:].*)/);return t?i==null?(i=t[1].length,s=t[2].length,o=t[3].length,t):(i+s+o!=t[1].length+t[2].length+t[3].length&&(r=!1),i!=t[1].length&&(n=!1),i>t[1].length&&(i=t[1].length),st[3].length&&(o=t[3].length),t):[e]}).map(t?f:n?r?l:f:c)}}).call(d.prototype),t.onSessionChange=function(e){var t=e.session;t&&!t.multiSelect&&(t.$selectionMarkers=[],t.selection.$initRangeList(),t.multiSelect=t.selection),this.multiSelect=t&&t.multiSelect;var n=e.oldSession;n&&(n.multiSelect.off("addRange",this.$onAddRange),n.multiSelect.off("removeRange",this.$onRemoveRange),n.multiSelect.off("multiSelect",this.$onMultiSelect),n.multiSelect.off("singleSelect",this.$onSingleSelect),n.multiSelect.lead.off("change",this.$checkMultiselectChange),n.multiSelect.anchor.off("change",this.$checkMultiselectChange)),t&&(t.multiSelect.on("addRange",this.$onAddRange),t.multiSelect.on("removeRange",this.$onRemoveRange),t.multiSelect.on("multiSelect",this.$onMultiSelect),t.multiSelect.on("singleSelect",this.$onSingleSelect),t.multiSelect.lead.on("change",this.$checkMultiselectChange),t.multiSelect.anchor.on("change",this.$checkMultiselectChange)),t&&this.inMultiSelectMode!=t.selection.inMultiSelectMode&&(t.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())},t.MultiSelect=m,e("./config").defineOptions(d.prototype,"editor",{enableMultiselect:{set:function(e){m(this),e?(this.on("changeSession",this.$multiselectOnSessionChange),this.on("mousedown",o)):(this.off("changeSession",this.$multiselectOnSessionChange),this.off("mousedown",o))},value:!0}})}),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../../range").Range,i=t.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);return this.foldingStartMarker.test(r)?"start":t=="markbeginend"&&this.foldingStopMarker&&this.foldingStopMarker.test(r)?"end":""},this.getFoldWidgetRange=function(e,t,n){return null},this.indentationBlock=function(e,t,n){var i=/\S/,s=e.getLine(t),o=s.search(i);if(o==-1)return;var u=n||s.length,a=e.getLength(),f=t,l=t;while(++tf){var h=e.getLine(l).length;return new r(f,u,l,h)}},this.openingBracketBlock=function(e,t,n,i,s){var o={row:n,column:i+1},u=e.$findClosingBracket(t,o,s);if(!u)return;var a=e.foldWidgets[u.row];return a==null&&(a=e.getFoldWidget(u.row)),a=="start"&&u.row>o.row&&(u.row--,u.column=e.getLine(u.row).length),r.fromPoints(o,u)},this.closingBracketBlock=function(e,t,n,i,s){var o={row:n,column:i},u=e.$findOpeningBracket(t,o);if(!u)return;return u.column++,o.column--,r.fromPoints(u,o)}}).call(i.prototype)}),ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";t.isDark=!1,t.cssClass="ace-tm",t.cssText='.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm {background-color: #FFFFFF;color: black;}.ace-tm .ace_cursor {color: black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;border-radius: 2px;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}';var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}),ace.define("ace/line_widgets",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/range"],function(e,t,n){"use strict";function o(e){this.session=e,this.session.widgetManager=this,this.session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on("change",this.updateOnChange),this.session.on("changeEditor",this.$onChangeEditor)}var r=e("./lib/oop"),i=e("./lib/dom"),s=e("./range").Range;(function(){this.getRowLength=function(e){var t;return this.lineWidgets?t=this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0:t=0,!this.$useWrapMode||!this.$wrapData[e]?1+t:this.$wrapData[e].length+1+t},this.$getWidgetScreenLength=function(){var e=0;return this.lineWidgets.forEach(function(t){t&&t.rowCount&&(e+=t.rowCount)}),e},this.$onChangeEditor=function(e){this.attach(e.editor)},this.attach=function(e){e&&e.widgetManager&&e.widgetManager!=this&&e.widgetManager.detach();if(this.editor==e)return;this.detach(),this.editor=e,e&&(e.widgetManager=this,e.renderer.on("beforeRender",this.measureWidgets),e.renderer.on("afterRender",this.renderWidgets))},this.detach=function(e){var t=this.editor;if(!t)return;this.editor=null,t.widgetManager=null,t.renderer.off("beforeRender",this.measureWidgets),t.renderer.off("afterRender",this.renderWidgets);var n=this.session.lineWidgets;n&&n.forEach(function(e){e&&e.el&&e.el.parentNode&&(e._inDocument=!1,e.el.parentNode.removeChild(e.el))})},this.updateOnChange=function(e){var t=this.session.lineWidgets;if(!t)return;var n=e.data,r=n.range,i=r.start.row,s=r.end.row-i;if(s!==0)if(n.action=="removeText"||n.action=="removeLines"){var o=t.splice(i+1,s);o.forEach(function(e){e&&this.removeLineWidget(e)},this),this.$updateRows()}else{var u=new Array(s);u.unshift(i,0),t.splice.apply(t,u),this.$updateRows()}},this.$updateRows=function(){var e=this.session.lineWidgets;if(!e)return;var t=!0;e.forEach(function(e,n){e&&(t=!1,e.row=n)}),t&&(this.session.lineWidgets=null)},this.addLineWidget=function(e){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength())),this.session.lineWidgets[e.row]=e;var t=this.editor.renderer;return e.html&&!e.el&&(e.el=i.createElement("div"),e.el.innerHTML=e.html),e.el&&(i.addCssClass(e.el,"ace_lineWidgetContainer"),e.el.style.position="absolute",e.el.style.zIndex=5,t.container.appendChild(e.el),e._inDocument=!0),e.coverGutter||(e.el.style.zIndex=3),e.pixelHeight||(e.pixelHeight=e.el.offsetHeight),e.rowCount==null&&(e.rowCount=e.pixelHeight/t.layerConfig.lineHeight),this.session._emit("changeFold",{data:{start:{row:e.row}}}),this.$updateRows(),this.renderWidgets(null,t),e},this.removeLineWidget=function(e){e._inDocument=!1,e.el&&e.el.parentNode&&e.el.parentNode.removeChild(e.el);if(e.editor&&e.editor.destroy)try{e.editor.destroy()}catch(t){}this.session.lineWidgets&&(this.session.lineWidgets[e.row]=undefined),this.session._emit("changeFold",{data:{start:{row:e.row}}}),this.$updateRows()},this.onWidgetChanged=function(e){this.session._changedWidgets.push(e),this.editor&&this.editor.renderer.updateFull()},this.measureWidgets=function(e,t){var n=this.session._changedWidgets,r=t.layerConfig;if(!n||!n.length)return;var i=Infinity;for(var s=0;s0&&!r[i])i--;this.firstRow=n.firstRow,this.lastRow=n.lastRow,t.$cursorLayer.config=n;for(var o=i;o<=s;o++){var u=r[o];if(!u||!u.el)continue;u._inDocument||(u._inDocument=!0,t.container.appendChild(u.el));var a=t.$cursorLayer.getPixelPosition({row:o,column:0},!0).top;u.coverLine||(a+=n.lineHeight*this.session.getRowLineCount(u.row)),u.el.style.top=a-n.offset+"px";var f=u.coverGutter?0:t.gutterWidth;u.fixedWidth||(f-=t.scrollLeft),u.el.style.left=f+"px",u.fixedWidth?u.el.style.right=t.scrollBar.getWidth()+"px":u.el.style.right=""}}}).call(o.prototype),t.LineWidgets=o}),ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range"],function(e,t,n){"use strict";function o(e,t,n){var r=0,i=e.length-1;while(r<=i){var s=r+i>>1,o=n(t,e[s]);if(o>0)r=s+1;else{if(!(o<0))return s;i=s-1}}return-(r+1)}function u(e,t,n){var r=e.getAnnotations().sort(s.comparePoints);if(!r.length)return;var i=o(r,{row:t,column:-1},s.comparePoints);i<0&&(i=-i-1),i>=r.length-1?i=n>0?0:r.length-1:i===0&&n<0&&(i=r.length-1);var u=r[i];if(!u||!n)return;if(u.row===t){do u=r[i+=n];while(u&&u.row===t);if(!u)return r.slice()}var a=[];t=u.row;do a[n<0?"unshift":"push"](u),u=r[i+=n];while(u&&u.row==t);return a.length&&a}var r=e("../line_widgets").LineWidgets,i=e("../lib/dom"),s=e("../range").Range;t.showErrorMarker=function(e,t){var n=e.session;n.widgetManager||(n.widgetManager=new r(n),n.widgetManager.attach(e));var s=e.getCursorPosition(),o=s.row,a=n.lineWidgets&&n.lineWidgets[o];a?a.destroy():o-=t;var f=u(n,o,t),l;if(f){var c=f[0];s.column=(c.pos&&typeof c.column!="number"?c.pos.sc:c.column)||0,s.row=c.row,l=e.renderer.$gutterLayer.$annotations[s.row]}else{if(a)return;l={text:["Looks good!"],className:"ace_ok"}}e.session.unfold(s.row),e.selection.moveToPosition(s);var h={row:s.row,fixedWidth:!0,coverGutter:!0,el:i.createElement("div")},p=h.el.appendChild(i.createElement("div")),d=h.el.appendChild(i.createElement("div"));d.className="error_widget_arrow "+l.className;var v=e.renderer.$cursorLayer.getPixelPosition(s).left;d.style.left=v+e.renderer.gutterWidth-5+"px",h.el.className="error_widget_wrapper",p.className="error_widget "+l.className,p.innerHTML=l.text.join("
    "),p.appendChild(i.createElement("div"));var m=function(e,t,n){if(t===0&&(n==="esc"||n==="return"))return h.destroy(),{command:"null"}};h.destroy=function(){if(e.$mouseHandler.isMousePressed)return;e.keyBinding.removeKeyboardHandler(m),n.widgetManager.removeLineWidget(h),e.off("changeSelection",h.destroy),e.off("changeSession",h.destroy),e.off("mouseup",h.destroy),e.off("change",h.destroy)},e.keyBinding.addKeyboardHandler(m),e.on("changeSelection",h.destroy),e.on("changeSession",h.destroy),e.on("mouseup",h.destroy),e.on("change",h.destroy),e.session.widgetManager.addLineWidget(h),h.el.onmousedown=e.focus.bind(e),e.renderer.scrollCursorIntoView(null,.5,{bottom:h.el.offsetHeight})},i.importCssString(" .error_widget_wrapper { background: inherit; color: inherit; border:none } .error_widget { border-top: solid 2px; border-bottom: solid 2px; margin: 5px 0; padding: 10px 40px; white-space: pre-wrap; } .error_widget.ace_error, .error_widget_arrow.ace_error{ border-color: #ff5a5a } .error_widget.ace_warning, .error_widget_arrow.ace_warning{ border-color: #F1D817 } .error_widget.ace_info, .error_widget_arrow.ace_info{ border-color: #5a5a5a } .error_widget.ace_ok, .error_widget_arrow.ace_ok{ border-color: #5aaa5a } .error_widget_arrow { position: absolute; border: solid 5px; border-top-color: transparent!important; border-right-color: transparent!important; border-left-color: transparent!important; top: -5px; }","")}),ace.define("ace/ace",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/dom","ace/lib/event","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config"],function(e,t,n){"use strict";e("./lib/fixoldbrowsers");var r=e("./lib/dom"),i=e("./lib/event"),s=e("./editor").Editor,o=e("./edit_session").EditSession,u=e("./undomanager").UndoManager,a=e("./virtual_renderer").VirtualRenderer;e("./worker/worker_client"),e("./keyboard/hash_handler"),e("./placeholder"),e("./multi_select"),e("./mode/folding/fold_mode"),e("./theme/textmate"),e("./ext/error_marker"),t.config=e("./config"),t.require=e,t.edit=function(e){if(typeof e=="string"){var n=e;e=document.getElementById(n);if(!e)throw new Error("ace.edit can't find div #"+n)}if(e&&e.env&&e.env.editor instanceof s)return e.env.editor;var o="";if(e&&/input|textarea/i.test(e.tagName)){var u=e;o=u.value,e=r.createElement("pre"),u.parentNode.replaceChild(e,u)}else o=r.getInnerText(e),e.innerHTML="";var f=t.createEditSession(o),l=new s(new a(e));l.setSession(f);var c={document:f,editor:l,onResize:l.resize.bind(l,null)};return u&&(c.textarea=u),i.addListener(window,"resize",c.onResize),l.on("destroy",function(){i.removeListener(window,"resize",c.onResize),c.editor.container.env=null}),l.container.env=l.env=c,l},t.createEditSession=function(e,t){var n=new o(e,t);return n.setUndoManager(new u),n},t.EditSession=o,t.UndoManager=u}); + (function() { + ace.require(["ace/ace"], function(a) { + a && a.config.init(true); + if (!window.ace) + window.ace = a; + for (var key in a) if (a.hasOwnProperty(key)) + window.ace[key] = a[key]; + }); + })(); + \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/ext-emmet.js b/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/ext-emmet.js new file mode 100644 index 000000000..ded0318b9 --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/ext-emmet.js @@ -0,0 +1,5 @@ +ace.define("ace/snippets",["require","exports","module","ace/lib/oop","ace/lib/event_emitter","ace/lib/lang","ace/range","ace/anchor","ace/keyboard/hash_handler","ace/tokenizer","ace/lib/dom","ace/editor"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/event_emitter").EventEmitter,s=e("./lib/lang"),o=e("./range").Range,u=e("./anchor").Anchor,a=e("./keyboard/hash_handler").HashHandler,f=e("./tokenizer").Tokenizer,l=o.comparePoints,c=function(){this.snippetMap={},this.snippetNameMap={}};(function(){r.implement(this,i),this.getTokenizer=function(){function e(e,t,n){return e=e.substr(1),/^\d+$/.test(e)&&!n.inFormatString?[{tabstopId:parseInt(e,10)}]:[{text:e}]}function t(e){return"(?:[^\\\\"+e+"]|\\\\.)"}return c.$tokenizer=new f({start:[{regex:/:/,onMatch:function(e,t,n){return n.length&&n[0].expectIf?(n[0].expectIf=!1,n[0].elseBranch=n[0],[n[0]]):":"}},{regex:/\\./,onMatch:function(e,t,n){var r=e[1];return r=="}"&&n.length?e=r:"`$\\".indexOf(r)!=-1?e=r:n.inFormatString&&(r=="n"?e="\n":r=="t"?e="\n":"ulULE".indexOf(r)!=-1&&(e={changeCase:r,local:r>"a"})),[e]}},{regex:/}/,onMatch:function(e,t,n){return[n.length?n.shift():e]}},{regex:/\$(?:\d+|\w+)/,onMatch:e},{regex:/\$\{[\dA-Z_a-z]+/,onMatch:function(t,n,r){var i=e(t.substr(1),n,r);return r.unshift(i[0]),i},next:"snippetVar"},{regex:/\n/,token:"newline",merge:!1}],snippetVar:[{regex:"\\|"+t("\\|")+"*\\|",onMatch:function(e,t,n){n[0].choices=e.slice(1,-1).split(",")},next:"start"},{regex:"/("+t("/")+"+)/(?:("+t("/")+"*)/)(\\w*):?",onMatch:function(e,t,n){var r=n[0];return r.fmtString=e,e=this.splitRegex.exec(e),r.guard=e[1],r.fmt=e[2],r.flag=e[3],""},next:"start"},{regex:"`"+t("`")+"*`",onMatch:function(e,t,n){return n[0].code=e.splice(1,-1),""},next:"start"},{regex:"\\?",onMatch:function(e,t,n){n[0]&&(n[0].expectIf=!0)},next:"start"},{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"start"}],formatString:[{regex:"/("+t("/")+"+)/",token:"regex"},{regex:"",onMatch:function(e,t,n){n.inFormatString=!0},next:"start"}]}),c.prototype.getTokenizer=function(){return c.$tokenizer},c.$tokenizer},this.tokenizeTmSnippet=function(e,t){return this.getTokenizer().getLineTokens(e,t).tokens.map(function(e){return e.value||e})},this.$getDefaultValue=function(e,t){if(/^[A-Z]\d+$/.test(t)){var n=t.substr(1);return(this.variables[t[0]+"__"]||{})[n]}if(/^\d+$/.test(t))return(this.variables.__||{})[t];t=t.replace(/^TM_/,"");if(!e)return;var r=e.session;switch(t){case"CURRENT_WORD":var i=r.getWordRange();case"SELECTION":case"SELECTED_TEXT":return r.getTextRange(i);case"CURRENT_LINE":return r.getLine(e.getCursorPosition().row);case"PREV_LINE":return r.getLine(e.getCursorPosition().row-1);case"LINE_INDEX":return e.getCursorPosition().column;case"LINE_NUMBER":return e.getCursorPosition().row+1;case"SOFT_TABS":return r.getUseSoftTabs()?"YES":"NO";case"TAB_SIZE":return r.getTabSize();case"FILENAME":case"FILEPATH":return"";case"FULLNAME":return"Ace"}},this.variables={},this.getVariableValue=function(e,t){return this.variables.hasOwnProperty(t)?this.variables[t](e,t)||"":this.$getDefaultValue(e,t)||""},this.tmStrFormat=function(e,t,n){var r=t.flag||"",i=t.guard;i=new RegExp(i,r.replace(/[^gi]/,""));var s=this.tokenizeTmSnippet(t.fmt,"formatString"),o=this,u=e.replace(i,function(){o.variables.__=arguments;var e=o.resolveVariables(s,n),t="E";for(var r=0;r=0&&s.splice(o,1)}}var n=this.snippetMap,r=this.snippetNameMap;e.content?i(e):Array.isArray(e)&&e.forEach(i)},this.parseSnippetFile=function(e){e=e.replace(/\r/g,"");var t=[],n={},r=/^#.*|^({[\s\S]*})\s*$|^(\S+) (.*)$|^((?:\n*\t.*)+)/gm,i;while(i=r.exec(e)){if(i[1])try{n=JSON.parse(i[1]),t.push(n)}catch(s){}if(i[4])n.content=i[4].replace(/^\t/gm,""),t.push(n),n={};else{var o=i[2],u=i[3];if(o=="regex"){var a=/\/((?:[^\/\\]|\\.)*)|$/g;n.guard=a.exec(u)[1],n.trigger=a.exec(u)[1],n.endTrigger=a.exec(u)[1],n.endGuard=a.exec(u)[1]}else o=="snippet"?(n.tabTrigger=u.match(/^\S*/)[0],n.name||(n.name=u)):n[o]=u}}return t},this.getSnippetByName=function(e,t){var n=this.snippetNameMap,r;return this.getActiveScopes(t).some(function(t){var i=n[t];return i&&(r=i[e]),!!r},this),r}}).call(c.prototype);var h=function(e){if(e.tabstopManager)return e.tabstopManager;e.tabstopManager=this,this.$onChange=this.onChange.bind(this),this.$onChangeSelection=s.delayedCall(this.onChangeSelection.bind(this)).schedule,this.$onChangeSession=this.onChangeSession.bind(this),this.$onAfterExec=this.onAfterExec.bind(this),this.attach(e)};(function(){this.attach=function(e){this.index=0,this.ranges=[],this.tabstops=[],this.$openTabstops=null,this.selectedTabstop=null,this.editor=e,this.editor.on("change",this.$onChange),this.editor.on("changeSelection",this.$onChangeSelection),this.editor.on("changeSession",this.$onChangeSession),this.editor.commands.on("afterExec",this.$onAfterExec),this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler)},this.detach=function(){this.tabstops.forEach(this.removeTabstopMarkers,this),this.ranges=null,this.tabstops=null,this.selectedTabstop=null,this.editor.removeListener("change",this.$onChange),this.editor.removeListener("changeSelection",this.$onChangeSelection),this.editor.removeListener("changeSession",this.$onChangeSession),this.editor.commands.removeListener("afterExec",this.$onAfterExec),this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.tabstopManager=null,this.editor=null},this.onChange=function(e){var t=e.data.range,n=e.data.action[0]=="r",r=t.start,i=t.end,s=r.row,o=i.row,u=o-s,a=i.column-r.column;n&&(u=-u,a=-a);if(!this.$inChange&&n){var f=this.selectedTabstop,c=f&&!f.some(function(e){return l(e.start,r)<=0&&l(e.end,i)>=0});if(c)return this.detach()}var h=this.ranges;for(var p=0;p0){this.removeRange(d),p--;continue}d.start.row==s&&d.start.column>r.column&&(d.start.column+=a),d.end.row==s&&d.end.column>=r.column&&(d.end.column+=a),d.start.row>=s&&(d.start.row+=u),d.end.row>=s&&(d.end.row+=u),l(d.start,d.end)>0&&this.removeRange(d)}h.length||this.detach()},this.updateLinkedFields=function(){var e=this.selectedTabstop;if(!e||!e.hasLinkedRanges)return;this.$inChange=!0;var n=this.editor.session,r=n.getTextRange(e.firstNonLinked);for(var i=e.length;i--;){var s=e[i];if(!s.linked)continue;var o=t.snippetManager.tmStrFormat(r,s.original);n.replace(s,o)}this.$inChange=!1},this.onAfterExec=function(e){e.command&&!e.command.readOnly&&this.updateLinkedFields()},this.onChangeSelection=function(){if(!this.editor)return;var e=this.editor.selection.lead,t=this.editor.selection.anchor,n=this.editor.selection.isEmpty();for(var r=this.ranges.length;r--;){if(this.ranges[r].linked)continue;var i=this.ranges[r].contains(e.row,e.column),s=n||this.ranges[r].contains(t.row,t.column);if(i&&s)return}this.detach()},this.onChangeSession=function(){this.detach()},this.tabNext=function(e){var t=this.tabstops.length,n=this.index+(e||1);n=Math.min(Math.max(n,1),t),n==t&&(n=0),this.selectTabstop(n),n===0&&this.detach()},this.selectTabstop=function(e){this.$openTabstops=null;var t=this.tabstops[this.index];t&&this.addTabstopMarkers(t),this.index=e,t=this.tabstops[this.index];if(!t||!t.length)return;this.selectedTabstop=t;if(!this.editor.inVirtualSelectionMode){var n=this.editor.multiSelect;n.toSingleRange(t.firstNonLinked.clone());for(var r=t.length;r--;){if(t.hasLinkedRanges&&t[r].linked)continue;n.addRange(t[r].clone(),!0)}n.ranges[0]&&n.addRange(n.ranges[0].clone())}else this.editor.selection.setRange(t.firstNonLinked);this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler)},this.addTabstops=function(e,t,n){this.$openTabstops||(this.$openTabstops=[]);if(!e[0]){var r=o.fromPoints(n,n);v(r.start,t),v(r.end,t),e[0]=[r],e[0].index=0}var i=this.index,s=[i+1,0],u=this.ranges;e.forEach(function(e,n){var r=this.$openTabstops[n]||e;for(var i=e.length;i--;){var a=e[i],f=o.fromPoints(a.start,a.end||a.start);d(f.start,t),d(f.end,t),f.original=a,f.tabstop=r,u.push(f),r!=e?r.unshift(f):r[i]=f,a.fmtString?(f.linked=!0,r.hasLinkedRanges=!0):r.firstNonLinked||(r.firstNonLinked=f)}r.firstNonLinked||(r.hasLinkedRanges=!1),r===e&&(s.push(r),this.$openTabstops[n]=r),this.addTabstopMarkers(r)},this),s.length>2&&(this.tabstops.length&&s.push(s.splice(2,1)[0]),this.tabstops.splice.apply(this.tabstops,s))},this.addTabstopMarkers=function(e){var t=this.editor.session;e.forEach(function(e){e.markerId||(e.markerId=t.addMarker(e,"ace_snippet-marker","text"))})},this.removeTabstopMarkers=function(e){var t=this.editor.session;e.forEach(function(e){t.removeMarker(e.markerId),e.markerId=null})},this.removeRange=function(e){var t=e.tabstop.indexOf(e);e.tabstop.splice(t,1),t=this.ranges.indexOf(e),this.ranges.splice(t,1),this.editor.session.removeMarker(e.markerId),e.tabstop.length||(t=this.tabstops.indexOf(e.tabstop),t!=-1&&this.tabstops.splice(t,1),this.tabstops.length||this.detach())},this.keyboardHandler=new a,this.keyboardHandler.bindKeys({Tab:function(e){if(t.snippetManager&&t.snippetManager.expandWithTab(e))return;e.tabstopManager.tabNext(1)},"Shift-Tab":function(e){e.tabstopManager.tabNext(-1)},Esc:function(e){e.tabstopManager.detach()},Return:function(e){return!1}})}).call(h.prototype);var p={};p.onChange=u.prototype.onChange,p.setPosition=function(e,t){this.pos.row=e,this.pos.column=t},p.update=function(e,t,n){this.$insertRight=n,this.pos=e,this.onChange(t)};var d=function(e,t){e.row==0&&(e.column+=t.column),e.row+=t.row},v=function(e,t){e.row==t.row&&(e.column-=t.column),e.row-=t.row};e("./lib/dom").importCssString(".ace_snippet-marker { -moz-box-sizing: border-box; box-sizing: border-box; background: rgba(194, 193, 208, 0.09); border: 1px dotted rgba(211, 208, 235, 0.62); position: absolute;}"),t.snippetManager=new c;var m=e("./editor").Editor;(function(){this.insertSnippet=function(e,n){return t.snippetManager.insertSnippet(this,e,n)},this.expandSnippet=function(e){return t.snippetManager.expandWithTab(this,e)}}).call(m.prototype)}),ace.define("ace/ext/emmet",["require","exports","module","ace/keyboard/hash_handler","ace/editor","ace/snippets","ace/range","resources","resources","range","tabStops","resources","utils","actions","ace/config","ace/config"],function(e,t,n){"use strict";function f(){}var r=e("ace/keyboard/hash_handler").HashHandler,i=e("ace/editor").Editor,s=e("ace/snippets").snippetManager,o=e("ace/range").Range,u,a;f.prototype={setupContext:function(e){this.ace=e,this.indentation=e.session.getTabString(),u||(u=window.emmet),u.require("resources").setVariable("indentation",this.indentation),this.$syntax=null,this.$syntax=this.getSyntax()},getSelectionRange:function(){var e=this.ace.getSelectionRange(),t=this.ace.session.doc;return{start:t.positionToIndex(e.start),end:t.positionToIndex(e.end)}},createSelection:function(e,t){var n=this.ace.session.doc;this.ace.selection.setRange({start:n.indexToPosition(e),end:n.indexToPosition(t)})},getCurrentLineRange:function(){var e=this.ace,t=e.getCursorPosition().row,n=e.session.getLine(t).length,r=e.session.doc.positionToIndex({row:t,column:0});return{start:r,end:r+n}},getCaretPos:function(){var e=this.ace.getCursorPosition();return this.ace.session.doc.positionToIndex(e)},setCaretPos:function(e){var t=this.ace.session.doc.indexToPosition(e);this.ace.selection.moveToPosition(t)},getCurrentLine:function(){var e=this.ace.getCursorPosition().row;return this.ace.session.getLine(e)},replaceContent:function(e,t,n,r){n==null&&(n=t==null?this.getContent().length:t),t==null&&(t=0);var i=this.ace,u=i.session.doc,a=o.fromPoints(u.indexToPosition(t),u.indexToPosition(n));i.session.remove(a),a.end=a.start,e=this.$updateTabstops(e),s.insertSnippet(i,e)},getContent:function(){return this.ace.getValue()},getSyntax:function(){if(this.$syntax)return this.$syntax;var e=this.ace.session.$modeId.split("/").pop();if(e=="html"||e=="php"){var t=this.ace.getCursorPosition(),n=this.ace.session.getState(t.row);typeof n!="string"&&(n=n[0]),n&&(n=n.split("-"),n.length>1?e=n[0]:e=="php"&&(e="html"))}return e},getProfileName:function(){switch(this.getSyntax()){case"css":return"css";case"xml":case"xsl":return"xml";case"html":var e=u.require("resources").getVariable("profile");return e||(e=this.ace.session.getLines(0,2).join("").search(/]+XHTML/i)!=-1?"xhtml":"html"),e}return"xhtml"},prompt:function(e){return prompt(e)},getSelection:function(){return this.ace.session.getTextRange()},getFilePath:function(){return""},$updateTabstops:function(e){var t=1e3,n=0,r=null,i=u.require("range"),s=u.require("tabStops"),o=u.require("resources").getVocabulary("user"),a={tabstop:function(e){var o=parseInt(e.group,10),u=o===0;u?o=++n:o+=t;var f=e.placeholder;f&&(f=s.processText(f,a));var l="${"+o+(f?":"+f:"")+"}";return u&&(r=i.create(e.start,l)),l},escape:function(e){return e=="$"?"\\$":e=="\\"?"\\\\":e}};return e=s.processText(e,a),o.variables.insert_final_tabstop&&!/\$\{0\}$/.test(e)?e+="${0}":r&&(e=u.require("utils").replaceSubstring(e,"${0}",r)),e}};var l={expand_abbreviation:{mac:"ctrl+alt+e",win:"alt+e"},match_pair_outward:{mac:"ctrl+d",win:"ctrl+,"},match_pair_inward:{mac:"ctrl+j",win:"ctrl+shift+0"},matching_pair:{mac:"ctrl+alt+j",win:"alt+j"},next_edit_point:"alt+right",prev_edit_point:"alt+left",toggle_comment:{mac:"command+/",win:"ctrl+/"},split_join_tag:{mac:"shift+command+'",win:"shift+ctrl+`"},remove_tag:{mac:"command+'",win:"shift+ctrl+;"},evaluate_math_expression:{mac:"shift+command+y",win:"shift+ctrl+y"},increment_number_by_1:"ctrl+up",decrement_number_by_1:"ctrl+down",increment_number_by_01:"alt+up",decrement_number_by_01:"alt+down",increment_number_by_10:{mac:"alt+command+up",win:"shift+alt+up"},decrement_number_by_10:{mac:"alt+command+down",win:"shift+alt+down"},select_next_item:{mac:"shift+command+.",win:"shift+ctrl+."},select_previous_item:{mac:"shift+command+,",win:"shift+ctrl+,"},reflect_css_value:{mac:"shift+command+r",win:"shift+ctrl+r"},encode_decode_data_url:{mac:"shift+ctrl+d",win:"ctrl+'"},expand_abbreviation_with_tab:"Tab",wrap_with_abbreviation:{mac:"shift+ctrl+a",win:"shift+ctrl+a"}},c=new f;t.commands=new r,t.runEmmetCommand=function(e){try{c.setupContext(e);if(c.getSyntax()=="php")return!1;var t=u.require("actions");if(this.action=="expand_abbreviation_with_tab"&&!e.selection.isEmpty())return!1;if(this.action=="wrap_with_abbreviation")return setTimeout(function(){t.run("wrap_with_abbreviation",c)},0);var n=e.selection.lead,r=e.session.getTokenAt(n.row,n.column);if(r&&/\btag\b/.test(r.type))return!1;var i=t.run(this.action,c)}catch(s){e._signal("changeStatus",typeof s=="string"?s:s.message),console.log(s),i=!1}return i};for(var h in l)t.commands.addCommand({name:"emmet:"+h,action:h,bindKey:l[h],exec:t.runEmmetCommand,multiSelectAction:"forEach"});t.updateCommands=function(e,n){n?e.keyBinding.addKeyboardHandler(t.commands):e.keyBinding.removeKeyboardHandler(t.commands)},t.isSupportedMode=function(e){return e&&/css|less|scss|sass|stylus|html|php|twig|ejs/.test(e)};var p=function(n,r){var i=r;if(!i)return;var s=t.isSupportedMode(i.session.$modeId);n.enableEmmet===!1&&(s=!1),s&&typeof a=="string"&&e("ace/config").loadModule(a,function(){a=null}),t.updateCommands(i,s)};t.AceEmmetEditor=f,e("ace/config").defineOptions(i.prototype,"editor",{enableEmmet:{set:function(e){this[e?"on":"removeListener"]("changeMode",p),p({enableEmmet:!!e},this)},value:!0}}),t.setCore=function(e){typeof e=="string"?a=e:u=e}}); + (function() { + ace.require(["ace/ext/emmet"], function() {}); + })(); + \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/ext-searchbox.js b/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/ext-searchbox.js new file mode 100644 index 000000000..964646ba5 --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/ext-searchbox.js @@ -0,0 +1,5 @@ +ace.define("ace/ext/searchbox",["require","exports","module","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/keyboard/hash_handler","ace/lib/keys"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=e("../lib/lang"),s=e("../lib/event"),o=".ace_search {background-color: #ddd;border: 1px solid #cbcbcb;border-top: 0 none;max-width: 325px;overflow: hidden;margin: 0;padding: 4px;padding-right: 6px;padding-bottom: 0;position: absolute;top: 0px;z-index: 99;white-space: normal;}.ace_search.left {border-left: 0 none;border-radius: 0px 0px 5px 0px;left: 0;}.ace_search.right {border-radius: 0px 0px 0px 5px;border-right: 0 none;right: 0;}.ace_search_form, .ace_replace_form {border-radius: 3px;border: 1px solid #cbcbcb;float: left;margin-bottom: 4px;overflow: hidden;}.ace_search_form.ace_nomatch {outline: 1px solid red;}.ace_search_field {background-color: white;border-right: 1px solid #cbcbcb;border: 0 none;-webkit-box-sizing: border-box;-moz-box-sizing: border-box;box-sizing: border-box;float: left;height: 22px;outline: 0;padding: 0 7px;width: 214px;margin: 0;}.ace_searchbtn,.ace_replacebtn {background: #fff;border: 0 none;border-left: 1px solid #dcdcdc;cursor: pointer;float: left;height: 22px;margin: 0;padding: 0;position: relative;}.ace_searchbtn:last-child,.ace_replacebtn:last-child {border-top-right-radius: 3px;border-bottom-right-radius: 3px;}.ace_searchbtn:disabled {background: none;cursor: default;}.ace_searchbtn {background-position: 50% 50%;background-repeat: no-repeat;width: 27px;}.ace_searchbtn.prev {background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFCAYAAAB4ka1VAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADFJREFUeNpiSU1NZUAC/6E0I0yACYskCpsJiySKIiY0SUZk40FyTEgCjGgKwTRAgAEAQJUIPCE+qfkAAAAASUVORK5CYII=); }.ace_searchbtn.next {background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFCAYAAAB4ka1VAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADRJREFUeNpiTE1NZQCC/0DMyIAKwGJMUAYDEo3M/s+EpvM/mkKwCQxYjIeLMaELoLMBAgwAU7UJObTKsvAAAAAASUVORK5CYII=); }.ace_searchbtn_close {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0;border-radius: 50%;border: 0 none;color: #656565;cursor: pointer;float: right;font: 16px/16px Arial;height: 14px;margin: 5px 1px 9px 5px;padding: 0;text-align: center;width: 14px;}.ace_searchbtn_close:hover {background-color: #656565;background-position: 50% 100%;color: white;}.ace_replacebtn.prev {width: 54px}.ace_replacebtn.next {width: 27px}.ace_button {margin-left: 2px;cursor: pointer;-webkit-user-select: none;-moz-user-select: none;-o-user-select: none;-ms-user-select: none;user-select: none;overflow: hidden;opacity: 0.7;border: 1px solid rgba(100,100,100,0.23);padding: 1px;-moz-box-sizing: border-box;box-sizing: border-box;color: black;}.ace_button:hover {background-color: #eee;opacity:1;}.ace_button:active {background-color: #ddd;}.ace_button.checked {border-color: #3399ff;opacity:1;}.ace_search_options{margin-bottom: 3px;text-align: right;-webkit-user-select: none;-moz-user-select: none;-o-user-select: none;-ms-user-select: none;user-select: none;}",u=e("../keyboard/hash_handler").HashHandler,a=e("../lib/keys");r.importCssString(o,"ace_searchbox");var f=''.replace(/>\s+/g,">"),l=function(e,t,n){var i=r.createElement("div");i.innerHTML=f,this.element=i.firstChild,this.$init(),this.setEditor(e)};(function(){this.setEditor=function(e){e.searchBox=this,e.container.appendChild(this.element),this.editor=e},this.$initElements=function(e){this.searchBox=e.querySelector(".ace_search_form"),this.replaceBox=e.querySelector(".ace_replace_form"),this.searchOptions=e.querySelector(".ace_search_options"),this.regExpOption=e.querySelector("[action=toggleRegexpMode]"),this.caseSensitiveOption=e.querySelector("[action=toggleCaseSensitive]"),this.wholeWordOption=e.querySelector("[action=toggleWholeWords]"),this.searchInput=this.searchBox.querySelector(".ace_search_field"),this.replaceInput=this.replaceBox.querySelector(".ace_search_field")},this.$init=function(){var e=this.element;this.$initElements(e);var t=this;s.addListener(e,"mousedown",function(e){setTimeout(function(){t.activeInput.focus()},0),s.stopPropagation(e)}),s.addListener(e,"click",function(e){var n=e.target||e.srcElement,r=n.getAttribute("action");r&&t[r]?t[r]():t.$searchBarKb.commands[r]&&t.$searchBarKb.commands[r].exec(t),s.stopPropagation(e)}),s.addCommandKeyListener(e,function(e,n,r){var i=a.keyCodeToString(r),o=t.$searchBarKb.findKeyCommand(n,i);o&&o.exec&&(o.exec(t),s.stopEvent(e))}),this.$onChange=i.delayedCall(function(){t.find(!1,!1)}),s.addListener(this.searchInput,"input",function(){t.$onChange.schedule(20)}),s.addListener(this.searchInput,"focus",function(){t.activeInput=t.searchInput,t.searchInput.value&&t.highlight()}),s.addListener(this.replaceInput,"focus",function(){t.activeInput=t.replaceInput,t.searchInput.value&&t.highlight()})},this.$closeSearchBarKb=new u([{bindKey:"Esc",name:"closeSearchBar",exec:function(e){e.searchBox.hide()}}]),this.$searchBarKb=new u,this.$searchBarKb.bindKeys({"Ctrl-f|Command-f|Ctrl-H|Command-Option-F":function(e){var t=e.isReplace=!e.isReplace;e.replaceBox.style.display=t?"":"none",e[t?"replaceInput":"searchInput"].focus()},"Ctrl-G|Command-G":function(e){e.findNext()},"Ctrl-Shift-G|Command-Shift-G":function(e){e.findPrev()},esc:function(e){setTimeout(function(){e.hide()})},Return:function(e){e.activeInput==e.replaceInput&&e.replace(),e.findNext()},"Shift-Return":function(e){e.activeInput==e.replaceInput&&e.replace(),e.findPrev()},"Alt-Return":function(e){e.activeInput==e.replaceInput&&e.replaceAll(),e.findAll()},Tab:function(e){(e.activeInput==e.replaceInput?e.searchInput:e.replaceInput).focus()}}),this.$searchBarKb.addCommands([{name:"toggleRegexpMode",bindKey:{win:"Alt-R|Alt-/",mac:"Ctrl-Alt-R|Ctrl-Alt-/"},exec:function(e){e.regExpOption.checked=!e.regExpOption.checked,e.$syncOptions()}},{name:"toggleCaseSensitive",bindKey:{win:"Alt-C|Alt-I",mac:"Ctrl-Alt-R|Ctrl-Alt-I"},exec:function(e){e.caseSensitiveOption.checked=!e.caseSensitiveOption.checked,e.$syncOptions()}},{name:"toggleWholeWords",bindKey:{win:"Alt-B|Alt-W",mac:"Ctrl-Alt-B|Ctrl-Alt-W"},exec:function(e){e.wholeWordOption.checked=!e.wholeWordOption.checked,e.$syncOptions()}}]),this.$syncOptions=function(){r.setCssClass(this.regExpOption,"checked",this.regExpOption.checked),r.setCssClass(this.wholeWordOption,"checked",this.wholeWordOption.checked),r.setCssClass(this.caseSensitiveOption,"checked",this.caseSensitiveOption.checked),this.find(!1,!1)},this.highlight=function(e){this.editor.session.highlight(e||this.editor.$search.$options.re),this.editor.renderer.updateBackMarkers()},this.find=function(e,t){var n=this.editor.find(this.searchInput.value,{skipCurrent:e,backwards:t,wrap:!0,regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked}),i=!n&&this.searchInput.value;r.setCssClass(this.searchBox,"ace_nomatch",i),this.editor._emit("findSearchBox",{match:!i}),this.highlight()},this.findNext=function(){this.find(!0,!1)},this.findPrev=function(){this.find(!0,!0)},this.findAll=function(){var e=this.editor.findAll(this.searchInput.value,{regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked}),t=!e&&this.searchInput.value;r.setCssClass(this.searchBox,"ace_nomatch",t),this.editor._emit("findSearchBox",{match:!t}),this.highlight(),this.hide()},this.replace=function(){this.editor.getReadOnly()||this.editor.replace(this.replaceInput.value)},this.replaceAndFindNext=function(){this.editor.getReadOnly()||(this.editor.replace(this.replaceInput.value),this.findNext())},this.replaceAll=function(){this.editor.getReadOnly()||this.editor.replaceAll(this.replaceInput.value)},this.hide=function(){this.element.style.display="none",this.editor.keyBinding.removeKeyboardHandler(this.$closeSearchBarKb),this.editor.focus()},this.show=function(e,t){this.element.style.display="",this.replaceBox.style.display=t?"":"none",this.isReplace=t,e&&(this.searchInput.value=e),this.searchInput.focus(),this.searchInput.select(),this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb)},this.isFocused=function(){var e=document.activeElement;return e==this.searchInput||e==this.replaceInput}}).call(l.prototype),t.SearchBox=l,t.Search=function(e,t){var n=e.searchBox||new l(e);n.show(e.session.getTextRange(),t)}}); + (function() { + ace.require(["ace/ext/searchbox"], function() {}); + })(); + \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/mode-css.js b/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/mode-css.js new file mode 100644 index 000000000..cb54989ab --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/mode-css.js @@ -0,0 +1 @@ +ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text_highlight_rules").TextHighlightRules,o=t.supportType="animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|pointer-events|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index",u=t.supportFunction="rgb|rgba|url|attr|counter|counters",a=t.supportConstant="absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero",f=t.supportConstantColor="aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow",l=t.supportConstantFonts="arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace",c=t.numRe="\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))",h=t.pseudoElements="(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b",p=t.pseudoClasses="(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b",d=function(){var e=this.createKeywordMapper({"support.function":u,"support.constant":a,"support.type":o,"support.constant.color":f,"support.constant.fonts":l},"text",!0);this.$rules={start:[{token:"comment",regex:"\\/\\*",push:"comment"},{token:"paren.lparen",regex:"\\{",push:"ruleset"},{token:"string",regex:"@.*?{",push:"media"},{token:"keyword",regex:"#[a-z0-9-_]+"},{token:"variable",regex:"\\.[a-z0-9-_]+"},{token:"string",regex:":[a-z0-9-_]+"},{token:"constant",regex:"[a-z0-9-_]+"},{caseInsensitive:!0}],media:[{token:"comment",regex:"\\/\\*",push:"comment"},{token:"paren.lparen",regex:"\\{",push:"ruleset"},{token:"string",regex:"\\}",next:"pop"},{token:"keyword",regex:"#[a-z0-9-_]+"},{token:"variable",regex:"\\.[a-z0-9-_]+"},{token:"string",regex:":[a-z0-9-_]+"},{token:"constant",regex:"[a-z0-9-_]+"},{caseInsensitive:!0}],comment:[{token:"comment",regex:"\\*\\/",next:"pop"},{defaultToken:"comment"}],ruleset:[{token:"paren.rparen",regex:"\\}",next:"pop"},{token:"comment",regex:"\\/\\*",push:"comment"},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:["constant.numeric","keyword"],regex:"("+c+")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)"},{token:"constant.numeric",regex:c},{token:"constant.numeric",regex:"#[a-f0-9]{6}"},{token:"constant.numeric",regex:"#[a-f0-9]{3}"},{token:["punctuation","entity.other.attribute-name.pseudo-element.css"],regex:h},{token:["punctuation","entity.other.attribute-name.pseudo-class.css"],regex:p},{token:["support.function","string","support.function"],regex:"(url\\()(.*)(\\))"},{token:e,regex:"\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"},{caseInsensitive:!0}]},this.normalizeRules()};r.inherits(d,s),t.CssHighlightRules=d}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("../../token_iterator").TokenIterator,o=e("../../lib/lang"),u=["text","paren.rparen","punctuation.operator"],a=["text","paren.rparen","punctuation.operator","comment"],f,l={},c=function(e){var t=-1;e.multiSelect&&(t=e.selection.index,l.rangeCount!=e.multiSelect.rangeCount&&(l={rangeCount:e.multiSelect.rangeCount}));if(l[t])return f=l[t];f=l[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},h=function(){this.add("braces","insertion",function(e,t,n,r,i){var s=n.getCursorPosition(),u=r.doc.getLine(s.row);if(i=="{"){c(n);var a=n.getSelectionRange(),l=r.doc.getTextRange(a);if(l!==""&&l!=="{"&&n.getWrapBehavioursEnabled())return{text:"{"+l+"}",selection:!1};if(h.isSaneInsertion(n,r))return/[\]\}\)]/.test(u[s.column])||n.inMultiSelectMode?(h.recordAutoInsert(n,r,"}"),{text:"{}",selection:[1,1]}):(h.recordMaybeInsert(n,r,"{"),{text:"{",selection:[1,1]})}else if(i=="}"){c(n);var p=u.substring(s.column,s.column+1);if(p=="}"){var d=r.$findOpeningBracket("}",{column:s.column+1,row:s.row});if(d!==null&&h.isAutoInsertedClosing(s,u,i))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else{if(i=="\n"||i=="\r\n"){c(n);var v="";h.isMaybeInsertedClosing(s,u)&&(v=o.stringRepeat("}",f.maybeInsertedBrackets),h.clearMaybeInsertedClosing());var p=u.substring(s.column,s.column+1);if(p==="}"){var m=r.findMatchingBracket({row:s.row,column:s.column+1},"}");if(!m)return null;var g=this.$getIndent(r.getLine(m.row))}else{if(!v){h.clearMaybeInsertedClosing();return}var g=this.$getIndent(u)}var y=g+r.getTabString();return{text:"\n"+y+"\n"+g+v,selection:[1,y.length,1,y.length]}}h.clearMaybeInsertedClosing()}}),this.add("braces","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="{"){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.end.column,i.end.column+1);if(u=="}")return i.end.column++,i;f.maybeInsertedBrackets--}}),this.add("parens","insertion",function(e,t,n,r,i){if(i=="("){c(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapBehavioursEnabled())return{text:"("+o+")",selection:!1};if(h.isSaneInsertion(n,r))return h.recordAutoInsert(n,r,")"),{text:"()",selection:[1,1]}}else if(i==")"){c(n);var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(f==")"){var l=r.$findOpeningBracket(")",{column:u.column+1,row:u.row});if(l!==null&&h.isAutoInsertedClosing(u,a,i))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="("){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==")")return i.end.column++,i}}),this.add("brackets","insertion",function(e,t,n,r,i){if(i=="["){c(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapBehavioursEnabled())return{text:"["+o+"]",selection:!1};if(h.isSaneInsertion(n,r))return h.recordAutoInsert(n,r,"]"),{text:"[]",selection:[1,1]}}else if(i=="]"){c(n);var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(f=="]"){var l=r.$findOpeningBracket("]",{column:u.column+1,row:u.row});if(l!==null&&h.isAutoInsertedClosing(u,a,i))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="["){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u=="]")return i.end.column++,i}}),this.add("string_dquotes","insertion",function(e,t,n,r,i){if(i=='"'||i=="'"){c(n);var s=i,o=n.getSelectionRange(),u=r.doc.getTextRange(o);if(u!==""&&u!=="'"&&u!='"'&&n.getWrapBehavioursEnabled())return{text:s+u+s,selection:!1};var a=n.getCursorPosition(),f=r.doc.getLine(a.row),l=f.substring(a.column-1,a.column),h=f.substring(a.column,a.column+1),p=r.getTokenAt(a.row,a.column),d=r.getTokenAt(a.row,a.column+1);if(l=="\\"&&p&&/escape/.test(p.type))return null;var v=p&&/string/.test(p.type),m=!d||/string/.test(d.type),g;if(h==s)g=v!==m;else{if(v&&!m)return null;if(v&&m)return null;var y=r.$mode.tokenRe;y.lastIndex=0;var b=y.test(l);y.lastIndex=0;var w=y.test(l);if(b||w)return null;if(h&&!/[\s;,.})\]\\]/.test(h))return null;g=!0}return{text:g?s+s:"",selection:[1,1]}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&(s=='"'||s=="'")){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==s)return i.end.column++,i}})};h.isSaneInsertion=function(e,t){var n=e.getCursorPosition(),r=new s(t,n.row,n.column);if(!this.$matchTokenType(r.getCurrentToken()||"text",u)){var i=new s(t,n.row,n.column+1);if(!this.$matchTokenType(i.getCurrentToken()||"text",u))return!1}return r.stepForward(),r.getCurrentTokenRow()!==n.row||this.$matchTokenType(r.getCurrentToken()||"text",a)},h.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},h.recordAutoInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isAutoInsertedClosing(r,i,f.autoInsertedLineEnd[0])||(f.autoInsertedBrackets=0),f.autoInsertedRow=r.row,f.autoInsertedLineEnd=n+i.substr(r.column),f.autoInsertedBrackets++},h.recordMaybeInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isMaybeInsertedClosing(r,i)||(f.maybeInsertedBrackets=0),f.maybeInsertedRow=r.row,f.maybeInsertedLineStart=i.substr(0,r.column)+n,f.maybeInsertedLineEnd=i.substr(r.column),f.maybeInsertedBrackets++},h.isAutoInsertedClosing=function(e,t,n){return f.autoInsertedBrackets>0&&e.row===f.autoInsertedRow&&n===f.autoInsertedLineEnd[0]&&t.substr(e.column)===f.autoInsertedLineEnd},h.isMaybeInsertedClosing=function(e,t){return f.maybeInsertedBrackets>0&&e.row===f.maybeInsertedRow&&t.substr(e.column)===f.maybeInsertedLineEnd&&t.substr(0,e.column)==f.maybeInsertedLineStart},h.popAutoInsertedClosing=function(){f.autoInsertedLineEnd=f.autoInsertedLineEnd.substr(1),f.autoInsertedBrackets--},h.clearMaybeInsertedClosing=function(){f&&(f.maybeInsertedBrackets=0,f.maybeInsertedRow=-1)},r.inherits(h,i),t.CstyleBehaviour=h}),ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("./cstyle").CstyleBehaviour,o=e("../../token_iterator").TokenIterator,u=function(){this.inherit(s),this.add("colon","insertion",function(e,t,n,r,i){if(i===":"){var s=n.getCursorPosition(),u=new o(r,s.row,s.column),a=u.getCurrentToken();a&&a.value.match(/\s+/)&&(a=u.stepBackward());if(a&&a.type==="support.type"){var f=r.doc.getLine(s.row),l=f.substring(s.column,s.column+1);if(l===":")return{text:"",selection:[1,1]};if(!f.substring(s.column).match(/^\s*;/))return{text:":;",selection:[1,1]}}}}),this.add("colon","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s===":"){var u=n.getCursorPosition(),a=new o(r,u.row,u.column),f=a.getCurrentToken();f&&f.value.match(/\s+/)&&(f=a.stepBackward());if(f&&f.type==="support.type"){var l=r.doc.getLine(i.start.row),c=l.substring(i.end.column,i.end.column+1);if(c===";")return i.end.column++,i}}}),this.add("semicolon","insertion",function(e,t,n,r,i){if(i===";"){var s=n.getCursorPosition(),o=r.doc.getLine(s.row),u=o.substring(s.column,s.column+1);if(u===";")return{text:"",selection:[1,1]}}})};r.inherits(u,s),t.CssBehaviour=u}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/(\{|\[)[^\}\]]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var i=this._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?"start":i},this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n);if(this.startRegionRe.test(i))return this.getCommentRegionBlock(e,i,n);var s=i.match(this.foldingStartMarker);if(s){var o=s.index;if(s[1])return this.openingBracketBlock(e,s[1],n,o);var u=e.getCommentFoldRange(n,o+s[0].length,1);return u&&!u.isMultiLine()&&(r?u=this.getSectionRange(e,n):t!="all"&&(u=null)),u}if(t==="markbegin")return;var s=i.match(this.foldingStopMarker);if(s){var o=s.index+s[0].length;return s[1]?this.closingBracketBlock(e,s[1],n,o):e.getCommentFoldRange(n,o,-1)}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length;t+=1;var u=t,a=e.getLength();while(++tf)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)},this.getCommentRegionBlock=function(e,t,n){var r=t.search(/\s*$/),s=e.getLength(),o=n,u=/^\s*(?:\/\*|\/\/)#(end)?region\b/,a=1;while(++no)return new i(o,r,l,t.length)}}.call(o.prototype)}),ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/css","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./css_highlight_rules").CssHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,u=e("../worker/worker_client").WorkerClient,a=e("./behaviour/css").CssBehaviour,f=e("./folding/cstyle").FoldMode,l=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new a,this.foldingRules=new f};r.inherits(l,i),function(){this.foldingRules="cStyle",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e).tokens;if(i.length&&i[i.length-1].type=="comment")return r;var s=t.match(/^.*\{\s*$/);return s&&(r+=n),r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.createWorker=function(e){var t=new u(["ace"],"ace/mode/css_worker","Worker");return t.attachToDocument(e.getDocument()),t.on("csslint",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/css"}.call(l.prototype),t.Mode=l}) \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/mode-html.js b/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/mode-html.js new file mode 100644 index 000000000..7b9e89a65 --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/mode-html.js @@ -0,0 +1 @@ +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},s.getTagRule(),{defaultToken:"comment.doc",caseInsensitive:!0}]}};r.inherits(s,i),s.getTagRule=function(e){return{token:"comment.doc.tag.storage.type",regex:"\\b(?:TODO|FIXME|XXX|HACK)\\b"}},s.getStartRule=function(e){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:e}},s.getEndRule=function(e){return{token:"comment.doc",regex:"\\*\\/",next:e}},t.DocCommentHighlightRules=s}),ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./doc_comment_highlight_rules").DocCommentHighlightRules,s=e("./text_highlight_rules").TextHighlightRules,o=function(e){var t=this.createKeywordMapper({"variable.language":"Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Namespace|QName|XML|XMLList|ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|SyntaxError|TypeError|URIError|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt|JSON|Math|this|arguments|prototype|window|document",keyword:"const|yield|import|get|set|break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|__parent__|__count__|escape|unescape|with|__proto__|class|enum|extends|super|export|implements|private|public|interface|package|protected|static","storage.type":"const|let|var|function","constant.language":"null|Infinity|NaN|undefined","support.function":"alert","constant.language.boolean":"true|false"},"identifier"),n="case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void",r="[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b",s="\\\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)";this.$rules={no_regex:[{token:"comment",regex:"\\/\\/",next:"line_comment"},i.getStartRule("doc-start"),{token:"comment",regex:/\/\*/,next:"comment"},{token:"string",regex:"'(?=.)",next:"qstring"},{token:"string",regex:'"(?=.)',next:"qqstring"},{token:"constant.numeric",regex:/0[xX][0-9a-fA-F]+\b/},{token:"constant.numeric",regex:/[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/},{token:["storage.type","punctuation.operator","support.function","punctuation.operator","entity.name.function","text","keyword.operator"],regex:"("+r+")(\\.)(prototype)(\\.)("+r+")(\\s*)(=)",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+r+")(\\.)("+r+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+r+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","entity.name.function","text","paren.lparen"],regex:"("+r+")(\\.)("+r+")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","text","entity.name.function","text","paren.lparen"],regex:"(function)(\\s+)("+r+")(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","punctuation.operator","text","storage.type","text","paren.lparen"],regex:"("+r+")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["text","text","storage.type","text","paren.lparen"],regex:"(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:"keyword",regex:"(?:"+n+")\\b",next:"start"},{token:["punctuation.operator","support.function"],regex:/(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/},{token:["punctuation.operator","support.function.dom"],regex:/(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/},{token:["punctuation.operator","support.constant"],regex:/(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/},{token:["support.constant"],regex:/that\b/},{token:["storage.type","punctuation.operator","support.function.firebug"],regex:/(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/},{token:t,regex:r},{token:"keyword.operator",regex:/--|\+\+|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|[!$%&*+\-~\/^]=?/,next:"start"},{token:"punctuation.operator",regex:/[?:,;.]/,next:"start"},{token:"paren.lparen",regex:/[\[({]/,next:"start"},{token:"paren.rparen",regex:/[\])}]/},{token:"comment",regex:/^#!.*$/}],start:[i.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment_regex_allowed"},{token:"comment",regex:"\\/\\/",next:"line_comment_regex_allowed"},{token:"string.regexp",regex:"\\/",next:"regex"},{token:"text",regex:"\\s+|^$",next:"start"},{token:"empty",regex:"",next:"no_regex"}],regex:[{token:"regexp.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"string.regexp",regex:"/[sxngimy]*",next:"no_regex"},{token:"invalid",regex:/\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/},{token:"constant.language.escape",regex:/\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/},{token:"constant.language.delimiter",regex:/\|/},{token:"constant.language.escape",regex:/\[\^?/,next:"regex_character_class"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp"}],regex_character_class:[{token:"regexp.charclass.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"constant.language.escape",regex:"]",next:"regex"},{token:"constant.language.escape",regex:"-"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp.charachterclass"}],function_arguments:[{token:"variable.parameter",regex:r},{token:"punctuation.operator",regex:"[, ]+"},{token:"punctuation.operator",regex:"$"},{token:"empty",regex:"",next:"no_regex"}],comment_regex_allowed:[i.getTagRule(),{token:"comment",regex:"\\*\\/",next:"start"},{defaultToken:"comment",caseInsensitive:!0}],comment:[i.getTagRule(),{token:"comment",regex:"\\*\\/",next:"no_regex"},{defaultToken:"comment",caseInsensitive:!0}],line_comment_regex_allowed:[i.getTagRule(),{token:"comment",regex:"$|^",next:"start"},{defaultToken:"comment",caseInsensitive:!0}],line_comment:[i.getTagRule(),{token:"comment",regex:"$|^",next:"no_regex"},{defaultToken:"comment",caseInsensitive:!0}],qqstring:[{token:"constant.language.escape",regex:s},{token:"string",regex:"\\\\$",next:"qqstring"},{token:"string",regex:'"|$',next:"no_regex"},{defaultToken:"string"}],qstring:[{token:"constant.language.escape",regex:s},{token:"string",regex:"\\\\$",next:"qstring"},{token:"string",regex:"'|$",next:"no_regex"},{defaultToken:"string"}]},(!e||!e.noES6)&&this.$rules.no_regex.unshift({regex:"[{}]",onMatch:function(e,t,n){this.next=e=="{"?this.nextState:"";if(e=="{"&&n.length)return n.unshift("start",t),"paren";if(e=="}"&&n.length){n.shift(),this.next=n.shift();if(this.next.indexOf("string")!=-1)return"paren.quasi.end"}return e=="{"?"paren.lparen":"paren.rparen"},nextState:"start"},{token:"string.quasi.start",regex:/`/,push:[{token:"constant.language.escape",regex:s},{token:"paren.quasi.start",regex:/\${/,push:"start"},{token:"string.quasi.end",regex:/`/,next:"pop"},{defaultToken:"string.quasi"}]}),this.embedRules(i,"doc-",[i.getEndRule("no_regex")]),this.normalizeRules()};r.inherits(o,s),t.JavaScriptHighlightRules=o}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("../../token_iterator").TokenIterator,o=e("../../lib/lang"),u=["text","paren.rparen","punctuation.operator"],a=["text","paren.rparen","punctuation.operator","comment"],f,l={},c=function(e){var t=-1;e.multiSelect&&(t=e.selection.index,l.rangeCount!=e.multiSelect.rangeCount&&(l={rangeCount:e.multiSelect.rangeCount}));if(l[t])return f=l[t];f=l[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},h=function(){this.add("braces","insertion",function(e,t,n,r,i){var s=n.getCursorPosition(),u=r.doc.getLine(s.row);if(i=="{"){c(n);var a=n.getSelectionRange(),l=r.doc.getTextRange(a);if(l!==""&&l!=="{"&&n.getWrapBehavioursEnabled())return{text:"{"+l+"}",selection:!1};if(h.isSaneInsertion(n,r))return/[\]\}\)]/.test(u[s.column])||n.inMultiSelectMode?(h.recordAutoInsert(n,r,"}"),{text:"{}",selection:[1,1]}):(h.recordMaybeInsert(n,r,"{"),{text:"{",selection:[1,1]})}else if(i=="}"){c(n);var p=u.substring(s.column,s.column+1);if(p=="}"){var d=r.$findOpeningBracket("}",{column:s.column+1,row:s.row});if(d!==null&&h.isAutoInsertedClosing(s,u,i))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else{if(i=="\n"||i=="\r\n"){c(n);var v="";h.isMaybeInsertedClosing(s,u)&&(v=o.stringRepeat("}",f.maybeInsertedBrackets),h.clearMaybeInsertedClosing());var p=u.substring(s.column,s.column+1);if(p==="}"){var m=r.findMatchingBracket({row:s.row,column:s.column+1},"}");if(!m)return null;var g=this.$getIndent(r.getLine(m.row))}else{if(!v){h.clearMaybeInsertedClosing();return}var g=this.$getIndent(u)}var y=g+r.getTabString();return{text:"\n"+y+"\n"+g+v,selection:[1,y.length,1,y.length]}}h.clearMaybeInsertedClosing()}}),this.add("braces","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="{"){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.end.column,i.end.column+1);if(u=="}")return i.end.column++,i;f.maybeInsertedBrackets--}}),this.add("parens","insertion",function(e,t,n,r,i){if(i=="("){c(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapBehavioursEnabled())return{text:"("+o+")",selection:!1};if(h.isSaneInsertion(n,r))return h.recordAutoInsert(n,r,")"),{text:"()",selection:[1,1]}}else if(i==")"){c(n);var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(f==")"){var l=r.$findOpeningBracket(")",{column:u.column+1,row:u.row});if(l!==null&&h.isAutoInsertedClosing(u,a,i))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="("){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==")")return i.end.column++,i}}),this.add("brackets","insertion",function(e,t,n,r,i){if(i=="["){c(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapBehavioursEnabled())return{text:"["+o+"]",selection:!1};if(h.isSaneInsertion(n,r))return h.recordAutoInsert(n,r,"]"),{text:"[]",selection:[1,1]}}else if(i=="]"){c(n);var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(f=="]"){var l=r.$findOpeningBracket("]",{column:u.column+1,row:u.row});if(l!==null&&h.isAutoInsertedClosing(u,a,i))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="["){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u=="]")return i.end.column++,i}}),this.add("string_dquotes","insertion",function(e,t,n,r,i){if(i=='"'||i=="'"){c(n);var s=i,o=n.getSelectionRange(),u=r.doc.getTextRange(o);if(u!==""&&u!=="'"&&u!='"'&&n.getWrapBehavioursEnabled())return{text:s+u+s,selection:!1};var a=n.getCursorPosition(),f=r.doc.getLine(a.row),l=f.substring(a.column-1,a.column),h=f.substring(a.column,a.column+1),p=r.getTokenAt(a.row,a.column),d=r.getTokenAt(a.row,a.column+1);if(l=="\\"&&p&&/escape/.test(p.type))return null;var v=p&&/string/.test(p.type),m=!d||/string/.test(d.type),g;if(h==s)g=v!==m;else{if(v&&!m)return null;if(v&&m)return null;var y=r.$mode.tokenRe;y.lastIndex=0;var b=y.test(l);y.lastIndex=0;var w=y.test(l);if(b||w)return null;if(h&&!/[\s;,.})\]\\]/.test(h))return null;g=!0}return{text:g?s+s:"",selection:[1,1]}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&(s=='"'||s=="'")){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==s)return i.end.column++,i}})};h.isSaneInsertion=function(e,t){var n=e.getCursorPosition(),r=new s(t,n.row,n.column);if(!this.$matchTokenType(r.getCurrentToken()||"text",u)){var i=new s(t,n.row,n.column+1);if(!this.$matchTokenType(i.getCurrentToken()||"text",u))return!1}return r.stepForward(),r.getCurrentTokenRow()!==n.row||this.$matchTokenType(r.getCurrentToken()||"text",a)},h.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},h.recordAutoInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isAutoInsertedClosing(r,i,f.autoInsertedLineEnd[0])||(f.autoInsertedBrackets=0),f.autoInsertedRow=r.row,f.autoInsertedLineEnd=n+i.substr(r.column),f.autoInsertedBrackets++},h.recordMaybeInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isMaybeInsertedClosing(r,i)||(f.maybeInsertedBrackets=0),f.maybeInsertedRow=r.row,f.maybeInsertedLineStart=i.substr(0,r.column)+n,f.maybeInsertedLineEnd=i.substr(r.column),f.maybeInsertedBrackets++},h.isAutoInsertedClosing=function(e,t,n){return f.autoInsertedBrackets>0&&e.row===f.autoInsertedRow&&n===f.autoInsertedLineEnd[0]&&t.substr(e.column)===f.autoInsertedLineEnd},h.isMaybeInsertedClosing=function(e,t){return f.maybeInsertedBrackets>0&&e.row===f.maybeInsertedRow&&t.substr(e.column)===f.maybeInsertedLineEnd&&t.substr(0,e.column)==f.maybeInsertedLineStart},h.popAutoInsertedClosing=function(){f.autoInsertedLineEnd=f.autoInsertedLineEnd.substr(1),f.autoInsertedBrackets--},h.clearMaybeInsertedClosing=function(){f&&(f.maybeInsertedBrackets=0,f.maybeInsertedRow=-1)},r.inherits(h,i),t.CstyleBehaviour=h}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/(\{|\[)[^\}\]]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var i=this._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?"start":i},this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n);if(this.startRegionRe.test(i))return this.getCommentRegionBlock(e,i,n);var s=i.match(this.foldingStartMarker);if(s){var o=s.index;if(s[1])return this.openingBracketBlock(e,s[1],n,o);var u=e.getCommentFoldRange(n,o+s[0].length,1);return u&&!u.isMultiLine()&&(r?u=this.getSectionRange(e,n):t!="all"&&(u=null)),u}if(t==="markbegin")return;var s=i.match(this.foldingStopMarker);if(s){var o=s.index+s[0].length;return s[1]?this.closingBracketBlock(e,s[1],n,o):e.getCommentFoldRange(n,o,-1)}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length;t+=1;var u=t,a=e.getLength();while(++tf)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)},this.getCommentRegionBlock=function(e,t,n){var r=t.search(/\s*$/),s=e.getLength(),o=n,u=/^\s*(?:\/\*|\/\/)#(end)?region\b/,a=1;while(++no)return new i(o,r,l,t.length)}}.call(o.prototype)}),ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./javascript_highlight_rules").JavaScriptHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,u=e("../range").Range,a=e("../worker/worker_client").WorkerClient,f=e("./behaviour/cstyle").CstyleBehaviour,l=e("./folding/cstyle").FoldMode,c=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new f,this.foldingRules=new l};r.inherits(c,i),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e),s=i.tokens,o=i.state;if(s.length&&s[s.length-1].type=="comment")return r;if(e=="start"||e=="no_regex"){var u=t.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);u&&(r+=n)}else if(e=="doc-start"){if(o=="start"||o=="no_regex")return"";var u=t.match(/^\s*(\/?)\*/);u&&(u[1]&&(r+=" "),r+="* ")}return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.createWorker=function(e){var t=new a(["ace"],"ace/mode/javascript_worker","JavaScriptWorker");return t.attachToDocument(e.getDocument()),t.on("jslint",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/javascript"}.call(c.prototype),t.Mode=c}),ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text_highlight_rules").TextHighlightRules,o=t.supportType="animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|pointer-events|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index",u=t.supportFunction="rgb|rgba|url|attr|counter|counters",a=t.supportConstant="absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero",f=t.supportConstantColor="aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow",l=t.supportConstantFonts="arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace",c=t.numRe="\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))",h=t.pseudoElements="(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b",p=t.pseudoClasses="(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b",d=function(){var e=this.createKeywordMapper({"support.function":u,"support.constant":a,"support.type":o,"support.constant.color":f,"support.constant.fonts":l},"text",!0);this.$rules={start:[{token:"comment",regex:"\\/\\*",push:"comment"},{token:"paren.lparen",regex:"\\{",push:"ruleset"},{token:"string",regex:"@.*?{",push:"media"},{token:"keyword",regex:"#[a-z0-9-_]+"},{token:"variable",regex:"\\.[a-z0-9-_]+"},{token:"string",regex:":[a-z0-9-_]+"},{token:"constant",regex:"[a-z0-9-_]+"},{caseInsensitive:!0}],media:[{token:"comment",regex:"\\/\\*",push:"comment"},{token:"paren.lparen",regex:"\\{",push:"ruleset"},{token:"string",regex:"\\}",next:"pop"},{token:"keyword",regex:"#[a-z0-9-_]+"},{token:"variable",regex:"\\.[a-z0-9-_]+"},{token:"string",regex:":[a-z0-9-_]+"},{token:"constant",regex:"[a-z0-9-_]+"},{caseInsensitive:!0}],comment:[{token:"comment",regex:"\\*\\/",next:"pop"},{defaultToken:"comment"}],ruleset:[{token:"paren.rparen",regex:"\\}",next:"pop"},{token:"comment",regex:"\\/\\*",push:"comment"},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:["constant.numeric","keyword"],regex:"("+c+")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)"},{token:"constant.numeric",regex:c},{token:"constant.numeric",regex:"#[a-f0-9]{6}"},{token:"constant.numeric",regex:"#[a-f0-9]{3}"},{token:["punctuation","entity.other.attribute-name.pseudo-element.css"],regex:h},{token:["punctuation","entity.other.attribute-name.pseudo-class.css"],regex:p},{token:["support.function","string","support.function"],regex:"(url\\()(.*)(\\))"},{token:e,regex:"\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"},{caseInsensitive:!0}]},this.normalizeRules()};r.inherits(d,s),t.CssHighlightRules=d}),ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("./cstyle").CstyleBehaviour,o=e("../../token_iterator").TokenIterator,u=function(){this.inherit(s),this.add("colon","insertion",function(e,t,n,r,i){if(i===":"){var s=n.getCursorPosition(),u=new o(r,s.row,s.column),a=u.getCurrentToken();a&&a.value.match(/\s+/)&&(a=u.stepBackward());if(a&&a.type==="support.type"){var f=r.doc.getLine(s.row),l=f.substring(s.column,s.column+1);if(l===":")return{text:"",selection:[1,1]};if(!f.substring(s.column).match(/^\s*;/))return{text:":;",selection:[1,1]}}}}),this.add("colon","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s===":"){var u=n.getCursorPosition(),a=new o(r,u.row,u.column),f=a.getCurrentToken();f&&f.value.match(/\s+/)&&(f=a.stepBackward());if(f&&f.type==="support.type"){var l=r.doc.getLine(i.start.row),c=l.substring(i.end.column,i.end.column+1);if(c===";")return i.end.column++,i}}}),this.add("semicolon","insertion",function(e,t,n,r,i){if(i===";"){var s=n.getCursorPosition(),o=r.doc.getLine(s.row),u=o.substring(s.column,s.column+1);if(u===";")return{text:"",selection:[1,1]}}})};r.inherits(u,s),t.CssBehaviour=u}),ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/css","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./css_highlight_rules").CssHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,u=e("../worker/worker_client").WorkerClient,a=e("./behaviour/css").CssBehaviour,f=e("./folding/cstyle").FoldMode,l=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new a,this.foldingRules=new f};r.inherits(l,i),function(){this.foldingRules="cStyle",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e).tokens;if(i.length&&i[i.length-1].type=="comment")return r;var s=t.match(/^.*\{\s*$/);return s&&(r+=n),r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.createWorker=function(e){var t=new u(["ace"],"ace/mode/css_worker","Worker");return t.attachToDocument(e.getDocument()),t.on("csslint",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/css"}.call(l.prototype),t.Mode=l}),ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(e){this.$rules={start:[{token:"string.cdata.xml",regex:"<\\!\\[CDATA\\[",next:"cdata"},{token:["punctuation.xml-decl.xml","keyword.xml-decl.xml"],regex:"(<\\?)(xml)(?=[\\s])",next:"xml_decl",caseInsensitive:!0},{token:["punctuation.instruction.xml","keyword.instruction.xml"],regex:"(<\\?)([-_a-zA-Z0-9]+)",next:"processing_instruction"},{token:"comment.xml",regex:"<\\!--",next:"comment"},{token:["xml-pe.doctype.xml","xml-pe.doctype.xml"],regex:"(<\\!)(DOCTYPE)(?=[\\s])",next:"doctype",caseInsensitive:!0},{include:"tag"},{token:"text.end-tag-open.xml",regex:"",next:"start"}],processing_instruction:[{token:"punctuation.instruction.xml",regex:"\\?>",next:"start"},{defaultToken:"instruction.xml"}],doctype:[{include:"whitespace"},{include:"string"},{token:"xml-pe.doctype.xml",regex:">",next:"start"},{token:"xml-pe.xml",regex:"[-_a-zA-Z0-9:]+"},{token:"punctuation.int-subset",regex:"\\[",push:"int_subset"}],int_subset:[{token:"text.xml",regex:"\\s+"},{token:"punctuation.int-subset.xml",regex:"]",next:"pop"},{token:["punctuation.markup-decl.xml","keyword.markup-decl.xml"],regex:"(<\\!)([-_a-zA-Z0-9]+)",push:[{token:"text",regex:"\\s+"},{token:"punctuation.markup-decl.xml",regex:">",next:"pop"},{include:"string"}]}],cdata:[{token:"string.cdata.xml",regex:"\\]\\]>",next:"start"},{token:"text.xml",regex:"\\s+"},{token:"text.xml",regex:"(?:[^\\]]|\\](?!\\]>))+"}],comment:[{token:"comment.xml",regex:"-->",next:"start"},{defaultToken:"comment.xml"}],reference:[{token:"constant.language.escape.reference.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}],attr_reference:[{token:"constant.language.escape.reference.attribute-value.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}],tag:[{token:["meta.tag.punctuation.tag-open.xml","meta.tag.punctuation.end-tag-open.xml","meta.tag.tag-name.xml"],regex:"(?:(<)|(",next:"start"}]}],tag_whitespace:[{token:"text.tag-whitespace.xml",regex:"\\s+"}],whitespace:[{token:"text.whitespace.xml",regex:"\\s+"}],string:[{token:"string.xml",regex:"'",push:[{token:"string.xml",regex:"'",next:"pop"},{defaultToken:"string.xml"}]},{token:"string.xml",regex:'"',push:[{token:"string.xml",regex:'"',next:"pop"},{defaultToken:"string.xml"}]}],attributes:[{token:"entity.other.attribute-name.xml",regex:"(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+"},{token:"keyword.operator.attribute-equals.xml",regex:"="},{include:"tag_whitespace"},{include:"attribute_value"}],attribute_value:[{token:"string.attribute-value.xml",regex:"'",push:[{token:"string.attribute-value.xml",regex:"'",next:"pop"},{include:"attr_reference"},{defaultToken:"string.attribute-value.xml"}]},{token:"string.attribute-value.xml",regex:'"',push:[{token:"string.attribute-value.xml",regex:'"',next:"pop"},{include:"attr_reference"},{defaultToken:"string.attribute-value.xml"}]}]},this.constructor===s&&this.normalizeRules()};(function(){this.embedTagRules=function(e,t,n){this.$rules.tag.unshift({token:["meta.tag.punctuation.tag-open.xml","meta.tag."+n+".tag-name.xml"],regex:"(<)("+n+"(?=\\s|>|$))",next:[{include:"attributes"},{token:"meta.tag.punctuation.tag-close.xml",regex:"/?>",next:t+"start"}]}),this.$rules[n+"-end"]=[{include:"attributes"},{token:"meta.tag.punctuation.tag-close.xml",regex:"/?>",next:"start",onMatch:function(e,t,n){return n.splice(0),this.token}}],this.embedRules(e,t,[{token:["meta.tag.punctuation.end-tag-open.xml","meta.tag."+n+".tag-name.xml"],regex:"(|$))",next:n+"-end"},{token:"string.cdata.xml",regex:"<\\!\\[CDATA\\["},{token:"string.cdata.xml",regex:"\\]\\]>"}])}}).call(i.prototype),r.inherits(s,i),t.XmlHighlightRules=s}),ace.define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./css_highlight_rules").CssHighlightRules,o=e("./javascript_highlight_rules").JavaScriptHighlightRules,u=e("./xml_highlight_rules").XmlHighlightRules,a=i.createMap({a:"anchor",button:"form",form:"form",img:"image",input:"form",label:"form",option:"form",script:"script",select:"form",textarea:"form",style:"style",table:"table",tbody:"table",td:"table",tfoot:"table",th:"table",tr:"table"}),f=function(){u.call(this),this.addRules({attributes:[{include:"tag_whitespace"},{token:"entity.other.attribute-name.xml",regex:"[-_a-zA-Z0-9:]+"},{token:"keyword.operator.attribute-equals.xml",regex:"=",push:[{include:"tag_whitespace"},{token:"string.unquoted.attribute-value.html",regex:"[^<>='\"`\\s]+",next:"pop"},{token:"empty",regex:"",next:"pop"}]},{include:"attribute_value"}],tag:[{token:function(e,t){var n=a[t];return["meta.tag.punctuation."+(e=="<"?"":"end-")+"tag-open.xml","meta.tag"+(n?"."+n:"")+".tag-name.xml"]},regex:"(",next:"start"}]}),this.embedTagRules(s,"css-","style"),this.embedTagRules(o,"js-","script"),this.constructor===f&&this.normalizeRules()};r.inherits(f,u),t.HtmlHighlightRules=f}),ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,n){"use strict";function u(e,t){return e.type.lastIndexOf(t+".xml")>-1}var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("../../token_iterator").TokenIterator,o=e("../../lib/lang"),a=function(){this.add("string_dquotes","insertion",function(e,t,n,r,i){if(i=='"'||i=="'"){var o=i,a=r.doc.getTextRange(n.getSelectionRange());if(a!==""&&a!=="'"&&a!='"'&&n.getWrapBehavioursEnabled())return{text:o+a+o,selection:!1};var f=n.getCursorPosition(),l=r.doc.getLine(f.row),c=l.substring(f.column,f.column+1),h=new s(r,f.row,f.column),p=h.getCurrentToken();if(c==o&&(u(p,"attribute-value")||u(p,"string")))return{text:"",selection:[1,1]};p||(p=h.stepBackward());if(!p)return;while(u(p,"tag-whitespace")||u(p,"whitespace"))p=h.stepBackward();var d=!c||c.match(/\s/);if(u(p,"attribute-equals")&&(d||c==">")||u(p,"decl-attribute-equals")&&(d||c=="?"))return{text:o+o,selection:[1,1]}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&(s=='"'||s=="'")){var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==s)return i.end.column++,i}}),this.add("autoclosing","insertion",function(e,t,n,r,i){if(i==">"){var o=n.getCursorPosition(),a=new s(r,o.row,o.column),f=a.getCurrentToken()||a.stepBackward();if(!f||!(u(f,"tag-name")||u(f,"tag-whitespace")||u(f,"attribute-name")||u(f,"attribute-equals")||u(f,"attribute-value")))return;if(u(f,"reference.attribute-value"))return;if(u(f,"attribute-value")){var l=f.value.charAt(0);if(l=='"'||l=="'"){var c=f.value.charAt(f.value.length-1),h=a.getCurrentTokenColumn()+f.value.length;if(h>o.column||h==o.column&&l!=c)return}}while(!u(f,"tag-name"))f=a.stepBackward();var p=a.getCurrentTokenRow(),d=a.getCurrentTokenColumn();if(u(a.stepBackward(),"end-tag-open"))return;var v=f.value;p==o.row&&(v=v.substring(0,o.column-d));if(this.voidElements.hasOwnProperty(v.toLowerCase()))return;return{text:">",selection:[1,1]}}}),this.add("autoindent","insertion",function(e,t,n,r,i){if(i=="\n"){var o=n.getCursorPosition(),u=r.getLine(o.row),a=new s(r,o.row,o.column),f=a.getCurrentToken();if(f&&f.type.indexOf("tag-close")!==-1){while(f&&f.type.indexOf("tag-name")===-1)f=a.stepBackward();if(!f)return;var l=f.value,c=a.getCurrentTokenRow();f=a.stepBackward();if(!f||f.type.indexOf("end-tag")!==-1)return;if(this.voidElements&&!this.voidElements[l]){var h=r.getTokenAt(o.row,o.column+1),u=r.getLine(c),p=this.$getIndent(u),d=p+r.getTabString();return h&&h.value==="-1}var r=e("../../lib/oop"),i=e("../../lib/lang"),s=e("../../range").Range,o=e("./fold_mode").FoldMode,u=e("../../token_iterator").TokenIterator,a=t.FoldMode=function(e,t){o.call(this),this.voidElements=e||{},this.optionalEndTags=r.mixin({},this.voidElements),t&&r.mixin(this.optionalEndTags,t)};r.inherits(a,o);var f=function(){this.tagName="",this.closing=!1,this.selfClosing=!1,this.start={row:0,column:0},this.end={row:0,column:0}};(function(){this.getFoldWidget=function(e,t,n){var r=this._getFirstTagInLine(e,n);return r?r.closing||!r.tagName&&r.selfClosing?t=="markbeginend"?"end":"":!r.tagName||r.selfClosing||this.voidElements.hasOwnProperty(r.tagName.toLowerCase())?"":this._findEndTagInLine(e,n,r.tagName,r.end.column)?"":"start":""},this._getFirstTagInLine=function(e,t){var n=e.getTokens(t),r=new f;for(var i=0;i";break}}return r}if(l(s,"tag-close"))return r.selfClosing=s.value=="/>",r;r.start.column+=s.value.length}return null},this._findEndTagInLine=function(e,t,n,r){var i=e.getTokens(t),s=0;for(var o=0;o",n.end.row=e.getCurrentTokenRow(),n.end.column=e.getCurrentTokenColumn()+t.value.length,e.stepForward(),n;while(t=e.stepForward());return null},this._readTagBackward=function(e){var t=e.getCurrentToken();if(!t)return null;var n=new f;do{if(l(t,"tag-open"))return n.closing=l(t,"end-tag-open"),n.start.row=e.getCurrentTokenRow(),n.start.column=e.getCurrentTokenColumn(),e.stepBackward(),n;l(t,"tag-name")?n.tagName=t.value:l(t,"tag-close")&&(n.selfClosing=t.value=="/>",n.end.row=e.getCurrentTokenRow(),n.end.column=e.getCurrentTokenColumn()+t.value.length)}while(t=e.stepBackward());return null},this._pop=function(e,t){while(e.length){var n=e[e.length-1];if(!t||n.tagName==t.tagName)return e.pop();if(this.optionalEndTags.hasOwnProperty(n.tagName)){e.pop();continue}return null}},this.getFoldWidgetRange=function(e,t,n){var r=this._getFirstTagInLine(e,n);if(!r)return null;var i=r.closing||r.selfClosing,o=[],a;if(!i){var f=new u(e,n,r.start.column),l={row:n,column:r.start.column+r.tagName.length+2};while(a=this._readTagForward(f)){if(a.selfClosing){if(!o.length)return a.start.column+=a.tagName.length+2,a.end.column-=2,s.fromPoints(a.start,a.end);continue}if(a.closing){this._pop(o,a);if(o.length==0)return s.fromPoints(l,a.start)}else o.push(a)}}else{var f=new u(e,n,r.end.column),c={row:n,column:r.start.column};while(a=this._readTagBackward(f)){if(a.selfClosing){if(!o.length)return a.start.column+=a.tagName.length+2,a.end.column-=2,s.fromPoints(a.start,a.end);continue}if(!a.closing){this._pop(o,a);if(o.length==0)return a.start.column+=a.tagName.length+2,s.fromPoints(a.start,c)}else o.push(a)}}}}).call(a.prototype)}),ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("./mixed").FoldMode,s=e("./xml").FoldMode,o=e("./cstyle").FoldMode,u=t.FoldMode=function(e,t){i.call(this,new s(e,t),{"js-":new o,"css-":new o})};r.inherits(u,i)}),ace.define("ace/mode/html_completions",["require","exports","module","ace/token_iterator"],function(e,t,n){"use strict";function f(e,t){return e.type.lastIndexOf(t+".xml")>-1}function l(e,t){var n=new r(e,t.row,t.column),i=n.getCurrentToken();while(i&&!f(i,"tag-name"))i=n.stepBackward();if(i)return i.value}var r=e("../token_iterator").TokenIterator,i=["accesskey","class","contenteditable","contextmenu","dir","draggable","dropzone","hidden","id","inert","itemid","itemprop","itemref","itemscope","itemtype","lang","spellcheck","style","tabindex","title","translate"],s=["onabort","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncontextmenu","oncuechange","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onmousedown","onmousemove","onmouseout","onmouseover","onmouseup","onmousewheel","onpause","onplay","onplaying","onprogress","onratechange","onreset","onscroll","onseeked","onseeking","onselect","onshow","onstalled","onsubmit","onsuspend","ontimeupdate","onvolumechange","onwaiting"],o=i.concat(s),u={html:["manifest"],head:[],title:[],base:["href","target"],link:["href","hreflang","rel","media","type","sizes"],meta:["http-equiv","name","content","charset"],style:["type","media","scoped"],script:["charset","type","src","defer","async"],noscript:["href"],body:["onafterprint","onbeforeprint","onbeforeunload","onhashchange","onmessage","onoffline","onpopstate","onredo","onresize","onstorage","onundo","onunload"],section:[],nav:[],article:["pubdate"],aside:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],footer:[],address:[],main:[],p:[],hr:[],pre:[],blockquote:["cite"],ol:["start","reversed"],ul:[],li:["value"],dl:[],dt:[],dd:[],figure:[],figcaption:[],div:[],a:["href","target","ping","rel","media","hreflang","type"],em:[],strong:[],small:[],s:[],cite:[],q:["cite"],dfn:[],abbr:[],data:[],time:["datetime"],code:[],"var":[],samp:[],kbd:[],sub:[],sup:[],i:[],b:[],u:[],mark:[],ruby:[],rt:[],rp:[],bdi:[],bdo:[],span:[],br:[],wbr:[],ins:["cite","datetime"],del:["cite","datetime"],img:["alt","src","height","width","usemap","ismap"],iframe:["name","src","height","width","sandbox","seamless"],embed:["src","height","width","type"],object:["param","data","type","height","width","usemap","name","form","classid"],param:["name","value"],video:["src","autobuffer","autoplay","loop","controls","width","height","poster"],audio:["src","autobuffer","autoplay","loop","controls"],source:["src","type","media"],track:["kind","src","srclang","label","default"],canvas:["width","height"],map:["name"],area:["shape","coords","href","hreflang","alt","target","media","rel","ping","type"],svg:[],math:[],table:["summary"],caption:[],colgroup:["span"],col:["span"],tbody:[],thead:[],tfoot:[],tr:[],td:["headers","rowspan","colspan"],th:["headers","rowspan","colspan","scope"],form:["accept-charset","action","autocomplete","enctype","method","name","novalidate","target"],fieldset:["disabled","form","name"],legend:[],label:["form","for"],input:["type","accept","alt","autocomplete","checked","disabled","form","formaction","formenctype","formmethod","formnovalidate","formtarget","height","list","max","maxlength","min","multiple","pattern","placeholder","readonly","required","size","src","step","width","files","value"],button:["autofocus","disabled","form","formaction","formenctype","formmethod","formnovalidate","formtarget","name","value","type"],select:["autofocus","disabled","form","multiple","name","size"],datalist:[],optgroup:["disabled","label"],option:["disabled","selected","label","value"],textarea:["autofocus","disabled","form","maxlength","name","placeholder","readonly","required","rows","cols","wrap"],keygen:["autofocus","challenge","disabled","form","keytype","name"],output:["for","form","name"],progress:["value","max"],meter:["value","min","max","low","high","optimum"],details:["open"],summary:[],command:["type","label","icon","disabled","checked","radiogroup","command"],menu:["type","label"],dialog:["open"]},a=Object.keys(u),c=function(){};(function(){this.getCompletions=function(e,t,n,r){var i=t.getTokenAt(n.row,n.column);return i?f(i,"tag-name")||f(i,"tag-open")||f(i,"end-tag-open")?this.getTagCompletions(e,t,n,r):f(i,"tag-whitespace")||f(i,"attribute-name")?this.getAttributeCompetions(e,t,n,r):[]:[]},this.getTagCompletions=function(e,t,n,r){return a.map(function(e){return{value:e,meta:"tag",score:Number.MAX_VALUE}})},this.getAttributeCompetions=function(e,t,n,r){var i=l(t,n);if(!i)return[];var s=o;return i in u&&(s=s.concat(u[i])),s.map(function(e){return{caption:e,snippet:e+'="$0"',meta:"attribute",score:Number.MAX_VALUE}})}}).call(c.prototype),t.HtmlCompletions=c}),ace.define("ace/mode/html",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/javascript","ace/mode/css","ace/mode/html_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/html","ace/mode/html_completions","ace/worker/worker_client"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text").Mode,o=e("./javascript").Mode,u=e("./css").Mode,a=e("./html_highlight_rules").HtmlHighlightRules,f=e("./behaviour/xml").XmlBehaviour,l=e("./folding/html").FoldMode,c=e("./html_completions").HtmlCompletions,h=e("../worker/worker_client").WorkerClient,p=["area","base","br","col","embed","hr","img","input","keygen","link","meta","menuitem","param","source","track","wbr"],d=["li","dt","dd","p","rt","rp","optgroup","option","colgroup","td","th"],v=function(e){this.fragmentContext=e&&e.fragmentContext,this.HighlightRules=a,this.$behaviour=new f,this.$completer=new c,this.createModeDelegates({"js-":o,"css-":u}),this.foldingRules=new l(this.voidElements,i.arrayToMap(d))};r.inherits(v,s),function(){this.blockComment={start:""},this.voidElements=i.arrayToMap(p),this.getNextLineIndent=function(e,t,n){return this.$getIndent(t)},this.checkOutdent=function(e,t,n){return!1},this.getCompletions=function(e,t,n,r){return this.$completer.getCompletions(e,t,n,r)},this.createWorker=function(e){if(this.constructor!=v)return;var t=new h(["ace"],"ace/mode/html_worker","Worker");return t.attachToDocument(e.getDocument()),this.fragmentContext&&t.call("setOptions",[{context:this.fragmentContext}]),t.on("error",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/html"}.call(v.prototype),t.Mode=v}) \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/mode-javascript.js b/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/mode-javascript.js new file mode 100644 index 000000000..4696564ed --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/mode-javascript.js @@ -0,0 +1 @@ +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},s.getTagRule(),{defaultToken:"comment.doc",caseInsensitive:!0}]}};r.inherits(s,i),s.getTagRule=function(e){return{token:"comment.doc.tag.storage.type",regex:"\\b(?:TODO|FIXME|XXX|HACK)\\b"}},s.getStartRule=function(e){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:e}},s.getEndRule=function(e){return{token:"comment.doc",regex:"\\*\\/",next:e}},t.DocCommentHighlightRules=s}),ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./doc_comment_highlight_rules").DocCommentHighlightRules,s=e("./text_highlight_rules").TextHighlightRules,o=function(e){var t=this.createKeywordMapper({"variable.language":"Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Namespace|QName|XML|XMLList|ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|SyntaxError|TypeError|URIError|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt|JSON|Math|this|arguments|prototype|window|document",keyword:"const|yield|import|get|set|break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|__parent__|__count__|escape|unescape|with|__proto__|class|enum|extends|super|export|implements|private|public|interface|package|protected|static","storage.type":"const|let|var|function","constant.language":"null|Infinity|NaN|undefined","support.function":"alert","constant.language.boolean":"true|false"},"identifier"),n="case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void",r="[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b",s="\\\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)";this.$rules={no_regex:[{token:"comment",regex:"\\/\\/",next:"line_comment"},i.getStartRule("doc-start"),{token:"comment",regex:/\/\*/,next:"comment"},{token:"string",regex:"'(?=.)",next:"qstring"},{token:"string",regex:'"(?=.)',next:"qqstring"},{token:"constant.numeric",regex:/0[xX][0-9a-fA-F]+\b/},{token:"constant.numeric",regex:/[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/},{token:["storage.type","punctuation.operator","support.function","punctuation.operator","entity.name.function","text","keyword.operator"],regex:"("+r+")(\\.)(prototype)(\\.)("+r+")(\\s*)(=)",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+r+")(\\.)("+r+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+r+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","entity.name.function","text","paren.lparen"],regex:"("+r+")(\\.)("+r+")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","text","entity.name.function","text","paren.lparen"],regex:"(function)(\\s+)("+r+")(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","punctuation.operator","text","storage.type","text","paren.lparen"],regex:"("+r+")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["text","text","storage.type","text","paren.lparen"],regex:"(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:"keyword",regex:"(?:"+n+")\\b",next:"start"},{token:["punctuation.operator","support.function"],regex:/(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/},{token:["punctuation.operator","support.function.dom"],regex:/(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/},{token:["punctuation.operator","support.constant"],regex:/(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/},{token:["support.constant"],regex:/that\b/},{token:["storage.type","punctuation.operator","support.function.firebug"],regex:/(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/},{token:t,regex:r},{token:"keyword.operator",regex:/--|\+\+|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|[!$%&*+\-~\/^]=?/,next:"start"},{token:"punctuation.operator",regex:/[?:,;.]/,next:"start"},{token:"paren.lparen",regex:/[\[({]/,next:"start"},{token:"paren.rparen",regex:/[\])}]/},{token:"comment",regex:/^#!.*$/}],start:[i.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment_regex_allowed"},{token:"comment",regex:"\\/\\/",next:"line_comment_regex_allowed"},{token:"string.regexp",regex:"\\/",next:"regex"},{token:"text",regex:"\\s+|^$",next:"start"},{token:"empty",regex:"",next:"no_regex"}],regex:[{token:"regexp.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"string.regexp",regex:"/[sxngimy]*",next:"no_regex"},{token:"invalid",regex:/\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/},{token:"constant.language.escape",regex:/\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/},{token:"constant.language.delimiter",regex:/\|/},{token:"constant.language.escape",regex:/\[\^?/,next:"regex_character_class"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp"}],regex_character_class:[{token:"regexp.charclass.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"constant.language.escape",regex:"]",next:"regex"},{token:"constant.language.escape",regex:"-"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp.charachterclass"}],function_arguments:[{token:"variable.parameter",regex:r},{token:"punctuation.operator",regex:"[, ]+"},{token:"punctuation.operator",regex:"$"},{token:"empty",regex:"",next:"no_regex"}],comment_regex_allowed:[i.getTagRule(),{token:"comment",regex:"\\*\\/",next:"start"},{defaultToken:"comment",caseInsensitive:!0}],comment:[i.getTagRule(),{token:"comment",regex:"\\*\\/",next:"no_regex"},{defaultToken:"comment",caseInsensitive:!0}],line_comment_regex_allowed:[i.getTagRule(),{token:"comment",regex:"$|^",next:"start"},{defaultToken:"comment",caseInsensitive:!0}],line_comment:[i.getTagRule(),{token:"comment",regex:"$|^",next:"no_regex"},{defaultToken:"comment",caseInsensitive:!0}],qqstring:[{token:"constant.language.escape",regex:s},{token:"string",regex:"\\\\$",next:"qqstring"},{token:"string",regex:'"|$',next:"no_regex"},{defaultToken:"string"}],qstring:[{token:"constant.language.escape",regex:s},{token:"string",regex:"\\\\$",next:"qstring"},{token:"string",regex:"'|$",next:"no_regex"},{defaultToken:"string"}]},(!e||!e.noES6)&&this.$rules.no_regex.unshift({regex:"[{}]",onMatch:function(e,t,n){this.next=e=="{"?this.nextState:"";if(e=="{"&&n.length)return n.unshift("start",t),"paren";if(e=="}"&&n.length){n.shift(),this.next=n.shift();if(this.next.indexOf("string")!=-1)return"paren.quasi.end"}return e=="{"?"paren.lparen":"paren.rparen"},nextState:"start"},{token:"string.quasi.start",regex:/`/,push:[{token:"constant.language.escape",regex:s},{token:"paren.quasi.start",regex:/\${/,push:"start"},{token:"string.quasi.end",regex:/`/,next:"pop"},{defaultToken:"string.quasi"}]}),this.embedRules(i,"doc-",[i.getEndRule("no_regex")]),this.normalizeRules()};r.inherits(o,s),t.JavaScriptHighlightRules=o}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("../../token_iterator").TokenIterator,o=e("../../lib/lang"),u=["text","paren.rparen","punctuation.operator"],a=["text","paren.rparen","punctuation.operator","comment"],f,l={},c=function(e){var t=-1;e.multiSelect&&(t=e.selection.index,l.rangeCount!=e.multiSelect.rangeCount&&(l={rangeCount:e.multiSelect.rangeCount}));if(l[t])return f=l[t];f=l[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},h=function(){this.add("braces","insertion",function(e,t,n,r,i){var s=n.getCursorPosition(),u=r.doc.getLine(s.row);if(i=="{"){c(n);var a=n.getSelectionRange(),l=r.doc.getTextRange(a);if(l!==""&&l!=="{"&&n.getWrapBehavioursEnabled())return{text:"{"+l+"}",selection:!1};if(h.isSaneInsertion(n,r))return/[\]\}\)]/.test(u[s.column])||n.inMultiSelectMode?(h.recordAutoInsert(n,r,"}"),{text:"{}",selection:[1,1]}):(h.recordMaybeInsert(n,r,"{"),{text:"{",selection:[1,1]})}else if(i=="}"){c(n);var p=u.substring(s.column,s.column+1);if(p=="}"){var d=r.$findOpeningBracket("}",{column:s.column+1,row:s.row});if(d!==null&&h.isAutoInsertedClosing(s,u,i))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else{if(i=="\n"||i=="\r\n"){c(n);var v="";h.isMaybeInsertedClosing(s,u)&&(v=o.stringRepeat("}",f.maybeInsertedBrackets),h.clearMaybeInsertedClosing());var p=u.substring(s.column,s.column+1);if(p==="}"){var m=r.findMatchingBracket({row:s.row,column:s.column+1},"}");if(!m)return null;var g=this.$getIndent(r.getLine(m.row))}else{if(!v){h.clearMaybeInsertedClosing();return}var g=this.$getIndent(u)}var y=g+r.getTabString();return{text:"\n"+y+"\n"+g+v,selection:[1,y.length,1,y.length]}}h.clearMaybeInsertedClosing()}}),this.add("braces","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="{"){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.end.column,i.end.column+1);if(u=="}")return i.end.column++,i;f.maybeInsertedBrackets--}}),this.add("parens","insertion",function(e,t,n,r,i){if(i=="("){c(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapBehavioursEnabled())return{text:"("+o+")",selection:!1};if(h.isSaneInsertion(n,r))return h.recordAutoInsert(n,r,")"),{text:"()",selection:[1,1]}}else if(i==")"){c(n);var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(f==")"){var l=r.$findOpeningBracket(")",{column:u.column+1,row:u.row});if(l!==null&&h.isAutoInsertedClosing(u,a,i))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="("){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==")")return i.end.column++,i}}),this.add("brackets","insertion",function(e,t,n,r,i){if(i=="["){c(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapBehavioursEnabled())return{text:"["+o+"]",selection:!1};if(h.isSaneInsertion(n,r))return h.recordAutoInsert(n,r,"]"),{text:"[]",selection:[1,1]}}else if(i=="]"){c(n);var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(f=="]"){var l=r.$findOpeningBracket("]",{column:u.column+1,row:u.row});if(l!==null&&h.isAutoInsertedClosing(u,a,i))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="["){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u=="]")return i.end.column++,i}}),this.add("string_dquotes","insertion",function(e,t,n,r,i){if(i=='"'||i=="'"){c(n);var s=i,o=n.getSelectionRange(),u=r.doc.getTextRange(o);if(u!==""&&u!=="'"&&u!='"'&&n.getWrapBehavioursEnabled())return{text:s+u+s,selection:!1};var a=n.getCursorPosition(),f=r.doc.getLine(a.row),l=f.substring(a.column-1,a.column),h=f.substring(a.column,a.column+1),p=r.getTokenAt(a.row,a.column),d=r.getTokenAt(a.row,a.column+1);if(l=="\\"&&p&&/escape/.test(p.type))return null;var v=p&&/string/.test(p.type),m=!d||/string/.test(d.type),g;if(h==s)g=v!==m;else{if(v&&!m)return null;if(v&&m)return null;var y=r.$mode.tokenRe;y.lastIndex=0;var b=y.test(l);y.lastIndex=0;var w=y.test(l);if(b||w)return null;if(h&&!/[\s;,.})\]\\]/.test(h))return null;g=!0}return{text:g?s+s:"",selection:[1,1]}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&(s=='"'||s=="'")){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==s)return i.end.column++,i}})};h.isSaneInsertion=function(e,t){var n=e.getCursorPosition(),r=new s(t,n.row,n.column);if(!this.$matchTokenType(r.getCurrentToken()||"text",u)){var i=new s(t,n.row,n.column+1);if(!this.$matchTokenType(i.getCurrentToken()||"text",u))return!1}return r.stepForward(),r.getCurrentTokenRow()!==n.row||this.$matchTokenType(r.getCurrentToken()||"text",a)},h.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},h.recordAutoInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isAutoInsertedClosing(r,i,f.autoInsertedLineEnd[0])||(f.autoInsertedBrackets=0),f.autoInsertedRow=r.row,f.autoInsertedLineEnd=n+i.substr(r.column),f.autoInsertedBrackets++},h.recordMaybeInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isMaybeInsertedClosing(r,i)||(f.maybeInsertedBrackets=0),f.maybeInsertedRow=r.row,f.maybeInsertedLineStart=i.substr(0,r.column)+n,f.maybeInsertedLineEnd=i.substr(r.column),f.maybeInsertedBrackets++},h.isAutoInsertedClosing=function(e,t,n){return f.autoInsertedBrackets>0&&e.row===f.autoInsertedRow&&n===f.autoInsertedLineEnd[0]&&t.substr(e.column)===f.autoInsertedLineEnd},h.isMaybeInsertedClosing=function(e,t){return f.maybeInsertedBrackets>0&&e.row===f.maybeInsertedRow&&t.substr(e.column)===f.maybeInsertedLineEnd&&t.substr(0,e.column)==f.maybeInsertedLineStart},h.popAutoInsertedClosing=function(){f.autoInsertedLineEnd=f.autoInsertedLineEnd.substr(1),f.autoInsertedBrackets--},h.clearMaybeInsertedClosing=function(){f&&(f.maybeInsertedBrackets=0,f.maybeInsertedRow=-1)},r.inherits(h,i),t.CstyleBehaviour=h}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/(\{|\[)[^\}\]]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var i=this._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?"start":i},this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n);if(this.startRegionRe.test(i))return this.getCommentRegionBlock(e,i,n);var s=i.match(this.foldingStartMarker);if(s){var o=s.index;if(s[1])return this.openingBracketBlock(e,s[1],n,o);var u=e.getCommentFoldRange(n,o+s[0].length,1);return u&&!u.isMultiLine()&&(r?u=this.getSectionRange(e,n):t!="all"&&(u=null)),u}if(t==="markbegin")return;var s=i.match(this.foldingStopMarker);if(s){var o=s.index+s[0].length;return s[1]?this.closingBracketBlock(e,s[1],n,o):e.getCommentFoldRange(n,o,-1)}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length;t+=1;var u=t,a=e.getLength();while(++tf)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)},this.getCommentRegionBlock=function(e,t,n){var r=t.search(/\s*$/),s=e.getLength(),o=n,u=/^\s*(?:\/\*|\/\/)#(end)?region\b/,a=1;while(++no)return new i(o,r,l,t.length)}}.call(o.prototype)}),ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./javascript_highlight_rules").JavaScriptHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,u=e("../range").Range,a=e("../worker/worker_client").WorkerClient,f=e("./behaviour/cstyle").CstyleBehaviour,l=e("./folding/cstyle").FoldMode,c=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new f,this.foldingRules=new l};r.inherits(c,i),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e),s=i.tokens,o=i.state;if(s.length&&s[s.length-1].type=="comment")return r;if(e=="start"||e=="no_regex"){var u=t.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);u&&(r+=n)}else if(e=="doc-start"){if(o=="start"||o=="no_regex")return"";var u=t.match(/^\s*(\/?)\*/);u&&(u[1]&&(r+=" "),r+="* ")}return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.createWorker=function(e){var t=new a(["ace"],"ace/mode/javascript_worker","JavaScriptWorker");return t.attachToDocument(e.getDocument()),t.on("jslint",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/javascript"}.call(c.prototype),t.Mode=c}) \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/mode-json.js b/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/mode-json.js new file mode 100644 index 000000000..e9e8e9390 --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/mode-json.js @@ -0,0 +1 @@ +ace.define("ace/mode/json_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"variable",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)'},{token:"string",regex:'"',next:"string"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:"invalid.illegal",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"invalid.illegal",regex:"\\/\\/.*$"},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],string:[{token:"constant.language.escape",regex:/\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnrt])/},{token:"string",regex:'[^"\\\\]+'},{token:"string",regex:'"',next:"start"},{token:"string",regex:"",next:"start"}]}};r.inherits(s,i),t.JsonHighlightRules=s}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("../../token_iterator").TokenIterator,o=e("../../lib/lang"),u=["text","paren.rparen","punctuation.operator"],a=["text","paren.rparen","punctuation.operator","comment"],f,l={},c=function(e){var t=-1;e.multiSelect&&(t=e.selection.index,l.rangeCount!=e.multiSelect.rangeCount&&(l={rangeCount:e.multiSelect.rangeCount}));if(l[t])return f=l[t];f=l[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},h=function(){this.add("braces","insertion",function(e,t,n,r,i){var s=n.getCursorPosition(),u=r.doc.getLine(s.row);if(i=="{"){c(n);var a=n.getSelectionRange(),l=r.doc.getTextRange(a);if(l!==""&&l!=="{"&&n.getWrapBehavioursEnabled())return{text:"{"+l+"}",selection:!1};if(h.isSaneInsertion(n,r))return/[\]\}\)]/.test(u[s.column])||n.inMultiSelectMode?(h.recordAutoInsert(n,r,"}"),{text:"{}",selection:[1,1]}):(h.recordMaybeInsert(n,r,"{"),{text:"{",selection:[1,1]})}else if(i=="}"){c(n);var p=u.substring(s.column,s.column+1);if(p=="}"){var d=r.$findOpeningBracket("}",{column:s.column+1,row:s.row});if(d!==null&&h.isAutoInsertedClosing(s,u,i))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else{if(i=="\n"||i=="\r\n"){c(n);var v="";h.isMaybeInsertedClosing(s,u)&&(v=o.stringRepeat("}",f.maybeInsertedBrackets),h.clearMaybeInsertedClosing());var p=u.substring(s.column,s.column+1);if(p==="}"){var m=r.findMatchingBracket({row:s.row,column:s.column+1},"}");if(!m)return null;var g=this.$getIndent(r.getLine(m.row))}else{if(!v){h.clearMaybeInsertedClosing();return}var g=this.$getIndent(u)}var y=g+r.getTabString();return{text:"\n"+y+"\n"+g+v,selection:[1,y.length,1,y.length]}}h.clearMaybeInsertedClosing()}}),this.add("braces","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="{"){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.end.column,i.end.column+1);if(u=="}")return i.end.column++,i;f.maybeInsertedBrackets--}}),this.add("parens","insertion",function(e,t,n,r,i){if(i=="("){c(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapBehavioursEnabled())return{text:"("+o+")",selection:!1};if(h.isSaneInsertion(n,r))return h.recordAutoInsert(n,r,")"),{text:"()",selection:[1,1]}}else if(i==")"){c(n);var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(f==")"){var l=r.$findOpeningBracket(")",{column:u.column+1,row:u.row});if(l!==null&&h.isAutoInsertedClosing(u,a,i))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="("){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==")")return i.end.column++,i}}),this.add("brackets","insertion",function(e,t,n,r,i){if(i=="["){c(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapBehavioursEnabled())return{text:"["+o+"]",selection:!1};if(h.isSaneInsertion(n,r))return h.recordAutoInsert(n,r,"]"),{text:"[]",selection:[1,1]}}else if(i=="]"){c(n);var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(f=="]"){var l=r.$findOpeningBracket("]",{column:u.column+1,row:u.row});if(l!==null&&h.isAutoInsertedClosing(u,a,i))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="["){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u=="]")return i.end.column++,i}}),this.add("string_dquotes","insertion",function(e,t,n,r,i){if(i=='"'||i=="'"){c(n);var s=i,o=n.getSelectionRange(),u=r.doc.getTextRange(o);if(u!==""&&u!=="'"&&u!='"'&&n.getWrapBehavioursEnabled())return{text:s+u+s,selection:!1};var a=n.getCursorPosition(),f=r.doc.getLine(a.row),l=f.substring(a.column-1,a.column),h=f.substring(a.column,a.column+1),p=r.getTokenAt(a.row,a.column),d=r.getTokenAt(a.row,a.column+1);if(l=="\\"&&p&&/escape/.test(p.type))return null;var v=p&&/string/.test(p.type),m=!d||/string/.test(d.type),g;if(h==s)g=v!==m;else{if(v&&!m)return null;if(v&&m)return null;var y=r.$mode.tokenRe;y.lastIndex=0;var b=y.test(l);y.lastIndex=0;var w=y.test(l);if(b||w)return null;if(h&&!/[\s;,.})\]\\]/.test(h))return null;g=!0}return{text:g?s+s:"",selection:[1,1]}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&(s=='"'||s=="'")){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==s)return i.end.column++,i}})};h.isSaneInsertion=function(e,t){var n=e.getCursorPosition(),r=new s(t,n.row,n.column);if(!this.$matchTokenType(r.getCurrentToken()||"text",u)){var i=new s(t,n.row,n.column+1);if(!this.$matchTokenType(i.getCurrentToken()||"text",u))return!1}return r.stepForward(),r.getCurrentTokenRow()!==n.row||this.$matchTokenType(r.getCurrentToken()||"text",a)},h.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},h.recordAutoInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isAutoInsertedClosing(r,i,f.autoInsertedLineEnd[0])||(f.autoInsertedBrackets=0),f.autoInsertedRow=r.row,f.autoInsertedLineEnd=n+i.substr(r.column),f.autoInsertedBrackets++},h.recordMaybeInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isMaybeInsertedClosing(r,i)||(f.maybeInsertedBrackets=0),f.maybeInsertedRow=r.row,f.maybeInsertedLineStart=i.substr(0,r.column)+n,f.maybeInsertedLineEnd=i.substr(r.column),f.maybeInsertedBrackets++},h.isAutoInsertedClosing=function(e,t,n){return f.autoInsertedBrackets>0&&e.row===f.autoInsertedRow&&n===f.autoInsertedLineEnd[0]&&t.substr(e.column)===f.autoInsertedLineEnd},h.isMaybeInsertedClosing=function(e,t){return f.maybeInsertedBrackets>0&&e.row===f.maybeInsertedRow&&t.substr(e.column)===f.maybeInsertedLineEnd&&t.substr(0,e.column)==f.maybeInsertedLineStart},h.popAutoInsertedClosing=function(){f.autoInsertedLineEnd=f.autoInsertedLineEnd.substr(1),f.autoInsertedBrackets--},h.clearMaybeInsertedClosing=function(){f&&(f.maybeInsertedBrackets=0,f.maybeInsertedRow=-1)},r.inherits(h,i),t.CstyleBehaviour=h}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/(\{|\[)[^\}\]]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var i=this._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?"start":i},this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n);if(this.startRegionRe.test(i))return this.getCommentRegionBlock(e,i,n);var s=i.match(this.foldingStartMarker);if(s){var o=s.index;if(s[1])return this.openingBracketBlock(e,s[1],n,o);var u=e.getCommentFoldRange(n,o+s[0].length,1);return u&&!u.isMultiLine()&&(r?u=this.getSectionRange(e,n):t!="all"&&(u=null)),u}if(t==="markbegin")return;var s=i.match(this.foldingStopMarker);if(s){var o=s.index+s[0].length;return s[1]?this.closingBracketBlock(e,s[1],n,o):e.getCommentFoldRange(n,o,-1)}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length;t+=1;var u=t,a=e.getLength();while(++tf)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)},this.getCommentRegionBlock=function(e,t,n){var r=t.search(/\s*$/),s=e.getLength(),o=n,u=/^\s*(?:\/\*|\/\/)#(end)?region\b/,a=1;while(++no)return new i(o,r,l,t.length)}}.call(o.prototype)}),ace.define("ace/mode/json",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/json_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle","ace/worker/worker_client"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./json_highlight_rules").JsonHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,u=e("./behaviour/cstyle").CstyleBehaviour,a=e("./folding/cstyle").FoldMode,f=e("../worker/worker_client").WorkerClient,l=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new u,this.foldingRules=new a};r.inherits(l,i),function(){this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t);if(e=="start"){var i=t.match(/^.*[\{\(\[]\s*$/);i&&(r+=n)}return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.createWorker=function(e){var t=new f(["ace"],"ace/mode/json_worker","JsonWorker");return t.attachToDocument(e.getDocument()),t.on("error",function(t){e.setAnnotations([t.data])}),t.on("ok",function(){e.clearAnnotations()}),t},this.$id="ace/mode/json"}.call(l.prototype),t.Mode=l}) \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/mode-less.js b/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/mode-less.js new file mode 100644 index 000000000..c92ac8d5b --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/mode-less.js @@ -0,0 +1 @@ +ace.define("ace/mode/less_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text_highlight_rules").TextHighlightRules,o=function(){var e=i.arrayToMap(function(){var e="-webkit-|-moz-|-o-|-ms-|-svg-|-pie-|-khtml-".split("|"),t="appearance|background-clip|background-inline-policy|background-origin|background-size|binding|border-bottom-colors|border-left-colors|border-right-colors|border-top-colors|border-end|border-end-color|border-end-style|border-end-width|border-image|border-start|border-start-color|border-start-style|border-start-width|box-align|box-direction|box-flex|box-flexgroup|box-ordinal-group|box-orient|box-pack|box-sizing|column-count|column-gap|column-width|column-rule|column-rule-width|column-rule-style|column-rule-color|float-edge|font-feature-settings|font-language-override|force-broken-image-icon|image-region|margin-end|margin-start|opacity|outline|outline-color|outline-offset|outline-radius|outline-radius-bottomleft|outline-radius-bottomright|outline-radius-topleft|outline-radius-topright|outline-style|outline-width|padding-end|padding-start|stack-sizing|tab-size|text-blink|text-decoration-color|text-decoration-line|text-decoration-style|transform|transform-origin|transition|transition-delay|transition-duration|transition-property|transition-timing-function|user-focus|user-input|user-modify|user-select|window-shadow|border-radius".split("|"),n="azimuth|background-attachment|background-color|background-image|background-position|background-repeat|background|border-bottom-color|border-bottom-style|border-bottom-width|border-bottom|border-collapse|border-color|border-left-color|border-left-style|border-left-width|border-left|border-right-color|border-right-style|border-right-width|border-right|border-spacing|border-style|border-top-color|border-top-style|border-top-width|border-top|border-width|border|bottom|box-sizing|caption-side|clear|clip|color|content|counter-increment|counter-reset|cue-after|cue-before|cue|cursor|direction|display|elevation|empty-cells|float|font-family|font-size-adjust|font-size|font-stretch|font-style|font-variant|font-weight|font|height|left|letter-spacing|line-height|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|marker-offset|margin|marks|max-height|max-width|min-height|min-width|opacity|orphans|outline-color|outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page|pause-after|pause-before|pause|pitch-range|pitch|play-during|position|quotes|richness|right|size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|stress|table-layout|text-align|text-decoration|text-indent|text-shadow|text-transform|top|unicode-bidi|vertical-align|visibility|voice-family|volume|white-space|widows|width|word-spacing|z-index".split("|"),r=[];for(var i=0,s=e.length;i|<=|>=|==|!=|-|%|#|\\+|\\$|\\+|\\*"},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"},{caseInsensitive:!0}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",regex:".+"}]}};r.inherits(o,s),t.LessHighlightRules=o}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("../../token_iterator").TokenIterator,o=e("../../lib/lang"),u=["text","paren.rparen","punctuation.operator"],a=["text","paren.rparen","punctuation.operator","comment"],f,l={},c=function(e){var t=-1;e.multiSelect&&(t=e.selection.index,l.rangeCount!=e.multiSelect.rangeCount&&(l={rangeCount:e.multiSelect.rangeCount}));if(l[t])return f=l[t];f=l[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},h=function(){this.add("braces","insertion",function(e,t,n,r,i){var s=n.getCursorPosition(),u=r.doc.getLine(s.row);if(i=="{"){c(n);var a=n.getSelectionRange(),l=r.doc.getTextRange(a);if(l!==""&&l!=="{"&&n.getWrapBehavioursEnabled())return{text:"{"+l+"}",selection:!1};if(h.isSaneInsertion(n,r))return/[\]\}\)]/.test(u[s.column])||n.inMultiSelectMode?(h.recordAutoInsert(n,r,"}"),{text:"{}",selection:[1,1]}):(h.recordMaybeInsert(n,r,"{"),{text:"{",selection:[1,1]})}else if(i=="}"){c(n);var p=u.substring(s.column,s.column+1);if(p=="}"){var d=r.$findOpeningBracket("}",{column:s.column+1,row:s.row});if(d!==null&&h.isAutoInsertedClosing(s,u,i))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else{if(i=="\n"||i=="\r\n"){c(n);var v="";h.isMaybeInsertedClosing(s,u)&&(v=o.stringRepeat("}",f.maybeInsertedBrackets),h.clearMaybeInsertedClosing());var p=u.substring(s.column,s.column+1);if(p==="}"){var m=r.findMatchingBracket({row:s.row,column:s.column+1},"}");if(!m)return null;var g=this.$getIndent(r.getLine(m.row))}else{if(!v){h.clearMaybeInsertedClosing();return}var g=this.$getIndent(u)}var y=g+r.getTabString();return{text:"\n"+y+"\n"+g+v,selection:[1,y.length,1,y.length]}}h.clearMaybeInsertedClosing()}}),this.add("braces","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="{"){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.end.column,i.end.column+1);if(u=="}")return i.end.column++,i;f.maybeInsertedBrackets--}}),this.add("parens","insertion",function(e,t,n,r,i){if(i=="("){c(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapBehavioursEnabled())return{text:"("+o+")",selection:!1};if(h.isSaneInsertion(n,r))return h.recordAutoInsert(n,r,")"),{text:"()",selection:[1,1]}}else if(i==")"){c(n);var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(f==")"){var l=r.$findOpeningBracket(")",{column:u.column+1,row:u.row});if(l!==null&&h.isAutoInsertedClosing(u,a,i))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="("){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==")")return i.end.column++,i}}),this.add("brackets","insertion",function(e,t,n,r,i){if(i=="["){c(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapBehavioursEnabled())return{text:"["+o+"]",selection:!1};if(h.isSaneInsertion(n,r))return h.recordAutoInsert(n,r,"]"),{text:"[]",selection:[1,1]}}else if(i=="]"){c(n);var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(f=="]"){var l=r.$findOpeningBracket("]",{column:u.column+1,row:u.row});if(l!==null&&h.isAutoInsertedClosing(u,a,i))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="["){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u=="]")return i.end.column++,i}}),this.add("string_dquotes","insertion",function(e,t,n,r,i){if(i=='"'||i=="'"){c(n);var s=i,o=n.getSelectionRange(),u=r.doc.getTextRange(o);if(u!==""&&u!=="'"&&u!='"'&&n.getWrapBehavioursEnabled())return{text:s+u+s,selection:!1};var a=n.getCursorPosition(),f=r.doc.getLine(a.row),l=f.substring(a.column-1,a.column),h=f.substring(a.column,a.column+1),p=r.getTokenAt(a.row,a.column),d=r.getTokenAt(a.row,a.column+1);if(l=="\\"&&p&&/escape/.test(p.type))return null;var v=p&&/string/.test(p.type),m=!d||/string/.test(d.type),g;if(h==s)g=v!==m;else{if(v&&!m)return null;if(v&&m)return null;var y=r.$mode.tokenRe;y.lastIndex=0;var b=y.test(l);y.lastIndex=0;var w=y.test(l);if(b||w)return null;if(h&&!/[\s;,.})\]\\]/.test(h))return null;g=!0}return{text:g?s+s:"",selection:[1,1]}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&(s=='"'||s=="'")){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==s)return i.end.column++,i}})};h.isSaneInsertion=function(e,t){var n=e.getCursorPosition(),r=new s(t,n.row,n.column);if(!this.$matchTokenType(r.getCurrentToken()||"text",u)){var i=new s(t,n.row,n.column+1);if(!this.$matchTokenType(i.getCurrentToken()||"text",u))return!1}return r.stepForward(),r.getCurrentTokenRow()!==n.row||this.$matchTokenType(r.getCurrentToken()||"text",a)},h.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},h.recordAutoInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isAutoInsertedClosing(r,i,f.autoInsertedLineEnd[0])||(f.autoInsertedBrackets=0),f.autoInsertedRow=r.row,f.autoInsertedLineEnd=n+i.substr(r.column),f.autoInsertedBrackets++},h.recordMaybeInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isMaybeInsertedClosing(r,i)||(f.maybeInsertedBrackets=0),f.maybeInsertedRow=r.row,f.maybeInsertedLineStart=i.substr(0,r.column)+n,f.maybeInsertedLineEnd=i.substr(r.column),f.maybeInsertedBrackets++},h.isAutoInsertedClosing=function(e,t,n){return f.autoInsertedBrackets>0&&e.row===f.autoInsertedRow&&n===f.autoInsertedLineEnd[0]&&t.substr(e.column)===f.autoInsertedLineEnd},h.isMaybeInsertedClosing=function(e,t){return f.maybeInsertedBrackets>0&&e.row===f.maybeInsertedRow&&t.substr(e.column)===f.maybeInsertedLineEnd&&t.substr(0,e.column)==f.maybeInsertedLineStart},h.popAutoInsertedClosing=function(){f.autoInsertedLineEnd=f.autoInsertedLineEnd.substr(1),f.autoInsertedBrackets--},h.clearMaybeInsertedClosing=function(){f&&(f.maybeInsertedBrackets=0,f.maybeInsertedRow=-1)},r.inherits(h,i),t.CstyleBehaviour=h}),ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("./cstyle").CstyleBehaviour,o=e("../../token_iterator").TokenIterator,u=function(){this.inherit(s),this.add("colon","insertion",function(e,t,n,r,i){if(i===":"){var s=n.getCursorPosition(),u=new o(r,s.row,s.column),a=u.getCurrentToken();a&&a.value.match(/\s+/)&&(a=u.stepBackward());if(a&&a.type==="support.type"){var f=r.doc.getLine(s.row),l=f.substring(s.column,s.column+1);if(l===":")return{text:"",selection:[1,1]};if(!f.substring(s.column).match(/^\s*;/))return{text:":;",selection:[1,1]}}}}),this.add("colon","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s===":"){var u=n.getCursorPosition(),a=new o(r,u.row,u.column),f=a.getCurrentToken();f&&f.value.match(/\s+/)&&(f=a.stepBackward());if(f&&f.type==="support.type"){var l=r.doc.getLine(i.start.row),c=l.substring(i.end.column,i.end.column+1);if(c===";")return i.end.column++,i}}}),this.add("semicolon","insertion",function(e,t,n,r,i){if(i===";"){var s=n.getCursorPosition(),o=r.doc.getLine(s.row),u=o.substring(s.column,s.column+1);if(u===";")return{text:"",selection:[1,1]}}})};r.inherits(u,s),t.CssBehaviour=u}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/(\{|\[)[^\}\]]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var i=this._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?"start":i},this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n);if(this.startRegionRe.test(i))return this.getCommentRegionBlock(e,i,n);var s=i.match(this.foldingStartMarker);if(s){var o=s.index;if(s[1])return this.openingBracketBlock(e,s[1],n,o);var u=e.getCommentFoldRange(n,o+s[0].length,1);return u&&!u.isMultiLine()&&(r?u=this.getSectionRange(e,n):t!="all"&&(u=null)),u}if(t==="markbegin")return;var s=i.match(this.foldingStopMarker);if(s){var o=s.index+s[0].length;return s[1]?this.closingBracketBlock(e,s[1],n,o):e.getCommentFoldRange(n,o,-1)}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length;t+=1;var u=t,a=e.getLength();while(++tf)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)},this.getCommentRegionBlock=function(e,t,n){var r=t.search(/\s*$/),s=e.getLength(),o=n,u=/^\s*(?:\/\*|\/\/)#(end)?region\b/,a=1;while(++no)return new i(o,r,l,t.length)}}.call(o.prototype)}),ace.define("ace/mode/less",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/less_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/css","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./less_highlight_rules").LessHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,u=e("./behaviour/css").CssBehaviour,a=e("./folding/cstyle").FoldMode,f=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new u,this.foldingRules=new a};r.inherits(f,i),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e).tokens;if(i.length&&i[i.length-1].type=="comment")return r;var s=t.match(/^.*\{\s*$/);return s&&(r+=n),r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.$id="ace/mode/less"}.call(f.prototype),t.Mode=f}) \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/mode-markdown.js b/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/mode-markdown.js new file mode 100644 index 000000000..44d4f824a --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/mode-markdown.js @@ -0,0 +1 @@ +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},s.getTagRule(),{defaultToken:"comment.doc",caseInsensitive:!0}]}};r.inherits(s,i),s.getTagRule=function(e){return{token:"comment.doc.tag.storage.type",regex:"\\b(?:TODO|FIXME|XXX|HACK)\\b"}},s.getStartRule=function(e){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:e}},s.getEndRule=function(e){return{token:"comment.doc",regex:"\\*\\/",next:e}},t.DocCommentHighlightRules=s}),ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./doc_comment_highlight_rules").DocCommentHighlightRules,s=e("./text_highlight_rules").TextHighlightRules,o=function(e){var t=this.createKeywordMapper({"variable.language":"Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Namespace|QName|XML|XMLList|ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|SyntaxError|TypeError|URIError|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt|JSON|Math|this|arguments|prototype|window|document",keyword:"const|yield|import|get|set|break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|__parent__|__count__|escape|unescape|with|__proto__|class|enum|extends|super|export|implements|private|public|interface|package|protected|static","storage.type":"const|let|var|function","constant.language":"null|Infinity|NaN|undefined","support.function":"alert","constant.language.boolean":"true|false"},"identifier"),n="case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void",r="[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b",s="\\\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)";this.$rules={no_regex:[{token:"comment",regex:"\\/\\/",next:"line_comment"},i.getStartRule("doc-start"),{token:"comment",regex:/\/\*/,next:"comment"},{token:"string",regex:"'(?=.)",next:"qstring"},{token:"string",regex:'"(?=.)',next:"qqstring"},{token:"constant.numeric",regex:/0[xX][0-9a-fA-F]+\b/},{token:"constant.numeric",regex:/[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/},{token:["storage.type","punctuation.operator","support.function","punctuation.operator","entity.name.function","text","keyword.operator"],regex:"("+r+")(\\.)(prototype)(\\.)("+r+")(\\s*)(=)",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+r+")(\\.)("+r+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+r+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","entity.name.function","text","paren.lparen"],regex:"("+r+")(\\.)("+r+")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","text","entity.name.function","text","paren.lparen"],regex:"(function)(\\s+)("+r+")(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","punctuation.operator","text","storage.type","text","paren.lparen"],regex:"("+r+")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["text","text","storage.type","text","paren.lparen"],regex:"(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:"keyword",regex:"(?:"+n+")\\b",next:"start"},{token:["punctuation.operator","support.function"],regex:/(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/},{token:["punctuation.operator","support.function.dom"],regex:/(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/},{token:["punctuation.operator","support.constant"],regex:/(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/},{token:["support.constant"],regex:/that\b/},{token:["storage.type","punctuation.operator","support.function.firebug"],regex:/(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/},{token:t,regex:r},{token:"keyword.operator",regex:/--|\+\+|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|[!$%&*+\-~\/^]=?/,next:"start"},{token:"punctuation.operator",regex:/[?:,;.]/,next:"start"},{token:"paren.lparen",regex:/[\[({]/,next:"start"},{token:"paren.rparen",regex:/[\])}]/},{token:"comment",regex:/^#!.*$/}],start:[i.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment_regex_allowed"},{token:"comment",regex:"\\/\\/",next:"line_comment_regex_allowed"},{token:"string.regexp",regex:"\\/",next:"regex"},{token:"text",regex:"\\s+|^$",next:"start"},{token:"empty",regex:"",next:"no_regex"}],regex:[{token:"regexp.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"string.regexp",regex:"/[sxngimy]*",next:"no_regex"},{token:"invalid",regex:/\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/},{token:"constant.language.escape",regex:/\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/},{token:"constant.language.delimiter",regex:/\|/},{token:"constant.language.escape",regex:/\[\^?/,next:"regex_character_class"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp"}],regex_character_class:[{token:"regexp.charclass.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"constant.language.escape",regex:"]",next:"regex"},{token:"constant.language.escape",regex:"-"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp.charachterclass"}],function_arguments:[{token:"variable.parameter",regex:r},{token:"punctuation.operator",regex:"[, ]+"},{token:"punctuation.operator",regex:"$"},{token:"empty",regex:"",next:"no_regex"}],comment_regex_allowed:[i.getTagRule(),{token:"comment",regex:"\\*\\/",next:"start"},{defaultToken:"comment",caseInsensitive:!0}],comment:[i.getTagRule(),{token:"comment",regex:"\\*\\/",next:"no_regex"},{defaultToken:"comment",caseInsensitive:!0}],line_comment_regex_allowed:[i.getTagRule(),{token:"comment",regex:"$|^",next:"start"},{defaultToken:"comment",caseInsensitive:!0}],line_comment:[i.getTagRule(),{token:"comment",regex:"$|^",next:"no_regex"},{defaultToken:"comment",caseInsensitive:!0}],qqstring:[{token:"constant.language.escape",regex:s},{token:"string",regex:"\\\\$",next:"qqstring"},{token:"string",regex:'"|$',next:"no_regex"},{defaultToken:"string"}],qstring:[{token:"constant.language.escape",regex:s},{token:"string",regex:"\\\\$",next:"qstring"},{token:"string",regex:"'|$",next:"no_regex"},{defaultToken:"string"}]},(!e||!e.noES6)&&this.$rules.no_regex.unshift({regex:"[{}]",onMatch:function(e,t,n){this.next=e=="{"?this.nextState:"";if(e=="{"&&n.length)return n.unshift("start",t),"paren";if(e=="}"&&n.length){n.shift(),this.next=n.shift();if(this.next.indexOf("string")!=-1)return"paren.quasi.end"}return e=="{"?"paren.lparen":"paren.rparen"},nextState:"start"},{token:"string.quasi.start",regex:/`/,push:[{token:"constant.language.escape",regex:s},{token:"paren.quasi.start",regex:/\${/,push:"start"},{token:"string.quasi.end",regex:/`/,next:"pop"},{defaultToken:"string.quasi"}]}),this.embedRules(i,"doc-",[i.getEndRule("no_regex")]),this.normalizeRules()};r.inherits(o,s),t.JavaScriptHighlightRules=o}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("../../token_iterator").TokenIterator,o=e("../../lib/lang"),u=["text","paren.rparen","punctuation.operator"],a=["text","paren.rparen","punctuation.operator","comment"],f,l={},c=function(e){var t=-1;e.multiSelect&&(t=e.selection.index,l.rangeCount!=e.multiSelect.rangeCount&&(l={rangeCount:e.multiSelect.rangeCount}));if(l[t])return f=l[t];f=l[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},h=function(){this.add("braces","insertion",function(e,t,n,r,i){var s=n.getCursorPosition(),u=r.doc.getLine(s.row);if(i=="{"){c(n);var a=n.getSelectionRange(),l=r.doc.getTextRange(a);if(l!==""&&l!=="{"&&n.getWrapBehavioursEnabled())return{text:"{"+l+"}",selection:!1};if(h.isSaneInsertion(n,r))return/[\]\}\)]/.test(u[s.column])||n.inMultiSelectMode?(h.recordAutoInsert(n,r,"}"),{text:"{}",selection:[1,1]}):(h.recordMaybeInsert(n,r,"{"),{text:"{",selection:[1,1]})}else if(i=="}"){c(n);var p=u.substring(s.column,s.column+1);if(p=="}"){var d=r.$findOpeningBracket("}",{column:s.column+1,row:s.row});if(d!==null&&h.isAutoInsertedClosing(s,u,i))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else{if(i=="\n"||i=="\r\n"){c(n);var v="";h.isMaybeInsertedClosing(s,u)&&(v=o.stringRepeat("}",f.maybeInsertedBrackets),h.clearMaybeInsertedClosing());var p=u.substring(s.column,s.column+1);if(p==="}"){var m=r.findMatchingBracket({row:s.row,column:s.column+1},"}");if(!m)return null;var g=this.$getIndent(r.getLine(m.row))}else{if(!v){h.clearMaybeInsertedClosing();return}var g=this.$getIndent(u)}var y=g+r.getTabString();return{text:"\n"+y+"\n"+g+v,selection:[1,y.length,1,y.length]}}h.clearMaybeInsertedClosing()}}),this.add("braces","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="{"){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.end.column,i.end.column+1);if(u=="}")return i.end.column++,i;f.maybeInsertedBrackets--}}),this.add("parens","insertion",function(e,t,n,r,i){if(i=="("){c(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapBehavioursEnabled())return{text:"("+o+")",selection:!1};if(h.isSaneInsertion(n,r))return h.recordAutoInsert(n,r,")"),{text:"()",selection:[1,1]}}else if(i==")"){c(n);var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(f==")"){var l=r.$findOpeningBracket(")",{column:u.column+1,row:u.row});if(l!==null&&h.isAutoInsertedClosing(u,a,i))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="("){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==")")return i.end.column++,i}}),this.add("brackets","insertion",function(e,t,n,r,i){if(i=="["){c(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapBehavioursEnabled())return{text:"["+o+"]",selection:!1};if(h.isSaneInsertion(n,r))return h.recordAutoInsert(n,r,"]"),{text:"[]",selection:[1,1]}}else if(i=="]"){c(n);var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(f=="]"){var l=r.$findOpeningBracket("]",{column:u.column+1,row:u.row});if(l!==null&&h.isAutoInsertedClosing(u,a,i))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="["){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u=="]")return i.end.column++,i}}),this.add("string_dquotes","insertion",function(e,t,n,r,i){if(i=='"'||i=="'"){c(n);var s=i,o=n.getSelectionRange(),u=r.doc.getTextRange(o);if(u!==""&&u!=="'"&&u!='"'&&n.getWrapBehavioursEnabled())return{text:s+u+s,selection:!1};var a=n.getCursorPosition(),f=r.doc.getLine(a.row),l=f.substring(a.column-1,a.column),h=f.substring(a.column,a.column+1),p=r.getTokenAt(a.row,a.column),d=r.getTokenAt(a.row,a.column+1);if(l=="\\"&&p&&/escape/.test(p.type))return null;var v=p&&/string/.test(p.type),m=!d||/string/.test(d.type),g;if(h==s)g=v!==m;else{if(v&&!m)return null;if(v&&m)return null;var y=r.$mode.tokenRe;y.lastIndex=0;var b=y.test(l);y.lastIndex=0;var w=y.test(l);if(b||w)return null;if(h&&!/[\s;,.})\]\\]/.test(h))return null;g=!0}return{text:g?s+s:"",selection:[1,1]}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&(s=='"'||s=="'")){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==s)return i.end.column++,i}})};h.isSaneInsertion=function(e,t){var n=e.getCursorPosition(),r=new s(t,n.row,n.column);if(!this.$matchTokenType(r.getCurrentToken()||"text",u)){var i=new s(t,n.row,n.column+1);if(!this.$matchTokenType(i.getCurrentToken()||"text",u))return!1}return r.stepForward(),r.getCurrentTokenRow()!==n.row||this.$matchTokenType(r.getCurrentToken()||"text",a)},h.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},h.recordAutoInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isAutoInsertedClosing(r,i,f.autoInsertedLineEnd[0])||(f.autoInsertedBrackets=0),f.autoInsertedRow=r.row,f.autoInsertedLineEnd=n+i.substr(r.column),f.autoInsertedBrackets++},h.recordMaybeInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isMaybeInsertedClosing(r,i)||(f.maybeInsertedBrackets=0),f.maybeInsertedRow=r.row,f.maybeInsertedLineStart=i.substr(0,r.column)+n,f.maybeInsertedLineEnd=i.substr(r.column),f.maybeInsertedBrackets++},h.isAutoInsertedClosing=function(e,t,n){return f.autoInsertedBrackets>0&&e.row===f.autoInsertedRow&&n===f.autoInsertedLineEnd[0]&&t.substr(e.column)===f.autoInsertedLineEnd},h.isMaybeInsertedClosing=function(e,t){return f.maybeInsertedBrackets>0&&e.row===f.maybeInsertedRow&&t.substr(e.column)===f.maybeInsertedLineEnd&&t.substr(0,e.column)==f.maybeInsertedLineStart},h.popAutoInsertedClosing=function(){f.autoInsertedLineEnd=f.autoInsertedLineEnd.substr(1),f.autoInsertedBrackets--},h.clearMaybeInsertedClosing=function(){f&&(f.maybeInsertedBrackets=0,f.maybeInsertedRow=-1)},r.inherits(h,i),t.CstyleBehaviour=h}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/(\{|\[)[^\}\]]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var i=this._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?"start":i},this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n);if(this.startRegionRe.test(i))return this.getCommentRegionBlock(e,i,n);var s=i.match(this.foldingStartMarker);if(s){var o=s.index;if(s[1])return this.openingBracketBlock(e,s[1],n,o);var u=e.getCommentFoldRange(n,o+s[0].length,1);return u&&!u.isMultiLine()&&(r?u=this.getSectionRange(e,n):t!="all"&&(u=null)),u}if(t==="markbegin")return;var s=i.match(this.foldingStopMarker);if(s){var o=s.index+s[0].length;return s[1]?this.closingBracketBlock(e,s[1],n,o):e.getCommentFoldRange(n,o,-1)}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length;t+=1;var u=t,a=e.getLength();while(++tf)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)},this.getCommentRegionBlock=function(e,t,n){var r=t.search(/\s*$/),s=e.getLength(),o=n,u=/^\s*(?:\/\*|\/\/)#(end)?region\b/,a=1;while(++no)return new i(o,r,l,t.length)}}.call(o.prototype)}),ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./javascript_highlight_rules").JavaScriptHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,u=e("../range").Range,a=e("../worker/worker_client").WorkerClient,f=e("./behaviour/cstyle").CstyleBehaviour,l=e("./folding/cstyle").FoldMode,c=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new f,this.foldingRules=new l};r.inherits(c,i),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e),s=i.tokens,o=i.state;if(s.length&&s[s.length-1].type=="comment")return r;if(e=="start"||e=="no_regex"){var u=t.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);u&&(r+=n)}else if(e=="doc-start"){if(o=="start"||o=="no_regex")return"";var u=t.match(/^\s*(\/?)\*/);u&&(u[1]&&(r+=" "),r+="* ")}return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.createWorker=function(e){var t=new a(["ace"],"ace/mode/javascript_worker","JavaScriptWorker");return t.attachToDocument(e.getDocument()),t.on("jslint",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/javascript"}.call(c.prototype),t.Mode=c}),ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(e){this.$rules={start:[{token:"string.cdata.xml",regex:"<\\!\\[CDATA\\[",next:"cdata"},{token:["punctuation.xml-decl.xml","keyword.xml-decl.xml"],regex:"(<\\?)(xml)(?=[\\s])",next:"xml_decl",caseInsensitive:!0},{token:["punctuation.instruction.xml","keyword.instruction.xml"],regex:"(<\\?)([-_a-zA-Z0-9]+)",next:"processing_instruction"},{token:"comment.xml",regex:"<\\!--",next:"comment"},{token:["xml-pe.doctype.xml","xml-pe.doctype.xml"],regex:"(<\\!)(DOCTYPE)(?=[\\s])",next:"doctype",caseInsensitive:!0},{include:"tag"},{token:"text.end-tag-open.xml",regex:"",next:"start"}],processing_instruction:[{token:"punctuation.instruction.xml",regex:"\\?>",next:"start"},{defaultToken:"instruction.xml"}],doctype:[{include:"whitespace"},{include:"string"},{token:"xml-pe.doctype.xml",regex:">",next:"start"},{token:"xml-pe.xml",regex:"[-_a-zA-Z0-9:]+"},{token:"punctuation.int-subset",regex:"\\[",push:"int_subset"}],int_subset:[{token:"text.xml",regex:"\\s+"},{token:"punctuation.int-subset.xml",regex:"]",next:"pop"},{token:["punctuation.markup-decl.xml","keyword.markup-decl.xml"],regex:"(<\\!)([-_a-zA-Z0-9]+)",push:[{token:"text",regex:"\\s+"},{token:"punctuation.markup-decl.xml",regex:">",next:"pop"},{include:"string"}]}],cdata:[{token:"string.cdata.xml",regex:"\\]\\]>",next:"start"},{token:"text.xml",regex:"\\s+"},{token:"text.xml",regex:"(?:[^\\]]|\\](?!\\]>))+"}],comment:[{token:"comment.xml",regex:"-->",next:"start"},{defaultToken:"comment.xml"}],reference:[{token:"constant.language.escape.reference.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}],attr_reference:[{token:"constant.language.escape.reference.attribute-value.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}],tag:[{token:["meta.tag.punctuation.tag-open.xml","meta.tag.punctuation.end-tag-open.xml","meta.tag.tag-name.xml"],regex:"(?:(<)|(",next:"start"}]}],tag_whitespace:[{token:"text.tag-whitespace.xml",regex:"\\s+"}],whitespace:[{token:"text.whitespace.xml",regex:"\\s+"}],string:[{token:"string.xml",regex:"'",push:[{token:"string.xml",regex:"'",next:"pop"},{defaultToken:"string.xml"}]},{token:"string.xml",regex:'"',push:[{token:"string.xml",regex:'"',next:"pop"},{defaultToken:"string.xml"}]}],attributes:[{token:"entity.other.attribute-name.xml",regex:"(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+"},{token:"keyword.operator.attribute-equals.xml",regex:"="},{include:"tag_whitespace"},{include:"attribute_value"}],attribute_value:[{token:"string.attribute-value.xml",regex:"'",push:[{token:"string.attribute-value.xml",regex:"'",next:"pop"},{include:"attr_reference"},{defaultToken:"string.attribute-value.xml"}]},{token:"string.attribute-value.xml",regex:'"',push:[{token:"string.attribute-value.xml",regex:'"',next:"pop"},{include:"attr_reference"},{defaultToken:"string.attribute-value.xml"}]}]},this.constructor===s&&this.normalizeRules()};(function(){this.embedTagRules=function(e,t,n){this.$rules.tag.unshift({token:["meta.tag.punctuation.tag-open.xml","meta.tag."+n+".tag-name.xml"],regex:"(<)("+n+"(?=\\s|>|$))",next:[{include:"attributes"},{token:"meta.tag.punctuation.tag-close.xml",regex:"/?>",next:t+"start"}]}),this.$rules[n+"-end"]=[{include:"attributes"},{token:"meta.tag.punctuation.tag-close.xml",regex:"/?>",next:"start",onMatch:function(e,t,n){return n.splice(0),this.token}}],this.embedRules(e,t,[{token:["meta.tag.punctuation.end-tag-open.xml","meta.tag."+n+".tag-name.xml"],regex:"(|$))",next:n+"-end"},{token:"string.cdata.xml",regex:"<\\!\\[CDATA\\["},{token:"string.cdata.xml",regex:"\\]\\]>"}])}}).call(i.prototype),r.inherits(s,i),t.XmlHighlightRules=s}),ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,n){"use strict";function u(e,t){return e.type.lastIndexOf(t+".xml")>-1}var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("../../token_iterator").TokenIterator,o=e("../../lib/lang"),a=function(){this.add("string_dquotes","insertion",function(e,t,n,r,i){if(i=='"'||i=="'"){var o=i,a=r.doc.getTextRange(n.getSelectionRange());if(a!==""&&a!=="'"&&a!='"'&&n.getWrapBehavioursEnabled())return{text:o+a+o,selection:!1};var f=n.getCursorPosition(),l=r.doc.getLine(f.row),c=l.substring(f.column,f.column+1),h=new s(r,f.row,f.column),p=h.getCurrentToken();if(c==o&&(u(p,"attribute-value")||u(p,"string")))return{text:"",selection:[1,1]};p||(p=h.stepBackward());if(!p)return;while(u(p,"tag-whitespace")||u(p,"whitespace"))p=h.stepBackward();var d=!c||c.match(/\s/);if(u(p,"attribute-equals")&&(d||c==">")||u(p,"decl-attribute-equals")&&(d||c=="?"))return{text:o+o,selection:[1,1]}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&(s=='"'||s=="'")){var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==s)return i.end.column++,i}}),this.add("autoclosing","insertion",function(e,t,n,r,i){if(i==">"){var o=n.getCursorPosition(),a=new s(r,o.row,o.column),f=a.getCurrentToken()||a.stepBackward();if(!f||!(u(f,"tag-name")||u(f,"tag-whitespace")||u(f,"attribute-name")||u(f,"attribute-equals")||u(f,"attribute-value")))return;if(u(f,"reference.attribute-value"))return;if(u(f,"attribute-value")){var l=f.value.charAt(0);if(l=='"'||l=="'"){var c=f.value.charAt(f.value.length-1),h=a.getCurrentTokenColumn()+f.value.length;if(h>o.column||h==o.column&&l!=c)return}}while(!u(f,"tag-name"))f=a.stepBackward();var p=a.getCurrentTokenRow(),d=a.getCurrentTokenColumn();if(u(a.stepBackward(),"end-tag-open"))return;var v=f.value;p==o.row&&(v=v.substring(0,o.column-d));if(this.voidElements.hasOwnProperty(v.toLowerCase()))return;return{text:">",selection:[1,1]}}}),this.add("autoindent","insertion",function(e,t,n,r,i){if(i=="\n"){var o=n.getCursorPosition(),u=r.getLine(o.row),a=new s(r,o.row,o.column),f=a.getCurrentToken();if(f&&f.type.indexOf("tag-close")!==-1){while(f&&f.type.indexOf("tag-name")===-1)f=a.stepBackward();if(!f)return;var l=f.value,c=a.getCurrentTokenRow();f=a.stepBackward();if(!f||f.type.indexOf("end-tag")!==-1)return;if(this.voidElements&&!this.voidElements[l]){var h=r.getTokenAt(o.row,o.column+1),u=r.getLine(c),p=this.$getIndent(u),d=p+r.getTabString();return h&&h.value==="-1}var r=e("../../lib/oop"),i=e("../../lib/lang"),s=e("../../range").Range,o=e("./fold_mode").FoldMode,u=e("../../token_iterator").TokenIterator,a=t.FoldMode=function(e,t){o.call(this),this.voidElements=e||{},this.optionalEndTags=r.mixin({},this.voidElements),t&&r.mixin(this.optionalEndTags,t)};r.inherits(a,o);var f=function(){this.tagName="",this.closing=!1,this.selfClosing=!1,this.start={row:0,column:0},this.end={row:0,column:0}};(function(){this.getFoldWidget=function(e,t,n){var r=this._getFirstTagInLine(e,n);return r?r.closing||!r.tagName&&r.selfClosing?t=="markbeginend"?"end":"":!r.tagName||r.selfClosing||this.voidElements.hasOwnProperty(r.tagName.toLowerCase())?"":this._findEndTagInLine(e,n,r.tagName,r.end.column)?"":"start":""},this._getFirstTagInLine=function(e,t){var n=e.getTokens(t),r=new f;for(var i=0;i";break}}return r}if(l(s,"tag-close"))return r.selfClosing=s.value=="/>",r;r.start.column+=s.value.length}return null},this._findEndTagInLine=function(e,t,n,r){var i=e.getTokens(t),s=0;for(var o=0;o",n.end.row=e.getCurrentTokenRow(),n.end.column=e.getCurrentTokenColumn()+t.value.length,e.stepForward(),n;while(t=e.stepForward());return null},this._readTagBackward=function(e){var t=e.getCurrentToken();if(!t)return null;var n=new f;do{if(l(t,"tag-open"))return n.closing=l(t,"end-tag-open"),n.start.row=e.getCurrentTokenRow(),n.start.column=e.getCurrentTokenColumn(),e.stepBackward(),n;l(t,"tag-name")?n.tagName=t.value:l(t,"tag-close")&&(n.selfClosing=t.value=="/>",n.end.row=e.getCurrentTokenRow(),n.end.column=e.getCurrentTokenColumn()+t.value.length)}while(t=e.stepBackward());return null},this._pop=function(e,t){while(e.length){var n=e[e.length-1];if(!t||n.tagName==t.tagName)return e.pop();if(this.optionalEndTags.hasOwnProperty(n.tagName)){e.pop();continue}return null}},this.getFoldWidgetRange=function(e,t,n){var r=this._getFirstTagInLine(e,n);if(!r)return null;var i=r.closing||r.selfClosing,o=[],a;if(!i){var f=new u(e,n,r.start.column),l={row:n,column:r.start.column+r.tagName.length+2};while(a=this._readTagForward(f)){if(a.selfClosing){if(!o.length)return a.start.column+=a.tagName.length+2,a.end.column-=2,s.fromPoints(a.start,a.end);continue}if(a.closing){this._pop(o,a);if(o.length==0)return s.fromPoints(l,a.start)}else o.push(a)}}else{var f=new u(e,n,r.end.column),c={row:n,column:r.start.column};while(a=this._readTagBackward(f)){if(a.selfClosing){if(!o.length)return a.start.column+=a.tagName.length+2,a.end.column-=2,s.fromPoints(a.start,a.end);continue}if(!a.closing){this._pop(o,a);if(o.length==0)return a.start.column+=a.tagName.length+2,s.fromPoints(a.start,c)}else o.push(a)}}}}).call(a.prototype)}),ace.define("ace/mode/xml",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/xml_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/xml"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text").Mode,o=e("./xml_highlight_rules").XmlHighlightRules,u=e("./behaviour/xml").XmlBehaviour,a=e("./folding/xml").FoldMode,f=function(){this.HighlightRules=o,this.$behaviour=new u,this.foldingRules=new a};r.inherits(f,s),function(){this.voidElements=i.arrayToMap([]),this.blockComment={start:""},this.$id="ace/mode/xml"}.call(f.prototype),t.Mode=f}),ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text_highlight_rules").TextHighlightRules,o=t.supportType="animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|pointer-events|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index",u=t.supportFunction="rgb|rgba|url|attr|counter|counters",a=t.supportConstant="absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero",f=t.supportConstantColor="aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow",l=t.supportConstantFonts="arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace",c=t.numRe="\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))",h=t.pseudoElements="(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b",p=t.pseudoClasses="(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b",d=function(){var e=this.createKeywordMapper({"support.function":u,"support.constant":a,"support.type":o,"support.constant.color":f,"support.constant.fonts":l},"text",!0);this.$rules={start:[{token:"comment",regex:"\\/\\*",push:"comment"},{token:"paren.lparen",regex:"\\{",push:"ruleset"},{token:"string",regex:"@.*?{",push:"media"},{token:"keyword",regex:"#[a-z0-9-_]+"},{token:"variable",regex:"\\.[a-z0-9-_]+"},{token:"string",regex:":[a-z0-9-_]+"},{token:"constant",regex:"[a-z0-9-_]+"},{caseInsensitive:!0}],media:[{token:"comment",regex:"\\/\\*",push:"comment"},{token:"paren.lparen",regex:"\\{",push:"ruleset"},{token:"string",regex:"\\}",next:"pop"},{token:"keyword",regex:"#[a-z0-9-_]+"},{token:"variable",regex:"\\.[a-z0-9-_]+"},{token:"string",regex:":[a-z0-9-_]+"},{token:"constant",regex:"[a-z0-9-_]+"},{caseInsensitive:!0}],comment:[{token:"comment",regex:"\\*\\/",next:"pop"},{defaultToken:"comment"}],ruleset:[{token:"paren.rparen",regex:"\\}",next:"pop"},{token:"comment",regex:"\\/\\*",push:"comment"},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:["constant.numeric","keyword"],regex:"("+c+")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)"},{token:"constant.numeric",regex:c},{token:"constant.numeric",regex:"#[a-f0-9]{6}"},{token:"constant.numeric",regex:"#[a-f0-9]{3}"},{token:["punctuation","entity.other.attribute-name.pseudo-element.css"],regex:h},{token:["punctuation","entity.other.attribute-name.pseudo-class.css"],regex:p},{token:["support.function","string","support.function"],regex:"(url\\()(.*)(\\))"},{token:e,regex:"\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"},{caseInsensitive:!0}]},this.normalizeRules()};r.inherits(d,s),t.CssHighlightRules=d}),ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("./cstyle").CstyleBehaviour,o=e("../../token_iterator").TokenIterator,u=function(){this.inherit(s),this.add("colon","insertion",function(e,t,n,r,i){if(i===":"){var s=n.getCursorPosition(),u=new o(r,s.row,s.column),a=u.getCurrentToken();a&&a.value.match(/\s+/)&&(a=u.stepBackward());if(a&&a.type==="support.type"){var f=r.doc.getLine(s.row),l=f.substring(s.column,s.column+1);if(l===":")return{text:"",selection:[1,1]};if(!f.substring(s.column).match(/^\s*;/))return{text:":;",selection:[1,1]}}}}),this.add("colon","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s===":"){var u=n.getCursorPosition(),a=new o(r,u.row,u.column),f=a.getCurrentToken();f&&f.value.match(/\s+/)&&(f=a.stepBackward());if(f&&f.type==="support.type"){var l=r.doc.getLine(i.start.row),c=l.substring(i.end.column,i.end.column+1);if(c===";")return i.end.column++,i}}}),this.add("semicolon","insertion",function(e,t,n,r,i){if(i===";"){var s=n.getCursorPosition(),o=r.doc.getLine(s.row),u=o.substring(s.column,s.column+1);if(u===";")return{text:"",selection:[1,1]}}})};r.inherits(u,s),t.CssBehaviour=u}),ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/css","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./css_highlight_rules").CssHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,u=e("../worker/worker_client").WorkerClient,a=e("./behaviour/css").CssBehaviour,f=e("./folding/cstyle").FoldMode,l=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new a,this.foldingRules=new f};r.inherits(l,i),function(){this.foldingRules="cStyle",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e).tokens;if(i.length&&i[i.length-1].type=="comment")return r;var s=t.match(/^.*\{\s*$/);return s&&(r+=n),r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.createWorker=function(e){var t=new u(["ace"],"ace/mode/css_worker","Worker");return t.attachToDocument(e.getDocument()),t.on("csslint",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/css"}.call(l.prototype),t.Mode=l}),ace.define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./css_highlight_rules").CssHighlightRules,o=e("./javascript_highlight_rules").JavaScriptHighlightRules,u=e("./xml_highlight_rules").XmlHighlightRules,a=i.createMap({a:"anchor",button:"form",form:"form",img:"image",input:"form",label:"form",option:"form",script:"script",select:"form",textarea:"form",style:"style",table:"table",tbody:"table",td:"table",tfoot:"table",th:"table",tr:"table"}),f=function(){u.call(this),this.addRules({attributes:[{include:"tag_whitespace"},{token:"entity.other.attribute-name.xml",regex:"[-_a-zA-Z0-9:]+"},{token:"keyword.operator.attribute-equals.xml",regex:"=",push:[{include:"tag_whitespace"},{token:"string.unquoted.attribute-value.html",regex:"[^<>='\"`\\s]+",next:"pop"},{token:"empty",regex:"",next:"pop"}]},{include:"attribute_value"}],tag:[{token:function(e,t){var n=a[t];return["meta.tag.punctuation."+(e=="<"?"":"end-")+"tag-open.xml","meta.tag"+(n?"."+n:"")+".tag-name.xml"]},regex:"(",next:"start"}]}),this.embedTagRules(s,"css-","style"),this.embedTagRules(o,"js-","script"),this.constructor===f&&this.normalizeRules()};r.inherits(f,u),t.HtmlHighlightRules=f}),ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("./fold_mode").FoldMode,s=t.FoldMode=function(e,t){this.defaultMode=e,this.subModes=t};r.inherits(s,i),function(){this.$getMode=function(e){typeof e!="string"&&(e=e[0]);for(var t in this.subModes)if(e.indexOf(t)===0)return this.subModes[t];return null},this.$tryMode=function(e,t,n,r){var i=this.$getMode(e);return i?i.getFoldWidget(t,n,r):""},this.getFoldWidget=function(e,t,n){return this.$tryMode(e.getState(n-1),e,t,n)||this.$tryMode(e.getState(n),e,t,n)||this.defaultMode.getFoldWidget(e,t,n)},this.getFoldWidgetRange=function(e,t,n){var r=this.$getMode(e.getState(n-1));if(!r||!r.getFoldWidget(e,t,n))r=this.$getMode(e.getState(n));if(!r||!r.getFoldWidget(e,t,n))r=this.defaultMode;return r.getFoldWidgetRange(e,t,n)}}.call(s.prototype)}),ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("./mixed").FoldMode,s=e("./xml").FoldMode,o=e("./cstyle").FoldMode,u=t.FoldMode=function(e,t){i.call(this,new s(e,t),{"js-":new o,"css-":new o})};r.inherits(u,i)}),ace.define("ace/mode/html_completions",["require","exports","module","ace/token_iterator"],function(e,t,n){"use strict";function f(e,t){return e.type.lastIndexOf(t+".xml")>-1}function l(e,t){var n=new r(e,t.row,t.column),i=n.getCurrentToken();while(i&&!f(i,"tag-name"))i=n.stepBackward();if(i)return i.value}var r=e("../token_iterator").TokenIterator,i=["accesskey","class","contenteditable","contextmenu","dir","draggable","dropzone","hidden","id","inert","itemid","itemprop","itemref","itemscope","itemtype","lang","spellcheck","style","tabindex","title","translate"],s=["onabort","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncontextmenu","oncuechange","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onmousedown","onmousemove","onmouseout","onmouseover","onmouseup","onmousewheel","onpause","onplay","onplaying","onprogress","onratechange","onreset","onscroll","onseeked","onseeking","onselect","onshow","onstalled","onsubmit","onsuspend","ontimeupdate","onvolumechange","onwaiting"],o=i.concat(s),u={html:["manifest"],head:[],title:[],base:["href","target"],link:["href","hreflang","rel","media","type","sizes"],meta:["http-equiv","name","content","charset"],style:["type","media","scoped"],script:["charset","type","src","defer","async"],noscript:["href"],body:["onafterprint","onbeforeprint","onbeforeunload","onhashchange","onmessage","onoffline","onpopstate","onredo","onresize","onstorage","onundo","onunload"],section:[],nav:[],article:["pubdate"],aside:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],footer:[],address:[],main:[],p:[],hr:[],pre:[],blockquote:["cite"],ol:["start","reversed"],ul:[],li:["value"],dl:[],dt:[],dd:[],figure:[],figcaption:[],div:[],a:["href","target","ping","rel","media","hreflang","type"],em:[],strong:[],small:[],s:[],cite:[],q:["cite"],dfn:[],abbr:[],data:[],time:["datetime"],code:[],"var":[],samp:[],kbd:[],sub:[],sup:[],i:[],b:[],u:[],mark:[],ruby:[],rt:[],rp:[],bdi:[],bdo:[],span:[],br:[],wbr:[],ins:["cite","datetime"],del:["cite","datetime"],img:["alt","src","height","width","usemap","ismap"],iframe:["name","src","height","width","sandbox","seamless"],embed:["src","height","width","type"],object:["param","data","type","height","width","usemap","name","form","classid"],param:["name","value"],video:["src","autobuffer","autoplay","loop","controls","width","height","poster"],audio:["src","autobuffer","autoplay","loop","controls"],source:["src","type","media"],track:["kind","src","srclang","label","default"],canvas:["width","height"],map:["name"],area:["shape","coords","href","hreflang","alt","target","media","rel","ping","type"],svg:[],math:[],table:["summary"],caption:[],colgroup:["span"],col:["span"],tbody:[],thead:[],tfoot:[],tr:[],td:["headers","rowspan","colspan"],th:["headers","rowspan","colspan","scope"],form:["accept-charset","action","autocomplete","enctype","method","name","novalidate","target"],fieldset:["disabled","form","name"],legend:[],label:["form","for"],input:["type","accept","alt","autocomplete","checked","disabled","form","formaction","formenctype","formmethod","formnovalidate","formtarget","height","list","max","maxlength","min","multiple","pattern","placeholder","readonly","required","size","src","step","width","files","value"],button:["autofocus","disabled","form","formaction","formenctype","formmethod","formnovalidate","formtarget","name","value","type"],select:["autofocus","disabled","form","multiple","name","size"],datalist:[],optgroup:["disabled","label"],option:["disabled","selected","label","value"],textarea:["autofocus","disabled","form","maxlength","name","placeholder","readonly","required","rows","cols","wrap"],keygen:["autofocus","challenge","disabled","form","keytype","name"],output:["for","form","name"],progress:["value","max"],meter:["value","min","max","low","high","optimum"],details:["open"],summary:[],command:["type","label","icon","disabled","checked","radiogroup","command"],menu:["type","label"],dialog:["open"]},a=Object.keys(u),c=function(){};(function(){this.getCompletions=function(e,t,n,r){var i=t.getTokenAt(n.row,n.column);return i?f(i,"tag-name")||f(i,"tag-open")||f(i,"end-tag-open")?this.getTagCompletions(e,t,n,r):f(i,"tag-whitespace")||f(i,"attribute-name")?this.getAttributeCompetions(e,t,n,r):[]:[]},this.getTagCompletions=function(e,t,n,r){return a.map(function(e){return{value:e,meta:"tag",score:Number.MAX_VALUE}})},this.getAttributeCompetions=function(e,t,n,r){var i=l(t,n);if(!i)return[];var s=o;return i in u&&(s=s.concat(u[i])),s.map(function(e){return{caption:e,snippet:e+'="$0"',meta:"attribute",score:Number.MAX_VALUE}})}}).call(c.prototype),t.HtmlCompletions=c}),ace.define("ace/mode/html",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/javascript","ace/mode/css","ace/mode/html_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/html","ace/mode/html_completions","ace/worker/worker_client"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text").Mode,o=e("./javascript").Mode,u=e("./css").Mode,a=e("./html_highlight_rules").HtmlHighlightRules,f=e("./behaviour/xml").XmlBehaviour,l=e("./folding/html").FoldMode,c=e("./html_completions").HtmlCompletions,h=e("../worker/worker_client").WorkerClient,p=["area","base","br","col","embed","hr","img","input","keygen","link","meta","menuitem","param","source","track","wbr"],d=["li","dt","dd","p","rt","rp","optgroup","option","colgroup","td","th"],v=function(e){this.fragmentContext=e&&e.fragmentContext,this.HighlightRules=a,this.$behaviour=new f,this.$completer=new c,this.createModeDelegates({"js-":o,"css-":u}),this.foldingRules=new l(this.voidElements,i.arrayToMap(d))};r.inherits(v,s),function(){this.blockComment={start:""},this.voidElements=i.arrayToMap(p),this.getNextLineIndent=function(e,t,n){return this.$getIndent(t)},this.checkOutdent=function(e,t,n){return!1},this.getCompletions=function(e,t,n,r){return this.$completer.getCompletions(e,t,n,r)},this.createWorker=function(e){if(this.constructor!=v)return;var t=new h(["ace"],"ace/mode/html_worker","Worker");return t.attachToDocument(e.getDocument()),this.fragmentContext&&t.call("setOptions",[{context:this.fragmentContext}]),t.on("error",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/html"}.call(v.prototype),t.Mode=v}),ace.define("ace/mode/markdown_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules","ace/mode/html_highlight_rules","ace/mode/css_highlight_rules"],function(e,t,n){"use strict";function c(e,t){return{token:"support.function",regex:"^\\s*```"+e+"\\s*$",push:t+"start"}}var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text_highlight_rules").TextHighlightRules,o=e("./javascript_highlight_rules").JavaScriptHighlightRules,u=e("./xml_highlight_rules").XmlHighlightRules,a=e("./html_highlight_rules").HtmlHighlightRules,f=e("./css_highlight_rules").CssHighlightRules,l=function(e){return"(?:[^"+i.escapeRegExp(e)+"\\\\]|\\\\.)*"},h=function(){a.call(this),this.$rules.start.unshift({token:"empty_line",regex:"^$",next:"allowBlock"},{token:"markup.heading.1",regex:"^=+(?=\\s*$)"},{token:"markup.heading.2",regex:"^\\-+(?=\\s*$)"},{token:function(e){return"markup.heading."+e.length},regex:/^#{1,6}(?=\s*[^ #]|\s+#.)/,next:"header"},c("(?:javascript|js)","jscode-"),c("xml","xmlcode-"),c("html","htmlcode-"),c("css","csscode-"),{token:"support.function",regex:"^\\s*```\\s*\\S*(?:{.*?\\})?\\s*$",next:"githubblock"},{token:"string.blockquote",regex:"^\\s*>\\s*(?:[*+-]|\\d+\\.)?\\s+",next:"blockquote"},{token:"constant",regex:"^ {0,2}(?:(?: ?\\* ?){3,}|(?: ?\\- ?){3,}|(?: ?\\_ ?){3,})\\s*$",next:"allowBlock"},{token:"markup.list",regex:"^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",next:"listblock-start"},{include:"basic"}),this.addRules({basic:[{token:"constant.language.escape",regex:/\\[\\`*_{}\[\]()#+\-.!]/},{token:"support.function",regex:"(`+)(.*?[^`])(\\1)"},{token:["text","constant","text","url","string","text"],regex:'^([ ]{0,3}\\[)([^\\]]+)(\\]:\\s*)([^ ]+)(\\s*(?:["][^"]+["])?(\\s*))$'},{token:["text","string","text","constant","text"],regex:"(\\[)("+l("]")+")(\\]s*\\[)("+l("]")+")(\\])"},{token:["text","string","text","markup.underline","string","text"],regex:"(\\[)("+l("]")+")(\\]\\()"+'((?:[^\\)\\s\\\\]|\\\\.|\\s(?=[^"]))*)'+'(\\s*"'+l('"')+'"\\s*)?'+"(\\))"},{token:"string.strong",regex:"([*]{2}|[_]{2}(?=\\S))(.*?\\S[*_]*)(\\1)"},{token:"string.emphasis",regex:"([*]|[_](?=\\S))(.*?\\S[*_]*)(\\1)"},{token:["text","url","text"],regex:"(<)((?:https?|ftp|dict):[^'\">\\s]+|(?:mailto:)?[-.\\w]+\\@[-a-z0-9]+(?:\\.[-a-z0-9]+)*\\.[a-z]+)(>)"}],allowBlock:[{token:"support.function",regex:"^ {4}.+",next:"allowBlock"},{token:"empty",regex:"",next:"start"}],header:[{regex:"$",next:"start"},{include:"basic"},{defaultToken:"heading"}],"listblock-start":[{token:"support.variable",regex:/(?:\[[ x]\])?/,next:"listblock"}],listblock:[{token:"empty_line",regex:"^$",next:"start"},{token:"markup.list",regex:"^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",next:"listblock-start"},{include:"basic",noEscape:!0},{token:"support.function",regex:"^\\s*```\\s*[a-zA-Z]*(?:{.*?\\})?\\s*$",next:"githubblock"},{defaultToken:"list"}],blockquote:[{token:"empty_line",regex:"^\\s*$",next:"start"},{token:"string.blockquote",regex:"^\\s*>\\s*(?:[*+-]|\\d+\\.)?\\s+",next:"blockquote"},{include:"basic",noEscape:!0},{defaultToken:"string.blockquote"}],githubblock:[{token:"support.function",regex:"^\\s*```",next:"start"},{token:"support.function",regex:".+"}]}),this.embedRules(o,"jscode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]),this.embedRules(a,"htmlcode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]),this.embedRules(f,"csscode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]),this.embedRules(u,"xmlcode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]),this.normalizeRules()};r.inherits(h,s),t.MarkdownHighlightRules=h}),ace.define("ace/mode/folding/markdown",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("./fold_mode").FoldMode,s=e("../../range").Range,o=t.FoldMode=function(){};r.inherits(o,i),function(){this.foldingStartMarker=/^(?:[=-]+\s*$|#{1,6} |`{3})/,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);return this.foldingStartMarker.test(r)?r[0]=="`"?e.bgTokenizer.getState(n)=="start"?"end":"start":"start":""},this.getFoldWidgetRange=function(e,t,n){function l(t){return f=e.getTokens(t)[0],f&&f.type.lastIndexOf(c,0)===0}function h(){var e=f.value[0];return e=="="?6:e=="-"?5:7-f.value.search(/[^#]/)}var r=e.getLine(n),i=r.length,o=e.getLength(),u=n,a=n;if(!r.match(this.foldingStartMarker))return;if(r[0]=="`"){if(e.bgTokenizer.getState(n)!=="start"){while(++n0){r=e.getLine(n);if(r[0]=="`"&r.substring(0,3)=="```")break}return new s(n,r.length,u,0)}var f,c="markup.heading";if(l(n)){var p=h();while(++n=p)break}a=n-(!f||["=","-"].indexOf(f.value[0])==-1?1:2);if(a>u)while(a>u&&/^\s*$/.test(e.getLine(a)))a--;if(a>u){var v=e.getLine(a).length;return new s(u,i,a,v)}}}}.call(o.prototype)}),ace.define("ace/mode/markdown",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript","ace/mode/xml","ace/mode/html","ace/mode/markdown_highlight_rules","ace/mode/folding/markdown"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./javascript").Mode,o=e("./xml").Mode,u=e("./html").Mode,a=e("./markdown_highlight_rules").MarkdownHighlightRules,f=e("./folding/markdown").FoldMode,l=function(){this.HighlightRules=a,this.createModeDelegates({"js-":s,"xml-":o,"html-":u}),this.foldingRules=new f};r.inherits(l,i),function(){this.type="text",this.blockComment={start:""},this.getNextLineIndent=function(e,t,n){if(e=="listblock"){var r=/^(\s*)(?:([-+*])|(\d+)\.)(\s+)/.exec(t);if(!r)return"";var i=r[2];return i||(i=parseInt(r[3],10)+1+"."),r[1]+i+r[4]}return this.$getIndent(t)},this.$id="ace/mode/markdown"}.call(l.prototype),t.Mode=l}) \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/mode-mysql.js b/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/mode-mysql.js new file mode 100644 index 000000000..733d69269 --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/mode-mysql.js @@ -0,0 +1 @@ +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},s.getTagRule(),{defaultToken:"comment.doc",caseInsensitive:!0}]}};r.inherits(s,i),s.getTagRule=function(e){return{token:"comment.doc.tag.storage.type",regex:"\\b(?:TODO|FIXME|XXX|HACK)\\b"}},s.getStartRule=function(e){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:e}},s.getEndRule=function(e){return{token:"comment.doc",regex:"\\*\\/",next:e}},t.DocCommentHighlightRules=s}),ace.define("ace/mode/mysql_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./doc_comment_highlight_rules").DocCommentHighlightRules,o=e("./text_highlight_rules").TextHighlightRules,u=function(){function i(e){var t=e.start,n=e.escape;return{token:"string.start",regex:t,next:[{token:"constant.language.escape",regex:n},{token:"string.end",next:"start",regex:t},{defaultToken:"string"}]}}var e="alter|and|as|asc|between|count|create|delete|desc|distinct|drop|from|having|in|insert|into|is|join|like|not|on|or|order|select|set|table|union|update|values|where|accessible|action|add|after|algorithm|all|analyze|asensitive|at|authors|auto_increment|autocommit|avg|avg_row_length|before|binary|binlog|both|btree|cache|call|cascade|cascaded|case|catalog_name|chain|change|changed|character|check|checkpoint|checksum|class_origin|client_statistics|close|coalesce|code|collate|collation|collations|column|columns|comment|commit|committed|completion|concurrent|condition|connection|consistent|constraint|contains|continue|contributors|convert|cross|current_date|current_time|current_timestamp|current_user|cursor|data|database|databases|day_hour|day_microsecond|day_minute|day_second|deallocate|dec|declare|default|delay_key_write|delayed|delimiter|des_key_file|describe|deterministic|dev_pop|dev_samp|deviance|directory|disable|discard|distinctrow|div|dual|dumpfile|each|elseif|enable|enclosed|end|ends|engine|engines|enum|errors|escape|escaped|even|event|events|every|execute|exists|exit|explain|extended|fast|fetch|field|fields|first|flush|for|force|foreign|found_rows|full|fulltext|function|general|global|grant|grants|group|groupby_concat|handler|hash|help|high_priority|hosts|hour_microsecond|hour_minute|hour_second|if|ignore|ignore_server_ids|import|index|index_statistics|infile|inner|innodb|inout|insensitive|insert_method|install|interval|invoker|isolation|iterate|key|keys|kill|language|last|leading|leave|left|level|limit|linear|lines|list|load|local|localtime|localtimestamp|lock|logs|low_priority|master|master_heartbeat_period|master_ssl_verify_server_cert|masters|match|max|max_rows|maxvalue|message_text|middleint|migrate|min|min_rows|minute_microsecond|minute_second|mod|mode|modifies|modify|mutex|mysql_errno|natural|next|no|no_write_to_binlog|offline|offset|one|online|open|optimize|option|optionally|out|outer|outfile|pack_keys|parser|partition|partitions|password|phase|plugin|plugins|prepare|preserve|prev|primary|privileges|procedure|processlist|profile|profiles|purge|query|quick|range|read|read_write|reads|real|rebuild|recover|references|regexp|relaylog|release|remove|rename|reorganize|repair|repeatable|replace|require|resignal|restrict|resume|return|returns|revoke|right|rlike|rollback|rollup|row|row_format|rtree|savepoint|schedule|schema|schema_name|schemas|second_microsecond|security|sensitive|separator|serializable|server|session|share|show|signal|slave|slow|smallint|snapshot|soname|spatial|specific|sql|sql_big_result|sql_buffer_result|sql_cache|sql_calc_found_rows|sql_no_cache|sql_small_result|sqlexception|sqlstate|sqlwarning|ssl|start|starting|starts|status|std|stddev|stddev_pop|stddev_samp|storage|straight_join|subclass_origin|sum|suspend|table_name|table_statistics|tables|tablespace|temporary|terminated|to|trailing|transaction|trigger|triggers|truncate|uncommitted|undo|uninstall|unique|unlock|upgrade|usage|use|use_frm|user|user_resources|user_statistics|using|utc_date|utc_time|utc_timestamp|value|variables|varying|view|views|warnings|when|while|with|work|write|xa|xor|year_month|zerofill|begin|do|then|else|loop|repeat",t="by|bool|boolean|bit|blob|decimal|double|enum|float|long|longblob|longtext|medium|mediumblob|mediumint|mediumtext|time|timestamp|tinyblob|tinyint|tinytext|text|bigint|int|int1|int2|int3|int4|int8|integer|float|float4|float8|double|char|varbinary|varchar|varcharacter|precision|date|datetime|year|unsigned|signed|numeric",n="charset|clear|connect|edit|ego|exit|go|help|nopager|notee|nowarning|pager|print|prompt|quit|rehash|source|status|system|tee",r=this.createKeywordMapper({"support.function":t,keyword:e,constant:"false|true|null|unknown|date|time|timestamp|ODBCdotTable|zerolessFloat","variable.language":n},"identifier",!0);this.$rules={start:[{token:"comment",regex:"(?:-- |#).*$"},i({start:'"',escape:/\\[0'"bnrtZ\\%_]?/}),i({start:"'",escape:/\\[0'"bnrtZ\\%_]?/}),s.getStartRule("doc-start"),{token:"comment",regex:/\/\*/,next:"comment"},{token:"constant.numeric",regex:/0[xX][0-9a-fA-F]+|[xX]'[0-9a-fA-F]+'|0[bB][01]+|[bB]'[01]+'/},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:r,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"constant.class",regex:"@@?[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"constant.buildin",regex:"`[^`]*`"},{token:"keyword.operator",regex:"\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|="},{token:"paren.lparen",regex:"[\\(]"},{token:"paren.rparen",regex:"[\\)]"},{token:"text",regex:"\\s+"}],comment:[{token:"comment",regex:"\\*\\/",next:"start"},{defaultToken:"comment"}]},this.embedRules(s,"doc-",[s.getEndRule("start")]),this.normalizeRules()};r.inherits(u,o),t.MysqlHighlightRules=u}),ace.define("ace/mode/mysql",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/mysql_highlight_rules","ace/range"],function(e,t,n){var r=e("../lib/oop"),i=e("../mode/text").Mode,s=e("./mysql_highlight_rules").MysqlHighlightRules,o=e("../range").Range,u=function(){this.HighlightRules=s};r.inherits(u,i),function(){this.lineCommentStart=["--","#"],this.blockComment={start:"/*",end:"*/"},this.$id="ace/mode/mysql"}.call(u.prototype),t.Mode=u}) \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/mode-php.js b/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/mode-php.js new file mode 100644 index 000000000..8d0f83fd7 --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/mode-php.js @@ -0,0 +1 @@ +ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},s.getTagRule(),{defaultToken:"comment.doc",caseInsensitive:!0}]}};r.inherits(s,i),s.getTagRule=function(e){return{token:"comment.doc.tag.storage.type",regex:"\\b(?:TODO|FIXME|XXX|HACK)\\b"}},s.getStartRule=function(e){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:e}},s.getEndRule=function(e){return{token:"comment.doc",regex:"\\*\\/",next:e}},t.DocCommentHighlightRules=s}),ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text_highlight_rules").TextHighlightRules,o=t.supportType="animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|pointer-events|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index",u=t.supportFunction="rgb|rgba|url|attr|counter|counters",a=t.supportConstant="absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero",f=t.supportConstantColor="aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow",l=t.supportConstantFonts="arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace",c=t.numRe="\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))",h=t.pseudoElements="(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b",p=t.pseudoClasses="(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b",d=function(){var e=this.createKeywordMapper({"support.function":u,"support.constant":a,"support.type":o,"support.constant.color":f,"support.constant.fonts":l},"text",!0);this.$rules={start:[{token:"comment",regex:"\\/\\*",push:"comment"},{token:"paren.lparen",regex:"\\{",push:"ruleset"},{token:"string",regex:"@.*?{",push:"media"},{token:"keyword",regex:"#[a-z0-9-_]+"},{token:"variable",regex:"\\.[a-z0-9-_]+"},{token:"string",regex:":[a-z0-9-_]+"},{token:"constant",regex:"[a-z0-9-_]+"},{caseInsensitive:!0}],media:[{token:"comment",regex:"\\/\\*",push:"comment"},{token:"paren.lparen",regex:"\\{",push:"ruleset"},{token:"string",regex:"\\}",next:"pop"},{token:"keyword",regex:"#[a-z0-9-_]+"},{token:"variable",regex:"\\.[a-z0-9-_]+"},{token:"string",regex:":[a-z0-9-_]+"},{token:"constant",regex:"[a-z0-9-_]+"},{caseInsensitive:!0}],comment:[{token:"comment",regex:"\\*\\/",next:"pop"},{defaultToken:"comment"}],ruleset:[{token:"paren.rparen",regex:"\\}",next:"pop"},{token:"comment",regex:"\\/\\*",push:"comment"},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:["constant.numeric","keyword"],regex:"("+c+")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)"},{token:"constant.numeric",regex:c},{token:"constant.numeric",regex:"#[a-f0-9]{6}"},{token:"constant.numeric",regex:"#[a-f0-9]{3}"},{token:["punctuation","entity.other.attribute-name.pseudo-element.css"],regex:h},{token:["punctuation","entity.other.attribute-name.pseudo-class.css"],regex:p},{token:["support.function","string","support.function"],regex:"(url\\()(.*)(\\))"},{token:e,regex:"\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"},{caseInsensitive:!0}]},this.normalizeRules()};r.inherits(d,s),t.CssHighlightRules=d}),ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./doc_comment_highlight_rules").DocCommentHighlightRules,s=e("./text_highlight_rules").TextHighlightRules,o=function(e){var t=this.createKeywordMapper({"variable.language":"Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Namespace|QName|XML|XMLList|ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|SyntaxError|TypeError|URIError|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt|JSON|Math|this|arguments|prototype|window|document",keyword:"const|yield|import|get|set|break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|__parent__|__count__|escape|unescape|with|__proto__|class|enum|extends|super|export|implements|private|public|interface|package|protected|static","storage.type":"const|let|var|function","constant.language":"null|Infinity|NaN|undefined","support.function":"alert","constant.language.boolean":"true|false"},"identifier"),n="case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void",r="[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b",s="\\\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)";this.$rules={no_regex:[{token:"comment",regex:"\\/\\/",next:"line_comment"},i.getStartRule("doc-start"),{token:"comment",regex:/\/\*/,next:"comment"},{token:"string",regex:"'(?=.)",next:"qstring"},{token:"string",regex:'"(?=.)',next:"qqstring"},{token:"constant.numeric",regex:/0[xX][0-9a-fA-F]+\b/},{token:"constant.numeric",regex:/[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/},{token:["storage.type","punctuation.operator","support.function","punctuation.operator","entity.name.function","text","keyword.operator"],regex:"("+r+")(\\.)(prototype)(\\.)("+r+")(\\s*)(=)",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+r+")(\\.)("+r+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+r+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","entity.name.function","text","paren.lparen"],regex:"("+r+")(\\.)("+r+")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","text","entity.name.function","text","paren.lparen"],regex:"(function)(\\s+)("+r+")(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","punctuation.operator","text","storage.type","text","paren.lparen"],regex:"("+r+")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["text","text","storage.type","text","paren.lparen"],regex:"(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:"keyword",regex:"(?:"+n+")\\b",next:"start"},{token:["punctuation.operator","support.function"],regex:/(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/},{token:["punctuation.operator","support.function.dom"],regex:/(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/},{token:["punctuation.operator","support.constant"],regex:/(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/},{token:["support.constant"],regex:/that\b/},{token:["storage.type","punctuation.operator","support.function.firebug"],regex:/(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/},{token:t,regex:r},{token:"keyword.operator",regex:/--|\+\+|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|[!$%&*+\-~\/^]=?/,next:"start"},{token:"punctuation.operator",regex:/[?:,;.]/,next:"start"},{token:"paren.lparen",regex:/[\[({]/,next:"start"},{token:"paren.rparen",regex:/[\])}]/},{token:"comment",regex:/^#!.*$/}],start:[i.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment_regex_allowed"},{token:"comment",regex:"\\/\\/",next:"line_comment_regex_allowed"},{token:"string.regexp",regex:"\\/",next:"regex"},{token:"text",regex:"\\s+|^$",next:"start"},{token:"empty",regex:"",next:"no_regex"}],regex:[{token:"regexp.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"string.regexp",regex:"/[sxngimy]*",next:"no_regex"},{token:"invalid",regex:/\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/},{token:"constant.language.escape",regex:/\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/},{token:"constant.language.delimiter",regex:/\|/},{token:"constant.language.escape",regex:/\[\^?/,next:"regex_character_class"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp"}],regex_character_class:[{token:"regexp.charclass.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"constant.language.escape",regex:"]",next:"regex"},{token:"constant.language.escape",regex:"-"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp.charachterclass"}],function_arguments:[{token:"variable.parameter",regex:r},{token:"punctuation.operator",regex:"[, ]+"},{token:"punctuation.operator",regex:"$"},{token:"empty",regex:"",next:"no_regex"}],comment_regex_allowed:[i.getTagRule(),{token:"comment",regex:"\\*\\/",next:"start"},{defaultToken:"comment",caseInsensitive:!0}],comment:[i.getTagRule(),{token:"comment",regex:"\\*\\/",next:"no_regex"},{defaultToken:"comment",caseInsensitive:!0}],line_comment_regex_allowed:[i.getTagRule(),{token:"comment",regex:"$|^",next:"start"},{defaultToken:"comment",caseInsensitive:!0}],line_comment:[i.getTagRule(),{token:"comment",regex:"$|^",next:"no_regex"},{defaultToken:"comment",caseInsensitive:!0}],qqstring:[{token:"constant.language.escape",regex:s},{token:"string",regex:"\\\\$",next:"qqstring"},{token:"string",regex:'"|$',next:"no_regex"},{defaultToken:"string"}],qstring:[{token:"constant.language.escape",regex:s},{token:"string",regex:"\\\\$",next:"qstring"},{token:"string",regex:"'|$",next:"no_regex"},{defaultToken:"string"}]},(!e||!e.noES6)&&this.$rules.no_regex.unshift({regex:"[{}]",onMatch:function(e,t,n){this.next=e=="{"?this.nextState:"";if(e=="{"&&n.length)return n.unshift("start",t),"paren";if(e=="}"&&n.length){n.shift(),this.next=n.shift();if(this.next.indexOf("string")!=-1)return"paren.quasi.end"}return e=="{"?"paren.lparen":"paren.rparen"},nextState:"start"},{token:"string.quasi.start",regex:/`/,push:[{token:"constant.language.escape",regex:s},{token:"paren.quasi.start",regex:/\${/,push:"start"},{token:"string.quasi.end",regex:/`/,next:"pop"},{defaultToken:"string.quasi"}]}),this.embedRules(i,"doc-",[i.getEndRule("no_regex")]),this.normalizeRules()};r.inherits(o,s),t.JavaScriptHighlightRules=o}),ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(e){this.$rules={start:[{token:"string.cdata.xml",regex:"<\\!\\[CDATA\\[",next:"cdata"},{token:["punctuation.xml-decl.xml","keyword.xml-decl.xml"],regex:"(<\\?)(xml)(?=[\\s])",next:"xml_decl",caseInsensitive:!0},{token:["punctuation.instruction.xml","keyword.instruction.xml"],regex:"(<\\?)([-_a-zA-Z0-9]+)",next:"processing_instruction"},{token:"comment.xml",regex:"<\\!--",next:"comment"},{token:["xml-pe.doctype.xml","xml-pe.doctype.xml"],regex:"(<\\!)(DOCTYPE)(?=[\\s])",next:"doctype",caseInsensitive:!0},{include:"tag"},{token:"text.end-tag-open.xml",regex:"",next:"start"}],processing_instruction:[{token:"punctuation.instruction.xml",regex:"\\?>",next:"start"},{defaultToken:"instruction.xml"}],doctype:[{include:"whitespace"},{include:"string"},{token:"xml-pe.doctype.xml",regex:">",next:"start"},{token:"xml-pe.xml",regex:"[-_a-zA-Z0-9:]+"},{token:"punctuation.int-subset",regex:"\\[",push:"int_subset"}],int_subset:[{token:"text.xml",regex:"\\s+"},{token:"punctuation.int-subset.xml",regex:"]",next:"pop"},{token:["punctuation.markup-decl.xml","keyword.markup-decl.xml"],regex:"(<\\!)([-_a-zA-Z0-9]+)",push:[{token:"text",regex:"\\s+"},{token:"punctuation.markup-decl.xml",regex:">",next:"pop"},{include:"string"}]}],cdata:[{token:"string.cdata.xml",regex:"\\]\\]>",next:"start"},{token:"text.xml",regex:"\\s+"},{token:"text.xml",regex:"(?:[^\\]]|\\](?!\\]>))+"}],comment:[{token:"comment.xml",regex:"-->",next:"start"},{defaultToken:"comment.xml"}],reference:[{token:"constant.language.escape.reference.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}],attr_reference:[{token:"constant.language.escape.reference.attribute-value.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}],tag:[{token:["meta.tag.punctuation.tag-open.xml","meta.tag.punctuation.end-tag-open.xml","meta.tag.tag-name.xml"],regex:"(?:(<)|(",next:"start"}]}],tag_whitespace:[{token:"text.tag-whitespace.xml",regex:"\\s+"}],whitespace:[{token:"text.whitespace.xml",regex:"\\s+"}],string:[{token:"string.xml",regex:"'",push:[{token:"string.xml",regex:"'",next:"pop"},{defaultToken:"string.xml"}]},{token:"string.xml",regex:'"',push:[{token:"string.xml",regex:'"',next:"pop"},{defaultToken:"string.xml"}]}],attributes:[{token:"entity.other.attribute-name.xml",regex:"(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+"},{token:"keyword.operator.attribute-equals.xml",regex:"="},{include:"tag_whitespace"},{include:"attribute_value"}],attribute_value:[{token:"string.attribute-value.xml",regex:"'",push:[{token:"string.attribute-value.xml",regex:"'",next:"pop"},{include:"attr_reference"},{defaultToken:"string.attribute-value.xml"}]},{token:"string.attribute-value.xml",regex:'"',push:[{token:"string.attribute-value.xml",regex:'"',next:"pop"},{include:"attr_reference"},{defaultToken:"string.attribute-value.xml"}]}]},this.constructor===s&&this.normalizeRules()};(function(){this.embedTagRules=function(e,t,n){this.$rules.tag.unshift({token:["meta.tag.punctuation.tag-open.xml","meta.tag."+n+".tag-name.xml"],regex:"(<)("+n+"(?=\\s|>|$))",next:[{include:"attributes"},{token:"meta.tag.punctuation.tag-close.xml",regex:"/?>",next:t+"start"}]}),this.$rules[n+"-end"]=[{include:"attributes"},{token:"meta.tag.punctuation.tag-close.xml",regex:"/?>",next:"start",onMatch:function(e,t,n){return n.splice(0),this.token}}],this.embedRules(e,t,[{token:["meta.tag.punctuation.end-tag-open.xml","meta.tag."+n+".tag-name.xml"],regex:"(|$))",next:n+"-end"},{token:"string.cdata.xml",regex:"<\\!\\[CDATA\\["},{token:"string.cdata.xml",regex:"\\]\\]>"}])}}).call(i.prototype),r.inherits(s,i),t.XmlHighlightRules=s}),ace.define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./css_highlight_rules").CssHighlightRules,o=e("./javascript_highlight_rules").JavaScriptHighlightRules,u=e("./xml_highlight_rules").XmlHighlightRules,a=i.createMap({a:"anchor",button:"form",form:"form",img:"image",input:"form",label:"form",option:"form",script:"script",select:"form",textarea:"form",style:"style",table:"table",tbody:"table",td:"table",tfoot:"table",th:"table",tr:"table"}),f=function(){u.call(this),this.addRules({attributes:[{include:"tag_whitespace"},{token:"entity.other.attribute-name.xml",regex:"[-_a-zA-Z0-9:]+"},{token:"keyword.operator.attribute-equals.xml",regex:"=",push:[{include:"tag_whitespace"},{token:"string.unquoted.attribute-value.html",regex:"[^<>='\"`\\s]+",next:"pop"},{token:"empty",regex:"",next:"pop"}]},{include:"attribute_value"}],tag:[{token:function(e,t){var n=a[t];return["meta.tag.punctuation."+(e=="<"?"":"end-")+"tag-open.xml","meta.tag"+(n?"."+n:"")+".tag-name.xml"]},regex:"(",next:"start"}]}),this.embedTagRules(s,"css-","style"),this.embedTagRules(o,"js-","script"),this.constructor===f&&this.normalizeRules()};r.inherits(f,u),t.HtmlHighlightRules=f}),ace.define("ace/mode/php_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules","ace/mode/html_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./doc_comment_highlight_rules").DocCommentHighlightRules,o=e("./text_highlight_rules").TextHighlightRules,u=e("./html_highlight_rules").HtmlHighlightRules,a=function(){var e=s,t=i.arrayToMap("abs|acos|acosh|addcslashes|addslashes|aggregate|aggregate_info|aggregate_methods|aggregate_methods_by_list|aggregate_methods_by_regexp|aggregate_properties|aggregate_properties_by_list|aggregate_properties_by_regexp|aggregation_info|amqpconnection|amqpexchange|amqpqueue|apache_child_terminate|apache_get_modules|apache_get_version|apache_getenv|apache_lookup_uri|apache_note|apache_request_headers|apache_reset_timeout|apache_response_headers|apache_setenv|apc_add|apc_bin_dump|apc_bin_dumpfile|apc_bin_load|apc_bin_loadfile|apc_cache_info|apc_cas|apc_clear_cache|apc_compile_file|apc_dec|apc_define_constants|apc_delete|apc_delete_file|apc_exists|apc_fetch|apc_inc|apc_load_constants|apc_sma_info|apc_store|apciterator|apd_breakpoint|apd_callstack|apd_clunk|apd_continue|apd_croak|apd_dump_function_table|apd_dump_persistent_resources|apd_dump_regular_resources|apd_echo|apd_get_active_symbols|apd_set_pprof_trace|apd_set_session|apd_set_session_trace|apd_set_session_trace_socket|appenditerator|array|array_change_key_case|array_chunk|array_combine|array_count_values|array_diff|array_diff_assoc|array_diff_key|array_diff_uassoc|array_diff_ukey|array_fill|array_fill_keys|array_filter|array_flip|array_intersect|array_intersect_assoc|array_intersect_key|array_intersect_uassoc|array_intersect_ukey|array_key_exists|array_keys|array_map|array_merge|array_merge_recursive|array_multisort|array_pad|array_pop|array_product|array_push|array_rand|array_reduce|array_replace|array_replace_recursive|array_reverse|array_search|array_shift|array_slice|array_splice|array_sum|array_udiff|array_udiff_assoc|array_udiff_uassoc|array_uintersect|array_uintersect_assoc|array_uintersect_uassoc|array_unique|array_unshift|array_values|array_walk|array_walk_recursive|arrayaccess|arrayiterator|arrayobject|arsort|asin|asinh|asort|assert|assert_options|atan|atan2|atanh|audioproperties|badfunctioncallexception|badmethodcallexception|base64_decode|base64_encode|base_convert|basename|bbcode_add_element|bbcode_add_smiley|bbcode_create|bbcode_destroy|bbcode_parse|bbcode_set_arg_parser|bbcode_set_flags|bcadd|bccomp|bcdiv|bcmod|bcmul|bcompiler_load|bcompiler_load_exe|bcompiler_parse_class|bcompiler_read|bcompiler_write_class|bcompiler_write_constant|bcompiler_write_exe_footer|bcompiler_write_file|bcompiler_write_footer|bcompiler_write_function|bcompiler_write_functions_from_file|bcompiler_write_header|bcompiler_write_included_filename|bcpow|bcpowmod|bcscale|bcsqrt|bcsub|bin2hex|bind_textdomain_codeset|bindec|bindtextdomain|bson_decode|bson_encode|bumpValue|bzclose|bzcompress|bzdecompress|bzerrno|bzerror|bzerrstr|bzflush|bzopen|bzread|bzwrite|cachingiterator|cairo|cairo_create|cairo_font_face_get_type|cairo_font_face_status|cairo_font_options_create|cairo_font_options_equal|cairo_font_options_get_antialias|cairo_font_options_get_hint_metrics|cairo_font_options_get_hint_style|cairo_font_options_get_subpixel_order|cairo_font_options_hash|cairo_font_options_merge|cairo_font_options_set_antialias|cairo_font_options_set_hint_metrics|cairo_font_options_set_hint_style|cairo_font_options_set_subpixel_order|cairo_font_options_status|cairo_format_stride_for_width|cairo_image_surface_create|cairo_image_surface_create_for_data|cairo_image_surface_create_from_png|cairo_image_surface_get_data|cairo_image_surface_get_format|cairo_image_surface_get_height|cairo_image_surface_get_stride|cairo_image_surface_get_width|cairo_matrix_create_scale|cairo_matrix_create_translate|cairo_matrix_invert|cairo_matrix_multiply|cairo_matrix_rotate|cairo_matrix_transform_distance|cairo_matrix_transform_point|cairo_matrix_translate|cairo_pattern_add_color_stop_rgb|cairo_pattern_add_color_stop_rgba|cairo_pattern_create_for_surface|cairo_pattern_create_linear|cairo_pattern_create_radial|cairo_pattern_create_rgb|cairo_pattern_create_rgba|cairo_pattern_get_color_stop_count|cairo_pattern_get_color_stop_rgba|cairo_pattern_get_extend|cairo_pattern_get_filter|cairo_pattern_get_linear_points|cairo_pattern_get_matrix|cairo_pattern_get_radial_circles|cairo_pattern_get_rgba|cairo_pattern_get_surface|cairo_pattern_get_type|cairo_pattern_set_extend|cairo_pattern_set_filter|cairo_pattern_set_matrix|cairo_pattern_status|cairo_pdf_surface_create|cairo_pdf_surface_set_size|cairo_ps_get_levels|cairo_ps_level_to_string|cairo_ps_surface_create|cairo_ps_surface_dsc_begin_page_setup|cairo_ps_surface_dsc_begin_setup|cairo_ps_surface_dsc_comment|cairo_ps_surface_get_eps|cairo_ps_surface_restrict_to_level|cairo_ps_surface_set_eps|cairo_ps_surface_set_size|cairo_scaled_font_create|cairo_scaled_font_extents|cairo_scaled_font_get_ctm|cairo_scaled_font_get_font_face|cairo_scaled_font_get_font_matrix|cairo_scaled_font_get_font_options|cairo_scaled_font_get_scale_matrix|cairo_scaled_font_get_type|cairo_scaled_font_glyph_extents|cairo_scaled_font_status|cairo_scaled_font_text_extents|cairo_surface_copy_page|cairo_surface_create_similar|cairo_surface_finish|cairo_surface_flush|cairo_surface_get_content|cairo_surface_get_device_offset|cairo_surface_get_font_options|cairo_surface_get_type|cairo_surface_mark_dirty|cairo_surface_mark_dirty_rectangle|cairo_surface_set_device_offset|cairo_surface_set_fallback_resolution|cairo_surface_show_page|cairo_surface_status|cairo_surface_write_to_png|cairo_svg_surface_create|cairo_svg_surface_restrict_to_version|cairo_svg_version_to_string|cairoantialias|cairocontent|cairocontext|cairoexception|cairoextend|cairofillrule|cairofilter|cairofontface|cairofontoptions|cairofontslant|cairofonttype|cairofontweight|cairoformat|cairogradientpattern|cairohintmetrics|cairohintstyle|cairoimagesurface|cairolineargradient|cairolinecap|cairolinejoin|cairomatrix|cairooperator|cairopath|cairopattern|cairopatterntype|cairopdfsurface|cairopslevel|cairopssurface|cairoradialgradient|cairoscaledfont|cairosolidpattern|cairostatus|cairosubpixelorder|cairosurface|cairosurfacepattern|cairosurfacetype|cairosvgsurface|cairosvgversion|cairotoyfontface|cal_days_in_month|cal_from_jd|cal_info|cal_to_jd|calcul_hmac|calculhmac|call_user_func|call_user_func_array|call_user_method|call_user_method_array|callbackfilteriterator|ceil|chdb|chdb_create|chdir|checkdate|checkdnsrr|chgrp|chmod|chop|chown|chr|chroot|chunk_split|class_alias|class_exists|class_implements|class_parents|classkit_import|classkit_method_add|classkit_method_copy|classkit_method_redefine|classkit_method_remove|classkit_method_rename|clearstatcache|clone|closedir|closelog|collator|com|com_addref|com_create_guid|com_event_sink|com_get|com_get_active_object|com_invoke|com_isenum|com_load|com_load_typelib|com_message_pump|com_print_typeinfo|com_propget|com_propput|com_propset|com_release|com_set|compact|connection_aborted|connection_status|connection_timeout|constant|construct|construct|construct|convert_cyr_string|convert_uudecode|convert_uuencode|copy|cos|cosh|count|count_chars|countable|counter_bump|counter_bump_value|counter_create|counter_get|counter_get_meta|counter_get_named|counter_get_value|counter_reset|counter_reset_value|crack_check|crack_closedict|crack_getlastmessage|crack_opendict|crc32|create_function|crypt|ctype_alnum|ctype_alpha|ctype_cntrl|ctype_digit|ctype_graph|ctype_lower|ctype_print|ctype_punct|ctype_space|ctype_upper|ctype_xdigit|cubrid_affected_rows|cubrid_bind|cubrid_client_encoding|cubrid_close|cubrid_close_prepare|cubrid_close_request|cubrid_col_get|cubrid_col_size|cubrid_column_names|cubrid_column_types|cubrid_commit|cubrid_connect|cubrid_connect_with_url|cubrid_current_oid|cubrid_data_seek|cubrid_db_name|cubrid_disconnect|cubrid_drop|cubrid_errno|cubrid_error|cubrid_error_code|cubrid_error_code_facility|cubrid_error_msg|cubrid_execute|cubrid_fetch|cubrid_fetch_array|cubrid_fetch_assoc|cubrid_fetch_field|cubrid_fetch_lengths|cubrid_fetch_object|cubrid_fetch_row|cubrid_field_flags|cubrid_field_len|cubrid_field_name|cubrid_field_seek|cubrid_field_table|cubrid_field_type|cubrid_free_result|cubrid_get|cubrid_get_autocommit|cubrid_get_charset|cubrid_get_class_name|cubrid_get_client_info|cubrid_get_db_parameter|cubrid_get_server_info|cubrid_insert_id|cubrid_is_instance|cubrid_list_dbs|cubrid_load_from_glo|cubrid_lob_close|cubrid_lob_export|cubrid_lob_get|cubrid_lob_send|cubrid_lob_size|cubrid_lock_read|cubrid_lock_write|cubrid_move_cursor|cubrid_new_glo|cubrid_next_result|cubrid_num_cols|cubrid_num_fields|cubrid_num_rows|cubrid_ping|cubrid_prepare|cubrid_put|cubrid_query|cubrid_real_escape_string|cubrid_result|cubrid_rollback|cubrid_save_to_glo|cubrid_schema|cubrid_send_glo|cubrid_seq_drop|cubrid_seq_insert|cubrid_seq_put|cubrid_set_add|cubrid_set_autocommit|cubrid_set_db_parameter|cubrid_set_drop|cubrid_unbuffered_query|cubrid_version|curl_close|curl_copy_handle|curl_errno|curl_error|curl_exec|curl_getinfo|curl_init|curl_multi_add_handle|curl_multi_close|curl_multi_exec|curl_multi_getcontent|curl_multi_info_read|curl_multi_init|curl_multi_remove_handle|curl_multi_select|curl_setopt|curl_setopt_array|curl_version|current|cyrus_authenticate|cyrus_bind|cyrus_close|cyrus_connect|cyrus_query|cyrus_unbind|date|date_add|date_create|date_create_from_format|date_date_set|date_default_timezone_get|date_default_timezone_set|date_diff|date_format|date_get_last_errors|date_interval_create_from_date_string|date_interval_format|date_isodate_set|date_modify|date_offset_get|date_parse|date_parse_from_format|date_sub|date_sun_info|date_sunrise|date_sunset|date_time_set|date_timestamp_get|date_timestamp_set|date_timezone_get|date_timezone_set|dateinterval|dateperiod|datetime|datetimezone|db2_autocommit|db2_bind_param|db2_client_info|db2_close|db2_column_privileges|db2_columns|db2_commit|db2_conn_error|db2_conn_errormsg|db2_connect|db2_cursor_type|db2_escape_string|db2_exec|db2_execute|db2_fetch_array|db2_fetch_assoc|db2_fetch_both|db2_fetch_object|db2_fetch_row|db2_field_display_size|db2_field_name|db2_field_num|db2_field_precision|db2_field_scale|db2_field_type|db2_field_width|db2_foreign_keys|db2_free_result|db2_free_stmt|db2_get_option|db2_last_insert_id|db2_lob_read|db2_next_result|db2_num_fields|db2_num_rows|db2_pclose|db2_pconnect|db2_prepare|db2_primary_keys|db2_procedure_columns|db2_procedures|db2_result|db2_rollback|db2_server_info|db2_set_option|db2_special_columns|db2_statistics|db2_stmt_error|db2_stmt_errormsg|db2_table_privileges|db2_tables|dba_close|dba_delete|dba_exists|dba_fetch|dba_firstkey|dba_handlers|dba_insert|dba_key_split|dba_list|dba_nextkey|dba_open|dba_optimize|dba_popen|dba_replace|dba_sync|dbase_add_record|dbase_close|dbase_create|dbase_delete_record|dbase_get_header_info|dbase_get_record|dbase_get_record_with_names|dbase_numfields|dbase_numrecords|dbase_open|dbase_pack|dbase_replace_record|dbplus_add|dbplus_aql|dbplus_chdir|dbplus_close|dbplus_curr|dbplus_errcode|dbplus_errno|dbplus_find|dbplus_first|dbplus_flush|dbplus_freealllocks|dbplus_freelock|dbplus_freerlocks|dbplus_getlock|dbplus_getunique|dbplus_info|dbplus_last|dbplus_lockrel|dbplus_next|dbplus_open|dbplus_prev|dbplus_rchperm|dbplus_rcreate|dbplus_rcrtexact|dbplus_rcrtlike|dbplus_resolve|dbplus_restorepos|dbplus_rkeys|dbplus_ropen|dbplus_rquery|dbplus_rrename|dbplus_rsecindex|dbplus_runlink|dbplus_rzap|dbplus_savepos|dbplus_setindex|dbplus_setindexbynumber|dbplus_sql|dbplus_tcl|dbplus_tremove|dbplus_undo|dbplus_undoprepare|dbplus_unlockrel|dbplus_unselect|dbplus_update|dbplus_xlockrel|dbplus_xunlockrel|dbx_close|dbx_compare|dbx_connect|dbx_error|dbx_escape_string|dbx_fetch_row|dbx_query|dbx_sort|dcgettext|dcngettext|deaggregate|debug_backtrace|debug_print_backtrace|debug_zval_dump|decbin|dechex|decoct|define|define_syslog_variables|defined|deg2rad|delete|dgettext|die|dio_close|dio_fcntl|dio_open|dio_read|dio_seek|dio_stat|dio_tcsetattr|dio_truncate|dio_write|dir|directoryiterator|dirname|disk_free_space|disk_total_space|diskfreespace|dl|dngettext|dns_check_record|dns_get_mx|dns_get_record|dom_import_simplexml|domainexception|domattr|domattribute_name|domattribute_set_value|domattribute_specified|domattribute_value|domcharacterdata|domcomment|domdocument|domdocument_add_root|domdocument_create_attribute|domdocument_create_cdata_section|domdocument_create_comment|domdocument_create_element|domdocument_create_element_ns|domdocument_create_entity_reference|domdocument_create_processing_instruction|domdocument_create_text_node|domdocument_doctype|domdocument_document_element|domdocument_dump_file|domdocument_dump_mem|domdocument_get_element_by_id|domdocument_get_elements_by_tagname|domdocument_html_dump_mem|domdocument_xinclude|domdocumentfragment|domdocumenttype|domdocumenttype_entities|domdocumenttype_internal_subset|domdocumenttype_name|domdocumenttype_notations|domdocumenttype_public_id|domdocumenttype_system_id|domelement|domelement_get_attribute|domelement_get_attribute_node|domelement_get_elements_by_tagname|domelement_has_attribute|domelement_remove_attribute|domelement_set_attribute|domelement_set_attribute_node|domelement_tagname|domentity|domentityreference|domexception|domimplementation|domnamednodemap|domnode|domnode_add_namespace|domnode_append_child|domnode_append_sibling|domnode_attributes|domnode_child_nodes|domnode_clone_node|domnode_dump_node|domnode_first_child|domnode_get_content|domnode_has_attributes|domnode_has_child_nodes|domnode_insert_before|domnode_is_blank_node|domnode_last_child|domnode_next_sibling|domnode_node_name|domnode_node_type|domnode_node_value|domnode_owner_document|domnode_parent_node|domnode_prefix|domnode_previous_sibling|domnode_remove_child|domnode_replace_child|domnode_replace_node|domnode_set_content|domnode_set_name|domnode_set_namespace|domnode_unlink_node|domnodelist|domnotation|domprocessinginstruction|domprocessinginstruction_data|domprocessinginstruction_target|domtext|domxml_new_doc|domxml_open_file|domxml_open_mem|domxml_version|domxml_xmltree|domxml_xslt_stylesheet|domxml_xslt_stylesheet_doc|domxml_xslt_stylesheet_file|domxml_xslt_version|domxpath|domxsltstylesheet_process|domxsltstylesheet_result_dump_file|domxsltstylesheet_result_dump_mem|dotnet|dotnet_load|doubleval|each|easter_date|easter_days|echo|empty|emptyiterator|enchant_broker_describe|enchant_broker_dict_exists|enchant_broker_free|enchant_broker_free_dict|enchant_broker_get_error|enchant_broker_init|enchant_broker_list_dicts|enchant_broker_request_dict|enchant_broker_request_pwl_dict|enchant_broker_set_ordering|enchant_dict_add_to_personal|enchant_dict_add_to_session|enchant_dict_check|enchant_dict_describe|enchant_dict_get_error|enchant_dict_is_in_session|enchant_dict_quick_check|enchant_dict_store_replacement|enchant_dict_suggest|end|ereg|ereg_replace|eregi|eregi_replace|error_get_last|error_log|error_reporting|errorexception|escapeshellarg|escapeshellcmd|eval|event_add|event_base_free|event_base_loop|event_base_loopbreak|event_base_loopexit|event_base_new|event_base_priority_init|event_base_set|event_buffer_base_set|event_buffer_disable|event_buffer_enable|event_buffer_fd_set|event_buffer_free|event_buffer_new|event_buffer_priority_set|event_buffer_read|event_buffer_set_callback|event_buffer_timeout_set|event_buffer_watermark_set|event_buffer_write|event_del|event_free|event_new|event_set|exception|exec|exif_imagetype|exif_read_data|exif_tagname|exif_thumbnail|exit|exp|expect_expectl|expect_popen|explode|expm1|export|export|extension_loaded|extract|ezmlm_hash|fam_cancel_monitor|fam_close|fam_monitor_collection|fam_monitor_directory|fam_monitor_file|fam_next_event|fam_open|fam_pending|fam_resume_monitor|fam_suspend_monitor|fbsql_affected_rows|fbsql_autocommit|fbsql_blob_size|fbsql_change_user|fbsql_clob_size|fbsql_close|fbsql_commit|fbsql_connect|fbsql_create_blob|fbsql_create_clob|fbsql_create_db|fbsql_data_seek|fbsql_database|fbsql_database_password|fbsql_db_query|fbsql_db_status|fbsql_drop_db|fbsql_errno|fbsql_error|fbsql_fetch_array|fbsql_fetch_assoc|fbsql_fetch_field|fbsql_fetch_lengths|fbsql_fetch_object|fbsql_fetch_row|fbsql_field_flags|fbsql_field_len|fbsql_field_name|fbsql_field_seek|fbsql_field_table|fbsql_field_type|fbsql_free_result|fbsql_get_autostart_info|fbsql_hostname|fbsql_insert_id|fbsql_list_dbs|fbsql_list_fields|fbsql_list_tables|fbsql_next_result|fbsql_num_fields|fbsql_num_rows|fbsql_password|fbsql_pconnect|fbsql_query|fbsql_read_blob|fbsql_read_clob|fbsql_result|fbsql_rollback|fbsql_rows_fetched|fbsql_select_db|fbsql_set_characterset|fbsql_set_lob_mode|fbsql_set_password|fbsql_set_transaction|fbsql_start_db|fbsql_stop_db|fbsql_table_name|fbsql_tablename|fbsql_username|fbsql_warnings|fclose|fdf_add_doc_javascript|fdf_add_template|fdf_close|fdf_create|fdf_enum_values|fdf_errno|fdf_error|fdf_get_ap|fdf_get_attachment|fdf_get_encoding|fdf_get_file|fdf_get_flags|fdf_get_opt|fdf_get_status|fdf_get_value|fdf_get_version|fdf_header|fdf_next_field_name|fdf_open|fdf_open_string|fdf_remove_item|fdf_save|fdf_save_string|fdf_set_ap|fdf_set_encoding|fdf_set_file|fdf_set_flags|fdf_set_javascript_action|fdf_set_on_import_javascript|fdf_set_opt|fdf_set_status|fdf_set_submit_form_action|fdf_set_target_frame|fdf_set_value|fdf_set_version|feof|fflush|fgetc|fgetcsv|fgets|fgetss|file|file_exists|file_get_contents|file_put_contents|fileatime|filectime|filegroup|fileinode|filemtime|fileowner|fileperms|filepro|filepro_fieldcount|filepro_fieldname|filepro_fieldtype|filepro_fieldwidth|filepro_retrieve|filepro_rowcount|filesize|filesystemiterator|filetype|filter_has_var|filter_id|filter_input|filter_input_array|filter_list|filter_var|filter_var_array|filteriterator|finfo_buffer|finfo_close|finfo_file|finfo_open|finfo_set_flags|floatval|flock|floor|flush|fmod|fnmatch|fopen|forward_static_call|forward_static_call_array|fpassthru|fprintf|fputcsv|fputs|fread|frenchtojd|fribidi_log2vis|fscanf|fseek|fsockopen|fstat|ftell|ftok|ftp_alloc|ftp_cdup|ftp_chdir|ftp_chmod|ftp_close|ftp_connect|ftp_delete|ftp_exec|ftp_fget|ftp_fput|ftp_get|ftp_get_option|ftp_login|ftp_mdtm|ftp_mkdir|ftp_nb_continue|ftp_nb_fget|ftp_nb_fput|ftp_nb_get|ftp_nb_put|ftp_nlist|ftp_pasv|ftp_put|ftp_pwd|ftp_quit|ftp_raw|ftp_rawlist|ftp_rename|ftp_rmdir|ftp_set_option|ftp_site|ftp_size|ftp_ssl_connect|ftp_systype|ftruncate|func_get_arg|func_get_args|func_num_args|function_exists|fwrite|gc_collect_cycles|gc_disable|gc_enable|gc_enabled|gd_info|gearmanclient|gearmanjob|gearmantask|gearmanworker|geoip_continent_code_by_name|geoip_country_code3_by_name|geoip_country_code_by_name|geoip_country_name_by_name|geoip_database_info|geoip_db_avail|geoip_db_filename|geoip_db_get_all_info|geoip_id_by_name|geoip_isp_by_name|geoip_org_by_name|geoip_record_by_name|geoip_region_by_name|geoip_region_name_by_code|geoip_time_zone_by_country_and_region|getMeta|getNamed|getValue|get_browser|get_called_class|get_cfg_var|get_class|get_class_methods|get_class_vars|get_current_user|get_declared_classes|get_declared_interfaces|get_defined_constants|get_defined_functions|get_defined_vars|get_extension_funcs|get_headers|get_html_translation_table|get_include_path|get_included_files|get_loaded_extensions|get_magic_quotes_gpc|get_magic_quotes_runtime|get_meta_tags|get_object_vars|get_parent_class|get_required_files|get_resource_type|getallheaders|getconstant|getconstants|getconstructor|getcwd|getdate|getdefaultproperties|getdoccomment|getendline|getenv|getextension|getextensionname|getfilename|gethostbyaddr|gethostbyname|gethostbynamel|gethostname|getimagesize|getinterfacenames|getinterfaces|getlastmod|getmethod|getmethods|getmodifiers|getmxrr|getmygid|getmyinode|getmypid|getmyuid|getname|getnamespacename|getopt|getparentclass|getproperties|getproperty|getprotobyname|getprotobynumber|getrandmax|getrusage|getservbyname|getservbyport|getshortname|getstartline|getstaticproperties|getstaticpropertyvalue|gettext|gettimeofday|gettype|glob|globiterator|gmagick|gmagickdraw|gmagickpixel|gmdate|gmmktime|gmp_abs|gmp_add|gmp_and|gmp_clrbit|gmp_cmp|gmp_com|gmp_div|gmp_div_q|gmp_div_qr|gmp_div_r|gmp_divexact|gmp_fact|gmp_gcd|gmp_gcdext|gmp_hamdist|gmp_init|gmp_intval|gmp_invert|gmp_jacobi|gmp_legendre|gmp_mod|gmp_mul|gmp_neg|gmp_nextprime|gmp_or|gmp_perfect_square|gmp_popcount|gmp_pow|gmp_powm|gmp_prob_prime|gmp_random|gmp_scan0|gmp_scan1|gmp_setbit|gmp_sign|gmp_sqrt|gmp_sqrtrem|gmp_strval|gmp_sub|gmp_testbit|gmp_xor|gmstrftime|gnupg_adddecryptkey|gnupg_addencryptkey|gnupg_addsignkey|gnupg_cleardecryptkeys|gnupg_clearencryptkeys|gnupg_clearsignkeys|gnupg_decrypt|gnupg_decryptverify|gnupg_encrypt|gnupg_encryptsign|gnupg_export|gnupg_geterror|gnupg_getprotocol|gnupg_import|gnupg_init|gnupg_keyinfo|gnupg_setarmor|gnupg_seterrormode|gnupg_setsignmode|gnupg_sign|gnupg_verify|gopher_parsedir|grapheme_extract|grapheme_stripos|grapheme_stristr|grapheme_strlen|grapheme_strpos|grapheme_strripos|grapheme_strrpos|grapheme_strstr|grapheme_substr|gregoriantojd|gupnp_context_get_host_ip|gupnp_context_get_port|gupnp_context_get_subscription_timeout|gupnp_context_host_path|gupnp_context_new|gupnp_context_set_subscription_timeout|gupnp_context_timeout_add|gupnp_context_unhost_path|gupnp_control_point_browse_start|gupnp_control_point_browse_stop|gupnp_control_point_callback_set|gupnp_control_point_new|gupnp_device_action_callback_set|gupnp_device_info_get|gupnp_device_info_get_service|gupnp_root_device_get_available|gupnp_root_device_get_relative_location|gupnp_root_device_new|gupnp_root_device_set_available|gupnp_root_device_start|gupnp_root_device_stop|gupnp_service_action_get|gupnp_service_action_return|gupnp_service_action_return_error|gupnp_service_action_set|gupnp_service_freeze_notify|gupnp_service_info_get|gupnp_service_info_get_introspection|gupnp_service_introspection_get_state_variable|gupnp_service_notify|gupnp_service_proxy_action_get|gupnp_service_proxy_action_set|gupnp_service_proxy_add_notify|gupnp_service_proxy_callback_set|gupnp_service_proxy_get_subscribed|gupnp_service_proxy_remove_notify|gupnp_service_proxy_set_subscribed|gupnp_service_thaw_notify|gzclose|gzcompress|gzdecode|gzdeflate|gzencode|gzeof|gzfile|gzgetc|gzgets|gzgetss|gzinflate|gzopen|gzpassthru|gzputs|gzread|gzrewind|gzseek|gztell|gzuncompress|gzwrite|halt_compiler|haruannotation|haruannotation_setborderstyle|haruannotation_sethighlightmode|haruannotation_seticon|haruannotation_setopened|harudestination|harudestination_setfit|harudestination_setfitb|harudestination_setfitbh|harudestination_setfitbv|harudestination_setfith|harudestination_setfitr|harudestination_setfitv|harudestination_setxyz|harudoc|harudoc_addpage|harudoc_addpagelabel|harudoc_construct|harudoc_createoutline|harudoc_getcurrentencoder|harudoc_getcurrentpage|harudoc_getencoder|harudoc_getfont|harudoc_getinfoattr|harudoc_getpagelayout|harudoc_getpagemode|harudoc_getstreamsize|harudoc_insertpage|harudoc_loadjpeg|harudoc_loadpng|harudoc_loadraw|harudoc_loadttc|harudoc_loadttf|harudoc_loadtype1|harudoc_output|harudoc_readfromstream|harudoc_reseterror|harudoc_resetstream|harudoc_save|harudoc_savetostream|harudoc_setcompressionmode|harudoc_setcurrentencoder|harudoc_setencryptionmode|harudoc_setinfoattr|harudoc_setinfodateattr|harudoc_setopenaction|harudoc_setpagelayout|harudoc_setpagemode|harudoc_setpagesconfiguration|harudoc_setpassword|harudoc_setpermission|harudoc_usecnsencodings|harudoc_usecnsfonts|harudoc_usecntencodings|harudoc_usecntfonts|harudoc_usejpencodings|harudoc_usejpfonts|harudoc_usekrencodings|harudoc_usekrfonts|haruencoder|haruencoder_getbytetype|haruencoder_gettype|haruencoder_getunicode|haruencoder_getwritingmode|haruexception|harufont|harufont_getascent|harufont_getcapheight|harufont_getdescent|harufont_getencodingname|harufont_getfontname|harufont_gettextwidth|harufont_getunicodewidth|harufont_getxheight|harufont_measuretext|haruimage|haruimage_getbitspercomponent|haruimage_getcolorspace|haruimage_getheight|haruimage_getsize|haruimage_getwidth|haruimage_setcolormask|haruimage_setmaskimage|haruoutline|haruoutline_setdestination|haruoutline_setopened|harupage|harupage_arc|harupage_begintext|harupage_circle|harupage_closepath|harupage_concat|harupage_createdestination|harupage_createlinkannotation|harupage_createtextannotation|harupage_createurlannotation|harupage_curveto|harupage_curveto2|harupage_curveto3|harupage_drawimage|harupage_ellipse|harupage_endpath|harupage_endtext|harupage_eofill|harupage_eofillstroke|harupage_fill|harupage_fillstroke|harupage_getcharspace|harupage_getcmykfill|harupage_getcmykstroke|harupage_getcurrentfont|harupage_getcurrentfontsize|harupage_getcurrentpos|harupage_getcurrenttextpos|harupage_getdash|harupage_getfillingcolorspace|harupage_getflatness|harupage_getgmode|harupage_getgrayfill|harupage_getgraystroke|harupage_getheight|harupage_gethorizontalscaling|harupage_getlinecap|harupage_getlinejoin|harupage_getlinewidth|harupage_getmiterlimit|harupage_getrgbfill|harupage_getrgbstroke|harupage_getstrokingcolorspace|harupage_gettextleading|harupage_gettextmatrix|harupage_gettextrenderingmode|harupage_gettextrise|harupage_gettextwidth|harupage_gettransmatrix|harupage_getwidth|harupage_getwordspace|harupage_lineto|harupage_measuretext|harupage_movetextpos|harupage_moveto|harupage_movetonextline|harupage_rectangle|harupage_setcharspace|harupage_setcmykfill|harupage_setcmykstroke|harupage_setdash|harupage_setflatness|harupage_setfontandsize|harupage_setgrayfill|harupage_setgraystroke|harupage_setheight|harupage_sethorizontalscaling|harupage_setlinecap|harupage_setlinejoin|harupage_setlinewidth|harupage_setmiterlimit|harupage_setrgbfill|harupage_setrgbstroke|harupage_setrotate|harupage_setsize|harupage_setslideshow|harupage_settextleading|harupage_settextmatrix|harupage_settextrenderingmode|harupage_settextrise|harupage_setwidth|harupage_setwordspace|harupage_showtext|harupage_showtextnextline|harupage_stroke|harupage_textout|harupage_textrect|hasconstant|hash|hash_algos|hash_copy|hash_file|hash_final|hash_hmac|hash_hmac_file|hash_init|hash_update|hash_update_file|hash_update_stream|hasmethod|hasproperty|header|header_register_callback|header_remove|headers_list|headers_sent|hebrev|hebrevc|hex2bin|hexdec|highlight_file|highlight_string|html_entity_decode|htmlentities|htmlspecialchars|htmlspecialchars_decode|http_build_cookie|http_build_query|http_build_str|http_build_url|http_cache_etag|http_cache_last_modified|http_chunked_decode|http_date|http_deflate|http_get|http_get_request_body|http_get_request_body_stream|http_get_request_headers|http_head|http_inflate|http_match_etag|http_match_modified|http_match_request_header|http_negotiate_charset|http_negotiate_content_type|http_negotiate_language|http_parse_cookie|http_parse_headers|http_parse_message|http_parse_params|http_persistent_handles_clean|http_persistent_handles_count|http_persistent_handles_ident|http_post_data|http_post_fields|http_put_data|http_put_file|http_put_stream|http_redirect|http_request|http_request_body_encode|http_request_method_exists|http_request_method_name|http_request_method_register|http_request_method_unregister|http_response_code|http_send_content_disposition|http_send_content_type|http_send_data|http_send_file|http_send_last_modified|http_send_status|http_send_stream|http_support|http_throttle|httpdeflatestream|httpdeflatestream_construct|httpdeflatestream_factory|httpdeflatestream_finish|httpdeflatestream_flush|httpdeflatestream_update|httpinflatestream|httpinflatestream_construct|httpinflatestream_factory|httpinflatestream_finish|httpinflatestream_flush|httpinflatestream_update|httpmessage|httpmessage_addheaders|httpmessage_construct|httpmessage_detach|httpmessage_factory|httpmessage_fromenv|httpmessage_fromstring|httpmessage_getbody|httpmessage_getheader|httpmessage_getheaders|httpmessage_gethttpversion|httpmessage_getparentmessage|httpmessage_getrequestmethod|httpmessage_getrequesturl|httpmessage_getresponsecode|httpmessage_getresponsestatus|httpmessage_gettype|httpmessage_guesscontenttype|httpmessage_prepend|httpmessage_reverse|httpmessage_send|httpmessage_setbody|httpmessage_setheaders|httpmessage_sethttpversion|httpmessage_setrequestmethod|httpmessage_setrequesturl|httpmessage_setresponsecode|httpmessage_setresponsestatus|httpmessage_settype|httpmessage_tomessagetypeobject|httpmessage_tostring|httpquerystring|httpquerystring_construct|httpquerystring_get|httpquerystring_mod|httpquerystring_set|httpquerystring_singleton|httpquerystring_toarray|httpquerystring_tostring|httpquerystring_xlate|httprequest|httprequest_addcookies|httprequest_addheaders|httprequest_addpostfields|httprequest_addpostfile|httprequest_addputdata|httprequest_addquerydata|httprequest_addrawpostdata|httprequest_addssloptions|httprequest_clearhistory|httprequest_construct|httprequest_enablecookies|httprequest_getcontenttype|httprequest_getcookies|httprequest_getheaders|httprequest_gethistory|httprequest_getmethod|httprequest_getoptions|httprequest_getpostfields|httprequest_getpostfiles|httprequest_getputdata|httprequest_getputfile|httprequest_getquerydata|httprequest_getrawpostdata|httprequest_getrawrequestmessage|httprequest_getrawresponsemessage|httprequest_getrequestmessage|httprequest_getresponsebody|httprequest_getresponsecode|httprequest_getresponsecookies|httprequest_getresponsedata|httprequest_getresponseheader|httprequest_getresponseinfo|httprequest_getresponsemessage|httprequest_getresponsestatus|httprequest_getssloptions|httprequest_geturl|httprequest_resetcookies|httprequest_send|httprequest_setcontenttype|httprequest_setcookies|httprequest_setheaders|httprequest_setmethod|httprequest_setoptions|httprequest_setpostfields|httprequest_setpostfiles|httprequest_setputdata|httprequest_setputfile|httprequest_setquerydata|httprequest_setrawpostdata|httprequest_setssloptions|httprequest_seturl|httprequestpool|httprequestpool_attach|httprequestpool_construct|httprequestpool_destruct|httprequestpool_detach|httprequestpool_getattachedrequests|httprequestpool_getfinishedrequests|httprequestpool_reset|httprequestpool_send|httprequestpool_socketperform|httprequestpool_socketselect|httpresponse|httpresponse_capture|httpresponse_getbuffersize|httpresponse_getcache|httpresponse_getcachecontrol|httpresponse_getcontentdisposition|httpresponse_getcontenttype|httpresponse_getdata|httpresponse_getetag|httpresponse_getfile|httpresponse_getgzip|httpresponse_getheader|httpresponse_getlastmodified|httpresponse_getrequestbody|httpresponse_getrequestbodystream|httpresponse_getrequestheaders|httpresponse_getstream|httpresponse_getthrottledelay|httpresponse_guesscontenttype|httpresponse_redirect|httpresponse_send|httpresponse_setbuffersize|httpresponse_setcache|httpresponse_setcachecontrol|httpresponse_setcontentdisposition|httpresponse_setcontenttype|httpresponse_setdata|httpresponse_setetag|httpresponse_setfile|httpresponse_setgzip|httpresponse_setheader|httpresponse_setlastmodified|httpresponse_setstream|httpresponse_setthrottledelay|httpresponse_status|hw_array2objrec|hw_changeobject|hw_children|hw_childrenobj|hw_close|hw_connect|hw_connection_info|hw_cp|hw_deleteobject|hw_docbyanchor|hw_docbyanchorobj|hw_document_attributes|hw_document_bodytag|hw_document_content|hw_document_setcontent|hw_document_size|hw_dummy|hw_edittext|hw_error|hw_errormsg|hw_free_document|hw_getanchors|hw_getanchorsobj|hw_getandlock|hw_getchildcoll|hw_getchildcollobj|hw_getchilddoccoll|hw_getchilddoccollobj|hw_getobject|hw_getobjectbyquery|hw_getobjectbyquerycoll|hw_getobjectbyquerycollobj|hw_getobjectbyqueryobj|hw_getparents|hw_getparentsobj|hw_getrellink|hw_getremote|hw_getremotechildren|hw_getsrcbydestobj|hw_gettext|hw_getusername|hw_identify|hw_incollections|hw_info|hw_inscoll|hw_insdoc|hw_insertanchors|hw_insertdocument|hw_insertobject|hw_mapid|hw_modifyobject|hw_mv|hw_new_document|hw_objrec2array|hw_output_document|hw_pconnect|hw_pipedocument|hw_root|hw_setlinkroot|hw_stat|hw_unlock|hw_who|hwapi_attribute|hwapi_attribute_key|hwapi_attribute_langdepvalue|hwapi_attribute_value|hwapi_attribute_values|hwapi_checkin|hwapi_checkout|hwapi_children|hwapi_content|hwapi_content_mimetype|hwapi_content_read|hwapi_copy|hwapi_dbstat|hwapi_dcstat|hwapi_dstanchors|hwapi_dstofsrcanchor|hwapi_error_count|hwapi_error_reason|hwapi_find|hwapi_ftstat|hwapi_hgcsp|hwapi_hwstat|hwapi_identify|hwapi_info|hwapi_insert|hwapi_insertanchor|hwapi_insertcollection|hwapi_insertdocument|hwapi_link|hwapi_lock|hwapi_move|hwapi_new_content|hwapi_object|hwapi_object_assign|hwapi_object_attreditable|hwapi_object_count|hwapi_object_insert|hwapi_object_new|hwapi_object_remove|hwapi_object_title|hwapi_object_value|hwapi_objectbyanchor|hwapi_parents|hwapi_reason_description|hwapi_reason_type|hwapi_remove|hwapi_replace|hwapi_setcommittedversion|hwapi_srcanchors|hwapi_srcsofdst|hwapi_unlock|hwapi_user|hwapi_userlist|hypot|ibase_add_user|ibase_affected_rows|ibase_backup|ibase_blob_add|ibase_blob_cancel|ibase_blob_close|ibase_blob_create|ibase_blob_echo|ibase_blob_get|ibase_blob_import|ibase_blob_info|ibase_blob_open|ibase_close|ibase_commit|ibase_commit_ret|ibase_connect|ibase_db_info|ibase_delete_user|ibase_drop_db|ibase_errcode|ibase_errmsg|ibase_execute|ibase_fetch_assoc|ibase_fetch_object|ibase_fetch_row|ibase_field_info|ibase_free_event_handler|ibase_free_query|ibase_free_result|ibase_gen_id|ibase_maintain_db|ibase_modify_user|ibase_name_result|ibase_num_fields|ibase_num_params|ibase_param_info|ibase_pconnect|ibase_prepare|ibase_query|ibase_restore|ibase_rollback|ibase_rollback_ret|ibase_server_info|ibase_service_attach|ibase_service_detach|ibase_set_event_handler|ibase_timefmt|ibase_trans|ibase_wait_event|iconv|iconv_get_encoding|iconv_mime_decode|iconv_mime_decode_headers|iconv_mime_encode|iconv_set_encoding|iconv_strlen|iconv_strpos|iconv_strrpos|iconv_substr|id3_get_frame_long_name|id3_get_frame_short_name|id3_get_genre_id|id3_get_genre_list|id3_get_genre_name|id3_get_tag|id3_get_version|id3_remove_tag|id3_set_tag|id3v2attachedpictureframe|id3v2frame|id3v2tag|idate|idn_to_ascii|idn_to_unicode|idn_to_utf8|ifx_affected_rows|ifx_blobinfile_mode|ifx_byteasvarchar|ifx_close|ifx_connect|ifx_copy_blob|ifx_create_blob|ifx_create_char|ifx_do|ifx_error|ifx_errormsg|ifx_fetch_row|ifx_fieldproperties|ifx_fieldtypes|ifx_free_blob|ifx_free_char|ifx_free_result|ifx_get_blob|ifx_get_char|ifx_getsqlca|ifx_htmltbl_result|ifx_nullformat|ifx_num_fields|ifx_num_rows|ifx_pconnect|ifx_prepare|ifx_query|ifx_textasvarchar|ifx_update_blob|ifx_update_char|ifxus_close_slob|ifxus_create_slob|ifxus_free_slob|ifxus_open_slob|ifxus_read_slob|ifxus_seek_slob|ifxus_tell_slob|ifxus_write_slob|ignore_user_abort|iis_add_server|iis_get_dir_security|iis_get_script_map|iis_get_server_by_comment|iis_get_server_by_path|iis_get_server_rights|iis_get_service_state|iis_remove_server|iis_set_app_settings|iis_set_dir_security|iis_set_script_map|iis_set_server_rights|iis_start_server|iis_start_service|iis_stop_server|iis_stop_service|image2wbmp|image_type_to_extension|image_type_to_mime_type|imagealphablending|imageantialias|imagearc|imagechar|imagecharup|imagecolorallocate|imagecolorallocatealpha|imagecolorat|imagecolorclosest|imagecolorclosestalpha|imagecolorclosesthwb|imagecolordeallocate|imagecolorexact|imagecolorexactalpha|imagecolormatch|imagecolorresolve|imagecolorresolvealpha|imagecolorset|imagecolorsforindex|imagecolorstotal|imagecolortransparent|imageconvolution|imagecopy|imagecopymerge|imagecopymergegray|imagecopyresampled|imagecopyresized|imagecreate|imagecreatefromgd|imagecreatefromgd2|imagecreatefromgd2part|imagecreatefromgif|imagecreatefromjpeg|imagecreatefrompng|imagecreatefromstring|imagecreatefromwbmp|imagecreatefromxbm|imagecreatefromxpm|imagecreatetruecolor|imagedashedline|imagedestroy|imageellipse|imagefill|imagefilledarc|imagefilledellipse|imagefilledpolygon|imagefilledrectangle|imagefilltoborder|imagefilter|imagefontheight|imagefontwidth|imageftbbox|imagefttext|imagegammacorrect|imagegd|imagegd2|imagegif|imagegrabscreen|imagegrabwindow|imageinterlace|imageistruecolor|imagejpeg|imagelayereffect|imageline|imageloadfont|imagepalettecopy|imagepng|imagepolygon|imagepsbbox|imagepsencodefont|imagepsextendfont|imagepsfreefont|imagepsloadfont|imagepsslantfont|imagepstext|imagerectangle|imagerotate|imagesavealpha|imagesetbrush|imagesetpixel|imagesetstyle|imagesetthickness|imagesettile|imagestring|imagestringup|imagesx|imagesy|imagetruecolortopalette|imagettfbbox|imagettftext|imagetypes|imagewbmp|imagexbm|imagick|imagick_adaptiveblurimage|imagick_adaptiveresizeimage|imagick_adaptivesharpenimage|imagick_adaptivethresholdimage|imagick_addimage|imagick_addnoiseimage|imagick_affinetransformimage|imagick_animateimages|imagick_annotateimage|imagick_appendimages|imagick_averageimages|imagick_blackthresholdimage|imagick_blurimage|imagick_borderimage|imagick_charcoalimage|imagick_chopimage|imagick_clear|imagick_clipimage|imagick_clippathimage|imagick_clone|imagick_clutimage|imagick_coalesceimages|imagick_colorfloodfillimage|imagick_colorizeimage|imagick_combineimages|imagick_commentimage|imagick_compareimagechannels|imagick_compareimagelayers|imagick_compareimages|imagick_compositeimage|imagick_construct|imagick_contrastimage|imagick_contraststretchimage|imagick_convolveimage|imagick_cropimage|imagick_cropthumbnailimage|imagick_current|imagick_cyclecolormapimage|imagick_decipherimage|imagick_deconstructimages|imagick_deleteimageartifact|imagick_despeckleimage|imagick_destroy|imagick_displayimage|imagick_displayimages|imagick_distortimage|imagick_drawimage|imagick_edgeimage|imagick_embossimage|imagick_encipherimage|imagick_enhanceimage|imagick_equalizeimage|imagick_evaluateimage|imagick_extentimage|imagick_flattenimages|imagick_flipimage|imagick_floodfillpaintimage|imagick_flopimage|imagick_frameimage|imagick_fximage|imagick_gammaimage|imagick_gaussianblurimage|imagick_getcolorspace|imagick_getcompression|imagick_getcompressionquality|imagick_getcopyright|imagick_getfilename|imagick_getfont|imagick_getformat|imagick_getgravity|imagick_gethomeurl|imagick_getimage|imagick_getimagealphachannel|imagick_getimageartifact|imagick_getimagebackgroundcolor|imagick_getimageblob|imagick_getimageblueprimary|imagick_getimagebordercolor|imagick_getimagechanneldepth|imagick_getimagechanneldistortion|imagick_getimagechanneldistortions|imagick_getimagechannelextrema|imagick_getimagechannelmean|imagick_getimagechannelrange|imagick_getimagechannelstatistics|imagick_getimageclipmask|imagick_getimagecolormapcolor|imagick_getimagecolors|imagick_getimagecolorspace|imagick_getimagecompose|imagick_getimagecompression|imagick_getimagecompressionquality|imagick_getimagedelay|imagick_getimagedepth|imagick_getimagedispose|imagick_getimagedistortion|imagick_getimageextrema|imagick_getimagefilename|imagick_getimageformat|imagick_getimagegamma|imagick_getimagegeometry|imagick_getimagegravity|imagick_getimagegreenprimary|imagick_getimageheight|imagick_getimagehistogram|imagick_getimageindex|imagick_getimageinterlacescheme|imagick_getimageinterpolatemethod|imagick_getimageiterations|imagick_getimagelength|imagick_getimagemagicklicense|imagick_getimagematte|imagick_getimagemattecolor|imagick_getimageorientation|imagick_getimagepage|imagick_getimagepixelcolor|imagick_getimageprofile|imagick_getimageprofiles|imagick_getimageproperties|imagick_getimageproperty|imagick_getimageredprimary|imagick_getimageregion|imagick_getimagerenderingintent|imagick_getimageresolution|imagick_getimagesblob|imagick_getimagescene|imagick_getimagesignature|imagick_getimagesize|imagick_getimagetickspersecond|imagick_getimagetotalinkdensity|imagick_getimagetype|imagick_getimageunits|imagick_getimagevirtualpixelmethod|imagick_getimagewhitepoint|imagick_getimagewidth|imagick_getinterlacescheme|imagick_getiteratorindex|imagick_getnumberimages|imagick_getoption|imagick_getpackagename|imagick_getpage|imagick_getpixeliterator|imagick_getpixelregioniterator|imagick_getpointsize|imagick_getquantumdepth|imagick_getquantumrange|imagick_getreleasedate|imagick_getresource|imagick_getresourcelimit|imagick_getsamplingfactors|imagick_getsize|imagick_getsizeoffset|imagick_getversion|imagick_hasnextimage|imagick_haspreviousimage|imagick_identifyimage|imagick_implodeimage|imagick_labelimage|imagick_levelimage|imagick_linearstretchimage|imagick_liquidrescaleimage|imagick_magnifyimage|imagick_mapimage|imagick_mattefloodfillimage|imagick_medianfilterimage|imagick_mergeimagelayers|imagick_minifyimage|imagick_modulateimage|imagick_montageimage|imagick_morphimages|imagick_mosaicimages|imagick_motionblurimage|imagick_negateimage|imagick_newimage|imagick_newpseudoimage|imagick_nextimage|imagick_normalizeimage|imagick_oilpaintimage|imagick_opaquepaintimage|imagick_optimizeimagelayers|imagick_orderedposterizeimage|imagick_paintfloodfillimage|imagick_paintopaqueimage|imagick_painttransparentimage|imagick_pingimage|imagick_pingimageblob|imagick_pingimagefile|imagick_polaroidimage|imagick_posterizeimage|imagick_previewimages|imagick_previousimage|imagick_profileimage|imagick_quantizeimage|imagick_quantizeimages|imagick_queryfontmetrics|imagick_queryfonts|imagick_queryformats|imagick_radialblurimage|imagick_raiseimage|imagick_randomthresholdimage|imagick_readimage|imagick_readimageblob|imagick_readimagefile|imagick_recolorimage|imagick_reducenoiseimage|imagick_removeimage|imagick_removeimageprofile|imagick_render|imagick_resampleimage|imagick_resetimagepage|imagick_resizeimage|imagick_rollimage|imagick_rotateimage|imagick_roundcorners|imagick_sampleimage|imagick_scaleimage|imagick_separateimagechannel|imagick_sepiatoneimage|imagick_setbackgroundcolor|imagick_setcolorspace|imagick_setcompression|imagick_setcompressionquality|imagick_setfilename|imagick_setfirstiterator|imagick_setfont|imagick_setformat|imagick_setgravity|imagick_setimage|imagick_setimagealphachannel|imagick_setimageartifact|imagick_setimagebackgroundcolor|imagick_setimagebias|imagick_setimageblueprimary|imagick_setimagebordercolor|imagick_setimagechanneldepth|imagick_setimageclipmask|imagick_setimagecolormapcolor|imagick_setimagecolorspace|imagick_setimagecompose|imagick_setimagecompression|imagick_setimagecompressionquality|imagick_setimagedelay|imagick_setimagedepth|imagick_setimagedispose|imagick_setimageextent|imagick_setimagefilename|imagick_setimageformat|imagick_setimagegamma|imagick_setimagegravity|imagick_setimagegreenprimary|imagick_setimageindex|imagick_setimageinterlacescheme|imagick_setimageinterpolatemethod|imagick_setimageiterations|imagick_setimagematte|imagick_setimagemattecolor|imagick_setimageopacity|imagick_setimageorientation|imagick_setimagepage|imagick_setimageprofile|imagick_setimageproperty|imagick_setimageredprimary|imagick_setimagerenderingintent|imagick_setimageresolution|imagick_setimagescene|imagick_setimagetickspersecond|imagick_setimagetype|imagick_setimageunits|imagick_setimagevirtualpixelmethod|imagick_setimagewhitepoint|imagick_setinterlacescheme|imagick_setiteratorindex|imagick_setlastiterator|imagick_setoption|imagick_setpage|imagick_setpointsize|imagick_setresolution|imagick_setresourcelimit|imagick_setsamplingfactors|imagick_setsize|imagick_setsizeoffset|imagick_settype|imagick_shadeimage|imagick_shadowimage|imagick_sharpenimage|imagick_shaveimage|imagick_shearimage|imagick_sigmoidalcontrastimage|imagick_sketchimage|imagick_solarizeimage|imagick_spliceimage|imagick_spreadimage|imagick_steganoimage|imagick_stereoimage|imagick_stripimage|imagick_swirlimage|imagick_textureimage|imagick_thresholdimage|imagick_thumbnailimage|imagick_tintimage|imagick_transformimage|imagick_transparentpaintimage|imagick_transposeimage|imagick_transverseimage|imagick_trimimage|imagick_uniqueimagecolors|imagick_unsharpmaskimage|imagick_valid|imagick_vignetteimage|imagick_waveimage|imagick_whitethresholdimage|imagick_writeimage|imagick_writeimagefile|imagick_writeimages|imagick_writeimagesfile|imagickdraw|imagickdraw_affine|imagickdraw_annotation|imagickdraw_arc|imagickdraw_bezier|imagickdraw_circle|imagickdraw_clear|imagickdraw_clone|imagickdraw_color|imagickdraw_comment|imagickdraw_composite|imagickdraw_construct|imagickdraw_destroy|imagickdraw_ellipse|imagickdraw_getclippath|imagickdraw_getcliprule|imagickdraw_getclipunits|imagickdraw_getfillcolor|imagickdraw_getfillopacity|imagickdraw_getfillrule|imagickdraw_getfont|imagickdraw_getfontfamily|imagickdraw_getfontsize|imagickdraw_getfontstyle|imagickdraw_getfontweight|imagickdraw_getgravity|imagickdraw_getstrokeantialias|imagickdraw_getstrokecolor|imagickdraw_getstrokedasharray|imagickdraw_getstrokedashoffset|imagickdraw_getstrokelinecap|imagickdraw_getstrokelinejoin|imagickdraw_getstrokemiterlimit|imagickdraw_getstrokeopacity|imagickdraw_getstrokewidth|imagickdraw_gettextalignment|imagickdraw_gettextantialias|imagickdraw_gettextdecoration|imagickdraw_gettextencoding|imagickdraw_gettextundercolor|imagickdraw_getvectorgraphics|imagickdraw_line|imagickdraw_matte|imagickdraw_pathclose|imagickdraw_pathcurvetoabsolute|imagickdraw_pathcurvetoquadraticbezierabsolute|imagickdraw_pathcurvetoquadraticbezierrelative|imagickdraw_pathcurvetoquadraticbeziersmoothabsolute|imagickdraw_pathcurvetoquadraticbeziersmoothrelative|imagickdraw_pathcurvetorelative|imagickdraw_pathcurvetosmoothabsolute|imagickdraw_pathcurvetosmoothrelative|imagickdraw_pathellipticarcabsolute|imagickdraw_pathellipticarcrelative|imagickdraw_pathfinish|imagickdraw_pathlinetoabsolute|imagickdraw_pathlinetohorizontalabsolute|imagickdraw_pathlinetohorizontalrelative|imagickdraw_pathlinetorelative|imagickdraw_pathlinetoverticalabsolute|imagickdraw_pathlinetoverticalrelative|imagickdraw_pathmovetoabsolute|imagickdraw_pathmovetorelative|imagickdraw_pathstart|imagickdraw_point|imagickdraw_polygon|imagickdraw_polyline|imagickdraw_pop|imagickdraw_popclippath|imagickdraw_popdefs|imagickdraw_poppattern|imagickdraw_push|imagickdraw_pushclippath|imagickdraw_pushdefs|imagickdraw_pushpattern|imagickdraw_rectangle|imagickdraw_render|imagickdraw_rotate|imagickdraw_roundrectangle|imagickdraw_scale|imagickdraw_setclippath|imagickdraw_setcliprule|imagickdraw_setclipunits|imagickdraw_setfillalpha|imagickdraw_setfillcolor|imagickdraw_setfillopacity|imagickdraw_setfillpatternurl|imagickdraw_setfillrule|imagickdraw_setfont|imagickdraw_setfontfamily|imagickdraw_setfontsize|imagickdraw_setfontstretch|imagickdraw_setfontstyle|imagickdraw_setfontweight|imagickdraw_setgravity|imagickdraw_setstrokealpha|imagickdraw_setstrokeantialias|imagickdraw_setstrokecolor|imagickdraw_setstrokedasharray|imagickdraw_setstrokedashoffset|imagickdraw_setstrokelinecap|imagickdraw_setstrokelinejoin|imagickdraw_setstrokemiterlimit|imagickdraw_setstrokeopacity|imagickdraw_setstrokepatternurl|imagickdraw_setstrokewidth|imagickdraw_settextalignment|imagickdraw_settextantialias|imagickdraw_settextdecoration|imagickdraw_settextencoding|imagickdraw_settextundercolor|imagickdraw_setvectorgraphics|imagickdraw_setviewbox|imagickdraw_skewx|imagickdraw_skewy|imagickdraw_translate|imagickpixel|imagickpixel_clear|imagickpixel_construct|imagickpixel_destroy|imagickpixel_getcolor|imagickpixel_getcolorasstring|imagickpixel_getcolorcount|imagickpixel_getcolorvalue|imagickpixel_gethsl|imagickpixel_issimilar|imagickpixel_setcolor|imagickpixel_setcolorvalue|imagickpixel_sethsl|imagickpixeliterator|imagickpixeliterator_clear|imagickpixeliterator_construct|imagickpixeliterator_destroy|imagickpixeliterator_getcurrentiteratorrow|imagickpixeliterator_getiteratorrow|imagickpixeliterator_getnextiteratorrow|imagickpixeliterator_getpreviousiteratorrow|imagickpixeliterator_newpixeliterator|imagickpixeliterator_newpixelregioniterator|imagickpixeliterator_resetiterator|imagickpixeliterator_setiteratorfirstrow|imagickpixeliterator_setiteratorlastrow|imagickpixeliterator_setiteratorrow|imagickpixeliterator_synciterator|imap_8bit|imap_alerts|imap_append|imap_base64|imap_binary|imap_body|imap_bodystruct|imap_check|imap_clearflag_full|imap_close|imap_create|imap_createmailbox|imap_delete|imap_deletemailbox|imap_errors|imap_expunge|imap_fetch_overview|imap_fetchbody|imap_fetchheader|imap_fetchmime|imap_fetchstructure|imap_fetchtext|imap_gc|imap_get_quota|imap_get_quotaroot|imap_getacl|imap_getmailboxes|imap_getsubscribed|imap_header|imap_headerinfo|imap_headers|imap_last_error|imap_list|imap_listmailbox|imap_listscan|imap_listsubscribed|imap_lsub|imap_mail|imap_mail_compose|imap_mail_copy|imap_mail_move|imap_mailboxmsginfo|imap_mime_header_decode|imap_msgno|imap_num_msg|imap_num_recent|imap_open|imap_ping|imap_qprint|imap_rename|imap_renamemailbox|imap_reopen|imap_rfc822_parse_adrlist|imap_rfc822_parse_headers|imap_rfc822_write_address|imap_savebody|imap_scan|imap_scanmailbox|imap_search|imap_set_quota|imap_setacl|imap_setflag_full|imap_sort|imap_status|imap_subscribe|imap_thread|imap_timeout|imap_uid|imap_undelete|imap_unsubscribe|imap_utf7_decode|imap_utf7_encode|imap_utf8|implementsinterface|implode|import_request_variables|in_array|include|include_once|inclued_get_data|inet_ntop|inet_pton|infiniteiterator|ingres_autocommit|ingres_autocommit_state|ingres_charset|ingres_close|ingres_commit|ingres_connect|ingres_cursor|ingres_errno|ingres_error|ingres_errsqlstate|ingres_escape_string|ingres_execute|ingres_fetch_array|ingres_fetch_assoc|ingres_fetch_object|ingres_fetch_proc_return|ingres_fetch_row|ingres_field_length|ingres_field_name|ingres_field_nullable|ingres_field_precision|ingres_field_scale|ingres_field_type|ingres_free_result|ingres_next_error|ingres_num_fields|ingres_num_rows|ingres_pconnect|ingres_prepare|ingres_query|ingres_result_seek|ingres_rollback|ingres_set_environment|ingres_unbuffered_query|ini_alter|ini_get|ini_get_all|ini_restore|ini_set|innamespace|inotify_add_watch|inotify_init|inotify_queue_len|inotify_read|inotify_rm_watch|interface_exists|intl_error_name|intl_get_error_code|intl_get_error_message|intl_is_failure|intldateformatter|intval|invalidargumentexception|invoke|invokeargs|ip2long|iptcembed|iptcparse|is_a|is_array|is_bool|is_callable|is_dir|is_double|is_executable|is_file|is_finite|is_float|is_infinite|is_int|is_integer|is_link|is_long|is_nan|is_null|is_numeric|is_object|is_readable|is_real|is_resource|is_scalar|is_soap_fault|is_string|is_subclass_of|is_uploaded_file|is_writable|is_writeable|isabstract|iscloneable|isdisabled|isfinal|isinstance|isinstantiable|isinterface|isinternal|isiterateable|isset|issubclassof|isuserdefined|iterator|iterator_apply|iterator_count|iterator_to_array|iteratoraggregate|iteratoriterator|java_last_exception_clear|java_last_exception_get|jddayofweek|jdmonthname|jdtofrench|jdtogregorian|jdtojewish|jdtojulian|jdtounix|jewishtojd|join|jpeg2wbmp|json_decode|json_encode|json_last_error|jsonserializable|judy|judy_type|judy_version|juliantojd|kadm5_chpass_principal|kadm5_create_principal|kadm5_delete_principal|kadm5_destroy|kadm5_flush|kadm5_get_policies|kadm5_get_principal|kadm5_get_principals|kadm5_init_with_password|kadm5_modify_principal|key|krsort|ksort|lcfirst|lcg_value|lchgrp|lchown|ldap_8859_to_t61|ldap_add|ldap_bind|ldap_close|ldap_compare|ldap_connect|ldap_count_entries|ldap_delete|ldap_dn2ufn|ldap_err2str|ldap_errno|ldap_error|ldap_explode_dn|ldap_first_attribute|ldap_first_entry|ldap_first_reference|ldap_free_result|ldap_get_attributes|ldap_get_dn|ldap_get_entries|ldap_get_option|ldap_get_values|ldap_get_values_len|ldap_list|ldap_mod_add|ldap_mod_del|ldap_mod_replace|ldap_modify|ldap_next_attribute|ldap_next_entry|ldap_next_reference|ldap_parse_reference|ldap_parse_result|ldap_read|ldap_rename|ldap_sasl_bind|ldap_search|ldap_set_option|ldap_set_rebind_proc|ldap_sort|ldap_start_tls|ldap_t61_to_8859|ldap_unbind|lengthexception|levenshtein|libxml_clear_errors|libxml_disable_entity_loader|libxml_get_errors|libxml_get_last_error|libxml_set_streams_context|libxml_use_internal_errors|libxmlerror|limititerator|link|linkinfo|list|locale|localeconv|localtime|log|log10|log1p|logicexception|long2ip|lstat|ltrim|lzf_compress|lzf_decompress|lzf_optimized_for|m_checkstatus|m_completeauthorizations|m_connect|m_connectionerror|m_deletetrans|m_destroyconn|m_destroyengine|m_getcell|m_getcellbynum|m_getcommadelimited|m_getheader|m_initconn|m_initengine|m_iscommadelimited|m_maxconntimeout|m_monitor|m_numcolumns|m_numrows|m_parsecommadelimited|m_responsekeys|m_responseparam|m_returnstatus|m_setblocking|m_setdropfile|m_setip|m_setssl|m_setssl_cafile|m_setssl_files|m_settimeout|m_sslcert_gen_hash|m_transactionssent|m_transinqueue|m_transkeyval|m_transnew|m_transsend|m_uwait|m_validateidentifier|m_verifyconnection|m_verifysslcert|magic_quotes_runtime|mail|mailparse_determine_best_xfer_encoding|mailparse_msg_create|mailparse_msg_extract_part|mailparse_msg_extract_part_file|mailparse_msg_extract_whole_part_file|mailparse_msg_free|mailparse_msg_get_part|mailparse_msg_get_part_data|mailparse_msg_get_structure|mailparse_msg_parse|mailparse_msg_parse_file|mailparse_rfc822_parse_addresses|mailparse_stream_encode|mailparse_uudecode_all|main|max|maxdb_affected_rows|maxdb_autocommit|maxdb_bind_param|maxdb_bind_result|maxdb_change_user|maxdb_character_set_name|maxdb_client_encoding|maxdb_close|maxdb_close_long_data|maxdb_commit|maxdb_connect|maxdb_connect_errno|maxdb_connect_error|maxdb_data_seek|maxdb_debug|maxdb_disable_reads_from_master|maxdb_disable_rpl_parse|maxdb_dump_debug_info|maxdb_embedded_connect|maxdb_enable_reads_from_master|maxdb_enable_rpl_parse|maxdb_errno|maxdb_error|maxdb_escape_string|maxdb_execute|maxdb_fetch|maxdb_fetch_array|maxdb_fetch_assoc|maxdb_fetch_field|maxdb_fetch_field_direct|maxdb_fetch_fields|maxdb_fetch_lengths|maxdb_fetch_object|maxdb_fetch_row|maxdb_field_count|maxdb_field_seek|maxdb_field_tell|maxdb_free_result|maxdb_get_client_info|maxdb_get_client_version|maxdb_get_host_info|maxdb_get_metadata|maxdb_get_proto_info|maxdb_get_server_info|maxdb_get_server_version|maxdb_info|maxdb_init|maxdb_insert_id|maxdb_kill|maxdb_master_query|maxdb_more_results|maxdb_multi_query|maxdb_next_result|maxdb_num_fields|maxdb_num_rows|maxdb_options|maxdb_param_count|maxdb_ping|maxdb_prepare|maxdb_query|maxdb_real_connect|maxdb_real_escape_string|maxdb_real_query|maxdb_report|maxdb_rollback|maxdb_rpl_parse_enabled|maxdb_rpl_probe|maxdb_rpl_query_type|maxdb_select_db|maxdb_send_long_data|maxdb_send_query|maxdb_server_end|maxdb_server_init|maxdb_set_opt|maxdb_sqlstate|maxdb_ssl_set|maxdb_stat|maxdb_stmt_affected_rows|maxdb_stmt_bind_param|maxdb_stmt_bind_result|maxdb_stmt_close|maxdb_stmt_close_long_data|maxdb_stmt_data_seek|maxdb_stmt_errno|maxdb_stmt_error|maxdb_stmt_execute|maxdb_stmt_fetch|maxdb_stmt_free_result|maxdb_stmt_init|maxdb_stmt_num_rows|maxdb_stmt_param_count|maxdb_stmt_prepare|maxdb_stmt_reset|maxdb_stmt_result_metadata|maxdb_stmt_send_long_data|maxdb_stmt_sqlstate|maxdb_stmt_store_result|maxdb_store_result|maxdb_thread_id|maxdb_thread_safe|maxdb_use_result|maxdb_warning_count|mb_check_encoding|mb_convert_case|mb_convert_encoding|mb_convert_kana|mb_convert_variables|mb_decode_mimeheader|mb_decode_numericentity|mb_detect_encoding|mb_detect_order|mb_encode_mimeheader|mb_encode_numericentity|mb_encoding_aliases|mb_ereg|mb_ereg_match|mb_ereg_replace|mb_ereg_search|mb_ereg_search_getpos|mb_ereg_search_getregs|mb_ereg_search_init|mb_ereg_search_pos|mb_ereg_search_regs|mb_ereg_search_setpos|mb_eregi|mb_eregi_replace|mb_get_info|mb_http_input|mb_http_output|mb_internal_encoding|mb_language|mb_list_encodings|mb_output_handler|mb_parse_str|mb_preferred_mime_name|mb_regex_encoding|mb_regex_set_options|mb_send_mail|mb_split|mb_strcut|mb_strimwidth|mb_stripos|mb_stristr|mb_strlen|mb_strpos|mb_strrchr|mb_strrichr|mb_strripos|mb_strrpos|mb_strstr|mb_strtolower|mb_strtoupper|mb_strwidth|mb_substitute_character|mb_substr|mb_substr_count|mcrypt_cbc|mcrypt_cfb|mcrypt_create_iv|mcrypt_decrypt|mcrypt_ecb|mcrypt_enc_get_algorithms_name|mcrypt_enc_get_block_size|mcrypt_enc_get_iv_size|mcrypt_enc_get_key_size|mcrypt_enc_get_modes_name|mcrypt_enc_get_supported_key_sizes|mcrypt_enc_is_block_algorithm|mcrypt_enc_is_block_algorithm_mode|mcrypt_enc_is_block_mode|mcrypt_enc_self_test|mcrypt_encrypt|mcrypt_generic|mcrypt_generic_deinit|mcrypt_generic_end|mcrypt_generic_init|mcrypt_get_block_size|mcrypt_get_cipher_name|mcrypt_get_iv_size|mcrypt_get_key_size|mcrypt_list_algorithms|mcrypt_list_modes|mcrypt_module_close|mcrypt_module_get_algo_block_size|mcrypt_module_get_algo_key_size|mcrypt_module_get_supported_key_sizes|mcrypt_module_is_block_algorithm|mcrypt_module_is_block_algorithm_mode|mcrypt_module_is_block_mode|mcrypt_module_open|mcrypt_module_self_test|mcrypt_ofb|md5|md5_file|mdecrypt_generic|memcache|memcache_debug|memcached|memory_get_peak_usage|memory_get_usage|messageformatter|metaphone|method_exists|mhash|mhash_count|mhash_get_block_size|mhash_get_hash_name|mhash_keygen_s2k|microtime|mime_content_type|min|ming_keypress|ming_setcubicthreshold|ming_setscale|ming_setswfcompression|ming_useconstants|ming_useswfversion|mkdir|mktime|money_format|mongo|mongobindata|mongocode|mongocollection|mongoconnectionexception|mongocursor|mongocursorexception|mongocursortimeoutexception|mongodate|mongodb|mongodbref|mongoexception|mongogridfs|mongogridfscursor|mongogridfsexception|mongogridfsfile|mongoid|mongoint32|mongoint64|mongomaxkey|mongominkey|mongoregex|mongotimestamp|move_uploaded_file|mpegfile|mqseries_back|mqseries_begin|mqseries_close|mqseries_cmit|mqseries_conn|mqseries_connx|mqseries_disc|mqseries_get|mqseries_inq|mqseries_open|mqseries_put|mqseries_put1|mqseries_set|mqseries_strerror|msession_connect|msession_count|msession_create|msession_destroy|msession_disconnect|msession_find|msession_get|msession_get_array|msession_get_data|msession_inc|msession_list|msession_listvar|msession_lock|msession_plugin|msession_randstr|msession_set|msession_set_array|msession_set_data|msession_timeout|msession_uniq|msession_unlock|msg_get_queue|msg_queue_exists|msg_receive|msg_remove_queue|msg_send|msg_set_queue|msg_stat_queue|msql|msql_affected_rows|msql_close|msql_connect|msql_create_db|msql_createdb|msql_data_seek|msql_db_query|msql_dbname|msql_drop_db|msql_error|msql_fetch_array|msql_fetch_field|msql_fetch_object|msql_fetch_row|msql_field_flags|msql_field_len|msql_field_name|msql_field_seek|msql_field_table|msql_field_type|msql_fieldflags|msql_fieldlen|msql_fieldname|msql_fieldtable|msql_fieldtype|msql_free_result|msql_list_dbs|msql_list_fields|msql_list_tables|msql_num_fields|msql_num_rows|msql_numfields|msql_numrows|msql_pconnect|msql_query|msql_regcase|msql_result|msql_select_db|msql_tablename|mssql_bind|mssql_close|mssql_connect|mssql_data_seek|mssql_execute|mssql_fetch_array|mssql_fetch_assoc|mssql_fetch_batch|mssql_fetch_field|mssql_fetch_object|mssql_fetch_row|mssql_field_length|mssql_field_name|mssql_field_seek|mssql_field_type|mssql_free_result|mssql_free_statement|mssql_get_last_message|mssql_guid_string|mssql_init|mssql_min_error_severity|mssql_min_message_severity|mssql_next_result|mssql_num_fields|mssql_num_rows|mssql_pconnect|mssql_query|mssql_result|mssql_rows_affected|mssql_select_db|mt_getrandmax|mt_rand|mt_srand|multipleiterator|mysql_affected_rows|mysql_client_encoding|mysql_close|mysql_connect|mysql_create_db|mysql_data_seek|mysql_db_name|mysql_db_query|mysql_drop_db|mysql_errno|mysql_error|mysql_escape_string|mysql_fetch_array|mysql_fetch_assoc|mysql_fetch_field|mysql_fetch_lengths|mysql_fetch_object|mysql_fetch_row|mysql_field_flags|mysql_field_len|mysql_field_name|mysql_field_seek|mysql_field_table|mysql_field_type|mysql_free_result|mysql_get_client_info|mysql_get_host_info|mysql_get_proto_info|mysql_get_server_info|mysql_info|mysql_insert_id|mysql_list_dbs|mysql_list_fields|mysql_list_processes|mysql_list_tables|mysql_num_fields|mysql_num_rows|mysql_pconnect|mysql_ping|mysql_query|mysql_real_escape_string|mysql_result|mysql_select_db|mysql_set_charset|mysql_stat|mysql_tablename|mysql_thread_id|mysql_unbuffered_query|mysqli|mysqli_bind_param|mysqli_bind_result|mysqli_client_encoding|mysqli_connect|mysqli_disable_reads_from_master|mysqli_disable_rpl_parse|mysqli_driver|mysqli_enable_reads_from_master|mysqli_enable_rpl_parse|mysqli_escape_string|mysqli_execute|mysqli_fetch|mysqli_get_metadata|mysqli_master_query|mysqli_param_count|mysqli_report|mysqli_result|mysqli_rpl_parse_enabled|mysqli_rpl_probe|mysqli_rpl_query_type|mysqli_send_long_data|mysqli_send_query|mysqli_set_opt|mysqli_slave_query|mysqli_stmt|mysqli_warning|mysqlnd_ms_get_stats|mysqlnd_ms_query_is_select|mysqlnd_ms_set_user_pick_server|mysqlnd_qc_change_handler|mysqlnd_qc_clear_cache|mysqlnd_qc_get_cache_info|mysqlnd_qc_get_core_stats|mysqlnd_qc_get_handler|mysqlnd_qc_get_query_trace_log|mysqlnd_qc_set_user_handlers|natcasesort|natsort|ncurses_addch|ncurses_addchnstr|ncurses_addchstr|ncurses_addnstr|ncurses_addstr|ncurses_assume_default_colors|ncurses_attroff|ncurses_attron|ncurses_attrset|ncurses_baudrate|ncurses_beep|ncurses_bkgd|ncurses_bkgdset|ncurses_border|ncurses_bottom_panel|ncurses_can_change_color|ncurses_cbreak|ncurses_clear|ncurses_clrtobot|ncurses_clrtoeol|ncurses_color_content|ncurses_color_set|ncurses_curs_set|ncurses_def_prog_mode|ncurses_def_shell_mode|ncurses_define_key|ncurses_del_panel|ncurses_delay_output|ncurses_delch|ncurses_deleteln|ncurses_delwin|ncurses_doupdate|ncurses_echo|ncurses_echochar|ncurses_end|ncurses_erase|ncurses_erasechar|ncurses_filter|ncurses_flash|ncurses_flushinp|ncurses_getch|ncurses_getmaxyx|ncurses_getmouse|ncurses_getyx|ncurses_halfdelay|ncurses_has_colors|ncurses_has_ic|ncurses_has_il|ncurses_has_key|ncurses_hide_panel|ncurses_hline|ncurses_inch|ncurses_init|ncurses_init_color|ncurses_init_pair|ncurses_insch|ncurses_insdelln|ncurses_insertln|ncurses_insstr|ncurses_instr|ncurses_isendwin|ncurses_keyok|ncurses_keypad|ncurses_killchar|ncurses_longname|ncurses_meta|ncurses_mouse_trafo|ncurses_mouseinterval|ncurses_mousemask|ncurses_move|ncurses_move_panel|ncurses_mvaddch|ncurses_mvaddchnstr|ncurses_mvaddchstr|ncurses_mvaddnstr|ncurses_mvaddstr|ncurses_mvcur|ncurses_mvdelch|ncurses_mvgetch|ncurses_mvhline|ncurses_mvinch|ncurses_mvvline|ncurses_mvwaddstr|ncurses_napms|ncurses_new_panel|ncurses_newpad|ncurses_newwin|ncurses_nl|ncurses_nocbreak|ncurses_noecho|ncurses_nonl|ncurses_noqiflush|ncurses_noraw|ncurses_pair_content|ncurses_panel_above|ncurses_panel_below|ncurses_panel_window|ncurses_pnoutrefresh|ncurses_prefresh|ncurses_putp|ncurses_qiflush|ncurses_raw|ncurses_refresh|ncurses_replace_panel|ncurses_reset_prog_mode|ncurses_reset_shell_mode|ncurses_resetty|ncurses_savetty|ncurses_scr_dump|ncurses_scr_init|ncurses_scr_restore|ncurses_scr_set|ncurses_scrl|ncurses_show_panel|ncurses_slk_attr|ncurses_slk_attroff|ncurses_slk_attron|ncurses_slk_attrset|ncurses_slk_clear|ncurses_slk_color|ncurses_slk_init|ncurses_slk_noutrefresh|ncurses_slk_refresh|ncurses_slk_restore|ncurses_slk_set|ncurses_slk_touch|ncurses_standend|ncurses_standout|ncurses_start_color|ncurses_termattrs|ncurses_termname|ncurses_timeout|ncurses_top_panel|ncurses_typeahead|ncurses_ungetch|ncurses_ungetmouse|ncurses_update_panels|ncurses_use_default_colors|ncurses_use_env|ncurses_use_extended_names|ncurses_vidattr|ncurses_vline|ncurses_waddch|ncurses_waddstr|ncurses_wattroff|ncurses_wattron|ncurses_wattrset|ncurses_wborder|ncurses_wclear|ncurses_wcolor_set|ncurses_werase|ncurses_wgetch|ncurses_whline|ncurses_wmouse_trafo|ncurses_wmove|ncurses_wnoutrefresh|ncurses_wrefresh|ncurses_wstandend|ncurses_wstandout|ncurses_wvline|newinstance|newinstanceargs|newt_bell|newt_button|newt_button_bar|newt_centered_window|newt_checkbox|newt_checkbox_get_value|newt_checkbox_set_flags|newt_checkbox_set_value|newt_checkbox_tree|newt_checkbox_tree_add_item|newt_checkbox_tree_find_item|newt_checkbox_tree_get_current|newt_checkbox_tree_get_entry_value|newt_checkbox_tree_get_multi_selection|newt_checkbox_tree_get_selection|newt_checkbox_tree_multi|newt_checkbox_tree_set_current|newt_checkbox_tree_set_entry|newt_checkbox_tree_set_entry_value|newt_checkbox_tree_set_width|newt_clear_key_buffer|newt_cls|newt_compact_button|newt_component_add_callback|newt_component_takes_focus|newt_create_grid|newt_cursor_off|newt_cursor_on|newt_delay|newt_draw_form|newt_draw_root_text|newt_entry|newt_entry_get_value|newt_entry_set|newt_entry_set_filter|newt_entry_set_flags|newt_finished|newt_form|newt_form_add_component|newt_form_add_components|newt_form_add_hot_key|newt_form_destroy|newt_form_get_current|newt_form_run|newt_form_set_background|newt_form_set_height|newt_form_set_size|newt_form_set_timer|newt_form_set_width|newt_form_watch_fd|newt_get_screen_size|newt_grid_add_components_to_form|newt_grid_basic_window|newt_grid_free|newt_grid_get_size|newt_grid_h_close_stacked|newt_grid_h_stacked|newt_grid_place|newt_grid_set_field|newt_grid_simple_window|newt_grid_v_close_stacked|newt_grid_v_stacked|newt_grid_wrapped_window|newt_grid_wrapped_window_at|newt_init|newt_label|newt_label_set_text|newt_listbox|newt_listbox_append_entry|newt_listbox_clear|newt_listbox_clear_selection|newt_listbox_delete_entry|newt_listbox_get_current|newt_listbox_get_selection|newt_listbox_insert_entry|newt_listbox_item_count|newt_listbox_select_item|newt_listbox_set_current|newt_listbox_set_current_by_key|newt_listbox_set_data|newt_listbox_set_entry|newt_listbox_set_width|newt_listitem|newt_listitem_get_data|newt_listitem_set|newt_open_window|newt_pop_help_line|newt_pop_window|newt_push_help_line|newt_radio_get_current|newt_radiobutton|newt_redraw_help_line|newt_reflow_text|newt_refresh|newt_resize_screen|newt_resume|newt_run_form|newt_scale|newt_scale_set|newt_scrollbar_set|newt_set_help_callback|newt_set_suspend_callback|newt_suspend|newt_textbox|newt_textbox_get_num_lines|newt_textbox_reflowed|newt_textbox_set_height|newt_textbox_set_text|newt_vertical_scrollbar|newt_wait_for_key|newt_win_choice|newt_win_entries|newt_win_menu|newt_win_message|newt_win_messagev|newt_win_ternary|next|ngettext|nl2br|nl_langinfo|norewinditerator|normalizer|notes_body|notes_copy_db|notes_create_db|notes_create_note|notes_drop_db|notes_find_note|notes_header_info|notes_list_msgs|notes_mark_read|notes_mark_unread|notes_nav_create|notes_search|notes_unread|notes_version|nsapi_request_headers|nsapi_response_headers|nsapi_virtual|nthmac|number_format|numberformatter|oauth|oauth_get_sbs|oauth_urlencode|oauthexception|oauthprovider|ob_clean|ob_deflatehandler|ob_end_clean|ob_end_flush|ob_etaghandler|ob_flush|ob_get_clean|ob_get_contents|ob_get_flush|ob_get_length|ob_get_level|ob_get_status|ob_gzhandler|ob_iconv_handler|ob_implicit_flush|ob_inflatehandler|ob_list_handlers|ob_start|ob_tidyhandler|oci_bind_array_by_name|oci_bind_by_name|oci_cancel|oci_client_version|oci_close|oci_collection_append|oci_collection_assign|oci_collection_element_assign|oci_collection_element_get|oci_collection_free|oci_collection_max|oci_collection_size|oci_collection_trim|oci_commit|oci_connect|oci_define_by_name|oci_error|oci_execute|oci_fetch|oci_fetch_all|oci_fetch_array|oci_fetch_assoc|oci_fetch_object|oci_fetch_row|oci_field_is_null|oci_field_name|oci_field_precision|oci_field_scale|oci_field_size|oci_field_type|oci_field_type_raw|oci_free_statement|oci_internal_debug|oci_lob_append|oci_lob_close|oci_lob_copy|oci_lob_eof|oci_lob_erase|oci_lob_export|oci_lob_flush|oci_lob_free|oci_lob_getbuffering|oci_lob_import|oci_lob_is_equal|oci_lob_load|oci_lob_read|oci_lob_rewind|oci_lob_save|oci_lob_savefile|oci_lob_seek|oci_lob_setbuffering|oci_lob_size|oci_lob_tell|oci_lob_truncate|oci_lob_write|oci_lob_writetemporary|oci_lob_writetofile|oci_new_collection|oci_new_connect|oci_new_cursor|oci_new_descriptor|oci_num_fields|oci_num_rows|oci_parse|oci_password_change|oci_pconnect|oci_result|oci_rollback|oci_server_version|oci_set_action|oci_set_client_identifier|oci_set_client_info|oci_set_edition|oci_set_module_name|oci_set_prefetch|oci_statement_type|ocibindbyname|ocicancel|ocicloselob|ocicollappend|ocicollassign|ocicollassignelem|ocicollgetelem|ocicollmax|ocicollsize|ocicolltrim|ocicolumnisnull|ocicolumnname|ocicolumnprecision|ocicolumnscale|ocicolumnsize|ocicolumntype|ocicolumntyperaw|ocicommit|ocidefinebyname|ocierror|ociexecute|ocifetch|ocifetchinto|ocifetchstatement|ocifreecollection|ocifreecursor|ocifreedesc|ocifreestatement|ociinternaldebug|ociloadlob|ocilogoff|ocilogon|ocinewcollection|ocinewcursor|ocinewdescriptor|ocinlogon|ocinumcols|ociparse|ociplogon|ociresult|ocirollback|ocirowcount|ocisavelob|ocisavelobfile|ociserverversion|ocisetprefetch|ocistatementtype|ociwritelobtofile|ociwritetemporarylob|octdec|odbc_autocommit|odbc_binmode|odbc_close|odbc_close_all|odbc_columnprivileges|odbc_columns|odbc_commit|odbc_connect|odbc_cursor|odbc_data_source|odbc_do|odbc_error|odbc_errormsg|odbc_exec|odbc_execute|odbc_fetch_array|odbc_fetch_into|odbc_fetch_object|odbc_fetch_row|odbc_field_len|odbc_field_name|odbc_field_num|odbc_field_precision|odbc_field_scale|odbc_field_type|odbc_foreignkeys|odbc_free_result|odbc_gettypeinfo|odbc_longreadlen|odbc_next_result|odbc_num_fields|odbc_num_rows|odbc_pconnect|odbc_prepare|odbc_primarykeys|odbc_procedurecolumns|odbc_procedures|odbc_result|odbc_result_all|odbc_rollback|odbc_setoption|odbc_specialcolumns|odbc_statistics|odbc_tableprivileges|odbc_tables|openal_buffer_create|openal_buffer_data|openal_buffer_destroy|openal_buffer_get|openal_buffer_loadwav|openal_context_create|openal_context_current|openal_context_destroy|openal_context_process|openal_context_suspend|openal_device_close|openal_device_open|openal_listener_get|openal_listener_set|openal_source_create|openal_source_destroy|openal_source_get|openal_source_pause|openal_source_play|openal_source_rewind|openal_source_set|openal_source_stop|openal_stream|opendir|openlog|openssl_cipher_iv_length|openssl_csr_export|openssl_csr_export_to_file|openssl_csr_get_public_key|openssl_csr_get_subject|openssl_csr_new|openssl_csr_sign|openssl_decrypt|openssl_dh_compute_key|openssl_digest|openssl_encrypt|openssl_error_string|openssl_free_key|openssl_get_cipher_methods|openssl_get_md_methods|openssl_get_privatekey|openssl_get_publickey|openssl_open|openssl_pkcs12_export|openssl_pkcs12_export_to_file|openssl_pkcs12_read|openssl_pkcs7_decrypt|openssl_pkcs7_encrypt|openssl_pkcs7_sign|openssl_pkcs7_verify|openssl_pkey_export|openssl_pkey_export_to_file|openssl_pkey_free|openssl_pkey_get_details|openssl_pkey_get_private|openssl_pkey_get_public|openssl_pkey_new|openssl_private_decrypt|openssl_private_encrypt|openssl_public_decrypt|openssl_public_encrypt|openssl_random_pseudo_bytes|openssl_seal|openssl_sign|openssl_verify|openssl_x509_check_private_key|openssl_x509_checkpurpose|openssl_x509_export|openssl_x509_export_to_file|openssl_x509_free|openssl_x509_parse|openssl_x509_read|ord|outeriterator|outofboundsexception|outofrangeexception|output_add_rewrite_var|output_reset_rewrite_vars|overflowexception|overload|override_function|ovrimos_close|ovrimos_commit|ovrimos_connect|ovrimos_cursor|ovrimos_exec|ovrimos_execute|ovrimos_fetch_into|ovrimos_fetch_row|ovrimos_field_len|ovrimos_field_name|ovrimos_field_num|ovrimos_field_type|ovrimos_free_result|ovrimos_longreadlen|ovrimos_num_fields|ovrimos_num_rows|ovrimos_prepare|ovrimos_result|ovrimos_result_all|ovrimos_rollback|pack|parentiterator|parse_ini_file|parse_ini_string|parse_str|parse_url|parsekit_compile_file|parsekit_compile_string|parsekit_func_arginfo|passthru|pathinfo|pclose|pcntl_alarm|pcntl_exec|pcntl_fork|pcntl_getpriority|pcntl_setpriority|pcntl_signal|pcntl_signal_dispatch|pcntl_sigprocmask|pcntl_sigtimedwait|pcntl_sigwaitinfo|pcntl_wait|pcntl_waitpid|pcntl_wexitstatus|pcntl_wifexited|pcntl_wifsignaled|pcntl_wifstopped|pcntl_wstopsig|pcntl_wtermsig|pdf_activate_item|pdf_add_annotation|pdf_add_bookmark|pdf_add_launchlink|pdf_add_locallink|pdf_add_nameddest|pdf_add_note|pdf_add_outline|pdf_add_pdflink|pdf_add_table_cell|pdf_add_textflow|pdf_add_thumbnail|pdf_add_weblink|pdf_arc|pdf_arcn|pdf_attach_file|pdf_begin_document|pdf_begin_font|pdf_begin_glyph|pdf_begin_item|pdf_begin_layer|pdf_begin_page|pdf_begin_page_ext|pdf_begin_pattern|pdf_begin_template|pdf_begin_template_ext|pdf_circle|pdf_clip|pdf_close|pdf_close_image|pdf_close_pdi|pdf_close_pdi_page|pdf_closepath|pdf_closepath_fill_stroke|pdf_closepath_stroke|pdf_concat|pdf_continue_text|pdf_create_3dview|pdf_create_action|pdf_create_annotation|pdf_create_bookmark|pdf_create_field|pdf_create_fieldgroup|pdf_create_gstate|pdf_create_pvf|pdf_create_textflow|pdf_curveto|pdf_define_layer|pdf_delete|pdf_delete_pvf|pdf_delete_table|pdf_delete_textflow|pdf_encoding_set_char|pdf_end_document|pdf_end_font|pdf_end_glyph|pdf_end_item|pdf_end_layer|pdf_end_page|pdf_end_page_ext|pdf_end_pattern|pdf_end_template|pdf_endpath|pdf_fill|pdf_fill_imageblock|pdf_fill_pdfblock|pdf_fill_stroke|pdf_fill_textblock|pdf_findfont|pdf_fit_image|pdf_fit_pdi_page|pdf_fit_table|pdf_fit_textflow|pdf_fit_textline|pdf_get_apiname|pdf_get_buffer|pdf_get_errmsg|pdf_get_errnum|pdf_get_font|pdf_get_fontname|pdf_get_fontsize|pdf_get_image_height|pdf_get_image_width|pdf_get_majorversion|pdf_get_minorversion|pdf_get_parameter|pdf_get_pdi_parameter|pdf_get_pdi_value|pdf_get_value|pdf_info_font|pdf_info_matchbox|pdf_info_table|pdf_info_textflow|pdf_info_textline|pdf_initgraphics|pdf_lineto|pdf_load_3ddata|pdf_load_font|pdf_load_iccprofile|pdf_load_image|pdf_makespotcolor|pdf_moveto|pdf_new|pdf_open_ccitt|pdf_open_file|pdf_open_gif|pdf_open_image|pdf_open_image_file|pdf_open_jpeg|pdf_open_memory_image|pdf_open_pdi|pdf_open_pdi_document|pdf_open_pdi_page|pdf_open_tiff|pdf_pcos_get_number|pdf_pcos_get_stream|pdf_pcos_get_string|pdf_place_image|pdf_place_pdi_page|pdf_process_pdi|pdf_rect|pdf_restore|pdf_resume_page|pdf_rotate|pdf_save|pdf_scale|pdf_set_border_color|pdf_set_border_dash|pdf_set_border_style|pdf_set_char_spacing|pdf_set_duration|pdf_set_gstate|pdf_set_horiz_scaling|pdf_set_info|pdf_set_info_author|pdf_set_info_creator|pdf_set_info_keywords|pdf_set_info_subject|pdf_set_info_title|pdf_set_layer_dependency|pdf_set_leading|pdf_set_parameter|pdf_set_text_matrix|pdf_set_text_pos|pdf_set_text_rendering|pdf_set_text_rise|pdf_set_value|pdf_set_word_spacing|pdf_setcolor|pdf_setdash|pdf_setdashpattern|pdf_setflat|pdf_setfont|pdf_setgray|pdf_setgray_fill|pdf_setgray_stroke|pdf_setlinecap|pdf_setlinejoin|pdf_setlinewidth|pdf_setmatrix|pdf_setmiterlimit|pdf_setpolydash|pdf_setrgbcolor|pdf_setrgbcolor_fill|pdf_setrgbcolor_stroke|pdf_shading|pdf_shading_pattern|pdf_shfill|pdf_show|pdf_show_boxed|pdf_show_xy|pdf_skew|pdf_stringwidth|pdf_stroke|pdf_suspend_page|pdf_translate|pdf_utf16_to_utf8|pdf_utf32_to_utf16|pdf_utf8_to_utf16|pdo|pdo_cubrid_schema|pdo_pgsqllobcreate|pdo_pgsqllobopen|pdo_pgsqllobunlink|pdo_sqlitecreateaggregate|pdo_sqlitecreatefunction|pdoexception|pdostatement|pfsockopen|pg_affected_rows|pg_cancel_query|pg_client_encoding|pg_close|pg_connect|pg_connection_busy|pg_connection_reset|pg_connection_status|pg_convert|pg_copy_from|pg_copy_to|pg_dbname|pg_delete|pg_end_copy|pg_escape_bytea|pg_escape_string|pg_execute|pg_fetch_all|pg_fetch_all_columns|pg_fetch_array|pg_fetch_assoc|pg_fetch_object|pg_fetch_result|pg_fetch_row|pg_field_is_null|pg_field_name|pg_field_num|pg_field_prtlen|pg_field_size|pg_field_table|pg_field_type|pg_field_type_oid|pg_free_result|pg_get_notify|pg_get_pid|pg_get_result|pg_host|pg_insert|pg_last_error|pg_last_notice|pg_last_oid|pg_lo_close|pg_lo_create|pg_lo_export|pg_lo_import|pg_lo_open|pg_lo_read|pg_lo_read_all|pg_lo_seek|pg_lo_tell|pg_lo_unlink|pg_lo_write|pg_meta_data|pg_num_fields|pg_num_rows|pg_options|pg_parameter_status|pg_pconnect|pg_ping|pg_port|pg_prepare|pg_put_line|pg_query|pg_query_params|pg_result_error|pg_result_error_field|pg_result_seek|pg_result_status|pg_select|pg_send_execute|pg_send_prepare|pg_send_query|pg_send_query_params|pg_set_client_encoding|pg_set_error_verbosity|pg_trace|pg_transaction_status|pg_tty|pg_unescape_bytea|pg_untrace|pg_update|pg_version|php_check_syntax|php_ini_loaded_file|php_ini_scanned_files|php_logo_guid|php_sapi_name|php_strip_whitespace|php_uname|phpcredits|phpinfo|phpversion|pi|png2wbmp|popen|pos|posix_access|posix_ctermid|posix_errno|posix_get_last_error|posix_getcwd|posix_getegid|posix_geteuid|posix_getgid|posix_getgrgid|posix_getgrnam|posix_getgroups|posix_getlogin|posix_getpgid|posix_getpgrp|posix_getpid|posix_getppid|posix_getpwnam|posix_getpwuid|posix_getrlimit|posix_getsid|posix_getuid|posix_initgroups|posix_isatty|posix_kill|posix_mkfifo|posix_mknod|posix_setegid|posix_seteuid|posix_setgid|posix_setpgid|posix_setsid|posix_setuid|posix_strerror|posix_times|posix_ttyname|posix_uname|pow|preg_filter|preg_grep|preg_last_error|preg_match|preg_match_all|preg_quote|preg_replace|preg_replace_callback|preg_split|prev|print|print_r|printer_abort|printer_close|printer_create_brush|printer_create_dc|printer_create_font|printer_create_pen|printer_delete_brush|printer_delete_dc|printer_delete_font|printer_delete_pen|printer_draw_bmp|printer_draw_chord|printer_draw_elipse|printer_draw_line|printer_draw_pie|printer_draw_rectangle|printer_draw_roundrect|printer_draw_text|printer_end_doc|printer_end_page|printer_get_option|printer_list|printer_logical_fontheight|printer_open|printer_select_brush|printer_select_font|printer_select_pen|printer_set_option|printer_start_doc|printer_start_page|printer_write|printf|proc_close|proc_get_status|proc_nice|proc_open|proc_terminate|property_exists|ps_add_bookmark|ps_add_launchlink|ps_add_locallink|ps_add_note|ps_add_pdflink|ps_add_weblink|ps_arc|ps_arcn|ps_begin_page|ps_begin_pattern|ps_begin_template|ps_circle|ps_clip|ps_close|ps_close_image|ps_closepath|ps_closepath_stroke|ps_continue_text|ps_curveto|ps_delete|ps_end_page|ps_end_pattern|ps_end_template|ps_fill|ps_fill_stroke|ps_findfont|ps_get_buffer|ps_get_parameter|ps_get_value|ps_hyphenate|ps_include_file|ps_lineto|ps_makespotcolor|ps_moveto|ps_new|ps_open_file|ps_open_image|ps_open_image_file|ps_open_memory_image|ps_place_image|ps_rect|ps_restore|ps_rotate|ps_save|ps_scale|ps_set_border_color|ps_set_border_dash|ps_set_border_style|ps_set_info|ps_set_parameter|ps_set_text_pos|ps_set_value|ps_setcolor|ps_setdash|ps_setflat|ps_setfont|ps_setgray|ps_setlinecap|ps_setlinejoin|ps_setlinewidth|ps_setmiterlimit|ps_setoverprintmode|ps_setpolydash|ps_shading|ps_shading_pattern|ps_shfill|ps_show|ps_show2|ps_show_boxed|ps_show_xy|ps_show_xy2|ps_string_geometry|ps_stringwidth|ps_stroke|ps_symbol|ps_symbol_name|ps_symbol_width|ps_translate|pspell_add_to_personal|pspell_add_to_session|pspell_check|pspell_clear_session|pspell_config_create|pspell_config_data_dir|pspell_config_dict_dir|pspell_config_ignore|pspell_config_mode|pspell_config_personal|pspell_config_repl|pspell_config_runtogether|pspell_config_save_repl|pspell_new|pspell_new_config|pspell_new_personal|pspell_save_wordlist|pspell_store_replacement|pspell_suggest|putenv|px_close|px_create_fp|px_date2string|px_delete|px_delete_record|px_get_field|px_get_info|px_get_parameter|px_get_record|px_get_schema|px_get_value|px_insert_record|px_new|px_numfields|px_numrecords|px_open_fp|px_put_record|px_retrieve_record|px_set_blob_file|px_set_parameter|px_set_tablename|px_set_targetencoding|px_set_value|px_timestamp2string|px_update_record|qdom_error|qdom_tree|quoted_printable_decode|quoted_printable_encode|quotemeta|rad2deg|radius_acct_open|radius_add_server|radius_auth_open|radius_close|radius_config|radius_create_request|radius_cvt_addr|radius_cvt_int|radius_cvt_string|radius_demangle|radius_demangle_mppe_key|radius_get_attr|radius_get_vendor_attr|radius_put_addr|radius_put_attr|radius_put_int|radius_put_string|radius_put_vendor_addr|radius_put_vendor_attr|radius_put_vendor_int|radius_put_vendor_string|radius_request_authenticator|radius_send_request|radius_server_secret|radius_strerror|rand|range|rangeexception|rar_wrapper_cache_stats|rararchive|rarentry|rarexception|rawurldecode|rawurlencode|read_exif_data|readdir|readfile|readgzfile|readline|readline_add_history|readline_callback_handler_install|readline_callback_handler_remove|readline_callback_read_char|readline_clear_history|readline_completion_function|readline_info|readline_list_history|readline_on_new_line|readline_read_history|readline_redisplay|readline_write_history|readlink|realpath|realpath_cache_get|realpath_cache_size|recode|recode_file|recode_string|recursivearrayiterator|recursivecachingiterator|recursivecallbackfilteriterator|recursivedirectoryiterator|recursivefilteriterator|recursiveiterator|recursiveiteratoriterator|recursiveregexiterator|recursivetreeiterator|reflection|reflectionclass|reflectionexception|reflectionextension|reflectionfunction|reflectionfunctionabstract|reflectionmethod|reflectionobject|reflectionparameter|reflectionproperty|reflector|regexiterator|register_shutdown_function|register_tick_function|rename|rename_function|require|require_once|reset|resetValue|resourcebundle|restore_error_handler|restore_exception_handler|restore_include_path|return|rewind|rewinddir|rmdir|round|rpm_close|rpm_get_tag|rpm_is_valid|rpm_open|rpm_version|rrd_create|rrd_error|rrd_fetch|rrd_first|rrd_graph|rrd_info|rrd_last|rrd_lastupdate|rrd_restore|rrd_tune|rrd_update|rrd_xport|rrdcreator|rrdgraph|rrdupdater|rsort|rtrim|runkit_class_adopt|runkit_class_emancipate|runkit_constant_add|runkit_constant_redefine|runkit_constant_remove|runkit_function_add|runkit_function_copy|runkit_function_redefine|runkit_function_remove|runkit_function_rename|runkit_import|runkit_lint|runkit_lint_file|runkit_method_add|runkit_method_copy|runkit_method_redefine|runkit_method_remove|runkit_method_rename|runkit_return_value_used|runkit_sandbox_output_handler|runkit_superglobals|runtimeexception|samconnection_commit|samconnection_connect|samconnection_constructor|samconnection_disconnect|samconnection_errno|samconnection_error|samconnection_isconnected|samconnection_peek|samconnection_peekall|samconnection_receive|samconnection_remove|samconnection_rollback|samconnection_send|samconnection_setDebug|samconnection_subscribe|samconnection_unsubscribe|sammessage_body|sammessage_constructor|sammessage_header|sca_createdataobject|sca_getservice|sca_localproxy_createdataobject|sca_soapproxy_createdataobject|scandir|sdo_das_changesummary_beginlogging|sdo_das_changesummary_endlogging|sdo_das_changesummary_getchangeddataobjects|sdo_das_changesummary_getchangetype|sdo_das_changesummary_getoldcontainer|sdo_das_changesummary_getoldvalues|sdo_das_changesummary_islogging|sdo_das_datafactory_addpropertytotype|sdo_das_datafactory_addtype|sdo_das_datafactory_getdatafactory|sdo_das_dataobject_getchangesummary|sdo_das_relational_applychanges|sdo_das_relational_construct|sdo_das_relational_createrootdataobject|sdo_das_relational_executepreparedquery|sdo_das_relational_executequery|sdo_das_setting_getlistindex|sdo_das_setting_getpropertyindex|sdo_das_setting_getpropertyname|sdo_das_setting_getvalue|sdo_das_setting_isset|sdo_das_xml_addtypes|sdo_das_xml_create|sdo_das_xml_createdataobject|sdo_das_xml_createdocument|sdo_das_xml_document_getrootdataobject|sdo_das_xml_document_getrootelementname|sdo_das_xml_document_getrootelementuri|sdo_das_xml_document_setencoding|sdo_das_xml_document_setxmldeclaration|sdo_das_xml_document_setxmlversion|sdo_das_xml_loadfile|sdo_das_xml_loadstring|sdo_das_xml_savefile|sdo_das_xml_savestring|sdo_datafactory_create|sdo_dataobject_clear|sdo_dataobject_createdataobject|sdo_dataobject_getcontainer|sdo_dataobject_getsequence|sdo_dataobject_gettypename|sdo_dataobject_gettypenamespaceuri|sdo_exception_getcause|sdo_list_insert|sdo_model_property_getcontainingtype|sdo_model_property_getdefault|sdo_model_property_getname|sdo_model_property_gettype|sdo_model_property_iscontainment|sdo_model_property_ismany|sdo_model_reflectiondataobject_construct|sdo_model_reflectiondataobject_export|sdo_model_reflectiondataobject_getcontainmentproperty|sdo_model_reflectiondataobject_getinstanceproperties|sdo_model_reflectiondataobject_gettype|sdo_model_type_getbasetype|sdo_model_type_getname|sdo_model_type_getnamespaceuri|sdo_model_type_getproperties|sdo_model_type_getproperty|sdo_model_type_isabstracttype|sdo_model_type_isdatatype|sdo_model_type_isinstance|sdo_model_type_isopentype|sdo_model_type_issequencedtype|sdo_sequence_getproperty|sdo_sequence_insert|sdo_sequence_move|seekableiterator|sem_acquire|sem_get|sem_release|sem_remove|serializable|serialize|session_cache_expire|session_cache_limiter|session_commit|session_decode|session_destroy|session_encode|session_get_cookie_params|session_id|session_is_registered|session_module_name|session_name|session_pgsql_add_error|session_pgsql_get_error|session_pgsql_get_field|session_pgsql_reset|session_pgsql_set_field|session_pgsql_status|session_regenerate_id|session_register|session_save_path|session_set_cookie_params|session_set_save_handler|session_start|session_unregister|session_unset|session_write_close|setCounterClass|set_error_handler|set_exception_handler|set_file_buffer|set_include_path|set_magic_quotes_runtime|set_socket_blocking|set_time_limit|setcookie|setlocale|setproctitle|setrawcookie|setstaticpropertyvalue|setthreadtitle|settype|sha1|sha1_file|shell_exec|shm_attach|shm_detach|shm_get_var|shm_has_var|shm_put_var|shm_remove|shm_remove_var|shmop_close|shmop_delete|shmop_open|shmop_read|shmop_size|shmop_write|show_source|shuffle|signeurlpaiement|similar_text|simplexml_import_dom|simplexml_load_file|simplexml_load_string|simplexmlelement|simplexmliterator|sin|sinh|sizeof|sleep|snmp|snmp2_get|snmp2_getnext|snmp2_real_walk|snmp2_set|snmp2_walk|snmp3_get|snmp3_getnext|snmp3_real_walk|snmp3_set|snmp3_walk|snmp_get_quick_print|snmp_get_valueretrieval|snmp_read_mib|snmp_set_enum_print|snmp_set_oid_numeric_print|snmp_set_oid_output_format|snmp_set_quick_print|snmp_set_valueretrieval|snmpget|snmpgetnext|snmprealwalk|snmpset|snmpwalk|snmpwalkoid|soapclient|soapfault|soapheader|soapparam|soapserver|soapvar|socket_accept|socket_bind|socket_clear_error|socket_close|socket_connect|socket_create|socket_create_listen|socket_create_pair|socket_get_option|socket_get_status|socket_getpeername|socket_getsockname|socket_last_error|socket_listen|socket_read|socket_recv|socket_recvfrom|socket_select|socket_send|socket_sendto|socket_set_block|socket_set_blocking|socket_set_nonblock|socket_set_option|socket_set_timeout|socket_shutdown|socket_strerror|socket_write|solr_get_version|solrclient|solrclientexception|solrdocument|solrdocumentfield|solrexception|solrgenericresponse|solrillegalargumentexception|solrillegaloperationexception|solrinputdocument|solrmodifiableparams|solrobject|solrparams|solrpingresponse|solrquery|solrqueryresponse|solrresponse|solrupdateresponse|solrutils|sort|soundex|sphinxclient|spl_autoload|spl_autoload_call|spl_autoload_extensions|spl_autoload_functions|spl_autoload_register|spl_autoload_unregister|spl_classes|spl_object_hash|splbool|spldoublylinkedlist|splenum|splfileinfo|splfileobject|splfixedarray|splfloat|splheap|splint|split|spliti|splmaxheap|splminheap|splobjectstorage|splobserver|splpriorityqueue|splqueue|splstack|splstring|splsubject|spltempfileobject|spoofchecker|sprintf|sql_regcase|sqlite3|sqlite3result|sqlite3stmt|sqlite_array_query|sqlite_busy_timeout|sqlite_changes|sqlite_close|sqlite_column|sqlite_create_aggregate|sqlite_create_function|sqlite_current|sqlite_error_string|sqlite_escape_string|sqlite_exec|sqlite_factory|sqlite_fetch_all|sqlite_fetch_array|sqlite_fetch_column_types|sqlite_fetch_object|sqlite_fetch_single|sqlite_fetch_string|sqlite_field_name|sqlite_has_more|sqlite_has_prev|sqlite_key|sqlite_last_error|sqlite_last_insert_rowid|sqlite_libencoding|sqlite_libversion|sqlite_next|sqlite_num_fields|sqlite_num_rows|sqlite_open|sqlite_popen|sqlite_prev|sqlite_query|sqlite_rewind|sqlite_seek|sqlite_single_query|sqlite_udf_decode_binary|sqlite_udf_encode_binary|sqlite_unbuffered_query|sqlite_valid|sqrt|srand|sscanf|ssdeep_fuzzy_compare|ssdeep_fuzzy_hash|ssdeep_fuzzy_hash_filename|ssh2_auth_hostbased_file|ssh2_auth_none|ssh2_auth_password|ssh2_auth_pubkey_file|ssh2_connect|ssh2_exec|ssh2_fetch_stream|ssh2_fingerprint|ssh2_methods_negotiated|ssh2_publickey_add|ssh2_publickey_init|ssh2_publickey_list|ssh2_publickey_remove|ssh2_scp_recv|ssh2_scp_send|ssh2_sftp|ssh2_sftp_lstat|ssh2_sftp_mkdir|ssh2_sftp_readlink|ssh2_sftp_realpath|ssh2_sftp_rename|ssh2_sftp_rmdir|ssh2_sftp_stat|ssh2_sftp_symlink|ssh2_sftp_unlink|ssh2_shell|ssh2_tunnel|stat|stats_absolute_deviation|stats_cdf_beta|stats_cdf_binomial|stats_cdf_cauchy|stats_cdf_chisquare|stats_cdf_exponential|stats_cdf_f|stats_cdf_gamma|stats_cdf_laplace|stats_cdf_logistic|stats_cdf_negative_binomial|stats_cdf_noncentral_chisquare|stats_cdf_noncentral_f|stats_cdf_poisson|stats_cdf_t|stats_cdf_uniform|stats_cdf_weibull|stats_covariance|stats_den_uniform|stats_dens_beta|stats_dens_cauchy|stats_dens_chisquare|stats_dens_exponential|stats_dens_f|stats_dens_gamma|stats_dens_laplace|stats_dens_logistic|stats_dens_negative_binomial|stats_dens_normal|stats_dens_pmf_binomial|stats_dens_pmf_hypergeometric|stats_dens_pmf_poisson|stats_dens_t|stats_dens_weibull|stats_harmonic_mean|stats_kurtosis|stats_rand_gen_beta|stats_rand_gen_chisquare|stats_rand_gen_exponential|stats_rand_gen_f|stats_rand_gen_funiform|stats_rand_gen_gamma|stats_rand_gen_ibinomial|stats_rand_gen_ibinomial_negative|stats_rand_gen_int|stats_rand_gen_ipoisson|stats_rand_gen_iuniform|stats_rand_gen_noncenral_chisquare|stats_rand_gen_noncentral_f|stats_rand_gen_noncentral_t|stats_rand_gen_normal|stats_rand_gen_t|stats_rand_get_seeds|stats_rand_phrase_to_seeds|stats_rand_ranf|stats_rand_setall|stats_skew|stats_standard_deviation|stats_stat_binomial_coef|stats_stat_correlation|stats_stat_gennch|stats_stat_independent_t|stats_stat_innerproduct|stats_stat_noncentral_t|stats_stat_paired_t|stats_stat_percentile|stats_stat_powersum|stats_variance|stomp|stomp_connect_error|stomp_version|stompexception|stompframe|str_getcsv|str_ireplace|str_pad|str_repeat|str_replace|str_rot13|str_shuffle|str_split|str_word_count|strcasecmp|strchr|strcmp|strcoll|strcspn|stream_bucket_append|stream_bucket_make_writeable|stream_bucket_new|stream_bucket_prepend|stream_context_create|stream_context_get_default|stream_context_get_options|stream_context_get_params|stream_context_set_default|stream_context_set_option|stream_context_set_params|stream_copy_to_stream|stream_encoding|stream_filter_append|stream_filter_prepend|stream_filter_register|stream_filter_remove|stream_get_contents|stream_get_filters|stream_get_line|stream_get_meta_data|stream_get_transports|stream_get_wrappers|stream_is_local|stream_notification_callback|stream_register_wrapper|stream_resolve_include_path|stream_select|stream_set_blocking|stream_set_read_buffer|stream_set_timeout|stream_set_write_buffer|stream_socket_accept|stream_socket_client|stream_socket_enable_crypto|stream_socket_get_name|stream_socket_pair|stream_socket_recvfrom|stream_socket_sendto|stream_socket_server|stream_socket_shutdown|stream_supports_lock|stream_wrapper_register|stream_wrapper_restore|stream_wrapper_unregister|streamwrapper|strftime|strip_tags|stripcslashes|stripos|stripslashes|stristr|strlen|strnatcasecmp|strnatcmp|strncasecmp|strncmp|strpbrk|strpos|strptime|strrchr|strrev|strripos|strrpos|strspn|strstr|strtok|strtolower|strtotime|strtoupper|strtr|strval|substr|substr_compare|substr_count|substr_replace|svm|svmmodel|svn_add|svn_auth_get_parameter|svn_auth_set_parameter|svn_blame|svn_cat|svn_checkout|svn_cleanup|svn_client_version|svn_commit|svn_delete|svn_diff|svn_export|svn_fs_abort_txn|svn_fs_apply_text|svn_fs_begin_txn2|svn_fs_change_node_prop|svn_fs_check_path|svn_fs_contents_changed|svn_fs_copy|svn_fs_delete|svn_fs_dir_entries|svn_fs_file_contents|svn_fs_file_length|svn_fs_is_dir|svn_fs_is_file|svn_fs_make_dir|svn_fs_make_file|svn_fs_node_created_rev|svn_fs_node_prop|svn_fs_props_changed|svn_fs_revision_prop|svn_fs_revision_root|svn_fs_txn_root|svn_fs_youngest_rev|svn_import|svn_log|svn_ls|svn_mkdir|svn_repos_create|svn_repos_fs|svn_repos_fs_begin_txn_for_commit|svn_repos_fs_commit_txn|svn_repos_hotcopy|svn_repos_open|svn_repos_recover|svn_revert|svn_status|svn_update|swf_actiongeturl|swf_actiongotoframe|swf_actiongotolabel|swf_actionnextframe|swf_actionplay|swf_actionprevframe|swf_actionsettarget|swf_actionstop|swf_actiontogglequality|swf_actionwaitforframe|swf_addbuttonrecord|swf_addcolor|swf_closefile|swf_definebitmap|swf_definefont|swf_defineline|swf_definepoly|swf_definerect|swf_definetext|swf_endbutton|swf_enddoaction|swf_endshape|swf_endsymbol|swf_fontsize|swf_fontslant|swf_fonttracking|swf_getbitmapinfo|swf_getfontinfo|swf_getframe|swf_labelframe|swf_lookat|swf_modifyobject|swf_mulcolor|swf_nextid|swf_oncondition|swf_openfile|swf_ortho|swf_ortho2|swf_perspective|swf_placeobject|swf_polarview|swf_popmatrix|swf_posround|swf_pushmatrix|swf_removeobject|swf_rotate|swf_scale|swf_setfont|swf_setframe|swf_shapearc|swf_shapecurveto|swf_shapecurveto3|swf_shapefillbitmapclip|swf_shapefillbitmaptile|swf_shapefilloff|swf_shapefillsolid|swf_shapelinesolid|swf_shapelineto|swf_shapemoveto|swf_showframe|swf_startbutton|swf_startdoaction|swf_startshape|swf_startsymbol|swf_textwidth|swf_translate|swf_viewport|swfaction|swfbitmap|swfbutton|swfdisplayitem|swffill|swffont|swffontchar|swfgradient|swfmorph|swfmovie|swfprebuiltclip|swfshape|swfsound|swfsoundinstance|swfsprite|swftext|swftextfield|swfvideostream|swish_construct|swish_getmetalist|swish_getpropertylist|swish_prepare|swish_query|swishresult_getmetalist|swishresult_stem|swishresults_getparsedwords|swishresults_getremovedstopwords|swishresults_nextresult|swishresults_seekresult|swishsearch_execute|swishsearch_resetlimit|swishsearch_setlimit|swishsearch_setphrasedelimiter|swishsearch_setsort|swishsearch_setstructure|sybase_affected_rows|sybase_close|sybase_connect|sybase_data_seek|sybase_deadlock_retry_count|sybase_fetch_array|sybase_fetch_assoc|sybase_fetch_field|sybase_fetch_object|sybase_fetch_row|sybase_field_seek|sybase_free_result|sybase_get_last_message|sybase_min_client_severity|sybase_min_error_severity|sybase_min_message_severity|sybase_min_server_severity|sybase_num_fields|sybase_num_rows|sybase_pconnect|sybase_query|sybase_result|sybase_select_db|sybase_set_message_handler|sybase_unbuffered_query|symlink|sys_get_temp_dir|sys_getloadavg|syslog|system|tag|tan|tanh|tcpwrap_check|tempnam|textdomain|tidy|tidy_access_count|tidy_config_count|tidy_diagnose|tidy_error_count|tidy_get_error_buffer|tidy_get_output|tidy_load_config|tidy_reset_config|tidy_save_config|tidy_set_encoding|tidy_setopt|tidy_warning_count|tidynode|time|time_nanosleep|time_sleep_until|timezone_abbreviations_list|timezone_identifiers_list|timezone_location_get|timezone_name_from_abbr|timezone_name_get|timezone_offset_get|timezone_open|timezone_transitions_get|timezone_version_get|tmpfile|token_get_all|token_name|tokyotyrant|tokyotyrantquery|tokyotyranttable|tostring|tostring|touch|transliterator|traversable|trigger_error|trim|uasort|ucfirst|ucwords|udm_add_search_limit|udm_alloc_agent|udm_alloc_agent_array|udm_api_version|udm_cat_list|udm_cat_path|udm_check_charset|udm_check_stored|udm_clear_search_limits|udm_close_stored|udm_crc32|udm_errno|udm_error|udm_find|udm_free_agent|udm_free_ispell_data|udm_free_res|udm_get_doc_count|udm_get_res_field|udm_get_res_param|udm_hash32|udm_load_ispell_data|udm_open_stored|udm_set_agent_param|uksort|umask|underflowexception|unexpectedvalueexception|uniqid|unixtojd|unlink|unpack|unregister_tick_function|unserialize|unset|urldecode|urlencode|use_soap_error_handler|user_error|usleep|usort|utf8_decode|utf8_encode|v8js|v8jsexception|var_dump|var_export|variant|variant_abs|variant_add|variant_and|variant_cast|variant_cat|variant_cmp|variant_date_from_timestamp|variant_date_to_timestamp|variant_div|variant_eqv|variant_fix|variant_get_type|variant_idiv|variant_imp|variant_int|variant_mod|variant_mul|variant_neg|variant_not|variant_or|variant_pow|variant_round|variant_set|variant_set_type|variant_sub|variant_xor|version_compare|vfprintf|virtual|vpopmail_add_alias_domain|vpopmail_add_alias_domain_ex|vpopmail_add_domain|vpopmail_add_domain_ex|vpopmail_add_user|vpopmail_alias_add|vpopmail_alias_del|vpopmail_alias_del_domain|vpopmail_alias_get|vpopmail_alias_get_all|vpopmail_auth_user|vpopmail_del_domain|vpopmail_del_domain_ex|vpopmail_del_user|vpopmail_error|vpopmail_passwd|vpopmail_set_user_quota|vprintf|vsprintf|w32api_deftype|w32api_init_dtype|w32api_invoke_function|w32api_register_function|w32api_set_call_method|wddx_add_vars|wddx_deserialize|wddx_packet_end|wddx_packet_start|wddx_serialize_value|wddx_serialize_vars|win32_continue_service|win32_create_service|win32_delete_service|win32_get_last_control_message|win32_pause_service|win32_ps_list_procs|win32_ps_stat_mem|win32_ps_stat_proc|win32_query_service_status|win32_set_service_status|win32_start_service|win32_start_service_ctrl_dispatcher|win32_stop_service|wincache_fcache_fileinfo|wincache_fcache_meminfo|wincache_lock|wincache_ocache_fileinfo|wincache_ocache_meminfo|wincache_refresh_if_changed|wincache_rplist_fileinfo|wincache_rplist_meminfo|wincache_scache_info|wincache_scache_meminfo|wincache_ucache_add|wincache_ucache_cas|wincache_ucache_clear|wincache_ucache_dec|wincache_ucache_delete|wincache_ucache_exists|wincache_ucache_get|wincache_ucache_inc|wincache_ucache_info|wincache_ucache_meminfo|wincache_ucache_set|wincache_unlock|wordwrap|xattr_get|xattr_list|xattr_remove|xattr_set|xattr_supported|xdiff_file_bdiff|xdiff_file_bdiff_size|xdiff_file_bpatch|xdiff_file_diff|xdiff_file_diff_binary|xdiff_file_merge3|xdiff_file_patch|xdiff_file_patch_binary|xdiff_file_rabdiff|xdiff_string_bdiff|xdiff_string_bdiff_size|xdiff_string_bpatch|xdiff_string_diff|xdiff_string_diff_binary|xdiff_string_merge3|xdiff_string_patch|xdiff_string_patch_binary|xdiff_string_rabdiff|xhprof_disable|xhprof_enable|xhprof_sample_disable|xhprof_sample_enable|xml_error_string|xml_get_current_byte_index|xml_get_current_column_number|xml_get_current_line_number|xml_get_error_code|xml_parse|xml_parse_into_struct|xml_parser_create|xml_parser_create_ns|xml_parser_free|xml_parser_get_option|xml_parser_set_option|xml_set_character_data_handler|xml_set_default_handler|xml_set_element_handler|xml_set_end_namespace_decl_handler|xml_set_external_entity_ref_handler|xml_set_notation_decl_handler|xml_set_object|xml_set_processing_instruction_handler|xml_set_start_namespace_decl_handler|xml_set_unparsed_entity_decl_handler|xmlreader|xmlrpc_decode|xmlrpc_decode_request|xmlrpc_encode|xmlrpc_encode_request|xmlrpc_get_type|xmlrpc_is_fault|xmlrpc_parse_method_descriptions|xmlrpc_server_add_introspection_data|xmlrpc_server_call_method|xmlrpc_server_create|xmlrpc_server_destroy|xmlrpc_server_register_introspection_callback|xmlrpc_server_register_method|xmlrpc_set_type|xmlwriter_end_attribute|xmlwriter_end_cdata|xmlwriter_end_comment|xmlwriter_end_document|xmlwriter_end_dtd|xmlwriter_end_dtd_attlist|xmlwriter_end_dtd_element|xmlwriter_end_dtd_entity|xmlwriter_end_element|xmlwriter_end_pi|xmlwriter_flush|xmlwriter_full_end_element|xmlwriter_open_memory|xmlwriter_open_uri|xmlwriter_output_memory|xmlwriter_set_indent|xmlwriter_set_indent_string|xmlwriter_start_attribute|xmlwriter_start_attribute_ns|xmlwriter_start_cdata|xmlwriter_start_comment|xmlwriter_start_document|xmlwriter_start_dtd|xmlwriter_start_dtd_attlist|xmlwriter_start_dtd_element|xmlwriter_start_dtd_entity|xmlwriter_start_element|xmlwriter_start_element_ns|xmlwriter_start_pi|xmlwriter_text|xmlwriter_write_attribute|xmlwriter_write_attribute_ns|xmlwriter_write_cdata|xmlwriter_write_comment|xmlwriter_write_dtd|xmlwriter_write_dtd_attlist|xmlwriter_write_dtd_element|xmlwriter_write_dtd_entity|xmlwriter_write_element|xmlwriter_write_element_ns|xmlwriter_write_pi|xmlwriter_write_raw|xpath_eval|xpath_eval_expression|xpath_new_context|xpath_register_ns|xpath_register_ns_auto|xptr_eval|xptr_new_context|xslt_backend_info|xslt_backend_name|xslt_backend_version|xslt_create|xslt_errno|xslt_error|xslt_free|xslt_getopt|xslt_process|xslt_set_base|xslt_set_encoding|xslt_set_error_handler|xslt_set_log|xslt_set_object|xslt_set_sax_handler|xslt_set_sax_handlers|xslt_set_scheme_handler|xslt_set_scheme_handlers|xslt_setopt|xsltprocessor|yaml_emit|yaml_emit_file|yaml_parse|yaml_parse_file|yaml_parse_url|yaz_addinfo|yaz_ccl_conf|yaz_ccl_parse|yaz_close|yaz_connect|yaz_database|yaz_element|yaz_errno|yaz_error|yaz_es|yaz_es_result|yaz_get_option|yaz_hits|yaz_itemorder|yaz_present|yaz_range|yaz_record|yaz_scan|yaz_scan_result|yaz_schema|yaz_search|yaz_set_option|yaz_sort|yaz_syntax|yaz_wait|yp_all|yp_cat|yp_err_string|yp_errno|yp_first|yp_get_default_domain|yp_master|yp_match|yp_next|yp_order|zend_logo_guid|zend_thread_id|zend_version|zip_close|zip_entry_close|zip_entry_compressedsize|zip_entry_compressionmethod|zip_entry_filesize|zip_entry_name|zip_entry_open|zip_entry_read|zip_open|zip_read|ziparchive|ziparchive_addemptydir|ziparchive_addfile|ziparchive_addfromstring|ziparchive_close|ziparchive_deleteindex|ziparchive_deletename|ziparchive_extractto|ziparchive_getarchivecomment|ziparchive_getcommentindex|ziparchive_getcommentname|ziparchive_getfromindex|ziparchive_getfromname|ziparchive_getnameindex|ziparchive_getstatusstring|ziparchive_getstream|ziparchive_locatename|ziparchive_open|ziparchive_renameindex|ziparchive_renamename|ziparchive_setCommentName|ziparchive_setarchivecomment|ziparchive_setcommentindex|ziparchive_statindex|ziparchive_statname|ziparchive_unchangeall|ziparchive_unchangearchive|ziparchive_unchangeindex|ziparchive_unchangename|zlib_get_coding_type".split("|")),n=i.arrayToMap("abstract|and|array|as|break|case|catch|class|clone|const|continue|declare|default|do|else|elseif|enddeclare|endfor|endforeach|endif|endswitch|endwhile|extends|final|for|foreach|function|global|goto|if|implements|interface|instanceof|namespace|new|or|private|protected|public|static|switch|throw|try|use|var|while|xor".split("|")),r=i.arrayToMap("die|echo|empty|exit|eval|include|include_once|isset|list|require|require_once|return|print|unset".split("|")),o=i.arrayToMap("true|false|null|__CLASS__|__DIR__|__FILE__|__LINE__|__METHOD__|__FUNCTION__|__NAMESPACE__".split("|")),u=i.arrayToMap("$GLOBALS|$_SERVER|$_GET|$_POST|$_FILES|$_REQUEST|$_SESSION|$_ENV|$_COOKIE|$php_errormsg|$HTTP_RAW_POST_DATA|$http_response_header|$argc|$argv".split("|")),a=i.arrayToMap("key_exists|cairo_matrix_create_scale|cairo_matrix_create_translate|call_user_method|call_user_method_array|com_addref|com_get|com_invoke|com_isenum|com_load|com_release|com_set|connection_timeout|cubrid_load_from_glo|cubrid_new_glo|cubrid_save_to_glo|cubrid_send_glo|define_syslog_variables|dl|ereg|ereg_replace|eregi|eregi_replace|hw_documentattributes|hw_documentbodytag|hw_documentsize|hw_outputdocument|imagedashedline|maxdb_bind_param|maxdb_bind_result|maxdb_client_encoding|maxdb_close_long_data|maxdb_execute|maxdb_fetch|maxdb_get_metadata|maxdb_param_count|maxdb_send_long_data|mcrypt_ecb|mcrypt_generic_end|mime_content_type|mysql_createdb|mysql_dbname|mysql_db_query|mysql_drop_db|mysql_dropdb|mysql_escape_string|mysql_fieldflags|mysql_fieldflags|mysql_fieldname|mysql_fieldtable|mysql_fieldtype|mysql_freeresult|mysql_listdbs|mysql_list_fields|mysql_listfields|mysql_list_tables|mysql_listtables|mysql_numfields|mysql_numrows|mysql_selectdb|mysql_tablename|mysqli_bind_param|mysqli_bind_result|mysqli_disable_reads_from_master|mysqli_disable_rpl_parse|mysqli_enable_reads_from_master|mysqli_enable_rpl_parse|mysqli_execute|mysqli_fetch|mysqli_get_metadata|mysqli_master_query|mysqli_param_count|mysqli_rpl_parse_enabled|mysqli_rpl_probe|mysqli_rpl_query_type|mysqli_send_long_data|mysqli_send_query|mysqli_slave_query|ocibindbyname|ocicancel|ocicloselob|ocicollappend|ocicollassign|ocicollassignelem|ocicollgetelem|ocicollmax|ocicollsize|ocicolltrim|ocicolumnisnull|ocicolumnname|ocicolumnprecision|ocicolumnscale|ocicolumnsize|ocicolumntype|ocicolumntyperaw|ocicommit|ocidefinebyname|ocierror|ociexecute|ocifetch|ocifetchinto|ocifetchstatement|ocifreecollection|ocifreecursor|ocifreedesc|ocifreestatement|ociinternaldebug|ociloadlob|ocilogoff|ocilogon|ocinewcollection|ocinewcursor|ocinewdescriptor|ocinlogon|ocinumcols|ociparse|ociplogon|ociresult|ocirollback|ocirowcount|ocisavelob|ocisavelobfile|ociserverversion|ocisetprefetch|ocistatementtype|ociwritelobtofile|ociwritetemporarylob|PDF_add_annotation|PDF_add_bookmark|PDF_add_launchlink|PDF_add_locallink|PDF_add_note|PDF_add_outline|PDF_add_pdflink|PDF_add_weblink|PDF_attach_file|PDF_begin_page|PDF_begin_template|PDF_close_pdi|PDF_close|PDF_findfont|PDF_get_font|PDF_get_fontname|PDF_get_fontsize|PDF_get_image_height|PDF_get_image_width|PDF_get_majorversion|PDF_get_minorversion|PDF_get_pdi_parameter|PDF_get_pdi_value|PDF_open_ccitt|PDF_open_file|PDF_open_gif|PDF_open_image_file|PDF_open_image|PDF_open_jpeg|PDF_open_pdi|PDF_open_tiff|PDF_place_image|PDF_place_pdi_page|PDF_set_border_color|PDF_set_border_dash|PDF_set_border_style|PDF_set_char_spacing|PDF_set_duration|PDF_set_horiz_scaling|PDF_set_info_author|PDF_set_info_creator|PDF_set_info_keywords|PDF_set_info_subject|PDF_set_info_title|PDF_set_leading|PDF_set_text_matrix|PDF_set_text_rendering|PDF_set_text_rise|PDF_set_word_spacing|PDF_setgray_fill|PDF_setgray_stroke|PDF_setgray|PDF_setpolydash|PDF_setrgbcolor_fill|PDF_setrgbcolor_stroke|PDF_setrgbcolor|PDF_show_boxed|php_check_syntax|px_set_tablename|px_set_targetencoding|runkit_sandbox_output_handler|session_is_registered|session_register|session_unregisterset_magic_quotes_runtime|magic_quotes_runtime|set_socket_blocking|socket_set_blocking|set_socket_timeout|socket_set_timeout|split|spliti|sql_regcase".split("|")),f=i.arrayToMap("cfunction|old_function".split("|")),l=i.arrayToMap([]);this.$rules={start:[{token:"comment",regex:/(?:#|\/\/)(?:[^?]|\?[^>])*/},e.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment"},{token:"string.regexp",regex:"[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/][gimy]*\\s*(?=[).,;]|$)"},{token:"string",regex:'"',next:"qqstring"},{token:"string",regex:"'",next:"qstring"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language",regex:"\\b(?:DEFAULT_INCLUDE_PATH|E_(?:ALL|CO(?:MPILE_(?:ERROR|WARNING)|RE_(?:ERROR|WARNING))|ERROR|NOTICE|PARSE|STRICT|USER_(?:ERROR|NOTICE|WARNING)|WARNING)|P(?:EAR_(?:EXTENSION_DIR|INSTALL_DIR)|HP_(?:BINDIR|CONFIG_FILE_(?:PATH|SCAN_DIR)|DATADIR|E(?:OL|XTENSION_DIR)|INT_(?:MAX|SIZE)|L(?:IBDIR|OCALSTATEDIR)|O(?:S|UTPUT_HANDLER_(?:CONT|END|START))|PREFIX|S(?:API|HLIB_SUFFIX|YSCONFDIR)|VERSION))|__COMPILER_HALT_OFFSET__)\\b"},{token:["keyword","text","support.class"],regex:"\\b(new)(\\s+)(\\w+)"},{token:["support.class","keyword.operator"],regex:"\\b(\\w+)(::)"},{token:"constant.language",regex:"\\b(?:A(?:B(?:DAY_(?:1|2|3|4|5|6|7)|MON_(?:1(?:0|1|2|)|2|3|4|5|6|7|8|9))|LT_DIGITS|M_STR|SSERT_(?:ACTIVE|BAIL|CALLBACK|QUIET_EVAL|WARNING))|C(?:ASE_(?:LOWER|UPPER)|HAR_MAX|O(?:DESET|NNECTION_(?:ABORTED|NORMAL|TIMEOUT)|UNT_(?:NORMAL|RECURSIVE))|R(?:EDITS_(?:ALL|DOCS|FULLPAGE|G(?:ENERAL|ROUP)|MODULES|QA|SAPI)|NCYSTR|YPT_(?:BLOWFISH|EXT_DES|MD5|S(?:ALT_LENGTH|TD_DES)))|URRENCY_SYMBOL)|D(?:AY_(?:1|2|3|4|5|6|7)|ECIMAL_POINT|IRECTORY_SEPARATOR|_(?:FMT|T_FMT))|E(?:NT_(?:COMPAT|NOQUOTES|QUOTES)|RA(?:_(?:D_(?:FMT|T_FMT)|T_FMT|YEAR)|)|XTR_(?:IF_EXISTS|OVERWRITE|PREFIX_(?:ALL|I(?:F_EXISTS|NVALID)|SAME)|SKIP))|FRAC_DIGITS|GROUPING|HTML_(?:ENTITIES|SPECIALCHARS)|IN(?:FO_(?:ALL|C(?:ONFIGURATION|REDITS)|ENVIRONMENT|GENERAL|LICENSE|MODULES|VARIABLES)|I_(?:ALL|PERDIR|SYSTEM|USER)|T_(?:CURR_SYMBOL|FRAC_DIGITS))|L(?:C_(?:ALL|C(?:OLLATE|TYPE)|M(?:ESSAGES|ONETARY)|NUMERIC|TIME)|O(?:CK_(?:EX|NB|SH|UN)|G_(?:A(?:LERT|UTH(?:PRIV|))|C(?:ONS|R(?:IT|ON))|D(?:AEMON|EBUG)|E(?:MERG|RR)|INFO|KERN|L(?:OCAL(?:0|1|2|3|4|5|6|7)|PR)|MAIL|N(?:DELAY|EWS|O(?:TICE|WAIT))|ODELAY|P(?:ERROR|ID)|SYSLOG|U(?:SER|UCP)|WARNING)))|M(?:ON_(?:1(?:0|1|2|)|2|3|4|5|6|7|8|9|DECIMAL_POINT|GROUPING|THOUSANDS_SEP)|_(?:1_PI|2_(?:PI|SQRTPI)|E|L(?:N(?:10|2)|OG(?:10E|2E))|PI(?:_(?:2|4)|)|SQRT(?:1_2|2)))|N(?:EGATIVE_SIGN|O(?:EXPR|STR)|_(?:CS_PRECEDES|S(?:EP_BY_SPACE|IGN_POSN)))|P(?:ATH(?:INFO_(?:BASENAME|DIRNAME|EXTENSION)|_SEPARATOR)|M_STR|OSITIVE_SIGN|_(?:CS_PRECEDES|S(?:EP_BY_SPACE|IGN_POSN)))|RADIXCHAR|S(?:EEK_(?:CUR|END|SET)|ORT_(?:ASC|DESC|NUMERIC|REGULAR|STRING)|TR_PAD_(?:BOTH|LEFT|RIGHT))|T(?:HOUS(?:ANDS_SEP|EP)|_FMT(?:_AMPM|))|YES(?:EXPR|STR)|STD(?:IN|OUT|ERR))\\b"},{token:function(e){return n.hasOwnProperty(e)?"keyword":o.hasOwnProperty(e)?"constant.language":u.hasOwnProperty(e)?"variable.language":l.hasOwnProperty(e)?"invalid.illegal":t.hasOwnProperty(e)?"support.function":e=="debugger"?"invalid.deprecated":e.match(/^(\$[a-zA-Z_\x7f-\uffff][a-zA-Z0-9_\x7f-\uffff]*|self|parent)$/)?"variable":"identifier"},regex:/[a-zA-Z_$\x7f-\uffff][a-zA-Z0-9_\x7f-\uffff]*/},{onMatch:function(e,t,n){e=e.substr(3);if(e[0]=="'"||e[0]=='"')e=e.slice(1,-1);return n.unshift(this.next,e),"markup.list"},regex:/<<<(?:\w+|'\w+'|"\w+")$/,next:"heredoc"},{token:"keyword.operator",regex:"::|!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|!=|!==|<=|>=|=>|<<=|>>=|>>>=|<>|<|>|=|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],heredoc:[{onMatch:function(e,t,n){return n[1]!=e?"string":(n.shift(),n.shift(),"markup.list")},regex:"^\\w+(?=;?$)",next:"start"},{token:"string",regex:".*"}],comment:[{token:"comment",regex:"\\*\\/",next:"start"},{defaultToken:"comment"}],qqstring:[{token:"constant.language.escape",regex:'\\\\(?:[nrtvef\\\\"$]|[0-7]{1,3}|x[0-9A-Fa-f]{1,2})'},{token:"variable",regex:/\$[\w]+(?:\[[\w\]+]|[=\-]>\w+)?/},{token:"variable",regex:/\$\{[^"\}]+\}?/},{token:"string",regex:'"',next:"start"},{defaultToken:"string"}],qstring:[{token:"constant.language.escape",regex:/\\['\\]/},{token:"string",regex:"'",next:"start"},{defaultToken:"string"}]},this.embedRules(s,"doc-",[s.getEndRule("start")])};r.inherits(a,o);var f=function(){u.call(this);var e=[{token:"support.php_tag",regex:"<\\?(?:php|=)?",push:"php-start"}],t=[{token:"support.php_tag",regex:"\\?>",next:"pop"}];for(var n in this.$rules)this.$rules[n].unshift.apply(this.$rules[n],e);this.embedRules(a,"php-",t,["start"]),this.normalizeRules()};r.inherits(f,u),t.PhpHighlightRules=f,t.PhpLangHighlightRules=a}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("../../token_iterator").TokenIterator,o=e("../../lib/lang"),u=["text","paren.rparen","punctuation.operator"],a=["text","paren.rparen","punctuation.operator","comment"],f,l={},c=function(e){var t=-1;e.multiSelect&&(t=e.selection.index,l.rangeCount!=e.multiSelect.rangeCount&&(l={rangeCount:e.multiSelect.rangeCount}));if(l[t])return f=l[t];f=l[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},h=function(){this.add("braces","insertion",function(e,t,n,r,i){var s=n.getCursorPosition(),u=r.doc.getLine(s.row);if(i=="{"){c(n);var a=n.getSelectionRange(),l=r.doc.getTextRange(a);if(l!==""&&l!=="{"&&n.getWrapBehavioursEnabled())return{text:"{"+l+"}",selection:!1};if(h.isSaneInsertion(n,r))return/[\]\}\)]/.test(u[s.column])||n.inMultiSelectMode?(h.recordAutoInsert(n,r,"}"),{text:"{}",selection:[1,1]}):(h.recordMaybeInsert(n,r,"{"),{text:"{",selection:[1,1]})}else if(i=="}"){c(n);var p=u.substring(s.column,s.column+1);if(p=="}"){var d=r.$findOpeningBracket("}",{column:s.column+1,row:s.row});if(d!==null&&h.isAutoInsertedClosing(s,u,i))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else{if(i=="\n"||i=="\r\n"){c(n);var v="";h.isMaybeInsertedClosing(s,u)&&(v=o.stringRepeat("}",f.maybeInsertedBrackets),h.clearMaybeInsertedClosing());var p=u.substring(s.column,s.column+1);if(p==="}"){var m=r.findMatchingBracket({row:s.row,column:s.column+1},"}");if(!m)return null;var g=this.$getIndent(r.getLine(m.row))}else{if(!v){h.clearMaybeInsertedClosing();return}var g=this.$getIndent(u)}var y=g+r.getTabString();return{text:"\n"+y+"\n"+g+v,selection:[1,y.length,1,y.length]}}h.clearMaybeInsertedClosing()}}),this.add("braces","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="{"){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.end.column,i.end.column+1);if(u=="}")return i.end.column++,i;f.maybeInsertedBrackets--}}),this.add("parens","insertion",function(e,t,n,r,i){if(i=="("){c(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapBehavioursEnabled())return{text:"("+o+")",selection:!1};if(h.isSaneInsertion(n,r))return h.recordAutoInsert(n,r,")"),{text:"()",selection:[1,1]}}else if(i==")"){c(n);var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(f==")"){var l=r.$findOpeningBracket(")",{column:u.column+1,row:u.row});if(l!==null&&h.isAutoInsertedClosing(u,a,i))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="("){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==")")return i.end.column++,i}}),this.add("brackets","insertion",function(e,t,n,r,i){if(i=="["){c(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapBehavioursEnabled())return{text:"["+o+"]",selection:!1};if(h.isSaneInsertion(n,r))return h.recordAutoInsert(n,r,"]"),{text:"[]",selection:[1,1]}}else if(i=="]"){c(n);var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(f=="]"){var l=r.$findOpeningBracket("]",{column:u.column+1,row:u.row});if(l!==null&&h.isAutoInsertedClosing(u,a,i))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="["){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u=="]")return i.end.column++,i}}),this.add("string_dquotes","insertion",function(e,t,n,r,i){if(i=='"'||i=="'"){c(n);var s=i,o=n.getSelectionRange(),u=r.doc.getTextRange(o);if(u!==""&&u!=="'"&&u!='"'&&n.getWrapBehavioursEnabled())return{text:s+u+s,selection:!1};var a=n.getCursorPosition(),f=r.doc.getLine(a.row),l=f.substring(a.column-1,a.column),h=f.substring(a.column,a.column+1),p=r.getTokenAt(a.row,a.column),d=r.getTokenAt(a.row,a.column+1);if(l=="\\"&&p&&/escape/.test(p.type))return null;var v=p&&/string/.test(p.type),m=!d||/string/.test(d.type),g;if(h==s)g=v!==m;else{if(v&&!m)return null;if(v&&m)return null;var y=r.$mode.tokenRe;y.lastIndex=0;var b=y.test(l);y.lastIndex=0;var w=y.test(l);if(b||w)return null;if(h&&!/[\s;,.})\]\\]/.test(h))return null;g=!0}return{text:g?s+s:"",selection:[1,1]}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&(s=='"'||s=="'")){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==s)return i.end.column++,i}})};h.isSaneInsertion=function(e,t){var n=e.getCursorPosition(),r=new s(t,n.row,n.column);if(!this.$matchTokenType(r.getCurrentToken()||"text",u)){var i=new s(t,n.row,n.column+1);if(!this.$matchTokenType(i.getCurrentToken()||"text",u))return!1}return r.stepForward(),r.getCurrentTokenRow()!==n.row||this.$matchTokenType(r.getCurrentToken()||"text",a)},h.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},h.recordAutoInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isAutoInsertedClosing(r,i,f.autoInsertedLineEnd[0])||(f.autoInsertedBrackets=0),f.autoInsertedRow=r.row,f.autoInsertedLineEnd=n+i.substr(r.column),f.autoInsertedBrackets++},h.recordMaybeInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isMaybeInsertedClosing(r,i)||(f.maybeInsertedBrackets=0),f.maybeInsertedRow=r.row,f.maybeInsertedLineStart=i.substr(0,r.column)+n,f.maybeInsertedLineEnd=i.substr(r.column),f.maybeInsertedBrackets++},h.isAutoInsertedClosing=function(e,t,n){return f.autoInsertedBrackets>0&&e.row===f.autoInsertedRow&&n===f.autoInsertedLineEnd[0]&&t.substr(e.column)===f.autoInsertedLineEnd},h.isMaybeInsertedClosing=function(e,t){return f.maybeInsertedBrackets>0&&e.row===f.maybeInsertedRow&&t.substr(e.column)===f.maybeInsertedLineEnd&&t.substr(0,e.column)==f.maybeInsertedLineStart},h.popAutoInsertedClosing=function(){f.autoInsertedLineEnd=f.autoInsertedLineEnd.substr(1),f.autoInsertedBrackets--},h.clearMaybeInsertedClosing=function(){f&&(f.maybeInsertedBrackets=0,f.maybeInsertedRow=-1)},r.inherits(h,i),t.CstyleBehaviour=h}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/(\{|\[)[^\}\]]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var i=this._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?"start":i},this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n);if(this.startRegionRe.test(i))return this.getCommentRegionBlock(e,i,n);var s=i.match(this.foldingStartMarker);if(s){var o=s.index;if(s[1])return this.openingBracketBlock(e,s[1],n,o);var u=e.getCommentFoldRange(n,o+s[0].length,1);return u&&!u.isMultiLine()&&(r?u=this.getSectionRange(e,n):t!="all"&&(u=null)),u}if(t==="markbegin")return;var s=i.match(this.foldingStopMarker);if(s){var o=s.index+s[0].length;return s[1]?this.closingBracketBlock(e,s[1],n,o):e.getCommentFoldRange(n,o,-1)}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length;t+=1;var u=t,a=e.getLength();while(++tf)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)},this.getCommentRegionBlock=function(e,t,n){var r=t.search(/\s*$/),s=e.getLength(),o=n,u=/^\s*(?:\/\*|\/\/)#(end)?region\b/,a=1;while(++no)return new i(o,r,l,t.length)}}.call(o.prototype)}),ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./javascript_highlight_rules").JavaScriptHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,u=e("../range").Range,a=e("../worker/worker_client").WorkerClient,f=e("./behaviour/cstyle").CstyleBehaviour,l=e("./folding/cstyle").FoldMode,c=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new f,this.foldingRules=new l};r.inherits(c,i),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e),s=i.tokens,o=i.state;if(s.length&&s[s.length-1].type=="comment")return r;if(e=="start"||e=="no_regex"){var u=t.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);u&&(r+=n)}else if(e=="doc-start"){if(o=="start"||o=="no_regex")return"";var u=t.match(/^\s*(\/?)\*/);u&&(u[1]&&(r+=" "),r+="* ")}return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.createWorker=function(e){var t=new a(["ace"],"ace/mode/javascript_worker","JavaScriptWorker");return t.attachToDocument(e.getDocument()),t.on("jslint",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/javascript"}.call(c.prototype),t.Mode=c}),ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("./cstyle").CstyleBehaviour,o=e("../../token_iterator").TokenIterator,u=function(){this.inherit(s),this.add("colon","insertion",function(e,t,n,r,i){if(i===":"){var s=n.getCursorPosition(),u=new o(r,s.row,s.column),a=u.getCurrentToken();a&&a.value.match(/\s+/)&&(a=u.stepBackward());if(a&&a.type==="support.type"){var f=r.doc.getLine(s.row),l=f.substring(s.column,s.column+1);if(l===":")return{text:"",selection:[1,1]};if(!f.substring(s.column).match(/^\s*;/))return{text:":;",selection:[1,1]}}}}),this.add("colon","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s===":"){var u=n.getCursorPosition(),a=new o(r,u.row,u.column),f=a.getCurrentToken();f&&f.value.match(/\s+/)&&(f=a.stepBackward());if(f&&f.type==="support.type"){var l=r.doc.getLine(i.start.row),c=l.substring(i.end.column,i.end.column+1);if(c===";")return i.end.column++,i}}}),this.add("semicolon","insertion",function(e,t,n,r,i){if(i===";"){var s=n.getCursorPosition(),o=r.doc.getLine(s.row),u=o.substring(s.column,s.column+1);if(u===";")return{text:"",selection:[1,1]}}})};r.inherits(u,s),t.CssBehaviour=u}),ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/css","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./css_highlight_rules").CssHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,u=e("../worker/worker_client").WorkerClient,a=e("./behaviour/css").CssBehaviour,f=e("./folding/cstyle").FoldMode,l=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new a,this.foldingRules=new f};r.inherits(l,i),function(){this.foldingRules="cStyle",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e).tokens;if(i.length&&i[i.length-1].type=="comment")return r;var s=t.match(/^.*\{\s*$/);return s&&(r+=n),r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.createWorker=function(e){var t=new u(["ace"],"ace/mode/css_worker","Worker");return t.attachToDocument(e.getDocument()),t.on("csslint",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/css"}.call(l.prototype),t.Mode=l}),ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,n){"use strict";function u(e,t){return e.type.lastIndexOf(t+".xml")>-1}var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("../../token_iterator").TokenIterator,o=e("../../lib/lang"),a=function(){this.add("string_dquotes","insertion",function(e,t,n,r,i){if(i=='"'||i=="'"){var o=i,a=r.doc.getTextRange(n.getSelectionRange());if(a!==""&&a!=="'"&&a!='"'&&n.getWrapBehavioursEnabled())return{text:o+a+o,selection:!1};var f=n.getCursorPosition(),l=r.doc.getLine(f.row),c=l.substring(f.column,f.column+1),h=new s(r,f.row,f.column),p=h.getCurrentToken();if(c==o&&(u(p,"attribute-value")||u(p,"string")))return{text:"",selection:[1,1]};p||(p=h.stepBackward());if(!p)return;while(u(p,"tag-whitespace")||u(p,"whitespace"))p=h.stepBackward();var d=!c||c.match(/\s/);if(u(p,"attribute-equals")&&(d||c==">")||u(p,"decl-attribute-equals")&&(d||c=="?"))return{text:o+o,selection:[1,1]}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&(s=='"'||s=="'")){var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==s)return i.end.column++,i}}),this.add("autoclosing","insertion",function(e,t,n,r,i){if(i==">"){var o=n.getCursorPosition(),a=new s(r,o.row,o.column),f=a.getCurrentToken()||a.stepBackward();if(!f||!(u(f,"tag-name")||u(f,"tag-whitespace")||u(f,"attribute-name")||u(f,"attribute-equals")||u(f,"attribute-value")))return;if(u(f,"reference.attribute-value"))return;if(u(f,"attribute-value")){var l=f.value.charAt(0);if(l=='"'||l=="'"){var c=f.value.charAt(f.value.length-1),h=a.getCurrentTokenColumn()+f.value.length;if(h>o.column||h==o.column&&l!=c)return}}while(!u(f,"tag-name"))f=a.stepBackward();var p=a.getCurrentTokenRow(),d=a.getCurrentTokenColumn();if(u(a.stepBackward(),"end-tag-open"))return;var v=f.value;p==o.row&&(v=v.substring(0,o.column-d));if(this.voidElements.hasOwnProperty(v.toLowerCase()))return;return{text:">",selection:[1,1]}}}),this.add("autoindent","insertion",function(e,t,n,r,i){if(i=="\n"){var o=n.getCursorPosition(),u=r.getLine(o.row),a=new s(r,o.row,o.column),f=a.getCurrentToken();if(f&&f.type.indexOf("tag-close")!==-1){while(f&&f.type.indexOf("tag-name")===-1)f=a.stepBackward();if(!f)return;var l=f.value,c=a.getCurrentTokenRow();f=a.stepBackward();if(!f||f.type.indexOf("end-tag")!==-1)return;if(this.voidElements&&!this.voidElements[l]){var h=r.getTokenAt(o.row,o.column+1),u=r.getLine(c),p=this.$getIndent(u),d=p+r.getTabString();return h&&h.value==="-1}var r=e("../../lib/oop"),i=e("../../lib/lang"),s=e("../../range").Range,o=e("./fold_mode").FoldMode,u=e("../../token_iterator").TokenIterator,a=t.FoldMode=function(e,t){o.call(this),this.voidElements=e||{},this.optionalEndTags=r.mixin({},this.voidElements),t&&r.mixin(this.optionalEndTags,t)};r.inherits(a,o);var f=function(){this.tagName="",this.closing=!1,this.selfClosing=!1,this.start={row:0,column:0},this.end={row:0,column:0}};(function(){this.getFoldWidget=function(e,t,n){var r=this._getFirstTagInLine(e,n);return r?r.closing||!r.tagName&&r.selfClosing?t=="markbeginend"?"end":"":!r.tagName||r.selfClosing||this.voidElements.hasOwnProperty(r.tagName.toLowerCase())?"":this._findEndTagInLine(e,n,r.tagName,r.end.column)?"":"start":""},this._getFirstTagInLine=function(e,t){var n=e.getTokens(t),r=new f;for(var i=0;i";break}}return r}if(l(s,"tag-close"))return r.selfClosing=s.value=="/>",r;r.start.column+=s.value.length}return null},this._findEndTagInLine=function(e,t,n,r){var i=e.getTokens(t),s=0;for(var o=0;o",n.end.row=e.getCurrentTokenRow(),n.end.column=e.getCurrentTokenColumn()+t.value.length,e.stepForward(),n;while(t=e.stepForward());return null},this._readTagBackward=function(e){var t=e.getCurrentToken();if(!t)return null;var n=new f;do{if(l(t,"tag-open"))return n.closing=l(t,"end-tag-open"),n.start.row=e.getCurrentTokenRow(),n.start.column=e.getCurrentTokenColumn(),e.stepBackward(),n;l(t,"tag-name")?n.tagName=t.value:l(t,"tag-close")&&(n.selfClosing=t.value=="/>",n.end.row=e.getCurrentTokenRow(),n.end.column=e.getCurrentTokenColumn()+t.value.length)}while(t=e.stepBackward());return null},this._pop=function(e,t){while(e.length){var n=e[e.length-1];if(!t||n.tagName==t.tagName)return e.pop();if(this.optionalEndTags.hasOwnProperty(n.tagName)){e.pop();continue}return null}},this.getFoldWidgetRange=function(e,t,n){var r=this._getFirstTagInLine(e,n);if(!r)return null;var i=r.closing||r.selfClosing,o=[],a;if(!i){var f=new u(e,n,r.start.column),l={row:n,column:r.start.column+r.tagName.length+2};while(a=this._readTagForward(f)){if(a.selfClosing){if(!o.length)return a.start.column+=a.tagName.length+2,a.end.column-=2,s.fromPoints(a.start,a.end);continue}if(a.closing){this._pop(o,a);if(o.length==0)return s.fromPoints(l,a.start)}else o.push(a)}}else{var f=new u(e,n,r.end.column),c={row:n,column:r.start.column};while(a=this._readTagBackward(f)){if(a.selfClosing){if(!o.length)return a.start.column+=a.tagName.length+2,a.end.column-=2,s.fromPoints(a.start,a.end);continue}if(!a.closing){this._pop(o,a);if(o.length==0)return a.start.column+=a.tagName.length+2,s.fromPoints(a.start,c)}else o.push(a)}}}}).call(a.prototype)}),ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("./mixed").FoldMode,s=e("./xml").FoldMode,o=e("./cstyle").FoldMode,u=t.FoldMode=function(e,t){i.call(this,new s(e,t),{"js-":new o,"css-":new o})};r.inherits(u,i)}),ace.define("ace/mode/html_completions",["require","exports","module","ace/token_iterator"],function(e,t,n){"use strict";function f(e,t){return e.type.lastIndexOf(t+".xml")>-1}function l(e,t){var n=new r(e,t.row,t.column),i=n.getCurrentToken();while(i&&!f(i,"tag-name"))i=n.stepBackward();if(i)return i.value}var r=e("../token_iterator").TokenIterator,i=["accesskey","class","contenteditable","contextmenu","dir","draggable","dropzone","hidden","id","inert","itemid","itemprop","itemref","itemscope","itemtype","lang","spellcheck","style","tabindex","title","translate"],s=["onabort","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncontextmenu","oncuechange","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onmousedown","onmousemove","onmouseout","onmouseover","onmouseup","onmousewheel","onpause","onplay","onplaying","onprogress","onratechange","onreset","onscroll","onseeked","onseeking","onselect","onshow","onstalled","onsubmit","onsuspend","ontimeupdate","onvolumechange","onwaiting"],o=i.concat(s),u={html:["manifest"],head:[],title:[],base:["href","target"],link:["href","hreflang","rel","media","type","sizes"],meta:["http-equiv","name","content","charset"],style:["type","media","scoped"],script:["charset","type","src","defer","async"],noscript:["href"],body:["onafterprint","onbeforeprint","onbeforeunload","onhashchange","onmessage","onoffline","onpopstate","onredo","onresize","onstorage","onundo","onunload"],section:[],nav:[],article:["pubdate"],aside:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],footer:[],address:[],main:[],p:[],hr:[],pre:[],blockquote:["cite"],ol:["start","reversed"],ul:[],li:["value"],dl:[],dt:[],dd:[],figure:[],figcaption:[],div:[],a:["href","target","ping","rel","media","hreflang","type"],em:[],strong:[],small:[],s:[],cite:[],q:["cite"],dfn:[],abbr:[],data:[],time:["datetime"],code:[],"var":[],samp:[],kbd:[],sub:[],sup:[],i:[],b:[],u:[],mark:[],ruby:[],rt:[],rp:[],bdi:[],bdo:[],span:[],br:[],wbr:[],ins:["cite","datetime"],del:["cite","datetime"],img:["alt","src","height","width","usemap","ismap"],iframe:["name","src","height","width","sandbox","seamless"],embed:["src","height","width","type"],object:["param","data","type","height","width","usemap","name","form","classid"],param:["name","value"],video:["src","autobuffer","autoplay","loop","controls","width","height","poster"],audio:["src","autobuffer","autoplay","loop","controls"],source:["src","type","media"],track:["kind","src","srclang","label","default"],canvas:["width","height"],map:["name"],area:["shape","coords","href","hreflang","alt","target","media","rel","ping","type"],svg:[],math:[],table:["summary"],caption:[],colgroup:["span"],col:["span"],tbody:[],thead:[],tfoot:[],tr:[],td:["headers","rowspan","colspan"],th:["headers","rowspan","colspan","scope"],form:["accept-charset","action","autocomplete","enctype","method","name","novalidate","target"],fieldset:["disabled","form","name"],legend:[],label:["form","for"],input:["type","accept","alt","autocomplete","checked","disabled","form","formaction","formenctype","formmethod","formnovalidate","formtarget","height","list","max","maxlength","min","multiple","pattern","placeholder","readonly","required","size","src","step","width","files","value"],button:["autofocus","disabled","form","formaction","formenctype","formmethod","formnovalidate","formtarget","name","value","type"],select:["autofocus","disabled","form","multiple","name","size"],datalist:[],optgroup:["disabled","label"],option:["disabled","selected","label","value"],textarea:["autofocus","disabled","form","maxlength","name","placeholder","readonly","required","rows","cols","wrap"],keygen:["autofocus","challenge","disabled","form","keytype","name"],output:["for","form","name"],progress:["value","max"],meter:["value","min","max","low","high","optimum"],details:["open"],summary:[],command:["type","label","icon","disabled","checked","radiogroup","command"],menu:["type","label"],dialog:["open"]},a=Object.keys(u),c=function(){};(function(){this.getCompletions=function(e,t,n,r){var i=t.getTokenAt(n.row,n.column);return i?f(i,"tag-name")||f(i,"tag-open")||f(i,"end-tag-open")?this.getTagCompletions(e,t,n,r):f(i,"tag-whitespace")||f(i,"attribute-name")?this.getAttributeCompetions(e,t,n,r):[]:[]},this.getTagCompletions=function(e,t,n,r){return a.map(function(e){return{value:e,meta:"tag",score:Number.MAX_VALUE}})},this.getAttributeCompetions=function(e,t,n,r){var i=l(t,n);if(!i)return[];var s=o;return i in u&&(s=s.concat(u[i])),s.map(function(e){return{caption:e,snippet:e+'="$0"',meta:"attribute",score:Number.MAX_VALUE}})}}).call(c.prototype),t.HtmlCompletions=c}),ace.define("ace/mode/html",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/javascript","ace/mode/css","ace/mode/html_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/html","ace/mode/html_completions","ace/worker/worker_client"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text").Mode,o=e("./javascript").Mode,u=e("./css").Mode,a=e("./html_highlight_rules").HtmlHighlightRules,f=e("./behaviour/xml").XmlBehaviour,l=e("./folding/html").FoldMode,c=e("./html_completions").HtmlCompletions,h=e("../worker/worker_client").WorkerClient,p=["area","base","br","col","embed","hr","img","input","keygen","link","meta","menuitem","param","source","track","wbr"],d=["li","dt","dd","p","rt","rp","optgroup","option","colgroup","td","th"],v=function(e){this.fragmentContext=e&&e.fragmentContext,this.HighlightRules=a,this.$behaviour=new f,this.$completer=new c,this.createModeDelegates({"js-":o,"css-":u}),this.foldingRules=new l(this.voidElements,i.arrayToMap(d))};r.inherits(v,s),function(){this.blockComment={start:""},this.voidElements=i.arrayToMap(p),this.getNextLineIndent=function(e,t,n){return this.$getIndent(t)},this.checkOutdent=function(e,t,n){return!1},this.getCompletions=function(e,t,n,r){return this.$completer.getCompletions(e,t,n,r)},this.createWorker=function(e){if(this.constructor!=v)return;var t=new h(["ace"],"ace/mode/html_worker","Worker");return t.attachToDocument(e.getDocument()),this.fragmentContext&&t.call("setOptions",[{context:this.fragmentContext}]),t.on("error",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/html"}.call(v.prototype),t.Mode=v}),ace.define("ace/mode/php",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/php_highlight_rules","ace/mode/php_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle","ace/unicode","ace/mode/html","ace/mode/javascript","ace/mode/css"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./php_highlight_rules").PhpHighlightRules,o=e("./php_highlight_rules").PhpLangHighlightRules,u=e("./matching_brace_outdent").MatchingBraceOutdent,a=e("../range").Range,f=e("../worker/worker_client").WorkerClient,l=e("./behaviour/cstyle").CstyleBehaviour,c=e("./folding/cstyle").FoldMode,h=e("../unicode"),p=e("./html").Mode,d=e("./javascript").Mode,v=e("./css").Mode,m=function(e){this.HighlightRules=o,this.$outdent=new u,this.$behaviour=new l,this.foldingRules=new c};r.inherits(m,i),function(){this.tokenRe=new RegExp("^["+h.packages.L+h.packages.Mn+h.packages.Mc+h.packages.Nd+h.packages.Pc+"_]+","g"),this.nonTokenRe=new RegExp("^(?:[^"+h.packages.L+h.packages.Mn+h.packages.Mc+h.packages.Nd+h.packages.Pc+"_]|s])+","g"),this.lineCommentStart=["//","#"],this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e),s=i.tokens,o=i.state;if(s.length&&s[s.length-1].type=="comment")return r;if(e=="start"){var u=t.match(/^.*[\{\(\[\:]\s*$/);u&&(r+=n)}else if(e=="doc-start"){if(o!="doc-start")return"";var u=t.match(/^\s*(\/?)\*/);u&&(u[1]&&(r+=" "),r+="* ")}return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.$id="ace/mode/php-inline"}.call(m.prototype);var g=function(e){if(e&&e.inline){var t=new m;return t.createWorker=this.createWorker,t.inlinePhp=!0,t}p.call(this),this.HighlightRules=s,this.createModeDelegates({"js-":d,"css-":v,"php-":m}),this.foldingRules.subModes["php-"]=new c};r.inherits(g,p),function(){this.createWorker=function(e){var t=new f(["ace"],"ace/mode/php_worker","PhpWorker");return t.attachToDocument(e.getDocument()),this.inlinePhp&&t.call("setOptions",[{inline:!0}]),t.on("error",function(t){e.setAnnotations(t.data)}),t.on("ok",function(){e.clearAnnotations()}),t},this.$id="ace/mode/php"}.call(g.prototype),t.Mode=g}) \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/mode-plain_text.js b/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/mode-plain_text.js new file mode 100644 index 000000000..be72ab998 --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/mode-plain_text.js @@ -0,0 +1 @@ +ace.define("ace/mode/plain_text",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/text_highlight_rules","ace/mode/behaviour"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./text_highlight_rules").TextHighlightRules,o=e("./behaviour").Behaviour,u=function(){this.HighlightRules=s,this.$behaviour=new o};r.inherits(u,i),function(){this.type="text",this.getNextLineIndent=function(e,t,n){return""},this.$id="ace/mode/plain_text"}.call(u.prototype),t.Mode=u}) \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/mode-sass.js b/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/mode-sass.js new file mode 100644 index 000000000..91a991d6d --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/mode-sass.js @@ -0,0 +1 @@ +ace.define("ace/mode/scss_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text_highlight_rules").TextHighlightRules,o=function(){var e=i.arrayToMap(function(){var e="-webkit-|-moz-|-o-|-ms-|-svg-|-pie-|-khtml-".split("|"),t="appearance|background-clip|background-inline-policy|background-origin|background-size|binding|border-bottom-colors|border-left-colors|border-right-colors|border-top-colors|border-end|border-end-color|border-end-style|border-end-width|border-image|border-start|border-start-color|border-start-style|border-start-width|box-align|box-direction|box-flex|box-flexgroup|box-ordinal-group|box-orient|box-pack|box-sizing|column-count|column-gap|column-width|column-rule|column-rule-width|column-rule-style|column-rule-color|float-edge|font-feature-settings|font-language-override|force-broken-image-icon|image-region|margin-end|margin-start|opacity|outline|outline-color|outline-offset|outline-radius|outline-radius-bottomleft|outline-radius-bottomright|outline-radius-topleft|outline-radius-topright|outline-style|outline-width|padding-end|padding-start|stack-sizing|tab-size|text-blink|text-decoration-color|text-decoration-line|text-decoration-style|transform|transform-origin|transition|transition-delay|transition-duration|transition-property|transition-timing-function|user-focus|user-input|user-modify|user-select|window-shadow|border-radius".split("|"),n="azimuth|background-attachment|background-color|background-image|background-position|background-repeat|background|border-bottom-color|border-bottom-style|border-bottom-width|border-bottom|border-collapse|border-color|border-left-color|border-left-style|border-left-width|border-left|border-right-color|border-right-style|border-right-width|border-right|border-spacing|border-style|border-top-color|border-top-style|border-top-width|border-top|border-width|border|bottom|box-shadow|box-sizing|caption-side|clear|clip|color|content|counter-increment|counter-reset|cue-after|cue-before|cue|cursor|direction|display|elevation|empty-cells|float|font-family|font-size-adjust|font-size|font-stretch|font-style|font-variant|font-weight|font|height|left|letter-spacing|line-height|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|marker-offset|margin|marks|max-height|max-width|min-height|min-width|opacity|orphans|outline-color|outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page|pause-after|pause-before|pause|pitch-range|pitch|play-during|position|quotes|richness|right|size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|stress|table-layout|text-align|text-decoration|text-indent|text-shadow|text-transform|top|unicode-bidi|vertical-align|visibility|voice-family|volume|white-space|widows|width|word-spacing|z-index".split("|"),r=[];for(var i=0,s=e.length;i|<=|>=|==|!=|-|%|#|\\+|\\$|\\+|\\*"},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"},{caseInsensitive:!0}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",regex:".+"}],qqstring:[{token:"string",regex:'(?:(?:\\\\.)|(?:[^"\\\\]))*?"',next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]}};r.inherits(o,s),t.ScssHighlightRules=o}),ace.define("ace/mode/sass_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/scss_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./scss_highlight_rules").ScssHighlightRules,o=function(){s.call(this);var e=this.$rules.start;e[1].token=="comment"&&(e.splice(1,1,{onMatch:function(e,t,n){return n.unshift(this.next,-1,e.length-2,t),"comment"},regex:/^\s*\/\*/,next:"comment"},{token:"error.invalid",regex:"/\\*|[{;}]"},{token:"support.type",regex:/^\s*:[\w\-]+\s/}),this.$rules.comment=[{regex:/^\s*/,onMatch:function(e,t,n){return n[1]===-1&&(n[1]=Math.max(n[2],e.length-1)),e.length<=n[1]?(n.shift(),n.shift(),n.shift(),this.next=n.shift(),"text"):(this.next="","comment")},next:"start"},{defaultToken:"comment"}])};r.inherits(o,s),t.SassHighlightRules=o}),ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("./fold_mode").FoldMode,s=e("../../range").Range,o=t.FoldMode=function(){};r.inherits(o,i),function(){this.getFoldWidgetRange=function(e,t,n){var r=this.indentationBlock(e,n);if(r)return r;var i=/\S/,o=e.getLine(n),u=o.search(i);if(u==-1||o[u]!="#")return;var a=o.length,f=e.getLength(),l=n,c=n;while(++nl){var p=e.getLine(c).length;return new s(l,a,c,p)}},this.getFoldWidget=function(e,t,n){var r=e.getLine(n),i=r.search(/\S/),s=e.getLine(n+1),o=e.getLine(n-1),u=o.search(/\S/),a=s.search(/\S/);if(i==-1)return e.foldWidgets[n-1]=u!=-1&&u|<=|>=|==|!=|-|%|#|\\+|\\$|\\+|\\*"},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"},{caseInsensitive:!0}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",regex:".+"}],qqstring:[{token:"string",regex:'(?:(?:\\\\.)|(?:[^"\\\\]))*?"',next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]}};r.inherits(o,s),t.ScssHighlightRules=o}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("../../token_iterator").TokenIterator,o=e("../../lib/lang"),u=["text","paren.rparen","punctuation.operator"],a=["text","paren.rparen","punctuation.operator","comment"],f,l={},c=function(e){var t=-1;e.multiSelect&&(t=e.selection.index,l.rangeCount!=e.multiSelect.rangeCount&&(l={rangeCount:e.multiSelect.rangeCount}));if(l[t])return f=l[t];f=l[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},h=function(){this.add("braces","insertion",function(e,t,n,r,i){var s=n.getCursorPosition(),u=r.doc.getLine(s.row);if(i=="{"){c(n);var a=n.getSelectionRange(),l=r.doc.getTextRange(a);if(l!==""&&l!=="{"&&n.getWrapBehavioursEnabled())return{text:"{"+l+"}",selection:!1};if(h.isSaneInsertion(n,r))return/[\]\}\)]/.test(u[s.column])||n.inMultiSelectMode?(h.recordAutoInsert(n,r,"}"),{text:"{}",selection:[1,1]}):(h.recordMaybeInsert(n,r,"{"),{text:"{",selection:[1,1]})}else if(i=="}"){c(n);var p=u.substring(s.column,s.column+1);if(p=="}"){var d=r.$findOpeningBracket("}",{column:s.column+1,row:s.row});if(d!==null&&h.isAutoInsertedClosing(s,u,i))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else{if(i=="\n"||i=="\r\n"){c(n);var v="";h.isMaybeInsertedClosing(s,u)&&(v=o.stringRepeat("}",f.maybeInsertedBrackets),h.clearMaybeInsertedClosing());var p=u.substring(s.column,s.column+1);if(p==="}"){var m=r.findMatchingBracket({row:s.row,column:s.column+1},"}");if(!m)return null;var g=this.$getIndent(r.getLine(m.row))}else{if(!v){h.clearMaybeInsertedClosing();return}var g=this.$getIndent(u)}var y=g+r.getTabString();return{text:"\n"+y+"\n"+g+v,selection:[1,y.length,1,y.length]}}h.clearMaybeInsertedClosing()}}),this.add("braces","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="{"){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.end.column,i.end.column+1);if(u=="}")return i.end.column++,i;f.maybeInsertedBrackets--}}),this.add("parens","insertion",function(e,t,n,r,i){if(i=="("){c(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapBehavioursEnabled())return{text:"("+o+")",selection:!1};if(h.isSaneInsertion(n,r))return h.recordAutoInsert(n,r,")"),{text:"()",selection:[1,1]}}else if(i==")"){c(n);var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(f==")"){var l=r.$findOpeningBracket(")",{column:u.column+1,row:u.row});if(l!==null&&h.isAutoInsertedClosing(u,a,i))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="("){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==")")return i.end.column++,i}}),this.add("brackets","insertion",function(e,t,n,r,i){if(i=="["){c(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapBehavioursEnabled())return{text:"["+o+"]",selection:!1};if(h.isSaneInsertion(n,r))return h.recordAutoInsert(n,r,"]"),{text:"[]",selection:[1,1]}}else if(i=="]"){c(n);var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(f=="]"){var l=r.$findOpeningBracket("]",{column:u.column+1,row:u.row});if(l!==null&&h.isAutoInsertedClosing(u,a,i))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="["){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u=="]")return i.end.column++,i}}),this.add("string_dquotes","insertion",function(e,t,n,r,i){if(i=='"'||i=="'"){c(n);var s=i,o=n.getSelectionRange(),u=r.doc.getTextRange(o);if(u!==""&&u!=="'"&&u!='"'&&n.getWrapBehavioursEnabled())return{text:s+u+s,selection:!1};var a=n.getCursorPosition(),f=r.doc.getLine(a.row),l=f.substring(a.column-1,a.column),h=f.substring(a.column,a.column+1),p=r.getTokenAt(a.row,a.column),d=r.getTokenAt(a.row,a.column+1);if(l=="\\"&&p&&/escape/.test(p.type))return null;var v=p&&/string/.test(p.type),m=!d||/string/.test(d.type),g;if(h==s)g=v!==m;else{if(v&&!m)return null;if(v&&m)return null;var y=r.$mode.tokenRe;y.lastIndex=0;var b=y.test(l);y.lastIndex=0;var w=y.test(l);if(b||w)return null;if(h&&!/[\s;,.})\]\\]/.test(h))return null;g=!0}return{text:g?s+s:"",selection:[1,1]}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&(s=='"'||s=="'")){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==s)return i.end.column++,i}})};h.isSaneInsertion=function(e,t){var n=e.getCursorPosition(),r=new s(t,n.row,n.column);if(!this.$matchTokenType(r.getCurrentToken()||"text",u)){var i=new s(t,n.row,n.column+1);if(!this.$matchTokenType(i.getCurrentToken()||"text",u))return!1}return r.stepForward(),r.getCurrentTokenRow()!==n.row||this.$matchTokenType(r.getCurrentToken()||"text",a)},h.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},h.recordAutoInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isAutoInsertedClosing(r,i,f.autoInsertedLineEnd[0])||(f.autoInsertedBrackets=0),f.autoInsertedRow=r.row,f.autoInsertedLineEnd=n+i.substr(r.column),f.autoInsertedBrackets++},h.recordMaybeInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isMaybeInsertedClosing(r,i)||(f.maybeInsertedBrackets=0),f.maybeInsertedRow=r.row,f.maybeInsertedLineStart=i.substr(0,r.column)+n,f.maybeInsertedLineEnd=i.substr(r.column),f.maybeInsertedBrackets++},h.isAutoInsertedClosing=function(e,t,n){return f.autoInsertedBrackets>0&&e.row===f.autoInsertedRow&&n===f.autoInsertedLineEnd[0]&&t.substr(e.column)===f.autoInsertedLineEnd},h.isMaybeInsertedClosing=function(e,t){return f.maybeInsertedBrackets>0&&e.row===f.maybeInsertedRow&&t.substr(e.column)===f.maybeInsertedLineEnd&&t.substr(0,e.column)==f.maybeInsertedLineStart},h.popAutoInsertedClosing=function(){f.autoInsertedLineEnd=f.autoInsertedLineEnd.substr(1),f.autoInsertedBrackets--},h.clearMaybeInsertedClosing=function(){f&&(f.maybeInsertedBrackets=0,f.maybeInsertedRow=-1)},r.inherits(h,i),t.CstyleBehaviour=h}),ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("./cstyle").CstyleBehaviour,o=e("../../token_iterator").TokenIterator,u=function(){this.inherit(s),this.add("colon","insertion",function(e,t,n,r,i){if(i===":"){var s=n.getCursorPosition(),u=new o(r,s.row,s.column),a=u.getCurrentToken();a&&a.value.match(/\s+/)&&(a=u.stepBackward());if(a&&a.type==="support.type"){var f=r.doc.getLine(s.row),l=f.substring(s.column,s.column+1);if(l===":")return{text:"",selection:[1,1]};if(!f.substring(s.column).match(/^\s*;/))return{text:":;",selection:[1,1]}}}}),this.add("colon","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s===":"){var u=n.getCursorPosition(),a=new o(r,u.row,u.column),f=a.getCurrentToken();f&&f.value.match(/\s+/)&&(f=a.stepBackward());if(f&&f.type==="support.type"){var l=r.doc.getLine(i.start.row),c=l.substring(i.end.column,i.end.column+1);if(c===";")return i.end.column++,i}}}),this.add("semicolon","insertion",function(e,t,n,r,i){if(i===";"){var s=n.getCursorPosition(),o=r.doc.getLine(s.row),u=o.substring(s.column,s.column+1);if(u===";")return{text:"",selection:[1,1]}}})};r.inherits(u,s),t.CssBehaviour=u}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/(\{|\[)[^\}\]]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var i=this._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?"start":i},this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n);if(this.startRegionRe.test(i))return this.getCommentRegionBlock(e,i,n);var s=i.match(this.foldingStartMarker);if(s){var o=s.index;if(s[1])return this.openingBracketBlock(e,s[1],n,o);var u=e.getCommentFoldRange(n,o+s[0].length,1);return u&&!u.isMultiLine()&&(r?u=this.getSectionRange(e,n):t!="all"&&(u=null)),u}if(t==="markbegin")return;var s=i.match(this.foldingStopMarker);if(s){var o=s.index+s[0].length;return s[1]?this.closingBracketBlock(e,s[1],n,o):e.getCommentFoldRange(n,o,-1)}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length;t+=1;var u=t,a=e.getLength();while(++tf)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)},this.getCommentRegionBlock=function(e,t,n){var r=t.search(/\s*$/),s=e.getLength(),o=n,u=/^\s*(?:\/\*|\/\/)#(end)?region\b/,a=1;while(++no)return new i(o,r,l,t.length)}}.call(o.prototype)}),ace.define("ace/mode/scss",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/scss_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/css","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./scss_highlight_rules").ScssHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,u=e("./behaviour/css").CssBehaviour,a=e("./folding/cstyle").FoldMode,f=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new u,this.foldingRules=new a};r.inherits(f,i),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e).tokens;if(i.length&&i[i.length-1].type=="comment")return r;var s=t.match(/^.*\{\s*$/);return s&&(r+=n),r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.$id="ace/mode/scss"}.call(f.prototype),t.Mode=f}) \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/mode-text.js b/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/mode-text.js new file mode 100644 index 000000000..e69de29bb diff --git a/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/mode-xml.js b/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/mode-xml.js new file mode 100644 index 000000000..e9a5bc792 --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/mode-xml.js @@ -0,0 +1 @@ +ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(e){this.$rules={start:[{token:"string.cdata.xml",regex:"<\\!\\[CDATA\\[",next:"cdata"},{token:["punctuation.xml-decl.xml","keyword.xml-decl.xml"],regex:"(<\\?)(xml)(?=[\\s])",next:"xml_decl",caseInsensitive:!0},{token:["punctuation.instruction.xml","keyword.instruction.xml"],regex:"(<\\?)([-_a-zA-Z0-9]+)",next:"processing_instruction"},{token:"comment.xml",regex:"<\\!--",next:"comment"},{token:["xml-pe.doctype.xml","xml-pe.doctype.xml"],regex:"(<\\!)(DOCTYPE)(?=[\\s])",next:"doctype",caseInsensitive:!0},{include:"tag"},{token:"text.end-tag-open.xml",regex:"",next:"start"}],processing_instruction:[{token:"punctuation.instruction.xml",regex:"\\?>",next:"start"},{defaultToken:"instruction.xml"}],doctype:[{include:"whitespace"},{include:"string"},{token:"xml-pe.doctype.xml",regex:">",next:"start"},{token:"xml-pe.xml",regex:"[-_a-zA-Z0-9:]+"},{token:"punctuation.int-subset",regex:"\\[",push:"int_subset"}],int_subset:[{token:"text.xml",regex:"\\s+"},{token:"punctuation.int-subset.xml",regex:"]",next:"pop"},{token:["punctuation.markup-decl.xml","keyword.markup-decl.xml"],regex:"(<\\!)([-_a-zA-Z0-9]+)",push:[{token:"text",regex:"\\s+"},{token:"punctuation.markup-decl.xml",regex:">",next:"pop"},{include:"string"}]}],cdata:[{token:"string.cdata.xml",regex:"\\]\\]>",next:"start"},{token:"text.xml",regex:"\\s+"},{token:"text.xml",regex:"(?:[^\\]]|\\](?!\\]>))+"}],comment:[{token:"comment.xml",regex:"-->",next:"start"},{defaultToken:"comment.xml"}],reference:[{token:"constant.language.escape.reference.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}],attr_reference:[{token:"constant.language.escape.reference.attribute-value.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}],tag:[{token:["meta.tag.punctuation.tag-open.xml","meta.tag.punctuation.end-tag-open.xml","meta.tag.tag-name.xml"],regex:"(?:(<)|(",next:"start"}]}],tag_whitespace:[{token:"text.tag-whitespace.xml",regex:"\\s+"}],whitespace:[{token:"text.whitespace.xml",regex:"\\s+"}],string:[{token:"string.xml",regex:"'",push:[{token:"string.xml",regex:"'",next:"pop"},{defaultToken:"string.xml"}]},{token:"string.xml",regex:'"',push:[{token:"string.xml",regex:'"',next:"pop"},{defaultToken:"string.xml"}]}],attributes:[{token:"entity.other.attribute-name.xml",regex:"(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+"},{token:"keyword.operator.attribute-equals.xml",regex:"="},{include:"tag_whitespace"},{include:"attribute_value"}],attribute_value:[{token:"string.attribute-value.xml",regex:"'",push:[{token:"string.attribute-value.xml",regex:"'",next:"pop"},{include:"attr_reference"},{defaultToken:"string.attribute-value.xml"}]},{token:"string.attribute-value.xml",regex:'"',push:[{token:"string.attribute-value.xml",regex:'"',next:"pop"},{include:"attr_reference"},{defaultToken:"string.attribute-value.xml"}]}]},this.constructor===s&&this.normalizeRules()};(function(){this.embedTagRules=function(e,t,n){this.$rules.tag.unshift({token:["meta.tag.punctuation.tag-open.xml","meta.tag."+n+".tag-name.xml"],regex:"(<)("+n+"(?=\\s|>|$))",next:[{include:"attributes"},{token:"meta.tag.punctuation.tag-close.xml",regex:"/?>",next:t+"start"}]}),this.$rules[n+"-end"]=[{include:"attributes"},{token:"meta.tag.punctuation.tag-close.xml",regex:"/?>",next:"start",onMatch:function(e,t,n){return n.splice(0),this.token}}],this.embedRules(e,t,[{token:["meta.tag.punctuation.end-tag-open.xml","meta.tag."+n+".tag-name.xml"],regex:"(|$))",next:n+"-end"},{token:"string.cdata.xml",regex:"<\\!\\[CDATA\\["},{token:"string.cdata.xml",regex:"\\]\\]>"}])}}).call(i.prototype),r.inherits(s,i),t.XmlHighlightRules=s}),ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,n){"use strict";function u(e,t){return e.type.lastIndexOf(t+".xml")>-1}var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("../../token_iterator").TokenIterator,o=e("../../lib/lang"),a=function(){this.add("string_dquotes","insertion",function(e,t,n,r,i){if(i=='"'||i=="'"){var o=i,a=r.doc.getTextRange(n.getSelectionRange());if(a!==""&&a!=="'"&&a!='"'&&n.getWrapBehavioursEnabled())return{text:o+a+o,selection:!1};var f=n.getCursorPosition(),l=r.doc.getLine(f.row),c=l.substring(f.column,f.column+1),h=new s(r,f.row,f.column),p=h.getCurrentToken();if(c==o&&(u(p,"attribute-value")||u(p,"string")))return{text:"",selection:[1,1]};p||(p=h.stepBackward());if(!p)return;while(u(p,"tag-whitespace")||u(p,"whitespace"))p=h.stepBackward();var d=!c||c.match(/\s/);if(u(p,"attribute-equals")&&(d||c==">")||u(p,"decl-attribute-equals")&&(d||c=="?"))return{text:o+o,selection:[1,1]}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&(s=='"'||s=="'")){var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==s)return i.end.column++,i}}),this.add("autoclosing","insertion",function(e,t,n,r,i){if(i==">"){var o=n.getCursorPosition(),a=new s(r,o.row,o.column),f=a.getCurrentToken()||a.stepBackward();if(!f||!(u(f,"tag-name")||u(f,"tag-whitespace")||u(f,"attribute-name")||u(f,"attribute-equals")||u(f,"attribute-value")))return;if(u(f,"reference.attribute-value"))return;if(u(f,"attribute-value")){var l=f.value.charAt(0);if(l=='"'||l=="'"){var c=f.value.charAt(f.value.length-1),h=a.getCurrentTokenColumn()+f.value.length;if(h>o.column||h==o.column&&l!=c)return}}while(!u(f,"tag-name"))f=a.stepBackward();var p=a.getCurrentTokenRow(),d=a.getCurrentTokenColumn();if(u(a.stepBackward(),"end-tag-open"))return;var v=f.value;p==o.row&&(v=v.substring(0,o.column-d));if(this.voidElements.hasOwnProperty(v.toLowerCase()))return;return{text:">",selection:[1,1]}}}),this.add("autoindent","insertion",function(e,t,n,r,i){if(i=="\n"){var o=n.getCursorPosition(),u=r.getLine(o.row),a=new s(r,o.row,o.column),f=a.getCurrentToken();if(f&&f.type.indexOf("tag-close")!==-1){while(f&&f.type.indexOf("tag-name")===-1)f=a.stepBackward();if(!f)return;var l=f.value,c=a.getCurrentTokenRow();f=a.stepBackward();if(!f||f.type.indexOf("end-tag")!==-1)return;if(this.voidElements&&!this.voidElements[l]){var h=r.getTokenAt(o.row,o.column+1),u=r.getLine(c),p=this.$getIndent(u),d=p+r.getTabString();return h&&h.value==="-1}var r=e("../../lib/oop"),i=e("../../lib/lang"),s=e("../../range").Range,o=e("./fold_mode").FoldMode,u=e("../../token_iterator").TokenIterator,a=t.FoldMode=function(e,t){o.call(this),this.voidElements=e||{},this.optionalEndTags=r.mixin({},this.voidElements),t&&r.mixin(this.optionalEndTags,t)};r.inherits(a,o);var f=function(){this.tagName="",this.closing=!1,this.selfClosing=!1,this.start={row:0,column:0},this.end={row:0,column:0}};(function(){this.getFoldWidget=function(e,t,n){var r=this._getFirstTagInLine(e,n);return r?r.closing||!r.tagName&&r.selfClosing?t=="markbeginend"?"end":"":!r.tagName||r.selfClosing||this.voidElements.hasOwnProperty(r.tagName.toLowerCase())?"":this._findEndTagInLine(e,n,r.tagName,r.end.column)?"":"start":""},this._getFirstTagInLine=function(e,t){var n=e.getTokens(t),r=new f;for(var i=0;i";break}}return r}if(l(s,"tag-close"))return r.selfClosing=s.value=="/>",r;r.start.column+=s.value.length}return null},this._findEndTagInLine=function(e,t,n,r){var i=e.getTokens(t),s=0;for(var o=0;o",n.end.row=e.getCurrentTokenRow(),n.end.column=e.getCurrentTokenColumn()+t.value.length,e.stepForward(),n;while(t=e.stepForward());return null},this._readTagBackward=function(e){var t=e.getCurrentToken();if(!t)return null;var n=new f;do{if(l(t,"tag-open"))return n.closing=l(t,"end-tag-open"),n.start.row=e.getCurrentTokenRow(),n.start.column=e.getCurrentTokenColumn(),e.stepBackward(),n;l(t,"tag-name")?n.tagName=t.value:l(t,"tag-close")&&(n.selfClosing=t.value=="/>",n.end.row=e.getCurrentTokenRow(),n.end.column=e.getCurrentTokenColumn()+t.value.length)}while(t=e.stepBackward());return null},this._pop=function(e,t){while(e.length){var n=e[e.length-1];if(!t||n.tagName==t.tagName)return e.pop();if(this.optionalEndTags.hasOwnProperty(n.tagName)){e.pop();continue}return null}},this.getFoldWidgetRange=function(e,t,n){var r=this._getFirstTagInLine(e,n);if(!r)return null;var i=r.closing||r.selfClosing,o=[],a;if(!i){var f=new u(e,n,r.start.column),l={row:n,column:r.start.column+r.tagName.length+2};while(a=this._readTagForward(f)){if(a.selfClosing){if(!o.length)return a.start.column+=a.tagName.length+2,a.end.column-=2,s.fromPoints(a.start,a.end);continue}if(a.closing){this._pop(o,a);if(o.length==0)return s.fromPoints(l,a.start)}else o.push(a)}}else{var f=new u(e,n,r.end.column),c={row:n,column:r.start.column};while(a=this._readTagBackward(f)){if(a.selfClosing){if(!o.length)return a.start.column+=a.tagName.length+2,a.end.column-=2,s.fromPoints(a.start,a.end);continue}if(!a.closing){this._pop(o,a);if(o.length==0)return a.start.column+=a.tagName.length+2,s.fromPoints(a.start,c)}else o.push(a)}}}}).call(a.prototype)}),ace.define("ace/mode/xml",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/xml_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/xml"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text").Mode,o=e("./xml_highlight_rules").XmlHighlightRules,u=e("./behaviour/xml").XmlBehaviour,a=e("./folding/xml").FoldMode,f=function(){this.HighlightRules=o,this.$behaviour=new u,this.foldingRules=new a};r.inherits(f,s),function(){this.voidElements=i.arrayToMap([]),this.blockComment={start:""},this.$id="ace/mode/xml"}.call(f.prototype),t.Mode=f}) \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/snippets/css.js b/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/snippets/css.js new file mode 100644 index 000000000..23306a8a9 --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/snippets/css.js @@ -0,0 +1 @@ +ace.define("ace/snippets/css",["require","exports","module"],function(e,t,n){"use strict";t.snippetText="snippet .\n ${1} {\n ${2}\n }\nsnippet !\n !important\nsnippet bdi:m+\n -moz-border-image: url(${1}) ${2:0} ${3:0} ${4:0} ${5:0} ${6:stretch} ${7:stretch};\nsnippet bdi:m\n -moz-border-image: ${1};\nsnippet bdrz:m\n -moz-border-radius: ${1};\nsnippet bxsh:m+\n -moz-box-shadow: ${1:0} ${2:0} ${3:0} #${4:000};\nsnippet bxsh:m\n -moz-box-shadow: ${1};\nsnippet bdi:w+\n -webkit-border-image: url(${1}) ${2:0} ${3:0} ${4:0} ${5:0} ${6:stretch} ${7:stretch};\nsnippet bdi:w\n -webkit-border-image: ${1};\nsnippet bdrz:w\n -webkit-border-radius: ${1};\nsnippet bxsh:w+\n -webkit-box-shadow: ${1:0} ${2:0} ${3:0} #${4:000};\nsnippet bxsh:w\n -webkit-box-shadow: ${1};\nsnippet @f\n @font-face {\n font-family: ${1};\n src: url(${2});\n }\nsnippet @i\n @import url(${1});\nsnippet @m\n @media ${1:print} {\n ${2}\n }\nsnippet bg+\n background: #${1:FFF} url(${2}) ${3:0} ${4:0} ${5:no-repeat};\nsnippet bga\n background-attachment: ${1};\nsnippet bga:f\n background-attachment: fixed;\nsnippet bga:s\n background-attachment: scroll;\nsnippet bgbk\n background-break: ${1};\nsnippet bgbk:bb\n background-break: bounding-box;\nsnippet bgbk:c\n background-break: continuous;\nsnippet bgbk:eb\n background-break: each-box;\nsnippet bgcp\n background-clip: ${1};\nsnippet bgcp:bb\n background-clip: border-box;\nsnippet bgcp:cb\n background-clip: content-box;\nsnippet bgcp:nc\n background-clip: no-clip;\nsnippet bgcp:pb\n background-clip: padding-box;\nsnippet bgc\n background-color: #${1:FFF};\nsnippet bgc:t\n background-color: transparent;\nsnippet bgi\n background-image: url(${1});\nsnippet bgi:n\n background-image: none;\nsnippet bgo\n background-origin: ${1};\nsnippet bgo:bb\n background-origin: border-box;\nsnippet bgo:cb\n background-origin: content-box;\nsnippet bgo:pb\n background-origin: padding-box;\nsnippet bgpx\n background-position-x: ${1};\nsnippet bgpy\n background-position-y: ${1};\nsnippet bgp\n background-position: ${1:0} ${2:0};\nsnippet bgr\n background-repeat: ${1};\nsnippet bgr:n\n background-repeat: no-repeat;\nsnippet bgr:x\n background-repeat: repeat-x;\nsnippet bgr:y\n background-repeat: repeat-y;\nsnippet bgr:r\n background-repeat: repeat;\nsnippet bgz\n background-size: ${1};\nsnippet bgz:a\n background-size: auto;\nsnippet bgz:ct\n background-size: contain;\nsnippet bgz:cv\n background-size: cover;\nsnippet bg\n background: ${1};\nsnippet bg:ie\n filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='${1}',sizingMethod='${2:crop}');\nsnippet bg:n\n background: none;\nsnippet bd+\n border: ${1:1px} ${2:solid} #${3:000};\nsnippet bdb+\n border-bottom: ${1:1px} ${2:solid} #${3:000};\nsnippet bdbc\n border-bottom-color: #${1:000};\nsnippet bdbi\n border-bottom-image: url(${1});\nsnippet bdbi:n\n border-bottom-image: none;\nsnippet bdbli\n border-bottom-left-image: url(${1});\nsnippet bdbli:c\n border-bottom-left-image: continue;\nsnippet bdbli:n\n border-bottom-left-image: none;\nsnippet bdblrz\n border-bottom-left-radius: ${1};\nsnippet bdbri\n border-bottom-right-image: url(${1});\nsnippet bdbri:c\n border-bottom-right-image: continue;\nsnippet bdbri:n\n border-bottom-right-image: none;\nsnippet bdbrrz\n border-bottom-right-radius: ${1};\nsnippet bdbs\n border-bottom-style: ${1};\nsnippet bdbs:n\n border-bottom-style: none;\nsnippet bdbw\n border-bottom-width: ${1};\nsnippet bdb\n border-bottom: ${1};\nsnippet bdb:n\n border-bottom: none;\nsnippet bdbk\n border-break: ${1};\nsnippet bdbk:c\n border-break: close;\nsnippet bdcl\n border-collapse: ${1};\nsnippet bdcl:c\n border-collapse: collapse;\nsnippet bdcl:s\n border-collapse: separate;\nsnippet bdc\n border-color: #${1:000};\nsnippet bdci\n border-corner-image: url(${1});\nsnippet bdci:c\n border-corner-image: continue;\nsnippet bdci:n\n border-corner-image: none;\nsnippet bdf\n border-fit: ${1};\nsnippet bdf:c\n border-fit: clip;\nsnippet bdf:of\n border-fit: overwrite;\nsnippet bdf:ow\n border-fit: overwrite;\nsnippet bdf:r\n border-fit: repeat;\nsnippet bdf:sc\n border-fit: scale;\nsnippet bdf:sp\n border-fit: space;\nsnippet bdf:st\n border-fit: stretch;\nsnippet bdi\n border-image: url(${1}) ${2:0} ${3:0} ${4:0} ${5:0} ${6:stretch} ${7:stretch};\nsnippet bdi:n\n border-image: none;\nsnippet bdl+\n border-left: ${1:1px} ${2:solid} #${3:000};\nsnippet bdlc\n border-left-color: #${1:000};\nsnippet bdli\n border-left-image: url(${1});\nsnippet bdli:n\n border-left-image: none;\nsnippet bdls\n border-left-style: ${1};\nsnippet bdls:n\n border-left-style: none;\nsnippet bdlw\n border-left-width: ${1};\nsnippet bdl\n border-left: ${1};\nsnippet bdl:n\n border-left: none;\nsnippet bdlt\n border-length: ${1};\nsnippet bdlt:a\n border-length: auto;\nsnippet bdrz\n border-radius: ${1};\nsnippet bdr+\n border-right: ${1:1px} ${2:solid} #${3:000};\nsnippet bdrc\n border-right-color: #${1:000};\nsnippet bdri\n border-right-image: url(${1});\nsnippet bdri:n\n border-right-image: none;\nsnippet bdrs\n border-right-style: ${1};\nsnippet bdrs:n\n border-right-style: none;\nsnippet bdrw\n border-right-width: ${1};\nsnippet bdr\n border-right: ${1};\nsnippet bdr:n\n border-right: none;\nsnippet bdsp\n border-spacing: ${1};\nsnippet bds\n border-style: ${1};\nsnippet bds:ds\n border-style: dashed;\nsnippet bds:dtds\n border-style: dot-dash;\nsnippet bds:dtdtds\n border-style: dot-dot-dash;\nsnippet bds:dt\n border-style: dotted;\nsnippet bds:db\n border-style: double;\nsnippet bds:g\n border-style: groove;\nsnippet bds:h\n border-style: hidden;\nsnippet bds:i\n border-style: inset;\nsnippet bds:n\n border-style: none;\nsnippet bds:o\n border-style: outset;\nsnippet bds:r\n border-style: ridge;\nsnippet bds:s\n border-style: solid;\nsnippet bds:w\n border-style: wave;\nsnippet bdt+\n border-top: ${1:1px} ${2:solid} #${3:000};\nsnippet bdtc\n border-top-color: #${1:000};\nsnippet bdti\n border-top-image: url(${1});\nsnippet bdti:n\n border-top-image: none;\nsnippet bdtli\n border-top-left-image: url(${1});\nsnippet bdtli:c\n border-corner-image: continue;\nsnippet bdtli:n\n border-corner-image: none;\nsnippet bdtlrz\n border-top-left-radius: ${1};\nsnippet bdtri\n border-top-right-image: url(${1});\nsnippet bdtri:c\n border-top-right-image: continue;\nsnippet bdtri:n\n border-top-right-image: none;\nsnippet bdtrrz\n border-top-right-radius: ${1};\nsnippet bdts\n border-top-style: ${1};\nsnippet bdts:n\n border-top-style: none;\nsnippet bdtw\n border-top-width: ${1};\nsnippet bdt\n border-top: ${1};\nsnippet bdt:n\n border-top: none;\nsnippet bdw\n border-width: ${1};\nsnippet bd\n border: ${1};\nsnippet bd:n\n border: none;\nsnippet b\n bottom: ${1};\nsnippet b:a\n bottom: auto;\nsnippet bxsh+\n box-shadow: ${1:0} ${2:0} ${3:0} #${4:000};\nsnippet bxsh\n box-shadow: ${1};\nsnippet bxsh:n\n box-shadow: none;\nsnippet bxz\n box-sizing: ${1};\nsnippet bxz:bb\n box-sizing: border-box;\nsnippet bxz:cb\n box-sizing: content-box;\nsnippet cps\n caption-side: ${1};\nsnippet cps:b\n caption-side: bottom;\nsnippet cps:t\n caption-side: top;\nsnippet cl\n clear: ${1};\nsnippet cl:b\n clear: both;\nsnippet cl:l\n clear: left;\nsnippet cl:n\n clear: none;\nsnippet cl:r\n clear: right;\nsnippet cp\n clip: ${1};\nsnippet cp:a\n clip: auto;\nsnippet cp:r\n clip: rect(${1:0} ${2:0} ${3:0} ${4:0});\nsnippet c\n color: #${1:000};\nsnippet ct\n content: ${1};\nsnippet ct:a\n content: attr(${1});\nsnippet ct:cq\n content: close-quote;\nsnippet ct:c\n content: counter(${1});\nsnippet ct:cs\n content: counters(${1});\nsnippet ct:ncq\n content: no-close-quote;\nsnippet ct:noq\n content: no-open-quote;\nsnippet ct:n\n content: normal;\nsnippet ct:oq\n content: open-quote;\nsnippet coi\n counter-increment: ${1};\nsnippet cor\n counter-reset: ${1};\nsnippet cur\n cursor: ${1};\nsnippet cur:a\n cursor: auto;\nsnippet cur:c\n cursor: crosshair;\nsnippet cur:d\n cursor: default;\nsnippet cur:ha\n cursor: hand;\nsnippet cur:he\n cursor: help;\nsnippet cur:m\n cursor: move;\nsnippet cur:p\n cursor: pointer;\nsnippet cur:t\n cursor: text;\nsnippet d\n display: ${1};\nsnippet d:mib\n display: -moz-inline-box;\nsnippet d:mis\n display: -moz-inline-stack;\nsnippet d:b\n display: block;\nsnippet d:cp\n display: compact;\nsnippet d:ib\n display: inline-block;\nsnippet d:itb\n display: inline-table;\nsnippet d:i\n display: inline;\nsnippet d:li\n display: list-item;\nsnippet d:n\n display: none;\nsnippet d:ri\n display: run-in;\nsnippet d:tbcp\n display: table-caption;\nsnippet d:tbc\n display: table-cell;\nsnippet d:tbclg\n display: table-column-group;\nsnippet d:tbcl\n display: table-column;\nsnippet d:tbfg\n display: table-footer-group;\nsnippet d:tbhg\n display: table-header-group;\nsnippet d:tbrg\n display: table-row-group;\nsnippet d:tbr\n display: table-row;\nsnippet d:tb\n display: table;\nsnippet ec\n empty-cells: ${1};\nsnippet ec:h\n empty-cells: hide;\nsnippet ec:s\n empty-cells: show;\nsnippet exp\n expression()\nsnippet fl\n float: ${1};\nsnippet fl:l\n float: left;\nsnippet fl:n\n float: none;\nsnippet fl:r\n float: right;\nsnippet f+\n font: ${1:1em} ${2:Arial},${3:sans-serif};\nsnippet fef\n font-effect: ${1};\nsnippet fef:eb\n font-effect: emboss;\nsnippet fef:eg\n font-effect: engrave;\nsnippet fef:n\n font-effect: none;\nsnippet fef:o\n font-effect: outline;\nsnippet femp\n font-emphasize-position: ${1};\nsnippet femp:a\n font-emphasize-position: after;\nsnippet femp:b\n font-emphasize-position: before;\nsnippet fems\n font-emphasize-style: ${1};\nsnippet fems:ac\n font-emphasize-style: accent;\nsnippet fems:c\n font-emphasize-style: circle;\nsnippet fems:ds\n font-emphasize-style: disc;\nsnippet fems:dt\n font-emphasize-style: dot;\nsnippet fems:n\n font-emphasize-style: none;\nsnippet fem\n font-emphasize: ${1};\nsnippet ff\n font-family: ${1};\nsnippet ff:c\n font-family: ${1:'Monotype Corsiva','Comic Sans MS'},cursive;\nsnippet ff:f\n font-family: ${1:Capitals,Impact},fantasy;\nsnippet ff:m\n font-family: ${1:Monaco,'Courier New'},monospace;\nsnippet ff:ss\n font-family: ${1:Helvetica,Arial},sans-serif;\nsnippet ff:s\n font-family: ${1:Georgia,'Times New Roman'},serif;\nsnippet fza\n font-size-adjust: ${1};\nsnippet fza:n\n font-size-adjust: none;\nsnippet fz\n font-size: ${1};\nsnippet fsm\n font-smooth: ${1};\nsnippet fsm:aw\n font-smooth: always;\nsnippet fsm:a\n font-smooth: auto;\nsnippet fsm:n\n font-smooth: never;\nsnippet fst\n font-stretch: ${1};\nsnippet fst:c\n font-stretch: condensed;\nsnippet fst:e\n font-stretch: expanded;\nsnippet fst:ec\n font-stretch: extra-condensed;\nsnippet fst:ee\n font-stretch: extra-expanded;\nsnippet fst:n\n font-stretch: normal;\nsnippet fst:sc\n font-stretch: semi-condensed;\nsnippet fst:se\n font-stretch: semi-expanded;\nsnippet fst:uc\n font-stretch: legacy-condensed;\nsnippet fst:ue\n font-stretch: legacy-expanded;\nsnippet fs\n font-style: ${1};\nsnippet fs:i\n font-style: italic;\nsnippet fs:n\n font-style: normal;\nsnippet fs:o\n font-style: oblique;\nsnippet fv\n font-variant: ${1};\nsnippet fv:n\n font-variant: normal;\nsnippet fv:sc\n font-variant: small-caps;\nsnippet fw\n font-weight: ${1};\nsnippet fw:b\n font-weight: bold;\nsnippet fw:br\n font-weight: bolder;\nsnippet fw:lr\n font-weight: lighter;\nsnippet fw:n\n font-weight: normal;\nsnippet f\n font: ${1};\nsnippet h\n height: ${1};\nsnippet h:a\n height: auto;\nsnippet l\n left: ${1};\nsnippet l:a\n left: auto;\nsnippet lts\n letter-spacing: ${1};\nsnippet lh\n line-height: ${1};\nsnippet lisi\n list-style-image: url(${1});\nsnippet lisi:n\n list-style-image: none;\nsnippet lisp\n list-style-position: ${1};\nsnippet lisp:i\n list-style-position: inside;\nsnippet lisp:o\n list-style-position: outside;\nsnippet list\n list-style-type: ${1};\nsnippet list:c\n list-style-type: circle;\nsnippet list:dclz\n list-style-type: decimal-leading-zero;\nsnippet list:dc\n list-style-type: decimal;\nsnippet list:d\n list-style-type: disc;\nsnippet list:lr\n list-style-type: lower-roman;\nsnippet list:n\n list-style-type: none;\nsnippet list:s\n list-style-type: square;\nsnippet list:ur\n list-style-type: upper-roman;\nsnippet lis\n list-style: ${1};\nsnippet lis:n\n list-style: none;\nsnippet mb\n margin-bottom: ${1};\nsnippet mb:a\n margin-bottom: auto;\nsnippet ml\n margin-left: ${1};\nsnippet ml:a\n margin-left: auto;\nsnippet mr\n margin-right: ${1};\nsnippet mr:a\n margin-right: auto;\nsnippet mt\n margin-top: ${1};\nsnippet mt:a\n margin-top: auto;\nsnippet m\n margin: ${1};\nsnippet m:4\n margin: ${1:0} ${2:0} ${3:0} ${4:0};\nsnippet m:3\n margin: ${1:0} ${2:0} ${3:0};\nsnippet m:2\n margin: ${1:0} ${2:0};\nsnippet m:0\n margin: 0;\nsnippet m:a\n margin: auto;\nsnippet mah\n max-height: ${1};\nsnippet mah:n\n max-height: none;\nsnippet maw\n max-width: ${1};\nsnippet maw:n\n max-width: none;\nsnippet mih\n min-height: ${1};\nsnippet miw\n min-width: ${1};\nsnippet op\n opacity: ${1};\nsnippet op:ie\n filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=${1:100});\nsnippet op:ms\n -ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=${1:100})';\nsnippet orp\n orphans: ${1};\nsnippet o+\n outline: ${1:1px} ${2:solid} #${3:000};\nsnippet oc\n outline-color: ${1:#000};\nsnippet oc:i\n outline-color: invert;\nsnippet oo\n outline-offset: ${1};\nsnippet os\n outline-style: ${1};\nsnippet ow\n outline-width: ${1};\nsnippet o\n outline: ${1};\nsnippet o:n\n outline: none;\nsnippet ovs\n overflow-style: ${1};\nsnippet ovs:a\n overflow-style: auto;\nsnippet ovs:mq\n overflow-style: marquee;\nsnippet ovs:mv\n overflow-style: move;\nsnippet ovs:p\n overflow-style: panner;\nsnippet ovs:s\n overflow-style: scrollbar;\nsnippet ovx\n overflow-x: ${1};\nsnippet ovx:a\n overflow-x: auto;\nsnippet ovx:h\n overflow-x: hidden;\nsnippet ovx:s\n overflow-x: scroll;\nsnippet ovx:v\n overflow-x: visible;\nsnippet ovy\n overflow-y: ${1};\nsnippet ovy:a\n overflow-y: auto;\nsnippet ovy:h\n overflow-y: hidden;\nsnippet ovy:s\n overflow-y: scroll;\nsnippet ovy:v\n overflow-y: visible;\nsnippet ov\n overflow: ${1};\nsnippet ov:a\n overflow: auto;\nsnippet ov:h\n overflow: hidden;\nsnippet ov:s\n overflow: scroll;\nsnippet ov:v\n overflow: visible;\nsnippet pb\n padding-bottom: ${1};\nsnippet pl\n padding-left: ${1};\nsnippet pr\n padding-right: ${1};\nsnippet pt\n padding-top: ${1};\nsnippet p\n padding: ${1};\nsnippet p:4\n padding: ${1:0} ${2:0} ${3:0} ${4:0};\nsnippet p:3\n padding: ${1:0} ${2:0} ${3:0};\nsnippet p:2\n padding: ${1:0} ${2:0};\nsnippet p:0\n padding: 0;\nsnippet pgba\n page-break-after: ${1};\nsnippet pgba:aw\n page-break-after: always;\nsnippet pgba:a\n page-break-after: auto;\nsnippet pgba:l\n page-break-after: left;\nsnippet pgba:r\n page-break-after: right;\nsnippet pgbb\n page-break-before: ${1};\nsnippet pgbb:aw\n page-break-before: always;\nsnippet pgbb:a\n page-break-before: auto;\nsnippet pgbb:l\n page-break-before: left;\nsnippet pgbb:r\n page-break-before: right;\nsnippet pgbi\n page-break-inside: ${1};\nsnippet pgbi:a\n page-break-inside: auto;\nsnippet pgbi:av\n page-break-inside: avoid;\nsnippet pos\n position: ${1};\nsnippet pos:a\n position: absolute;\nsnippet pos:f\n position: fixed;\nsnippet pos:r\n position: relative;\nsnippet pos:s\n position: static;\nsnippet q\n quotes: ${1};\nsnippet q:en\n quotes: '\\201C' '\\201D' '\\2018' '\\2019';\nsnippet q:n\n quotes: none;\nsnippet q:ru\n quotes: '\\00AB' '\\00BB' '\\201E' '\\201C';\nsnippet rz\n resize: ${1};\nsnippet rz:b\n resize: both;\nsnippet rz:h\n resize: horizontal;\nsnippet rz:n\n resize: none;\nsnippet rz:v\n resize: vertical;\nsnippet r\n right: ${1};\nsnippet r:a\n right: auto;\nsnippet tbl\n table-layout: ${1};\nsnippet tbl:a\n table-layout: auto;\nsnippet tbl:f\n table-layout: fixed;\nsnippet tal\n text-align-last: ${1};\nsnippet tal:a\n text-align-last: auto;\nsnippet tal:c\n text-align-last: center;\nsnippet tal:l\n text-align-last: left;\nsnippet tal:r\n text-align-last: right;\nsnippet ta\n text-align: ${1};\nsnippet ta:c\n text-align: center;\nsnippet ta:l\n text-align: left;\nsnippet ta:r\n text-align: right;\nsnippet td\n text-decoration: ${1};\nsnippet td:l\n text-decoration: line-through;\nsnippet td:n\n text-decoration: none;\nsnippet td:o\n text-decoration: overline;\nsnippet td:u\n text-decoration: underline;\nsnippet te\n text-emphasis: ${1};\nsnippet te:ac\n text-emphasis: accent;\nsnippet te:a\n text-emphasis: after;\nsnippet te:b\n text-emphasis: before;\nsnippet te:c\n text-emphasis: circle;\nsnippet te:ds\n text-emphasis: disc;\nsnippet te:dt\n text-emphasis: dot;\nsnippet te:n\n text-emphasis: none;\nsnippet th\n text-height: ${1};\nsnippet th:a\n text-height: auto;\nsnippet th:f\n text-height: font-size;\nsnippet th:m\n text-height: max-size;\nsnippet th:t\n text-height: text-size;\nsnippet ti\n text-indent: ${1};\nsnippet ti:-\n text-indent: -9999px;\nsnippet tj\n text-justify: ${1};\nsnippet tj:a\n text-justify: auto;\nsnippet tj:d\n text-justify: distribute;\nsnippet tj:ic\n text-justify: inter-cluster;\nsnippet tj:ii\n text-justify: inter-ideograph;\nsnippet tj:iw\n text-justify: inter-word;\nsnippet tj:k\n text-justify: kashida;\nsnippet tj:t\n text-justify: tibetan;\nsnippet to+\n text-outline: ${1:0} ${2:0} #${3:000};\nsnippet to\n text-outline: ${1};\nsnippet to:n\n text-outline: none;\nsnippet tr\n text-replace: ${1};\nsnippet tr:n\n text-replace: none;\nsnippet tsh+\n text-shadow: ${1:0} ${2:0} ${3:0} #${4:000};\nsnippet tsh\n text-shadow: ${1};\nsnippet tsh:n\n text-shadow: none;\nsnippet tt\n text-transform: ${1};\nsnippet tt:c\n text-transform: capitalize;\nsnippet tt:l\n text-transform: lowercase;\nsnippet tt:n\n text-transform: none;\nsnippet tt:u\n text-transform: uppercase;\nsnippet tw\n text-wrap: ${1};\nsnippet tw:no\n text-wrap: none;\nsnippet tw:n\n text-wrap: normal;\nsnippet tw:s\n text-wrap: suppress;\nsnippet tw:u\n text-wrap: unrestricted;\nsnippet t\n top: ${1};\nsnippet t:a\n top: auto;\nsnippet va\n vertical-align: ${1};\nsnippet va:bl\n vertical-align: baseline;\nsnippet va:b\n vertical-align: bottom;\nsnippet va:m\n vertical-align: middle;\nsnippet va:sub\n vertical-align: sub;\nsnippet va:sup\n vertical-align: super;\nsnippet va:tb\n vertical-align: text-bottom;\nsnippet va:tt\n vertical-align: text-top;\nsnippet va:t\n vertical-align: top;\nsnippet v\n visibility: ${1};\nsnippet v:c\n visibility: collapse;\nsnippet v:h\n visibility: hidden;\nsnippet v:v\n visibility: visible;\nsnippet whsc\n white-space-collapse: ${1};\nsnippet whsc:ba\n white-space-collapse: break-all;\nsnippet whsc:bs\n white-space-collapse: break-strict;\nsnippet whsc:k\n white-space-collapse: keep-all;\nsnippet whsc:l\n white-space-collapse: loose;\nsnippet whsc:n\n white-space-collapse: normal;\nsnippet whs\n white-space: ${1};\nsnippet whs:n\n white-space: normal;\nsnippet whs:nw\n white-space: nowrap;\nsnippet whs:pl\n white-space: pre-line;\nsnippet whs:pw\n white-space: pre-wrap;\nsnippet whs:p\n white-space: pre;\nsnippet wid\n widows: ${1};\nsnippet w\n width: ${1};\nsnippet w:a\n width: auto;\nsnippet wob\n word-break: ${1};\nsnippet wob:ba\n word-break: break-all;\nsnippet wob:bs\n word-break: break-strict;\nsnippet wob:k\n word-break: keep-all;\nsnippet wob:l\n word-break: loose;\nsnippet wob:n\n word-break: normal;\nsnippet wos\n word-spacing: ${1};\nsnippet wow\n word-wrap: ${1};\nsnippet wow:no\n word-wrap: none;\nsnippet wow:n\n word-wrap: normal;\nsnippet wow:s\n word-wrap: suppress;\nsnippet wow:u\n word-wrap: unrestricted;\nsnippet z\n z-index: ${1};\nsnippet z:a\n z-index: auto;\nsnippet zoo\n zoom: 1;\n",t.scope="css"}) \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/snippets/html.js b/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/snippets/html.js new file mode 100644 index 000000000..a220d3df1 --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/fields/ace_editor/vendor/snippets/html.js @@ -0,0 +1 @@ +ace.define("ace/snippets/html",["require","exports","module"],function(e,t,n){"use strict";t.snippetText='# Some useful Unicode entities\n# Non-Breaking Space\nsnippet nbs\n  \n# \u2190\nsnippet left\n ←\n# \u2192\nsnippet right\n →\n# \u2191\nsnippet up\n ↑\n# \u2193\nsnippet down\n ↓\n# \u21a9\nsnippet return\n ↩\n# \u21e4\nsnippet backtab\n ⇤\n# \u21e5\nsnippet tab\n ⇥\n# \u21e7\nsnippet shift\n ⇧\n# \u2303\nsnippet ctrl\n ⌃\n# \u2305\nsnippet enter\n ⌅\n# \u2318\nsnippet cmd\n ⌘\n# \u2325\nsnippet option\n ⌥\n# \u2326\nsnippet delete\n ⌦\n# \u232b\nsnippet backspace\n ⌫\n# \u238b\nsnippet esc\n ⎋\n# Generic Doctype\nsnippet doctype HTML 4.01 Strict\n \nsnippet doctype HTML 4.01 Transitional\n \nsnippet doctype HTML 5\n \nsnippet doctype XHTML 1.0 Frameset\n \nsnippet doctype XHTML 1.0 Strict\n \nsnippet doctype XHTML 1.0 Transitional\n \nsnippet doctype XHTML 1.1\n \n# HTML Doctype 4.01 Strict\nsnippet docts\n \n# HTML Doctype 4.01 Transitional\nsnippet doct\n \n# HTML Doctype 5\nsnippet doct5\n \n# XHTML Doctype 1.0 Frameset\nsnippet docxf\n \n# XHTML Doctype 1.0 Strict\nsnippet docxs\n \n# XHTML Doctype 1.0 Transitional\nsnippet docxt\n \n# XHTML Doctype 1.1\nsnippet docx\n \n# Attributes\nsnippet attr\n ${1:attribute}="${2:property}"\nsnippet attr+\n ${1:attribute}="${2:property}" attr+${3}\nsnippet .\n class="${1}"${2}\nsnippet #\n id="${1}"${2}\nsnippet alt\n alt="${1}"${2}\nsnippet charset\n charset="${1:utf-8}"${2}\nsnippet data\n data-${1}="${2:$1}"${3}\nsnippet for\n for="${1}"${2}\nsnippet height\n height="${1}"${2}\nsnippet href\n href="${1:#}"${2}\nsnippet lang\n lang="${1:en}"${2}\nsnippet media\n media="${1}"${2}\nsnippet name\n name="${1}"${2}\nsnippet rel\n rel="${1}"${2}\nsnippet scope\n scope="${1:row}"${2}\nsnippet src\n src="${1}"${2}\nsnippet title=\n title="${1}"${2}\nsnippet type\n type="${1}"${2}\nsnippet value\n value="${1}"${2}\nsnippet width\n width="${1}"${2}\n# Elements\nsnippet a\n ${2:$1}\nsnippet a.\n ${3:$1}\nsnippet a#\n ${3:$1}\nsnippet a:ext\n ${2:$1}\nsnippet a:mail\n ${3:email me}\nsnippet abbr\n ${2}\nsnippet address\n
    \n ${1}\n
    \nsnippet area\n ${4}\nsnippet area+\n ${4}\n area+${5}\nsnippet area:c\n ${3}\nsnippet area:d\n ${3}\nsnippet area:p\n ${3}\nsnippet area:r\n ${3}\nsnippet article\n
    \n ${1}\n
    \nsnippet article.\n
    \n ${2}\n
    \nsnippet article#\n
    \n ${2}\n
    \nsnippet aside\n \nsnippet aside.\n \nsnippet aside#\n \nsnippet audio\n
    ${1}
    + + + + +


    + +


    + +
    + + + +
    +

    + + +
    +

    + +

    + +

    + '; + foreach ( $redux as $panel ) { + echo ' ' . $panel->args['display_name'] . ''; + if ( ! empty( $panel->args['display_version'] ) ) { + echo ' v' . $panel->args['display_version']; + } + echo ' 
    '; + } + echo '
    '; + } + + + // + // $t = wp_get_theme(); + // $active_theme = array( + // 'name' => $t->get( 'Name' ), + // 'version' => $t->get( 'Version' ), + // 'template' => $t->get( 'Template' ), + // 'productURL' => $t->get( 'ThemeURI' ), + // 'author' => $t->get( 'Author' ), + // 'authorURL' => $t->get( 'AuthorURI' ), + // ); + // $parent_theme = array(); + // + // if ( ! empty( $active_theme['Template'] ) ) { + // $pt = wp_get_theme( $active_theme['Template'] ); + // $parent_theme = array( + // 'name' => $pt->get( 'Name' ), + // 'version' => $pt->get( 'Version' ), + // 'template' => $pt->get( 'Template' ), + // 'productURL' => $pt->get( 'ThemeURI' ), + // 'author' => $pt->get( 'Author' ), + // 'authorURL' => $pt->get( 'AuthorURI' ), + // ); + // } + // + // + // $products = array( 'plugins' => array(), 'theme' => array(), 'unknown' => array() ); + // + // $active_plugins = (array) get_option( 'active_plugins', array() ); + // + // if ( is_multisite() ) { + // $active_plugins = array_merge( $active_plugins, get_site_option( 'active_sitewide_plugins', array() ) ); + // } + // + // $plugins = array(); + // + // foreach ( $active_plugins as $plugin ) : + // $plugin_data = @get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin ); + // $plugins[ $plugin_data['Name'] ] = array( + // 'name' => $plugin_data['Name'], + // 'title' => $plugin_data['Title'], + // 'version' => $plugin_data['Version'], + // 'productURL' => $plugin_data['PluginURI'], + // 'author' => $plugin_data['Author'], + // 'authorURL' => $plugin_data['AuthorURI'], + // ); + // endforeach; + // + // + // foreach ( $redux as $panel ) { + // if ( $active_theme == $panel->args['display_name'] ) { + // $products['theme'] = $active_theme; + // } else if ( $parent_theme == $panel->args['display_name'] ) { + // $products['theme'] = $parent_theme; + // } else if ( isset( $plugins[ $panel->args['display_name'] ] ) ) { + // $products['plugins'][] = array( + // 'name' => $panel->args['display_name'], + // 'version' => $panel->args['display_version'] + // ); + // } else { + // $products['unknown'][] = array( + // 'name' => $panel->args['display_name'], + // 'version' => $panel->args['display_version'] + // ); + // } + // } + // print_r( $products ); + //?> + + + + + + + + + + + + + + + + + + Name ); ?> + + + + + Name ); ?> + Name; ?> + Version; ?> + + + + + +
    + + +

    + following article before asking for support from us directly.', 'legacy_framework' ), array( 'a' => array( 'href' => array() ) ) ), esc_url( 'http://docs.reduxframework.com/core/support-defined/' ) ); + ?> + + + +

    + +
    + + + +
    +
    + +
    \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/inc/welcome/welcome.php b/plugins/legacy-admin/framework/core/inc/welcome/welcome.php new file mode 100644 index 000000000..45833da63 --- /dev/null +++ b/plugins/legacy-admin/framework/core/inc/welcome/welcome.php @@ -0,0 +1,558 @@ +redux_loaded ) { + return; + } + $this->redux_loaded = true; + add_action( 'admin_menu', array( $this, 'admin_menus' ) ); + + if ( isset( $_GET['page'] ) ) { + if ( substr( $_GET['page'], 0, 6 ) == "redux-" ) { + $version = explode( '.', ReduxFramework::$_version ); + $this->display_version = $version[0] . '.' . $version[1]; + add_filter( 'admin_footer_text', array( $this, 'change_wp_footer' ) ); + add_action( 'admin_head', array( $this, 'admin_head' ) ); + } else { + $this->check_version(); + } + } else { + $this->check_version(); + } + update_option( 'redux_version_upgraded_from', ReduxFramework::$_version ); + set_transient( '_redux_activation_redirect', true, 30 ); + + } + + + public function check_version() { + global $pagenow; + + if ($pagenow == "admin-ajax.php" || ( $GLOBALS['pagenow'] == "customize" && isset( $_GET['theme'] ) && ! empty( $_GET['theme'] ) ) ) { + return; + } + + $saveVer = Redux_Helpers::major_version( get_option( 'redux_version_upgraded_from' ) ); + $curVer = Redux_Helpers::major_version( ReduxFramework::$_version ); + $compare = false; + + if ( Redux_Helpers::isLocalHost() ) { + $compare = true; + } else if ( class_exists( 'ReduxFrameworkPlugin' ) ) { + $compare = true; + } else { + $redux = ReduxFrameworkInstances::get_all_instances(); + foreach ( $redux as $panel ) { + if ( $panel->args['dev_mode'] == 1 ) { + $compare = true; + break; + } + } + } + + if ( $compare ) { + $redirect = false; + if ( empty( $saveVer ) ) { + $redirect = true; // First time + } else if ( version_compare( $curVer, $saveVer, '>' ) ) { + $redirect = true; // Previous version + } + if ( $redirect ) { + //wp_safe_redirect( admin_url( 'tools.php?page=redux-about' ) ); + //exit(); + } + } + } + + public function change_wp_footer() { + echo 'If you like Redux please leave us a 5 star rating. A huge thank you from Redux in advance!'; + } + + public function support_hash() { + + if ( ! wp_verify_nonce( $_POST['nonce'], 'redux-support-hash' ) ) { + die(); + } + + $data = get_option( 'redux_support_hash' ); + $data = wp_parse_args( $data, array( 'check' => '', 'identifier' => '' ) ); + $generate_hash = true; + $system_info = Redux_Helpers::compileSystemStatus(); + $newHash = md5( json_encode( $system_info ) ); + $return = array(); + if ( $newHash == $data['check'] ) { + unset( $generate_hash ); + } + $post_data = array( + 'hash' => md5( network_site_url() . '-' . $_SERVER['REMOTE_ADDR'] ), + 'site' => esc_url( home_url( '/' ) ), + 'tracking' => Redux_Helpers::getTrackingObject(), + 'system_status' => $system_info, + ); + $post_data = json_encode( $post_data ); + + if ( isset( $generate_hash ) && $generate_hash ) { + $data['check'] = $newHash; + $data['identifier'] = ""; + $response = wp_remote_post( 'http://support.redux.io/v1/', array( + 'method' => 'POST', + 'timeout' => 65, + 'redirection' => 5, + 'httpversion' => '1.0', + 'blocking' => true, + 'compress' => true, + 'headers' => array(), + 'body' => array( + 'data' => $post_data + ) + ) + ); + + if ( is_wp_error( $response ) ) { + echo json_encode( array( + 'status' => 'error', + 'message' => $response->get_error_message() + ) ); + die( 1 ); + } else { + $response_code = wp_remote_retrieve_response_code( $response ); + if ( $response_code == 200 ) { + $response = wp_remote_retrieve_body( $response ); + $return = json_decode( $response, true ); + if ( isset( $return['identifier'] ) ) { + $data['identifier'] = $return['identifier']; + update_option( 'redux_support_hash', $data ); + } + } else { + $response = wp_remote_retrieve_body( $response ); + echo json_encode( array( + 'status' => 'error', + 'message' => $response + ) ); + } + } + } + + if ( ! empty( $data['identifier'] ) ) { + $return['status'] = "success"; + $return['identifier'] = $data['identifier']; + } else { + $return['status'] = "error"; + $return['message'] = __( "Support hash could not be generated. Please try again later.", 'legacy_framework' ); + } + + echo json_encode( $return ); + + die( 1 ); + } + + /** + * Register the Dashboard Pages which are later hidden but these pages + * are used to render the Welcome and Credits pages. + * + * @access public + * @since 1.4 + * @return void + */ + public function admin_menus() { + + // About Page + add_management_page( + __( 'Welcome to Redux Framework', 'legacy_framework' ), __( 'Redux Framework', 'legacy_framework' ), $this->minimum_capability, 'redux-about', array( + $this, + 'about_screen' + ) + ); + + // Changelog Page + add_management_page( + __( 'Redux Framework Changelog', 'legacy_framework' ), __( 'Redux Framework Changelog', 'legacy_framework' ), $this->minimum_capability, 'redux-changelog', array( + $this, + 'changelog_screen' + ) + ); + + // Support Page + add_management_page( + __( 'Get Support', 'legacy_framework' ), __( 'Get Support', 'legacy_framework' ), $this->minimum_capability, 'redux-support', array( + $this, + 'get_support' + ) + ); + + // Support Page + add_management_page( + __( 'Redux Extensions', 'legacy_framework' ), __( 'Redux Extensions', 'legacy_framework' ), $this->minimum_capability, 'redux-extensions', array( + $this, + 'redux_extensions' + ) + ); + + + // Credits Page + add_management_page( + __( 'The people that develop Redux Framework', 'legacy_framework' ), __( 'The people that develop Redux Framework', 'legacy_framework' ), $this->minimum_capability, 'redux-credits', array( + $this, + 'credits_screen' + ) + ); + + // Status Page + add_management_page( + __( 'Redux Framework Status', 'legacy_framework' ), __( 'Redux Framework Status', 'legacy_framework' ), $this->minimum_capability, 'redux-status', array( + $this, + 'status_screen' + ) + ); + + remove_submenu_page( 'tools.php', 'redux-about' ); + remove_submenu_page( 'tools.php', 'redux-status' ); + remove_submenu_page( 'tools.php', 'redux-changelog' ); + remove_submenu_page( 'tools.php', 'redux-getting-started' ); + remove_submenu_page( 'tools.php', 'redux-credits' ); + remove_submenu_page( 'tools.php', 'redux-support' ); + remove_submenu_page( 'tools.php', 'redux-extensions' ); + + + } + + /** + * Hide Individual Dashboard Pages + * + * @access public + * @since 1.4 + * @return void + */ + public function admin_head() { + + // Badge for welcome page + $badge_url = ReduxFramework::$_url . 'assets/images/redux-badge.png'; + ?> + + + + + + + + + + + + + + + + + + + + +

    '; + + include_once( 'views/about.php' ); + + } + + /** + * Render Changelog Screen + * + * @access public + * @since 2.0.3 + * @return void + */ + public function changelog_screen() { + // Stupid hack for Wordpress alerts and warnings + echo '

    '; + + include_once( 'views/changelog.php' ); + + } + + /** + * Render Changelog Screen + * + * @access public + * @since 2.0.3 + * @return void + */ + public function redux_extensions() { + // Stupid hack for Wordpress alerts and warnings + echo '

    '; + + include_once( 'views/extensions.php' ); + + } + + + /** + * Render Get Support Screen + * + * @access public + * @since 1.9 + * @return void + */ + public function get_support() { + // Stupid hack for Wordpress alerts and warnings + echo '

    '; + + include_once( 'views/support.php' ); + + } + + /** + * Render Credits Screen + * + * @access public + * @since 1.4 + * @return void + */ + public function credits_screen() { + // Stupid hack for Wordpress alerts and warnings + echo '

    '; + + include_once( 'views/credits.php' ); + + } + + /** + * Render Status Report Screen + * + * @access public + * @since 1.4 + * @return void + */ + public function status_screen() { + // Stupid hack for Wordpress alerts and warnings + echo '

    '; + + include_once( 'views/status_report.php' ); + + } + + /** + * Parse the Redux readme.txt file + * + * @since 2.0.3 + * @return string $readme HTML formatted readme file + */ + public function parse_readme() { + if ( file_exists( ReduxFramework::$_dir . 'inc/fields/raw/parsedown.php' ) ) { + require_once ReduxFramework::$_dir . 'inc/fields/raw/parsedown.php'; + $Parsedown = new Parsedown(); + + return $Parsedown->text( trim( str_replace( '# Redux Framework Changelog', '', wp_remote_retrieve_body( wp_remote_get( ReduxFramework::$_url . '../CHANGELOG.md' ) ) ) ) ); + } + + return ''; + + } + + public function actions() { + ?> +

    + Docs + Review Us + Donate + + +

    + get_contributors(); + + if ( empty ( $contributors ) ) { + return ''; + } + + $contributor_list = ''; + + return $contributor_list; + } + + /** + * Retreive list of contributors from GitHub. + * + * @access public + * @since 1.4 + * @return array $contributors List of contributors + */ + public function get_contributors() { + $contributors = get_transient( 'redux_contributors' ); + + if ( false !== $contributors ) { + return $contributors; + } + + $response = wp_remote_get( 'https://api.github.com/repos/ReduxFramework/legacy_framework/contributors', array( 'sslverify' => false ) ); + + if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) { + return array(); + } + + $contributors = json_decode( wp_remote_retrieve_body( $response ) ); + + if ( ! is_array( $contributors ) ) { + return array(); + } + + set_transient( 'redux_contributors', $contributors, 3600 ); + + return $contributors; + } + } + + new Redux_Welcome(); + diff --git a/plugins/legacy-admin/framework/core/languages/README.txt b/plugins/legacy-admin/framework/core/languages/README.txt new file mode 100644 index 000000000..57b2f194e --- /dev/null +++ b/plugins/legacy-admin/framework/core/languages/README.txt @@ -0,0 +1 @@ +Please visit: https://github.com/ReduxFramework/ReduxFramework/wiki/Translate for details on how you can help. diff --git a/plugins/legacy-admin/framework/core/languages/ar.mo b/plugins/legacy-admin/framework/core/languages/ar.mo new file mode 100644 index 000000000..9605c4275 Binary files /dev/null and b/plugins/legacy-admin/framework/core/languages/ar.mo differ diff --git a/plugins/legacy-admin/framework/core/languages/bg_BG.mo b/plugins/legacy-admin/framework/core/languages/bg_BG.mo new file mode 100644 index 000000000..7f30514ae Binary files /dev/null and b/plugins/legacy-admin/framework/core/languages/bg_BG.mo differ diff --git a/plugins/legacy-admin/framework/core/languages/bn_BD.mo b/plugins/legacy-admin/framework/core/languages/bn_BD.mo new file mode 100644 index 000000000..f944e029c Binary files /dev/null and b/plugins/legacy-admin/framework/core/languages/bn_BD.mo differ diff --git a/plugins/legacy-admin/framework/core/languages/cs_CZ.mo b/plugins/legacy-admin/framework/core/languages/cs_CZ.mo new file mode 100644 index 000000000..e55ae8f44 Binary files /dev/null and b/plugins/legacy-admin/framework/core/languages/cs_CZ.mo differ diff --git a/plugins/legacy-admin/framework/core/languages/da_DK.mo b/plugins/legacy-admin/framework/core/languages/da_DK.mo new file mode 100644 index 000000000..1321840bf Binary files /dev/null and b/plugins/legacy-admin/framework/core/languages/da_DK.mo differ diff --git a/plugins/legacy-admin/framework/core/languages/de_DE.mo b/plugins/legacy-admin/framework/core/languages/de_DE.mo new file mode 100644 index 000000000..74a0f2bce Binary files /dev/null and b/plugins/legacy-admin/framework/core/languages/de_DE.mo differ diff --git a/plugins/legacy-admin/framework/core/languages/el.mo b/plugins/legacy-admin/framework/core/languages/el.mo new file mode 100644 index 000000000..3cec8b060 Binary files /dev/null and b/plugins/legacy-admin/framework/core/languages/el.mo differ diff --git a/plugins/legacy-admin/framework/core/languages/es_ES.mo b/plugins/legacy-admin/framework/core/languages/es_ES.mo new file mode 100644 index 000000000..f2fe50b08 Binary files /dev/null and b/plugins/legacy-admin/framework/core/languages/es_ES.mo differ diff --git a/plugins/legacy-admin/framework/core/languages/es_MX.mo b/plugins/legacy-admin/framework/core/languages/es_MX.mo new file mode 100644 index 000000000..906a2ad3d Binary files /dev/null and b/plugins/legacy-admin/framework/core/languages/es_MX.mo differ diff --git a/plugins/legacy-admin/framework/core/languages/fa_IR.mo b/plugins/legacy-admin/framework/core/languages/fa_IR.mo new file mode 100644 index 000000000..bcee4f017 Binary files /dev/null and b/plugins/legacy-admin/framework/core/languages/fa_IR.mo differ diff --git a/plugins/legacy-admin/framework/core/languages/fi.mo b/plugins/legacy-admin/framework/core/languages/fi.mo new file mode 100644 index 000000000..d04d4cc79 Binary files /dev/null and b/plugins/legacy-admin/framework/core/languages/fi.mo differ diff --git a/plugins/legacy-admin/framework/core/languages/fr_FR.mo b/plugins/legacy-admin/framework/core/languages/fr_FR.mo new file mode 100644 index 000000000..17dfb6e24 Binary files /dev/null and b/plugins/legacy-admin/framework/core/languages/fr_FR.mo differ diff --git a/plugins/legacy-admin/framework/core/languages/he_IL.mo b/plugins/legacy-admin/framework/core/languages/he_IL.mo new file mode 100644 index 000000000..f831823a5 Binary files /dev/null and b/plugins/legacy-admin/framework/core/languages/he_IL.mo differ diff --git a/plugins/legacy-admin/framework/core/languages/hi_IN.mo b/plugins/legacy-admin/framework/core/languages/hi_IN.mo new file mode 100644 index 000000000..eb687d385 Binary files /dev/null and b/plugins/legacy-admin/framework/core/languages/hi_IN.mo differ diff --git a/plugins/legacy-admin/framework/core/languages/hr.mo b/plugins/legacy-admin/framework/core/languages/hr.mo new file mode 100644 index 000000000..6f577572e Binary files /dev/null and b/plugins/legacy-admin/framework/core/languages/hr.mo differ diff --git a/plugins/legacy-admin/framework/core/languages/hu_HU.mo b/plugins/legacy-admin/framework/core/languages/hu_HU.mo new file mode 100644 index 000000000..985496406 Binary files /dev/null and b/plugins/legacy-admin/framework/core/languages/hu_HU.mo differ diff --git a/plugins/legacy-admin/framework/core/languages/id_ID.mo b/plugins/legacy-admin/framework/core/languages/id_ID.mo new file mode 100644 index 000000000..9434f24b0 Binary files /dev/null and b/plugins/legacy-admin/framework/core/languages/id_ID.mo differ diff --git a/plugins/legacy-admin/framework/core/languages/it_IT.mo b/plugins/legacy-admin/framework/core/languages/it_IT.mo new file mode 100644 index 000000000..948d994bf Binary files /dev/null and b/plugins/legacy-admin/framework/core/languages/it_IT.mo differ diff --git a/plugins/legacy-admin/framework/core/languages/ja.mo b/plugins/legacy-admin/framework/core/languages/ja.mo new file mode 100644 index 000000000..30a0a9056 Binary files /dev/null and b/plugins/legacy-admin/framework/core/languages/ja.mo differ diff --git a/plugins/legacy-admin/framework/core/languages/km.mo b/plugins/legacy-admin/framework/core/languages/km.mo new file mode 100644 index 000000000..2e66d5e12 Binary files /dev/null and b/plugins/legacy-admin/framework/core/languages/km.mo differ diff --git a/plugins/legacy-admin/framework/core/languages/lt_LT.mo b/plugins/legacy-admin/framework/core/languages/lt_LT.mo new file mode 100644 index 000000000..e69de29bb diff --git a/plugins/legacy-admin/framework/core/languages/nb_NO.mo b/plugins/legacy-admin/framework/core/languages/nb_NO.mo new file mode 100644 index 000000000..030b1fe50 Binary files /dev/null and b/plugins/legacy-admin/framework/core/languages/nb_NO.mo differ diff --git a/plugins/legacy-admin/framework/core/languages/ne_NP.mo b/plugins/legacy-admin/framework/core/languages/ne_NP.mo new file mode 100644 index 000000000..cefe9c156 Binary files /dev/null and b/plugins/legacy-admin/framework/core/languages/ne_NP.mo differ diff --git a/plugins/legacy-admin/framework/core/languages/nl_NL.mo b/plugins/legacy-admin/framework/core/languages/nl_NL.mo new file mode 100644 index 000000000..8ce8f394a Binary files /dev/null and b/plugins/legacy-admin/framework/core/languages/nl_NL.mo differ diff --git a/plugins/legacy-admin/framework/core/languages/pl_PL.mo b/plugins/legacy-admin/framework/core/languages/pl_PL.mo new file mode 100644 index 000000000..74d2eaafb Binary files /dev/null and b/plugins/legacy-admin/framework/core/languages/pl_PL.mo differ diff --git a/plugins/legacy-admin/framework/core/languages/pt_BR.mo b/plugins/legacy-admin/framework/core/languages/pt_BR.mo new file mode 100644 index 000000000..153f3e37a Binary files /dev/null and b/plugins/legacy-admin/framework/core/languages/pt_BR.mo differ diff --git a/plugins/legacy-admin/framework/core/languages/pt_PT.mo b/plugins/legacy-admin/framework/core/languages/pt_PT.mo new file mode 100644 index 000000000..20dd0481f Binary files /dev/null and b/plugins/legacy-admin/framework/core/languages/pt_PT.mo differ diff --git a/plugins/legacy-admin/framework/core/languages/redux-framework.pot b/plugins/legacy-admin/framework/core/languages/redux-framework.pot new file mode 100644 index 000000000..554d81f41 --- /dev/null +++ b/plugins/legacy-admin/framework/core/languages/redux-framework.pot @@ -0,0 +1,1540 @@ +# Copyright (C) 2015 Team Redux +# This file is distributed under the GPL3+. +msgid "" +msgstr "" +"Project-Id-Version: Redux Framework 3.4.4.9.4\n" +"Report-Msgid-Bugs-To: " +"https://github.com/ReduxFramework/ReduxFramework/issues\n" +"POT-Creation-Date: 2015-04-02 04:45:17+00:00\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"PO-Revision-Date: 2015-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"X-Generator: grunt-wp-i18n 0.4.9\n" +"X-Poedit-KeywordsList: " +"__;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;_nx_noop:1,2,3c;esc_" +"attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;esc_html_x:1,2c;\n" +"Language: en\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Poedit-Country: United States\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-Basepath: ../\n" +"X-Poedit-SearchPath-0: .\n" +"X-Poedit-Bookmarks: \n" +"X-Textdomain-Support: yes\n" + +#: ReduxCore/core/enqueue.php:397 +#: ReduxCore/inc/extensions/customizer/extension_customizer.php:562 +msgid "You have changes that are not saved. Would you like to save them now?" +msgstr "" + +#: ReduxCore/core/enqueue.php:405 +#: ReduxCore/inc/extensions/customizer/extension_customizer.php:563 +msgid "Are you sure? Resetting will lose all custom values." +msgstr "" + +#: ReduxCore/core/enqueue.php:413 +msgid "Are you sure? Resetting will lose all custom values in this section." +msgstr "" + +#: ReduxCore/core/enqueue.php:421 +#: ReduxCore/inc/extensions/customizer/extension_customizer.php:564 +msgid "" +"Your current options will be replaced with the values of this preset. Would " +"you like to proceed?" +msgstr "" + +#: ReduxCore/core/enqueue.php:428 +msgid "Please Wait" +msgstr "" + +#: ReduxCore/core/enqueue.php:439 +msgid "There was an error saving. Here is the result of your action:" +msgstr "" + +#: ReduxCore/core/enqueue.php:440 +msgid "There was a problem with your action. Please try again or reload the page." +msgstr "" + +#: ReduxCore/core/panel.php:65 +msgid "Warning- This options panel will not work properly without javascript!" +msgstr "" + +#: ReduxCore/core/panel.php:141 +msgid "Settings Imported!" +msgstr "" + +#: ReduxCore/core/panel.php:156 +msgid "All Defaults Restored!" +msgstr "" + +#: ReduxCore/core/panel.php:170 +msgid "Section Defaults Restored!" +msgstr "" + +#: ReduxCore/core/panel.php:184 +msgid "Settings Saved!" +msgstr "" + +#: ReduxCore/core/panel.php:204 +msgid "Settings have changed, you should save them!" +msgstr "" + +#: ReduxCore/core/panel.php:212 +msgid "error(s) were found!" +msgstr "" + +#: ReduxCore/core/panel.php:220 +msgid "warning(s) were found!" +msgstr "" + +#: ReduxCore/core/panel.php:340 +msgid "" +"Your panel has bundled outdated copies of Redux Framework template " +"files – if you encounter functionality issues this could be " +"the reason. Ensure you update or remove them." +msgstr "" + +#: ReduxCore/framework.php:220 +msgid "Options panel created using %1$s" +msgstr "" + +#. Plugin Name of the plugin/theme +msgid "Redux Framework" +msgstr "" + +#: ReduxCore/framework.php:224 ReduxCore/framework.php:228 +msgid "Options" +msgstr "" + +#: ReduxCore/framework.php:1381 +#: ReduxCore/templates/panel/menu_container.tpl.php:63 +msgid "System Info" +msgstr "" + +#: ReduxCore/framework.php:1684 +msgid "Enable" +msgstr "" + +#: ReduxCore/framework.php:1689 +msgid "Disable" +msgstr "" + +#: ReduxCore/framework.php:1695 +msgid "moving the mouse over" +msgstr "" + +#: ReduxCore/framework.php:1697 +msgid "clicking" +msgstr "" + +#: ReduxCore/framework.php:1701 +msgid "" +"Hints are tooltips that popup when %d the hint icon, offering addition " +"information about the field in which they appear. They can be %d d by " +"using the link below." +msgstr "" + +#: ReduxCore/framework.php:1706 +msgid "Hints" +msgstr "" + +#: ReduxCore/framework.php:1833 +msgid "Default" +msgstr "" + +#: ReduxCore/framework.php:2687 +msgid "Invalid security credential, please reload the page and try again." +msgstr "" + +#: ReduxCore/framework.php:2753 +msgid "Your panel has no fields. Nothing to save." +msgstr "" + +#: ReduxCore/inc/class.redux_filesystem.php:23 +msgid "Unable to modify required files. Please ensure that" +msgstr "" + +#: ReduxCore/inc/class.redux_filesystem.php:25 +msgid "has the proper read/write permissions or enter your FTP information below." +msgstr "" + +#: ReduxCore/inc/class.redux_functions.php:237 +msgid "Dismiss" +msgstr "" + +#: ReduxCore/inc/class.redux_helpers.php:577 +msgid "" +"%s version %s is out of " +"date. The core version is %s" +msgstr "" + +#: ReduxCore/inc/class.redux_themecheck.php:61 +msgid "" +"The theme you are testing has %s embedded. We invite you to read the " +"%sTheme-Check Documentation%s to understand some warnings you will see " +"because of Redux." +msgstr "" + +#: ReduxCore/inc/class.redux_themecheck.php:109 +msgid "" +"The following directories & files are still located in your " +"Redux directory. They may cause errors in Theme-Check." +msgstr "" + +#: ReduxCore/inc/debug.php:41 ReduxCore/inc/debug.php:69 +#: ReduxCore/inc/debug.php:76 ReduxCore/inc/debug.php:77 +msgid "Options Object" +msgstr "" + +#: ReduxCore/inc/debug.php:54 +msgid "Show Object in Javascript Console Object" +msgstr "" + +#: ReduxCore/inc/extensions/customizer/extension_customizer.php:597 +msgid "You have changes that are not saved. Would you like to save them now?" +msgstr "" + +#: ReduxCore/inc/extensions/customizer/extension_customizer.php:598 +msgid "Are you sure? Resetting will lose all custom values." +msgstr "" + +#: ReduxCore/inc/extensions/customizer/extension_customizer.php:599 +msgid "" +"Your current options will be replaced with the values of this preset. " +"Would you like to proceed?" +msgstr "" + +#: ReduxCore/inc/extensions/import_export/extension_import_export.php:120 +msgid "Import / Export" +msgstr "" + +#: ReduxCore/inc/extensions/import_export/import_export/field_import_export.php:106 +msgid "Import Options" +msgstr "" + +#: ReduxCore/inc/extensions/import_export/import_export/field_import_export.php:107 +msgid "Import from File" +msgstr "" + +#: ReduxCore/inc/extensions/import_export/import_export/field_import_export.php:107 +msgid "Import from URL" +msgstr "" + +#: ReduxCore/inc/extensions/import_export/import_export/field_import_export.php:110 +msgid "" +"Input your backup file below and hit Import to restore your sites options " +"from a backup." +msgstr "" + +#: ReduxCore/inc/extensions/import_export/import_export/field_import_export.php:115 +msgid "" +"Input the URL to another sites options set and hit Import to load the " +"options from that site." +msgstr "" + +#: ReduxCore/inc/extensions/import_export/import_export/field_import_export.php:119 +msgid "Import" +msgstr "" + +#: ReduxCore/inc/extensions/import_export/import_export/field_import_export.php:119 +msgid "" +"WARNING! This will overwrite all existing option values, please proceed " +"with caution!" +msgstr "" + +#: ReduxCore/inc/extensions/import_export/import_export/field_import_export.php:122 +msgid "Export Options" +msgstr "" + +#: ReduxCore/inc/extensions/import_export/import_export/field_import_export.php:124 +msgid "" +"Here you can copy/download your current option settings. Keep this safe as " +"you can use it as a backup should anything go wrong, or you can use it to " +"restore your settings on this site (or any other site)." +msgstr "" + +#: ReduxCore/inc/extensions/import_export/import_export/field_import_export.php:129 +msgid "Copy Data" +msgstr "" + +#: ReduxCore/inc/extensions/import_export/import_export/field_import_export.php:129 +msgid "Download Data File" +msgstr "" + +#: ReduxCore/inc/extensions/import_export/import_export/field_import_export.php:129 +msgid "Copy Export URL" +msgstr "" + +#: ReduxCore/inc/fields/background/field_background.php:124 +#: ReduxCore/inc/fields/color/field_color.php:73 +#: ReduxCore/inc/fields/color_gradient/field_color_gradient.php:79 +#: ReduxCore/inc/fields/color_gradient/field_color_gradient.php:91 +msgid "Transparent" +msgstr "" + +#: ReduxCore/inc/fields/background/field_background.php:141 +msgid "Background Repeat" +msgstr "" + +#: ReduxCore/inc/fields/background/field_background.php:157 +msgid "Background Clip" +msgstr "" + +#: ReduxCore/inc/fields/background/field_background.php:173 +msgid "Background Origin" +msgstr "" + +#: ReduxCore/inc/fields/background/field_background.php:188 +msgid "Background Size" +msgstr "" + +#: ReduxCore/inc/fields/background/field_background.php:203 +msgid "Background Attachment" +msgstr "" + +#: ReduxCore/inc/fields/background/field_background.php:223 +msgid "Background Position" +msgstr "" + +#: ReduxCore/inc/fields/background/field_background.php:277 +#: ReduxCore/inc/fields/media/field_media.php:149 +msgid "No media selected" +msgstr "" + +#: ReduxCore/inc/fields/background/field_background.php:314 +#: ReduxCore/inc/fields/media/field_media.php:198 +#: ReduxCore/inc/fields/slides/field_slides.php:126 +#: ReduxCore/inc/fields/slides/field_slides.php:188 +msgid "Upload" +msgstr "" + +#: ReduxCore/inc/fields/background/field_background.php:321 +#: ReduxCore/inc/fields/media/field_media.php:205 +#: ReduxCore/inc/fields/multi_text/field_multi_text.php:69 +#: ReduxCore/inc/fields/multi_text/field_multi_text.php:73 +#: ReduxCore/inc/fields/multi_text/field_multi_text.php:76 +#: ReduxCore/inc/fields/slides/field_slides.php:133 +#: ReduxCore/inc/fields/slides/field_slides.php:190 +msgid "Remove" +msgstr "" + +#: ReduxCore/inc/fields/border/field_border.php:125 +#: ReduxCore/inc/fields/spacing/field_spacing.php:191 +msgid "All" +msgstr "" + +#: ReduxCore/inc/fields/border/field_border.php:138 +#: ReduxCore/inc/fields/spacing/field_spacing.php:215 +msgid "Top" +msgstr "" + +#: ReduxCore/inc/fields/border/field_border.php:145 +#: ReduxCore/inc/fields/spacing/field_spacing.php:222 +msgid "Right" +msgstr "" + +#: ReduxCore/inc/fields/border/field_border.php:152 +#: ReduxCore/inc/fields/spacing/field_spacing.php:229 +msgid "Bottom" +msgstr "" + +#: ReduxCore/inc/fields/border/field_border.php:159 +#: ReduxCore/inc/fields/spacing/field_spacing.php:236 +msgid "Left" +msgstr "" + +#: ReduxCore/inc/fields/border/field_border.php:173 +msgid "Border style" +msgstr "" + +#: ReduxCore/inc/fields/color_gradient/field_color_gradient.php:68 +msgid "From " +msgstr "" + +#: ReduxCore/inc/fields/color_gradient/field_color_gradient.php:82 +msgid "To " +msgstr "" + +#: ReduxCore/inc/fields/dimensions/field_dimensions.php:162 +msgid "Width" +msgstr "" + +#: ReduxCore/inc/fields/dimensions/field_dimensions.php:178 +#: ReduxCore/inc/fields/typography/field_typography.php:442 +msgid "Height" +msgstr "" + +#: ReduxCore/inc/fields/dimensions/field_dimensions.php:189 +#: ReduxCore/inc/fields/dimensions/field_dimensions.php:190 +#: ReduxCore/inc/fields/spacing/field_spacing.php:245 +#: ReduxCore/inc/fields/spacing/field_spacing.php:246 +msgid "Units" +msgstr "" + +#: ReduxCore/inc/fields/gallery/field_gallery.php:73 +msgid "Add/Edit Gallery" +msgstr "" + +#: ReduxCore/inc/fields/gallery/field_gallery.php:74 +msgid "Clear Gallery" +msgstr "" + +#: ReduxCore/inc/fields/link_color/field_link_color.php:87 +msgid "Regular" +msgstr "" + +#: ReduxCore/inc/fields/link_color/field_link_color.php:91 +msgid "Hover" +msgstr "" + +#: ReduxCore/inc/fields/link_color/field_link_color.php:95 +msgid "Visited" +msgstr "" + +#: ReduxCore/inc/fields/link_color/field_link_color.php:99 +msgid "Active" +msgstr "" + +#: ReduxCore/inc/fields/multi_text/field_multi_text.php:61 +msgid "Add More" +msgstr "" + +#: ReduxCore/inc/fields/password/field_password.php:62 +msgid "Password" +msgstr "" + +#: ReduxCore/inc/fields/password/field_password.php:63 +msgid "Username" +msgstr "" + +#: ReduxCore/inc/fields/select/field_select.php:83 +#: ReduxCore/inc/fields/select_image/field_select_image.php:63 +msgid "Select an item" +msgstr "" + +#: ReduxCore/inc/fields/select/field_select.php:134 +#: ReduxCore/inc/fields/select_image/field_select_image.php:144 +msgid "No items of this type were found." +msgstr "" + +#: ReduxCore/inc/fields/slides/field_slides.php:68 +msgid "Slide" +msgstr "" + +#: ReduxCore/inc/fields/slides/field_slides.php:73 +#: ReduxCore/inc/fields/slides/field_slides.php:174 +msgid "New %s" +msgstr "" + +#: ReduxCore/inc/fields/slides/field_slides.php:145 +#: ReduxCore/inc/fields/slides/field_slides.php:200 +msgid "Title" +msgstr "" + +#: ReduxCore/inc/fields/slides/field_slides.php:149 +#: ReduxCore/inc/fields/slides/field_slides.php:204 +msgid "Description" +msgstr "" + +#: ReduxCore/inc/fields/slides/field_slides.php:153 +#: ReduxCore/inc/fields/slides/field_slides.php:207 +msgid "URL" +msgstr "" + +#: ReduxCore/inc/fields/slides/field_slides.php:167 +#: ReduxCore/inc/fields/slides/field_slides.php:220 +msgid "Delete" +msgstr "" + +#: ReduxCore/inc/fields/slides/field_slides.php:223 +msgid "Add %s" +msgstr "" + +#: ReduxCore/inc/fields/switch/field_switch.php:41 +msgid "On" +msgstr "" + +#: ReduxCore/inc/fields/switch/field_switch.php:44 +msgid "Off" +msgstr "" + +#: ReduxCore/inc/fields/typography/field_typography.php:231 +msgid "Font Family" +msgstr "" + +#: ReduxCore/inc/fields/typography/field_typography.php:232 +msgid "Font family" +msgstr "" + +#: ReduxCore/inc/fields/typography/field_typography.php:258 +#: ReduxCore/inc/fields/typography/field_typography.php:259 +msgid "Backup Font Family" +msgstr "" + +#: ReduxCore/inc/fields/typography/field_typography.php:273 +#: ReduxCore/inc/fields/typography/field_typography.php:281 +msgid "Font style" +msgstr "" + +#: ReduxCore/inc/fields/typography/field_typography.php:274 +msgid "Font Weight & Style" +msgstr "" + +#: ReduxCore/inc/fields/typography/field_typography.php:281 +msgid "Style" +msgstr "" + +#: ReduxCore/inc/fields/typography/field_typography.php:321 +msgid "Font subsets" +msgstr "" + +#: ReduxCore/inc/fields/typography/field_typography.php:323 +msgid "Font Subsets" +msgstr "" + +#: ReduxCore/inc/fields/typography/field_typography.php:325 +msgid "Subsets" +msgstr "" + +#: ReduxCore/inc/fields/typography/field_typography.php:325 +msgid "Font script" +msgstr "" + +#: ReduxCore/inc/fields/typography/field_typography.php:342 +#: ReduxCore/inc/fields/typography/field_typography.php:343 +#: ReduxCore/inc/fields/typography/field_typography.php:344 +msgid "Text Align" +msgstr "" + +#: ReduxCore/inc/fields/typography/field_typography.php:365 +#: ReduxCore/inc/fields/typography/field_typography.php:366 +#: ReduxCore/inc/fields/typography/field_typography.php:367 +msgid "Text Transform" +msgstr "" + +#: ReduxCore/inc/fields/typography/field_typography.php:388 +#: ReduxCore/inc/fields/typography/field_typography.php:389 +#: ReduxCore/inc/fields/typography/field_typography.php:390 +msgid "Font Variant" +msgstr "" + +#: ReduxCore/inc/fields/typography/field_typography.php:408 +#: ReduxCore/inc/fields/typography/field_typography.php:409 +#: ReduxCore/inc/fields/typography/field_typography.php:410 +msgid "Text Decoration" +msgstr "" + +#: ReduxCore/inc/fields/typography/field_typography.php:432 +#: ReduxCore/inc/fields/typography/field_typography.php:433 +msgid "Font Size" +msgstr "" + +#: ReduxCore/inc/fields/typography/field_typography.php:433 +msgid "Size" +msgstr "" + +#: ReduxCore/inc/fields/typography/field_typography.php:441 +#: ReduxCore/inc/fields/typography/field_typography.php:442 +msgid "Line Height" +msgstr "" + +#: ReduxCore/inc/fields/typography/field_typography.php:450 +#: ReduxCore/inc/fields/typography/field_typography.php:451 +msgid "Word Spacing" +msgstr "" + +#: ReduxCore/inc/fields/typography/field_typography.php:459 +#: ReduxCore/inc/fields/typography/field_typography.php:460 +msgid "Letter Spacing" +msgstr "" + +#: ReduxCore/inc/fields/typography/field_typography.php:478 +msgid "Font Color" +msgstr "" + +#: ReduxCore/inc/fields/typography/field_typography.php:480 +msgid "Font color" +msgstr "" + +#: ReduxCore/inc/fields/typography/field_typography.php:879 +msgid "Standard Fonts" +msgstr "" + +#: ReduxCore/inc/fields/typography/field_typography.php:980 +msgid "Google Webfonts" +msgstr "" + +#: ReduxCore/inc/tracking.php:129 +msgid "Help improve Our Panel" +msgstr "" + +#: ReduxCore/inc/tracking.php:130 +msgid "" +"Please helps us improve our panel by allowing us to gather anonymous usage " +"stats so we know which configurations, plugins and themes to test to ensure " +"compatibility." +msgstr "" + +#: ReduxCore/inc/tracking.php:135 +msgid "Allow tracking" +msgstr "" + +#: ReduxCore/inc/tracking.php:140 +msgid "Do not allow tracking" +msgstr "" + +#: ReduxCore/inc/tracking.php:151 +msgid "Welcome to the Redux Demo Panel" +msgstr "" + +#: ReduxCore/inc/tracking.php:152 +msgid "Getting Started" +msgstr "" + +#: ReduxCore/inc/tracking.php:152 +msgid "" +"This panel demonstrates the many features of Redux. Before digging in, we " +"suggest you get up to speed by reviewing %1$s." +msgstr "" + +#: ReduxCore/inc/tracking.php:152 +msgid "our documentation" +msgstr "" + +#: ReduxCore/inc/tracking.php:153 +msgid "Redux Generator" +msgstr "" + +#: ReduxCore/inc/tracking.php:153 +msgid "" +"Want to get a head start? Use the %1$s. It will create a customized " +"boilerplate theme or a standalone admin folder complete with all things " +"Redux (with the help of Underscores and TGM). Save yourself a headache and " +"try it today." +msgstr "" + +#: ReduxCore/inc/tracking.php:154 ReduxCore/inc/welcome/welcome.php:212 +msgid "Redux Extensions" +msgstr "" + +#: ReduxCore/inc/tracking.php:154 +msgid "" +"Did you know we have extensions, which greatly enhance the features of " +"Redux? Visit our %1$s to learn more!" +msgstr "" + +#: ReduxCore/inc/tracking.php:154 +msgid "extensions directory" +msgstr "" + +#: ReduxCore/inc/tracking.php:155 +msgid "Like Redux?" +msgstr "" + +#: ReduxCore/inc/tracking.php:155 +msgid "" +"If so, please %1$s and consider making a %2$s to keep development of Redux " +"moving forward." +msgstr "" + +#: ReduxCore/inc/tracking.php:155 +msgid "leave us a favorable review on WordPress.org" +msgstr "" + +#: ReduxCore/inc/tracking.php:155 +msgid "donation" +msgstr "" + +#: ReduxCore/inc/tracking.php:156 +msgid "Newsletter" +msgstr "" + +#: ReduxCore/inc/tracking.php:156 +msgid "" +"If you'd like to keep up to with all things Redux, please subscribe to our " +"newsletter" +msgstr "" + +#: ReduxCore/inc/tracking.php:157 +msgid "Email address" +msgstr "" + +#: ReduxCore/inc/tracking.php:157 +msgid "Subscribe" +msgstr "" + +#: ReduxCore/inc/tracking.php:166 +msgid "Close" +msgstr "" + +#: ReduxCore/inc/validation/color/validation_color.php:15 +#: ReduxCore/inc/validation/color_rgba/validation_color_rgba.php:14 +#: ReduxCore/inc/validation/colorrgba/validation_colorrgba.php:16 +msgid "This field must be a valid color value." +msgstr "" + +#: ReduxCore/inc/validation/comma_numeric/validation_comma_numeric.php:16 +msgid "You must provide a comma separated list of numerical values for this option." +msgstr "" + +#: ReduxCore/inc/validation/css/validation_css.php:38 +msgid "Unsafe strings were found in your CSS and have been filtered out." +msgstr "" + +#: ReduxCore/inc/validation/date/validation_date.php:16 +msgid "This field must be a valid date." +msgstr "" + +#: ReduxCore/inc/validation/email/validation_email.php:16 +#: ReduxCore/inc/validation/email_not_empty/validation_email_not_empty.php:16 +msgid "You must provide a valid email for this option." +msgstr "" + +#: ReduxCore/inc/validation/no_html/validation_no_html.php:15 +msgid "You must not enter any HTML in this field, all HTML tags have been removed." +msgstr "" + +#: ReduxCore/inc/validation/no_special_chars/validation_no_special_chars.php:16 +msgid "" +"You must not enter any special characters in this field, all special " +"characters have been removed." +msgstr "" + +#: ReduxCore/inc/validation/not_empty/validation_not_empty.php:16 +msgid "This field cannot be empty. Please provide a value." +msgstr "" + +#: ReduxCore/inc/validation/numeric/validation_numeric.php:16 +#: ReduxCore/inc/validation/numeric_not_empty/validation_numeric_not_empty.php:16 +msgid "You must provide a numerical value for this option." +msgstr "" + +#: ReduxCore/inc/validation/unique_slug/validation_unique_slug.php:16 +msgid "" +"That URL slug is in use, please choose another. %s is open for " +"use." +msgstr "" + +#: ReduxCore/inc/validation/url/validation_url.php:16 +msgid "You must provide a valid URL for this option." +msgstr "" + +#: ReduxCore/inc/welcome/views/about.php:2 +msgid "Welcome to Redux Framework %s" +msgstr "" + +#: ReduxCore/inc/welcome/views/about.php:5 +msgid "" +"Thank you for updating to the latest version! Redux Framework %s is a huge " +"step forward in Redux Development. Look at all that's new." +msgstr "" + +#: ReduxCore/inc/welcome/views/about.php:8 +#: ReduxCore/inc/welcome/views/changelog.php:8 +#: ReduxCore/inc/welcome/views/credits.php:8 +#: ReduxCore/inc/welcome/views/extensions.php:82 +#: ReduxCore/inc/welcome/views/status_report.php:31 +#: ReduxCore/inc/welcome/views/support.php:8 +msgid "Version %s" +msgstr "" + +#: ReduxCore/inc/welcome/views/about.php:15 +msgid "What is Redux Framework?" +msgstr "" + +#: ReduxCore/inc/welcome/views/about.php:17 +msgid "" +"Redux Framework is the core of many products on the web. It is an option " +"framework which developers use to\n" +" enhance their products." +msgstr "" + +#: ReduxCore/inc/welcome/views/about.php:22 +msgid "Learn More" +msgstr "" + +#: ReduxCore/inc/welcome/views/about.php:28 +msgid "New in this Release" +msgstr "" + +#: ReduxCore/inc/welcome/views/changelog.php:2 +msgid "Redux Framework - Changelog" +msgstr "" + +#: ReduxCore/inc/welcome/views/changelog.php:5 +#: ReduxCore/inc/welcome/views/status_report.php:28 +msgid "" +"Our core mantra at Redux is backwards compatibility. With hundreds of " +"thousands of instances worldwide, you can be assured that we will take care " +"of you and your clients." +msgstr "" + +#: ReduxCore/inc/welcome/views/credits.php:2 +msgid "Redux Framework - A Community Effort" +msgstr "" + +#: ReduxCore/inc/welcome/views/credits.php:5 +msgid "" +"We recognize we are nothing without our community. We would like to thank " +"all of those who help Redux to be what it is. Thank you for your " +"involvement." +msgstr "" + +#: ReduxCore/inc/welcome/views/credits.php:14 +msgid "" +"Redux is created by a community of developers world wide. Want to have your " +"name listed too? Contribute to Redux." +msgstr "" + +#: ReduxCore/inc/welcome/views/extensions.php:76 +msgid "Redux Framework - Extensions" +msgstr "" + +#: ReduxCore/inc/welcome/views/extensions.php:79 +msgid "" +"Supercharge your Redux experience. Our extensions provide you with features " +"that will take your products to the next level." +msgstr "" + +#: ReduxCore/inc/welcome/views/extensions.php:88 +msgid "" +"While some are built specificially for developers, extensions such as " +"Custom Fonts are sure to make any user happy." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:25 +msgid "Redux Framework - System Status" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:38 +msgid "" +"Please copy and paste this information in your ticket when contacting " +"support:" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:41 +msgid "Get System Report" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:44 +msgid "Understanding the Status Report" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:51 +msgid "Copied!" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:51 +msgid "Copy for Support" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:60 +msgid "WordPress Environment" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:65 +msgid "Home URL" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:66 +msgid "The URL of your site's homepage." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:70 +msgid "Site URL" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:71 +msgid "The root URL of your site." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:75 +msgid "Redux Version" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:76 +msgid "The version of Redux Framework installed on your site." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:80 +msgid "Redux Data Directory Writable" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:83 +msgid "" +"Redux and its extensions write data to the uploads directory. " +"This directory must be writable." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:88 +msgid "To allow data saving, make %s writable." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:93 +msgid "WP Version" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:94 +msgid "The version of WordPress installed on your site." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:98 +msgid "WP Multisite" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:99 +msgid "Whether or not you have WordPress Multisite enabled." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:107 +msgid "Permalink Structure" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:108 +msgid "" +"The current permalink structure as defined in Wordpress " +"Settings->Permalinks." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:113 +msgid "Front Page Display" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:114 +msgid "The current Reading mode of Wordpress." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:122 +msgid "Front Page" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:123 +msgid "The currently selected page which acts as the site's Front Page." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:127 +msgid "Posts Page" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:128 +msgid "The currently selected page in where blog posts are displayed." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:135 +msgid "WP Memory Limit" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:136 +msgid "The maximum amount of memory (RAM) that your site can use at one time." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:141 +msgid "" +"%s - We recommend setting memory to at least 40MB. See: Increasing memory allocated to PHP" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:148 +msgid "Database Table Prefix" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:150 +msgid "The prefix structure of the current Wordpress database." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:154 +msgid "WP Debug Mode" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:155 +msgid "Displays whether or not WordPress is in Debug Mode." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:163 +msgid "Language" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:164 +msgid "The current language used by WordPress. Default = English" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:172 +msgid "Browser" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:177 +msgid "Browser Info" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:178 +msgid "Information about web browser current in use." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:193 +msgid "Server Environment" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:198 +msgid "Server Info" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:199 +msgid "Information about the web server that is currently hosting your site." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:203 +msgid "Localhost Environment" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:204 +msgid "Is the server running in a localhost environment." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:214 +msgid "PHP Version" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:215 +msgid "The version of PHP installed on your hosting server." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:220 +msgid "PHP Memory Limit" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:221 +#: ReduxCore/inc/welcome/views/status_report.php:226 +msgid "The largest filesize that can be contained in one post." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:225 +msgid "PHP Post Max Size" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:230 +msgid "PHP Time Limit" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:231 +msgid "" +"The amount of time (in seconds) that your site will spend on a single " +"operation before timing out (to avoid server lockups)" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:235 +msgid "PHP Max Input Vars" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:236 +msgid "" +"The maximum number of variables your server can use for a single function " +"to avoid overloads." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:240 +msgid "PHP Display Errors" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:241 +msgid "Determines if PHP will display errors within the browser." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:252 +msgid "SUHOSIN Installed" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:253 +msgid "" +"Suhosin is an advanced protection system for PHP installations. It was " +"designed to protect your servers on the one hand against a number of well " +"known problems in PHP applications and on the other hand against potential " +"unknown vulnerabilities within these applications or the PHP core itself. " +"If enabled on your server, Suhosin may need to be configured to increase " +"its data submission limits." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:262 +msgid "MySQL Version" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:263 +msgid "The version of MySQL installed on your hosting server." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:267 +msgid "Max Upload Size" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:268 +msgid "The largest filesize that can be uploaded to your WordPress installation." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:272 +msgid "Default Timezone is UTC" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:275 +msgid "The default timezone for your server." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:278 +msgid "Default timezone is %s - it should be UTC" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:289 +msgid "Used when communicating with remote services with PHP." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:295 +msgid "" +"Your server does not have fsockopen or cURL enabled - cURL is used to " +"communicate with other servers. Please contact your hosting provider." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:334 +msgid "Remote Post" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:335 +msgid "Used to send data to remote servers." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:340 +msgid "" +"wp_remote_post() failed. Many advanced features may not function. Contact " +"your hosting provider." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:343 +#: ReduxCore/inc/welcome/views/status_report.php:358 +msgid "Error: %s" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:350 +msgid "Remote Get" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:351 +msgid "Used to grab information from remote servers for updates updates." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:356 +msgid "" +"wp_remote_get() failed. This is needed to get information from remote " +"servers. Contact your hosting provider." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:390 +msgid "Active Plugins" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:406 +msgid "Visit plugin homepage" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:430 +msgid "Redux Instance: " +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:437 +msgid "The opt_name argument for this instance of Redux." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:445 +msgid "The global_variable argument for this instance of Redux." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:453 +msgid "Indicates if developer mode is enabled for this instance of Redux." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:458 +msgid "Indicates if ajax based saving is enabled for this instance of Redux." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:463 +msgid "" +"The page slug denotes the string used for the options panel page for this " +"instance of Redux." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:468 +msgid "" +"The page permissions variable sets the permission level required to access " +"the options panel for this instance of Redux." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:473 +msgid "" +"This variable set whether or not the menu is displayed as an admin menu " +"item for this instance of Redux." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:478 +msgid "" +"The page parent variable sets where the options menu will be placed on the " +"WordPress admin sidebar for this instance of Redux." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:484 +msgid "Indicates if the compiler flag is enabled for this instance of Redux." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:489 +msgid "" +"Indicates if output flag for globally shutting off all CSS output is " +"enabled for this instance of Redux." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:494 +msgid "" +"The output_tag variable sets whether or not dynamic CSS will be generated " +"for the customizer and Google fonts for this instance of Redux." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:503 +msgid "" +"The specified template path containing custom template files for this " +"instance of Redux." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:508 +msgid "List of template files overriding the default Redux template files." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:531 +msgid "Indicates the installed Redux extensions and their version numbers." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:562 +msgid "Theme" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:567 +msgid "Name" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:568 +msgid "The name of the current active theme." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:572 +msgid "Version" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:573 +msgid "The installed version of the current active theme." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:578 +msgid "is available" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:583 +msgid "Author URL" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:584 +msgid "The theme developers URL." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:588 +msgid "Child Theme" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:589 +msgid "Displays whether or not the current theme is a child theme." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:591 +msgid "" +"If you're modifying Redux Framework or a parent theme you didn't build " +"personally, we recommend using a child theme. See: How to create a child theme" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:599 +msgid "Parent Theme Name" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:601 +msgid "The name of the parent theme." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:605 +msgid "Parent Theme Version" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:608 +msgid "The installed version of the parent theme." +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:612 +msgid "Parent Theme Author URL" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:615 +msgid "The parent theme developers URL." +msgstr "" + +#: ReduxCore/inc/welcome/views/support.php:2 +msgid "Redux Framework - Support" +msgstr "" + +#: ReduxCore/inc/welcome/views/support.php:5 +msgid "" +"We are an open source project used by developers to make powerful control " +"panels." +msgstr "" + +#: ReduxCore/inc/welcome/views/support.php:20 +msgid "Generate a Support URL" +msgstr "" + +#: ReduxCore/inc/welcome/views/support.php:21 +msgid "Select Support Type" +msgstr "" + +#: ReduxCore/inc/welcome/views/support.php:22 +#: ReduxCore/inc/welcome/views/support.php:65 +msgid "How to Get Support" +msgstr "" + +#: ReduxCore/inc/welcome/views/support.php:27 +msgid "Submit a Support Request" +msgstr "" + +#: ReduxCore/inc/welcome/views/support.php:30 +msgid "To get started, we will need to generate a support hash." +msgstr "" + +#: ReduxCore/inc/welcome/views/support.php:33 +msgid "" +"This will provide to your developer all the information they may need to " +"remedy your issue. This action WILL send information securely to a remote " +"server. To see the type of information sent, please look at the Status tab." +msgstr "" + +#: ReduxCore/inc/welcome/views/support.php:37 +msgid "" +"Generate\n" +" a Support URL" +msgstr "" + +#: ReduxCore/inc/welcome/views/support.php:44 +msgid "Select Your Support Type" +msgstr "" + +#: ReduxCore/inc/welcome/views/support.php:47 +msgid "What type of user are you?" +msgstr "" + +#: ReduxCore/inc/welcome/views/support.php:52 +msgid "User" +msgstr "" + +#: ReduxCore/inc/welcome/views/support.php:53 +msgid "I am a user, using a pre-built product." +msgstr "" + +#: ReduxCore/inc/welcome/views/support.php:56 +msgid "Developer" +msgstr "" + +#: ReduxCore/inc/welcome/views/support.php:57 +msgid "I am a developer, building a product using Redux." +msgstr "" + +#: ReduxCore/inc/welcome/views/support.php:68 +msgid "" +"Please proceed to the Redux Framework issue tracker and supply us with your " +"support URL below. Please also provide any information that will help us to " +"reproduce your issue." +msgstr "" + +#: ReduxCore/inc/welcome/views/support.php:74 +msgid "" +"Listed below are the Wordpress plugins and/or theme installed on your site " +"that utilize Redux Framework. We do not directly support products created " +"with our framework. It is the responsibility of the plugin or theme " +"developer to support their work. You will need to contact the author(s) of " +"the products listed below with your support questions." +msgstr "" + +#: ReduxCore/inc/welcome/views/support.php:77 +msgid "" +"Please be sure to include for your developer - via cut and paste - the " +"Support URL in the box below." +msgstr "" + +#: ReduxCore/inc/welcome/views/support.php:215 +msgid "" +"Should the developer not be responsive, read the following article before asking for support from us " +"directly." +msgstr "" + +#: ReduxCore/inc/welcome/welcome.php:168 +msgid "Support hash could not be generated. Please try again later." +msgstr "" + +#: ReduxCore/inc/welcome/welcome.php:188 +msgid "Welcome to Redux Framework" +msgstr "" + +#: ReduxCore/inc/welcome/welcome.php:196 +msgid "Redux Framework Changelog" +msgstr "" + +#: ReduxCore/inc/welcome/welcome.php:204 class.redux-plugin.php:410 +msgid "Get Support" +msgstr "" + +#: ReduxCore/inc/welcome/welcome.php:221 +msgid "The people that develop Redux Framework" +msgstr "" + +#: ReduxCore/inc/welcome/welcome.php:229 +msgid "Redux Framework Status" +msgstr "" + +#: ReduxCore/inc/welcome/welcome.php:334 +msgid "What's New" +msgstr "" + +#: ReduxCore/inc/welcome/welcome.php:338 +msgid "Extensions" +msgstr "" + +#: ReduxCore/inc/welcome/welcome.php:342 +msgid "Changelog" +msgstr "" + +#: ReduxCore/inc/welcome/welcome.php:346 +msgid "Credits" +msgstr "" + +#: ReduxCore/inc/welcome/welcome.php:350 +msgid "Support" +msgstr "" + +#: ReduxCore/inc/welcome/welcome.php:354 +msgid "Status" +msgstr "" + +#: ReduxCore/inc/welcome/welcome.php:511 +msgid "View %s" +msgstr "" + +#: ReduxCore/templates/panel/footer.tpl.php:43 +#: ReduxCore/templates/panel/header_stickybar.tpl.php:20 +msgid "Save Changes" +msgstr "" + +#: ReduxCore/templates/panel/footer.tpl.php:46 +#: ReduxCore/templates/panel/header_stickybar.tpl.php:22 +msgid "Reset Section" +msgstr "" + +#: ReduxCore/templates/panel/footer.tpl.php:47 +#: ReduxCore/templates/panel/header_stickybar.tpl.php:23 +msgid "Reset All" +msgstr "" + +#: ReduxCore/templates/panel/footer.tpl.php:52 +#: ReduxCore/templates/panel/header_stickybar.tpl.php:26 +msgid "Working..." +msgstr "" + +#: ReduxCore/templates/panel/header.tpl.php:18 +msgid "Developer Mode Enabled" +msgstr "" + +#: ReduxCore/templates/panel/header_stickybar.tpl.php:16 +msgid "Expand" +msgstr "" + +#: class.redux-plugin.php:306 +msgid "Redux Framework has an embedded demo." +msgstr "" + +#: class.redux-plugin.php:306 +msgid "Click here to activate the sample config file." +msgstr "" + +#: class.redux-plugin.php:407 +msgid "Docs" +msgstr "" + +#: class.redux-plugin.php:408 +msgid "Repo" +msgstr "" + +#: class.redux-plugin.php:409 +msgid "Builder" +msgstr "" + +#: class.redux-plugin.php:415 +msgid "Deactivate Demo Mode" +msgstr "" + +#: class.redux-plugin.php:417 +msgid "Activate Demo Mode" +msgstr "" + +#: tests/includes/class-tivwp-dm-controller.php:28 +msgid "Must call in of after the \"plugins_loaded\" action." +msgstr "" + +#: tests/includes/class-tivwp-dm-controller.php:138 +msgid "Unknown action \"%1$s\" specified for %2$s" +msgstr "" + +#: tests/includes/class-tivwp-dm-controller.php:143 +msgid "The unknown action has been replaced with \"%s\"" +msgstr "" + +#: tests/includes/class-tivwp-dm-controller.php:158 +msgid "Automatic action performed: \"%s\"" +msgstr "" + +#: tests/includes/class-tivwp-dm.php:112 +msgid "Activate Development Plugins" +msgstr "" + +#: tests/includes/class-tivwp-dm.php:119 +msgid "Deactivate Development Plugins" +msgstr "" + +#: tests/includes/class-tivwp-dm.php:131 +msgid "You do not have sufficient permissions to access this page." +msgstr "" + +#. Plugin URI of the plugin/theme +msgid "http://wordpress.org/plugins/legacy_framework" +msgstr "" + +#. Description of the plugin/theme +msgid "" +"Redux is a simple, truly extensible options framework for WordPress themes " +"and plugins." +msgstr "" + +#. Author of the plugin/theme +msgid "Team Redux" +msgstr "" + +#. Author URI of the plugin/theme +msgid "http://reduxframework.com" +msgstr "" + +#: ReduxCore/inc/welcome/views/status_report.php:412 +msgctxt "by author" +msgid "by %s" +msgstr "" \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/languages/ro_RO.mo b/plugins/legacy-admin/framework/core/languages/ro_RO.mo new file mode 100644 index 000000000..5597eff17 Binary files /dev/null and b/plugins/legacy-admin/framework/core/languages/ro_RO.mo differ diff --git a/plugins/legacy-admin/framework/core/languages/ru_RU.mo b/plugins/legacy-admin/framework/core/languages/ru_RU.mo new file mode 100644 index 000000000..01607074f Binary files /dev/null and b/plugins/legacy-admin/framework/core/languages/ru_RU.mo differ diff --git a/plugins/legacy-admin/framework/core/languages/sk_SK.mo b/plugins/legacy-admin/framework/core/languages/sk_SK.mo new file mode 100644 index 000000000..2b7ea22b4 Binary files /dev/null and b/plugins/legacy-admin/framework/core/languages/sk_SK.mo differ diff --git a/plugins/legacy-admin/framework/core/languages/sl_SI.mo b/plugins/legacy-admin/framework/core/languages/sl_SI.mo new file mode 100644 index 000000000..41358aae4 Binary files /dev/null and b/plugins/legacy-admin/framework/core/languages/sl_SI.mo differ diff --git a/plugins/legacy-admin/framework/core/languages/sv_SE.mo b/plugins/legacy-admin/framework/core/languages/sv_SE.mo new file mode 100644 index 000000000..e39d7672f Binary files /dev/null and b/plugins/legacy-admin/framework/core/languages/sv_SE.mo differ diff --git a/plugins/legacy-admin/framework/core/languages/th.mo b/plugins/legacy-admin/framework/core/languages/th.mo new file mode 100644 index 000000000..d90141b0a Binary files /dev/null and b/plugins/legacy-admin/framework/core/languages/th.mo differ diff --git a/plugins/legacy-admin/framework/core/languages/tr_TR.mo b/plugins/legacy-admin/framework/core/languages/tr_TR.mo new file mode 100644 index 000000000..e33468781 Binary files /dev/null and b/plugins/legacy-admin/framework/core/languages/tr_TR.mo differ diff --git a/plugins/legacy-admin/framework/core/languages/zh_CN.mo b/plugins/legacy-admin/framework/core/languages/zh_CN.mo new file mode 100644 index 000000000..166f0e05c Binary files /dev/null and b/plugins/legacy-admin/framework/core/languages/zh_CN.mo differ diff --git a/plugins/legacy-admin/framework/core/templates/panel/container.tpl.php b/plugins/legacy-admin/framework/core/templates/panel/container.tpl.php new file mode 100644 index 000000000..c65ef6078 --- /dev/null +++ b/plugins/legacy-admin/framework/core/templates/panel/container.tpl.php @@ -0,0 +1,44 @@ +parent->args['open_expanded'] ) ? ' fully-expanded' : '' . ( ! empty( $this->parent->args['class'] ) ? ' ' . $this->parent->args['class'] : '' ); + $nonce = wp_create_nonce("redux_ajax_nonce"); +?> +
    + parent->args['database'] == "network" && $this->parent->args['network_admin'] && is_network_admin() ? './edit.php?action=redux_' . $this->parent->args['opt_name'] : './options.php' ) ?> +
    + + + parent->no_panel ) ) : ?> + + + init_settings_fields(); + + // Last tab? + $this->parent->options['last_tab'] = ( isset( $_GET['tab'] ) && ! isset( $this->parent->transients['last_save_mode'] ) ) ? $_GET['tab'] : ''; + ?> + + + get_template( 'content.tpl.php' ); ?> + +
    +
    + +parent->args['footer_text'] ) ) : ?> + + diff --git a/plugins/legacy-admin/framework/core/templates/panel/content.tpl.php b/plugins/legacy-admin/framework/core/templates/panel/content.tpl.php new file mode 100644 index 000000000..9dfee5e4b --- /dev/null +++ b/plugins/legacy-admin/framework/core/templates/panel/content.tpl.php @@ -0,0 +1,121 @@ + + +get_template( 'header.tpl.php' ); ?> + + +parent->args['intro_text'] ) ) : ?> +
    parent->args['intro_text']; ?>
    + + + + + +get_template( 'menu_container.tpl.php' ); ?> + +
    + + get_template( 'header_stickybar.tpl.php' ); ?> +
     
    + parent->sections as $k => $section ) { + if ( isset( $section['customizer_only'] ) && $section['customizer_only'] == true ) { + continue; + } + + //$active = ( ( is_numeric($this->parent->current_tab) && $this->parent->current_tab == $k ) || ( !is_numeric($this->parent->current_tab) && $this->parent->current_tab === $k ) ) ? ' style="display: block;"' : ''; + $section['class'] = isset( $section['class'] ) ? ' ' . $section['class'] : ''; + echo '
    '; + //echo '
    '; + + echo '
      '; + + foreach ($section['tab'] as $subkey => $subsection) { + //echo '-=' . $subkey . '=-'; + echo '
    • ' . $subsection['title'] . '
    • '; + } + + echo '
    '; + foreach ($section['tab'] as $subkey => $subsection) { + echo '
    '; + echo '
    '; + echo "hello ".$subkey; + do_settings_sections( $this->parent->args['opt_name'] . $k . '_tab_' . $subkey . '_section_group' ); + echo "
    "; + echo "
    "; + } + echo "
    "; + } else { + */ + + // Don't display in the + $display = true; + if ( isset( $_GET['page'] ) && $_GET['page'] == $this->parent->args['page_slug'] ) { + if ( isset( $section['panel'] ) && $section['panel'] == "false" ) { + $display = false; + } + } + + if ( $display ) { + $this->output_section( $k ); + } + //} + echo "
    "; + //echo '
    '; + } + + // + // // Debug object output + // if ( $this->parent->args['dev_mode'] == true ) { + // $this->parent->debug->render(); + // } + //?> + parent->args['system_info'] === true ) : + // require_once ReduxFramework::$_dir . 'inc/sysinfo.php'; + // $system_info = new Simple_System_Info(); + // ?> + + + + + get( true );?> + + + + + parent->args['opt_name']}", $this ); // REMOVE LATER + + /** + * action 'redux/page/{opt_name}/sections/after' + * + * @param object $this ReduxFramework + */ + do_action( "redux/page/{$this->parent->args['opt_name']}/sections/after", $this ); + ?> +
    + + get_template( 'footer.tpl.php' ); ?> + +
    +
    \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/templates/panel/footer.tpl.php b/plugins/legacy-admin/framework/core/templates/panel/footer.tpl.php new file mode 100644 index 000000000..e905b0419 --- /dev/null +++ b/plugins/legacy-admin/framework/core/templates/panel/footer.tpl.php @@ -0,0 +1,57 @@ + + + diff --git a/plugins/legacy-admin/framework/core/templates/panel/header.tpl.php b/plugins/legacy-admin/framework/core/templates/panel/header.tpl.php new file mode 100644 index 000000000..23bfe159a --- /dev/null +++ b/plugins/legacy-admin/framework/core/templates/panel/header.tpl.php @@ -0,0 +1,31 @@ + +
    + parent->args['display_name'] ) ) : ?> +
    + + parent->args['dev_mode'] ) && $this->parent->args['dev_mode'] ) : ?> + + + +

    parent->args['display_name']; ?>

    + + parent->args['display_version'] ) ) : ?> + parent->args['display_version']; ?> + + +
    + + +
    +
    \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/templates/panel/header_stickybar.tpl.php b/plugins/legacy-admin/framework/core/templates/panel/header_stickybar.tpl.php new file mode 100644 index 000000000..7ba8e36c5 --- /dev/null +++ b/plugins/legacy-admin/framework/core/templates/panel/header_stickybar.tpl.php @@ -0,0 +1,36 @@ + +
    +
    + + parent->args['hide_expand'] ? ' style="display: none;"' : '' ?>> + +
    + + + parent->args['hide_reset'] ) : ?> + parent->args['opt_name'] . '[defaults-section]', false ); ?> + parent->args['opt_name'] . '[defaults]', false ); ?> + +
    +
     
    +
    +
    + + +
    + notification_bar(); ?> +
    + + +
    \ No newline at end of file diff --git a/plugins/legacy-admin/framework/core/templates/panel/menu_container.tpl.php b/plugins/legacy-admin/framework/core/templates/panel/menu_container.tpl.php new file mode 100644 index 000000000..17205422f --- /dev/null +++ b/plugins/legacy-admin/framework/core/templates/panel/menu_container.tpl.php @@ -0,0 +1,67 @@ + +
    +
      + parent->sections as $k => $section ) { + $title = isset ( $section[ 'title' ] ) ? $section[ 'title' ] : ''; + + $skip_sec = false; + foreach ( $this->parent->hidden_perm_sections as $num => $section_title ) { + if ( $section_title == $title ) { + $skip_sec = true; + } + } + + if ( isset ( $section[ 'customizer_only' ] ) && $section[ 'customizer_only' ] == true ) { + continue; + } + + if ( false == $skip_sec ) { + echo $this->parent->section_menu ( $k, $section ); + $skip_sec = false; + } + } + + /** + * action 'redux-page-after-sections-menu-{opt_name}' + * + * @param object $this ReduxFramework + */ + do_action ( "redux-page-after-sections-menu-{$this->parent->args[ 'opt_name' ]}", $this ); + + /** + * action 'redux/page/{opt_name}/menu/after' + * + * @param object $this ReduxFramework + */ + do_action ( "redux/page/{$this->parent->args[ 'opt_name' ]}/menu/after", $this ); + + ?> + + parent->args[ 'system_info' ] === true ) : ?> + + +
    +
    \ No newline at end of file diff --git a/plugins/legacy-admin/framework/options/legacy-config.php b/plugins/legacy-admin/framework/options/legacy-config.php new file mode 100644 index 000000000..02121d4d2 --- /dev/null +++ b/plugins/legacy-admin/framework/options/legacy-config.php @@ -0,0 +1,2165 @@ + SET ARGUMENTS + * All the possible arguments for Redux. + * For full documentation on arguments, please refer to: https://github.com/ReduxFramework/ReduxFramework/wiki/Arguments + * */ + + + + + /*ADDED in Legacy Admin - START */ + // manageoptions and super admin + + $legacyadmin_permissions = legacy_get_option( "legacyadmin_plugin_access","manage_options"); + if($legacyadmin_permissions == "super_admin" && is_super_admin()){ + $legacyadmin_permissions = 'manage_options'; + } + + // specific user + $legacyadmin_userid = legacy_get_option( "legacyadmin_plugin_userid",""); + if($legacyadmin_permissions == "specific_user" && $legacyadmin_userid == get_current_user_id()){ + $legacyadmin_permissions = 'read'; + } + + // if plugin is network activated, then hide it from inner sites. + $menu_type = 'menu'; + + if ( ! function_exists( 'is_plugin_active_for_network' ) ){ + require_once( ABSPATH . '/wp-admin/includes/plugin.php' ); + } + + // Makes sure the plugin is defined before trying to use it + if ( is_plugin_active_for_network( 'legacy-admin/legacy-core.php' )){ + if(!is_main_site()){ + $menu_type = 'hidden'; + } + } + + +/*ADDED in Legacy Admin - END*/ + + + + + $theme = wp_get_theme(); // For use with some settings. Not necessary. + + $args = array( + // TYPICAL -> Change these values as you need/desire + 'opt_name' => $opt_name, + // This is where your data is stored in the database and also becomes your global variable name. + 'display_name' => 'Legacy Admin', + // Name that appears at the top of your panel + 'display_version' => '9.2', + // Version that appears at the top of your panel + 'menu_type' => $menu_type, + //Specify if the admin menu should appear or not. Options: menu or submenu (Under appearance only) + 'allow_sub_menu' => true, + // Show the sections below the admin menu item or not + 'menu_title' => __( 'Legacy Admin', 'legacy_framework' ), + 'page_title' => __( 'Legacy Admin', 'legacy_framework' ), + // You will need to generate a Google API key to use this feature. + // Please visit: https://developers.google.com/fonts/docs/developer_api#Auth + 'google_api_key' => '', + // Set it you want google fonts to update weekly. A google_api_key value is required. + 'google_update_weekly' => false, + // Must be defined to add google fonts to the typography module + 'async_typography' => true, + // Use a asynchronous font on the front end or font string + //'disable_google_fonts_link' => true, // Disable this in case you want to create your own google fonts loader + 'admin_bar' => true, + // Show the panel pages on the admin bar + 'admin_bar_icon' => 'dashicons-art', + // Choose an icon for the admin bar menu + 'admin_bar_priority' => 50, + // Choose an priority for the admin bar menu + 'global_variable' => 'legacyadmin', + // Set a different name for your global variable other than the opt_name + 'dev_mode' => false, + // Show the time the page took to load, etc + 'update_notice' => true, + // If dev_mode is enabled, will notify developer of updated versions available in the GitHub Repo + 'customizer' => false, + // Enable basic customizer support + //'open_expanded' => true, // Allow you to start the panel in an expanded way initially. + //'disable_save_warn' => true, // Disable the save warning when a user changes a field + + // OPTIONAL -> Give you extra features + 'page_priority' => null, + // Order where the menu appears in the admin area. If there is any conflict, something will not show. Warning. + 'page_parent' => 'themes.php', + // For a full list of options, visit: http://codex.wordpress.org/Function_Reference/add_submenu_page#Parameters + 'page_permissions' => $legacyadmin_permissions, + // Permissions needed to access the options panel. + 'menu_icon' => '', + // Specify a custom URL to an icon + 'last_tab' => '', + // Force your panel to always open to a specific tab (by id) + 'page_icon' => 'icon-themes', + // Icon displayed in the admin panel next to your menu_title + 'page_slug' => '_legacyoptions', + // Page slug used to denote the panel + 'save_defaults' => true, + // On load save the defaults to DB before user clicks save or not + 'default_show' => false, + // If true, shows the default value next to each field that is not the default value. + 'default_mark' => '', + // What to print by the field's title if the value shown is default. Suggested: * + 'show_import_export' => true, + // Shows the Import/Export panel when not used as a field. + + // CAREFUL -> These options are for advanced use only + 'transient_time' => 60 * MINUTE_IN_SECONDS, + 'output' => true, + // Global shut-off for dynamic CSS output by the framework. Will also disable google fonts output + 'output_tag' => true, + // Allows dynamic CSS to be generated for customizer and google fonts, but stops the dynamic CSS from going to the head + 'footer_credit' => ' ', // Disable the footer credit of Redux. Please leave if you can help it. + + // FUTURE -> Not in use yet, but reserved or partially implemented. Use at your own risk. + 'database' => '', + // possible: options, theme_mods, theme_mods_expanded, transient. Not fully functional, warning! + 'system_info' => false, + // REMOVE + + //'compiler' => true, + + // HINTS + 'hints' => array( + 'icon' => 'el el-question-sign', + 'icon_position' => 'right', + 'icon_color' => 'lightgray', + 'icon_size' => 'normal', + 'tip_style' => array( + 'color' => 'light', + 'shadow' => true, + 'rounded' => false, + 'style' => '', + ), + 'tip_position' => array( + 'my' => 'top left', + 'at' => 'bottom right', + ), + 'tip_effect' => array( + 'show' => array( + 'effect' => 'slide', + 'duration' => '500', + 'event' => 'mouseover', + ), + 'hide' => array( + 'effect' => 'slide', + 'duration' => '500', + 'event' => 'click mouseleave', + ), + ), + ) + ); + + Redux::setArgs( $opt_name, $args ); + + /* + * ---> END ARGUMENTS + */ + + + /* + * ---> START HELP TABS + */ +/* + $tabs = array( + array( + 'id' => 'redux-help-tab-1', + 'title' => __( 'Theme Information 1', 'legacy_framework' ), + 'content' => __( '

    This is the tab content, HTML is allowed.

    ', 'legacy_framework' ) + ), + array( + 'id' => 'redux-help-tab-2', + 'title' => __( 'Theme Information 2', 'legacy_framework' ), + 'content' => __( '

    This is the tab content, HTML is allowed.

    ', 'legacy_framework' ) + ) + ); + Redux::setHelpTab( $opt_name, $tabs ); + + // Set the help sidebar + $content = __( '

    This is the sidebar content, HTML is allowed.

    ', 'legacy_framework' ); + Redux::setHelpSidebar( $opt_name, $content ); +*/ + + /* + * <--- END HELP TABS + */ + + + /* + * + * ---> START SECTIONS + * + */ + + /* + + As of Redux 3.5+, there is an extensive API. This API can be used in a mix/match mode allowing for + + + */ + + // -> START Basic Fields + $standard_fonts = array( + '0' => 'Select Font', + 'Arial, Helvetica, sans-serif' => 'Arial, Helvetica, sans-serif', + "'Arial Black', Gadget, sans-serif" => "'Arial Black', Gadget, sans-serif", + "'Bookman Old Style', serif" => "'Bookman Old Style', serif", + "'Comic Sans MS', cursive" => "'Comic Sans MS', cursive", + "Courier, monospace" => "Courier, monospace", + "Garamond, serif" => "Garamond, serif", + "Georgia, serif" => "Georgia, serif", + "Impact, Charcoal, sans-serif" => "Impact, Charcoal, sans-serif", + "'Lucida Console', Monaco, monospace" => "'Lucida Console', Monaco, monospace", + "'Lucida Sans Unicode', 'Lucida Grande', sans-serif" => "'Lucida Sans Unicode', 'Lucida Grande', sans-serif", + "'MS Sans Serif', Geneva, sans-serif" => "'MS Sans Serif', Geneva, sans-serif", + "'MS Serif', 'New York', sans-serif" => "'MS Serif', 'New York', sans-serif", + "'Palatino Linotype', 'Book Antiqua', Palatino, serif" => "'Palatino Linotype', 'Book Antiqua', Palatino, serif", + "Tahoma, Geneva, sans-serif" => "Tahoma, Geneva, sans-serif", + "'Times New Roman', Times, serif" => "'Times New Roman', Times, serif", + "'Trebuchet MS', Helvetica, sans-serif" => "'Trebuchet MS', Helvetica, sans-serif", + "Verdana, Geneva, sans-serif" => "Verdana, Geneva, sans-serif" + ); + + + $google_fonts = array( + "0" => "Select Font", + "ABeeZee" => "ABeeZee", + "Abel" => "Abel", + "Abril Fatface" => "Abril Fatface", + "Aclonica" => "Aclonica", + "Acme" => "Acme", + "Actor" => "Actor", + "Adamina" => "Adamina", + "Advent Pro" => "Advent Pro", + "Aguafina Script" => "Aguafina Script", + "Akronim" => "Akronim", + "Aladin" => "Aladin", + "Aldrich" => "Aldrich", + "Alef" => "Alef", + "Alegreya" => "Alegreya", + "Alegreya SC" => "Alegreya SC", + "Alegreya Sans" => "Alegreya Sans", + "Alegreya Sans SC" => "Alegreya Sans SC", + "Alex Brush" => "Alex Brush", + "Alfa Slab One" => "Alfa Slab One", + "Alice" => "Alice", + "Alike" => "Alike", + "Alike Angular" => "Alike Angular", + "Allan" => "Allan", + "Allerta" => "Allerta", + "Allerta Stencil" => "Allerta Stencil", + "Allura" => "Allura", + "Almendra" => "Almendra", + "Almendra Display" => "Almendra Display", + "Almendra SC" => "Almendra SC", + "Amarante" => "Amarante", + "Amaranth" => "Amaranth", + "Amatic SC" => "Amatic SC", + "Amethysta" => "Amethysta", + "Anaheim" => "Anaheim", + "Andada" => "Andada", + "Andika" => "Andika", + "Angkor" => "Angkor", + "Annie Use Your Telescope" => "Annie Use Your Telescope", + "Anonymous Pro" => "Anonymous Pro", + "Antic" => "Antic", + "Antic Didone" => "Antic Didone", + "Antic Slab" => "Antic Slab", + "Anton" => "Anton", + "Arapey" => "Arapey", + "Arbutus" => "Arbutus", + "Arbutus Slab" => "Arbutus Slab", + "Architects Daughter" => "Architects Daughter", + "Archivo Black" => "Archivo Black", + "Archivo Narrow" => "Archivo Narrow", + "Arimo" => "Arimo", + "Arizonia" => "Arizonia", + "Armata" => "Armata", + "Artifika" => "Artifika", + "Arvo" => "Arvo", + "Asap" => "Asap", + "Asset" => "Asset", + "Astloch" => "Astloch", + "Asul" => "Asul", + "Atomic Age" => "Atomic Age", + "Aubrey" => "Aubrey", + "Audiowide" => "Audiowide", + "Autour One" => "Autour One", + "Average" => "Average", + "Average Sans" => "Average Sans", + "Averia Gruesa Libre" => "Averia Gruesa Libre", + "Averia Libre" => "Averia Libre", + "Averia Sans Libre" => "Averia Sans Libre", + "Averia Serif Libre" => "Averia Serif Libre", + "Bad Script" => "Bad Script", + "Balthazar" => "Balthazar", + "Bangers" => "Bangers", + "Basic" => "Basic", + "Battambang" => "Battambang", + "Baumans" => "Baumans", + "Bayon" => "Bayon", + "Belgrano" => "Belgrano", + "Belleza" => "Belleza", + "BenchNine" => "BenchNine", + "Bentham" => "Bentham", + "Berkshire Swash" => "Berkshire Swash", + "Bevan" => "Bevan", + "Bigelow Rules" => "Bigelow Rules", + "Bigshot One" => "Bigshot One", + "Bilbo" => "Bilbo", + "Bilbo Swash Caps" => "Bilbo Swash Caps", + "Bitter" => "Bitter", + "Black Ops One" => "Black Ops One", + "Bokor" => "Bokor", + "Bonbon" => "Bonbon", + "Boogaloo" => "Boogaloo", + "Bowlby One" => "Bowlby One", + "Bowlby One SC" => "Bowlby One SC", + "Brawler" => "Brawler", + "Bree Serif" => "Bree Serif", + "Bubblegum Sans" => "Bubblegum Sans", + "Bubbler One" => "Bubbler One", + "Buda" => "Buda", + "Buenard" => "Buenard", + "Butcherman" => "Butcherman", + "Butterfly Kids" => "Butterfly Kids", + "Cabin" => "Cabin", + "Cabin Condensed" => "Cabin Condensed", + "Cabin Sketch" => "Cabin Sketch", + "Caesar Dressing" => "Caesar Dressing", + "Cagliostro" => "Cagliostro", + "Calligraffitti" => "Calligraffitti", + "Cambo" => "Cambo", + "Candal" => "Candal", + "Cantarell" => "Cantarell", + "Cantata One" => "Cantata One", + "Cantora One" => "Cantora One", + "Capriola" => "Capriola", + "Cardo" => "Cardo", + "Carme" => "Carme", + "Carrois Gothic" => "Carrois Gothic", + "Carrois Gothic SC" => "Carrois Gothic SC", + "Carter One" => "Carter One", + "Caudex" => "Caudex", + "Cedarville Cursive" => "Cedarville Cursive", + "Ceviche One" => "Ceviche One", + "Changa One" => "Changa One", + "Chango" => "Chango", + "Chau Philomene One" => "Chau Philomene One", + "Chela One" => "Chela One", + "Chelsea Market" => "Chelsea Market", + "Chenla" => "Chenla", + "Cherry Cream Soda" => "Cherry Cream Soda", + "Cherry Swash" => "Cherry Swash", + "Chewy" => "Chewy", + "Chicle" => "Chicle", + "Chivo" => "Chivo", + "Cinzel" => "Cinzel", + "Cinzel Decorative" => "Cinzel Decorative", + "Clicker Script" => "Clicker Script", + "Coda" => "Coda", + "Coda Caption" => "Coda Caption", + "Codystar" => "Codystar", + "Combo" => "Combo", + "Comfortaa" => "Comfortaa", + "Coming Soon" => "Coming Soon", + "Concert One" => "Concert One", + "Condiment" => "Condiment", + "Content" => "Content", + "Contrail One" => "Contrail One", + "Convergence" => "Convergence", + "Cookie" => "Cookie", + "Copse" => "Copse", + "Corben" => "Corben", + "Courgette" => "Courgette", + "Cousine" => "Cousine", + "Coustard" => "Coustard", + "Covered By Your Grace" => "Covered By Your Grace", + "Crafty Girls" => "Crafty Girls", + "Creepster" => "Creepster", + "Crete Round" => "Crete Round", + "Crimson Text" => "Crimson Text", + "Croissant One" => "Croissant One", + "Crushed" => "Crushed", + "Cuprum" => "Cuprum", + "Cutive" => "Cutive", + "Cutive Mono" => "Cutive Mono", + "Damion" => "Damion", + "Dancing Script" => "Dancing Script", + "Dangrek" => "Dangrek", + "Dawning of a New Day" => "Dawning of a New Day", + "Days One" => "Days One", + "Delius" => "Delius", + "Delius Swash Caps" => "Delius Swash Caps", + "Delius Unicase" => "Delius Unicase", + "Della Respira" => "Della Respira", + "Denk One" => "Denk One", + "Devonshire" => "Devonshire", + "Didact Gothic" => "Didact Gothic", + "Diplomata" => "Diplomata", + "Diplomata SC" => "Diplomata SC", + "Domine" => "Domine", + "Donegal One" => "Donegal One", + "Doppio One" => "Doppio One", + "Dorsa" => "Dorsa", + "Dosis" => "Dosis", + "Dr Sugiyama" => "Dr Sugiyama", + "Droid Sans" => "Droid Sans", + "Droid Sans Mono" => "Droid Sans Mono", + "Droid Serif" => "Droid Serif", + "Duru Sans" => "Duru Sans", + "Dynalight" => "Dynalight", + "EB Garamond" => "EB Garamond", + "Eagle Lake" => "Eagle Lake", + "Eater" => "Eater", + "Economica" => "Economica", + "Electrolize" => "Electrolize", + "Elsie" => "Elsie", + "Elsie Swash Caps" => "Elsie Swash Caps", + "Emblema One" => "Emblema One", + "Emilys Candy" => "Emilys Candy", + "Engagement" => "Engagement", + "Englebert" => "Englebert", + "Enriqueta" => "Enriqueta", + "Erica One" => "Erica One", + "Esteban" => "Esteban", + "Euphoria Script" => "Euphoria Script", + "Ewert" => "Ewert", + "Exo" => "Exo", + "Exo 2" => "Exo 2", + "Expletus Sans" => "Expletus Sans", + "Fanwood Text" => "Fanwood Text", + "Fascinate" => "Fascinate", + "Fascinate Inline" => "Fascinate Inline", + "Faster One" => "Faster One", + "Fasthand" => "Fasthand", + "Fauna One" => "Fauna One", + "Federant" => "Federant", + "Federo" => "Federo", + "Felipa" => "Felipa", + "Fenix" => "Fenix", + "Finger Paint" => "Finger Paint", + "Fjalla One" => "Fjalla One", + "Fjord One" => "Fjord One", + "Flamenco" => "Flamenco", + "Flavors" => "Flavors", + "Fondamento" => "Fondamento", + "Fontdiner Swanky" => "Fontdiner Swanky", + "Forum" => "Forum", + "Francois One" => "Francois One", + "Freckle Face" => "Freckle Face", + "Fredericka the Great" => "Fredericka the Great", + "Fredoka One" => "Fredoka One", + "Freehand" => "Freehand", + "Fresca" => "Fresca", + "Frijole" => "Frijole", + "Fruktur" => "Fruktur", + "Fugaz One" => "Fugaz One", + "GFS Didot" => "GFS Didot", + "GFS Neohellenic" => "GFS Neohellenic", + "Gabriela" => "Gabriela", + "Gafata" => "Gafata", + "Galdeano" => "Galdeano", + "Galindo" => "Galindo", + "Gentium Basic" => "Gentium Basic", + "Gentium Book Basic" => "Gentium Book Basic", + "Geo" => "Geo", + "Geostar" => "Geostar", + "Geostar Fill" => "Geostar Fill", + "Germania One" => "Germania One", + "Gilda Display" => "Gilda Display", + "Give You Glory" => "Give You Glory", + "Glass Antiqua" => "Glass Antiqua", + "Glegoo" => "Glegoo", + "Gloria Hallelujah" => "Gloria Hallelujah", + "Goblin One" => "Goblin One", + "Gochi Hand" => "Gochi Hand", + "Gorditas" => "Gorditas", + "Goudy Bookletter 1911" => "Goudy Bookletter 1911", + "Graduate" => "Graduate", + "Grand Hotel" => "Grand Hotel", + "Gravitas One" => "Gravitas One", + "Great Vibes" => "Great Vibes", + "Griffy" => "Griffy", + "Gruppo" => "Gruppo", + "Gudea" => "Gudea", + "Habibi" => "Habibi", + "Hammersmith One" => "Hammersmith One", + "Hanalei" => "Hanalei", + "Hanalei Fill" => "Hanalei Fill", + "Handlee" => "Handlee", + "Hanuman" => "Hanuman", + "Happy Monkey" => "Happy Monkey", + "Headland One" => "Headland One", + "Henny Penny" => "Henny Penny", + "Herr Von Muellerhoff" => "Herr Von Muellerhoff", + "Holtwood One SC" => "Holtwood One SC", + "Homemade Apple" => "Homemade Apple", + "Homenaje" => "Homenaje", + "IM Fell DW Pica" => "IM Fell DW Pica", + "IM Fell DW Pica SC" => "IM Fell DW Pica SC", + "IM Fell Double Pica" => "IM Fell Double Pica", + "IM Fell Double Pica SC" => "IM Fell Double Pica SC", + "IM Fell English" => "IM Fell English", + "IM Fell English SC" => "IM Fell English SC", + "IM Fell French Canon" => "IM Fell French Canon", + "IM Fell French Canon SC" => "IM Fell French Canon SC", + "IM Fell Great Primer" => "IM Fell Great Primer", + "IM Fell Great Primer SC" => "IM Fell Great Primer SC", + "Iceberg" => "Iceberg", + "Iceland" => "Iceland", + "Imprima" => "Imprima", + "Inconsolata" => "Inconsolata", + "Inder" => "Inder", + "Indie Flower" => "Indie Flower", + "Inika" => "Inika", + "Irish Grover" => "Irish Grover", + "Istok Web" => "Istok Web", + "Italiana" => "Italiana", + "Italianno" => "Italianno", + "Jacques Francois" => "Jacques Francois", + "Jacques Francois Shadow" => "Jacques Francois Shadow", + "Jim Nightshade" => "Jim Nightshade", + "Jockey One" => "Jockey One", + "Jolly Lodger" => "Jolly Lodger", + "Josefin Sans" => "Josefin Sans", + "Josefin Slab" => "Josefin Slab", + "Joti One" => "Joti One", + "Judson" => "Judson", + "Julee" => "Julee", + "Julius Sans One" => "Julius Sans One", + "Junge" => "Junge", + "Jura" => "Jura", + "Just Another Hand" => "Just Another Hand", + "Just Me Again Down Here" => "Just Me Again Down Here", + "Kameron" => "Kameron", + "Kantumruy" => "Kantumruy", + "Karla" => "Karla", + "Kaushan Script" => "Kaushan Script", + "Kavoon" => "Kavoon", + "Kdam Thmor" => "Kdam Thmor", + "Keania One" => "Keania One", + "Kelly Slab" => "Kelly Slab", + "Kenia" => "Kenia", + "Khmer" => "Khmer", + "Kite One" => "Kite One", + "Knewave" => "Knewave", + "Kotta One" => "Kotta One", + "Koulen" => "Koulen", + "Kranky" => "Kranky", + "Kreon" => "Kreon", + "Kristi" => "Kristi", + "Krona One" => "Krona One", + "La Belle Aurore" => "La Belle Aurore", + "Lancelot" => "Lancelot", + "Lato" => "Lato", + "League Script" => "League Script", + "Leckerli One" => "Leckerli One", + "Ledger" => "Ledger", + "Lekton" => "Lekton", + "Lemon" => "Lemon", + "Libre Baskerville" => "Libre Baskerville", + "Life Savers" => "Life Savers", + "Lilita One" => "Lilita One", + "Lily Script One" => "Lily Script One", + "Limelight" => "Limelight", + "Linden Hill" => "Linden Hill", + "Lobster" => "Lobster", + "Lobster Two" => "Lobster Two", + "Londrina Outline" => "Londrina Outline", + "Londrina Shadow" => "Londrina Shadow", + "Londrina Sketch" => "Londrina Sketch", + "Londrina Solid" => "Londrina Solid", + "Lora" => "Lora", + "Love Ya Like A Sister" => "Love Ya Like A Sister", + "Loved by the King" => "Loved by the King", + "Lovers Quarrel" => "Lovers Quarrel", + "Luckiest Guy" => "Luckiest Guy", + "Lusitana" => "Lusitana", + "Lustria" => "Lustria", + "Macondo" => "Macondo", + "Macondo Swash Caps" => "Macondo Swash Caps", + "Magra" => "Magra", + "Maiden Orange" => "Maiden Orange", + "Mako" => "Mako", + "Marcellus" => "Marcellus", + "Marcellus SC" => "Marcellus SC", + "Marck Script" => "Marck Script", + "Margarine" => "Margarine", + "Marko One" => "Marko One", + "Marmelad" => "Marmelad", + "Marvel" => "Marvel", + "Mate" => "Mate", + "Mate SC" => "Mate SC", + "Maven Pro" => "Maven Pro", + "McLaren" => "McLaren", + "Meddon" => "Meddon", + "MedievalSharp" => "MedievalSharp", + "Medula One" => "Medula One", + "Megrim" => "Megrim", + "Meie Script" => "Meie Script", + "Merienda" => "Merienda", + "Merienda One" => "Merienda One", + "Merriweather" => "Merriweather", + "Merriweather Sans" => "Merriweather Sans", + "Metal" => "Metal", + "Metal Mania" => "Metal Mania", + "Metamorphous" => "Metamorphous", + "Metrophobic" => "Metrophobic", + "Michroma" => "Michroma", + "Milonga" => "Milonga", + "Miltonian" => "Miltonian", + "Miltonian Tattoo" => "Miltonian Tattoo", + "Miniver" => "Miniver", + "Miss Fajardose" => "Miss Fajardose", + "Modern Antiqua" => "Modern Antiqua", + "Molengo" => "Molengo", + "Molle" => "Molle", + "Monda" => "Monda", + "Monofett" => "Monofett", + "Monoton" => "Monoton", + "Monsieur La Doulaise" => "Monsieur La Doulaise", + "Montaga" => "Montaga", + "Montez" => "Montez", + "Montserrat" => "Montserrat", + "Montserrat Alternates" => "Montserrat Alternates", + "Montserrat Subrayada" => "Montserrat Subrayada", + "Moul" => "Moul", + "Moulpali" => "Moulpali", + "Mountains of Christmas" => "Mountains of Christmas", + "Mouse Memoirs" => "Mouse Memoirs", + "Mr Bedfort" => "Mr Bedfort", + "Mr Dafoe" => "Mr Dafoe", + "Mr De Haviland" => "Mr De Haviland", + "Mrs Saint Delafield" => "Mrs Saint Delafield", + "Mrs Sheppards" => "Mrs Sheppards", + "Muli" => "Muli", + "Mystery Quest" => "Mystery Quest", + "Neucha" => "Neucha", + "Neuton" => "Neuton", + "New Rocker" => "New Rocker", + "News Cycle" => "News Cycle", + "Niconne" => "Niconne", + "Nixie One" => "Nixie One", + "Nobile" => "Nobile", + "Nokora" => "Nokora", + "Norican" => "Norican", + "Nosifer" => "Nosifer", + "Nothing You Could Do" => "Nothing You Could Do", + "Noticia Text" => "Noticia Text", + "Noto Sans" => "Noto Sans", + "Noto Serif" => "Noto Serif", + "Nova Cut" => "Nova Cut", + "Nova Flat" => "Nova Flat", + "Nova Mono" => "Nova Mono", + "Nova Oval" => "Nova Oval", + "Nova Round" => "Nova Round", + "Nova Script" => "Nova Script", + "Nova Slim" => "Nova Slim", + "Nova Square" => "Nova Square", + "Numans" => "Numans", + "Nunito" => "Nunito", + "Odor Mean Chey" => "Odor Mean Chey", + "Offside" => "Offside", + "Old Standard TT" => "Old Standard TT", + "Oldenburg" => "Oldenburg", + "Oleo Script" => "Oleo Script", + "Oleo Script Swash Caps" => "Oleo Script Swash Caps", + "Open Sans" => "Open Sans", + "Open Sans Condensed" => "Open Sans Condensed", + "Oranienbaum" => "Oranienbaum", + "Orbitron" => "Orbitron", + "Oregano" => "Oregano", + "Orienta" => "Orienta", + "Original Surfer" => "Original Surfer", + "Oswald" => "Oswald", + "Over the Rainbow" => "Over the Rainbow", + "Overlock" => "Overlock", + "Overlock SC" => "Overlock SC", + "Ovo" => "Ovo", + "Oxygen" => "Oxygen", + "Oxygen Mono" => "Oxygen Mono", + "PT Mono" => "PT Mono", + "PT Sans" => "PT Sans", + "PT Sans Caption" => "PT Sans Caption", + "PT Sans Narrow" => "PT Sans Narrow", + "PT Serif" => "PT Serif", + "PT Serif Caption" => "PT Serif Caption", + "Pacifico" => "Pacifico", + "Paprika" => "Paprika", + "Parisienne" => "Parisienne", + "Passero One" => "Passero One", + "Passion One" => "Passion One", + "Pathway Gothic One" => "Pathway Gothic One", + "Patrick Hand" => "Patrick Hand", + "Patrick Hand SC" => "Patrick Hand SC", + "Patua One" => "Patua One", + "Paytone One" => "Paytone One", + "Peralta" => "Peralta", + "Permanent Marker" => "Permanent Marker", + "Petit Formal Script" => "Petit Formal Script", + "Petrona" => "Petrona", + "Philosopher" => "Philosopher", + "Piedra" => "Piedra", + "Pinyon Script" => "Pinyon Script", + "Pirata One" => "Pirata One", + "Plaster" => "Plaster", + "Play" => "Play", + "Playball" => "Playball", + "Playfair Display" => "Playfair Display", + "Playfair Display SC" => "Playfair Display SC", + "Podkova" => "Podkova", + "Poiret One" => "Poiret One", + "Poller One" => "Poller One", + "Poly" => "Poly", + "Pompiere" => "Pompiere", + "Pontano Sans" => "Pontano Sans", + "Port Lligat Sans" => "Port Lligat Sans", + "Port Lligat Slab" => "Port Lligat Slab", + "Prata" => "Prata", + "Preahvihear" => "Preahvihear", + "Press Start 2P" => "Press Start 2P", + "Princess Sofia" => "Princess Sofia", + "Prociono" => "Prociono", + "Prosto One" => "Prosto One", + "Puritan" => "Puritan", + "Purple Purse" => "Purple Purse", + "Quando" => "Quando", + "Quantico" => "Quantico", + "Quattrocento" => "Quattrocento", + "Quattrocento Sans" => "Quattrocento Sans", + "Questrial" => "Questrial", + "Quicksand" => "Quicksand", + "Quintessential" => "Quintessential", + "Qwigley" => "Qwigley", + "Racing Sans One" => "Racing Sans One", + "Radley" => "Radley", + "Raleway" => "Raleway", + "Raleway Dots" => "Raleway Dots", + "Rambla" => "Rambla", + "Rammetto One" => "Rammetto One", + "Ranchers" => "Ranchers", + "Rancho" => "Rancho", + "Rationale" => "Rationale", + "Redressed" => "Redressed", + "Reenie Beanie" => "Reenie Beanie", + "Revalia" => "Revalia", + "Ribeye" => "Ribeye", + "Ribeye Marrow" => "Ribeye Marrow", + "Righteous" => "Righteous", + "Risque" => "Risque", + "Roboto" => "Roboto", + "Roboto Condensed" => "Roboto Condensed", + "Roboto Slab" => "Roboto Slab", + "Rochester" => "Rochester", + "Rock Salt" => "Rock Salt", + "Rokkitt" => "Rokkitt", + "Romanesco" => "Romanesco", + "Ropa Sans" => "Ropa Sans", + "Rosario" => "Rosario", + "Rosarivo" => "Rosarivo", + "Rouge Script" => "Rouge Script", + "Ruda" => "Ruda", + "Rufina" => "Rufina", + "Ruge Boogie" => "Ruge Boogie", + "Ruluko" => "Ruluko", + "Rum Raisin" => "Rum Raisin", + "Ruslan Display" => "Ruslan Display", + "Russo One" => "Russo One", + "Ruthie" => "Ruthie", + "Rye" => "Rye", + "Sacramento" => "Sacramento", + "Sail" => "Sail", + "Salsa" => "Salsa", + "Sanchez" => "Sanchez", + "Sancreek" => "Sancreek", + "Sansita One" => "Sansita One", + "Sarina" => "Sarina", + "Satisfy" => "Satisfy", + "Scada" => "Scada", + "Schoolbell" => "Schoolbell", + "Seaweed Script" => "Seaweed Script", + "Sevillana" => "Sevillana", + "Seymour One" => "Seymour One", + "Shadows Into Light" => "Shadows Into Light", + "Shadows Into Light Two" => "Shadows Into Light Two", + "Shanti" => "Shanti", + "Share" => "Share", + "Share Tech" => "Share Tech", + "Share Tech Mono" => "Share Tech Mono", + "Shojumaru" => "Shojumaru", + "Short Stack" => "Short Stack", + "Siemreap" => "Siemreap", + "Sigmar One" => "Sigmar One", + "Signika" => "Signika", + "Signika Negative" => "Signika Negative", + "Simonetta" => "Simonetta", + "Sintony" => "Sintony", + "Sirin Stencil" => "Sirin Stencil", + "Six Caps" => "Six Caps", + "Skranji" => "Skranji", + "Slackey" => "Slackey", + "Smokum" => "Smokum", + "Smythe" => "Smythe", + "Sniglet" => "Sniglet", + "Snippet" => "Snippet", + "Snowburst One" => "Snowburst One", + "Sofadi One" => "Sofadi One", + "Sofia" => "Sofia", + "Sonsie One" => "Sonsie One", + "Sorts Mill Goudy" => "Sorts Mill Goudy", + "Source Code Pro" => "Source Code Pro", + "Source Sans Pro" => "Source Sans Pro", + "Special Elite" => "Special Elite", + "Spicy Rice" => "Spicy Rice", + "Spinnaker" => "Spinnaker", + "Spirax" => "Spirax", + "Squada One" => "Squada One", + "Stalemate" => "Stalemate", + "Stalinist One" => "Stalinist One", + "Stardos Stencil" => "Stardos Stencil", + "Stint Legacy Condensed" => "Stint Legacy Condensed", + "Stint Legacy Expanded" => "Stint Legacy Expanded", + "Stoke" => "Stoke", + "Strait" => "Strait", + "Sue Ellen Francisco" => "Sue Ellen Francisco", + "Sunshiney" => "Sunshiney", + "Supermercado One" => "Supermercado One", + "Suwannaphum" => "Suwannaphum", + "Swanky and Moo Moo" => "Swanky and Moo Moo", + "Syncopate" => "Syncopate", + "Tangerine" => "Tangerine", + "Taprom" => "Taprom", + "Tauri" => "Tauri", + "Telex" => "Telex", + "Tenor Sans" => "Tenor Sans", + "Text Me One" => "Text Me One", + "The Girl Next Door" => "The Girl Next Door", + "Tienne" => "Tienne", + "Tinos" => "Tinos", + "Titan One" => "Titan One", + "Titillium Web" => "Titillium Web", + "Trade Winds" => "Trade Winds", + "Trocchi" => "Trocchi", + "Trochut" => "Trochut", + "Trykker" => "Trykker", + "Tulpen One" => "Tulpen One", + "Ubuntu" => "Ubuntu", + "Ubuntu Condensed" => "Ubuntu Condensed", + "Ubuntu Mono" => "Ubuntu Mono", + "Legacy" => "Legacy", + "Uncial Antiqua" => "Uncial Antiqua", + "Underdog" => "Underdog", + "Unica One" => "Unica One", + "UnifrakturCook" => "UnifrakturCook", + "UnifrakturMaguntia" => "UnifrakturMaguntia", + "Unkempt" => "Unkempt", + "Unlock" => "Unlock", + "Unna" => "Unna", + "VT323" => "VT323", + "Vampiro One" => "Vampiro One", + "Varela" => "Varela", + "Varela Round" => "Varela Round", + "Vast Shadow" => "Vast Shadow", + "Vibur" => "Vibur", + "Vidaloka" => "Vidaloka", + "Viga" => "Viga", + "Voces" => "Voces", + "Volkhov" => "Volkhov", + "Vollkorn" => "Vollkorn", + "Voltaire" => "Voltaire", + "Waiting for the Sunrise" => "Waiting for the Sunrise", + "Wallpoet" => "Wallpoet", + "Walter Turncoat" => "Walter Turncoat", + "Warnes" => "Warnes", + "Wellfleet" => "Wellfleet", + "Wendy One" => "Wendy One", + "Wire One" => "Wire One", + "Yanone Kaffeesatz" => "Yanone Kaffeesatz", + "Yellowtail" => "Yellowtail", + "Yeseva One" => "Yeseva One", + "Yesteryear" => "Yesteryear", + "Zeyada" => "Zeyada", + ); + + + $more_settings_msg = 'You have chosen an inbuilt theme. One or more setting options in this section are applicable for custom theme only.'; + + + global $legacy_color_list; + + foreach($legacy_color_list as $colorid => $colorname){ + $legacy_color_thumbs[$colorid]['title'] = esc_attr($colorname, 'legacy_framework'); + $legacy_color_thumbs[$colorid]['img'] = ReduxFramework::$_url . '../../images/assets/'.$colorid.'.jpg'; + } + + //plugins_url('/', __FILE__)."../../images/logo.png" + $modbaseurl = plugins_url('/', __FILE__); + $modbaseurl = str_replace("framework/options/","",$modbaseurl); + + + Redux::setSection( $opt_name, array( + 'id' => 'pick-theme', + 'title' => __('Pick Theme', 'legacy_framework'), + 'icon' => 'el-icon-css', + 'fields' => array( + array( + 'id' => 'dynamic-css-type', + 'type' => 'image_select', + 'title' => __('Choose Theme', 'legacy_framework'), + 'desc' => __('Select the default themes inbuilt with the plugin or choose custom theme options defined below.', 'legacy_framework'), + 'options' => $legacy_color_thumbs, + 'default' => 'custom' + ), + + + + array( + 'id' => 'primary-color', + 'type' => 'color', + 'title' => __('Primary Color of theme', 'legacy_framework'), + 'subtitle' => __('Pick primary color for theme.', 'legacy_framework'), + 'required' => array('dynamic-css-type', 'equals', 'custom'), + 'default' => '#f45246', + 'validate' => 'color', + ), + ), + ) ); + + Redux::setSection( $opt_name, array( + 'title' => __('Layout', 'legacy_framework'), + 'icon' => 'el-icon-css', + 'fields' => array( + array( + 'id' => 'page-bg', + 'type' => 'background', + 'required' => array('dynamic-css-type', 'equals', 'custom'), + 'title' => __('Page Background', 'legacy_framework'), + 'subtitle' => __('Background image, color and settings etc. for admin page', 'legacy_framework'), + 'default' => array( + 'background-color' => '#f0f1f2', + ) + ), + array( + 'id' => 'heading-color', + 'type' => 'color', + 'required' => array('dynamic-css-type', 'equals', 'custom'), + 'title' => __('Heading Color', 'legacy_framework'), + 'subtitle' => __('Pick color for headings and titles in the theme.', 'legacy_framework'), + 'default' => '#7d8a9d', + 'validate' => 'color', + ), + array( + 'id' => 'body-text-color', + 'type' => 'color', + 'required' => array('dynamic-css-type', 'equals', 'custom'), + 'title' => __('Body Text Color', 'legacy_framework'), + 'subtitle' => __('Pick color for page text.', 'legacy_framework'), + 'default' => '#7d8a9d', + 'validate' => 'color', + ), + array( + 'id' => 'link-color', + 'type' => 'link_color', + 'required' => array('dynamic-css-type', 'equals', 'custom'), + 'title' => __('Anchor/URL Links Color', 'legacy_framework'), + 'subtitle' => __('Pick colors for different states of URL links', 'legacy_framework'), + 'active' => false, // Disable Active Color + 'default' => array( + 'regular' => '#2a3e4c', + 'hover' => '#f45246', + ) + ), + array( + 'id' => 'opt1-info-field', + 'type' => 'info', + 'desc' => __($more_settings_msg, 'legacy_framework'), + 'required' => array( 'dynamic-css-type', 'not', 'custom' ), + ), + + ), + ) ); + + Redux::setSection( $opt_name, array( + 'title' => __('Typography Fonts', 'legacy_framework'), + 'icon' => 'el-icon-font', + 'fields' => array( + array( + 'id' => 'google_body', + 'type' => 'typography', + 'title' => __('Body Font', 'legacy_framework'), + 'subtitle' => __('Specify the body font properties.', 'legacy_framework'), + 'google' => true, + 'font-backup' => true, // Select a backup non-google font in addition to a google font + 'font-style' => true, // Includes font-style and weight. Can use font-style or font-weight to declare + 'font-size' => true, + 'line-height' => true, + 'text-align' => false, + 'word-spacing' => false, // Defaults to false + 'letter-spacing' => false, // Defaults to false + 'color' => false, + 'default' => array( + 'font-family' => 'Open Sans', + 'font-weight' => '400', + 'font-backup' => "Arial, Helvetica, sans-serif", + 'font-size' => '14px', + 'line-height' => '23px', + ), + ), + array( + 'id' => 'google_nav', + 'type' => 'typography', + 'title' => __('Main Menu Font', 'legacy_framework'), + 'subtitle' => __('Specify the main menu font properties.', 'legacy_framework'), + 'google' => true, + 'font-backup' => true, // Select a backup non-google font in addition to a google font + 'font-style' => true, // Includes font-style and weight. Can use font-style or font-weight to declare + 'font-size' => true, + 'line-height' => true, + 'text-align' => false, + 'word-spacing' => true, // Defaults to false + 'letter-spacing' => true, // Defaults to false + 'color' => false, + 'default' => array( + 'font-family' => 'Roboto Condensed', + 'font-weight' => '300', + 'font-backup' => "Arial, Helvetica, sans-serif", + 'font-size' => '17px', + 'line-height' => '46px', + ), + ), + array( + 'id' => 'google_headings', + 'type' => 'typography', + 'title' => __('Headings Font', 'legacy_framework'), + 'subtitle' => __('Specify the heading font properties.', 'legacy_framework'), + 'google' => true, + 'font-backup' => true, // Select a backup non-google font in addition to a google font + 'font-style' => true, // Includes font-style and weight. Can use font-style or font-weight to declare + 'font-size' => false, + 'line-height' => false, + 'text-align' => false, + 'word-spacing' => true, // Defaults to false + 'letter-spacing' => true, // Defaults to false + 'color' => false, + 'default' => array( + 'font-family' => 'Roboto Condensed', + 'font-weight' => '300', + 'font-backup' => "Arial, Helvetica, sans-serif" + ), + ), + array( + 'id' => 'google_button', + 'type' => 'typography', + 'title' => __('Button Font', 'legacy_framework'), + 'subtitle' => __('Specify the button font properties.', 'legacy_framework'), + 'google' => true, + 'font-backup' => true, // Select a backup non-google font in addition to a google font + 'font-style' => true, // Includes font-style and weight. Can use font-style or font-weight to declare + 'font-size' => true, + 'line-height' => true, + 'text-align' => false, + 'word-spacing' => true, // Defaults to false + 'letter-spacing' => true, // Defaults to false + 'color' => false, + 'default' => array( + 'font-family' => 'Roboto Condensed', + 'font-weight' => '300', + 'font-backup' => "Arial, Helvetica, sans-serif", + 'font-size' => '15px', + 'line-height' => '23px', + ), + ), + + array( + 'id' => 'google_pagehead', + 'type' => 'typography', + 'title' => __('Page Heading Font', 'legacy_framework'), + 'subtitle' => __('Specify the page heading font properties.', 'legacy_framework'), + 'google' => true, + 'font-backup' => true, // Select a backup non-google font in addition to a google font + 'font-style' => true, // Includes font-style and weight. Can use font-style or font-weight to declare + 'font-size' => true, + 'line-height' => true, + 'text-align' => false, + 'word-spacing' => true, // Defaults to false + 'letter-spacing' => true, // Defaults to false + 'color' => false, + 'default' => array( + 'font-family' => 'Roboto Condensed', + 'font-weight' => '400', + 'font-backup' => "Arial, Helvetica, sans-serif", + 'font-size' => '36px', + 'line-height' => '55px', + ), + ), + + + + array( + 'id' => 'submenu-line-height', + 'type' => 'text', + 'title' => __( 'Submenu Line Height', 'legacy_framework' ), + 'subtitle' => __( 'Line height of submenu items in admin menu. Font size will be same as menu item filled above.', 'legacy_framework' ), + 'default' => '40px', + ), + + + + ), + ) ); + + Redux::setSection( $opt_name, array( + 'title' => __('Admin Menu', 'legacy_framework'), + 'icon' => 'el-icon-css', + 'fields' => array( + + /*array( + 'id' => 'enable-allusers-legacyadmin', + 'type' => 'switch', + 'title' => __('Enable Legacy Admin Panel for users', 'legacy_framework'), + 'desc' => __('Check ON to show Legacy Admin Settings Panel to all Users, OFF to show only to Admin User.', 'legacy_framework'), + 'default' => '0'// 1 = on | 0 = off + ),*/ + + + array( + 'id' => 'menu-bg', + 'type' => 'background', + 'required' => array('dynamic-css-type', 'equals', 'custom'), + 'title' => __('Menu Background', 'legacy_framework'), + 'subtitle' => __('Background image, color and settings etc. for Admin Menu', 'legacy_framework'), + 'default' => array( + 'background-color' => '#2a3e4c', + ) + ), + array( + 'id' => 'menu-color', + 'type' => 'color', + 'required' => array('dynamic-css-type', 'equals', 'custom'), + 'title' => __('Menu Text Color', 'legacy_framework'), + 'subtitle' => __('Pick link/text color for admin menu.', 'legacy_framework'), + 'default' => '#ffffff', + 'validate' => 'color', + ), + array( + 'id' => 'menu-hover-color', + 'type' => 'color', + 'required' => array('dynamic-css-type', 'equals', 'custom'), + 'title' => __('Menu Hover Text Color', 'legacy_framework'), + 'subtitle' => __('Pick link/text color for admin menu on hover.', 'legacy_framework'), + 'default' => '#ffffff', + 'validate' => 'color', + ), + array( + 'id' => 'submenu-color', + 'type' => 'color', + 'required' => array('dynamic-css-type', 'equals', 'custom'), + 'title' => __('SubMenu Text Color', 'legacy_framework'), + 'subtitle' => __('Pick link/text color for admin submenu.', 'legacy_framework'), + 'default' => '#aeb2b7', + 'validate' => 'color', + ), + array( + 'id' => 'menu-primary-bg', + 'type' => 'color', + 'required' => array('dynamic-css-type', 'equals', 'custom'), + 'title' => __('Menu Primary Background Color', 'legacy_framework'), + 'subtitle' => __('Pick background color for admin menu. It is the hover or default background color of Menu link', 'legacy_framework'), + 'default' => '#f45246', + 'validate' => 'color', + ), + array( + 'id' => 'menu-secondary-bg', + 'type' => 'color', + 'required' => array('dynamic-css-type', 'equals', 'custom'), + 'title' => __('Menu Secondary Background Color', 'legacy_framework'), + 'subtitle' => __('Pick background color for admin submenu. It is the hover or default background color of Submenu link', 'legacy_framework'), + 'default' => '#141c22', + 'validate' => 'color', + ), + + array( + 'id' => 'menu-icon-line-bg', + 'type' => 'background', + 'required' => array('dynamic-css-type', 'equals', 'custom'), + 'title' => __('Menu Icon Connection Line Background', 'legacy_framework'), + 'subtitle' => __('Color of icons connecting Line in admin menu', 'legacy_framework'), + 'default' => array( + 'background-color' => '#aeb2b7', + ) + ), + array( + 'id' => 'menu-icon-color', + 'type' => 'color', + 'required' => array('dynamic-css-type', 'equals', 'custom'), + 'title' => __('Menu Icon Color', 'legacy_framework'), + 'subtitle' => __('Pick icon color for admin menu.', 'legacy_framework'), + 'default' => '#aeb2b7', + 'validate' => 'color', + ), + array( + 'id' => 'menu-icon-bg', + 'type' => 'background', + 'required' => array('dynamic-css-type', 'equals', 'custom'), + 'title' => __('Menu Icon Background', 'legacy_framework'), + 'subtitle' => __('Background color Admin Menu icons', 'legacy_framework'), + 'default' => array( + 'background-color' => '#2a3e4c', + ) + ), + + array( + 'id' => 'menu-active-icon-color', + 'type' => 'color', + 'required' => array('dynamic-css-type', 'equals', 'custom'), + 'title' => __('Active Menu Icon Color', 'legacy_framework'), + 'subtitle' => __('Pick icon color for active state or hover state of admin menu item.', 'legacy_framework'), + 'default' => '#f45246', + 'validate' => 'color', + ), + array( + 'id' => 'menu-active-icon-bg', + 'type' => 'background', + 'required' => array('dynamic-css-type', 'equals', 'custom'), + 'title' => __('Active Menu Icon Background', 'legacy_framework'), + 'subtitle' => __('Icon background color for active state or hover state of admin menu item', 'legacy_framework'), + 'default' => array( + 'background-color' => '#f0f1f2', + ) + ), + array( + 'id' => 'submenu-active-icon-bg', + 'type' => 'background', + 'required' => array('dynamic-css-type', 'equals', 'custom'), + 'title' => __('Active SubMenu Icon Background', 'legacy_framework'), + 'subtitle' => __('Icon background color for active state or hover state of admin submenu item', 'legacy_framework'), + 'default' => array( + 'background-color' => '#f45246', + ) + ), + + + array( + 'id' => 'menu-transform-text', + 'type' => 'select', + 'title' => __('Menu Text transform', 'legacy_framework'), + 'subtitle' => __('Pick to convert menu item to uppercase, lowercase, capitalize each word or use original.', 'legacy_framework'), + "default" => "uppercase", + "options" => array('uppercase' => 'Uppercase','lowercase' =>'Lowercase','capitalize' => 'Capitalize', 'none' => 'Use Original') + ), + array( + 'id' => 'opt2-info-field', + 'type' => 'info', + 'desc' => __($more_settings_msg, 'legacy_framework'), + 'required' => array( 'dynamic-css-type', 'not', 'custom' ), + ), + + ), + ) ); + + Redux::setSection( $opt_name, array( + 'title' => __('Logo Settings', 'legacy_framework'), + 'icon' => 'el-icon-star', + // 'submenu' => false, // Setting submenu to false on a given section will hide it from the WordPress sidebar menu! + 'fields' => array( + array( + 'id' => 'enable-logo', + 'type' => 'switch', + 'title' => __('Show Logo', 'legacy_framework'), + 'desc' => __('Check ON to show logo in menu and favicon, OFF to disable.', 'legacy_framework'), + 'default' => '1'// 1 = on | 0 = off + ), + + array( + 'id' => 'logo-url', + 'type' => 'text', + 'title' => __( 'Logo URL', 'legacy_framework' ), + 'subtitle' => __( 'On clicking logo, user will be redirected to this mentioned url.', 'legacy_framework' ), + 'validate' => 'url', + 'default' => '', + // 'text_hint' => array( + // 'title' => '', + // 'content' => 'Please enter a valid URL in this field.' + // ) + ), + + array( + 'id' => 'logo-bg', + 'type' => 'color', + 'required' => array('dynamic-css-type', 'equals', 'custom'), + 'title' => __('Logo Background', 'legacy_framework'), + 'subtitle' => __('Background image, color and settings etc. for logo in Admin Menu', 'legacy_framework'), + 'default' => '#2a3e4c', + 'validate' => 'color', + ), + + array( + 'id' => 'logo', + 'type' => 'media', + 'url' => true, + 'readonly' => false, + //'required' => array('dynamic-css-type', 'equals', 'custom'), + 'title' => __('Logo', 'legacy_framework'), + 'subtitle' => __('Upload your own logo of 230px (width) * 69px (height)', 'legacy_framework'), + 'default' => array('url' => $modbaseurl."images/logo.png") + ), + array( + 'id' => 'logo_folded', + 'type' => 'media', + 'url' => true, + 'readonly' => false, + //'required' => array('dynamic-css-type', 'equals', 'custom'), + 'title' => __('Collapsed Menu Logo', 'legacy_framework'), + 'subtitle' => __('Upload your own logo of 46px (width) * 69px (height)', 'legacy_framework'), + 'default' => array('url' => $modbaseurl."images/logo-folded.png") + ), + + + array( + 'id' => 'login-logo', + 'type' => 'media', + 'url' => true, + 'readonly' => false, + 'title' => __('Login Page Logo', 'legacy_framework'), + 'subtitle' => __('Upload your login page logo.', 'legacy_framework'), + 'default' => array('url' => $modbaseurl."images/login-logo.png") + ), + + array( + 'id' => 'favicon', + 'type' => 'media', + 'url' => true, + 'readonly' => false, + 'compiler' => 'true', + 'title' => __('Favicon', 'legacy_framework'), + 'subtitle' => __('image that will be used as favicon (16px x 16px).', 'legacy_framework'), + 'default' => array('url' => $modbaseurl."images/favicon.png") + ), + array( + 'id' => 'iphone_icon', + 'type' => 'media', + 'readonly' => false, + 'url' => true, + 'compiler' => 'true', + 'title' => __('Apple Iphone Icon', 'legacy_framework'), + 'subtitle' => __('Apple Iphone Icon (57px x 57px).', 'legacy_framework'), + 'default' => array('url' => $modbaseurl."images/apple-touch-icon-57-precomposed.png") + ), + array( + 'id' => 'iphone_icon_retina', + 'type' => 'media', + 'url' => true, + 'readonly' => false, + 'compiler' => 'true', + 'title' => __('Apple Iphone Retina Icon', 'legacy_framework'), + 'subtitle' => __('Apple Iphone Retina Icon (114px x 114px).', 'legacy_framework'), + 'default' => array('url' => $modbaseurl."images/apple-touch-icon-114-precomposed.png") + ), + array( + 'id' => 'ipad_icon', + 'type' => 'media', + 'url' => true, + 'readonly' => false, + 'compiler' => 'true', + 'title' => __('Apple iPad Icon', 'legacy_framework'), + 'subtitle' => __('Apple Iphone Retina Icon (72px x 72px).', 'legacy_framework'), + 'default' => array('url' => $modbaseurl."images/apple-touch-icon-72-precomposed.png") + ), + array( + 'id' => 'ipad_icon_retina', + 'type' => 'media', + 'url' => true, + 'readonly' => false, + 'compiler' => 'true', + 'title' => __('Apple iPad Retina Icon', 'legacy_framework'), + 'subtitle' => __('Apple iPad Retina Icon (144px x 144px).', 'legacy_framework'), + 'default' => array('url' => $modbaseurl."images/apple-touch-icon-144-precomposed.png") + ), + ), + ) ); + + Redux::setSection( $opt_name, array( + 'title' => __('Content Box', 'legacy_framework'), + 'icon' => 'el-icon-css', + 'fields' => array( + + array( + 'id' => 'box-bg', + 'type' => 'background', + 'required' => array('dynamic-css-type', 'equals', 'custom'), + 'title' => __('Content Box Background', 'legacy_framework'), + 'subtitle' => __('Background image, color and settings etc. for Content Boxes. Eg: Welcome box on dashboard', 'legacy_framework'), + 'default' => array( + 'background-color' => '#ffffff', + ) + ), + array( + 'id' => 'box-head-bg', + 'type' => 'background', + 'required' => array('dynamic-css-type', 'equals', 'custom'), + 'title' => __('Content Box Header Background', 'legacy_framework'), + 'subtitle' => __('Background image, color and settings etc. for Content Box Header area. Eg: Welcome box on dashboard', 'legacy_framework'), + 'default' => array( + 'background-color' => '#64ca92', + ) + ), + + array( + 'id' => 'box-head-color', + 'type' => 'color', + 'required' => array('dynamic-css-type', 'equals', 'custom'), + 'title' => __('Box Head Text Color', 'legacy_framework'), + 'subtitle' => __('Pick text color for content box header area.', 'legacy_framework'), + 'default' => '#ffffff', + 'validate' => 'color', + ), + array( + 'id' => 'opt3-info-field', + 'type' => 'info', + 'desc' => __($more_settings_msg, 'legacy_framework'), + 'required' => array( 'dynamic-css-type', 'not', 'custom' ), + ), + ), + ) ); + + Redux::setSection( $opt_name, array( + 'title' => __('Button', 'legacy_framework'), + 'icon' => 'el-icon-css', + 'fields' => array( + array( + 'id' => 'button-primary-bg', + 'type' => 'color', + 'required' => array('dynamic-css-type', 'equals', 'custom'), + 'title' => __('Primary Button Background Color', 'legacy_framework'), + 'subtitle' => __('Pick background color for primary button', 'legacy_framework'), + 'default' => '#f45246', + 'validate' => 'color', + ), + array( + 'id' => 'button-primary-hover-bg', + 'type' => 'color', + 'required' => array('dynamic-css-type', 'equals', 'custom'), + 'title' => __('Primary Button Hover Background Color', 'legacy_framework'), + 'subtitle' => __('Pick hover background color for primary button', 'legacy_framework'), + 'default' => '#18b3dc', + 'validate' => 'color', + ), + array( + 'id' => 'button-secondary-bg', + 'type' => 'color', + 'required' => array('dynamic-css-type', 'equals', 'custom'), + 'title' => __('Secondary Button Background Color', 'legacy_framework'), + 'subtitle' => __('Pick background color for secondary button', 'legacy_framework'), + 'default' => '#a9a9a9', + 'validate' => 'color', + ), + array( + 'id' => 'button-secondary-hover-bg', + 'type' => 'color', + 'required' => array('dynamic-css-type', 'equals', 'custom'), + 'title' => __('Secondary Button Hover Background Color', 'legacy_framework'), + 'subtitle' => __('Pick hover background color for secondary button', 'legacy_framework'), + 'default' => '#999999', + 'validate' => 'color', + ), + array( + 'id' => 'button-text-color', + 'type' => 'color', + 'required' => array('dynamic-css-type', 'equals', 'custom'), + 'title' => __('Button Text Color', 'legacy_framework'), + 'subtitle' => __('Pick text color for a button.', 'legacy_framework'), + 'default' => '#ffffff', + 'validate' => 'color', + ), + array( + 'id' => 'opt4-info-field', + 'type' => 'info', + 'desc' => __($more_settings_msg, 'legacy_framework'), + 'required' => array( 'dynamic-css-type', 'not', 'custom' ), + ), + + ), + ) ); + + Redux::setSection( $opt_name, array( + 'title' => __('Form', 'legacy_framework'), + 'icon' => 'el-icon-css', + 'fields' => array( + + array( + 'id' => 'form-bg', + 'required' => array('dynamic-css-type', 'equals', 'custom'), + 'type' => 'color', + 'title' => __('Form Elements Background Color', 'legacy_framework'), + 'subtitle' => __('Pick background color for form elements', 'legacy_framework'), + 'default' => '#ffffff', + 'validate' => 'color', + ), + + array( + 'id' => 'form-text-color', + 'required' => array('dynamic-css-type', 'equals', 'custom'), + 'type' => 'color', + 'title' => __('Form Elements Text Color', 'legacy_framework'), + 'subtitle' => __('Pick text color for form elements', 'legacy_framework'), + 'default' => '#7d8a9d', + 'validate' => 'color', + ), + + array( + 'id' => 'form-border-color', + 'required' => array('dynamic-css-type', 'equals', 'custom'), + 'type' => 'color', + 'title' => __('Form Elements Border Color', 'legacy_framework'), + 'subtitle' => __('Pick border color for form elements.', 'legacy_framework'), + 'default' => '#e2e2e4', + 'validate' => 'color', + ), + array( + 'id' => 'opt5-info-field', + 'type' => 'info', + 'desc' => __($more_settings_msg, 'legacy_framework'), + 'required' => array( 'dynamic-css-type', 'not', 'custom' ), + ), + + ), + ) ); + + Redux::setSection( $opt_name, array( + 'title' => __('Login Page', 'legacy_framework'), + 'icon' => 'el-icon-css', + 'fields' => array( + + /*array( + 'id' => 'enable-login', + 'type' => 'switch', + 'title' => __('Enable Custom Login Screen', 'legacy_framework'), + 'desc' => __('Check ON to show custom login screen. OFF for default WordPress Login Page.', 'legacy_framework'), + 'default' => '1'// 1 = on | 0 = off + ),*/ + + + array( + 'id' => 'login-background', + 'tiles' => true, + //'required' => array('dynamic-css-type', 'equals', 'custom'), + 'type' => 'background', + 'title' => __('Login Page Background', 'legacy_framework'), + 'subtitle' => __('Background image, color and settings etc. for login page (Eg: http://www.yourdomain.com/wp-login.php)', 'legacy_framework'), + 'preview' => false, + 'preview_media' => true, + 'default' => array( + 'background-color' => '#a1a4a6', + 'background-position' => 'center center', + 'background-image' => $modbaseurl."images/login-bg.png", + ) + ), + + array( + 'id' => 'login-form-background', + 'type' => 'color_gradient', + 'title' => __( 'Header Gradient Color Option', 'legacy_framework' ), + 'subtitle' => __( 'Only color validation can be done on this field type', 'legacy_framework' ), + 'desc' => __( 'This is the description field, again good for additional info.', 'legacy_framework' ), + 'default' => array( + 'from' => '#181845', + 'to' => '#000000' + ) + ), + + /* + array( + 'id' => 'login-form-background', + 'tiles' => true, + 'required' => array('dynamic-css-type', 'equals', 'custom'), + 'type' => 'background', + 'title' => __('Login Form Box Background', 'legacy_framework'), + 'subtitle' => __('Background image, color and settings etc. for login form box', 'legacy_framework'), + 'preview' => false, + 'preview_media' => true, + 'default' => array( + 'background-color' => 'transparent', + ) + ), + */ + array( + 'id' => 'login-text-color', + 'type' => 'color', + //'required' => array('dynamic-css-type', 'equals', 'custom'), + 'title' => __('Login Page Text color', 'legacy_framework'), + 'subtitle' => __('Pick color for login page text.', 'legacy_framework'), + 'validate' => 'color', + 'default' => '#9a9a9a', + ), + + array( + 'id' => 'login-link-color', + 'type' => 'link_color', + // 'required' => array('dynamic-css-type', 'equals', 'custom'), + 'title' => __('Login Page Anchor/URL Links Color', 'legacy_framework'), + 'subtitle' => __('Pick colors for different states of login page links', 'legacy_framework'), + //'regular' => false, // Disable Regular Color + //'hover' => false, // Disable Hover Color + 'active' => false, // Disable Active Color + //'visited' => true, // Enable Visited Color + 'default' => array( + 'regular' => '#9a9a9a', + 'hover' => '#aaaaaa', + ) + ), + + array( + 'id' => 'login-input-text-color', + 'type' => 'color', + // 'required' => array('dynamic-css-type', 'equals', 'custom'), + 'title' => __('Login Input Fields Text color', 'legacy_framework'), + 'subtitle' => __('Pick text color for login page input fields.', 'legacy_framework'), + 'validate' => 'color', + 'default' => '#f5f5f5', + ), + + array( + 'id' => 'login-input-bg-color', + 'type' => 'color', + // 'required' => array('dynamic-css-type', 'equals', 'custom'), + 'title' => __('Login Input Fields background color', 'legacy_framework'), + 'subtitle' => __('Pick background color for login page input fields.', 'legacy_framework'), + 'validate' => 'color', + 'default' => 'transparent', + ), + array( + 'id' => 'login-input-bg-opacity', + 'type' => 'text', + 'title' => __('Login Input Fields background Opacity', 'legacy_framework'), + 'subtitle' => __('Define opacity in range from 0.1 to 1.0. Eg: 0.8', 'legacy_framework'), + 'default' => '0.5', + ), + array( + 'id' => 'login-input-bg-hover-opacity', + 'type' => 'text', + 'title' => __('Login Input Fields Focus/Hover background Opacity', 'legacy_framework'), + 'subtitle' => __('Define opacity in range from 0.1 to 1.0. Eg: 0.8', 'legacy_framework'), + 'default' => '0.8', + ), + + array( + 'id' => 'login-input-border-color', + 'type' => 'color', + // 'required' => array('dynamic-css-type', 'equals', 'custom'), + 'title' => __('Login Input Fields bottom border color', 'legacy_framework'), + 'subtitle' => __('Pick bottom border color for login page input fields.', 'legacy_framework'), + 'validate' => 'color', + 'default' => '#8b8c91', + ), + + + + array( + 'id' => 'login-button-bg', + 'type' => 'color', + // 'required' => array('dynamic-css-type', 'equals', 'custom'), + 'title' => __('Login Button Background Color', 'legacy_framework'), + 'subtitle' => __('Pick background color for login button', 'legacy_framework'), + 'default' => '#f45246', + 'validate' => 'color', + ), + array( + 'id' => 'login-button-hover-bg', + 'type' => 'color', + // 'required' => array('dynamic-css-type', 'equals', 'custom'), + 'title' => __('Login Button Hover Background Color', 'legacy_framework'), + 'subtitle' => __('Pick hover background color for login button', 'legacy_framework'), + 'default' => '#18b3dc', + 'validate' => 'color', + ), + + array( + 'id' => 'login-button-text-color', + 'type' => 'color', + // 'required' => array('dynamic-css-type', 'equals', 'custom'), + 'title' => __('Login button Text Color', 'legacy_framework'), + 'subtitle' => __('Pick text color for a login button.', 'legacy_framework'), + 'default' => '#ffffff', + 'validate' => 'color', + ), + + + array("title" => "Back to main site Link", + "desc" => "Select to show or hide back to main site link on login page.", + "id" => "backtosite_login_link", + "default" => '0', + "type" => "switch"), + + array("title" => "Forgot Password Link", + "desc" => "Select to show or hide Forgot Password link on login page.", + "id" => "forgot_login_link", + "default" => '1', + "type" => "switch"), + + array( + 'id' => 'login-logo-title', + 'type' => 'text', + 'title' => __('Login Logo Title', 'legacy_framework'), + 'subtitle' => __('The title tooltip shown on login logo when mouse is taken over it.', 'legacy_framework'), + 'default' => 'Legacy - White Lable WordPress Admin Theme', + ), + + + /*array( + 'id' => 'opt6-info-field', + 'type' => 'info', + 'desc' => __($more_settings_msg, 'legacy_framework'), + 'required' => array( 'dynamic-css-type', 'not', 'custom' ), + ),*/ + ), + ) ); + + Redux::setSection( $opt_name, array( + 'title' => __('Admin Top Bar', 'legacy_framework'), + 'icon' => 'el-icon-css', + 'fields' => array( + + array( + 'id' => 'enable-topbar', + 'type' => 'switch', + 'title' => __('Enable Admin Top Bar in admin panel', 'legacy_framework'), + 'desc' => __('Check ON to show admin panel top bar in the menu, OFF to hide.', 'legacy_framework'), + 'default' => '1'// 1 = on | 0 = off + ), + + array( + 'id' => 'enable-topbar-wp', + 'type' => 'switch', + 'title' => __('Enable Top Bar on front End (on website)', 'legacy_framework'), + 'desc' => __('Check ON to show admin panel top bar on the website for logged in users, OFF to hide.', 'legacy_framework'), + 'default' => '1'// 1 = on | 0 = off + ), + + // array("title" => "Admin Top Bar Style", + // "desc" => "Select the default style to display the top bar menu.", + // "id" => "topbar-style", + // "default" => "style2", + // "type" => "select", + // "options" => array('style1' => '100% Width Style','style2' =>'Besides Main Menu'), + // ), + + array( + 'id' => 'topbar-menu-color', + 'type' => 'color', + 'required' => array('dynamic-css-type', 'equals', 'custom'), + 'title' => __('Top Bar Menu Text Color', 'legacy_framework'), + 'subtitle' => __('Pick link/text color for top bar menu.', 'legacy_framework'), + 'default' => '#ffffff', + 'validate' => 'color', + ), + + + array( + 'id' => 'topbar-menu-bg', + 'type' => 'background', + 'required' => array('dynamic-css-type', 'equals', 'custom'), + 'title' => __('Top Bar Menu Background', 'legacy_framework'), + 'subtitle' => __('Background image, color and settings etc. for top bar Menu', 'legacy_framework'), + 'default' => array( + 'background-color' => '#18b3dc', + ) + ), + + array( + 'id' => 'topbar-submenu-color', + 'type' => 'color', + 'required' => array('dynamic-css-type', 'equals', 'custom'), + 'title' => __('Top Bar SubMenu Text Color', 'legacy_framework'), + 'subtitle' => __('Pick link/text color for top bar submenu.', 'legacy_framework'), + 'default' => '#aeb2b7', + 'validate' => 'color', + ), + array( + 'id' => 'topbar-submenu-bg', + 'type' => 'color', + 'required' => array('dynamic-css-type', 'equals', 'custom'), + 'title' => __('Top Bar SubMenu Primary Background Color', 'legacy_framework'), + 'subtitle' => __('Pick background color for top bar menu. It is the hover or default background color of Menu link', 'legacy_framework'), + 'default' => '#2a3e4c', + 'validate' => 'color', + ), + + + array( + 'id' => 'topbar-submenu-hover-bg', + 'type' => 'color', + 'required' => array('dynamic-css-type', 'equals', 'custom'), + 'title' => __('Top Bar SubMenu Secondary Background Color', 'legacy_framework'), + 'subtitle' => __('Pick background color for top bar submenu. It is the hover or default background color of Submenu link', 'legacy_framework'), + 'default' => '#141c22', + 'validate' => 'color', + ), + + array( + 'id' => 'enable-topbar-links-wp', + 'type' => 'switch', + 'title' => __('Top Bar WordPress Menu', 'legacy_framework'), + 'desc' => __('Check ON to show top bar wordpress menu and submenu links, OFF to hide.', 'legacy_framework'), + 'default' => '1'// 1 = on | 0 = off + ), + + + array( + 'id' => 'enable-topbar-links-site', + 'type' => 'switch', + 'title' => __('Top Bar Site Menu', 'legacy_framework'), + 'desc' => __('Check ON to show top bar site menu and submenu links, OFF to hide.', 'legacy_framework'), + 'default' => '1'// 1 = on | 0 = off + ), + + array( + 'id' => 'enable-topbar-links-comments', + 'type' => 'switch', + 'title' => __('Top Bar Comments link', 'legacy_framework'), + 'desc' => __('Check ON to show top bar comments link, OFF to hide.', 'legacy_framework'), + 'default' => '1'// 1 = on | 0 = off + ), + + array( + 'id' => 'enable-topbar-links-new', + 'type' => 'switch', + 'title' => __('Top Bar Add New Menu', 'legacy_framework'), + 'desc' => __('Check ON to show top bar add new menu and submenu links, OFF to hide.', 'legacy_framework'), + 'default' => '1'// 1 = on | 0 = off + ), + + array( + 'id' => 'enable-topbar-links-legacyadmin', + 'type' => 'switch', + 'title' => __('Top Bar Legacy Admin Menu', 'legacy_framework'), + 'desc' => __('Check ON to show top bar Legacy Admin menu and submenu links, OFF to hide.', 'legacy_framework'), + 'default' => '1'// 1 = on | 0 = off + ), + + array( + 'id' => 'enable-topbar-myaccount', + 'type' => 'switch', + 'title' => __('Top Bar My Account', 'legacy_framework'), + 'desc' => __('Check ON to show top bar My Account Menu, OFF to hide.', 'legacy_framework'), + 'default' => '1'// 1 = on | 0 = off + ), + + + array( + 'id' => 'enable-topbar-directlogout', + 'type' => 'switch', + 'title' => __('Direct Logout Link', 'legacy_framework'), + 'desc' => __('Check ON to show logout link in the top bar besides user account menu, OFF to hide.', 'legacy_framework'), + 'default' => '0'// 1 = on | 0 = off + ), + + array( + 'id' => 'topbar-removeids', + 'type' => 'text', + 'title' => __('Remove Top bar Link Node ids', 'legacy_framework'), + 'desc' => __('Enter node ids of link top bar to remove. Separate by comma(,) Eg: new-content,comments', 'legacy_framework'), + 'default' => '', + ), + + array( + 'id' => 'myaccount_greet', + 'type' => 'text', + 'title' => __('Greet User with', 'legacy_framework'), + 'desc' => __('Enter the greeting word for logged in user. Default is Howdy. Eg: Welcome ', 'legacy_framework'), + 'default' => 'Howdy', + ), + + + + array( + 'id' => 'opt7-info-field', + 'type' => 'info', + 'desc' => __($more_settings_msg, 'legacy_framework'), + 'required' => array( 'dynamic-css-type', 'not', 'custom' ), + ), + + ), + ) ); + + Redux::setSection( $opt_name, array( + 'title' => __('Page Loader', 'legacy_framework'), + 'icon' => 'el-icon-css', + 'fields' => array( + + array( + 'id' => 'enable-pageloader', + 'type' => 'switch', + 'title' => __('Enable Page Loading Top Bar', 'legacy_framework'), + 'desc' => __('Check ON to enable progress bar on top, OFF to disable.', 'legacy_framework'), + 'default' => '1'// 1 = on | 0 = off + ), + + + ), + ) ); + + + Redux::setSection( $opt_name, array( + 'title' => __('Email Settings', 'legacy_framework'), + 'icon' => 'el-icon-css', + 'fields' => array( + + array( + 'id' => 'from-mail-email', + 'type' => 'text', + 'title' => __('From Mail Email Address', 'legacy_framework'), + 'desc' => __('Change the from email address used in an email sent using the wp_mail function. (Default is wordpress@domain.com). Change it to your personal brand or domain name. To avoid being marked as spam make sure the email is from the same domain as your website.', 'legacy_framework'), + 'default' => '', + ), + + array( + 'id' => 'from-mail-name', + 'type' => 'text', + 'title' => __('From Mail Name', 'legacy_framework'), + 'desc' => __('Change the from name used in an email sent using the wp_mail function. (Default is Wordpress). Change it to your personal brand or domain name.', 'legacy_framework'), + 'default' => '', + ), + + + + ), +) ); + + + Redux::setSection( $opt_name, array( + 'title' => __('Extra Settings', 'legacy_framework'), + 'icon' => 'el-icon-css', + 'fields' => array( + + array("title" => "Footer Text", + "desc" => "Enter the text that displays in the footer bar. HTML markup can be used.", + "id" => "footer_text", + "default" => 'Thank you for creating with WordPress and Legacy White Label WordPress Admin Theme', + "type" => "editor"), + + array("title" => "Footer Version", + "desc" => "Select to show WordPress version info in footer area or not.", + "id" => "footer_version", + "default" => '1', + "type" => "switch"), + + + array("title" => "Screen Option Tab", + "desc" => "Select to show screen option tab in top right corner of admin screen", + "id" => "screen_option_tab", + "default" => '1', + "type" => "switch"), + + array("title" => "Screen Help Tab", + "desc" => "Select to show screen help tab in top right corner of admin screen", + "id" => "screen_help_tab", + "default" => '1', + "type" => "switch"), + + + array( + 'id' => 'custom-css', + 'type' => 'ace_editor', + 'title' => __( 'Custom CSS Code', 'legacy_framework' ), + 'subtitle' => __( 'Paste your CSS code here. This code will be applied in all your admin panel', 'legacy_framework' ), + 'mode' => 'css', + 'theme' => 'monokai', + 'desc' => 'In case if you need to overwrite any CSS setting, you can add !important at the end of CSS property. eg: color: #da2234 !important; +
    +You can use dynamic css variables in custom css code. +
    +Eg:
    +.css-selector{
    +    background: var(--tp-primary-color);
    +    border-color: var(--tp-primary-color);
    +}
    +
    +Following is the list of defined css variables based on your settings configured. +
    +:root {
    +  --tp-primary-color: #f45246;
    +  --tp-page-bg-background-color: #f0f1f2;
    +  --tp-heading-color: #7d8a9d;
    +  --tp-body-text-color: #7d8a9d;
    +  --tp-link-color-regular: #2a3e4c;
    +  --tp-link-color-hover: #f45246;
    +  --tp-menu-bg-background-color: #2a3e4c;
    +  --tp-menu-color: #ffffff;
    +  --tp-menu-hover-color: #ffffff;
    +  --tp-submenu-color: #aeb2b7;
    +  --tp-menu-primary-bg: #f45246;
    +  --tp-menu-secondary-bg: #141c22;
    +  --tp-box-bg-background-color: #ffffff;
    +  --tp-box-head-bg-background-color: #64ca92;
    +  --tp-box-head-color: #ffffff;
    +  --tp-button-primary-bg: #f45246;
    +  --tp-button-primary-hover-bg: #18b3dc;
    +  --tp-button-secondary-bg: #a9a9a9;
    +  --tp-button-secondary-hover-bg: #999999;
    +  --tp-button-text-color: #ffffff;
    +  --tp-form-bg: #ffffff;
    +  --tp-form-text-color: #7d8a9d;
    +  --tp-form-border-color: #e2e2e4;
    +  --tp-logo-bg: #2a3e4c;
    +  --tp-topbar-menu-color: #ffffff;
    +  --tp-topbar-menu-bg-background-color: #18b3dc;
    +  --tp-topbar-submenu-color: #aeb2b7;
    +  --tp-topbar-submenu-bg: #2a3e4c;
    +  --tp-topbar-submenu-hover-bg: #141c22;
    +}
    +
    + ', + 'default' => "" + ), + + array( + 'id' => 'custom-login-css', + 'type' => 'ace_editor', + 'title' => __( 'Custom Login Page CSS Code', 'legacy_framework' ), + 'subtitle' => __( 'Paste your CSS code here. This code will be applied on your admin login page.', 'legacy_framework' ), + 'mode' => 'css', + 'theme' => 'monokai', + 'desc' => 'In case if you need to overwrite any CSS setting, you can add !important at the end of CSS property. eg: color: #da2234 !important; ', + 'default' => "" + ), + + ), + ) ); + + /* + * <--- END SECTIONS + */ + + /** + * Custom function for the callback validation referenced above + * */ + if ( ! function_exists( 'redux_validate_callback_function' ) ) { + function redux_validate_callback_function( $field, $value, $existing_value ) { + $error = false; + $warning = false; + + //do your validation + if ( $value == 1 ) { + $error = true; + $value = $existing_value; + } elseif ( $value == 2 ) { + $warning = true; + $value = $existing_value; + } + + $return['value'] = $value; + + if ( $error == true ) { + $return['error'] = $field; + $field['msg'] = 'your custom error message'; + } + + if ( $warning == true ) { + $return['warning'] = $field; + $field['msg'] = 'your custom warning message'; + } + + return $return; + } + } + + /** + * Custom function for the callback referenced above + */ + if ( ! function_exists( 'redux_my_custom_field' ) ) { + function redux_my_custom_field( $field, $value ) { + print_r( $field ); + echo '
    '; + print_r( $value ); + } + } + + /** + * Custom function for filtering the sections array. Good for child themes to override or add to the sections. + * Simply include this function in the child themes functions.php file. + * NOTE: the defined constants for URLs, and directories will NOT be available at this point in a child theme, + * so you must use get_template_directory_uri() if you want to use any of the built in icons + * */ + function dynamic_section_delete_legacy_conflict( $sections ) { + //$sections = array(); + $sections[] = array( + 'title' => __( 'Section via hook', 'legacy_framework' ), + 'desc' => __( '

    This is a section created by adding a filter to the sections array. Can be used by child themes to add/remove sections from the options.

    ', 'legacy_framework' ), + 'icon' => 'el el-paper-clip', + // Leave this as a blank section, no options just some intro text set above. + 'fields' => array() + ); + + return $sections; + } + + /** + * Filter hook for filtering the args. Good for child themes to override or add to the args array. Can also be used in other functions. + * */ + function change_arguments_delete_legacy_conflict( $args ) { + //$args['dev_mode'] = true; + + return $args; + } + + /** + * Filter hook for filtering the default value of any given field. Very useful in development mode. + * */ + function change_defaults_delete_legacy_conflict( $defaults ) { + $defaults['str_replace'] = 'Testing filter hook!'; + + return $defaults; + } + + // Remove the demo link and the notice of integrated demo from the legacy_framework plugin + function remove_demo_delete_legacy_conflict() { + + // Used to hide the demo mode link from the plugin page. Only used when Redux is a plugin. + if ( class_exists( 'ReduxFrameworkPlugin' ) ) { + remove_filter( 'plugin_row_meta', array( + ReduxFrameworkPlugin::instance(), + 'plugin_metalinks' + ), null, 2 ); + + // Used to hide the activation notice informing users of the demo panel. Only used when Redux is a plugin. + remove_action( 'admin_notices', array( ReduxFrameworkPlugin::instance(), 'admin_notices' ) ); + } + } diff --git a/plugins/legacy-admin/images/apple-touch-icon-114-precomposed.png b/plugins/legacy-admin/images/apple-touch-icon-114-precomposed.png new file mode 100644 index 000000000..3699a04b7 Binary files /dev/null and b/plugins/legacy-admin/images/apple-touch-icon-114-precomposed.png differ diff --git a/plugins/legacy-admin/images/apple-touch-icon-144-precomposed.png b/plugins/legacy-admin/images/apple-touch-icon-144-precomposed.png new file mode 100644 index 000000000..2e9dd4f3f Binary files /dev/null and b/plugins/legacy-admin/images/apple-touch-icon-144-precomposed.png differ diff --git a/plugins/legacy-admin/images/apple-touch-icon-57-precomposed.png b/plugins/legacy-admin/images/apple-touch-icon-57-precomposed.png new file mode 100644 index 000000000..5bbec3659 Binary files /dev/null and b/plugins/legacy-admin/images/apple-touch-icon-57-precomposed.png differ diff --git a/plugins/legacy-admin/images/apple-touch-icon-72-precomposed.png b/plugins/legacy-admin/images/apple-touch-icon-72-precomposed.png new file mode 100644 index 000000000..bc9933d15 Binary files /dev/null and b/plugins/legacy-admin/images/apple-touch-icon-72-precomposed.png differ diff --git a/plugins/legacy-admin/images/assets/color1.jpg b/plugins/legacy-admin/images/assets/color1.jpg new file mode 100644 index 000000000..4cf4fdf98 Binary files /dev/null and b/plugins/legacy-admin/images/assets/color1.jpg differ diff --git a/plugins/legacy-admin/images/assets/color10.jpg b/plugins/legacy-admin/images/assets/color10.jpg new file mode 100644 index 000000000..b1e733445 Binary files /dev/null and b/plugins/legacy-admin/images/assets/color10.jpg differ diff --git a/plugins/legacy-admin/images/assets/color11.jpg b/plugins/legacy-admin/images/assets/color11.jpg new file mode 100644 index 000000000..64bf0a613 Binary files /dev/null and b/plugins/legacy-admin/images/assets/color11.jpg differ diff --git a/plugins/legacy-admin/images/assets/color12.jpg b/plugins/legacy-admin/images/assets/color12.jpg new file mode 100644 index 000000000..305f4dc6b Binary files /dev/null and b/plugins/legacy-admin/images/assets/color12.jpg differ diff --git a/plugins/legacy-admin/images/assets/color13.jpg b/plugins/legacy-admin/images/assets/color13.jpg new file mode 100644 index 000000000..da6ad4748 Binary files /dev/null and b/plugins/legacy-admin/images/assets/color13.jpg differ diff --git a/plugins/legacy-admin/images/assets/color14.jpg b/plugins/legacy-admin/images/assets/color14.jpg new file mode 100644 index 000000000..a10b08e7d Binary files /dev/null and b/plugins/legacy-admin/images/assets/color14.jpg differ diff --git a/plugins/legacy-admin/images/assets/color15.jpg b/plugins/legacy-admin/images/assets/color15.jpg new file mode 100644 index 000000000..53007b012 Binary files /dev/null and b/plugins/legacy-admin/images/assets/color15.jpg differ diff --git a/plugins/legacy-admin/images/assets/color16.jpg b/plugins/legacy-admin/images/assets/color16.jpg new file mode 100644 index 000000000..74f0a3241 Binary files /dev/null and b/plugins/legacy-admin/images/assets/color16.jpg differ diff --git a/plugins/legacy-admin/images/assets/color17.jpg b/plugins/legacy-admin/images/assets/color17.jpg new file mode 100644 index 000000000..dfe794ab8 Binary files /dev/null and b/plugins/legacy-admin/images/assets/color17.jpg differ diff --git a/plugins/legacy-admin/images/assets/color18.jpg b/plugins/legacy-admin/images/assets/color18.jpg new file mode 100644 index 000000000..8cc71b129 Binary files /dev/null and b/plugins/legacy-admin/images/assets/color18.jpg differ diff --git a/plugins/legacy-admin/images/assets/color19.jpg b/plugins/legacy-admin/images/assets/color19.jpg new file mode 100644 index 000000000..2cc412846 Binary files /dev/null and b/plugins/legacy-admin/images/assets/color19.jpg differ diff --git a/plugins/legacy-admin/images/assets/color2.jpg b/plugins/legacy-admin/images/assets/color2.jpg new file mode 100644 index 000000000..9b20ecbb9 Binary files /dev/null and b/plugins/legacy-admin/images/assets/color2.jpg differ diff --git a/plugins/legacy-admin/images/assets/color20.jpg b/plugins/legacy-admin/images/assets/color20.jpg new file mode 100644 index 000000000..1b108ddee Binary files /dev/null and b/plugins/legacy-admin/images/assets/color20.jpg differ diff --git a/plugins/legacy-admin/images/assets/color21.jpg b/plugins/legacy-admin/images/assets/color21.jpg new file mode 100644 index 000000000..b261a24ce Binary files /dev/null and b/plugins/legacy-admin/images/assets/color21.jpg differ diff --git a/plugins/legacy-admin/images/assets/color22.jpg b/plugins/legacy-admin/images/assets/color22.jpg new file mode 100644 index 000000000..7fb3b7e3c Binary files /dev/null and b/plugins/legacy-admin/images/assets/color22.jpg differ diff --git a/plugins/legacy-admin/images/assets/color23.jpg b/plugins/legacy-admin/images/assets/color23.jpg new file mode 100644 index 000000000..ef2c5305b Binary files /dev/null and b/plugins/legacy-admin/images/assets/color23.jpg differ diff --git a/plugins/legacy-admin/images/assets/color24.jpg b/plugins/legacy-admin/images/assets/color24.jpg new file mode 100644 index 000000000..84d29990a Binary files /dev/null and b/plugins/legacy-admin/images/assets/color24.jpg differ diff --git a/plugins/legacy-admin/images/assets/color25.jpg b/plugins/legacy-admin/images/assets/color25.jpg new file mode 100644 index 000000000..cf9413044 Binary files /dev/null and b/plugins/legacy-admin/images/assets/color25.jpg differ diff --git a/plugins/legacy-admin/images/assets/color3.jpg b/plugins/legacy-admin/images/assets/color3.jpg new file mode 100644 index 000000000..e069646b7 Binary files /dev/null and b/plugins/legacy-admin/images/assets/color3.jpg differ diff --git a/plugins/legacy-admin/images/assets/color4.jpg b/plugins/legacy-admin/images/assets/color4.jpg new file mode 100644 index 000000000..3089a99bf Binary files /dev/null and b/plugins/legacy-admin/images/assets/color4.jpg differ diff --git a/plugins/legacy-admin/images/assets/color5.jpg b/plugins/legacy-admin/images/assets/color5.jpg new file mode 100644 index 000000000..74b075790 Binary files /dev/null and b/plugins/legacy-admin/images/assets/color5.jpg differ diff --git a/plugins/legacy-admin/images/assets/color6.jpg b/plugins/legacy-admin/images/assets/color6.jpg new file mode 100644 index 000000000..56b3db08d Binary files /dev/null and b/plugins/legacy-admin/images/assets/color6.jpg differ diff --git a/plugins/legacy-admin/images/assets/color7.jpg b/plugins/legacy-admin/images/assets/color7.jpg new file mode 100644 index 000000000..fec684964 Binary files /dev/null and b/plugins/legacy-admin/images/assets/color7.jpg differ diff --git a/plugins/legacy-admin/images/assets/color8.jpg b/plugins/legacy-admin/images/assets/color8.jpg new file mode 100644 index 000000000..7c7c58af8 Binary files /dev/null and b/plugins/legacy-admin/images/assets/color8.jpg differ diff --git a/plugins/legacy-admin/images/assets/color9.jpg b/plugins/legacy-admin/images/assets/color9.jpg new file mode 100644 index 000000000..92d7f14cf Binary files /dev/null and b/plugins/legacy-admin/images/assets/color9.jpg differ diff --git a/plugins/legacy-admin/images/assets/custom.jpg b/plugins/legacy-admin/images/assets/custom.jpg new file mode 100644 index 000000000..b05bfc492 Binary files /dev/null and b/plugins/legacy-admin/images/assets/custom.jpg differ diff --git a/plugins/legacy-admin/images/favicon.png b/plugins/legacy-admin/images/favicon.png new file mode 100644 index 000000000..3a52281c3 Binary files /dev/null and b/plugins/legacy-admin/images/favicon.png differ diff --git a/plugins/legacy-admin/images/login-bg.png b/plugins/legacy-admin/images/login-bg.png new file mode 100644 index 000000000..739fd4372 Binary files /dev/null and b/plugins/legacy-admin/images/login-bg.png differ diff --git a/plugins/legacy-admin/images/login-logo.png b/plugins/legacy-admin/images/login-logo.png new file mode 100644 index 000000000..d92517d80 Binary files /dev/null and b/plugins/legacy-admin/images/login-logo.png differ diff --git a/plugins/legacy-admin/images/logo-folded.png b/plugins/legacy-admin/images/logo-folded.png new file mode 100644 index 000000000..3c33ca42a Binary files /dev/null and b/plugins/legacy-admin/images/logo-folded.png differ diff --git a/plugins/legacy-admin/images/logo.png b/plugins/legacy-admin/images/logo.png new file mode 100644 index 000000000..fbd00abc5 Binary files /dev/null and b/plugins/legacy-admin/images/logo.png differ diff --git a/plugins/legacy-admin/js/legacy-jquery.ui.elements.js b/plugins/legacy-admin/js/legacy-jquery.ui.elements.js new file mode 100644 index 000000000..6cfe8042a --- /dev/null +++ b/plugins/legacy-admin/js/legacy-jquery.ui.elements.js @@ -0,0 +1,535 @@ +/** + * @Package: WordPress Plugin + * @Subpackage: Legacy - White Label WordPress Admin Theme + * @Since: Legacy 1.0 + * @WordPress Version: 4.0 or above + * This file is part of Legacy - White Label WordPress Admin Theme Plugin. + */ + +/*! jQuery UI - v1.10.4 - 2014-10-19- core*/ +(function(e, t) { + function i(t, i) { + var a, n, r, o = t.nodeName.toLowerCase(); + return"area" === o ? (a = t.parentNode, n = a.name, t.href && n && "map" === a.nodeName.toLowerCase() ? (r = e("img[usemap=#" + n + "]")[0], !!r && s(r)) : !1) : (/input|select|textarea|button|object/.test(o) ? !t.disabled : "a" === o ? t.href || i : i) && s(t) + } + function s(t) { + return e.expr.filters.visible(t) && !e(t).parents().addBack().filter(function() { + return"hidden" === e.css(this, "visibility") + }).length + } + var a = 0, n = /^ui-id-\d+$/; + e.ui = e.ui || {}, e.extend(e.ui, {version: "1.10.4", keyCode: {BACKSPACE: 8, COMMA: 188, DELETE: 46, DOWN: 40, END: 35, ENTER: 13, ESCAPE: 27, HOME: 36, LEFT: 37, NUMPAD_ADD: 107, NUMPAD_DECIMAL: 110, NUMPAD_DIVIDE: 111, NUMPAD_ENTER: 108, NUMPAD_MULTIPLY: 106, NUMPAD_SUBTRACT: 109, PAGE_DOWN: 34, PAGE_UP: 33, PERIOD: 190, RIGHT: 39, SPACE: 32, TAB: 9, UP: 38}}), e.fn.extend({focus: function(t) { + return function(i, s) { + return"number" == typeof i ? this.each(function() { + var t = this; + setTimeout(function() { + e(t).focus(), s && s.call(t) + }, i) + }) : t.apply(this, arguments) + } + }(e.fn.focus), scrollParent: function() { + var t; + return t = e.ui.ie && /(static|relative)/.test(this.css("position")) || /absolute/.test(this.css("position")) ? this.parents().filter(function() { + return/(relative|absolute|fixed)/.test(e.css(this, "position")) && /(auto|scroll)/.test(e.css(this, "overflow") + e.css(this, "overflow-y") + e.css(this, "overflow-x")) + }).eq(0) : this.parents().filter(function() { + return/(auto|scroll)/.test(e.css(this, "overflow") + e.css(this, "overflow-y") + e.css(this, "overflow-x")) + }).eq(0), /fixed/.test(this.css("position")) || !t.length ? e(document) : t + }, zIndex: function(i) { + if (i !== t) + return this.css("zIndex", i); + if (this.length) + for (var s, a, n = e(this[0]); n.length && n[0] !== document; ) { + if (s = n.css("position"), ("absolute" === s || "relative" === s || "fixed" === s) && (a = parseInt(n.css("zIndex"), 10), !isNaN(a) && 0 !== a)) + return a; + n = n.parent() + } + return 0 + }, uniqueId: function() { + return this.each(function() { + this.id || (this.id = "ui-id-" + ++a) + }) + }, removeUniqueId: function() { + return this.each(function() { + n.test(this.id) && e(this).removeAttr("id") + }) + }}), e.extend(e.expr[":"], {data: e.expr.createPseudo ? e.expr.createPseudo(function(t) { + return function(i) { + return!!e.data(i, t) + } + }) : function(t, i, s) { + return!!e.data(t, s[3]) + }, focusable: function(t) { + return i(t, !isNaN(e.attr(t, "tabindex"))) + }, tabbable: function(t) { + var s = e.attr(t, "tabindex"), a = isNaN(s); + return(a || s >= 0) && i(t, !a) + }}), e("").outerWidth(1).jquery || e.each(["Width", "Height"], function(i, s) { + function a(t, i, s, a) { + return e.each(n, function() { + i -= parseFloat(e.css(t, "padding" + this)) || 0, s && (i -= parseFloat(e.css(t, "border" + this + "Width")) || 0), a && (i -= parseFloat(e.css(t, "margin" + this)) || 0) + }), i + } + var n = "Width" === s ? ["Left", "Right"] : ["Top", "Bottom"], r = s.toLowerCase(), o = {innerWidth: e.fn.innerWidth, innerHeight: e.fn.innerHeight, outerWidth: e.fn.outerWidth, outerHeight: e.fn.outerHeight}; + e.fn["inner" + s] = function(i) { + return i === t ? o["inner" + s].call(this) : this.each(function() { + e(this).css(r, a(this, i) + "px") + }) + }, e.fn["outer" + s] = function(t, i) { + return"number" != typeof t ? o["outer" + s].call(this, t) : this.each(function() { + e(this).css(r, a(this, t, !0, i) + "px") + }) + } + }), e.fn.addBack || (e.fn.addBack = function(e) { + return this.add(null == e ? this.prevObject : this.prevObject.filter(e)) + }), e("").data("a-b", "a").removeData("a-b").data("a-b") && (e.fn.removeData = function(t) { + return function(i) { + return arguments.length ? t.call(this, e.camelCase(i)) : t.call(this) + } + }(e.fn.removeData)), e.ui.ie = !!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()), e.support.selectstart = "onselectstart"in document.createElement("div"), e.fn.extend({disableSelection: function() { + return this.bind((e.support.selectstart ? "selectstart" : "mousedown") + ".ui-disableSelection", function(e) { + e.preventDefault() + }) + }, enableSelection: function() { + return this.unbind(".ui-disableSelection") + }}), e.extend(e.ui, {plugin: {add: function(t, i, s) { + var a, n = e.ui[t].prototype; + for (a in s) + n.plugins[a] = n.plugins[a] || [], n.plugins[a].push([i, s[a]]) + }, call: function(e, t, i) { + var s, a = e.plugins[t]; + if (a && e.element[0].parentNode && 11 !== e.element[0].parentNode.nodeType) + for (s = 0; a.length > s; s++) + e.options[a[s][0]] && a[s][1].apply(e.element, i) + }}, hasScroll: function(t, i) { + if ("hidden" === e(t).css("overflow")) + return!1; + var s = i && "left" === i ? "scrollLeft" : "scrollTop", a = !1; + return t[s] > 0 ? !0 : (t[s] = 1, a = t[s] > 0, t[s] = 0, a) + }}) +})(jQuery); + +/*! jQuery UI - v1.10.4 - 2014-10-19 - widget*/ +(function(e, t) { + var i = 0, s = Array.prototype.slice, a = e.cleanData; + e.cleanData = function(t) { + for (var i, s = 0; null != (i = t[s]); s++) + try { + e(i).triggerHandler("remove") + } catch (n) { + } + a(t) + }, e.widget = function(i, s, a) { + var n, r, o, h, l = {}, u = i.split(".")[0]; + i = i.split(".")[1], n = u + "-" + i, a || (a = s, s = e.Widget), e.expr[":"][n.toLowerCase()] = function(t) { + return!!e.data(t, n) + }, e[u] = e[u] || {}, r = e[u][i], o = e[u][i] = function(e, i) { + return this._createWidget ? (arguments.length && this._createWidget(e, i), t) : new o(e, i) + }, e.extend(o, r, {version: a.version, _proto: e.extend({}, a), _childConstructors: []}), h = new s, h.options = e.widget.extend({}, h.options), e.each(a, function(i, a) { + return e.isFunction(a) ? (l[i] = function() { + var e = function() { + return s.prototype[i].apply(this, arguments) + }, t = function(e) { + return s.prototype[i].apply(this, e) + }; + return function() { + var i, s = this._super, n = this._superApply; + return this._super = e, this._superApply = t, i = a.apply(this, arguments), this._super = s, this._superApply = n, i + } + }(), t) : (l[i] = a, t) + }), o.prototype = e.widget.extend(h, {widgetEventPrefix: r ? h.widgetEventPrefix || i : i}, l, {constructor: o, namespace: u, widgetName: i, widgetFullName: n}), r ? (e.each(r._childConstructors, function(t, i) { + var s = i.prototype; + e.widget(s.namespace + "." + s.widgetName, o, i._proto) + }), delete r._childConstructors) : s._childConstructors.push(o), e.widget.bridge(i, o) + }, e.widget.extend = function(i) { + for (var a, n, r = s.call(arguments, 1), o = 0, h = r.length; h > o; o++) + for (a in r[o]) + n = r[o][a], r[o].hasOwnProperty(a) && n !== t && (i[a] = e.isPlainObject(n) ? e.isPlainObject(i[a]) ? e.widget.extend({}, i[a], n) : e.widget.extend({}, n) : n); + return i + }, e.widget.bridge = function(i, a) { + var n = a.prototype.widgetFullName || i; + e.fn[i] = function(r) { + var o = "string" == typeof r, h = s.call(arguments, 1), l = this; + return r = !o && h.length ? e.widget.extend.apply(null, [r].concat(h)) : r, o ? this.each(function() { + var s, a = e.data(this, n); + return a ? e.isFunction(a[r]) && "_" !== r.charAt(0) ? (s = a[r].apply(a, h), s !== a && s !== t ? (l = s && s.jquery ? l.pushStack(s.get()) : s, !1) : t) : e.error("no such method '" + r + "' for " + i + " widget instance") : e.error("cannot call methods on " + i + " prior to initialization; " + "attempted to call method '" + r + "'") + }) : this.each(function() { + var t = e.data(this, n); + t ? t.option(r || {})._init() : e.data(this, n, new a(r, this)) + }), l + } + }, e.Widget = function() { + }, e.Widget._childConstructors = [], e.Widget.prototype = {widgetName: "widget", widgetEventPrefix: "", defaultElement: "
    ", options: {disabled: !1, create: null}, _createWidget: function(t, s) { + s = e(s || this.defaultElement || this)[0], this.element = e(s), this.uuid = i++, this.eventNamespace = "." + this.widgetName + this.uuid, this.options = e.widget.extend({}, this.options, this._getCreateOptions(), t), this.bindings = e(), this.hoverable = e(), this.focusable = e(), s !== this && (e.data(s, this.widgetFullName, this), this._on(!0, this.element, {remove: function(e) { + e.target === s && this.destroy() + }}), this.document = e(s.style ? s.ownerDocument : s.document || s), this.window = e(this.document[0].defaultView || this.document[0].parentWindow)), this._create(), this._trigger("create", null, this._getCreateEventData()), this._init() + }, _getCreateOptions: e.noop, _getCreateEventData: e.noop, _create: e.noop, _init: e.noop, destroy: function() { + this._destroy(), this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)), this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName + "-disabled " + "ui-state-disabled"), this.bindings.unbind(this.eventNamespace), this.hoverable.removeClass("ui-state-hover"), this.focusable.removeClass("ui-state-focus") + }, _destroy: e.noop, widget: function() { + return this.element + }, option: function(i, s) { + var a, n, r, o = i; + if (0 === arguments.length) + return e.widget.extend({}, this.options); + if ("string" == typeof i) + if (o = {}, a = i.split("."), i = a.shift(), a.length) { + for (n = o[i] = e.widget.extend({}, this.options[i]), r = 0; a.length - 1 > r; r++) + n[a[r]] = n[a[r]] || {}, n = n[a[r]]; + if (i = a.pop(), 1 === arguments.length) + return n[i] === t ? null : n[i]; + n[i] = s + } else { + if (1 === arguments.length) + return this.options[i] === t ? null : this.options[i]; + o[i] = s + } + return this._setOptions(o), this + }, _setOptions: function(e) { + var t; + for (t in e) + this._setOption(t, e[t]); + return this + }, _setOption: function(e, t) { + return this.options[e] = t, "disabled" === e && (this.widget().toggleClass(this.widgetFullName + "-disabled ui-state-disabled", !!t).attr("aria-disabled", t), this.hoverable.removeClass("ui-state-hover"), this.focusable.removeClass("ui-state-focus")), this + }, enable: function() { + return this._setOption("disabled", !1) + }, disable: function() { + return this._setOption("disabled", !0) + }, _on: function(i, s, a) { + var n, r = this; + "boolean" != typeof i && (a = s, s = i, i = !1), a ? (s = n = e(s), this.bindings = this.bindings.add(s)) : (a = s, s = this.element, n = this.widget()), e.each(a, function(a, o) { + function h() { + return i || r.options.disabled !== !0 && !e(this).hasClass("ui-state-disabled") ? ("string" == typeof o ? r[o] : o).apply(r, arguments) : t + } + "string" != typeof o && (h.guid = o.guid = o.guid || h.guid || e.guid++); + var l = a.match(/^(\w+)\s*(.*)$/), u = l[1] + r.eventNamespace, d = l[2]; + d ? n.delegate(d, u, h) : s.bind(u, h) + }) + }, _off: function(e, t) { + t = (t || "").split(" ").join(this.eventNamespace + " ") + this.eventNamespace, e.unbind(t).undelegate(t) + }, _delay: function(e, t) { + function i() { + return("string" == typeof e ? s[e] : e).apply(s, arguments) + } + var s = this; + return setTimeout(i, t || 0) + }, _hoverable: function(t) { + this.hoverable = this.hoverable.add(t), this._on(t, {mouseenter: function(t) { + e(t.currentTarget).addClass("ui-state-hover") + }, mouseleave: function(t) { + e(t.currentTarget).removeClass("ui-state-hover") + }}) + }, _focusable: function(t) { + this.focusable = this.focusable.add(t), this._on(t, {focusin: function(t) { + e(t.currentTarget).addClass("ui-state-focus") + }, focusout: function(t) { + e(t.currentTarget).removeClass("ui-state-focus") + }}) + }, _trigger: function(t, i, s) { + var a, n, r = this.options[t]; + if (s = s || {}, i = e.Event(i), i.type = (t === this.widgetEventPrefix ? t : this.widgetEventPrefix + t).toLowerCase(), i.target = this.element[0], n = i.originalEvent) + for (a in n) + a in i || (i[a] = n[a]); + return this.element.trigger(i, s), !(e.isFunction(r) && r.apply(this.element[0], [i].concat(s)) === !1 || i.isDefaultPrevented()) + }}, e.each({show: "fadeIn", hide: "fadeOut"}, function(t, i) { + e.Widget.prototype["_" + t] = function(s, a, n) { + "string" == typeof a && (a = {effect: a}); + var r, o = a ? a === !0 || "number" == typeof a ? i : a.effect || i : t; + a = a || {}, "number" == typeof a && (a = {duration: a}), r = !e.isEmptyObject(a), a.complete = n, a.delay && s.delay(a.delay), r && e.effects && e.effects.effect[o] ? s[t](a) : o !== t && s[o] ? s[o](a.duration, a.easing, n) : s.queue(function(i) { + e(this)[t](), n && n.call(s[0]), i() + }) + } + }) +})(jQuery); + +/*! jQuery UI - v1.10.4 - 2014-10-19 - mouse*/ +(function(e) { + var t = !1; + e(document).mouseup(function() { + t = !1 + }), e.widget("ui.mouse", {version: "1.10.4", options: {cancel: "input,textarea,button,select,option", distance: 1, delay: 0}, _mouseInit: function() { + var t = this; + this.element.bind("mousedown." + this.widgetName, function(e) { + return t._mouseDown(e) + }).bind("click." + this.widgetName, function(i) { + return!0 === e.data(i.target, t.widgetName + ".preventClickEvent") ? (e.removeData(i.target, t.widgetName + ".preventClickEvent"), i.stopImmediatePropagation(), !1) : undefined + }), this.started = !1 + }, _mouseDestroy: function() { + this.element.unbind("." + this.widgetName), this._mouseMoveDelegate && e(document).unbind("mousemove." + this.widgetName, this._mouseMoveDelegate).unbind("mouseup." + this.widgetName, this._mouseUpDelegate) + }, _mouseDown: function(i) { + if (!t) { + this._mouseStarted && this._mouseUp(i), this._mouseDownEvent = i; + var s = this, a = 1 === i.which, n = "string" == typeof this.options.cancel && i.target.nodeName ? e(i.target).closest(this.options.cancel).length : !1; + return a && !n && this._mouseCapture(i) ? (this.mouseDelayMet = !this.options.delay, this.mouseDelayMet || (this._mouseDelayTimer = setTimeout(function() { + s.mouseDelayMet = !0 + }, this.options.delay)), this._mouseDistanceMet(i) && this._mouseDelayMet(i) && (this._mouseStarted = this._mouseStart(i) !== !1, !this._mouseStarted) ? (i.preventDefault(), !0) : (!0 === e.data(i.target, this.widgetName + ".preventClickEvent") && e.removeData(i.target, this.widgetName + ".preventClickEvent"), this._mouseMoveDelegate = function(e) { + return s._mouseMove(e) + }, this._mouseUpDelegate = function(e) { + return s._mouseUp(e) + }, e(document).bind("mousemove." + this.widgetName, this._mouseMoveDelegate).bind("mouseup." + this.widgetName, this._mouseUpDelegate), i.preventDefault(), t = !0, !0)) : !0 + } + }, _mouseMove: function(t) { + return e.ui.ie && (!document.documentMode || 9 > document.documentMode) && !t.button ? this._mouseUp(t) : this._mouseStarted ? (this._mouseDrag(t), t.preventDefault()) : (this._mouseDistanceMet(t) && this._mouseDelayMet(t) && (this._mouseStarted = this._mouseStart(this._mouseDownEvent, t) !== !1, this._mouseStarted ? this._mouseDrag(t) : this._mouseUp(t)), !this._mouseStarted) + }, _mouseUp: function(t) { + return e(document).unbind("mousemove." + this.widgetName, this._mouseMoveDelegate).unbind("mouseup." + this.widgetName, this._mouseUpDelegate), this._mouseStarted && (this._mouseStarted = !1, t.target === this._mouseDownEvent.target && e.data(t.target, this.widgetName + ".preventClickEvent", !0), this._mouseStop(t)), !1 + }, _mouseDistanceMet: function(e) { + return Math.max(Math.abs(this._mouseDownEvent.pageX - e.pageX), Math.abs(this._mouseDownEvent.pageY - e.pageY)) >= this.options.distance + }, _mouseDelayMet: function() { + return this.mouseDelayMet + }, _mouseStart: function() { + }, _mouseDrag: function() { + }, _mouseStop: function() { + }, _mouseCapture: function() { + return!0 + }}) +})(jQuery); + +/*! jQuery UI - v1.10.4 - 2014-10-19 - sortable*/ +(function(e) { + function t(e, t, i) { + return e > t && t + i > e + } + function i(e) { + return/left|right/.test(e.css("float")) || /inline|table-cell/.test(e.css("display")) + } + e.widget("ui.sortable", e.ui.mouse, {version: "1.10.4", widgetEventPrefix: "sort", ready: !1, options: {appendTo: "parent", axis: !1, connectWith: !1, containment: !1, cursor: "auto", cursorAt: !1, dropOnEmpty: !0, forcePlaceholderSize: !1, forceHelperSize: !1, grid: !1, handle: !1, helper: "original", items: "> *", opacity: !1, placeholder: !1, revert: !1, scroll: !0, scrollSensitivity: 20, scrollSpeed: 20, scope: "default", tolerance: "intersect", zIndex: 1e3, activate: null, beforeStop: null, change: null, deactivate: null, out: null, over: null, receive: null, remove: null, sort: null, start: null, stop: null, update: null}, _create: function() { + var e = this.options; + this.containerCache = {}, this.element.addClass("ui-sortable"), this.refresh(), this.floating = this.items.length ? "x" === e.axis || i(this.items[0].item) : !1, this.offset = this.element.offset(), this._mouseInit(), this.ready = !0 + }, _destroy: function() { + this.element.removeClass("ui-sortable ui-sortable-disabled"), this._mouseDestroy(); + for (var e = this.items.length - 1; e >= 0; e--) + this.items[e].item.removeData(this.widgetName + "-item"); + return this + }, _setOption: function(t, i) { + "disabled" === t ? (this.options[t] = i, this.widget().toggleClass("ui-sortable-disabled", !!i)) : e.Widget.prototype._setOption.apply(this, arguments) + }, _mouseCapture: function(t, i) { + var s = null, a = !1, n = this; + return this.reverting ? !1 : this.options.disabled || "static" === this.options.type ? !1 : (this._refreshItems(t), e(t.target).parents().each(function() { + return e.data(this, n.widgetName + "-item") === n ? (s = e(this), !1) : undefined + }), e.data(t.target, n.widgetName + "-item") === n && (s = e(t.target)), s ? !this.options.handle || i || (e(this.options.handle, s).find("*").addBack().each(function() { + this === t.target && (a = !0) + }), a) ? (this.currentItem = s, this._removeCurrentsFromItems(), !0) : !1 : !1) + }, _mouseStart: function(t, i, s) { + var a, n, r = this.options; + if (this.currentContainer = this, this.refreshPositions(), this.helper = this._createHelper(t), this._cacheHelperProportions(), this._cacheMargins(), this.scrollParent = this.helper.scrollParent(), this.offset = this.currentItem.offset(), this.offset = {top: this.offset.top - this.margins.top, left: this.offset.left - this.margins.left}, e.extend(this.offset, {click: {left: t.pageX - this.offset.left, top: t.pageY - this.offset.top}, parent: this._getParentOffset(), relative: this._getRelativeOffset()}), this.helper.css("position", "absolute"), this.cssPosition = this.helper.css("position"), this.originalPosition = this._generatePosition(t), this.originalPageX = t.pageX, this.originalPageY = t.pageY, r.cursorAt && this._adjustOffsetFromHelper(r.cursorAt), this.domPosition = {prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0]}, this.helper[0] !== this.currentItem[0] && this.currentItem.hide(), this._createPlaceholder(), r.containment && this._setContainment(), r.cursor && "auto" !== r.cursor && (n = this.document.find("body"), this.storedCursor = n.css("cursor"), n.css("cursor", r.cursor), this.storedStylesheet = e("").appendTo(n)), r.opacity && (this.helper.css("opacity") && (this._storedOpacity = this.helper.css("opacity")), this.helper.css("opacity", r.opacity)), r.zIndex && (this.helper.css("zIndex") && (this._storedZIndex = this.helper.css("zIndex")), this.helper.css("zIndex", r.zIndex)), this.scrollParent[0] !== document && "HTML" !== this.scrollParent[0].tagName && (this.overflowOffset = this.scrollParent.offset()), this._trigger("start", t, this._uiHash()), this._preserveHelperProportions || this._cacheHelperProportions(), !s) + for (a = this.containers.length - 1; a >= 0; a--) + this.containers[a]._trigger("activate", t, this._uiHash(this)); + return e.ui.ddmanager && (e.ui.ddmanager.current = this), e.ui.ddmanager && !r.dropBehaviour && e.ui.ddmanager.prepareOffsets(this, t), this.dragging = !0, this.helper.addClass("ui-sortable-helper"), this._mouseDrag(t), !0 + }, _mouseDrag: function(t) { + var i, s, a, n, r = this.options, o = !1; + for (this.position = this._generatePosition(t), this.positionAbs = this._convertPositionTo("absolute"), this.lastPositionAbs || (this.lastPositionAbs = this.positionAbs), this.options.scroll && (this.scrollParent[0] !== document && "HTML" !== this.scrollParent[0].tagName?(this.overflowOffset.top + this.scrollParent[0].offsetHeight - t.pageY < r.scrollSensitivity?this.scrollParent[0].scrollTop = o = this.scrollParent[0].scrollTop + r.scrollSpeed:t.pageY - this.overflowOffset.top < r.scrollSensitivity && (this.scrollParent[0].scrollTop = o = this.scrollParent[0].scrollTop - r.scrollSpeed), this.overflowOffset.left + this.scrollParent[0].offsetWidth - t.pageX < r.scrollSensitivity?this.scrollParent[0].scrollLeft = o = this.scrollParent[0].scrollLeft + r.scrollSpeed:t.pageX - this.overflowOffset.left < r.scrollSensitivity && (this.scrollParent[0].scrollLeft = o = this.scrollParent[0].scrollLeft - r.scrollSpeed)):(t.pageY - e(document).scrollTop() < r.scrollSensitivity?o = e(document).scrollTop(e(document).scrollTop() - r.scrollSpeed):e(window).height() - (t.pageY - e(document).scrollTop()) < r.scrollSensitivity && (o = e(document).scrollTop(e(document).scrollTop() + r.scrollSpeed)), t.pageX - e(document).scrollLeft() < r.scrollSensitivity?o = e(document).scrollLeft(e(document).scrollLeft() - r.scrollSpeed):e(window).width() - (t.pageX - e(document).scrollLeft()) < r.scrollSensitivity && (o = e(document).scrollLeft(e(document).scrollLeft() + r.scrollSpeed))), o !== !1 && e.ui.ddmanager && !r.dropBehaviour && e.ui.ddmanager.prepareOffsets(this, t)), this.positionAbs = this._convertPositionTo("absolute"), this.options.axis && "y" === this.options.axis || (this.helper[0].style.left = this.position.left + "px"), this.options.axis && "x" === this.options.axis || (this.helper[0].style.top = this.position.top + "px"), i = this.items.length - 1; i >= 0; i--) + if (s = this.items[i], a = s.item[0], n = this._intersectsWithPointer(s), n && s.instance === this.currentContainer && a !== this.currentItem[0] && this.placeholder[1 === n ? "next" : "prev"]()[0] !== a && !e.contains(this.placeholder[0], a) && ("semi-dynamic" === this.options.type ? !e.contains(this.element[0], a) : !0)) { + if (this.direction = 1 === n ? "down" : "up", "pointer" !== this.options.tolerance && !this._intersectsWithSides(s)) + break; + this._rearrange(t, s), this._trigger("change", t, this._uiHash()); + break + } + return this._contactContainers(t), e.ui.ddmanager && e.ui.ddmanager.drag(this, t), this._trigger("sort", t, this._uiHash()), this.lastPositionAbs = this.positionAbs, !1 + }, _mouseStop: function(t, i) { + if (t) { + if (e.ui.ddmanager && !this.options.dropBehaviour && e.ui.ddmanager.drop(this, t), this.options.revert) { + var s = this, a = this.placeholder.offset(), n = this.options.axis, r = {}; + n && "x" !== n || (r.left = a.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollLeft)), n && "y" !== n || (r.top = a.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollTop)), this.reverting = !0, e(this.helper).animate(r, parseInt(this.options.revert, 10) || 500, function() { + s._clear(t) + }) + } else + this._clear(t, i); + return!1 + } + }, cancel: function() { + if (this.dragging) { + this._mouseUp({target: null}), "original" === this.options.helper ? this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper") : this.currentItem.show(); + for (var t = this.containers.length - 1; t >= 0; t--) + this.containers[t]._trigger("deactivate", null, this._uiHash(this)), this.containers[t].containerCache.over && (this.containers[t]._trigger("out", null, this._uiHash(this)), this.containers[t].containerCache.over = 0) + } + return this.placeholder && (this.placeholder[0].parentNode && this.placeholder[0].parentNode.removeChild(this.placeholder[0]), "original" !== this.options.helper && this.helper && this.helper[0].parentNode && this.helper.remove(), e.extend(this, {helper: null, dragging: !1, reverting: !1, _noFinalSort: null}), this.domPosition.prev ? e(this.domPosition.prev).after(this.currentItem) : e(this.domPosition.parent).prepend(this.currentItem)), this + }, serialize: function(t) { + var i = this._getItemsAsjQuery(t && t.connected), s = []; + return t = t || {}, e(i).each(function() { + var i = (e(t.item || this).attr(t.attribute || "id") || "").match(t.expression || /(.+)[\-=_](.+)/); + i && s.push((t.key || i[1] + "[]") + "=" + (t.key && t.expression ? i[1] : i[2])) + }), !s.length && t.key && s.push(t.key + "="), s.join("&") + }, toArray: function(t) { + var i = this._getItemsAsjQuery(t && t.connected), s = []; + return t = t || {}, i.each(function() { + s.push(e(t.item || this).attr(t.attribute || "id") || "") + }), s + }, _intersectsWith: function(e) { + var t = this.positionAbs.left, i = t + this.helperProportions.width, s = this.positionAbs.top, a = s + this.helperProportions.height, n = e.left, r = n + e.width, o = e.top, h = o + e.height, l = this.offset.click.top, u = this.offset.click.left, d = "x" === this.options.axis || s + l > o && h > s + l, c = "y" === this.options.axis || t + u > n && r > t + u, p = d && c; + return"pointer" === this.options.tolerance || this.options.forcePointerForContainers || "pointer" !== this.options.tolerance && this.helperProportions[this.floating ? "width" : "height"] > e[this.floating ? "width" : "height"] ? p : t + this.helperProportions.width / 2 > n && r > i - this.helperProportions.width / 2 && s + this.helperProportions.height / 2 > o && h > a - this.helperProportions.height / 2 + }, _intersectsWithPointer: function(e) { + var i = "x" === this.options.axis || t(this.positionAbs.top + this.offset.click.top, e.top, e.height), s = "y" === this.options.axis || t(this.positionAbs.left + this.offset.click.left, e.left, e.width), a = i && s, n = this._getDragVerticalDirection(), r = this._getDragHorizontalDirection(); + return a ? this.floating ? r && "right" === r || "down" === n ? 2 : 1 : n && ("down" === n ? 2 : 1) : !1 + }, _intersectsWithSides: function(e) { + var i = t(this.positionAbs.top + this.offset.click.top, e.top + e.height / 2, e.height), s = t(this.positionAbs.left + this.offset.click.left, e.left + e.width / 2, e.width), a = this._getDragVerticalDirection(), n = this._getDragHorizontalDirection(); + return this.floating && n ? "right" === n && s || "left" === n && !s : a && ("down" === a && i || "up" === a && !i) + }, _getDragVerticalDirection: function() { + var e = this.positionAbs.top - this.lastPositionAbs.top; + return 0 !== e && (e > 0 ? "down" : "up") + }, _getDragHorizontalDirection: function() { + var e = this.positionAbs.left - this.lastPositionAbs.left; + return 0 !== e && (e > 0 ? "right" : "left") + }, refresh: function(e) { + return this._refreshItems(e), this.refreshPositions(), this + }, _connectWith: function() { + var e = this.options; + return e.connectWith.constructor === String ? [e.connectWith] : e.connectWith + }, _getItemsAsjQuery: function(t) { + function i() { + o.push(this) + } + var s, a, n, r, o = [], h = [], l = this._connectWith(); + if (l && t) + for (s = l.length - 1; s >= 0; s--) + for (n = e(l[s]), a = n.length - 1; a >= 0; a--) + r = e.data(n[a], this.widgetFullName), r && r !== this && !r.options.disabled && h.push([e.isFunction(r.options.items) ? r.options.items.call(r.element) : e(r.options.items, r.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), r]); + for (h.push([e.isFunction(this.options.items)?this.options.items.call(this.element, null, {options:this.options, item:this.currentItem}):e(this.options.items, this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), this]), s = h.length - 1; s >= 0; s--) + h[s][0].each(i); + return e(o) + }, _removeCurrentsFromItems: function() { + var t = this.currentItem.find(":data(" + this.widgetName + "-item)"); + this.items = e.grep(this.items, function(e) { + for (var i = 0; t.length > i; i++) + if (t[i] === e.item[0]) + return!1; + return!0 + }) + }, _refreshItems: function(t) { + this.items = [], this.containers = [this]; + var i, s, a, n, r, o, h, l, u = this.items, d = [[e.isFunction(this.options.items) ? this.options.items.call(this.element[0], t, {item: this.currentItem}) : e(this.options.items, this.element), this]], c = this._connectWith(); + if (c && this.ready) + for (i = c.length - 1; i >= 0; i--) + for (a = e(c[i]), s = a.length - 1; s >= 0; s--) + n = e.data(a[s], this.widgetFullName), n && n !== this && !n.options.disabled && (d.push([e.isFunction(n.options.items) ? n.options.items.call(n.element[0], t, {item: this.currentItem}) : e(n.options.items, n.element), n]), this.containers.push(n)); + for (i = d.length - 1; i >= 0; i--) + for (r = d[i][1], o = d[i][0], s = 0, l = o.length; l > s; s++) + h = e(o[s]), h.data(this.widgetName + "-item", r), u.push({item: h, instance: r, width: 0, height: 0, left: 0, top: 0}) + }, refreshPositions: function(t) { + this.offsetParent && this.helper && (this.offset.parent = this._getParentOffset()); + var i, s, a, n; + for (i = this.items.length - 1; i >= 0; i--) + s = this.items[i], s.instance !== this.currentContainer && this.currentContainer && s.item[0] !== this.currentItem[0] || (a = this.options.toleranceElement ? e(this.options.toleranceElement, s.item) : s.item, t || (s.width = a.outerWidth(), s.height = a.outerHeight()), n = a.offset(), s.left = n.left, s.top = n.top); + if (this.options.custom && this.options.custom.refreshContainers) + this.options.custom.refreshContainers.call(this); + else + for (i = this.containers.length - 1; i >= 0; i--) + n = this.containers[i].element.offset(), this.containers[i].containerCache.left = n.left, this.containers[i].containerCache.top = n.top, this.containers[i].containerCache.width = this.containers[i].element.outerWidth(), this.containers[i].containerCache.height = this.containers[i].element.outerHeight(); + return this + }, _createPlaceholder: function(t) { + t = t || this; + var i, s = t.options; + s.placeholder && s.placeholder.constructor !== String || (i = s.placeholder, s.placeholder = {element: function() { + var s = t.currentItem[0].nodeName.toLowerCase(), a = e("<" + s + ">", t.document[0]).addClass(i || t.currentItem[0].className + " ui-sortable-placeholder").removeClass("ui-sortable-helper"); + return"tr" === s ? t.currentItem.children().each(function() { + e(" ", t.document[0]).attr("colspan", e(this).attr("colspan") || 1).appendTo(a) + }) : "img" === s && a.attr("src", t.currentItem.attr("src")), i || a.css("visibility", "hidden"), a + }, update: function(e, a) { + (!i || s.forcePlaceholderSize) && (a.height() || a.height(t.currentItem.innerHeight() - parseInt(t.currentItem.css("paddingTop") || 0, 10) - parseInt(t.currentItem.css("paddingBottom") || 0, 10)), a.width() || a.width(t.currentItem.innerWidth() - parseInt(t.currentItem.css("paddingLeft") || 0, 10) - parseInt(t.currentItem.css("paddingRight") || 0, 10))) + }}), t.placeholder = e(s.placeholder.element.call(t.element, t.currentItem)), t.currentItem.after(t.placeholder), s.placeholder.update(t, t.placeholder) + }, _contactContainers: function(s) { + var a, n, r, o, h, l, u, d, c, p, f = null, m = null; + for (a = this.containers.length - 1; a >= 0; a--) + if (!e.contains(this.currentItem[0], this.containers[a].element[0])) + if (this._intersectsWith(this.containers[a].containerCache)) { + if (f && e.contains(this.containers[a].element[0], f.element[0])) + continue; + f = this.containers[a], m = a + } else + this.containers[a].containerCache.over && (this.containers[a]._trigger("out", s, this._uiHash(this)), this.containers[a].containerCache.over = 0); + if (f) + if (1 === this.containers.length) + this.containers[m].containerCache.over || (this.containers[m]._trigger("over", s, this._uiHash(this)), this.containers[m].containerCache.over = 1); + else { + for (r = 1e4, o = null, p = f.floating || i(this.currentItem), h = p?"left":"top", l = p?"width":"height", u = this.positionAbs[h] + this.offset.click[h], n = this.items.length - 1; n >= 0; n--) + e.contains(this.containers[m].element[0], this.items[n].item[0]) && this.items[n].item[0] !== this.currentItem[0] && (!p || t(this.positionAbs.top + this.offset.click.top, this.items[n].top, this.items[n].height)) && (d = this.items[n].item.offset()[h], c = !1, Math.abs(d - u) > Math.abs(d + this.items[n][l] - u) && (c = !0, d += this.items[n][l]), r > Math.abs(d - u) && (r = Math.abs(d - u), o = this.items[n], this.direction = c ? "up" : "down")); + if (!o && !this.options.dropOnEmpty) + return; + if (this.currentContainer === this.containers[m]) + return; + o ? this._rearrange(s, o, null, !0) : this._rearrange(s, null, this.containers[m].element, !0), this._trigger("change", s, this._uiHash()), this.containers[m]._trigger("change", s, this._uiHash(this)), this.currentContainer = this.containers[m], this.options.placeholder.update(this.currentContainer, this.placeholder), this.containers[m]._trigger("over", s, this._uiHash(this)), this.containers[m].containerCache.over = 1 + } + }, _createHelper: function(t) { + var i = this.options, s = e.isFunction(i.helper) ? e(i.helper.apply(this.element[0], [t, this.currentItem])) : "clone" === i.helper ? this.currentItem.clone() : this.currentItem; + return s.parents("body").length || e("parent" !== i.appendTo ? i.appendTo : this.currentItem[0].parentNode)[0].appendChild(s[0]), s[0] === this.currentItem[0] && (this._storedCSS = {width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css("position"), top: this.currentItem.css("top"), left: this.currentItem.css("left")}), (!s[0].style.width || i.forceHelperSize) && s.width(this.currentItem.width()), (!s[0].style.height || i.forceHelperSize) && s.height(this.currentItem.height()), s + }, _adjustOffsetFromHelper: function(t) { + "string" == typeof t && (t = t.split(" ")), e.isArray(t) && (t = {left: +t[0], top: +t[1] || 0}), "left"in t && (this.offset.click.left = t.left + this.margins.left), "right"in t && (this.offset.click.left = this.helperProportions.width - t.right + this.margins.left), "top"in t && (this.offset.click.top = t.top + this.margins.top), "bottom"in t && (this.offset.click.top = this.helperProportions.height - t.bottom + this.margins.top) + }, _getParentOffset: function() { + this.offsetParent = this.helper.offsetParent(); + var t = this.offsetParent.offset(); + return"absolute" === this.cssPosition && this.scrollParent[0] !== document && e.contains(this.scrollParent[0], this.offsetParent[0]) && (t.left += this.scrollParent.scrollLeft(), t.top += this.scrollParent.scrollTop()), (this.offsetParent[0] === document.body || this.offsetParent[0].tagName && "html" === this.offsetParent[0].tagName.toLowerCase() && e.ui.ie) && (t = {top: 0, left: 0}), {top: t.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0), left: t.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0)} + }, _getRelativeOffset: function() { + if ("relative" === this.cssPosition) { + var e = this.currentItem.position(); + return{top: e.top - (parseInt(this.helper.css("top"), 10) || 0) + this.scrollParent.scrollTop(), left: e.left - (parseInt(this.helper.css("left"), 10) || 0) + this.scrollParent.scrollLeft()} + } + return{top: 0, left: 0} + }, _cacheMargins: function() { + this.margins = {left: parseInt(this.currentItem.css("marginLeft"), 10) || 0, top: parseInt(this.currentItem.css("marginTop"), 10) || 0} + }, _cacheHelperProportions: function() { + this.helperProportions = {width: this.helper.outerWidth(), height: this.helper.outerHeight()} + }, _setContainment: function() { + var t, i, s, a = this.options; + "parent" === a.containment && (a.containment = this.helper[0].parentNode), ("document" === a.containment || "window" === a.containment) && (this.containment = [0 - this.offset.relative.left - this.offset.parent.left, 0 - this.offset.relative.top - this.offset.parent.top, e("document" === a.containment ? document : window).width() - this.helperProportions.width - this.margins.left, (e("document" === a.containment ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top]), /^(document|window|parent)$/.test(a.containment) || (t = e(a.containment)[0], i = e(a.containment).offset(), s = "hidden" !== e(t).css("overflow"), this.containment = [i.left + (parseInt(e(t).css("borderLeftWidth"), 10) || 0) + (parseInt(e(t).css("paddingLeft"), 10) || 0) - this.margins.left, i.top + (parseInt(e(t).css("borderTopWidth"), 10) || 0) + (parseInt(e(t).css("paddingTop"), 10) || 0) - this.margins.top, i.left + (s ? Math.max(t.scrollWidth, t.offsetWidth) : t.offsetWidth) - (parseInt(e(t).css("borderLeftWidth"), 10) || 0) - (parseInt(e(t).css("paddingRight"), 10) || 0) - this.helperProportions.width - this.margins.left, i.top + (s ? Math.max(t.scrollHeight, t.offsetHeight) : t.offsetHeight) - (parseInt(e(t).css("borderTopWidth"), 10) || 0) - (parseInt(e(t).css("paddingBottom"), 10) || 0) - this.helperProportions.height - this.margins.top]) + }, _convertPositionTo: function(t, i) { + i || (i = this.position); + var s = "absolute" === t ? 1 : -1, a = "absolute" !== this.cssPosition || this.scrollParent[0] !== document && e.contains(this.scrollParent[0], this.offsetParent[0]) ? this.scrollParent : this.offsetParent, n = /(html|body)/i.test(a[0].tagName); + return{top: i.top + this.offset.relative.top * s + this.offset.parent.top * s - ("fixed" === this.cssPosition ? -this.scrollParent.scrollTop() : n ? 0 : a.scrollTop()) * s, left: i.left + this.offset.relative.left * s + this.offset.parent.left * s - ("fixed" === this.cssPosition ? -this.scrollParent.scrollLeft() : n ? 0 : a.scrollLeft()) * s} + }, _generatePosition: function(t) { + var i, s, a = this.options, n = t.pageX, r = t.pageY, o = "absolute" !== this.cssPosition || this.scrollParent[0] !== document && e.contains(this.scrollParent[0], this.offsetParent[0]) ? this.scrollParent : this.offsetParent, h = /(html|body)/i.test(o[0].tagName); + return"relative" !== this.cssPosition || this.scrollParent[0] !== document && this.scrollParent[0] !== this.offsetParent[0] || (this.offset.relative = this._getRelativeOffset()), this.originalPosition && (this.containment && (t.pageX - this.offset.click.left < this.containment[0] && (n = this.containment[0] + this.offset.click.left), t.pageY - this.offset.click.top < this.containment[1] && (r = this.containment[1] + this.offset.click.top), t.pageX - this.offset.click.left > this.containment[2] && (n = this.containment[2] + this.offset.click.left), t.pageY - this.offset.click.top > this.containment[3] && (r = this.containment[3] + this.offset.click.top)), a.grid && (i = this.originalPageY + Math.round((r - this.originalPageY) / a.grid[1]) * a.grid[1], r = this.containment ? i - this.offset.click.top >= this.containment[1] && i - this.offset.click.top <= this.containment[3] ? i : i - this.offset.click.top >= this.containment[1] ? i - a.grid[1] : i + a.grid[1] : i, s = this.originalPageX + Math.round((n - this.originalPageX) / a.grid[0]) * a.grid[0], n = this.containment ? s - this.offset.click.left >= this.containment[0] && s - this.offset.click.left <= this.containment[2] ? s : s - this.offset.click.left >= this.containment[0] ? s - a.grid[0] : s + a.grid[0] : s)), {top: r - this.offset.click.top - this.offset.relative.top - this.offset.parent.top + ("fixed" === this.cssPosition ? -this.scrollParent.scrollTop() : h ? 0 : o.scrollTop()), left: n - this.offset.click.left - this.offset.relative.left - this.offset.parent.left + ("fixed" === this.cssPosition ? -this.scrollParent.scrollLeft() : h ? 0 : o.scrollLeft())} + }, _rearrange: function(e, t, i, s) { + i ? i[0].appendChild(this.placeholder[0]) : t.item[0].parentNode.insertBefore(this.placeholder[0], "down" === this.direction ? t.item[0] : t.item[0].nextSibling), this.counter = this.counter ? ++this.counter : 1; + var a = this.counter; + this._delay(function() { + a === this.counter && this.refreshPositions(!s) + }) + }, _clear: function(e, t) { + function i(e, t, i) { + return function(s) { + i._trigger(e, s, t._uiHash(t)) + } + } + this.reverting = !1; + var s, a = []; + if (!this._noFinalSort && this.currentItem.parent().length && this.placeholder.before(this.currentItem), this._noFinalSort = null, this.helper[0] === this.currentItem[0]) { + for (s in this._storedCSS) + ("auto" === this._storedCSS[s] || "static" === this._storedCSS[s]) && (this._storedCSS[s] = ""); + this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper") + } else + this.currentItem.show(); + for (this.fromOutside && !t && a.push(function(e) { + this._trigger("receive", e, this._uiHash(this.fromOutside)) + }), !this.fromOutside && this.domPosition.prev === this.currentItem.prev().not(".ui-sortable-helper")[0] && this.domPosition.parent === this.currentItem.parent()[0] || t || a.push(function(e) { + this._trigger("update", e, this._uiHash()) + }), this !== this.currentContainer && (t || (a.push(function(e) { + this._trigger("remove", e, this._uiHash()) + }), a.push(function(e) { + return function(t) { + e._trigger("receive", t, this._uiHash(this)) + } + }.call(this, this.currentContainer)), a.push(function(e) { + return function(t) { + e._trigger("update", t, this._uiHash(this)) + } + }.call(this, this.currentContainer)))), s = this.containers.length - 1; s >= 0; s--) + t || a.push(i("deactivate", this, this.containers[s])), this.containers[s].containerCache.over && (a.push(i("out", this, this.containers[s])), this.containers[s].containerCache.over = 0); + if (this.storedCursor && (this.document.find("body").css("cursor", this.storedCursor), this.storedStylesheet.remove()), this._storedOpacity && this.helper.css("opacity", this._storedOpacity), this._storedZIndex && this.helper.css("zIndex", "auto" === this._storedZIndex ? "" : this._storedZIndex), this.dragging = !1, this.cancelHelperRemoval) { + if (!t) { + for (this._trigger("beforeStop", e, this._uiHash()), s = 0; a.length > s; s++) + a[s].call(this, e); + this._trigger("stop", e, this._uiHash()) + } + return this.fromOutside = !1, !1 + } + if (t || this._trigger("beforeStop", e, this._uiHash()), this.placeholder[0].parentNode.removeChild(this.placeholder[0]), this.helper[0] !== this.currentItem[0] && this.helper.remove(), this.helper = null, !t) { + for (s = 0; a.length > s; s++) + a[s].call(this, e); + this._trigger("stop", e, this._uiHash()) + } + return this.fromOutside = !1, !0 + }, _trigger: function() { + e.Widget.prototype._trigger.apply(this, arguments) === !1 && this.cancel() + }, _uiHash: function(t) { + var i = t || this; + return{helper: i.helper, placeholder: i.placeholder || e([]), position: i.position, originalPosition: i.originalPosition, offset: i.positionAbs, item: i.currentItem, sender: t ? t.element : null} + }}) +})(jQuery); diff --git a/plugins/legacy-admin/js/legacy-login-scripts.js b/plugins/legacy-admin/js/legacy-login-scripts.js new file mode 100644 index 000000000..e31507a25 --- /dev/null +++ b/plugins/legacy-admin/js/legacy-login-scripts.js @@ -0,0 +1,41 @@ +/** + * @Package: WordPress Plugin + * @Subpackage: Legacy - White Label WordPress Admin Theme + * @Since: Legacy 1.0 + * @WordPress Version: 4.0 or above + * This file is part of Legacy - White Label WordPress Admin Theme Plugin. + */ + + +jQuery(function($) { + + 'use strict'; + + var LEGACY_LOGIN_SETTINGS = window.LEGACY_LOGIN_SETTINGS || {}; + + + LEGACY_LOGIN_SETTINGS.placeholderFields = function() { + + $('#user_login').attr('placeholder', 'Username'); + $('#user_email').attr('placeholder', 'Email'); + $('#user_pass').attr('placeholder', 'Password'); + + }; + + + + /****************************** + initialize respective scripts + *****************************/ + $(document).ready(function() { + LEGACY_LOGIN_SETTINGS.placeholderFields(); + + }); + + $(window).resize(function() { + }); + + $(window).load(function() { + }); + +}); \ No newline at end of file diff --git a/plugins/legacy-admin/js/legacy-pace-script.js b/plugins/legacy-admin/js/legacy-pace-script.js new file mode 100644 index 000000000..d31a5d840 --- /dev/null +++ b/plugins/legacy-admin/js/legacy-pace-script.js @@ -0,0 +1,21 @@ +/** + * @Package: WordPress Plugin + * @Subpackage: Legacy - White Label WordPress Admin Theme + * @Since: Legacy 1.0 + * @WordPress Version: 4.0 or above + * This file is part of Legacy - White Label WordPress Admin Theme Plugin. + */ + + +/*---------------------------------- + Page loader + -----------------------------------*/ + +(function($) { + Pace.on('start', function() { + }); + Pace.on('hide', function() { + $("#wpwrap").addClass("loaded"); + }); +})(jQuery); + diff --git a/plugins/legacy-admin/js/legacy-pace.min.js b/plugins/legacy-admin/js/legacy-pace.min.js new file mode 100644 index 000000000..1a2f0d500 --- /dev/null +++ b/plugins/legacy-admin/js/legacy-pace.min.js @@ -0,0 +1,352 @@ +/** + * @Package: WordPress Plugin + * @Subpackage: Legacy - White Label WordPress Admin Theme + * @Since: Legacy 1.0 + * @WordPress Version: 4.0 or above + * This file is part of Legacy - White Label WordPress Admin Theme Plugin. + */ +/*! pace 0.5.6 */ +(function() { + var a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W = [].slice, X = {}.hasOwnProperty, Y = function(a, b) { + function c() { + this.constructor = a + } + for (var d in b) + X.call(b, d) && (a[d] = b[d]); + return c.prototype = b.prototype, a.prototype = new c, a.__super__ = b.prototype, a + }, Z = [].indexOf || function(a) { + for (var b = 0, c = this.length; c > b; b++) + if (b in this && this[b] === a) + return b; + return-1 + }; + for (t = {catchupTime:500, initialRate:.03, minTime:500, ghostTime:500, maxProgressPerFrame:10, easeFactor:1.25, startOnPageLoad:!0, restartOnPushState:!0, restartOnRequestAfter:500, target:"body", elements:{checkInterval:100, selectors:["body"]}, eventLag:{minSamples:10, sampleCount:3, lagThreshold:3}, ajax:{trackMethods:["GET"], trackWebSockets:!0, ignoreURLs:[]}}, B = function() { + var a; + return null != (a = "undefined" != typeof performance && null !== performance && "function" == typeof performance.now ? performance.now() : void 0) ? a : +new Date + }, D = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame, s = window.cancelAnimationFrame || window.mozCancelAnimationFrame, null == D && (D = function(a) { + return setTimeout(a, 50) + }, s = function(a) { + return clearTimeout(a) + }), F = function(a) { + var b, c; + return b = B(), (c = function() { + var d; + return d = B() - b, d >= 33 ? (b = B(), a(d, function() { + return D(c) + })) : setTimeout(c, 33 - d) + })() + }, E = function() { + var a, b, c; + return c = arguments[0], b = arguments[1], a = 3 <= arguments.length ? W.call(arguments, 2) : [], "function" == typeof c[b] ? c[b].apply(c, a) : c[b] + }, u = function() { + var a, b, c, d, e, f, g; + for (b = arguments[0], d = 2 <= arguments.length?W.call(arguments, 1):[], f = 0, g = d.length; g > f; f++) + if (c = d[f]) + for (a in c) + X.call(c, a) && (e = c[a], null != b[a] && "object" == typeof b[a] && null != e && "object" == typeof e ? u(b[a], e) : b[a] = e); + return b + }, p = function(a) { + var b, c, d, e, f; + for (c = b = 0, e = 0, f = a.length; f > e; e++) + d = a[e], c += Math.abs(d), b++; + return c / b + }, w = function(a, b) { + var c, d, e; + if (null == a && (a = "options"), null == b && (b = !0), e = document.querySelector("[data-pace-" + a + "]")) { + if (c = e.getAttribute("data-pace-" + a), !b) + return c; + try { + return JSON.parse(c) + } catch (f) { + return d = f, "undefined" != typeof console && null !== console ? console.error("Error parsing inline pace options", d) : void 0 + } + } + }, g = function() { + function a() { + } + return a.prototype.on = function(a, b, c, d) { + var e; + return null == d && (d = !1), null == this.bindings && (this.bindings = {}), null == (e = this.bindings)[a] && (e[a] = []), this.bindings[a].push({handler: b, ctx: c, once: d}) + }, a.prototype.once = function(a, b, c) { + return this.on(a, b, c, !0) + }, a.prototype.off = function(a, b) { + var c, d, e; + if (null != (null != (d = this.bindings) ? d[a] : void 0)) { + if (null == b) + return delete this.bindings[a]; + for (c = 0, e = []; c < this.bindings[a].length; ) + e.push(this.bindings[a][c].handler === b ? this.bindings[a].splice(c, 1) : c++); + return e + } + }, a.prototype.trigger = function() { + var a, b, c, d, e, f, g, h, i; + if (c = arguments[0], a = 2 <= arguments.length ? W.call(arguments, 1) : [], null != (g = this.bindings) ? g[c] : void 0) { + for (e = 0, i = []; e < this.bindings[c].length; ) + h = this.bindings[c][e], d = h.handler, b = h.ctx, f = h.once, d.apply(null != b ? b : this, a), i.push(f ? this.bindings[c].splice(e, 1) : e++); + return i + } + }, a + }(), null == window.Pace && (window.Pace = {}), u(Pace, g.prototype), C = Pace.options = u({}, t, window.paceOptions, w()), T = ["ajax", "document", "eventLag", "elements"], P = 0, R = T.length; R > P; P++) + J = T[P], C[J] === !0 && (C[J] = t[J]); + i = function(a) { + function b() { + return U = b.__super__.constructor.apply(this, arguments) + } + return Y(b, a), b + }(Error), b = function() { + function a() { + this.progress = 0 + } + return a.prototype.getElement = function() { + var a; + if (null == this.el) { + if (a = document.querySelector(C.target), !a) + throw new i; + this.el = document.createElement("div"), this.el.className = "pace pace-active", document.body.className = document.body.className.replace(/pace-done/g, ""), document.body.className += " pace-running", this.el.innerHTML = '
    \n
    \n
    \n
    ', null != a.firstChild ? a.insertBefore(this.el, a.firstChild) : a.appendChild(this.el) + } + return this.el + }, a.prototype.finish = function() { + var a; + return a = this.getElement(), a.className = a.className.replace("pace-active", ""), a.className += " pace-inactive", document.body.className = document.body.className.replace("pace-running", ""), document.body.className += " pace-done" + }, a.prototype.update = function(a) { + return this.progress = a, this.render() + }, a.prototype.destroy = function() { + try { + this.getElement().parentNode.removeChild(this.getElement()) + } catch (a) { + i = a + } + return this.el = void 0 + }, a.prototype.render = function() { + var a, b; + return null == document.querySelector(C.target) ? !1 : (a = this.getElement(), a.children[0].style.width = "" + this.progress + "%", (!this.lastRenderedProgress || this.lastRenderedProgress | 0 !== this.progress | 0) && (a.children[0].setAttribute("data-progress-text", "" + (0 | this.progress) + "%"), this.progress >= 100 ? b = "99" : (b = this.progress < 10 ? "0" : "", b += 0 | this.progress), a.children[0].setAttribute("data-progress", "" + b)), this.lastRenderedProgress = this.progress) + }, a.prototype.done = function() { + return this.progress >= 100 + }, a + }(), h = function() { + function a() { + this.bindings = {} + } + return a.prototype.trigger = function(a, b) { + var c, d, e, f, g; + if (null != this.bindings[a]) { + for (f = this.bindings[a], g = [], d = 0, e = f.length; e > d; d++) + c = f[d], g.push(c.call(this, b)); + return g + } + }, a.prototype.on = function(a, b) { + var c; + return null == (c = this.bindings)[a] && (c[a] = []), this.bindings[a].push(b) + }, a + }(), O = window.XMLHttpRequest, N = window.XDomainRequest, M = window.WebSocket, v = function(a, b) { + var c, d, e, f; + f = []; + for (d in b.prototype) + try { + e = b.prototype[d], f.push(null == a[d] && "function" != typeof e ? a[d] = e : void 0) + } catch (g) { + c = g + } + return f + }, z = [], Pace.ignore = function() { + var a, b, c; + return b = arguments[0], a = 2 <= arguments.length ? W.call(arguments, 1) : [], z.unshift("ignore"), c = b.apply(null, a), z.shift(), c + }, Pace.track = function() { + var a, b, c; + return b = arguments[0], a = 2 <= arguments.length ? W.call(arguments, 1) : [], z.unshift("track"), c = b.apply(null, a), z.shift(), c + }, I = function(a) { + var b; + if (null == a && (a = "GET"), "track" === z[0]) + return"force"; + if (!z.length && C.ajax) { + if ("socket" === a && C.ajax.trackWebSockets) + return!0; + if (b = a.toUpperCase(), Z.call(C.ajax.trackMethods, b) >= 0) + return!0 + } + return!1 + }, j = function(a) { + function b() { + var a, c = this; + b.__super__.constructor.apply(this, arguments), a = function(a) { + var b; + return b = a.open, a.open = function(d, e) { + return I(d) && c.trigger("request", {type: d, url: e, request: a}), b.apply(a, arguments) + } + }, window.XMLHttpRequest = function(b) { + var c; + return c = new O(b), a(c), c + }; + try { + v(window.XMLHttpRequest, O) + } catch (d) { + } + if (null != N) { + window.XDomainRequest = function() { + var b; + return b = new N, a(b), b + }; + try { + v(window.XDomainRequest, N) + } catch (d) { + } + } + if (null != M && C.ajax.trackWebSockets) { + window.WebSocket = function(a, b) { + var d; + return d = null != b ? new M(a, b) : new M(a), I("socket") && c.trigger("request", {type: "socket", url: a, protocols: b, request: d}), d + }; + try { + v(window.WebSocket, M) + } catch (d) { + } + } + } + return Y(b, a), b + }(h), Q = null, x = function() { + return null == Q && (Q = new j), Q + }, H = function(a) { + var b, c, d, e; + for (e = C.ajax.ignoreURLs, c = 0, d = e.length; d > c; c++) + if (b = e[c], "string" == typeof b) { + if (-1 !== a.indexOf(b)) + return!0 + } else if (b.test(a)) + return!0; + return!1 + }, x().on("request", function(b) { + var c, d, e, f, g; + return f = b.type, e = b.request, g = b.url, H(g) ? void 0 : Pace.running || C.restartOnRequestAfter === !1 && "force" !== I(f) ? void 0 : (d = arguments, c = C.restartOnRequestAfter || 0, "boolean" == typeof c && (c = 0), setTimeout(function() { + var b, c, g, h, i, j; + if (b = "socket" === f ? e.readyState < 2 : 0 < (h = e.readyState) && 4 > h) { + for (Pace.restart(), i = Pace.sources, j = [], c = 0, g = i.length; g > c; c++) { + if (J = i[c], J instanceof a) { + J.watch.apply(J, d); + break + } + j.push(void 0) + } + return j + } + }, c)) + }), a = function() { + function a() { + var a = this; + this.elements = [], x().on("request", function() { + return a.watch.apply(a, arguments) + }) + } + return a.prototype.watch = function(a) { + var b, c, d, e; + return d = a.type, b = a.request, e = a.url, H(e) ? void 0 : (c = "socket" === d ? new m(b) : new n(b), this.elements.push(c)) + }, a + }(), n = function() { + function a(a) { + var b, c, d, e, f, g, h = this; + if (this.progress = 0, null != window.ProgressEvent) + for (c = null, a.addEventListener("progress", function(a) { + return h.progress = a.lengthComputable ? 100 * a.loaded / a.total : h.progress + (100 - h.progress) / 2 + }), g = ["load", "abort", "timeout", "error"], d = 0, e = g.length; e > d; d++) + b = g[d], a.addEventListener(b, function() { + return h.progress = 100 + }); + else + f = a.onreadystatechange, a.onreadystatechange = function() { + var b; + return 0 === (b = a.readyState) || 4 === b ? h.progress = 100 : 3 === a.readyState && (h.progress = 50), "function" == typeof f ? f.apply(null, arguments) : void 0 + } + } + return a + }(), m = function() { + function a(a) { + var b, c, d, e, f = this; + for (this.progress = 0, e = ["error", "open"], c = 0, d = e.length; d > c; c++) + b = e[c], a.addEventListener(b, function() { + return f.progress = 100 + }) + } + return a + }(), d = function() { + function a(a) { + var b, c, d, f; + for (null == a && (a = {}), this.elements = [], null == a.selectors && (a.selectors = []), f = a.selectors, c = 0, d = f.length; d > c; c++) + b = f[c], this.elements.push(new e(b)) + } + return a + }(), e = function() { + function a(a) { + this.selector = a, this.progress = 0, this.check() + } + return a.prototype.check = function() { + var a = this; + return document.querySelector(this.selector) ? this.done() : setTimeout(function() { + return a.check() + }, C.elements.checkInterval) + }, a.prototype.done = function() { + return this.progress = 100 + }, a + }(), c = function() { + function a() { + var a, b, c = this; + this.progress = null != (b = this.states[document.readyState]) ? b : 100, a = document.onreadystatechange, document.onreadystatechange = function() { + return null != c.states[document.readyState] && (c.progress = c.states[document.readyState]), "function" == typeof a ? a.apply(null, arguments) : void 0 + } + } + return a.prototype.states = {loading: 0, interactive: 50, complete: 100}, a + }(), f = function() { + function a() { + var a, b, c, d, e, f = this; + this.progress = 0, a = 0, e = [], d = 0, c = B(), b = setInterval(function() { + var g; + return g = B() - c - 50, c = B(), e.push(g), e.length > C.eventLag.sampleCount && e.shift(), a = p(e), ++d >= C.eventLag.minSamples && a < C.eventLag.lagThreshold ? (f.progress = 100, clearInterval(b)) : f.progress = 100 * (3 / (a + 3)) + }, 50) + } + return a + }(), l = function() { + function a(a) { + this.source = a, this.last = this.sinceLastUpdate = 0, this.rate = C.initialRate, this.catchup = 0, this.progress = this.lastProgress = 0, null != this.source && (this.progress = E(this.source, "progress")) + } + return a.prototype.tick = function(a, b) { + var c; + return null == b && (b = E(this.source, "progress")), b >= 100 && (this.done = !0), b === this.last ? this.sinceLastUpdate += a : (this.sinceLastUpdate && (this.rate = (b - this.last) / this.sinceLastUpdate), this.catchup = (b - this.progress) / C.catchupTime, this.sinceLastUpdate = 0, this.last = b), b > this.progress && (this.progress += this.catchup * a), c = 1 - Math.pow(this.progress / 100, C.easeFactor), this.progress += c * this.rate * a, this.progress = Math.min(this.lastProgress + C.maxProgressPerFrame, this.progress), this.progress = Math.max(0, this.progress), this.progress = Math.min(100, this.progress), this.lastProgress = this.progress, this.progress + }, a + }(), K = null, G = null, q = null, L = null, o = null, r = null, Pace.running = !1, y = function() { + return C.restartOnPushState ? Pace.restart() : void 0 + }, null != window.history.pushState && (S = window.history.pushState, window.history.pushState = function() { + return y(), S.apply(window.history, arguments) + }), null != window.history.replaceState && (V = window.history.replaceState, window.history.replaceState = function() { + return y(), V.apply(window.history, arguments) + }), k = {ajax: a, elements: d, document: c, eventLag: f}, (A = function() { + var a, c, d, e, f, g, h, i; + for (Pace.sources = K = [], g = ["ajax", "elements", "document", "eventLag"], c = 0, e = g.length; e > c; c++) + a = g[c], C[a] !== !1 && K.push(new k[a](C[a])); + for (i = null != (h = C.extraSources)?h:[], d = 0, f = i.length; f > d; d++) + J = i[d], K.push(new J(C)); + return Pace.bar = q = new b, G = [], L = new l + })(), Pace.stop = function() { + return Pace.trigger("stop"), Pace.running = !1, q.destroy(), r = !0, null != o && ("function" == typeof s && s(o), o = null), A() + }, Pace.restart = function() { + return Pace.trigger("restart"), Pace.stop(), Pace.start() + }, Pace.go = function() { + var a; + return Pace.running = !0, q.render(), a = B(), r = !1, o = F(function(b, c) { + var d, e, f, g, h, i, j, k, m, n, o, p, s, t, u, v; + for (k = 100 - q.progress, e = o = 0, f = !0, i = p = 0, t = K.length; t > p; i = ++p) + for (J = K[i], n = null != G[i]?G[i]:G[i] = [], h = null != (v = J.elements)?v:[J], j = s = 0, u = h.length; u > s; j = ++s) + g = h[j], m = null != n[j] ? n[j] : n[j] = new l(g), f &= m.done, m.done || (e++, o += m.tick(b)); + return d = o / e, q.update(L.tick(b, d)), q.done() || f || r ? (q.update(100), Pace.trigger("done"), setTimeout(function() { + return q.finish(), Pace.running = !1, Pace.trigger("hide") + }, Math.max(C.ghostTime, Math.max(C.minTime - (B() - a), 0)))) : c() + }) + }, Pace.start = function(a) { + u(C, a), Pace.running = !0; + try { + q.render() + } catch (b) { + i = b + } + return document.querySelector(".pace") ? (Pace.trigger("start"), Pace.go()) : setTimeout(Pace.start, 50) + }, "function" == typeof define && define.amd ? define(function() { + return Pace + }) : "object" == typeof exports ? module.exports = Pace : C.startOnPageLoad && Pace.start() +}).call(this); \ No newline at end of file diff --git a/plugins/legacy-admin/js/legacy-scripts-menu-management.js b/plugins/legacy-admin/js/legacy-scripts-menu-management.js new file mode 100644 index 000000000..b059938ff --- /dev/null +++ b/plugins/legacy-admin/js/legacy-scripts-menu-management.js @@ -0,0 +1,260 @@ +/** + * @Package: WordPress Plugin + * @Subpackage: Legacy - White Label WordPress Admin Theme + * @Since: Legacy 1.0 + * @WordPress Version: 4.0 or above + * This file is part of Legacy - White Label WordPress Admin Theme Plugin. + */ + + +jQuery(function($) { + + 'use strict'; + + var LEGACY_MENUMNG_SETTINGS = window.LEGACY_MENUMNG_SETTINGS || {}; + + + + LEGACY_MENUMNG_SETTINGS.iconPanel = function(e) { + + $(document).on("click",".legacyicon",function(e) { + e.stopPropagation(); + var panel = $(this).parent().find(".legacyiconpanel"); + var iconstr = $(".legacyicons").html(); + panel.html(""); + panel.append(iconstr); + panel.show(); + }); + + + }; + + + + + LEGACY_MENUMNG_SETTINGS.menuToggle = function() { + + $(document).on("click",".legacytoggle",function(e) { + + var id = $(this).parent().attr("data-id"); + + if ($(this).hasClass("plus")) { + $(this).removeClass("plus dashicons-plus").addClass("minus dashicons-minus"); + //$(this).html("-"); + $(this).parent().parent().find(".legacymenupanel").removeClass("closed").addClass("opened"); + } else if ($(this).hasClass("minus")) { + $(this).removeClass("minus dashicons-minus").addClass("plus dashicons-plus"); + //$(this).html("+"); + $(this).parent().parent().find(".legacymenupanel").removeClass("opened").addClass("closed"); + } + + }); + + + $(document).on("click",".legacysubtoggle",function(e) { + + var id = $(this).parent().attr("data-id"); + + if ($(this).hasClass("plus")) { + $(this).removeClass("plus dashicons-plus").addClass("minus dashicons-minus"); + //$(this).html("-"); + $(this).parent().parent().find(".legacysubmenupanel").removeClass("closed").addClass("opened"); + } else if ($(this).hasClass("minus")) { + $(this).removeClass("minus dashicons-minus").addClass("plus dashicons-plus"); + //$(this).html("+"); + $(this).parent().parent().find(".legacysubmenupanel").removeClass("opened").addClass("closed"); + } + + }); + + + }; + + LEGACY_MENUMNG_SETTINGS.saveMenu = function() { + + $(document).on('click', '#legacy-savemenu', function(e){ + var neworder = ""; + var newsuborder = ""; + var menurename = ""; + var submenurename = ""; + var menudisable = ""; + var submenudisable = ""; + + $(".legacymenu").each(function() { + var id = $(this).attr("data-id"); + var menuid = $(this).attr("data-menu-id"); + neworder += menuid + "|"; + if ($(this).hasClass("disabled")) { + menudisable += menuid + "|"; + } + }); + + $(".legacysubmenu").each(function() { + var id = $(this).attr("data-id"); + var parentpage = $(this).attr("data-parent-page"); + newsuborder += parentpage + ":" + id + "|"; + if ($(this).hasClass("disabled")) { + submenudisable += parentpage + ":" + id + "|"; + } + }); + + $(".legacy-menurename").each(function() { + var id = $(this).attr("data-id"); + var sid = $(this).attr("data-menu-id"); + var val = $(this).val(); + var icon = $(this).parent().parent().find(".legacy-menuicon").attr("value"); + //console.log(icon); + menurename += id + ":" + sid + "@!@%@" + val + "[$!&!$]" + icon + "|#$%*|"; + }); + + + $(".legacy-submenurename").each(function() { + var id = $(this).attr("data-id"); + var parent = $(this).attr("data-parent-id"); + var parentpage = $(this).attr("data-parent-page"); + var val = $(this).val(); + submenurename += parentpage + "[($&)]" + parent + ":" + id + "@!@%@" + val + "|#$%*|"; + }); + + + + var action = 'legacy_savemenu'; + var data = { + neworder: neworder, + newsuborder: newsuborder, + menurename: menurename, + submenurename: submenurename, + menudisable: menudisable, + submenudisable: submenudisable, + action: action, + legacy_nonce: legacy_vars.legacy_nonce + }; + + $.post(ajaxurl, data, function(response) { + location.reload(); + //console.log(response); + }); + + return false; + + }); + + }; + + + LEGACY_MENUMNG_SETTINGS.resetMenu = function() { + + + $(document).on('click', '#legacy-resetmenu', function(e){ + + var action = 'legacy_resetmenu'; + var data = { + action: action, + legacy_nonce: legacy_vars.legacy_nonce + }; + + $.post(ajaxurl, data, function(response) { + location.reload(); + //console.log(response); + }); + + return false; + + }); + + }; + + + + + + + LEGACY_MENUMNG_SETTINGS.menuDisplay = function() { + + $(document).on('click', '.legacydisplay, .legacysubdisplay', function(e){ + + //var id = $(this).parent().attr("data-id"); + + if ($(this).hasClass("disable")) { + $(this).removeClass("disable").addClass("enable"); + //$(this).html("show"); + $(this).parent().parent().removeClass("enabled").addClass("disabled"); + } else if ($(this).hasClass("enable")) { + $(this).removeClass("enable").addClass("disable"); + //$(this).html("hide"); + $(this).parent().parent().removeClass("disabled").addClass("enabled"); + } + + }); + + }; + + + /****************************** + initialize respective scripts + *****************************/ + $(document).ready(function() { + + LEGACY_MENUMNG_SETTINGS.menuToggle(); + LEGACY_MENUMNG_SETTINGS.saveMenu(); + LEGACY_MENUMNG_SETTINGS.menuDisplay(); + LEGACY_MENUMNG_SETTINGS.iconPanel(); + LEGACY_MENUMNG_SETTINGS.resetMenu(); + }); + + $(window).resize(function() { + + }); + + $(window).load(function() { + + }); + +}); + + +jQuery(function($) { + if ($.isFunction($.fn.sortable)) { + $("#legacy-enabled, #legacy-disabled").sortable({ + connectWith: ".legacy-connectedSortable", + handle: ".legacymenu-wrap", + cancel: ".legacytoggle", + placeholder: "ui-state-highlight", + }).disableSelection(); + } +}); + + +jQuery(function($) { + if ($.isFunction($.fn.sortable)) { + $(".legacysubmenu-wrap").sortable({ + placeholder: "ui-state-highlight", + }).disableSelection(); + } +}); + + +jQuery(function($) { + $(document).ready(function() { + $(document).on('click', ".pickicon", function() { + var clss = $(this).attr("data-class"); + var prnt = $(this).parent().parent(); + //console.log(clss); + prnt.find("input").attr("value", clss); + prnt.find("input").val(clss); + var main = prnt.find(".legacymenuicon"); + main.removeClass(main.attr("data-class")).addClass(clss); + main.attr("data-class", clss); + return false; + }); + + $(document).on('click', "body", function() { + $(".legacyiconpanel").hide(); + //return false; + }); + + + + + }); +}); diff --git a/plugins/legacy-admin/js/legacy-scripts.js b/plugins/legacy-admin/js/legacy-scripts.js new file mode 100644 index 000000000..3cffd9b34 --- /dev/null +++ b/plugins/legacy-admin/js/legacy-scripts.js @@ -0,0 +1,171 @@ +/** + * @Package: WordPress Plugin + * @Subpackage: Legacy - White Label WordPress Admin Theme + * @Since: Legacy 1.0 + * @WordPress Version: 4.0 or above + * This file is part of Legacy - White Label WordPress Admin Theme Plugin. + */ + + +jQuery(function($) { + + 'use strict'; + + var LEGACY_SETTINGS = window.LEGACY_SETTINGS || {}; + + + /****************************** + Menu resizer + *****************************/ + LEGACY_SETTINGS.menuResizer = function() { + var menuWidth = $("#adminmenuwrap").width(); + if ($("#adminmenuwrap").is(":hidden")) { + $("body").addClass("menu-hidden"); + $("body").removeClass("menu-expanded"); + $("body").removeClass("menu-collapsed"); + } + else if (menuWidth > 46) { + $("body").addClass("menu-expanded"); + $("body").removeClass("menu-hidden"); + $("body").removeClass("menu-collapsed"); + } else { + $("body").addClass("menu-collapsed"); + $("body").removeClass("menu-expanded"); + $("body").removeClass("menu-hidden"); + } + + LEGACY_SETTINGS.menuConnectionLine(); + + }; + + LEGACY_SETTINGS.menuClickResize = function() { + $(document).on('click', '#collapse-menu, #wp-admin-bar-menu-toggle', function(e){ + var menuWidth = $("#adminmenuwrap").width(); + if ($("#adminmenuwrap").is(":hidden")) { + $("body").addClass("menu-hidden"); + $("body").removeClass("menu-expanded"); + $("body").removeClass("menu-collapsed"); + } + else if (menuWidth > 46) { + $("body").addClass("menu-expanded"); + $("body").removeClass("menu-hidden"); + $("body").removeClass("menu-collapsed"); + } else { + $("body").addClass("menu-collapsed"); + $("body").removeClass("menu-expanded"); + $("body").removeClass("menu-hidden"); + } + }); + }; + + LEGACY_SETTINGS.logoURL = function() { + + $("#adminmenuwrap").prepend("
    "); + + $(document).on('click', '#adminmenuwrap .logo-overlay', function(e){ + var logourl = $("#legacy-logourl").attr("data-value"); + if (logourl != "") { + window.location = logourl; + } + }); + }; + + + + LEGACY_SETTINGS.menuConnectionLinecall = function() { + + + $("#wp-admin-bar-menu-toggle").click(function(e) { + LEGACY_SETTINGS.menuConnectionLine(); + }); + + }; + + + + LEGACY_SETTINGS.menuConnectionLine = function() { + + + + var mainmenu = ($("#adminmenu").height() - $("li#collapse-menu").height()) / 2; + //$("#adminmenu:before, #adminmenu:after").css('height', +mainmenu + 'px'); + $('').appendTo('head'); + //console.log(mainmenu); + $("li.wp-has-submenu").each(function() { + var id = $(this).attr("id"); + + if ($("body").hasClass("folded") || $("body").hasClass("menu-collapsed")) { + var subheight = ($(this).find(".wp-submenu").height() - 49) / 2; + } else { + var subheight = ($(this).find(".wp-submenu").height()) / 2; + } + + var str = ""; + str += "li#" + id + " .wp-submenu:before, li#" + id + " .wp-submenu:after { height: " + subheight + "px !important;} "; + str += "li#" + id + " .wp-submenu:after { top: " + subheight + "px !important;} "; + str += ".folded li#" + id + " .wp-submenu:before, .folded li#" + id + " .wp-submenu:after { height: " + subheight + "px !important;} "; + str += ".folded li#" + id + " .wp-submenu:after { top: " + (subheight + 49) + "px !important;} "; + + $('').appendTo('head'); + }); + + }; + + + + LEGACY_SETTINGS.alternateSave = function() { + $(".legacy_save_new").on('click', function(e) { + legacy_ajaxsavestep(1); + console.log("alternate save it"); + //e.preventDefault(); + return false; + }); + + }; + + + + function legacy_ajaxsavestep(stepid) { + + var opt1 = $("#legacy_demo-dynamic-css-type .redux-image-select-selected input").val(); + var str = $("#legacy_demo-primary-color").find(".wp-color-result").attr("style") + ";" +$("#login-input-bg-opacity").val() +";"+ opt1; + + //alert(str); exit; + var action = 'legacy_alternate_save'; + var data = { + values: str, + action: action, + legacy_nonce: legacy_vars.legacy_nonce + }; + + $.post(ajaxurl, data, function(response) { + //alert(response); + $('.alternate_save_response').html(response); + + }); + + return false; + } + + /****************************** + initialize respective scripts + *****************************/ + $(document).ready(function() { + LEGACY_SETTINGS.menuResizer(); + LEGACY_SETTINGS.menuClickResize(); + LEGACY_SETTINGS.logoURL(); + LEGACY_SETTINGS.menuConnectionLinecall(); + LEGACY_SETTINGS.menuConnectionLine(); + }); + + $(window).resize(function() { + LEGACY_SETTINGS.menuResizer(); + LEGACY_SETTINGS.menuClickResize(); + }); + + $(window).load(function() { + LEGACY_SETTINGS.menuResizer(); + LEGACY_SETTINGS.menuClickResize(); + }); + +}); \ No newline at end of file diff --git a/plugins/legacy-admin/js/legacy-smoothscroll.min.js b/plugins/legacy-admin/js/legacy-smoothscroll.min.js new file mode 100644 index 000000000..12739938d --- /dev/null +++ b/plugins/legacy-admin/js/legacy-smoothscroll.min.js @@ -0,0 +1 @@ +!function(){var s,i,c,a,o={frameRate:150,animationTime:400,stepSize:100,pulseAlgorithm:!0,pulseScale:4,pulseNormalize:1,accelerationDelta:50,accelerationMax:3,keyboardSupport:!0,arrowScroll:50,fixedBackground:!0,excluded:""},p=o,u=!1,d=!1,n={x:0,y:0},f=!1,m=document.documentElement,l=[],h=/^Mac/.test(navigator.platform),w={left:37,up:38,right:39,down:40,spacebar:32,pageup:33,pagedown:34,end:35,home:36},v={37:1,38:1,39:1,40:1};function y(){if(!f&&document.body){f=!0;var e=document.body,t=document.documentElement,o=window.innerHeight,n=e.scrollHeight;if(m=0<=document.compatMode.indexOf("CSS")?t:e,s=e,p.keyboardSupport&&Y("keydown",x),top!=self)d=!0;else if(Q&&o=p.animationTime,c=i?1:l/p.animationTime;p.pulseAlgorithm&&(c=F(c));var s=a.x*c-a.lastX>>0,u=a.y*c-a.lastY>>0;o+=s,n+=u,a.lastX+=s,a.lastY+=u,i&&(b.splice(r,1),r--)}h?window.scrollBy(o,n):(o&&(d.scrollLeft+=o),n&&(d.scrollTop+=n)),f||m||(b=[]),b.length?j(w,d,1e3/p.frameRate+1):(g=!1,null!=d.$scrollBehavior&&(d.style.scrollBehavior=d.$scrollBehavior,d.$scrollBehavior=null))};j(w,d,0),g=!0}}function e(e){f||y();var t=e.target;if(e.defaultPrevented||e.ctrlKey)return!0;if(N(s,"embed")||N(t,"embed")&&/\.pdf/i.test(t.src)||N(s,"object")||t.shadowRoot)return!0;var o=-e.wheelDeltaX||e.deltaX||0,n=-e.wheelDeltaY||e.deltaY||0;h&&(e.wheelDeltaX&&K(e.wheelDeltaX,120)&&(o=e.wheelDeltaX/Math.abs(e.wheelDeltaX)*-120),e.wheelDeltaY&&K(e.wheelDeltaY,120)&&(n=e.wheelDeltaY/Math.abs(e.wheelDeltaY)*-120)),o||n||(n=-e.wheelDelta||0),1===e.deltaMode&&(o*=40,n*=40);var r=z(t);return r?!!function(e){if(!e)return;l.length||(l=[e,e,e]);e=Math.abs(e),l.push(e),l.shift(),clearTimeout(a),a=setTimeout(function(){try{localStorage.SS_deltaBuffer=l.join(",")}catch(e){}},1e3);var t=120add_item( array( + 'id' => 11272219, + 'basename' => plugin_basename( __FILE__ ) + ) ); + +} + + + +/* --------------- Registration Hook Library---------------- */ +require_once( trailingslashit(dirname(__FILE__)) . 'lib/legacy-register-hook.php' ); +register_activation_hook(__FILE__, 'legacy_admin_activation'); +register_deactivation_hook(__FILE__, 'legacy_admin_deactivation'); +?> \ No newline at end of file diff --git a/plugins/legacy-admin/lib/envato-plugin-update.php b/plugins/legacy-admin/lib/envato-plugin-update.php new file mode 100644 index 000000000..40a3e3d50 --- /dev/null +++ b/plugins/legacy-admin/lib/envato-plugin-update.php @@ -0,0 +1,203 @@ +items[] = $item; + + } + + + function admin_init() { + + if ( ! defined( 'EWPT_PLUGIN_SLUG' ) ) + return; + + // Make sure that any items have been registered + if ( empty( $this->items ) ) + return; + + $this->options = wp_parse_args( + get_option( EWPT_PLUGIN_SLUG ), + array( + 'user_name' => null, + 'api_key' => null + ) + ); + + $this->protected_api = new Envato_Protected_API( + $this->options['user_name'], + $this->options['api_key'] + ); + + add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_plugin_updates' ) ); + + add_filter( 'plugins_api', array( $this, 'plugins_api' ), 10, 3 ); + + } + + + function wp_list_plugins( $allow_cache = true, $timeout = 300 ) { + + return $this->protected_api->private_user_data( + 'wp-list-plugins', + $this->options['user_name'], + '', + $allow_cache, + $timeout + ); + + } + + + function get_items_by( $key = 'id' ) { + + $assoc = array(); + + foreach ( $this->items as $item ) + if ( isset( $item[ $key ] ) ) + $assoc[ $item[ $key ] ] = $item; + + return $assoc; + + } + + + function check_plugin_updates( $plugins ) { + + if ( ! isset( $plugins->checked ) ) + return $plugins; + + $user_plugins = $this->wp_list_plugins(); + $items = $this->get_items_by(); + + if ( empty( $user_plugins ) ) + return $plugins; + + foreach ( $user_plugins as $user_plugin ) { + + // Check if this item has been registered for automatic updates + if ( ! isset( $items[ $user_plugin->item_id ] ) ) + continue; + + $item_basename = $items[ $user_plugin->item_id ]['basename']; + + // Check if user has purchased this item + if ( array_key_exists( $user_plugin->item_id, $items ) && isset( $plugins->checked[ $item_basename ] ) ) { + + // Check if an update is available + if ( version_compare( $user_plugin->version, $plugins->checked[ $item_basename ], '>' ) ) { + + // Get the update zip file + $update_zip = $this->protected_api->wp_download( $user_plugin->item_id ); + + if ( ! $update_zip || empty( $update_zip ) ) + continue; + + $plugins->response[ $item_basename ] = (object) array( + 'id' => 'envato-' . $user_plugin->item_id, + 'slug' => 'envato-' . $user_plugin->item_id, + 'plugin' => $item_basename, + 'new_version' => $user_plugin->version, + 'upgrade_notice' => null, + 'url' => null, + 'package' => $update_zip + ); + + } + + } + + } + + return $plugins; + + } + + + function plugins_api( $res, $action, $args ) { + + $items = $this->get_items_by(); + + if ( 'plugin_information' == $action && isset( $args->slug ) && stristr( $args->slug, 'envato-' ) ) { + + // Get item ID out of "envato-NNNN" + $item_id = str_replace( 'envato-', '', $args->slug ); + + foreach ( $items as $item ) { + + if ( $item['id'] == $item_id ) { + + $item_details = $this->protected_api->item_details( $item_id ); + + if ( ! $item_details ) + return new WP_Error( + 'plugins_api_envato_failed', + __( 'Failed to retreive plugin details from the Envato API.' ) + ); + + return (object) array( + 'name' => $item_details->item, + 'sections' => array( + 'changelog' => sprintf( + '

    %s

    ', + sprintf( + __( 'New version of %s is available.' ), + esc_html( $item_details->item ) + ) + ), + ), + 'version' => null, + 'author' => $item_details->user, + 'requires' => null, + 'tested' => null, + 'homepage' => $item_details->url, + 'downloaded' => $item_details->sales, + 'slug' => 'envato-' . $item_id, + 'last_updated' => $item_details->last_update + ); + + } + } + + } + + return $res; + + } + +} + +endif; // class_exists + diff --git a/plugins/legacy-admin/lib/legacy-color-lib.php b/plugins/legacy-admin/lib/legacy-color-lib.php new file mode 100644 index 000000000..9fa9c9eea --- /dev/null +++ b/plugins/legacy-admin/lib/legacy-color-lib.php @@ -0,0 +1,197 @@ + +> 0x10); + $g = 0xFF & ($RGB >> 0x8); + $b = 0xFF & $RGB; + + $r = dechex($r); + $g = dechex($g); + $b = dechex($b); + + return "#" . str_pad($r, 2, "0", STR_PAD_LEFT) . str_pad($g, 2, "0", STR_PAD_LEFT) . str_pad($b, 2, "0", STR_PAD_LEFT); +} + +function legacy_ChangeLuminosity($RGB, $LuminosityPercent) { + $HSL = legacy_RGBToHSL($RGB); + $NewHSL = (int) (((float) $LuminosityPercent / 100) * 255) + (0xFFFF00 & $HSL); + return legacy_HSLToRGB($NewHSL); +} + +function legacy_RGBToHSL($RGB) { + $r = 0xFF & ($RGB >> 0x10); + $g = 0xFF & ($RGB >> 0x8); + $b = 0xFF & $RGB; + + $r = ((float) $r) / 255.0; + $g = ((float) $g) / 255.0; + $b = ((float) $b) / 255.0; + + $maxC = max($r, $g, $b); + $minC = min($r, $g, $b); + + $l = ($maxC + $minC) / 2.0; + + if ($maxC == $minC) { + $s = 0; + $h = 0; + } else { + if ($l < .5) { + $s = ($maxC - $minC) / ($maxC + $minC); + } else { + $s = ($maxC - $minC) / (2.0 - $maxC - $minC); + } + if ($r == $maxC) + $h = ($g - $b) / ($maxC - $minC); + if ($g == $maxC) + $h = 2.0 + ($b - $r) / ($maxC - $minC); + if ($b == $maxC) + $h = 4.0 + ($r - $g) / ($maxC - $minC); + + $h = $h / 6.0; + } + + $h = (int) round(255.0 * $h); + $s = (int) round(255.0 * $s); + $l = (int) round(255.0 * $l); + + $HSL = $l + ($s << 0x8) + ($h << 0x10); + return $HSL; +} + +function legacy_HSLToRGB($HSL) { + $h = 0xFF & ($HSL >> 0x10); + $s = 0xFF & ($HSL >> 0x8); + $l = 0xFF & $HSL; + + $h = ((float) $h) / 255.0; + $s = ((float) $s) / 255.0; + $l = ((float) $l) / 255.0; + + if ($s == 0) { + $r = $l; + $g = $l; + $b = $l; + } else { + if ($l < .5) { + $t2 = $l * (1.0 + $s); + } else { + $t2 = ($l + $s) - ($l * $s); + } + $t1 = 2.0 * $l - $t2; + + $rt3 = $h + 1.0 / 3.0; + $gt3 = $h; + $bt3 = $h - 1.0 / 3.0; + + if ($rt3 < 0) + $rt3 += 1.0; + if ($rt3 > 1) + $rt3 -= 1.0; + if ($gt3 < 0) + $gt3 += 1.0; + if ($gt3 > 1) + $gt3 -= 1.0; + if ($bt3 < 0) + $bt3 += 1.0; + if ($bt3 > 1) + $bt3 -= 1.0; + + if (6.0 * $rt3 < 1) + $r = $t1 + ($t2 - $t1) * 6.0 * $rt3; + elseif (2.0 * $rt3 < 1) + $r = $t2; + elseif (3.0 * $rt3 < 2) + $r = $t1 + ($t2 - $t1) * ((2.0 / 3.0) - $rt3) * 6.0; + else + $r = $t1; + + if (6.0 * $gt3 < 1) + $g = $t1 + ($t2 - $t1) * 6.0 * $gt3; + elseif (2.0 * $gt3 < 1) + $g = $t2; + elseif (3.0 * $gt3 < 2) + $g = $t1 + ($t2 - $t1) * ((2.0 / 3.0) - $gt3) * 6.0; + else + $g = $t1; + + if (6.0 * $bt3 < 1) + $b = $t1 + ($t2 - $t1) * 6.0 * $bt3; + elseif (2.0 * $bt3 < 1) + $b = $t2; + elseif (3.0 * $bt3 < 2) + $b = $t1 + ($t2 - $t1) * ((2.0 / 3.0) - $bt3) * 6.0; + else + $b = $t1; + } + + $r = (int) round(255.0 * $r); + $g = (int) round(255.0 * $g); + $b = (int) round(255.0 * $b); + + $RGB = $b + ($g << 0x8) + ($r << 0x10); + return $RGB; +} + +?> \ No newline at end of file diff --git a/plugins/legacy-admin/lib/legacy-css-lib.php b/plugins/legacy-admin/lib/legacy-css-lib.php new file mode 100644 index 000000000..27d1eea53 --- /dev/null +++ b/plugins/legacy-admin/lib/legacy-css-lib.php @@ -0,0 +1,464 @@ + + 0) { + $value = $legacyadmin[$id]['regular']; + } + if ($value == "") { + return; + } + } + return " " . $selector . "{color:" . legacy_hextorgba($value, $opacity) . " /*" . $value . "*/;} "; +} + +function legacy_css_shadow($selector, $id, $opacity = "", $side, $width, $string = "", $valuetype = "") { + if ($width == "") { + $width = "1px"; + } + + if ($side == "") { + $side = "bottom"; + } + + if ($side == "top") { + $side_css = "0px " . $width . " 0px 0px color inset, + 0px 0px 0px 0px color inset, + 0px 0px 0px 0px color inset, + 0px 0px 0px 0px color inset"; + } + if ($side == "right") { + $side_css = "0px 0px 0px 0px color inset, + 0px 0px 0px 0px color inset, + 0px 0px 0px 0px color inset, + -" . $width . " 0px 0px 0px color inset"; + } + if ($side == "bottom") { + $side_css = "0px 0px 0px 0px color inset, + 0px -" . $width . " 0px 0px color inset, + 0px 0px 0px 0px color inset, + 0px 0px 0px 0px color inset"; + } + if ($side == "left") { + $side_css = "0px 0px 0px 0px color inset, + 0px 0px 0px 0px color inset, + " . $width . " 0px 0px 0px color inset, + 0px 0px 0px 0px color inset"; + } + + if ($side == "left-right" || $side == "right-left") { + $side_css = "0px 0px 0px 0px color inset, + 0px 0px 0px 0px color inset, + " . $width . " 0px 0px 0px color inset, + -" . $width . " 0px 0px 0px color inset"; + } + + if ($side == "top-bottom" || $side == "bottom-top") { + $side_css = "0px " . $width . " 0px 0px color inset, + 0px -" . $width . " 0px 0px color inset, + 0px 0px 0px 0px color inset, + 0px 0px 0px 0px color inset"; + } + + if ($side == "all" || $side == "top-right-bottom-left") { + $side_css = "0px " . $width . " 0px 0px color inset, + 0px -" . $width . " 0px 0px color inset, + " . $width . " 0px 0px 0px color inset, + -" . $width . " 0px 0px 0px color inset"; + } + + + if ($side == "multiple") { + $side_css = $string; + } + + global $legacyadmin; + + if ($string == "string") { + $value = $id; + } else if ($valuetype == "string") { + $value = $id; + } else { + $value = $legacyadmin[$id]; + if (is_array($value) && sizeof($value) == 0) { + return; + } else if (is_array($value) && sizeof($value) > 0) { + $value = $legacyadmin[$id]['regular']; + } + } + + if ($value == "") { + return; + } + + + /* Relative color code */ + /* * * Darken Color - In box shadow the original color gets lighter ** */ + // echo $value; + $hex = $value; + /* + // echo "0. ".$hex . "[HEX]\n"; + $rgb = HTMLToRGB($hex); + // echo "1. ".$rgb . "[HEX to RGB]\n"; + $new_color = ChangeLuminosity($rgb, 63); + // echo "2. ".$new_color . "[Dark RGB (rgb-hsl-dark hsl-rgb)]\n"; + $new_hex = RGBToHTML($new_color); + // echo "3. ".$new_hex . "[HEX]\n"; + $value = $new_hex; + // echo "===========\n"; + */ + + +// if($side == "multiple"){ + if ($hex != "transparent") { + $color = legacy_hextorgba($hex, $opacity); + } else { + $color = "transparent"; + } // same color as separator - no darker version + $side_css = str_replace("color", $color, $side_css); + return " " . $selector . "{box-shadow: " . $side_css . " ;\n" + . "-webkit-box-shadow: " . $side_css . " ;\n" + . "-o-box-shadow: " . $side_css . " ;\n" + . "-moz-box-shadow: " . $side_css . " ;\n" + . "-ms-box-shadow: " . $side_css . " /*" . $hex . "*/;} \n"; +} + +function legacy_link_color($selector, $id, $opacity = "", $type = "", $valuetype = "") { + global $legacyadmin; + if ($valuetype == "array") { + $value = $id; + } else { + $value = $legacyadmin[$id]; + } + + if (sizeof($value) == 0) { + return; + } + + $selector_visited = $selector_hover = $selector_active = ""; + $exp = explode(",", $selector); + foreach ($exp as $single) { + $selector_visited .= trim($single) . ":visited, "; + $selector_hover .= trim($single) . ":hover, "; + $selector_active .= trim($single) . ":active, "; + } + + $selector_visited = substr($selector_visited, 0, -2); + $selector_hover = substr($selector_hover, 0, -2); + $selector_active = substr($selector_active, 0, -2); + + $regular = (isset($value['regular']) && $value['regular'] != "") ? $value['regular'] : $legacyadmin['primary-color']; + $hover = (isset($value['hover']) && $value['hover'] != "") ? $value['hover'] : $regular; + $active = (isset($value['active']) && $value['active'] != "") ? $value['active'] : $hover; + $visited = (isset($value['visited']) && $value['visited'] != "") ? $value['visited'] : $regular; + + if (isset($type) && $type == "hover") { + return $selector . "{color:" . legacy_hextorgba($value['hover'], $opacity) . " /*" . $value['hover'] . "*/;} "; + } else { + return $selector . "{color:" . legacy_hextorgba($regular, $opacity) . " /*" . $regular . "*/;} " . +// $selector_visited . " {color:" . legacy_hextorgba($visited, $opacity) . ";} " . + $selector_hover . " {color:" . legacy_hextorgba($hover, $opacity) . " /*" . $hover . "*/;} " . + $selector_active . " {color:" . legacy_hextorgba($active, $opacity) . " /*" . $active . "*/;} \n"; + } +} + +function legacy_css_bgcolor($selector, $id, $opacity = "", $valuetype = "",$important = "") { + global $legacyadmin; + + $imp = ""; + if($important == "imp"){ + $imp = "!important"; + } + + if ($valuetype == "string") { + $value = $id; + } else if ($valuetype == "luminosity") { + $value = $legacyadmin[$id]; + $hex = $value; /* HEX */ + $rgb = legacy_HTMLToRGB($hex); /* HEX to RGB */ + $new_color = legacy_ChangeLuminosity($rgb, $opacity); /* rgb-hsl-new hsl-rgb */ + $new_hex = legacy_RGBToHTML($new_color); /* HEX */ + $value = $new_hex; + } else { + $value = $legacyadmin[$id]; + if (is_array($value) && sizeof($value) == 0) { + return; + } else if (is_array($value) && sizeof($value) > 0) { + $value = $legacyadmin[$id]['regular']; + } + if ($value == "") { + return; + } + } + $color = ""; + if ($value == "transparent") { + $color = "transparent"; + } else if (strpos($value, "rgba") !== false) { + $color = $value; + } else { + $color = legacy_hextorgba($value, $opacity); + } + return " " . $selector . "{background-color:" . $color .$imp." /*" . $value . "*/;} "; +} + +function legacy_css_border_color($selector, $id, $opacity = "", $bordertype, $valuetype = "") { + global $legacyadmin; + + if ($valuetype == "string") { + $value = $id; + } else { + $value = $legacyadmin[$id]; + if (is_array($value) && sizeof($value) == 0) { + return; + } else if (is_array($value) && sizeof($value) > 0) { + if (isset($legacyadmin[$id]['regular'])) { + $value = $legacyadmin[$id]['regular']; + } + } + } + if ($value == "") { + return; + } + + + if ($bordertype == "all") { + $css_property = "border-color"; + } else if ($bordertype == "top") { + $css_property = "border-top-color"; + } else if ($bordertype == "right") { + $css_property = "border-right-color"; + } else if ($bordertype == "bottom") { + $css_property = "border-bottom-color"; + } else if ($bordertype == "left") { + $css_property = "border-left-color"; + } + + $color = ""; + if ($value != "transparent") { + $color = legacy_hextorgba($value, $opacity); + } else { + $color = "transparent"; + } + + return " " . $selector . "{" . $css_property . ":" . $color . " /*" . $value . "*/;}\n "; +} + +function legacy_css_background_gradient($selector, $id1, $id2, $direction, $percent1, $percent2, $opacity = "", $type = "") { + global $legacyadmin; + + if ($type == "string") { + $value1 = $id1; + $value2 = $id2; + } else { + + $value1 = "#aeb2b7"; + if (isset($legacyadmin[$id1]['background-color']) && trim($legacyadmin[$id1]['background-color']) != "") { + $value1 = $legacyadmin[$id1]['background-color']; + } + + $value2 = $value1; + if (isset($legacyadmin[$id2]['background-color']) && trim($legacyadmin[$id2]['background-color']) != "") { + $value2 = $legacyadmin[$id2]['background-color']; + } + } + + $color1 = legacy_colorcode($value1, $opacity, "", "1"); + $color2 = legacy_colorcode($value2, $opacity, "", "1"); + + if ($direction == "") { + $direction = "top"; + } + + if ($percent1 == "") { + $percent1 = "50%"; + } + + if ($percent2 == "") { + $percent2 = "50%"; + } + + $str = "linear-gradient(" . $direction . ", " . $color1 . " " . $percent1 . ", " . $color2 . " " . $percent2 . ");"; + + $ret = ""; + + $ret .= " " . $selector . "{"; + $ret .= "background: -moz-" . $str; + $ret .= "background: -webkit-" . $str; + $ret .= "background: -o-" . $str; + $ret .= "background: -ms-" . $str; + $ret .= "background: " . $str; + $ret .= "} "; + + return $ret; +} + +function legacy_css_background($selector, $id, $opacity = "", $type = "",$important = "") { + global $legacyadmin; + if ($type == "array") { + $value = $id; + } else { + $value = $legacyadmin[$id]; + } + + $imp = ""; + if($important == "imp"){ + $imp = "!important"; + } + + + if (!isset($value['background-image'])) { + $value['background-image'] = ""; + } + if (!isset($value['background-repeat'])) { + $value['background-repeat'] = ""; + } + if (!isset($value['background-color'])) { + $value['background-color'] = ""; + } + if (!isset($value['background-size'])) { + $value['background-size'] = ""; + } + if (!isset($value['background-attachment'])) { + $value['background-attachment'] = ""; + } + if (!isset($value['background-position'])) { + $value['background-position'] = ""; + } + + + $bg_image = ""; + $legacyadminID = $value['background-image']; + if (isset($legacyadminID) && trim($legacyadminID) != "") { + $bg_image = "background-image:url(" . $legacyadminID . ")".$imp."; "; + } + + $bg_color = ""; + $legacyadminID = $value['background-color']; + $colorcode = legacy_colorcode($legacyadminID, $opacity, $imp); + $bg_color = "background-color: " . $colorcode . ";"; + + $bg_repeat = ""; + $legacyadminID = $value['background-repeat']; + if (isset($legacyadminID) && trim($legacyadminID) != "") { + $bg_repeat = "background-repeat:" . $legacyadminID . "".$imp."; "; + } + + $bg_size = ""; + $legacyadminID = $value['background-size']; + if (isset($legacyadminID) && trim($legacyadminID) != "") { + $bg_size = "-webkit-background-size:" . $legacyadminID . "".$imp."; " + . "-moz-background-size:" . $legacyadminID . "".$imp."; " + . "-o-background-size:" . $legacyadminID . "".$imp."; " + . "background-size:" . $legacyadminID . "".$imp."; "; + } + + $bg_attach = ""; + $legacyadminID = $value['background-attachment']; + if (isset($legacyadminID) && trim($legacyadminID) != "") { + $bg_attach = "background-attachment:" . $legacyadminID . "".$imp."; "; + } + + $bg_pos = ""; + $legacyadminID = $value['background-position']; + if (isset($legacyadminID) && trim($legacyadminID) != "") { + $bg_pos = "background-position:" . $legacyadminID . "".$imp."; "; + } + + + return " " . $selector . "{" . $bg_color . $bg_image . $bg_pos . $bg_attach . $bg_size . $bg_repeat . "} "; +} + +function legacy_hextorgba($value, $opacity) { + if ($opacity == "" || !isset($opacity)) { + $opacity = 1; + } + $rgb = legacy_hex2rgb($value); + return "rgba(" . $rgb[0] . "," . $rgb[1] . "," . $rgb[2] . ",$opacity)"; +} + +function legacy_colorcode($color, $opacity = "", $addstr = "", $onlycode = "0") { + $ret = $color; + $code = ""; + if ($opacity == "") { + $opacity = "1.0"; + } + global $legacyadmin; + //$legacyadmin = legacy_color(); + + if (isset($color) && trim($color) != "" && trim($color) != "#") { + if ($color == "transparent") { + $ret = "transparent" . $addstr; + } else if ($color == "primary") { + $ret = $legacyadmin['primary-color'] . $addstr; + } else if ($color == "primary2") { + $ret = $legacyadmin['primary2-color'] . $addstr; + } else if ($color == "secondary") { + $ret = $legacyadmin['secondary-color'] . $addstr; + } else if (strpos($color, "rgb") !== false) { + $ret = $color . $addstr; + } else if (strpos($color, "/") !== false) { + $colorexp = explode("/", $color); + if (trim($colorexp[0]) == "primary") { + $code = $legacyadmin['primary-color']; + } else if (trim($colorexp[0]) == "primary2") { + $code = $legacyadmin['primary2-color']; + } else if (trim($colorexp[0]) == "secondary") { + $code = $legacyadmin['secondary-color']; + } else { + $code = trim($colorexp[0]); + } + if (trim($colorexp[1]) != "") { + $opacity = trim($colorexp[1]); + } + $ret = legacy_hextorgba($code, $opacity) . $addstr; + if ($onlycode != "1") { + $ret .= " /*" . $code . "*/"; + } + if ($onlycode != "1") { + $ret .= "; "; + } + } else { + $ret = legacy_hextorgba($color, $opacity) . $addstr; + if ($onlycode != "1") { + $ret .= " /*" . $color . "*/"; + } + if ($onlycode != "1") { + $ret .= "; "; + } +// $ret = $color ." /*".$color."*/; "; + } + } + + return $ret; +} + +?> \ No newline at end of file diff --git a/plugins/legacy-admin/lib/legacy-css-version.php b/plugins/legacy-admin/lib/legacy-css-version.php new file mode 100644 index 000000000..38a451d0e --- /dev/null +++ b/plugins/legacy-admin/lib/legacy-css-version.php @@ -0,0 +1,29 @@ + +=')) { + return 'css40'; + } else { + return ''; + } +} + +$GLOBALS['legacy_css_ver'] = legacy_css_version(); +?> \ No newline at end of file diff --git a/plugins/legacy-admin/lib/legacy-custom-colors.php b/plugins/legacy-admin/lib/legacy-custom-colors.php new file mode 100644 index 000000000..694fefc1c --- /dev/null +++ b/plugins/legacy-admin/lib/legacy-custom-colors.php @@ -0,0 +1,1081 @@ + + '#f45246', + 'page-bg' => array('background-color' => '#f0f1f2'), + 'heading-color' => '#7d8a9d', + 'body-text-color' => '#7d8a9d', + 'link-color' => array('regular' => '#2a3e4c', 'hover' => '#f45246',), + 'menu-bg' => array('background-color' => '#2a3e4c'), + 'menu-color' => '#ffffff', + 'menu-hover-color' => '#ffffff', + 'submenu-color' => '#aeb2b7', + 'menu-primary-bg' => '#f45246', + 'menu-secondary-bg' => '#141c22', + 'menu-icon-line-bg' => array('background-color' => '#aeb2b7'), + 'menu-icon-color' => '#aeb2b7', + 'menu-icon-bg' => array('background-color' => '#2a3e4c'), + 'menu-active-icon-color' => '#f45246', + 'menu-active-icon-bg' => array('background-color' => '#f0f1f2'), + 'submenu-active-icon-bg' => array('background-color' => '#f45246'), + 'box-bg' => array('background-color' => '#ffffff'), + 'box-head-bg' => array('background-color' => '#64ca92'), + 'box-head-color' => '#ffffff', + 'button-primary-bg' => '#f45246', + 'button-primary-hover-bg' => '#18b3dc', + 'button-secondary-bg' => '#a9a9a9', + 'button-secondary-hover-bg' => '#999999', + 'button-text-color' => '#ffffff', + 'form-bg' => '#ffffff', + 'form-text-color' => '#7d8a9d', + 'form-border-color' => '#e2e2e4', + 'logo-bg' => '#2a3e4c', + 'topbar-menu-color' => '#ffffff', + 'topbar-menu-bg' => array('background-color' => '#18b3dc'), + 'topbar-submenu-color' => '#aeb2b7', + 'topbar-submenu-bg' => '#2a3e4c', + 'topbar-submenu-hover-bg' => '#141c22', + 'logo' => array('url' => 'PLUGINURL/images/logo.png'), + 'logo_folded' => array('url' => 'PLUGINURL/images/logo-folded.png'), +); + + + +$color2 = array( + 'primary-color' => '#e96e4d', + 'page-bg' => array('background-color' => '#f3f4f8'), + 'heading-color' => '#7d8a9d', + 'body-text-color' => '#7d8a9d', + 'link-color' => array('regular' => '#32323a', 'hover' => '#e96e4d',), + 'menu-bg' => array('background-color' => '#32323a'), + 'menu-color' => '#ffffff', + 'menu-hover-color' => '#ffffff', + 'submenu-color' => '#aeb2b7', + 'menu-primary-bg' => '#e96e4d', + 'menu-secondary-bg' => '#212026', + 'menu-icon-line-bg' => array('background-color' => '#aeb2b7'), + 'menu-icon-color' => '#aeb2b7', + 'menu-icon-bg' => array('background-color' => '#32323a'), + 'menu-active-icon-color' => '#e96e4d', + 'menu-active-icon-bg' => array('background-color' => '#f3f4f8'), + 'submenu-active-icon-bg' => array('background-color' => '#e96e4d'), + 'box-bg' => array('background-color' => '#ffffff'), + 'box-head-bg' => array('background-color' => '#61cae7'), + 'box-head-color' => '#ffffff', + 'button-primary-bg' => '#e96e4d', + 'button-primary-hover-bg' => '#1fc7bf', + 'button-secondary-bg' => '#a9a9a9', + 'button-secondary-hover-bg' => '#999999', + 'button-text-color' => '#ffffff', + 'form-bg' => '#ffffff', + 'form-text-color' => '#7d8a9d', + 'form-border-color' => '#e2e2e4', + 'logo-bg' => '#32323a', + 'topbar-menu-color' => '#ffffff', + 'topbar-menu-bg' => array('background-color' => '#27c29c'), + 'topbar-submenu-color' => '#aeb2b7', + 'topbar-submenu-bg' => '#32323a', + 'topbar-submenu-hover-bg' => '#212026', + 'logo' => array('url' => 'PLUGINURL/images/logo.png'), + 'logo_folded' => array('url' => 'PLUGINURL/images/logo-folded.png'), +); + + + + + +$color3 = array( + 'primary-color' => '#6cbdc4', + 'page-bg' => array('background-color' => '#eef1f5'), + 'heading-color' => '#7d8a9d', + 'body-text-color' => '#7d8a9d', + 'link-color' => array('regular' => '#454c50', 'hover' => '#6cbdc4',), + 'menu-bg' => array('background-color' => '#454c50'), + 'menu-color' => '#ffffff', + 'menu-hover-color' => '#ffffff', + 'submenu-color' => '#aeb2b7', + 'menu-primary-bg' => '#6cbdc4', + 'menu-secondary-bg' => '#212026', + 'menu-icon-line-bg' => array('background-color' => '#aeb2b7'), + 'menu-icon-color' => '#aeb2b7', + 'menu-icon-bg' => array('background-color' => '#454c50'), + 'menu-active-icon-color' => '#6cbdc4', + 'menu-active-icon-bg' => array('background-color' => '#eef1f5'), + 'submenu-active-icon-bg' => array('background-color' => '#6cbdc4'), + 'box-bg' => array('background-color' => '#ffffff'), + 'box-head-bg' => array('background-color' => '#ec7963'), + 'box-head-color' => '#ffffff', + 'button-primary-bg' => '#6cbdc4', + 'button-primary-hover-bg' => '#188791', + 'button-secondary-bg' => '#a9a9a9', + 'button-secondary-hover-bg' => '#999999', + 'button-text-color' => '#ffffff', + 'form-bg' => '#ffffff', + 'form-text-color' => '#7d8a9d', + 'form-border-color' => '#e2e2e4', + 'logo-bg' => '#454c50', + 'topbar-menu-color' => '#ffffff', + 'topbar-menu-bg' => array('background-color' => '#6cbdc4'), + 'topbar-submenu-color' => '#aeb2b7', + 'topbar-submenu-bg' => '#454c50', + 'topbar-submenu-hover-bg' => '#212026', + 'logo' => array('url' => 'PLUGINURL/images/logo.png'), + 'logo_folded' => array('url' => 'PLUGINURL/images/logo-folded.png'), +); + + + +$color4 = array( + 'primary-color' => '#d76d93', // + 'page-bg' => array('background-color' => '#f1f2f7'), + 'heading-color' => '#5a5a67', + 'body-text-color' => '#5a5a67', + 'link-color' => array('regular' => '#32323a', 'hover' => '#d76d93',), + 'menu-bg' => array('background-color' => '#32323a'), + 'menu-color' => '#ffffff', + 'menu-hover-color' => '#ffffff', + 'submenu-color' => '#aeb2b7', + 'menu-primary-bg' => '#d76d93', + 'menu-secondary-bg' => '#212026', + 'menu-icon-line-bg' => array('background-color' => '#aeb2b7'), + 'menu-icon-color' => '#aeb2b7', + 'menu-icon-bg' => array('background-color' => '#32323a'), + 'menu-active-icon-color' => '#d76d93', + 'menu-active-icon-bg' => array('background-color' => '#f1f2f7'), + 'submenu-active-icon-bg' => array('background-color' => '#d76d93'), + 'box-bg' => array('background-color' => '#ffffff'), + 'box-head-bg' => array('background-color' => '#40bdbd'), + 'box-head-color' => '#ffffff', + 'button-primary-bg' => '#7d4b82', + 'button-primary-hover-bg' => '#eacc5f', + 'button-secondary-bg' => '#a9a9a9', + 'button-secondary-hover-bg' => '#999999', + 'button-text-color' => '#ffffff', + 'form-bg' => '#ffffff', + 'form-text-color' => '#5a5a67', + 'form-border-color' => '#e2e2e4', + 'logo-bg' => '#32323a', + 'topbar-menu-color' => '#ffffff', + 'topbar-menu-bg' => array('background-color' => '#7d4b82'), + 'topbar-submenu-color' => '#aeb2b7', + 'topbar-submenu-bg' => '#32323a', + 'topbar-submenu-hover-bg' => '#212026', + 'logo' => array('url' => 'PLUGINURL/images/logo.png'), + 'logo_folded' => array('url' => 'PLUGINURL/images/logo-folded.png'), +); + + + +$color5 = array( + 'primary-color' => '#06a9d8', + 'page-bg' => array('background-color' => '#eeeff0'), + 'heading-color' => '#7d8a9d', + 'body-text-color' => '#7d8a9d', + 'link-color' => array('regular' => '#28556b', 'hover' => '#06a9d8',), + 'menu-bg' => array('background-color' => '#28556b'), + 'menu-color' => '#ffffff', + 'menu-hover-color' => '#ffffff', + 'submenu-color' => '#aeb2b7', + 'menu-primary-bg' => '#06a9d8', + 'menu-secondary-bg' => '#143444', + 'menu-icon-line-bg' => array('background-color' => '#aeb2b7'), + 'menu-icon-color' => '#aeb2b7', + 'menu-icon-bg' => array('background-color' => '#28556b'), + 'menu-active-icon-color' => '#06a9d8', + 'menu-active-icon-bg' => array('background-color' => '#eeeff0'), + 'submenu-active-icon-bg' => array('background-color' => '#06a9d8'), + 'box-bg' => array('background-color' => '#ffffff'), + 'box-head-bg' => array('background-color' => '#eab44a'), + 'box-head-color' => '#ffffff', + 'button-primary-bg' => '#06a9d8', + 'button-primary-hover-bg' => '#188791', + 'button-secondary-bg' => '#a9a9a9', + 'button-secondary-hover-bg' => '#999999', + 'button-text-color' => '#ffffff', + 'form-bg' => '#ffffff', + 'form-text-color' => '#7d8a9d', + 'form-border-color' => '#e2e2e4', + 'logo-bg' => '#28556b', + 'topbar-menu-color' => '#ffffff', + 'topbar-menu-bg' => array('background-color' => '#06a9d8'), + 'topbar-submenu-color' => '#aeb2b7', + 'topbar-submenu-bg' => '#28556b', + 'topbar-submenu-hover-bg' => '#143444', + 'logo' => array('url' => 'PLUGINURL/images/logo.png'), + 'logo_folded' => array('url' => 'PLUGINURL/images/logo-folded.png'), +); + + +$color6 = array( + 'primary-color' => '#f0b270', + 'page-bg' => array('background-color' => '#f3f1ec'), + 'heading-color' => '#7d8a9d', + 'body-text-color' => '#7d8a9d', + 'link-color' => array('regular' => '#392a39', 'hover' => '#f0b270',), + 'menu-bg' => array('background-color' => '#392a39'), + 'menu-color' => '#ffffff', + 'menu-hover-color' => '#ffffff', + 'submenu-color' => '#aeb2b7', + 'menu-primary-bg' => '#f0b270', + 'menu-secondary-bg' => '#6f5f5c', + 'menu-icon-line-bg' => array('background-color' => '#aeb2b7'), + 'menu-icon-color' => '#aeb2b7', + 'menu-icon-bg' => array('background-color' => '#392a39'), + 'menu-active-icon-color' => '#f0b270', + 'menu-active-icon-bg' => array('background-color' => '#f3f1ec'), + 'submenu-active-icon-bg' => array('background-color' => '#f0b270'), + 'box-bg' => array('background-color' => '#ffffff'), + 'box-head-bg' => array('background-color' => '#e38f71'), + 'box-head-color' => '#ffffff', + 'button-primary-bg' => '#f0b270', + 'button-primary-hover-bg' => '#825d5b', + 'button-secondary-bg' => '#a9a9a9', + 'button-secondary-hover-bg' => '#999999', + 'button-text-color' => '#ffffff', + 'form-bg' => '#ffffff', + 'form-text-color' => '#7d8a9d', + 'form-border-color' => '#e2e2e4', + 'logo-bg' => '#392a39', + 'topbar-menu-color' => '#ffffff', + 'topbar-menu-bg' => array('background-color' => '#825d5b'), + 'topbar-submenu-color' => '#aeb2b7', + 'topbar-submenu-bg' => '#392a39', + 'topbar-submenu-hover-bg' => '#6f5f5c', + 'logo' => array('url' => 'PLUGINURL/images/logo.png'), + 'logo_folded' => array('url' => 'PLUGINURL/images/logo-folded.png'), +); + + + + +$color7 = array( + 'primary-color' => '#f9d36a', + 'page-bg' => array('background-color' => '#ecedec'), + 'heading-color' => '#7d8a9d', + 'body-text-color' => '#7d8a9d', + 'link-color' => array('regular' => '#4c4c4d', 'hover' => '#f9d36a',), + 'menu-bg' => array('background-color' => '#4c4c4d'), + 'menu-color' => '#ffffff', + 'menu-hover-color' => '#ffffff', + 'submenu-color' => '#aeb2b7', + 'menu-primary-bg' => '#f9d36a', + 'menu-secondary-bg' => '#212026', + 'menu-icon-line-bg' => array('background-color' => '#aeb2b7'), + 'menu-icon-color' => '#aeb2b7', + 'menu-icon-bg' => array('background-color' => '#4c4c4d'), + 'menu-active-icon-color' => '#f9d36a', + 'menu-active-icon-bg' => array('background-color' => '#ecedec'), + 'submenu-active-icon-bg' => array('background-color' => '#f9d36a'), + 'box-bg' => array('background-color' => '#ffffff'), + 'box-head-bg' => array('background-color' => '#b088d5'), + 'box-head-color' => '#ffffff', + 'button-primary-bg' => '#e75b3e', + 'button-primary-hover-bg' => '#188791', + 'button-secondary-bg' => '#a9a9a9', + 'button-secondary-hover-bg' => '#999999', + 'button-text-color' => '#ffffff', + 'form-bg' => '#ffffff', + 'form-text-color' => '#7d8a9d', + 'form-border-color' => '#e2e2e4', + 'logo-bg' => '#4c4c4d', + 'topbar-menu-color' => '#ffffff', + 'topbar-menu-bg' => array('background-color' => '#f9d36a'), + 'topbar-submenu-color' => '#aeb2b7', + 'topbar-submenu-bg' => '#4c4c4d', + 'topbar-submenu-hover-bg' => '#212026', + 'logo' => array('url' => 'PLUGINURL/images/logo.png'), + 'logo_folded' => array('url' => 'PLUGINURL/images/logo-folded.png'), +); + + + +$color8 = array( + 'primary-color' => '#f49658', + 'page-bg' => array('background-color' => '#eae9e4'), + 'heading-color' => '#7d8a9d', + 'body-text-color' => '#7d8a9d', + 'link-color' => array('regular' => '#372636', 'hover' => '#f49658',), + 'menu-bg' => array('background-color' => '#372636'), + 'menu-color' => '#ffffff', + 'menu-hover-color' => '#ffffff', + 'submenu-color' => '#aeb2b7', + 'menu-primary-bg' => '#f49658', + 'menu-secondary-bg' => '#212026', + 'menu-icon-line-bg' => array('background-color' => '#aeb2b7'), + 'menu-icon-color' => '#aeb2b7', + 'menu-icon-bg' => array('background-color' => '#372636'), + 'menu-active-icon-color' => '#f49658', + 'menu-active-icon-bg' => array('background-color' => '#eae9e4'), + 'submenu-active-icon-bg' => array('background-color' => '#f49658'), + 'box-bg' => array('background-color' => '#ffffff'), + 'box-head-bg' => array('background-color' => '#e7615c'), + 'box-head-color' => '#ffffff', + 'button-primary-bg' => '#f4c152', + 'button-primary-hover-bg' => '#8d3356', + 'button-secondary-bg' => '#a9a9a9', + 'button-secondary-hover-bg' => '#999999', + 'button-text-color' => '#ffffff', + 'form-bg' => '#ffffff', + 'form-text-color' => '#7d8a9d', + 'form-border-color' => '#e2e2e4', + 'logo-bg' => '#372636', + 'topbar-menu-color' => '#ffffff', + 'topbar-menu-bg' => array('background-color' => '#f49658'), + 'topbar-submenu-color' => '#aeb2b7', + 'topbar-submenu-bg' => '#372636', + 'topbar-submenu-hover-bg' => '#212026', + 'logo' => array('url' => 'PLUGINURL/images/logo.png'), + 'logo_folded' => array('url' => 'PLUGINURL/images/logo-folded.png'), +); + + +$color9 = array( + 'primary-color' => '#e35b27', + 'page-bg' => array('background-color' => '#e7e7e9'), + 'heading-color' => '#404143', + 'body-text-color' => '#704143', + 'link-color' => array('regular' => '#414244', 'hover' => '#e35b27',), + 'menu-bg' => array('background-color' => '#414244'), + 'menu-color' => '#ffffff', + 'menu-hover-color' => '#ffffff', + 'submenu-color' => '#aeb2b7', + 'menu-primary-bg' => '#e35b27', + 'menu-secondary-bg' => '#5e5f61', + 'menu-icon-line-bg' => array('background-color' => '#aeb2b7'), + 'menu-icon-color' => '#aeb2b7', + 'menu-icon-bg' => array('background-color' => '#414244'), + 'menu-active-icon-color' => '#e35b27', + 'menu-active-icon-bg' => array('background-color' => '#e7e7e9'), + 'submenu-active-icon-bg' => array('background-color' => '#e35b27'), + 'box-bg' => array('background-color' => '#ffffff'), + 'box-head-bg' => array('background-color' => '#e35b27'), + 'box-head-color' => '#ffffff', + 'button-primary-bg' => '#e35b27', + 'button-primary-hover-bg' => '#ff743d', + 'button-secondary-bg' => '#a9a9a9', + 'button-secondary-hover-bg' => '#999999', + 'button-text-color' => '#ffffff', + 'form-bg' => '#ffffff', + 'form-text-color' => '#7d8a9d', + 'form-border-color' => '#e2e2e4', + 'logo-bg' => '#414244', + 'topbar-menu-color' => '#ffffff', + 'topbar-menu-bg' => array('background-color' => '#e35b27'), + 'topbar-submenu-color' => '#aeb2b7', + 'topbar-submenu-bg' => '#414244', + 'topbar-submenu-hover-bg' => '#5e5f61', + 'logo' => array('url' => 'PLUGINURL/images/logo.png'), + 'logo_folded' => array('url' => 'PLUGINURL/images/logo-folded.png'), +); + + +$color10 = array( + 'primary-color' => '#5bc9c5', + 'page-bg' => array('background-color' => '#ececec'), + 'heading-color' => '#404143', + 'body-text-color' => '#704143', + 'link-color' => array('regular' => '#414244', 'hover' => '#5bc9c5',), + 'menu-bg' => array('background-color' => '#414244'), + 'menu-color' => '#ffffff', + 'menu-hover-color' => '#ffffff', + 'submenu-color' => '#aeb2b7', + 'menu-primary-bg' => '#5bc9c5', + 'menu-secondary-bg' => '#5e5f61', + 'menu-icon-line-bg' => array('background-color' => '#aeb2b7'), + 'menu-icon-color' => '#aeb2b7', + 'menu-icon-bg' => array('background-color' => '#414244'), + 'menu-active-icon-color' => '#5bc9c5', + 'menu-active-icon-bg' => array('background-color' => '#ececec'), + 'submenu-active-icon-bg' => array('background-color' => '#5bc9c5'), + 'box-bg' => array('background-color' => '#ffffff'), + 'box-head-bg' => array('background-color' => '#5bc9c5'), + 'box-head-color' => '#ffffff', + 'button-primary-bg' => '#5bc9c5', + 'button-primary-hover-bg' => '#ff743d', + 'button-secondary-bg' => '#a9a9a9', + 'button-secondary-hover-bg' => '#999999', + 'button-text-color' => '#ffffff', + 'form-bg' => '#ffffff', + 'form-text-color' => '#7d8a9d', + 'form-border-color' => '#e2e2e4', + 'logo-bg' => '#414244', + 'topbar-menu-color' => '#ffffff', + 'topbar-menu-bg' => array('background-color' => '#5bc9c5'), + 'topbar-submenu-color' => '#aeb2b7', + 'topbar-submenu-bg' => '#414244', + 'topbar-submenu-hover-bg' => '#5e5f61', + 'logo' => array('url' => 'PLUGINURL/images/logo.png'), + 'logo_folded' => array('url' => 'PLUGINURL/images/logo-folded.png'), +); + +$color11 = array( + 'primary-color' => '#f86759', + 'page-bg' => array('background-color' => '#ececec'), + 'heading-color' => '#404143', + 'body-text-color' => '#704143', + 'link-color' => array('regular' => '#414244', 'hover' => '#f86759',), + 'menu-bg' => array('background-color' => '#414244'), + 'menu-color' => '#ffffff', + 'menu-hover-color' => '#ffffff', + 'submenu-color' => '#aeb2b7', + 'menu-primary-bg' => '#f86759', + 'menu-secondary-bg' => '#5e5f61', + 'menu-icon-line-bg' => array('background-color' => '#aeb2b7'), + 'menu-icon-color' => '#aeb2b7', + 'menu-icon-bg' => array('background-color' => '#414244'), + 'menu-active-icon-color' => '#f86759', + 'menu-active-icon-bg' => array('background-color' => '#ececec'), + 'submenu-active-icon-bg' => array('background-color' => '#f86759'), + 'box-bg' => array('background-color' => '#ffffff'), + 'box-head-bg' => array('background-color' => '#f86759'), + 'box-head-color' => '#ffffff', + 'button-primary-bg' => '#f86759', + 'button-primary-hover-bg' => '#ff743d', + 'button-secondary-bg' => '#a9a9a9', + 'button-secondary-hover-bg' => '#999999', + 'button-text-color' => '#ffffff', + 'form-bg' => '#ffffff', + 'form-text-color' => '#7d8a9d', + 'form-border-color' => '#e2e2e4', + 'logo-bg' => '#414244', + 'topbar-menu-color' => '#ffffff', + 'topbar-menu-bg' => array('background-color' => '#f86759'), + 'topbar-submenu-color' => '#aeb2b7', + 'topbar-submenu-bg' => '#414244', + 'topbar-submenu-hover-bg' => '#5e5f61', + 'logo' => array('url' => 'PLUGINURL/images/logo.png'), + 'logo_folded' => array('url' => 'PLUGINURL/images/logo-folded.png'), +); + +$color12 = array( + 'primary-color' => '#7a6a93', + 'page-bg' => array('background-color' => '#ececec'), + 'heading-color' => '#404143', + 'body-text-color' => '#704143', + 'link-color' => array('regular' => '#414244', 'hover' => '#7a6a93',), + 'menu-bg' => array('background-color' => '#414244'), + 'menu-color' => '#ffffff', + 'menu-hover-color' => '#ffffff', + 'submenu-color' => '#aeb2b7', + 'menu-primary-bg' => '#7a6a93', + 'menu-secondary-bg' => '#5e5f61', + 'menu-icon-line-bg' => array('background-color' => '#aeb2b7'), + 'menu-icon-color' => '#aeb2b7', + 'menu-icon-bg' => array('background-color' => '#414244'), + 'menu-active-icon-color' => '#7a6a93', + 'menu-active-icon-bg' => array('background-color' => '#ececec'), + 'submenu-active-icon-bg' => array('background-color' => '#7a6a93'), + 'box-bg' => array('background-color' => '#ffffff'), + 'box-head-bg' => array('background-color' => '#7a6a93'), + 'box-head-color' => '#ffffff', + 'button-primary-bg' => '#7a6a93', + 'button-primary-hover-bg' => '#ff743d', + 'button-secondary-bg' => '#a9a9a9', + 'button-secondary-hover-bg' => '#999999', + 'button-text-color' => '#ffffff', + 'form-bg' => '#ffffff', + 'form-text-color' => '#7d8a9d', + 'form-border-color' => '#e2e2e4', + 'logo-bg' => '#414244', + 'topbar-menu-color' => '#ffffff', + 'topbar-menu-bg' => array('background-color' => '#7a6a93'), + 'topbar-submenu-color' => '#aeb2b7', + 'topbar-submenu-bg' => '#414244', + 'topbar-submenu-hover-bg' => '#5e5f61', + 'logo' => array('url' => 'PLUGINURL/images/logo.png'), + 'logo_folded' => array('url' => 'PLUGINURL/images/logo-folded.png'), +); + + + +$color13 = array( + 'primary-color' => '#7a6a93', + 'page-bg' => array('background-color' => '#eef1f5'), + 'heading-color' => '#7d8a9d', + 'body-text-color' => '#7d8a9d', + 'link-color' => array('regular' => '#454c50', 'hover' => '#7a6a93',), + 'menu-bg' => array('background-color' => '#454c50'), + 'menu-color' => '#ffffff', + 'menu-hover-color' => '#ffffff', + 'submenu-color' => '#aeb2b7', + 'menu-primary-bg' => '#7a6a93', + 'menu-secondary-bg' => '#212026', + 'menu-icon-line-bg' => array('background-color' => '#aeb2b7'), + 'menu-icon-color' => '#aeb2b7', + 'menu-icon-bg' => array('background-color' => '#454c50'), + 'menu-active-icon-color' => '#7a6a93', + 'menu-active-icon-bg' => array('background-color' => '#eef1f5'), + 'submenu-active-icon-bg' => array('background-color' => '#7a6a93'), + 'box-bg' => array('background-color' => '#ffffff'), + 'box-head-bg' => array('background-color' => '#5bc9c5'), + 'box-head-color' => '#ffffff', + 'button-primary-bg' => '#7a6a93', + 'button-primary-hover-bg' => '#188791', + 'button-secondary-bg' => '#a9a9a9', + 'button-secondary-hover-bg' => '#999999', + 'button-text-color' => '#ffffff', + 'form-bg' => '#ffffff', + 'form-text-color' => '#7d8a9d', + 'form-border-color' => '#e2e2e4', + 'logo-bg' => '#454c50', + 'topbar-menu-color' => '#ffffff', + 'topbar-menu-bg' => array('background-color' => '#7a6a93'), + 'topbar-submenu-color' => '#aeb2b7', + 'topbar-submenu-bg' => '#454c50', + 'topbar-submenu-hover-bg' => '#212026', + 'logo' => array('url' => 'PLUGINURL/images/logo.png'), + 'logo_folded' => array('url' => 'PLUGINURL/images/logo-folded.png'), +); + + + + +$color14 = array( + 'primary-color' => '#705788', + 'page-bg' => array('background-color' => '#eef1f5'), + 'heading-color' => '#7d8a9d', + 'body-text-color' => '#7d8a9d', + 'link-color' => array('regular' => '#454c50', 'hover' => '#705788',), + 'menu-bg' => array('background-color' => '#454c50'), + 'menu-color' => '#ffffff', + 'menu-hover-color' => '#ffffff', + 'submenu-color' => '#aeb2b7', + 'menu-primary-bg' => '#705788', + 'menu-secondary-bg' => '#212026', + 'menu-icon-line-bg' => array('background-color' => '#aeb2b7'), + 'menu-icon-color' => '#aeb2b7', + 'menu-icon-bg' => array('background-color' => '#454c50'), + 'menu-active-icon-color' => '#705788', + 'menu-active-icon-bg' => array('background-color' => '#eef1f5'), + 'submenu-active-icon-bg' => array('background-color' => '#705788'), + 'box-bg' => array('background-color' => '#ffffff'), + 'box-head-bg' => array('background-color' => '#f8c866'), + 'box-head-color' => '#ffffff', + 'button-primary-bg' => '#705788', + 'button-primary-hover-bg' => '#188791', + 'button-secondary-bg' => '#a9a9a9', + 'button-secondary-hover-bg' => '#999999', + 'button-text-color' => '#ffffff', + 'form-bg' => '#ffffff', + 'form-text-color' => '#7d8a9d', + 'form-border-color' => '#e2e2e4', + 'logo-bg' => '#454c50', + 'topbar-menu-color' => '#ffffff', + 'topbar-menu-bg' => array('background-color' => '#705788'), + 'topbar-submenu-color' => '#aeb2b7', + 'topbar-submenu-bg' => '#454c50', + 'topbar-submenu-hover-bg' => '#212026', + 'logo' => array('url' => 'PLUGINURL/images/logo.png'), + 'logo_folded' => array('url' => 'PLUGINURL/images/logo-folded.png'), +); + + +$color15 = array( + 'primary-color' => '#f25145', + 'page-bg' => array('background-color' => '#eef1f5'), + 'heading-color' => '#7d8a9d', + 'body-text-color' => '#7d8a9d', + 'link-color' => array('regular' => '#454c50', 'hover' => '#f25145',), + 'menu-bg' => array('background-color' => '#454c50'), + 'menu-color' => '#ffffff', + 'menu-hover-color' => '#ffffff', + 'submenu-color' => '#aeb2b7', + 'menu-primary-bg' => '#f25145', + 'menu-secondary-bg' => '#212026', + 'menu-icon-line-bg' => array('background-color' => '#aeb2b7'), + 'menu-icon-color' => '#aeb2b7', + 'menu-icon-bg' => array('background-color' => '#454c50'), + 'menu-active-icon-color' => '#f25145', + 'menu-active-icon-bg' => array('background-color' => '#eef1f5'), + 'submenu-active-icon-bg' => array('background-color' => '#f25145'), + 'box-bg' => array('background-color' => '#ffffff'), + 'box-head-bg' => array('background-color' => '#283c4b'), + 'box-head-color' => '#ffffff', + 'button-primary-bg' => '#f25145', + 'button-primary-hover-bg' => '#188791', + 'button-secondary-bg' => '#a9a9a9', + 'button-secondary-hover-bg' => '#999999', + 'button-text-color' => '#ffffff', + 'form-bg' => '#ffffff', + 'form-text-color' => '#7d8a9d', + 'form-border-color' => '#e2e2e4', + 'logo-bg' => '#454c50', + 'topbar-menu-color' => '#ffffff', + 'topbar-menu-bg' => array('background-color' => '#f25145'), + 'topbar-submenu-color' => '#aeb2b7', + 'topbar-submenu-bg' => '#454c50', + 'topbar-submenu-hover-bg' => '#212026', + 'logo' => array('url' => 'PLUGINURL/images/logo.png'), + 'logo_folded' => array('url' => 'PLUGINURL/images/logo-folded.png'), +); + + + +$color16 = array( + 'primary-color' => '#3faa96', + 'page-bg' => array('background-color' => '#eef1f5'), + 'heading-color' => '#7d8a9d', + 'body-text-color' => '#7d8a9d', + 'link-color' => array('regular' => '#454c50', 'hover' => '#3faa96',), + 'menu-bg' => array('background-color' => '#454c50'), + 'menu-color' => '#ffffff', + 'menu-hover-color' => '#ffffff', + 'submenu-color' => '#aeb2b7', + 'menu-primary-bg' => '#3faa96', + 'menu-secondary-bg' => '#212026', + 'menu-icon-line-bg' => array('background-color' => '#aeb2b7'), + 'menu-icon-color' => '#aeb2b7', + 'menu-icon-bg' => array('background-color' => '#454c50'), + 'menu-active-icon-color' => '#3faa96', + 'menu-active-icon-bg' => array('background-color' => '#eef1f5'), + 'submenu-active-icon-bg' => array('background-color' => '#3faa96'), + 'box-bg' => array('background-color' => '#ffffff'), + 'box-head-bg' => array('background-color' => '#f8c866'), + 'box-head-color' => '#ffffff', + 'button-primary-bg' => '#3faa96', + 'button-primary-hover-bg' => '#188791', + 'button-secondary-bg' => '#a9a9a9', + 'button-secondary-hover-bg' => '#999999', + 'button-text-color' => '#ffffff', + 'form-bg' => '#ffffff', + 'form-text-color' => '#7d8a9d', + 'form-border-color' => '#e2e2e4', + 'logo-bg' => '#454c50', + 'topbar-menu-color' => '#ffffff', + 'topbar-menu-bg' => array('background-color' => '#3faa96'), + 'topbar-submenu-color' => '#aeb2b7', + 'topbar-submenu-bg' => '#454c50', + 'topbar-submenu-hover-bg' => '#212026', + 'logo' => array('url' => 'PLUGINURL/images/logo.png'), + 'logo_folded' => array('url' => 'PLUGINURL/images/logo-folded.png'), +); + + + + +$color17 = array( + 'primary-color' => '#ff8053', + 'page-bg' => array('background-color' => '#eef1f5'), + 'heading-color' => '#7d8a9d', + 'body-text-color' => '#7d8a9d', + 'link-color' => array('regular' => '#454c50', 'hover' => '#ff8053',), + 'menu-bg' => array('background-color' => '#454c50'), + 'menu-color' => '#ffffff', + 'menu-hover-color' => '#ffffff', + 'submenu-color' => '#aeb2b7', + 'menu-primary-bg' => '#ff8053', + 'menu-secondary-bg' => '#212026', + 'menu-icon-line-bg' => array('background-color' => '#aeb2b7'), + 'menu-icon-color' => '#aeb2b7', + 'menu-icon-bg' => array('background-color' => '#454c50'), + 'menu-active-icon-color' => '#ff8053', + 'menu-active-icon-bg' => array('background-color' => '#eef1f5'), + 'submenu-active-icon-bg' => array('background-color' => '#ff8053'), + 'box-bg' => array('background-color' => '#ffffff'), + 'box-head-bg' => array('background-color' => '#888bb6'), + 'box-head-color' => '#ffffff', + 'button-primary-bg' => '#ff8053', + 'button-primary-hover-bg' => '#188791', + 'button-secondary-bg' => '#a9a9a9', + 'button-secondary-hover-bg' => '#999999', + 'button-text-color' => '#ffffff', + 'form-bg' => '#ffffff', + 'form-text-color' => '#7d8a9d', + 'form-border-color' => '#e2e2e4', + 'logo-bg' => '#454c50', + 'topbar-menu-color' => '#ffffff', + 'topbar-menu-bg' => array('background-color' => '#ff8053'), + 'topbar-submenu-color' => '#aeb2b7', + 'topbar-submenu-bg' => '#454c50', + 'topbar-submenu-hover-bg' => '#212026', + 'logo' => array('url' => 'PLUGINURL/images/logo.png'), + 'logo_folded' => array('url' => 'PLUGINURL/images/logo-folded.png'), +); + + +$color18 = array( + 'primary-color' => '#1fb5ac', + 'page-bg' => array('background-color' => '#eef1f5'), + 'heading-color' => '#7d8a9d', + 'body-text-color' => '#7d8a9d', + 'link-color' => array('regular' => '#454c50', 'hover' => '#1fb5ac',), + 'menu-bg' => array('background-color' => '#454c50'), + 'menu-color' => '#ffffff', + 'menu-hover-color' => '#ffffff', + 'submenu-color' => '#aeb2b7', + 'menu-primary-bg' => '#1fb5ac', + 'menu-secondary-bg' => '#212026', + 'menu-icon-line-bg' => array('background-color' => '#aeb2b7'), + 'menu-icon-color' => '#aeb2b7', + 'menu-icon-bg' => array('background-color' => '#454c50'), + 'menu-active-icon-color' => '#1fb5ac', + 'menu-active-icon-bg' => array('background-color' => '#eef1f5'), + 'submenu-active-icon-bg' => array('background-color' => '#1fb5ac'), + 'box-bg' => array('background-color' => '#ffffff'), + 'box-head-bg' => array('background-color' => '#9972b5'), + 'box-head-color' => '#ffffff', + 'button-primary-bg' => '#1fb5ac', + 'button-primary-hover-bg' => '#188791', + 'button-secondary-bg' => '#a9a9a9', + 'button-secondary-hover-bg' => '#999999', + 'button-text-color' => '#ffffff', + 'form-bg' => '#ffffff', + 'form-text-color' => '#7d8a9d', + 'form-border-color' => '#e2e2e4', + 'logo-bg' => '#454c50', + 'topbar-menu-color' => '#ffffff', + 'topbar-menu-bg' => array('background-color' => '#1fb5ac'), + 'topbar-submenu-color' => '#aeb2b7', + 'topbar-submenu-bg' => '#454c50', + 'topbar-submenu-hover-bg' => '#212026', + 'logo' => array('url' => 'PLUGINURL/images/logo.png'), + 'logo_folded' => array('url' => 'PLUGINURL/images/logo-folded.png'), +); + + +$color19 = array( + 'primary-color' => '#e1615d', + 'page-bg' => array('background-color' => '#eef1f5'), + 'heading-color' => '#7d8a9d', + 'body-text-color' => '#7d8a9d', + 'link-color' => array('regular' => '#454c50', 'hover' => '#e1615d',), + 'menu-bg' => array('background-color' => '#454c50'), + 'menu-color' => '#ffffff', + 'menu-hover-color' => '#ffffff', + 'submenu-color' => '#aeb2b7', + 'menu-primary-bg' => '#e1615d', + 'menu-secondary-bg' => '#212026', + 'menu-icon-line-bg' => array('background-color' => '#aeb2b7'), + 'menu-icon-color' => '#aeb2b7', + 'menu-icon-bg' => array('background-color' => '#454c50'), + 'menu-active-icon-color' => '#e1615d', + 'menu-active-icon-bg' => array('background-color' => '#eef1f5'), + 'submenu-active-icon-bg' => array('background-color' => '#e1615d'), + 'box-bg' => array('background-color' => '#ffffff'), + 'box-head-bg' => array('background-color' => '#fdbd57'), + 'box-head-color' => '#ffffff', + 'button-primary-bg' => '#e1615d', + 'button-primary-hover-bg' => '#188791', + 'button-secondary-bg' => '#a9a9a9', + 'button-secondary-hover-bg' => '#999999', + 'button-text-color' => '#ffffff', + 'form-bg' => '#ffffff', + 'form-text-color' => '#7d8a9d', + 'form-border-color' => '#e2e2e4', + 'logo-bg' => '#454c50', + 'topbar-menu-color' => '#ffffff', + 'topbar-menu-bg' => array('background-color' => '#e1615d'), + 'topbar-submenu-color' => '#aeb2b7', + 'topbar-submenu-bg' => '#454c50', + 'topbar-submenu-hover-bg' => '#212026', + 'logo' => array('url' => 'PLUGINURL/images/logo.png'), + 'logo_folded' => array('url' => 'PLUGINURL/images/logo-folded.png'), +); + + +$color20 = array( + 'primary-color' => '#f17e56', + 'page-bg' => array('background-color' => '#eef1f5'), + 'heading-color' => '#7d8a9d', + 'body-text-color' => '#7d8a9d', + 'link-color' => array('regular' => '#454c50', 'hover' => '#f17e56',), + 'menu-bg' => array('background-color' => '#454c50'), + 'menu-color' => '#ffffff', + 'menu-hover-color' => '#ffffff', + 'submenu-color' => '#aeb2b7', + 'menu-primary-bg' => '#f17e56', + 'menu-secondary-bg' => '#212026', + 'menu-icon-line-bg' => array('background-color' => '#aeb2b7'), + 'menu-icon-color' => '#aeb2b7', + 'menu-icon-bg' => array('background-color' => '#454c50'), + 'menu-active-icon-color' => '#f17e56', + 'menu-active-icon-bg' => array('background-color' => '#eef1f5'), + 'submenu-active-icon-bg' => array('background-color' => '#f17e56'), + 'box-bg' => array('background-color' => '#ffffff'), + 'box-head-bg' => array('background-color' => '#695f56'), + 'box-head-color' => '#ffffff', + 'button-primary-bg' => '#f17e56', + 'button-primary-hover-bg' => '#188791', + 'button-secondary-bg' => '#a9a9a9', + 'button-secondary-hover-bg' => '#999999', + 'button-text-color' => '#ffffff', + 'form-bg' => '#ffffff', + 'form-text-color' => '#7d8a9d', + 'form-border-color' => '#e2e2e4', + 'logo-bg' => '#454c50', + 'topbar-menu-color' => '#ffffff', + 'topbar-menu-bg' => array('background-color' => '#f17e56'), + 'topbar-submenu-color' => '#aeb2b7', + 'topbar-submenu-bg' => '#454c50', + 'topbar-submenu-hover-bg' => '#212026', + 'logo' => array('url' => 'PLUGINURL/images/logo.png'), + 'logo_folded' => array('url' => 'PLUGINURL/images/logo-folded.png'), +); + + + +$color21 = array( + 'primary-color' => '#1fb5ac', + 'page-bg' => array('background-color' => '#ececec'), + 'heading-color' => '#404143', + 'body-text-color' => '#704143', + 'link-color' => array('regular' => '#414244', 'hover' => '#1fb5ac',), + 'menu-bg' => array('background-color' => '#414244'), + 'menu-color' => '#ffffff', + 'menu-hover-color' => '#ffffff', + 'submenu-color' => '#aeb2b7', + 'menu-primary-bg' => '#1fb5ac', + 'menu-secondary-bg' => '#5e5f61', + 'menu-icon-line-bg' => array('background-color' => '#aeb2b7'), + 'menu-icon-color' => '#aeb2b7', + 'menu-icon-bg' => array('background-color' => '#414244'), + 'menu-active-icon-color' => '#1fb5ac', + 'menu-active-icon-bg' => array('background-color' => '#ececec'), + 'submenu-active-icon-bg' => array('background-color' => '#1fb5ac'), + 'box-bg' => array('background-color' => '#ffffff'), + 'box-head-bg' => array('background-color' => '#1fb5ac'), + 'box-head-color' => '#ffffff', + 'button-primary-bg' => '#1fb5ac', + 'button-primary-hover-bg' => '#ff743d', + 'button-secondary-bg' => '#a9a9a9', + 'button-secondary-hover-bg' => '#999999', + 'button-text-color' => '#ffffff', + 'form-bg' => '#ffffff', + 'form-text-color' => '#7d8a9d', + 'form-border-color' => '#e2e2e4', + 'logo-bg' => '#414244', + 'topbar-menu-color' => '#ffffff', + 'topbar-menu-bg' => array('background-color' => '#1fb5ac'), + 'topbar-submenu-color' => '#aeb2b7', + 'topbar-submenu-bg' => '#414244', + 'topbar-submenu-hover-bg' => '#5e5f61', + 'logo' => array('url' => 'PLUGINURL/images/logo.png'), + 'logo_folded' => array('url' => 'PLUGINURL/images/logo-folded.png'), +); + + +$color22 = array( + 'primary-color' => '#7a628b', + 'page-bg' => array('background-color' => '#eef1f5'), + 'heading-color' => '#7d8a9d', + 'body-text-color' => '#7d8a9d', + 'link-color' => array('regular' => '#454c50', 'hover' => '#7a628b',), + 'menu-bg' => array('background-color' => '#454c50'), + 'menu-color' => '#ffffff', + 'menu-hover-color' => '#ffffff', + 'submenu-color' => '#aeb2b7', + 'menu-primary-bg' => '#7a628b', + 'menu-secondary-bg' => '#212026', + 'menu-icon-line-bg' => array('background-color' => '#aeb2b7'), + 'menu-icon-color' => '#aeb2b7', + 'menu-icon-bg' => array('background-color' => '#454c50'), + 'menu-active-icon-color' => '#7a628b', + 'menu-active-icon-bg' => array('background-color' => '#eef1f5'), + 'submenu-active-icon-bg' => array('background-color' => '#7a628b'), + 'box-bg' => array('background-color' => '#ffffff'), + 'box-head-bg' => array('background-color' => '#cd5d7b'), + 'box-head-color' => '#ffffff', + 'button-primary-bg' => '#7a628b', + 'button-primary-hover-bg' => '#188791', + 'button-secondary-bg' => '#a9a9a9', + 'button-secondary-hover-bg' => '#999999', + 'button-text-color' => '#ffffff', + 'form-bg' => '#ffffff', + 'form-text-color' => '#7d8a9d', + 'form-border-color' => '#e2e2e4', + 'logo-bg' => '#454c50', + 'topbar-menu-color' => '#ffffff', + 'topbar-menu-bg' => array('background-color' => '#7a628b'), + 'topbar-submenu-color' => '#aeb2b7', + 'topbar-submenu-bg' => '#454c50', + 'topbar-submenu-hover-bg' => '#212026', + 'logo' => array('url' => 'PLUGINURL/images/logo.png'), + 'logo_folded' => array('url' => 'PLUGINURL/images/logo-folded.png'), +); + + +$color23 = array( + 'primary-color' => '#34495e', + 'page-bg' => array('background-color' => '#eef1f5'), + 'heading-color' => '#7d8a9d', + 'body-text-color' => '#7d8a9d', + 'link-color' => array('regular' => '#454c50', 'hover' => '#34495e',), + 'menu-bg' => array('background-color' => '#454c50'), + 'menu-color' => '#ffffff', + 'menu-hover-color' => '#ffffff', + 'submenu-color' => '#aeb2b7', + 'menu-primary-bg' => '#34495e', + 'menu-secondary-bg' => '#212026', + 'menu-icon-line-bg' => array('background-color' => '#aeb2b7'), + 'menu-icon-color' => '#aeb2b7', + 'menu-icon-bg' => array('background-color' => '#454c50'), + 'menu-active-icon-color' => '#34495e', + 'menu-active-icon-bg' => array('background-color' => '#eef1f5'), + 'submenu-active-icon-bg' => array('background-color' => '#34495e'), + 'box-bg' => array('background-color' => '#ffffff'), + 'box-head-bg' => array('background-color' => '#1fdab5'), + 'box-head-color' => '#ffffff', + 'button-primary-bg' => '#34495e', + 'button-primary-hover-bg' => '#188791', + 'button-secondary-bg' => '#a9a9a9', + 'button-secondary-hover-bg' => '#999999', + 'button-text-color' => '#ffffff', + 'form-bg' => '#ffffff', + 'form-text-color' => '#7d8a9d', + 'form-border-color' => '#e2e2e4', + 'logo-bg' => '#454c50', + 'topbar-menu-color' => '#ffffff', + 'topbar-menu-bg' => array('background-color' => '#34495e'), + 'topbar-submenu-color' => '#aeb2b7', + 'topbar-submenu-bg' => '#454c50', + 'topbar-submenu-hover-bg' => '#212026', + 'logo' => array('url' => 'PLUGINURL/images/logo.png'), + 'logo_folded' => array('url' => 'PLUGINURL/images/logo-folded.png'), +); + + +$color24 = array( + 'primary-color' => '#568c98', + 'page-bg' => array('background-color' => '#eef1f5'), + 'heading-color' => '#7d8a9d', + 'body-text-color' => '#7d8a9d', + 'link-color' => array('regular' => '#454c50', 'hover' => '#568c98',), + 'menu-bg' => array('background-color' => '#454c50'), + 'menu-color' => '#ffffff', + 'menu-hover-color' => '#ffffff', + 'submenu-color' => '#aeb2b7', + 'menu-primary-bg' => '#568c98', + 'menu-secondary-bg' => '#212026', + 'menu-icon-line-bg' => array('background-color' => '#aeb2b7'), + 'menu-icon-color' => '#aeb2b7', + 'menu-icon-bg' => array('background-color' => '#454c50'), + 'menu-active-icon-color' => '#568c98', + 'menu-active-icon-bg' => array('background-color' => '#eef1f5'), + 'submenu-active-icon-bg' => array('background-color' => '#ec8e72'), + 'box-bg' => array('background-color' => '#ffffff'), + 'box-head-bg' => array('background-color' => '#ec8e72'), + 'box-head-color' => '#ffffff', + 'button-primary-bg' => '#568c98', + 'button-primary-hover-bg' => '#188791', + 'button-secondary-bg' => '#a9a9a9', + 'button-secondary-hover-bg' => '#999999', + 'button-text-color' => '#ffffff', + 'form-bg' => '#ffffff', + 'form-text-color' => '#7d8a9d', + 'form-border-color' => '#e2e2e4', + 'logo-bg' => '#454c50', + 'topbar-menu-color' => '#ffffff', + 'topbar-menu-bg' => array('background-color' => '#568c98'), + 'topbar-submenu-color' => '#aeb2b7', + 'topbar-submenu-bg' => '#454c50', + 'topbar-submenu-hover-bg' => '#212026', + 'logo' => array('url' => 'PLUGINURL/images/logo.png'), + 'logo_folded' => array('url' => 'PLUGINURL/images/logo-folded.png'), +); + + +$color25 = array( + 'primary-color' => '#32cf78', + 'page-bg' => array('background-color' => '#eef1f5'), + 'heading-color' => '#7d8a9d', + 'body-text-color' => '#7d8a9d', + 'link-color' => array('regular' => '#454c50', 'hover' => '#32cf78',), + 'menu-bg' => array('background-color' => '#454c50'), + 'menu-color' => '#ffffff', + 'menu-hover-color' => '#ffffff', + 'submenu-color' => '#aeb2b7', + 'menu-primary-bg' => '#32cf78', + 'menu-secondary-bg' => '#212026', + 'menu-icon-line-bg' => array('background-color' => '#aeb2b7'), + 'menu-icon-color' => '#aeb2b7', + 'menu-icon-bg' => array('background-color' => '#454c50'), + 'menu-active-icon-color' => '#32cf78', + 'menu-active-icon-bg' => array('background-color' => '#eef1f5'), + 'submenu-active-icon-bg' => array('background-color' => '#32cf78'), + 'box-bg' => array('background-color' => '#ffffff'), + 'box-head-bg' => array('background-color' => '#f25858'), + 'box-head-color' => '#ffffff', + 'button-primary-bg' => '#32cf78', + 'button-primary-hover-bg' => '#188791', + 'button-secondary-bg' => '#a9a9a9', + 'button-secondary-hover-bg' => '#999999', + 'button-text-color' => '#ffffff', + 'form-bg' => '#ffffff', + 'form-text-color' => '#7d8a9d', + 'form-border-color' => '#e2e2e4', + 'logo-bg' => '#454c50', + 'topbar-menu-color' => '#ffffff', + 'topbar-menu-bg' => array('background-color' => '#32cf78'), + 'topbar-submenu-color' => '#aeb2b7', + 'topbar-submenu-bg' => '#454c50', + 'topbar-submenu-hover-bg' => '#212026', + 'logo' => array('url' => 'PLUGINURL/images/logo.png'), + 'logo_folded' => array('url' => 'PLUGINURL/images/logo-folded.png'), +); + +$GLOBALS['legacy_color']['color1'] = $color1; // dark +$GLOBALS['legacy_color']['color2'] = $color2; // modify +$GLOBALS['legacy_color']['color3'] = $color3; // dark +$GLOBALS['legacy_color']['color4'] = $color4; // light +$GLOBALS['legacy_color']['color5'] = $color5; // dark +$GLOBALS['legacy_color']['color6'] = $color6; // light +$GLOBALS['legacy_color']['color7'] = $color7; // light +$GLOBALS['legacy_color']['color8'] = $color8; // light +$GLOBALS['legacy_color']['color9'] = $color9; // dark +$GLOBALS['legacy_color']['color10'] = $color10; // dark +$GLOBALS['legacy_color']['color11'] = $color11; // dark +$GLOBALS['legacy_color']['color12'] = $color12; // dark +$GLOBALS['legacy_color']['color13'] = $color13; // dark +$GLOBALS['legacy_color']['color14'] = $color14; // dark +$GLOBALS['legacy_color']['color15'] = $color15; // dark +$GLOBALS['legacy_color']['color16'] = $color16; // dark +$GLOBALS['legacy_color']['color17'] = $color17; // light +$GLOBALS['legacy_color']['color18'] = $color18; // light +$GLOBALS['legacy_color']['color19'] = $color19; // light +$GLOBALS['legacy_color']['color20'] = $color20; // light +$GLOBALS['legacy_color']['color21'] = $color21; // light + $GLOBALS['legacy_color']['color22'] = $color22; // light + $GLOBALS['legacy_color']['color23'] = $color23; // light + $GLOBALS['legacy_color']['color24'] = $color24; // light + $GLOBALS['legacy_color']['color25'] = $color25; // light + + + +/* List Names for options panel */ +$GLOBALS['legacy_color_list']['custom'] = "Custom Theme"; +$GLOBALS['legacy_color_list']['color1'] = "Theme 1"; +$GLOBALS['legacy_color_list']['color2'] = "Theme 2"; +$GLOBALS['legacy_color_list']['color3'] = "Theme 3"; +$GLOBALS['legacy_color_list']['color4'] = "Theme 4"; +$GLOBALS['legacy_color_list']['color5'] = "Theme 5"; +$GLOBALS['legacy_color_list']['color6'] = "Theme 6"; +$GLOBALS['legacy_color_list']['color7'] = "Theme 7"; +$GLOBALS['legacy_color_list']['color8'] = "Theme 8"; +$GLOBALS['legacy_color_list']['color9'] = "Theme 9"; +$GLOBALS['legacy_color_list']['color10'] = "Theme 10"; +$GLOBALS['legacy_color_list']['color11'] = "Theme 11"; // color1 single +$GLOBALS['legacy_color_list']['color12'] = "Theme 12"; // color1 single +$GLOBALS['legacy_color_list']['color13'] = "Theme 13"; // color1 single +$GLOBALS['legacy_color_list']['color14'] = "Theme 14"; // color2 single +$GLOBALS['legacy_color_list']['color15'] = "Theme 15"; // color2 single +$GLOBALS['legacy_color_list']['color16'] = "Theme 16"; // color2 single +$GLOBALS['legacy_color_list']['color17'] = "Theme 17"; // color3 single +$GLOBALS['legacy_color_list']['color18'] = "Theme 18"; // color3 single +$GLOBALS['legacy_color_list']['color19'] = "Theme 19"; +$GLOBALS['legacy_color_list']['color20'] = "Theme 20"; +$GLOBALS['legacy_color_list']['color21'] = "Theme 21"; + $GLOBALS['legacy_color_list']['color22'] = "Theme 22"; + $GLOBALS['legacy_color_list']['color23'] = "Theme 23"; + $GLOBALS['legacy_color_list']['color24'] = "Theme 24"; + $GLOBALS['legacy_color_list']['color25'] = "Theme 25"; +?> \ No newline at end of file diff --git a/plugins/legacy-admin/lib/legacy-fonts.php b/plugins/legacy-admin/lib/legacy-fonts.php new file mode 100644 index 000000000..44a811823 --- /dev/null +++ b/plugins/legacy-admin/lib/legacy-fonts.php @@ -0,0 +1,276 @@ + + + + + + + + \ No newline at end of file diff --git a/plugins/legacy-admin/lib/legacy-functions.php b/plugins/legacy-admin/lib/legacy-functions.php new file mode 100644 index 000000000..777df7365 --- /dev/null +++ b/plugins/legacy-admin/lib/legacy-functions.php @@ -0,0 +1,1014 @@ + +console.log('Legacy WP Admin: WordPress Version Not Supported Yet!');"; + } +} + +function legacy_menumng_body_classes($classes) { + return $classes." tp-menumng"; +} + +function legacyadmin_network($default) { + + if (is_multisite() && legacy_network_active()) { + global $blog_id; + $current_blog_id = $blog_id; + switch_to_blog(1); + $site_specific_legacyadmin = get_option("legacy_demo"); + $legacyadmin = $site_specific_legacyadmin; + switch_to_blog($current_blog_id); + } else { + $legacyadmin = $default; + } + + return $legacyadmin; +} + +function legacy_dynamic_css_settings() { + + global $legacy_css_ver; + + global $legacyadmin; + $csstype = legacy_dynamic_css_type(); + + //echo "csstype: ".$csstype; + + if (isset($csstype) && $csstype != "custom") { + // enqueue default/ inbuilt CSS styles + add_action('admin_enqueue_scripts', 'legacy_default_css_colors', 99); + } else { + + // load custom CSS style generated dynamically + + $css_dir = trailingslashit(plugin_dir_path(__FILE__) . '../' . $legacy_css_ver); + + // if Not multisite + if (!is_multisite()) { + if (is_writable($css_dir)) { + //write the file if isn't there + if (!file_exists($css_dir . '/legacy-colors.css')) { + legacy_regenerate_dynamic_css_file(); + } + add_action('admin_enqueue_scripts', 'legacy_dynamic_enqueue_style', 99); + } else { + add_action('admin_head', 'legacy_wp_head_css'); + } + } else if (is_multisite() && legacy_network_active()) { + // multisite and network active + if (is_writable($css_dir)) { + + global $wpdb; + global $blog_id; + $current_blog_id = $blog_id; + + $current_site = 1; + switch_to_blog(1); + + //write the file if isn't there + if (!file_exists($css_dir . '/legacy-colors-site-' . $current_site . '.css')) { + + $site_specific_legacyadmin = get_option("legacy_demo"); + $filename = 'site-' . $current_site; + //print_r($site_specific_legacyadmin); + legacy_regenerate_dynamic_css_file($site_specific_legacyadmin, $filename); + } + add_action('admin_enqueue_scripts', 'legacy_dynamic_enqueue_style', 99); + + switch_to_blog($current_blog_id); + } else { + add_action('admin_head', 'legacy_wp_head_css'); + } + } else { + // multisite and not network active + // regenerate css file for the individual site only and enqueue it. + if (is_writable($css_dir)) { + + global $wpdb; + $current_site = $wpdb->blogid; + + //write the file if isn't there + if (!file_exists($css_dir . '/legacy-colors-site-' . $current_site . '.css')) { + + $site_specific_legacyadmin = get_option("legacy_demo"); + $filename = 'site-' . $current_site; + //print_r($site_specific_legacyadmin); + legacy_regenerate_dynamic_css_file($site_specific_legacyadmin, $filename); + } + add_action('admin_enqueue_scripts', 'legacy_dynamic_enqueue_style', 99); + } else { + add_action('admin_head', 'legacy_wp_head_css'); + } + } + } +} + +function legacy_framework_settings_saved() { + + global $legacy_css_ver; + global $legacyadmin; + + $css_dir = trailingslashit(plugin_dir_path(__FILE__) . '../' . $legacy_css_ver); + + // if Not multisite + if (!is_multisite()) { + + if (is_writable($css_dir)) { + legacy_regenerate_dynamic_css_file(); + } + } else if (is_multisite() && legacy_network_active()) { + global $wpdb; + $current_blog_id = $wpdb->blogid; + $current_site = 1; + switch_to_blog(1); + + $site_specific_legacyadmin = get_option("legacy_demo"); + $filename = 'site-' . $current_site; + //print_r($site_specific_legacyadmin); + legacy_regenerate_dynamic_css_file($site_specific_legacyadmin, $filename); + switch_to_blog($current_blog_id); + } else { + + // multisite + // regenerate css file for the individual site only + + if (is_writable($css_dir)) { + + global $wpdb; + $current_site = $wpdb->blogid; + + $site_specific_legacyadmin = get_option("legacy_demo"); + $filename = 'site-' . $current_site; + //print_r($site_specific_legacyadmin); + legacy_regenerate_dynamic_css_file($site_specific_legacyadmin, $filename); + } + } +} + +function legacy_scripts() { + global $legacyadmin; + $url = plugins_url('/', __FILE__) . '../js/legacy-scripts.js'; + wp_deregister_script('legacy-scripts-js'); + wp_register_script('legacy-scripts-js', $url); + wp_enqueue_script('legacy-scripts-js'); + + $url = plugins_url('/', __FILE__) . '../js/legacy-smoothscroll.min.js'; + wp_deregister_script('legacy-smoothscroll-js'); + wp_register_script('legacy-smoothscroll-js', $url); + wp_enqueue_script('legacy-smoothscroll-js'); + + wp_localize_script('legacy-scripts-js', 'legacy_vars', array( + 'legacy_nonce' => wp_create_nonce('legacy-nonce') + ) + ); + + + if (file_exists(plugin_dir_path(__FILE__) . '../demo-settings/legacy-settings-panel-css.css')) { + wp_deregister_style('legacy-settings-panel-css'); + wp_register_style('legacy-settings-panel-css', plugins_url('/', __FILE__) . "../demo-settings/legacy-settings-panel-css.css"); + wp_enqueue_style('legacy-settings-panel-css'); + } + + if (file_exists(plugin_dir_path(__FILE__) . '../demo-settings/legacy-settings-panel-js.js')) { + wp_deregister_script('legacy-settings-panel-js'); + wp_register_script('legacy-settings-panel-js', plugins_url('/', __FILE__) . "../demo-settings/legacy-settings-panel-js.js"); + wp_enqueue_script('legacy-settings-panel-js'); + } +} + +function legacy_admin_css() { + global $legacy_css_ver; + + $url = plugins_url('/', __FILE__) . '../' . $legacy_css_ver . '/legacy-admin.min.css'; + wp_deregister_style('legacy-admin', $url); + wp_register_style('legacy-admin', $url); + wp_enqueue_style('legacy-admin'); + + /* ame */ + $url = plugins_url('/', __FILE__) . '../css/legacy-ame.min.css'; + wp_deregister_style('legacy-ame', $url); + wp_register_style('legacy-ame', $url); + wp_enqueue_style('legacy-ame'); + + /* wordfence */ + $url = plugins_url('/', __FILE__) . '../css/legacy-wordfence.min.css'; + wp_deregister_style('legacy-wordfence', $url); + wp_register_style('legacy-wordfence', $url); + wp_enqueue_style('legacy-wordfence'); + + /* other plugins compatibility */ + $url = plugins_url('/', __FILE__) . '../css/legacy-external.min.css'; + wp_deregister_style('legacy-external', $url); + wp_register_style('legacy-external', $url); + wp_enqueue_style('legacy-external'); +} + + +function legacy_dynamic_css_type() { + + //global $wpdb; + //echo $wpdb->blogid; + + global $legacy_css_ver; + global $legacyadmin; + + + $csstype = "custom"; + + if (is_multisite()) { + + global $blog_id; + $current_blog_id = $blog_id; + $network_active = legacy_network_active(); + + //echo "

    id:".$current_blog_id; + + if ($network_active) { + //if network activate, switch to main blog + switch_to_blog(1); + } + + //echo $blog_id; + // get current site framework options and thus gets it csstype value + $current_site = get_option("legacy_demo"); + if (isset($current_site['dynamic-css-type'])) { + $csstype = $current_site['dynamic-css-type']; + } + //print_r($current_site); + //echo $csstype; + if ($network_active) { + // switch back to current blog again if network active + switch_to_blog($current_blog_id); + } + //echo $blog_id; + } else { + + + if(!isset($legacyadmin) || (isset($legacyadmin) && is_array($legacyadmin) && sizeof($legacyadmin) == 0 )){ + $legacyadmin = get_option("legacy_demo"); + } + + if (isset($legacyadmin['dynamic-css-type'])) { + $csstype = $legacyadmin['dynamic-css-type']; + } + } + + /* --------------- Legacy Settings Panel - for demo purposes ---------------- */ + if (!has_action('plugins_loaded', 'legacy_regenerate_all_dynamic_css_file') && has_action('admin_footer', 'legacy_admin_footer_function')) { + if (file_exists(plugin_dir_path(__FILE__) . '../demo-settings/legacy-settings-panel-session.php')) { + include( trailingslashit(dirname(__FILE__)) . '../demo-settings/legacy-settings-panel-session.php' ); + } + } + //echo $csstype; + return $csstype; +} + +function legacy_default_css_colors() { + global $legacy_css_ver; + global $legacyadmin; + $csstype = legacy_dynamic_css_type(); + //echo "default:".$csstype; + $css_path = trailingslashit(plugins_url('/', __FILE__) . '../' . $legacy_css_ver . '/colors'); + $css_dir = trailingslashit(plugin_dir_path(__FILE__) . '../' . $legacy_css_ver . '/colors'); + + if (isset($csstype) && $csstype != "custom" && trim($csstype) != "") { + + $style_color = trim($csstype); + + if (file_exists($css_dir . 'legacy-colors-' . $style_color . '.css')) { + wp_deregister_style('legacy-colors'); + wp_register_style('legacy-colors', $css_path . 'legacy-colors-' . $style_color . '.css'); + wp_enqueue_style('legacy-colors'); + } else { + // enqueue the default legacy-colors.css file + legacy_dynamic_enqueue_style(); + } + } +} + +function legacy_dynamic_enqueue_style() { + global $legacy_css_ver; + + if (!is_multisite()) { + $url = plugins_url('/', __FILE__) . '../' . $legacy_css_ver . '/legacy-colors.css'; + } else if (is_multisite() && legacy_network_active()) { + // IF NETWORK ACTIVE + global $wpdb; + $current_site = 1; + $url = plugins_url('/', __FILE__) . '../' . $legacy_css_ver . '/legacy-colors-site-' . $current_site . '.css'; + } else { + // IF NOT NETWORK ACTIVE - FOR INDIVIDUAL SITES ONLY + global $wpdb; + $current_site = $wpdb->blogid; + $url = plugins_url('/', __FILE__) . '../' . $legacy_css_ver . '/legacy-colors-site-' . $current_site . '.css'; + } + wp_deregister_style('legacy-colors'); + wp_register_style('legacy-colors', $url); + wp_enqueue_style('legacy-colors'); + + $style_type = 'custom'; +} + +function legacy_wp_head_css() { + + global $legacy_css_ver; + global $legacyadmin; + + global $wpdb; + $current_blog_id = $wpdb->blogid; + + if (is_multisite() && legacy_network_active()) { + switch_to_blog(1); + $site_specific_legacyadmin = get_option("legacy_demo"); + $legacyadmin = $site_specific_legacyadmin; + switch_to_blog($current_blog_id); + } + //print_r($legacyadmin); + + echo ''; + + $style_type = 'custom'; +} + +/* ------------ Generate / Update dynamic CSS file on saving / changing plugin settings ---------- */ + +function legacy_regenerate_dynamic_css_file($newlegacyadmin = array(), $filename = "", $basedir = "") { + + global $legacy_css_ver; + global $legacyadmin; + if (sizeof($legacyadmin) == 0) { + $legacyadmin = get_option("legacy_demo"); + } + if (is_array($newlegacyadmin) && sizeof($newlegacyadmin) > 0) { + $legacyadmin = $newlegacyadmin; + } + + + global $legacy_color; + + $newfilename = "legacy-colors"; + if (trim($filename) != "") { + $newfilename = "legacy-colors-" . $filename; + } + + $dynamic_css = trailingslashit(plugin_dir_path(__FILE__) . '../' . $legacy_css_ver) . 'dynamic_css.php'; + ob_start(); // Capture all output (output buffering) + require($dynamic_css); // Generate CSS + $css = ob_get_clean(); // Get generated CSS (output buffering) + $css = legacy_compress_css($css); + + //echo "
    "; echo $css; echo "
    "; + + $css_dir = trailingslashit(plugin_dir_path(__FILE__) . '../' . $legacy_css_ver); + + if (isset($basedir) && $basedir != "") { + $css_dir = $basedir; + } + + require_once(ABSPATH . 'wp-admin/includes/file.php'); + WP_Filesystem(); + global $wp_filesystem; + if (!$wp_filesystem->put_contents($css_dir . '/' . $newfilename . '.css', $css, 0644)) { + return true; + } +} + +/* * ***************** + * legacy_regenerate_all_dynamic_css_file(); + * Generate all Colors CSS files Function + * Function called in main plugin file + * ******************* */ + +function legacy_regenerate_all_dynamic_css_file() { + + global $legacy_css_ver; + global $legacyadmin; + + if (isset($legacyadmin) && is_array($legacyadmin) && sizeof($legacyadmin) == 0) { + //switch_to_blog(1); + $get_legacyadmin = get_option("legacy_demo"); + $legacyadmin = $get_legacyadmin; + } + + $legacyadmin_backup = $legacyadmin; + //echo "hi"; + //print_r($legacyadmin_backup); + //die(); + + global $legacy_color; + + $basedir = trailingslashit(plugin_dir_path(__FILE__) . '../' . $legacy_css_ver . '/colors'); + // loop through each color + foreach ($legacy_color as $filename => $dyn_data) { + $legacyadmin = legacy_newdata($dyn_data); + //echo $filename."
    "; print_r($legacyadmin); echo "
    "; + //regenerate new css file + legacy_regenerate_dynamic_css_file($legacyadmin, $filename, $basedir); + $legacyadmin = $legacyadmin_backup; + } + + // V. Imp to restore the original $data in variable back. + $legacyadmin = $legacyadmin_backup; + //die; +} + +function legacy_newdata($dyn_data) { + + global $legacy_css_ver; + global $legacyadmin; + + // loop through dynamic values + foreach ($dyn_data as $type => $val) { + // string type options + if (!is_array($val) && trim($val) != "") { + $legacyadmin[$type] = $val; + } + + // array type options + if (is_array($val) && sizeof($val) > 0) { + foreach ($val as $type2 => $val2) { + if (!is_array($val2) && trim($val2) != "") { + $legacyadmin[$type][$type2] = $val2; + } + } + } + } + + return $legacyadmin; +} + +function legacy_compress_css($css) { + + /* remove comments */ + $css = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $css); + + /* remove tabs, spaces, newlines, etc. */ + $css = str_replace(array("\r\n", "\r", "\n", "\t", ' ', ' ', ' '), '', $css); + return $css; +} + +function legacyadmin_access() { + + global $legacyadmin; + $str = ""; + + $element = 'enable-allusers-legacyadmin'; + if (isset($legacyadmin[$element]) && $legacyadmin[$element] != "1" && $legacyadmin[$element] == "0" && !$legacyadmin[$element]) { + if (!is_admin()) { + $str .= ".toplevel_page__legacyoptions{display:none;}"; + $str .= "#wp-admin-bar-_legacyoptions{display:none;}"; + } + } + + echo ""; +} + +function legacy_custom_css() { + + global $legacyadmin; + $legacyadmin = legacyadmin_network($legacyadmin); + + $str = ""; + + //print_r($legacyadmin); + + $element = 'custom-css'; + if (isset($legacyadmin[$element]) && trim($legacyadmin[$element]) != "") { + $str .= $legacyadmin[$element]; + } + + echo ""; +} + + +function legacy_login_custom_css(){ + + global $legacyadmin; + $legacyadmin = legacyadmin_network($legacyadmin); + + $str = ""; + + $element = 'custom-login-css'; + if(isset($legacyadmin[$element]) && trim($legacyadmin[$element]) != ""){ + $str .= $legacyadmin[$element]; + } + + echo ""; +} +function legacy_extra_css() { + + global $legacyadmin; + + $legacyadmin = legacyadmin_network($legacyadmin); + //print_r($legacyadmin); + + $transform = "uppercase"; + $style = ""; + $upgrade = "inline"; + + + /* ----------------- */ + /* Check admin side theme permission */ + $get_admintheme_page = legacy_get_option("legacyadmin_admintheme_page", "enable"); + + $adminside = true; + if (isset($get_admintheme_page) && $get_admintheme_page == "disable") { + $adminside = false; + } + //echo $adminside; + + if ($adminside) { + $element = 'menu-transform-text'; + if (isset($legacyadmin[$element]) && trim($legacyadmin[$element]) != "") { + $transform = $legacyadmin[$element]; + } + $style .= " #adminmenu .wp-submenu-head, #adminmenu a.menu-top { text-transform:" . $transform . " !important; } "; + } + + /* ----------------- */ + + + $element = 'footer_version'; + if (isset($legacyadmin[$element]) && trim($legacyadmin[$element]) != "") { + if ($legacyadmin[$element] == "0") { + $upgrade = "none"; + } + } + $style .= " #wpfooter #footer-upgrade { display:" . $upgrade . " !important; } "; + + echo ""; +} + +function legacy_disable_menu() { + + $str = ""; + $menudisable = get_option("legacyadmin_menudisable", ""); + $exp = array_unique(array_filter(explode("|", $menudisable))); + foreach ($exp as $menuid) { + $str .= "#" . $menuid . ", "; + } + + $str = substr($str, 0, -2); + +} + +function legacyprint($name, $arr) { + + echo "
    "; + echo $name; + echo "
    ";
    +    print_r($arr);
    +    echo "
    "; +} + +//change admin footer text +function legacy_footer_admin() { + + global $legacyadmin; + + $legacyadmin = legacyadmin_network($legacyadmin); + + $str = 'Thank you for creating with
    WordPress and Legacy - White Label WordPress Admin Theme'; + //print_r($legacyadmin); + + + $element = 'footer_text'; + if (isset($legacyadmin[$element]) && trim($legacyadmin[$element]) != "") { + $str = $legacyadmin[$element]; + } + + echo $str; + + $get_menumng_page = legacy_get_option( "legacyadmin_menumng_page","enable"); + if($get_menumng_page != "disable"){ + legacy_menu_management_counts(); + } + +} + +function legacy_menu_management_counts(){ + + //echo "
    ";
    +
    +    $counts = wp_get_update_data();
    +    $str = "";
    +    //echo "
    "; + //die(); + +} + + +function legacy_multisite_allsites() { + + $arr = array(); + // get all blogs + $blogs = get_blog_list(0, 'all'); + + if (0 < count($blogs)) : + foreach ($blogs as $blog) : + switch_to_blog($blog['blog_id']); + + if (get_theme_mod('show_in_home', 'on') !== 'on') { + continue; + } + + $blog_details = get_blog_details($blog['blog_id']); + //print_r($blog_details); + //echo "
    "; print_r(get_blog_option( $blog[ 'blog_id' ], 'legacy_demo' )); echo "
    "; + + $id = $blog['blog_id']; + $name = $blog_details->blogname; + $arr[$id] = $name; + + endforeach; + endif; + + return $arr; +} + +function legacy_network_active() { + + + if (!function_exists('is_plugin_active_for_network')) { + require_once( ABSPATH . '/wp-admin/includes/plugin.php' ); + } + + // Makes sure the plugin is defined before trying to use it + if (is_plugin_active_for_network('legacy-admin/legacy-core.php')) { + return true; + } + + return false; +} + +function legacy_add_option($variable, $default) { + if (legacy_network_active()) { + add_site_option($variable, $default); + } else { + add_option($variable, $default); + } +} + +function legacy_get_option($variable, $default) { + if (legacy_network_active()) { + return get_site_option($variable, $default); + } else { + return get_option($variable, $default); + } +} + +function legacy_update_option($variable, $default) { + if (legacy_network_active()) { + update_site_option($variable, $default); + } else { + update_option($variable, $default); + } +} + +function legacy_get_user_type() { + $get_admin_menumng_page = legacy_get_option("legacyadmin_admin_menumng_page", "enable"); + + $enablemenumng = true; + if ((is_super_admin() || current_user_can('manage_options')) && $get_admin_menumng_page == "disable") { + $enablemenumng = false; + } + return $enablemenumng; +} + +function legacy_generate_inbuilt_theme_import_file() { + global $legacy_color; + foreach ($legacy_color as $key => $value) { + $str = ""; + $str .= '{"dynamic-css-type":"custom","primary-color":"' . $value['primary-color'] . '",'; + $str .= '"page-bg":{"background-color":"' . $value['page-bg']['background-color'] . '"},'; + $str .= '"heading-color":"' . $value['heading-color'] . '",'; + $str .= '"body-text-color":"' . $value['body-text-color'] . '",'; + $str .= '"link-color":{"regular":"' . $value['link-color']['regular'] . '","hover":"' . $value['link-color']['hover'] . '"},'; + $str .= '"menu-bg":{"background-color":"' . $value['menu-bg']['background-color'] . '"},'; + $str .= '"menu-color":"' . $value['menu-color'] . '",'; + $str .= '"menu-hover-color":"' . $value['menu-hover-color'] . '",'; + $str .= '"submenu-color":"' . $value['submenu-color'] . '",'; + $str .= '"menu-primary-bg":"' . $value['menu-primary-bg'] . '",'; + $str .= '"menu-secondary-bg":"' . $value['menu-secondary-bg'] . '",'; + $str .= '"menu-icon-line-bg":{"background-color":"' . $value['menu-icon-line-bg']['background-color'] . '"},'; + $str .= '"menu-icon-color":"' . $value['menu-icon-color'] . '",'; + $str .= '"menu-icon-bg":{"background-color":"' . $value['menu-icon-bg']['background-color'] . '"},'; + $str .= '"menu-active-icon-color":"' . $value['menu-active-icon-color'] . '",'; + $str .= '"menu-active-icon-bg":{"background-color":"' . $value['menu-active-icon-bg']['background-color'] . '"},'; + $str .= '"submenu-active-icon-bg":{"background-color":"' . $value['submenu-active-icon-bg']['background-color'] . '"},'; + $str .= '"logo-bg":"' . $value['logo-bg'] . '",'; + $str .= '"box-bg":{"background-color":"' . $value['box-bg']['background-color'] . '"},'; + $str .= '"box-head-bg":{"background-color":"' . $value['box-head-bg']['background-color'] . '"},'; + $str .= '"box-head-color":"' . $value['box-head-color'] . '",'; + $str .= '"button-primary-bg":"' . $value['button-primary-bg'] . '",'; + $str .= '"button-primary-hover-bg":"' . $value['button-primary-hover-bg'] . '",'; + $str .= '"button-secondary-bg":"' . $value['button-secondary-bg'] . '",'; + $str .= '"button-secondary-hover-bg":"' . $value['button-secondary-hover-bg'] . '",'; + $str .= '"button-text-color":"' . $value['button-text-color'] . '",'; + $str .= '"form-bg":"' . $value['form-bg'] . '",'; + $str .= '"form-text-color":"' . $value['form-text-color'] . '",'; + $str .= '"form-border-color":"' . $value['form-border-color'] . '",'; + $str .= '"topbar-menu-color":"' . $value['topbar-menu-color'] . '",'; + $str .= '"topbar-menu-bg":{"background-color":"' . $value['topbar-menu-bg']['background-color'] . '"},'; + $str .= '"topbar-submenu-color":"' . $value['topbar-submenu-color'] . '",'; + $str .= '"topbar-submenu-bg":"' . $value['topbar-submenu-bg'] . '",'; + $str .= '"topbar-submenu-hover-bg":"' . $value['topbar-submenu-hover-bg'] . '","redux_import_export":"","redux-backup":1}'; + + legacy_inbuilttheme_file_create($key, $str); + } +} + +function legacy_inbuilttheme_file_create($filename, $str) { + + if (trim($filename) != "" && trim($str) != "") { + $css_dir = trailingslashit(plugin_dir_path(__FILE__) . '../inbuilt_themes_import'); + + require_once(ABSPATH . 'wp-admin/includes/file.php'); + WP_Filesystem(); + global $wp_filesystem; + if (!$wp_filesystem->put_contents($css_dir . '/' . $filename . '.txt', $str, 0644)) { + return true; + } + } +} + +function legacy_admin_footer_function() { + + + /* --------------- Settings Panel ----------------- */ + if (!has_action('plugins_loaded', 'legacy_regenerate_all_dynamic_css_file')) { + if (file_exists(plugin_dir_path(__FILE__) . '../demo-settings/legacy-settings-panel.php')) { + require_once( trailingslashit(dirname(__FILE__)) . '../demo-settings/legacy-settings-panel.php' ); + } + } +} + + +//add_action('wp_ajax_legacy_alternate_save', 'legacy_alternate_save_logic'); + +function legacy_alternate_save_logic() { + + if (!isset($_POST['legacy_nonce']) || !wp_verify_nonce($_POST['legacy_nonce'], 'legacy-nonce')) { + die('Permissions check failed. Please login or refresh (if already logged in) the page, then try Again.'); + } + + //print_r($_POST); + $values = $_POST['values']; + + $values = stripslashes($_POST["values"]); + + $values=''; + + //echo $values; + + //legacy_update_option("legacy_demo", $values); + die(); +} + + + +function legacy_screen_tabs(){ + + + global $legacy_css_ver; + global $legacyadmin; + + $legacyadmin = legacyadmin_network($legacyadmin); + + /*Remove Screen Option & Help Tabs*/ + + $screenoption = true; + $element = 'screen_option_tab'; + + //echo $legacyadmin[$element]; + + if(isset($legacyadmin[$element]) && trim($legacyadmin[$element]) != ""){ + if($legacyadmin[$element] == "0"){ + $screenoption = false; + }} + + $screenhelp = true; + $element = 'screen_help_tab'; + if(isset($legacyadmin[$element]) && trim($legacyadmin[$element]) != ""){ + if($legacyadmin[$element] == "0"){ + $screenhelp = false; + }} + + if(!$screenoption){ + add_filter('screen_options_show_screen', '__return_false'); + } + + if(!$screenhelp){ + add_action('admin_head', 'legacy_remove_help_tabs'); + } + +} + +function legacy_remove_help_tabs() { + $screen = get_current_screen(); + $screen->remove_help_tabs(); +} + + + +add_filter('admin_title', 'legacy_admin_title_update', 10, 2); + +function legacy_admin_title_update($admin_title, $title) +{ + return get_bloginfo('name').' • '.$title; +} + + + +function legacy_email_settings(){ + global $legacyadmin; + $legacyadmin = legacyadmin_network($legacyadmin); + + if(isset($legacyadmin['from-mail-email']) && trim($legacyadmin['from-mail-email']) != ""){ + // wp_mail_from + add_filter('wp_mail_from', 'legacy_from_mail'); + + } + + if(isset($legacyadmin['from-mail-name']) && trim($legacyadmin['from-mail-name']) != ""){ + // wp_mail_from_name + add_filter('wp_mail_from_name', 'legacy_from_mail_name'); + } + + +} + +function legacy_from_mail($original_email_address) { + + global $legacyadmin; + $legacyadmin = legacyadmin_network($legacyadmin); + $ret = $legacyadmin['from-mail-email']; + // $ret = "info@domain.com"; + return $ret; +} + +function legacy_from_mail_name($original_email_address_name) { + global $legacyadmin; + $legacyadmin = legacyadmin_network($legacyadmin); + $ret = $legacyadmin['from-mail-name']; + // $ret = "info"; + return $ret; + } + +?> \ No newline at end of file diff --git a/plugins/legacy-admin/lib/legacy-login.php b/plugins/legacy-admin/lib/legacy-login.php new file mode 100644 index 000000000..7338dd31c --- /dev/null +++ b/plugins/legacy-admin/lib/legacy-login.php @@ -0,0 +1,172 @@ + +"; print_r($legacyadmin); echo ""; + + global $legacy_css_ver; + + $url = plugins_url('/', __FILE__) . '../' . $legacy_css_ver . '/legacy-login.min.css'; + wp_deregister_style('legacy-login'); + wp_register_style('legacy-login', $url); + wp_enqueue_style('legacy-login'); + + $url = plugins_url('/', __FILE__) . '../js/legacy-login-scripts.js'; + wp_deregister_script('legacy-login-scripts-js'); + wp_register_script('legacy-login-scripts-js', $url); + wp_enqueue_script('legacy-login-scripts-js'); + + + echo "\n\n"; + + +} + +function legacy_custom_loginlogo_url() { + + global $legacyadmin; + $legacyadmin = legacyadmin_network($legacyadmin); + + $logourl = "https://wordpress.org/"; + + if (isset($legacyadmin['logo-url']) && trim($legacyadmin['logo-url']) != "") { + $logourl = $legacyadmin['logo-url']; + } + return $logourl; +} + +function legacy_login_options() { + + global $legacyadmin; + $legacyadmin = legacyadmin_network($legacyadmin); + + // back to blog + $backtoblog = "block"; + $element = 'backtosite_login_link'; + + if (isset($legacyadmin[$element]) && trim($legacyadmin[$element]) != "") { + if ($legacyadmin[$element] == "0") { + $backtoblog = "none"; + } + } + + $style = ""; + $style .= " #backtoblog { display:" . $backtoblog . " !important; } "; + + + // forgot password + + $forgot = "block"; + $element = 'forgot_login_link'; + + if (isset($legacyadmin[$element]) && trim($legacyadmin[$element]) != "") { + if ($legacyadmin[$element] == "0") { + $forgot = "none"; + } + } + + $style .= " #nav { display:" . $forgot . " !important; } "; + + echo ""; +} + +// change title +function legacy_loginlogo_title() { + global $legacyadmin; + $legacyadmin = legacyadmin_network($legacyadmin); + + $logourl = ""; + + if (isset($legacyadmin['login-logo-title']) && trim($legacyadmin['login-logo-title']) != "") { + $logourl = $legacyadmin['login-logo-title']; + } + return $logourl; +} + +add_filter('login_headertext', 'legacy_loginlogo_title'); + + + +?> \ No newline at end of file diff --git a/plugins/legacy-admin/lib/legacy-logo.php b/plugins/legacy-admin/lib/legacy-logo.php new file mode 100644 index 000000000..450dfe59d --- /dev/null +++ b/plugins/legacy-admin/lib/legacy-logo.php @@ -0,0 +1,198 @@ + + '', + 'page-bg' => array('background-color'), + 'heading-color' => '', + 'body-text-color' => '', + 'link-color' => array('regular','hover'), + 'menu-bg' => array('background-color'), + 'menu-color' => '', + 'menu-hover-color' => '', + 'submenu-color' => '', + 'menu-primary-bg' => '', + 'menu-secondary-bg' => '', + 'box-bg' => array('background-color'), + 'box-head-bg' => array('background-color'), + 'box-head-color' => '', + 'button-primary-bg' => '', + 'button-primary-hover-bg' => '', + 'button-secondary-bg' => '', + 'button-secondary-hover-bg' => '', + 'button-text-color' => '', + 'form-bg' => '', + 'form-text-color' => '', + 'form-border-color' => '', + 'logo-bg' => '', + 'topbar-menu-color' => '', + 'topbar-menu-bg' => array('background-color'), + 'topbar-submenu-color' => '', + 'topbar-submenu-bg' => '', + 'topbar-submenu-hover-bg' => '', + ); + + + $css = ""; + echo ""; + +} + +function legacy_logo($rettype = "") { + global $legacyadmin; + + $legacyadmin = legacyadmin_network($legacyadmin); + + //print_r($legacyadmin); + + + $csstype = legacy_dynamic_css_type(); + + legacy_css_variables($legacyadmin,$csstype); + + + + $str = ""; + if (isset($legacyadmin['enable-logo']) && $legacyadmin['enable-logo'] != "1" && $legacyadmin['enable-logo'] == "0" && !$legacyadmin['enable-logo']) { + + // hide logo + if ($rettype != "1") { + $str .= ""; + } + } else { + + // show logo + $logo = $logo_folded = ""; + + + if ($logo == "") { + if (isset($legacyadmin['logo']['url'])) { + $logo = trim($legacyadmin['logo']['url']); + } + } + if ($logo_folded == "") { + if (isset($legacyadmin['logo_folded']['url'])) { + $logo_folded = trim($legacyadmin['logo_folded']['url']); + } + } + + if ($rettype != "1") { + $str .= ""; + } + } + + if ($rettype != "1") { + echo $str; + } else { + return $str; + } +} + +function legacy_favicon() { + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + #adminmenuwrap .logo-overlay { cursor:hand;cursor:pointer; }"; + } + + echo ""; +} +?> \ No newline at end of file diff --git a/plugins/legacy-admin/lib/legacy-menu-settings.php b/plugins/legacy-admin/lib/legacy-menu-settings.php new file mode 100644 index 000000000..dd791b303 --- /dev/null +++ b/plugins/legacy-admin/lib/legacy-menu-settings.php @@ -0,0 +1,955 @@ +id); + + if (isset($plug) && $plug == "legacy-admin-addon_page_legacy_menumng_settings"){ + + $url = plugins_url('/', __FILE__).'../js/legacy-scripts-menu-management.js'; + wp_deregister_script('legacy-scripts-menu-management-js'); + wp_register_script('legacy-scripts-menu-management-js', $url); + wp_enqueue_script('legacy-scripts-menu-management-js'); + + $url = plugins_url('/', __FILE__).'../css/jquery-ui/minified/jquery-ui.min.css'; + wp_deregister_style('legacy-jqueryui'); + wp_register_style('legacy-jqueryui', $url); + wp_enqueue_style('legacy-jqueryui'); + + $url = plugins_url('/', __FILE__).'../js/legacy-jquery.ui.elements.js'; + wp_deregister_script('legacy-jqueryui'); + wp_register_script('legacy-jqueryui', $url); + wp_enqueue_script('legacy-jqueryui'); + + + wp_localize_script('legacy-scripts-menu-management-js', 'legacy_vars', array( + 'legacy_nonce' => wp_create_nonce('legacy-nonce') + ) + ); + } + + global $menu; + global $submenu; + global $legacymenu; + global $legacysubmenu; + + + if (!is_array($legacymenu) || sizeof($legacymenu) == 0) { + $legacymenu = $menu; + + $renamelegacymenu = legacy_rename_menu(); + $legacymenu = $renamelegacymenu; + + $neworder = legacy_adminmenu_neworder(); + //legacyprint("neworder",$neworder); + + $legacymenu = legacy_adminmenu_newmenu($neworder,$legacymenu); + //$legacymenu = legacy_adminmenu_disable($legacymenu); + + $GLOBALS['legacymenu'] = $legacymenu; + + + } + + if (!is_array($legacysubmenu) || sizeof($legacysubmenu) == 0) { + $legacysubmenu = $submenu; + + $renamelegacysubmenu = legacy_rename_submenu(); + $legacysubmenu = $renamelegacysubmenu; + //legacyprint('submenu',$submenu); + //return $submenu; + + $newsuborder = legacy_adminmenu_neworder(); + //echo "
    "; print_r($newsuborder); echo "
    "; + //return $submenu; + + $legacysubmeu = legacy_adminmenu_newsubmenu($newsuborder,$legacysubmenu,$legacymenu); + //return $submenu; + + $GLOBALS['legacysubmenu'] = $legacysubmenu; + + } + + //legacyprint('menu',$menu); + //legacyprint('submenu',$submenu); + //legacyprint('legacymenu',$legacymenu); + //legacyprint('legacysubmenu',$legacysubmenu); + + + echo '

    Admin Menu Management

    '; + $menudisable = legacy_get_option("legacyadmin_menudisable", ""); + $menudisablearr = array_unique(array_filter(explode("|", $menudisable))); + + $submenudisable = legacy_get_option("legacyadmin_submenudisable", ""); + + $submenudisablearr = array_unique(array_filter(explode("|", $submenudisable))); + + foreach ($legacymenu as $menuid => $menuarr) { + + /* ---------------- + menu tab + ---------------- */ + //echo $menuid."
    "; + //print_r($menuarr); + //if($menuarr[4] == "wp-menu-separator"){ + if (strpos($menuarr[4], "wp-menu-separator") !== false) { + // separator + //echo "
    ".$menuarr[0]."
    "; + } else { + // menu item + + $tabid = $menuid; + if (isset($menuarr['original'])) { + $tabid = $menuarr['original']; + } + + $sid = $tabid; + if (isset($menuarr[5])) { + $sid = $menuarr[5]; + } + + $menupage = $tabid; + if (isset($menuarr[2])) { + $menupage = $menuarr[2]; + } + + //print_r($menuarr); + $expstr = explode("<", $menuarr[0]); + $menuarr[0] = $expstr[0]; + + $originalname = $menuarr[0]; + //echo $originalname; + if(isset($menuarr['originalname'])){ + $originalname = $menuarr['originalname']; + } + + $expstr = explode("<", $originalname); + $originalname = $expstr[0]; + + + + + $originalicon = ""; + if (isset($menuarr[6])) { + $originalicon = $menuarr[6]; + if (isset($menuarr['originalicon'])) { + $originalicon = $menuarr['originalicon']; + } + } + + $disabled = " enabled "; + $disablebutclass = "disable"; + $disablebuttext = "hide"; + if (isset($menuarr[5]) && in_array($menuarr[5], $menudisablearr)) { + $disabled = " disabled "; + $disablebutclass = " enable "; + $disablebuttext = "show"; + } + + + echo "
    + +
    + + " . strip_tags($menuarr[0]) . " + + + +
    +
    + + +
    + ".__( 'Original', 'legacy_framework' ).": + " . $originalname . " +
    + ".__( 'Rename to', 'legacy_framework' ).": + +
    + ".__( 'Menu Icon', 'legacy_framework' ).": + + + + + +
    +
    +
    "; + + echo "
    "; + + /* -------------------- + submenu tabs + ---------------------- */ + echo "
    "; + if (isset($legacysubmenu[$menuarr[2]])) { + + $parentpage = ""; + if (isset($menuarr[2])) { + $parentpage = $menuarr[2]; + } + + foreach ($legacysubmenu[$menuarr[2]] as $submenuid => $submenuarr) { + + //print_r($submenuarr); + + //$submenuarr[0] = legacy_reformatstring($submenuarr[0]); + + $expstr = explode("<", $submenuarr[0]); + $submenuarr[0] = $expstr[0]; + + + $subtabid = $submenuid; + if (isset($submenuarr['original'])) { + $subtabid = $submenuarr['original']; + } + + $originalsubname = $submenuarr[0]; + if (isset($submenuarr['originalsubname'])) { + $originalsubname = $submenuarr['originalsubname']; + } + + $expstr = explode("<", $originalsubname); + $originalsubname = $expstr[0]; + + $subdisabled = " enabled "; + $subdisablebutclass = "disable"; + $subdisablebuttext = "hide"; + if (in_array($menupage . ":" . $subtabid, $submenudisablearr)) { + $subdisabled = " disabled "; + $subdisablebutclass = " enable "; + $subdisablebuttext = "show"; + } + + //print_r($submenuarr); + echo "
    + +
    + " . $submenuarr[0] . " + + + +
    + +
    + + +
    + ".__( 'Original', 'legacy_framework' ).": + " . $originalsubname . " +
    + ".__( 'Rename to', 'legacy_framework' ).": + +
    +
    +
    + +
    + +
    "; + } + + //print_r($submenu[$menuarr[2]]); + } + echo "
    "; // submenu end + echo "
    "; // menu end + } + } + + //echo ""; + + echo '
    '; + + //echo '
    '; echo '
    '; + + echo "
    ".__( 'Instructions', 'legacy_framework' ).":
      "; + echo "
    • ".__( 'Drag and Drop', 'legacy_framework' )." ".__( 'menu and sub menu items to rearrange.', 'legacy_framework' )."
    • "; + echo "
    • ".__( 'Click on', 'legacy_framework' )." ".__( 'icon to show or hide the menu or submenu item.', 'legacy_framework' )."
    • "; + echo "
    • ".__( 'Click on', 'legacy_framework' )." ".__( 'icon to edit menu and submenu link text', 'legacy_framework' )."
    • "; + echo "
    • ".__( 'Click on', 'legacy_framework' )." ".__( 'icon, click on the menu icon to open the available icons panel and pick your icon.', 'legacy_framework' )."
    • "; + echo "
    • ".__( 'Click on save menu button after editing.', 'legacy_framework' )."
    "; + + echo '

    '; + + + + echo legacy_menuicons_list(); + echo "
    "; + + echo "
    "; // .wrap +} + +add_action('wp_ajax_legacy_savemenu', 'legacy_savemenu'); + +function legacy_savemenu() { + if (!isset($_POST['legacy_nonce']) || !wp_verify_nonce($_POST['legacy_nonce'], 'legacy-nonce')) { + die('Permissions check failed. Please login or refresh (if already logged in) the page, then try Again.'); + } + + $neworder = $_POST['neworder']; + $newsuborder = $_POST['newsuborder']; + $menurename = $_POST['menurename']; + $submenurename = $_POST['submenurename']; + $menudisable = $_POST['menudisable']; + $submenudisable = $_POST['submenudisable']; + + //print_r($_POST); + legacy_update_option("legacyadmin_menuorder", $neworder); + legacy_update_option("legacyadmin_submenuorder", $newsuborder); + legacy_update_option("legacyadmin_menurename", $menurename); + legacy_update_option("legacyadmin_submenurename", $submenurename); + legacy_update_option("legacyadmin_menudisable", $menudisable); + legacy_update_option("legacyadmin_submenudisable", $submenudisable); + //echo "success"; + die(); +} + +add_action('wp_ajax_legacy_resetmenu', 'legacy_resetmenu'); + +function legacy_resetmenu() { + if (!isset($_POST['legacy_nonce']) || !wp_verify_nonce($_POST['legacy_nonce'], 'legacy-nonce')) { + die('Permissions check failed. Please login or refresh (if already logged in) the page, then try Again.'); + } + + $neworder = ""; + $newsuborder = ""; + $menurename = ""; + $submenurename = ""; + $menudisable = ""; + $submenudisable = ""; + + //print_r($_POST); + legacy_update_option("legacyadmin_menuorder", $neworder); + legacy_update_option("legacyadmin_submenuorder", $newsuborder); + legacy_update_option("legacyadmin_menurename", $menurename); + legacy_update_option("legacyadmin_submenurename", $submenurename); + legacy_update_option("legacyadmin_menudisable", $menudisable); + legacy_update_option("legacyadmin_submenudisable", $submenudisable); + //echo "success"; + die(); +} + +if ($get_menumng_page != "disable" && !is_network_admin()) { + add_action('admin_menu', 'legacy_adminmenu_rearrange', 999999999); +} + +function legacy_adminmenu_rearrange() { + + + $enablemenumng = legacy_get_user_type(); + + + global $menu; + global $submenu; + + if ($enablemenumng) { + + //legacyprint("menu",$menu); + + $renamemenu = legacy_rename_menu(); + $menu = $renamemenu; + //legacyprint("menu",$menu); + //return $menu; + + $neworder = legacy_adminmenu_neworder(); + //legacyprint("neworder",$neworder); + + $ret = legacy_adminmenu_newmenu($neworder, $menu); + $menu = $ret; + + $GLOBALS['legacymenu'] = $menu; + + $menu = legacy_adminmenu_disable($menu); + } + //legacyprint("menu",$menu); + return $menu; +} + +function legacy_adminmenu_neworder() { + + $new = array(); + $subnew = array(); + $ret = array(); + + $neworder = legacy_get_option("legacyadmin_menuorder", ""); + $newsuborder = legacy_get_option("legacyadmin_submenuorder", ""); + //echo $neworder; echo "
    "; echo $newsuborder; + + $exp = explode("|", $neworder); + $subexp = explode("|", $newsuborder); + + // set menu in new array + foreach ($exp as $id) { + if (trim($id) != "") { + $new[] = $id; + } + } + + // set submenu in new array with menu id + foreach ($subexp as $id) { + if (trim($id) != "") { + $subid = explode(":", $id); + $subnew[$subid[0]][] = $subid[1]; + } + } + + //legacyprint("new",$new); + //legacyprint("subnew",$subnew); + + $ret['menu'] = $new; + $ret['submenu'] = $subnew; + + return $ret; +} + +function legacy_adminmenu_newmenu($neworder, $menu) { + //legacyprint("menu",$menu); + //legacyprint("neworder",$neworder); + + $relation = array(); + + foreach ($menu as $id => $valarr) { + if (isset($valarr[5])) { + $relation[$valarr[5]] = $id; + } + } + + //print_r($relation); + //legacyprint("relation",$relation); + + $ret = array(); + $allids = $menu; + + $k = 100000; + foreach ($neworder['menu'] as $newmenuid) { + if (isset($relation[$newmenuid])) { + $k++; + $ret[$k] = $menu[$relation[$newmenuid]]; + $ret[$k]['original'] = $relation[$newmenuid]; + unset($allids[$relation[$newmenuid]]); + } + } + + foreach ($allids as $itemid => $item) { + $k++; + $ret[$k] = $item; + $ret[$k]['original'] = $itemid; + } + + //$ret = array_merge($ret,$allids); + //legacyprint("ret",$ret); + + return $ret; +} + +function legacy_adminmenu_newsubmenu($newsuborder, $submenu, $menu) { + + + $allids = $menu; + $allsubids = $submenu; + + + $ret = array(); + foreach ($newsuborder['submenu'] as $submenuid => $arr) { + $k = 1100000; + $k = 0; + foreach ($arr as $linkid) { + $submenu[$submenuid][$linkid]['original'] = $linkid; + $ret[$submenuid][$k] = $submenu[$submenuid][$linkid]; + unset($allsubids[$submenuid][$linkid]); + //$ret[$menumap[$submenuid]][]['original'] = $linkid; + $k++; + } + } + //legacyprint("allsubids",$allsubids); + + foreach ($allsubids as $itemid => $item) { + $k = 1100000; + $k = 0; + //if(sizeof($item) > 0){ + foreach ($item as $a => $b) { + $allsubids[$itemid][$a]['original'] = $a; + $ret[$itemid][$k] = $allsubids[$itemid][$a]; + //$ret[$k] = $item; + //$ret[$k]['original'] = $itemid; + $k++; + } + //} + } + + return $ret; +} + +if ($get_menumng_page != "disable" && !is_network_admin()) { + add_filter('custom_menu_order', 'legacy_admin_submenu_rearrange', 9999999999); +} + +function legacy_admin_submenu_rearrange() { + + global $legacymenu; + global $submenu; + + + $enablemenumng = legacy_get_user_type(); + if ($enablemenumng) { + //legacyprint('menu',$menu); + //legacyprint('submenu',$submenu); + //return $submenu; + + $renamesubmenu = legacy_rename_submenu(); + $submenu = $renamesubmenu; + //legacyprint('submenu',$submenu); + + + $newsuborder = legacy_adminmenu_neworder(); + //echo "
    "; print_r($newsuborder); echo "
    "; + + + $ret = legacy_adminmenu_newsubmenu($newsuborder, $submenu, $legacymenu); + + //return $submenu; + + + $submenu = $ret; + + $GLOBALS['legacysubmenu'] = $submenu; + + $submenu = legacy_adminsubmenu_disable($submenu); + } + return $submenu; + + +} + +function legacy_rename_menu_getnewID($menuarr, $field, $value) +{ + foreach($menuarr as $key => $product) + { + if ( $product[$field] === $value ) + return $key; + } + return false; +} + +function legacy_rename_menu() { + global $menu; + + $menurename = legacy_get_option("legacyadmin_menurename", ""); + + //legacyprint("menu",$menu); + + if (trim($menurename) != "") { + + $exp = explode("|#$%*|", $menurename); + + //legacyprint("exp",$exp); + foreach ($exp as $str) { + + if (trim($str) != "") { + + $id = $val = $icon = $original = ""; + + $arr = explode("@!@%@", $str); + if (isset($arr[0])) { + $id = $arr[0]; + } + if (isset($arr[1])) { + $str = $arr[1]; + } + $expstr = explode("[$!&!$]", $str); + if (isset($expstr[0])) { + $val = $expstr[0]; + } + if (isset($expstr[1])) { + $icon = $expstr[1]; + } + + if ($id != "") { + $expid = explode(":", $id); + $id = $expid[0]; + $sid = $expid[1]; + } + + // get new id + $id = legacy_rename_menu_getnewID($menu, "5", $sid); + + if (isset($menu[$id][0]) && isset($menu[$id][5]) && $menu[$id][5] == $sid) { + //print_r($original); + $original = $menu[$id][0]; + $menu[$id][0] = $val; + $menu[$id]['originalname'] = $original; + } + + if (isset($menu[$id][6]) && isset($menu[$id][5]) && $menu[$id][5] == $sid) { + $originalicon = $menu[$id][6]; + $menu[$id][6] = $icon; + $menu[$id]['originalicon'] = $originalicon; + } + //echo $id. " : ". $val."
    "; + } + } + } + //legacyprint("menu",$menu); + + return $menu; +} + +function legacy_rename_submenu() { + + global $submenu; + $submenurename = legacy_get_option("legacyadmin_submenurename", ""); + + if (trim($submenurename) != "") { + + $exp = explode("|#$%*|", $submenurename); + foreach ($exp as $str) { + + $idstr = $page = $parentid = $id = $val = $original = ""; + + $arr = explode("@!@%@", $str); + if (isset($arr[0])) { + $idstr = $arr[0]; + } + $idexp = explode("[($&)]", $idstr); + if (isset($idexp[0])) { + $page = $idexp[0]; + } + if (isset($idexp[1])) { + $idexp2 = explode(":", $idexp[1]); + } + if (isset($idexp2[0])) { + $parentid = $idexp2[0]; + } + if (isset($idexp2[1])) { + $id = $idexp2[1]; + } + if (isset($arr[1])) { + $val = $arr[1]; + } + + //echo $page." - ". $parentid. " - ". $id." - ". $val."
    "; + + if (isset($submenu[$page][$id][0])) { + $original = $submenu[$page][$id][0]; + $submenu[$page][$id][0] = $val; + $submenu[$page][$id]['originalsubname'] = $original; + } + //echo $id. " : ". $val."
    "; + } + } + //echo "
    "; print_r($submenu); echo "
    "; + return $submenu; +} + +function legacy_adminmenu_disable($menu) { + + //echo "
    "; print_r($menu); echo "
    "; + $menudisable = legacy_get_option("legacyadmin_menudisable", ""); + $exp = array_unique(array_filter(explode("|", $menudisable))); + + foreach ($menu as $id => $arr) { + if (isset($arr[5]) && in_array($arr[5], $exp)) { + unset($menu[$id]); + } + } + + return $menu; +} + +function legacy_adminsubmenu_disable($submenu) { + //echo "
    "; print_r($submenu); echo "
    "; + //legacyprint("submenu",$submenu); + global $menu; + //legacyprint("menu",$menu); + //enabled menu items + + $enabledmenu = array(); + foreach ($menu as $key => $value) { + $enabledmenu[] = $value[2]; + } + + //legacyprint("enabledmenu",$enabledmenu); + // map array of id and .php page of menu first + $menumap = array(); + foreach ($menu as $v) { + //$menumap[$v[2]] = $v[5];//$v['original']; + } + + //legacyprint("menumap",$menumap); + $submenudisable = legacy_get_option("legacyadmin_submenudisable", ""); + + $exp = array_unique(array_filter(explode("|", $submenudisable))); + + foreach ($submenu as $key => $value) { + + // check if parent menu is enabled. if not then unset it from submenu + if (!in_array($key, $enabledmenu)) { + unset($submenu[$key]); + } else { + + $parentid = ""; + //if(isset($parentid)){$parentid = $menumap[$key];} + + foreach ($value as $k => $v) { + $subid = ""; + if (isset($v['original'])) { + $subid = $v['original']; + } + if (in_array($key . ":" . $subid, $exp)) { + unset($submenu[$key][$k]); + } + } + } + } + + //legacyprint("submenu",$submenu); + return $submenu; +} + +function legacy_menuicons_list() { + $ret = ""; + $ret .= "
    "; + + $str = legacy_dashiconscsv(); + $exp = explode(",", $str); + foreach ($exp as $key => $value) { + $valexp = explode(":", $value); + $class = trim($valexp[0]); + $code = trim($valexp[1]); + $ret .= ""; + } + + $ret .= "
    "; + return $ret; +} + +function legacy_removeslashes($string) { + $string = implode("", explode("\\", $string)); + return stripslashes(trim($string)); +} + +function legacy_reformatstring($str) { + $str = htmlspecialchars($str, ENT_QUOTES); + $str = legacy_removeslashes($str); + return $str; +} + +function legacy_dashiconscsv() { + + $str = "menu:f333, + admin-site:f319, + dashboard:f226, + admin-media:f104, + admin-page:f105, + admin-comments:f101, + admin-appearance:f100, + admin-plugins:f106, + admin-users:f110, + admin-tools:f107, + admin-settings:f108, + admin-network:f112, + admin-generic:f111, + admin-home:f102, + admin-collapse:f148, + format-links:f103, + format-standard:f109, + format-image:f128, + format-gallery:f161, + format-audio:f127, + format-video:f126, + format-chat:f125, + format-status:f130, + format-aside:f123, + format-quote:f122, + welcome-edit-page:f119, + welcome-add-page:f133, + welcome-view-site:f115, + welcome-widgets-menus:f116, + welcome-comments:f117, + welcome-learn-more:f118, + image-crop:f165, + image-rotate-left:f166, + image-rotate-right:f167, + image-flip-vertical:f168, + image-flip-horizontal:f169, + undo:f171, + redo:f172, + editor-bold:f200, + editor-italic:f201, + editor-ul:f203, + editor-ol:f204, + editor-quote:f205, + editor-alignleft:f206, + editor-aligncenter:f207, + editor-alignright:f208, + editor-insertmore:f209, + editor-spellcheck:f210, + editor-expand:f211, + editor-contract:f506, + editor-kitchensink:f212, + editor-underline:f213, + editor-justify:f214, + editor-textcolor:f215, + editor-paste-word:f216, + editor-paste-text:f217, + editor-removeformatting:f218, + editor-video:f219, + editor-customchar:f220, + editor-outdent:f221, + editor-indent:f222, + editor-help:f223, + editor-strikethrough:f224, + editor-unlink:f225, + editor-rtl:f320, + editor-break:f474, + editor-code:f475, + editor-paragraph:f476, + align-left:f135, + align-right:f136, + align-center:f134, + align-none:f138, + lock:f160, + calendar:f145, + calendar-alt:f508, + visibility:f177, + post-status:f173, + edit:f464, + trash:f182, + external:f504, + arrow-up:f142, + arrow-down:f140, + arrow-left:f141, + arrow-right:f139, + arrow-up-alt:f342, + arrow-down-alt:f346, + arrow-left-alt:f340, + arrow-right-alt:f344, + arrow-up-alt2:f343, + arrow-down-alt2:f347, + arrow-left-alt2:f341, + arrow-right-alt2:f345, + leftright:f229, + sort:f156, + randomize:f503, + list-view:f163, + exerpt-view:f164, + grid-view:f509, + hammer:f308, + art:f309, + migrate:f310, + performance:f311, + universal-access:f483, + universal-access-alt:f507, + tickets:f486, + nametag:f484, + clipboard:f481, + heart:f487, + megaphone:f488, + schedule:f489, + wordpress:f120, + wordpress-alt:f324, + pressthis:f157, + update:f463, + screenoptions:f180, + info:f348, + cart:f174, + feedback:f175, + cloud:f176, + translation:f326, + tag:f323, + category:f318, + archive:f480, + tagcloud:f479, + text:f478, + media-archive:f501, + media-audio:f500, + media-code:f499, + media-default:f498, + media-document:f497, + media-interactive:f496, + media-spreadsheet:f495, + media-text:f491, + media-video:f490, + playlist-audio:f492, + playlist-video:f493, + yes:f147, + no:f158, + no-alt:f335, + plus:f132, + plus-alt:f502, + minus:f460, + dismiss:f153, + marker:f159, + star-filled:f155, + star-half:f459, + star-empty:f154, + flag:f227, + share:f237, + share1:f237, + share-alt:f240, + share-alt2:f242, + twitter:f301, + rss:f303, + email:f465, + email-alt:f466, + facebook:f304, + facebook-alt:f305, + networking:f325, + googleplus:f462, + location:f230, + location-alt:f231, + camera:f306, + images-alt:f232, + images-alt2:f233, + video-alt:f234, + video-alt2:f235, + video-alt3:f236, + vault:f178, + shield:f332, + shield-alt:f334, + sos:f468, + search:f179, + slides:f181, + analytics:f183, + chart-pie:f184, + chart-bar:f185, + chart-line:f238, + chart-area:f239, + groups:f307, + businessman:f338, + id:f336, + id-alt:f337, + products:f312, + awards:f313, + forms:f314, + testimonial:f473, + portfolio:f322, + book:f330, + book-alt:f331, + download:f316, + upload:f317, + backup:f321, + clock:f469, + lightbulb:f339, + microphone:f482, + desktop:f472, + tablet:f471, + smartphone:f470, + smiley:f328, + index-card:f510, + carrot:f511"; + + return $str; +} + +?> \ No newline at end of file diff --git a/plugins/legacy-admin/lib/legacy-pageloader.php b/plugins/legacy-admin/lib/legacy-pageloader.php new file mode 100644 index 000000000..e30c6bbeb --- /dev/null +++ b/plugins/legacy-admin/lib/legacy-pageloader.php @@ -0,0 +1,41 @@ + + \ No newline at end of file diff --git a/plugins/legacy-admin/lib/legacy-register-hook.php b/plugins/legacy-admin/lib/legacy-register-hook.php new file mode 100644 index 000000000..c4fed0f3a --- /dev/null +++ b/plugins/legacy-admin/lib/legacy-register-hook.php @@ -0,0 +1,52 @@ + \ No newline at end of file diff --git a/plugins/legacy-admin/lib/legacy-settings.php b/plugins/legacy-admin/lib/legacy-settings.php new file mode 100644 index 000000000..32dec4f2b --- /dev/null +++ b/plugins/legacy-admin/lib/legacy-settings.php @@ -0,0 +1,378 @@ +"; print_r($legacyadmin); echo ""; + + legacy_add_option("legacyadmin_plugin_access", "manage_options"); + legacy_add_option("legacyadmin_plugin_page", "show"); + legacy_add_option("legacyadmin_plugin_userid", ""); + legacy_add_option("legacyadmin_menumng_page", "enable"); + legacy_add_option("legacyadmin_admin_menumng_page", "enable"); + legacy_add_option("legacyadmin_admintheme_page", "enable"); + legacy_add_option("legacyadmin_logintheme_page", "enable"); + legacy_add_option("legacyadmin_master_theme", "0"); + + $get_menumng_page = legacy_get_option("legacyadmin_menumng_page", "enable"); + $get_admin_menumng_page = legacy_get_option("legacyadmin_admin_menumng_page", "enable"); + $get_admintheme_page = legacy_get_option("legacyadmin_admintheme_page", "enable"); + $get_logintheme_page = legacy_get_option("legacyadmin_logintheme_page", "enable"); + $get_mastertheme_page = legacy_get_option("legacyadmin_master_theme", "0"); + + + // manageoptions and super admin + $legacyadmin_permissions = legacy_get_option("legacyadmin_plugin_access", "manage_options"); + if ($legacyadmin_permissions == "super_admin" && is_super_admin()) { + $legacyadmin_permissions = 'manage_options'; + } + + // specific user + $legacyadmin_userid = legacy_get_option("legacyadmin_plugin_userid", ""); + if ($legacyadmin_permissions == "specific_user" && $legacyadmin_userid == get_current_user_id()) { + $legacyadmin_permissions = 'read'; + } + + $showtabs = true; + if (is_multisite() && legacy_network_active()) { + if (!is_main_site()) { + $showtabs = false; + } + } + + if ($showtabs) { + add_menu_page('Legacy Admin Addon', __('Legacy Admin Addon', 'legacy_framework'), $legacyadmin_permissions, 'legacy_permission_settings', 'legacy_permission_settings_page'); + add_submenu_page('legacy_permission_settings', 'Plugin Settings', __('Plugin Settings', 'legacy_framework'), $legacyadmin_permissions, 'legacy_permission_settings', 'legacy_permission_settings_page'); + if ($get_menumng_page != "disable") { + add_submenu_page('legacy_permission_settings', 'Menu Management', __('Menu Management', 'legacy_framework'), $legacyadmin_permissions, 'legacy_menumng_settings', 'legacy_menumng_settings_page'); + } + } +} + +function legacy_permission_settings_page() { + + if (isset($_POST['action']) && $_POST['action'] == 'legacy_save_settings') { + legacy_save_permission_settings(); + } + + $currentUser = wp_get_current_user(); + $isMultisite = is_multisite(); + $isSuperAdmin = is_super_admin(); + + $get_plugin_access = legacy_get_option("legacyadmin_plugin_access", "manage_options"); + $get_plugin_page = legacy_get_option("legacyadmin_plugin_page", "show"); + + $get_menumng_page = legacy_get_option("legacyadmin_menumng_page", "enable"); + $get_admin_menumng_page = legacy_get_option("legacyadmin_admin_menumng_page", "enable"); + + $get_admintheme_page = legacy_get_option("legacyadmin_admintheme_page", "enable"); + $get_logintheme_page = legacy_get_option("legacyadmin_logintheme_page", "enable"); + $get_mastertheme_page = legacy_get_option("legacyadmin_master_theme", "0"); + + + global $legacyadmin; +//echo $legacyadmin['dynamic-css-type']; +//echo "jhi"; + global $wpdb; + global $blog_id; + ?> + +
    + +

    Legacy Admin Settings

    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    +

    + +

    + +

    + +

    + +

    + +

    +
    + +

    + +

    +
    + + +

    + +

    +
    + + +

    + +

    +
    + + +

    + +

    +
    + + +

    + +

    +
    + + + +
    + + +
    + + + $blogname) { + update_blog_option($blogid, 'legacy_demo', $master_options); + } + } + } + } +} + +add_filter('all_plugins', 'legacy_filter_plugin_list'); + +function legacy_filter_plugin_list() { + + if (!function_exists('get_plugins')) { + require_once ABSPATH . 'wp-admin/includes/plugin.php'; + } + + $plugins = get_plugins(); + + //print_r($plugins); + + $currentUser = wp_get_current_user(); + $uaccess = legacy_get_option("legacyadmin_plugin_access", "manage_options"); + $upage = legacy_get_option("legacyadmin_plugin_page", "show"); + $uid = legacy_get_option("legacyadmin_plugin_userid", ""); + + if ($upage == "hide") { + + if ($uaccess == "super_admin" && !is_super_admin()) { + unset($plugins['legacy-admin/legacy-core.php']); + } + + if ($uaccess == "specific_user" && $uid != get_current_user_id()) { + unset($plugins['legacy-admin/legacy-core.php']); + } + + if ($uaccess == "manage_options" && !current_user_can('manage_options')) { + unset($plugins['legacy-admin/legacy-core.php']); + } + } + + + return $plugins; + +} +?> \ No newline at end of file diff --git a/plugins/legacy-admin/lib/legacy-topbar.php b/plugins/legacy-admin/lib/legacy-topbar.php new file mode 100644 index 000000000..21d2f144a --- /dev/null +++ b/plugins/legacy-admin/lib/legacy-topbar.php @@ -0,0 +1,216 @@ + +#wpadminbar{display: none !important;} html.wp-toolbar{padding-top:0px !important;} "; + } +} + +function legacy_wptopbar() { + global $legacyadmin; + $legacyadmin = legacyadmin_network($legacyadmin); + + if (isset($legacyadmin['enable-topbar-wp']) && $legacyadmin['enable-topbar-wp'] != "1" && $legacyadmin['enable-topbar-wp'] == "0" && !$legacyadmin['enable-topbar-wp']) { + remove_action('wp_footer', 'wp_admin_bar_render', 9); + add_filter('show_admin_bar', '__return_false'); + } +} + +function legacy_admintopbar_style() { + global $legacyadmin; + $legacyadmin = legacyadmin_network($legacyadmin); + + $logomargintop = "-40px"; + + if(isset($legacyadmin['enable-topbar']) && $legacyadmin['enable-topbar'] != "1" && $legacyadmin['enable-topbar'] == "0" && !$legacyadmin['enable-topbar']){ + $logomargintop = "0px"; + } + + + + if (isset($legacyadmin['topbar-style']) && $legacyadmin['topbar-style'] != "style1") { + return " #adminmenuback{z-index: 99998 !important;} + #adminmenuwrap{margin-top: ".$logomargintop." !important;z-index: 99999 !important;} + .folded #wpadminbar{padding-left: 46px !important;} + #wpadminbar{padding-left: 245px !important;z-index: 9999 !important;} + .menu-hidden #wpadminbar{padding-left: 0px !important;} + .menu-expanded #wpadminbar{padding-left: 245px !important;} + .menu-collapsed #wpadminbar{padding-left: 46px !important;} + + .rtl #adminmenuback{z-index: 99998 !important;} + .rtl #adminmenuwrap{margin-top: ".$logomargintop." !important;z-index: 99999 !important;} + .rtl.folded #wpadminbar{padding-right: 46px !important;padding-left: 0px!important;} + .rtl #wpadminbar{padding-right: 245px !important;padding-left: 0px !important;z-index: 9999 !important;} + .rtl.menu-hidden #wpadminbar{padding-left: 0px !important;padding-right: 0px !important;} + .rtl.menu-expanded #wpadminbar{padding-right: 245px !important;padding-left: 0px !important;} + .rtl.menu-collapsed #wpadminbar{padding-right: 46px !important;padding-left: 0px !important;} + "; + } +} + +function legacy_admintopbar_links() { + + global $legacyadmin; + + $legacyadmin = legacyadmin_network($legacyadmin); + + //print_r($legacyadmin); + + $str = ""; + + $element = 'enable-topbar-links-wp'; + if (isset($legacyadmin[$element]) && $legacyadmin[$element] != "1" && $legacyadmin[$element] == "0" && !$legacyadmin[$element]) { + $str .= "#wp-admin-bar-wp-logo{display:none;}"; + } + + $element = 'enable-topbar-links-site'; + if (isset($legacyadmin[$element]) && $legacyadmin[$element] != "1" && $legacyadmin[$element] == "0" && !$legacyadmin[$element]) { + $str .= "#wp-admin-bar-site-name{display:none;}"; + } + + $element = 'enable-topbar-links-comments'; + if (isset($legacyadmin[$element]) && $legacyadmin[$element] != "1" && $legacyadmin[$element] == "0" && !$legacyadmin[$element]) { + $str .= "#wp-admin-bar-comments{display:none;}"; + } + + $element = 'enable-topbar-links-new'; + if (isset($legacyadmin[$element]) && $legacyadmin[$element] != "1" && $legacyadmin[$element] == "0" && !$legacyadmin[$element]) { + $str .= "#wp-admin-bar-new-content{display:none;}"; + } + + $element = 'enable-topbar-links-legacyadmin'; + if (isset($legacyadmin[$element]) && $legacyadmin[$element] != "1" && $legacyadmin[$element] == "0" && !$legacyadmin[$element]) { + $str .= "#wp-admin-bar-_legacyoptions{display:none;}"; + } + + $element = 'enable-topbar-myaccount'; + if (isset($legacyadmin[$element]) && $legacyadmin[$element] != "1" && $legacyadmin[$element] == "0" && !$legacyadmin[$element]) { + $str .= "#wp-admin-bar-my-account{display:none;}"; + } + + echo ""; +} + +function legacy_topbar_logout_link() { + global $legacyadmin; + $legacyadmin = legacyadmin_network($legacyadmin); + + $element = 'enable-topbar-directlogout'; + + if (isset($legacyadmin[$element]) && trim($legacyadmin[$element]) != "") { + + if ($legacyadmin[$element] == "1") { + + global $wp_admin_bar; + $wp_admin_bar->add_menu(array( + 'id' => 'wp-custom-logout', + 'title' => 'Logout', + 'parent' => 'top-secondary', + 'href' => wp_logout_url() + )); + } + } +} + +function legacy_topbar_menuids() { + + global $wp_admin_bar; + global $legacyadmin; + $legacyadmin = legacyadmin_network($legacyadmin); + + $element = 'enable-topbar-links-wp'; + if (isset($legacyadmin[$element]) && $legacyadmin[$element] != "1" && $legacyadmin[$element] == "0" && !$legacyadmin[$element]) { + $wp_admin_bar->remove_menu('wp-logo'); + } + + $element = 'enable-topbar-links-site'; + if (isset($legacyadmin[$element]) && $legacyadmin[$element] != "1" && $legacyadmin[$element] == "0" && !$legacyadmin[$element]) { + $wp_admin_bar->remove_menu('site-name'); + } + + $element = 'enable-topbar-links-comments'; + if (isset($legacyadmin[$element]) && $legacyadmin[$element] != "1" && $legacyadmin[$element] == "0" && !$legacyadmin[$element]) { + $wp_admin_bar->remove_menu('comments'); + } + + $element = 'enable-topbar-links-new'; + if (isset($legacyadmin[$element]) && $legacyadmin[$element] != "1" && $legacyadmin[$element] == "0" && !$legacyadmin[$element]) { + $wp_admin_bar->remove_menu('new-content'); + } + + $element = 'enable-topbar-links-legacyadmin'; + if (isset($legacyadmin[$element]) && $legacyadmin[$element] != "1" && $legacyadmin[$element] == "0" && !$legacyadmin[$element]) { + $wp_admin_bar->remove_menu('_legacyoptions'); + } + + $element = 'enable-topbar-myaccount'; + if (isset($legacyadmin[$element]) && $legacyadmin[$element] != "1" && $legacyadmin[$element] == "0" && !$legacyadmin[$element]) { + $wp_admin_bar->remove_menu('my-account'); + } + + + $element = 'topbar-removeids'; + if (isset($legacyadmin[$element]) && trim($legacyadmin[$element]) != "") { + $exp = explode(",", $legacyadmin[$element]); + $exp = array_unique(array_filter($exp)); + + foreach ($exp as $nodeid) { + if (trim($nodeid) != "") { + $wp_admin_bar->remove_menu($nodeid); + } + } + } +} + +function legacy_topbar_account_menu($wp_admin_bar) { + + global $legacyadmin; + $legacyadmin = legacyadmin_network($legacyadmin); + $greet = 'Howdy'; + + $element = 'myaccount_greet'; + if (isset($legacyadmin[$element]) && trim($legacyadmin[$element]) != "Howdy") { + + $greet = $legacyadmin[$element]; + if ($greet != "") { + $greet .= ', '; + } + + $user_id = get_current_user_id(); + $current_user = wp_get_current_user(); + $profile_url = get_edit_profile_url($user_id); + + if (0 != $user_id) { + + /* Add the "My Account" menu */ + $avatar = get_avatar($user_id, 28); + $howdy = $greet . '' . sprintf(__('%1$s','legacy_framework'), $current_user->display_name); + $class = empty($avatar) ? '' : 'with-avatar'; + + $wp_admin_bar->add_menu(array( + 'id' => 'my-account', + 'parent' => 'top-secondary', + 'title' => $howdy . $avatar, + 'href' => $profile_url, + 'meta' => array( + 'class' => $class, + ), + )); + } + } +} + +?> \ No newline at end of file diff --git a/plugins/rosariosis-rest-api/Gruntfile.js b/plugins/rosariosis-rest-api/Gruntfile.js new file mode 100644 index 000000000..26bedbdef --- /dev/null +++ b/plugins/rosariosis-rest-api/Gruntfile.js @@ -0,0 +1,96 @@ +/* jshint node:true */ +module.exports = function( grunt ){ + 'use strict'; + + grunt.initConfig({ + // setting folder templates + dirs: { + css: 'assets/css', + less: 'assets/css', + js: 'assets/js' + }, + + // Compile all .less files. + less: { + compile: { + options: { + // These paths are searched for @imports + paths: ['<%= less.css %>/'] + }, + files: [{ + expand: true, + cwd: '<%= dirs.css %>/', + src: [ + '*.less', + '!mixins.less' + ], + dest: '<%= dirs.css %>/', + ext: '.css' + }] + } + }, + + // Minify all .css files. + cssmin: { + minify: { + expand: true, + cwd: '<%= dirs.css %>/', + src: ['*.css'], + dest: '<%= dirs.css %>/', + ext: '.css' + } + }, + + // Minify .js files. + uglify: { + options: { + preserveComments: 'some' + }, + jsfiles: { + files: [{ + expand: true, + cwd: '<%= dirs.js %>/', + src: [ + '*.js', + '!*.min.js', + '!Gruntfile.js', + ], + dest: '<%= dirs.js %>/', + ext: '.min.js' + }] + } + }, + + // Watch changes for assets + watch: { + less: { + files: [ + '<%= dirs.less %>/*.less', + ], + tasks: ['less', 'cssmin'], + }, + js: { + files: [ + '<%= dirs.js %>/*js', + '!<%= dirs.js %>/*.min.js' + ], + tasks: ['uglify'] + } + }, + + }); + + // Load NPM tasks to be used here + grunt.loadNpmTasks( 'grunt-contrib-less' ); + grunt.loadNpmTasks( 'grunt-contrib-cssmin' ); + grunt.loadNpmTasks( 'grunt-contrib-uglify' ); + grunt.loadNpmTasks( 'grunt-contrib-watch' ); + + // Register tasks + grunt.registerTask( 'default', [ + 'less', + 'cssmin', + 'uglify' + ]); + +}; \ No newline at end of file diff --git a/plugins/rosariosis-rest-api/LICENSE b/plugins/rosariosis-rest-api/LICENSE new file mode 100644 index 000000000..ecbc05937 --- /dev/null +++ b/plugins/rosariosis-rest-api/LICENSE @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. \ No newline at end of file diff --git a/plugins/rosariosis-rest-api/assets/css/admin.css b/plugins/rosariosis-rest-api/assets/css/admin.css new file mode 100644 index 000000000..e69de29bb diff --git a/plugins/rosariosis-rest-api/assets/css/admin.less b/plugins/rosariosis-rest-api/assets/css/admin.less new file mode 100644 index 000000000..e69de29bb diff --git a/plugins/rosariosis-rest-api/assets/css/frontend.css b/plugins/rosariosis-rest-api/assets/css/frontend.css new file mode 100644 index 000000000..e69de29bb diff --git a/plugins/rosariosis-rest-api/assets/css/frontend.less b/plugins/rosariosis-rest-api/assets/css/frontend.less new file mode 100644 index 000000000..e69de29bb diff --git a/plugins/rosariosis-rest-api/assets/img/icon-128x128.png b/plugins/rosariosis-rest-api/assets/img/icon-128x128.png new file mode 100644 index 000000000..96a596be0 Binary files /dev/null and b/plugins/rosariosis-rest-api/assets/img/icon-128x128.png differ diff --git a/plugins/rosariosis-rest-api/assets/img/icon-256x256.png b/plugins/rosariosis-rest-api/assets/img/icon-256x256.png new file mode 100644 index 000000000..3a0484c0c Binary files /dev/null and b/plugins/rosariosis-rest-api/assets/img/icon-256x256.png differ diff --git a/plugins/rosariosis-rest-api/assets/img/icon.png b/plugins/rosariosis-rest-api/assets/img/icon.png new file mode 100644 index 000000000..f6663dd6d Binary files /dev/null and b/plugins/rosariosis-rest-api/assets/img/icon.png differ diff --git a/plugins/rosariosis-rest-api/assets/js/admin.js b/plugins/rosariosis-rest-api/assets/js/admin.js new file mode 100644 index 000000000..a4bdeddec --- /dev/null +++ b/plugins/rosariosis-rest-api/assets/js/admin.js @@ -0,0 +1,5 @@ +(function($) { + $( document ).ready( function ( e ) { + + }); +})( jQuery ); diff --git a/plugins/rosariosis-rest-api/assets/js/admin.min.js b/plugins/rosariosis-rest-api/assets/js/admin.min.js new file mode 100644 index 000000000..d3ad82523 --- /dev/null +++ b/plugins/rosariosis-rest-api/assets/js/admin.min.js @@ -0,0 +1 @@ +jQuery(document).ready(function(){}); \ No newline at end of file diff --git a/plugins/rosariosis-rest-api/assets/js/frontend.js b/plugins/rosariosis-rest-api/assets/js/frontend.js new file mode 100644 index 000000000..a4bdeddec --- /dev/null +++ b/plugins/rosariosis-rest-api/assets/js/frontend.js @@ -0,0 +1,5 @@ +(function($) { + $( document ).ready( function ( e ) { + + }); +})( jQuery ); diff --git a/plugins/rosariosis-rest-api/assets/js/frontend.min.js b/plugins/rosariosis-rest-api/assets/js/frontend.min.js new file mode 100644 index 000000000..d3ad82523 --- /dev/null +++ b/plugins/rosariosis-rest-api/assets/js/frontend.min.js @@ -0,0 +1 @@ +jQuery(document).ready(function(){}); \ No newline at end of file diff --git a/plugins/rosariosis-rest-api/assets/js/settings.js b/plugins/rosariosis-rest-api/assets/js/settings.js new file mode 100644 index 000000000..36f11146e --- /dev/null +++ b/plugins/rosariosis-rest-api/assets/js/settings.js @@ -0,0 +1,71 @@ +jQuery(document).ready(function($) { + + /***** Colour picker *****/ + + $('.colorpicker').hide(); + $('.colorpicker').each( function() { + $(this).farbtastic( $(this).closest('.color-picker').find('.color') ); + }); + + $('.color').click(function() { + $(this).closest('.color-picker').find('.colorpicker').fadeIn(); + }); + + $(document).mousedown(function() { + $('.colorpicker').each(function() { + var display = $(this).css('display'); + if ( display == 'block' ) + $(this).fadeOut(); + }); + }); + + + /***** Uploading images *****/ + + var file_frame; + + jQuery.fn.uploadMediaFile = function( button, preview_media ) { + var button_id = button.attr('id'); + var field_id = button_id.replace( '_button', '' ); + var preview_id = button_id.replace( '_button', '_preview' ); + + // If the media frame already exists, reopen it. + if ( file_frame ) { + file_frame.open(); + return; + } + + // Create the media frame. + file_frame = wp.media.frames.file_frame = wp.media({ + title: jQuery( this ).data( 'uploader_title' ), + button: { + text: jQuery( this ).data( 'uploader_button_text' ), + }, + multiple: false + }); + + // When an image is selected, run a callback. + file_frame.on( 'select', function() { + attachment = file_frame.state().get('selection').first().toJSON(); + jQuery("#"+field_id).val(attachment.id); + if( preview_media ) { + jQuery("#"+preview_id).attr('src',attachment.sizes.thumbnail.url); + } + file_frame = false; + }); + + // Finally, open the modal + file_frame.open(); + } + + jQuery('.image_upload_button').click(function() { + jQuery.fn.uploadMediaFile( jQuery(this), true ); + }); + + jQuery('.image_delete_button').click(function() { + jQuery(this).closest('td').find( '.image_data_field' ).val( '' ); + jQuery(this).closest('td').find( '.image_preview' ).remove(); + return false; + }); + +}); \ No newline at end of file diff --git a/plugins/rosariosis-rest-api/assets/js/settings.min.js b/plugins/rosariosis-rest-api/assets/js/settings.min.js new file mode 100644 index 000000000..f506a9c28 --- /dev/null +++ b/plugins/rosariosis-rest-api/assets/js/settings.min.js @@ -0,0 +1 @@ +jQuery(document).ready(function(e){e(".colorpicker").hide();e(".colorpicker").each(function(){e(this).farbtastic(e(this).closest(".color-picker").find(".color"))});e(".color").click(function(){e(this).closest(".color-picker").find(".colorpicker").fadeIn()});e(document).mousedown(function(){e(".colorpicker").each(function(){var t=e(this).css("display");t=="block"&&e(this).fadeOut()})});var t;jQuery.fn.uploadMediaFile=function(e,n){var r=e.attr("id"),i=r.replace("_button",""),s=r.replace("_button","_preview");if(t){t.open();return}t=wp.media.frames.file_frame=wp.media({title:jQuery(this).data("uploader_title"),button:{text:jQuery(this).data("uploader_button_text")},multiple:!1});t.on("select",function(){attachment=t.state().get("selection").first().toJSON();jQuery("#"+i).val(attachment.id);n&&jQuery("#"+s).attr("src",attachment.sizes.thumbnail.url);t=!1});t.open()};jQuery(".image_upload_button").click(function(){jQuery.fn.uploadMediaFile(jQuery(this),!0)});jQuery(".image_delete_button").click(function(){jQuery(this).closest("td").find(".image_data_field").val("");jQuery(this).closest("td").find(".image_preview").remove();return!1})}); \ No newline at end of file diff --git a/plugins/rosariosis-rest-api/includes/class-rosariosis-rest-api-controller.php b/plugins/rosariosis-rest-api/includes/class-rosariosis-rest-api-controller.php new file mode 100644 index 000000000..6b9c0412b --- /dev/null +++ b/plugins/rosariosis-rest-api/includes/class-rosariosis-rest-api-controller.php @@ -0,0 +1,936 @@ +disable_cache = ! empty( $_GET['disable_cache'] ); + + $this->cache = false; + + add_action( 'current_screen', array( $this, 'plugins_screen_actions' ) ); + + add_action( 'admin_notices', array( $this, 'admin_notices' ) ); + } + + + /** + * Plugin screen actions: + * Test if connectivity to API is OK on admin pages: Plugins screen. + * + * @uses $this->check_connectivity() + */ + public function plugins_screen_actions() { + + $screen = get_current_screen(); + + // Test if connectivity to API is OK on admin pages: Plugins screen. + if ( 'plugins' === $screen->id ) { + + $this->check_connectivity(); + } + } + + + /** + * Main RosarioSIS_REST_API_Controller Instance + * + * Ensures only one instance of RosarioSIS_REST_API_Controller is loaded or can be loaded. + * + * @since 1.0.0 + * @static + * @see RosarioSIS_REST_API() + * + * @param string $file File pathname. + * @param string $version Version number. + * @return RosarioSIS_REST_API_Controller instance + */ + public static function instance( $file = '', $version = '1.0.0' ) { + if ( is_null( self::$_instance ) ) { + self::$_instance = new self( $file, $version ); + } + return self::$_instance; + } + + + /** + * Check connectivity to RosarioSIS EventsManager module API + * + * @access public + * @since 1.0.0 + * + * @return bool + */ + public function check_connectivity() { + + static $connectivity_cache; + + if ( ! is_null( $connectivity_cache ) ) { + + return $connectivity_cache; + } + + if ( ! defined( 'ROSARIOSIS_REST_API_URL' ) + || ! defined( 'ROSARIOSIS_REST_API_USER_TOKEN' ) ) { + + $this->add_error( __( 'Please define the ROSARIOSIS_REST_API_URL & ROSARIOSIS_REST_API_USER_TOKEN constants in the wp-config.php file.', 'rosariosis-rest-api' ) ); + + $connectivity_cache = false; + + return false; + } + + if ( ! filter_var( ROSARIOSIS_REST_API_URL, FILTER_VALIDATE_URL ) ) { + + $this->add_error( __( 'Please enter a valid ROSARIOSIS_REST_API_URL in the wp-config.php file.', 'rosariosis-rest-api' ) ); + + $connectivity_cache = false; + + return false; + } + + $this->delete_cached_request( 'get', 'config?filter=title,eq,LOGIN' ); + $response = $this->get( 'config?filter=title,eq,LOGIN', false ); + + if ( empty( $response ) || is_wp_error( $response ) ) { + + $this->add_error( __( 'Please enter a valid ROSARIOSIS_REST_API_URL and ROSARIOSIS_REST_API_USER_TOKEN in the wp-config.php file.', 'rosariosis-rest-api' ) ); + + // Reintent live (no cache) as we just had an error! + $this->delete_cached_request( 'get', 'config?filter=title,eq,LOGIN' ); + + $connectivity_cache = false; + + return false; + } + + if ( 200 === $this->status && + empty( $response->config_value ) ) { + + if ( ! empty( $response->error ) ) { + $this->add_error( $response->error ); + } else { + $this->add_error( __( 'Please enter a valid ROSARIOSIS_REST_API_URL and ROSARIOSIS_REST_API_USER_TOKEN in the wp-config.php file.', 'rosariosis-rest-api' ) ); + } + + // Reintent live (no cache) as we just had an error! + $this->delete_cached_request( 'get', 'config?filter=title,eq,LOGIN' ); + + $connectivity_cache = false; + + return false; + } + + if ( $response->config_value ) { + + $this->add_error( __( 'Connection successful.', 'rosariosis-rest-api' ), 'success' ); + } + + $connectivity_cache = true; + + return true; + } + + + /** + * Get RosarioSIS API endpoint URL + * + * @return string + */ + public function endpoint() { + + if ( isset( $this->endpoint ) ) { + + return $this->endpoint; + } + + $this->endpoint = rtrim( ROSARIOSIS_REST_API_URL, '/' ) . '/plugins/REST_API/api.php/'; + + return $this->endpoint; + } + + + /** + * Get RosarioSIS API Authentication endpoint URL + * + * @return string + */ + public function auth_endpoint() { + + if ( isset( $this->auth_endpoint ) ) { + + return $this->auth_endpoint; + } + + $this->auth_endpoint = rtrim( ROSARIOSIS_REST_API_URL, '/' ) . '/plugins/REST_API/auth.php'; + + return $this->auth_endpoint; + } + + + /** + * Get RosarioSIS API Access token + * Note: cannot save access_token to transient, JWT error. + * + * @return string + */ + public function get_access_token() { + + if ( isset( $this->access_token ) ) { + + return $this->access_token; + } + + $response = wp_remote_post( + $this->auth_endpoint(), + array( 'body' => array( 'usertoken' => ROSARIOSIS_REST_API_USER_TOKEN ) ) + ); + + if ( empty( $response ) || is_wp_error( $response ) ) { + + return ''; + } + + $response_body = $this->handle_body( $response ); + + if ( empty( $response_body->access_token ) ) { + + return ''; + } + + $this->access_token = $response_body->access_token; + + return $this->access_token; + } + + + /** + * Get RosarioSIS API action URL + * + * @uses $this->enpoint() + * + * @param string $action + * + * @return string + */ + public function get_action_url( $action ) { + + // Can omit 'records/'. + if ( strpos( $action, 'records/' ) === false ) { + $action = 'records/' . ltrim( $action, '/' ); + } + + return $this->endpoint() . $action; + } + + + /** + * Get DOLAPIKEY HTTP header. + * + * @return string + */ + public function auth_header() { + + if ( isset( $this->auth_header ) ) { + + return $this->auth_header; + } + + $this->auth_header = array( 'X-Authorization' => 'Bearer ' . $this->get_access_token() ); + + return $this->auth_header; + } + + + /** + * Get request arguments + * + * @param array $args Args to add to the request. + * + * @return array Request arguments. + */ + public function get_request_args( $args = array() ) { + + if ( empty( $this->request_args['headers'] ) ) { + + $this->request_args['headers'] = $this->auth_header(); + } + + return array_merge_recursive( $this->request_args, $args ); + } + + + /** + * Get JSON data + * Encodes data to JSON if needed. + * + * @param array|string $data Data. + * + * @return mixed|string|void + */ + public function get_json_data( $data ) { + + return ( $this->is_json( $data ) ? $data : json_encode( $data ) ); + } + + + /** + * Decode JSON data + * Decodes JSON data if needed. + * + * @param array|string $data JSON Data. + * + * @return mixed|string|void + */ + public function decode_json_data( $data ) { + + return ( $this->is_json( $data ) ? json_decode( $data ) : $data ); + } + + + /** + * Is JSON? + * + * @param array|string $data Data. + * + * @return bool + */ + public function is_json( $data ) { + if ( is_array( $data ) ) { + + return false; + } + + @json_decode( $data ); + + return ( json_last_error() === JSON_ERROR_NONE ); + } + + + /** + * Reset object properties before new request. + */ + public function reset() { + + $this->errors = array(); + + $this->request_args = array(); + + $this->body = null; + + $this->status = null; + } + + + /** + * Remote Request + * Get response from cache if found (GET only). + * + * @uses wp_remote_get + * @uses wp_remote_post + * @uses wp_remote_request + * @uses get_cached_request + * @uses cache_request + * + * @param string $method Method: get|post|put|delete + * @param string $action API Action. + * @param array $data Data (for POST & DELETE) + * + * @return array|mixed|WP_Error + */ + function request( $method, $action, $data = array() ) { + + $this->reset(); + + $cached_request = $this->get_cached_request( $method, $action, $data ); + + if ( ! empty( $cached_request['response'] ) ) { + + $response = $cached_request['response']; + } else { + + $args = array(); + + if ( $data ) { + + $args['body'] = $data; + } + + $action_url = $this->get_action_url( $action ); + + if ( 'get' === $method ) { + + $response = wp_remote_get( $action_url, $this->get_request_args( $args ) ); + } elseif ( 'post' === $method ) { + + $response = wp_remote_post( $action_url, $this->get_request_args( $args ) ); + + } elseif ( 'put' === $method ) { + + $args['method'] = 'PUT'; + + $response = wp_remote_request( $action_url, $this->get_request_args( $args ) ); + } elseif ( 'delete' === $method ) { + + $args['method'] = 'DELETE'; + + $response = wp_remote_request( $action_url, $this->get_request_args( $args ) ); + } + } + + $this->cache_request( $method, $action, $response ); + + return $response; + } + + + /** + * POST request + * + * @example /contacts/{id} get a contact. + * + * @param string $action API action. + * + * @return WP_Error|array The response or WP_Error on failure. + */ + public function get( $action, $cache = false ) { + + if ( $cache ) { + $this->cache = $this->disable_cache; + } + + $response = $this->request( 'get', $action ); + + if ( $cache ) { + $this->cache = false; + } + + return $this->handle_response( $response ); + } + + + /** + * POST request + * + * @example /contacts to create a contact. + * + * @param string $action API action. + * @param array $data Array or JSON data. + * + * @return WP_Error|array The response or WP_Error on failure. + */ + public function post( $action, $data = array() ) { + + $response = $this->request( 'post', $action, $data ); + + return $this->handle_response( $response ); + } + + + /** + * PUT request + * + * @example /contacts/{id} to delete a contact. + * + * @param string $action API action. + * @param array $data Array or JSON data. + * + * @return WP_Error|array The response or WP_Error on failure. + */ + public function put( $action, $data = array() ) { + + $response = $this->request( 'put', $action, $data ); + + return $this->handle_response( $response ); + } + + + /** + * DELETE request + * + * @example /contacts/{id} to delete a contact. + * + * @param string $action API action. + * + * @return WP_Error|array The response or WP_Error on failure. + */ + public function delete( $action ) { + + $response = $this->request( 'delete', $action ); + + return $this->handle_response( $response ); + } + + + /** + * Handle request response (or error) + * Set $this->handle_response to false if you do not want to the response to be handled here. + * + * @uses $this->handle_error() + * + * @param WP_Error|array $response Request response or WP_Error on failure. + * + * @return WP_Error|array|bool $response Request response or WP_Error on failure, when not handled or true / false when handled. + */ + public function handle_response( $response ) { + + if ( ! $this->handle_response ) { + + return $response; + } + + if ( $this->handle_error( $response ) ) { + + return false; + } + + if ( ! $this->handle_status( $response ) ) { + + return false; + } + + // Return decoded response body. + return $this->body; + } + + + /** + * Handle response error: + * get message and add to errors. + * + * @uses $this->add_error() + * + * @param WP_Error $wp_error + * + * @return boolean + */ + public function handle_error( $wp_error ) { + + $error_message = ''; + + if ( is_wp_error( $wp_error ) ) { + $error_message = $wp_error->get_error_message(); + + } elseif ( empty( $wp_error ) ) { + + $error_message = __( 'Empty response. Unknown error.', 'rosariosis-rest-api' ); + } + + if ( ! empty( $error_message ) ) { + + $this->add_error( $error_message ); + + return true; + } + + return false; + } + + + /** + * Handle response status + * Sets $this->status + * + * @uses handle_body() + * + * @param array $response Request response. + * + * @return bool False if body has error, true if status code >= 200 or < 299, else false. + */ + public function handle_status( $response ) { + + $this->status = $response['response']['code']; + + if ( ! $this->handle_body( $response ) ) { + + return false; + } + + if ( $this->status >= 200 && + $this->status < 299 ) { + + return true; + } + + $message = $this->status . ' ' . $response['response']['message']; + + if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { + + $message .= ' — ' . $response['http_response']->get_response_object()->url; + } + + $this->add_error( $message ); + + return false; + } + + + /** + * Handle response body + * Sets $this->body with decoded JSON data. + * + * @param array $response Request response. + * + * @return bool False if body has error, else body. + */ + public function handle_body( $response ) { + + $this->body = $this->decode_json_data( $response['body'] ); + + if ( ! empty( $this->body ) ) { + + if ( ! empty( $this->body->message ) ) { + + $message = $this->body->code . ' ' . $this->body->message; + + if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { + + $message .= ' — ' . $response['http_response']->get_response_object()->url; + } + + $this->add_error( $message ); + + return false; + } + } + + if ( isset( $this->body->records ) ) { + $this->body = $this->body->records; + + if ( count( $this->body ) === 1 ) { + $this->body = $this->body[0]; + } + } + + return $this->body; + } + + + /** + * Add error message to errors + * + * @param string $error_message + * @param string $level Level: info, success, error or warning. + * + * @return string Error message with plugin name prefixed. + */ + public function add_error( $message, $level = 'error', $plugin = 'this' ) { + + if ( 'this' === $plugin ) { + + $plugin = __( 'RosarioSIS REST API', 'rosariosis-rest-api' ); + } + + if ( $plugin ) { + + $message = $plugin . ' — ' . (string) $message; + } + + $this->errors[] = array( + 'message' => $message, + 'level' => $level, + ); + + return $message; + } + + /** + * Save errors to transient + * Pass errors from the save post action to the edit post screen redirection. + * + * @link https://www.sitepoint.com/displaying-errors-from-the-save_post-hook-in-wordpress/ + * + * @param int $post_id + */ + public function save_errors_to_transient( $post_id = 0 ) { + + $post_id = $post_id ? $post_id : (int) $_GET['post']; + + $transient_name = 'rosariosis_rest_api_errors_' . $post_id; + + set_transient( $transient_name, serialize( $this->errors ), 45 ); + } + + + /** + * Get errors from transient + * Get any error saved to transient for the current post ID. + * Delete transient immediately. + * + * @param int $post_id + * + * @return array|mixed + */ + public function get_errors_from_transient( $post_id = 0 ) { + + if ( ! $post_id && empty( $_GET['post'] ) ) { + + return array(); + } + + $post_id = $post_id ? $post_id : (int) $_GET['post']; + + $transient_name = 'rosariosis_rest_api_errors_' . $post_id; + + $transient = get_transient( $transient_name ); + + // Delete transient. + delete_transient( $transient_name ); + + if ( empty( $transient ) ) { + + return array(); + } + + return unserialize( $transient ); + } + + + /** + * Get last error and remove it from the errors array. + * + * @return array Empty array if no errors, else last error. + */ + public function last_error_unset() { + + if ( empty( $this->errors ) ) { + + return array(); + } + + return array_pop( $this->errors ); + } + + + /** + * Admin notices action + * + * @access public + * @since 1.0.0 + * + * @uses notice_html() + */ + public function admin_notices() { + + $errors_from_transient = $this->get_errors_from_transient(); + + if ( empty( $this->errors ) && + empty( $errors_from_transient ) ) { + + return; + } + + foreach ( $this->errors as $error ) { + + $this->notice_html( $error['message'], $error['level'] ); + } + + foreach ( $errors_from_transient as $error ) { + + $this->notice_html( $error['message'], $error['level'] ); + } + } + + + /** + * Notice HTML output + * + * @param string $message Message. + * @param string $level Level: info, success, error or warning. + */ + public function notice_html( $message, $level = '' ) { + + $level_class = ''; + + if ( $level && 'notice' !== $level ) { + $level_class = 'notice-' . $level; + } + ?> +
    +

    +
    + disable_cache to true. + * + * @param string $method + * @param string $action + * @param array $response + * @param array $data + * + * @return bool True if cached. + */ + public function cache_request( $method, $action, $response, $data = array() ) { + + // Do not cache POST, PUT and DELETE requests... + if ( $this->cache && 'get' === $method ) { + + return false; + } + + $cache = array( + 'method' => $method, + 'action' => $action, + 'data' => $data, + 'response' => $response, + ); + + $transient_name = 'rosariosis_rest_api_cache_' . $method . '_' . $action; + + return set_transient( $transient_name, $cache, 86400 ); + } + + + /** + * Get cached Request in transient + * Bypass cache by setting $this->disable_cache to true. + * + * @param string $method + * @param string $action + * @param array $data + * + * @return array|mixed Cached request or empty array. + */ + public function get_cached_request( $method, $action, $data = array() ) { + + // Do not cache POST, PUT and DELETE requests... + if ( $this->cache && 'get' === $method ) { + + return array(); + } + + $transient_name = 'rosariosis_rest_api_cache_' . $method . '_' . $action; + + $cache = get_transient( $transient_name ); + + if ( empty( $cache ) ) { + + return array(); + } + + if ( empty( $cache['data'] ) && empty( $data ) ) { + + return $cache; + } + + if ( $cache['data'] !== $data ) { + + return array(); + } + + return $cache; + } + + + /** + * Delete cached Request in transient + * + * @param string $method + * @param string $action + * + * @return bool True if deleted. + */ + public function delete_cached_request( $method, $action ) { + + $transient_name = 'rosariosis_rest_api_cache_' . $method . '_' . $action; + + return delete_transient( $transient_name ); + } +} diff --git a/plugins/rosariosis-rest-api/includes/class-rosariosis-rest-api-settings.php b/plugins/rosariosis-rest-api/includes/class-rosariosis-rest-api-settings.php new file mode 100644 index 000000000..1332ef44c --- /dev/null +++ b/plugins/rosariosis-rest-api/includes/class-rosariosis-rest-api-settings.php @@ -0,0 +1,442 @@ +parent = $parent; + + $this->base = 'wpt_'; + + // Initialise settings. + add_action( 'init', array( $this, 'init_settings' ), 11 ); + + // Register plugin settings. + add_action( 'admin_init' , array( $this, 'register_settings' ) ); + + // Add settings page to menu. + add_action( 'admin_menu' , array( $this, 'add_menu_item' ) ); + + // Add settings link to plugins page. + add_filter( 'plugin_action_links_' . plugin_basename( $this->parent->file ) , array( $this, 'add_settings_link' ) ); + } + + /** + * Initialise settings + * + * @return void + */ + public function init_settings() { + $this->settings = $this->settings_fields(); + } + + /** + * Add settings page to admin menu + * + * @return void + */ + public function add_menu_item() { + $page = add_options_page( __( 'Plugin Settings', 'rosariosis-rest-api' ) , __( 'Plugin Settings', 'rosariosis-rest-api' ) , 'manage_options' , $this->parent->_token . '_settings' , array( $this, 'settings_page' ) ); + add_action( 'admin_print_styles-' . $page, array( $this, 'settings_assets' ) ); + } + + /** + * Load settings JS & CSS + * + * @return void + */ + public function settings_assets() { + + // We're including the farbtastic script & styles here because they're needed for the colour picker + // If you're not including a colour picker field then you can leave these calls out as well as the farbtastic dependency for the wpt-admin-js script below. + wp_enqueue_style( 'farbtastic' ); + wp_enqueue_script( 'farbtastic' ); + + // We're including the WP media scripts here because they're needed for the image upload field + // If you're not including an image upload then you can leave this function call out. + wp_enqueue_media(); + + wp_register_script( $this->parent->_token . '-settings-js', $this->parent->assets_url . 'js/settings' . $this->parent->script_suffix . '.js', array( 'farbtastic', 'jquery' ), '1.0.0' ); + wp_enqueue_script( $this->parent->_token . '-settings-js' ); + } + + /** + * Add settings link to plugin list table + * + * @param array $links Existing links. + * @return array Modified links. + */ + public function add_settings_link( $links ) { + $settings_link = '' . __( 'Settings', 'rosariosis-rest-api' ) . ''; + array_push( $links, $settings_link ); + return $links; + } + + /** + * Build settings fields + * + * @return array Fields to be displayed on settings page. + */ + private function settings_fields() { + + $settings['standard'] = array( + 'title' => __( 'Standard', 'rosariosis-rest-api' ), + 'description' => __( 'These are fairly standard form input fields.', 'rosariosis-rest-api' ), + 'fields' => array( + array( + 'id' => 'text_field', + 'label' => __( 'Some Text' , 'rosariosis-rest-api' ), + 'description' => __( 'This is a standard text field.', 'rosariosis-rest-api' ), + 'type' => 'text', + 'default' => '', + 'placeholder' => __( 'Placeholder text', 'rosariosis-rest-api' ) + ), + array( + 'id' => 'password_field', + 'label' => __( 'A Password' , 'rosariosis-rest-api' ), + 'description' => __( 'This is a standard password field.', 'rosariosis-rest-api' ), + 'type' => 'password', + 'default' => '', + 'placeholder' => __( 'Placeholder text', 'rosariosis-rest-api' ) + ), + array( + 'id' => 'secret_text_field', + 'label' => __( 'Some Secret Text' , 'rosariosis-rest-api' ), + 'description' => __( 'This is a secret text field - any data saved here will not be displayed after the page has reloaded, but it will be saved.', 'rosariosis-rest-api' ), + 'type' => 'text_secret', + 'default' => '', + 'placeholder' => __( 'Placeholder text', 'rosariosis-rest-api' ) + ), + array( + 'id' => 'text_block', + 'label' => __( 'A Text Block' , 'rosariosis-rest-api' ), + 'description' => __( 'This is a standard text area.', 'rosariosis-rest-api' ), + 'type' => 'textarea', + 'default' => '', + 'placeholder' => __( 'Placeholder text for this textarea', 'rosariosis-rest-api' ) + ), + array( + 'id' => 'single_checkbox', + 'label' => __( 'An Option', 'rosariosis-rest-api' ), + 'description' => __( 'A standard checkbox - if you save this option as checked then it will store the option as \'on\', otherwise it will be an empty string.', 'rosariosis-rest-api' ), + 'type' => 'checkbox', + 'default' => '', + ), + array( + 'id' => 'select_box', + 'label' => __( 'A Select Box', 'rosariosis-rest-api' ), + 'description' => __( 'A standard select box.', 'rosariosis-rest-api' ), + 'type' => 'select', + 'options' => array( 'drupal' => 'Drupal', 'joomla' => 'Joomla', 'wordpress' => 'WordPress' ), + 'default' => 'wordpress', + ), + array( + 'id' => 'radio_buttons', + 'label' => __( 'Some Options', 'rosariosis-rest-api' ), + 'description' => __( 'A standard set of radio buttons.', 'rosariosis-rest-api' ), + 'type' => 'radio', + 'options' => array( 'superman' => 'Superman', 'batman' => 'Batman', 'ironman' => 'Iron Man' ), + 'default' => 'batman', + ), + array( + 'id' => 'multiple_checkboxes', + 'label' => __( 'Some Items', 'rosariosis-rest-api' ), + 'description' => __( 'You can select multiple items and they will be stored as an array.', 'rosariosis-rest-api' ), + 'type' => 'checkbox_multi', + 'options' => array( + 'square' => 'Square', + 'circle' => 'Circle', + 'rectangle' => 'Rectangle', + 'triangle' => 'Triangle', + ), + 'default' => array( 'circle', 'triangle' ), + ), + ), + ); + + $settings['extra'] = array( + 'title' => __( 'Extra', 'rosariosis-rest-api' ), + 'description' => __( 'These are some extra input fields that maybe aren\'t as common as the others.', 'rosariosis-rest-api' ), + 'fields' => array( + array( + 'id' => 'number_field', + 'label' => __( 'A Number' , 'rosariosis-rest-api' ), + 'description' => __( 'This is a standard number field - if this field contains anything other than numbers then the form will not be submitted.', 'rosariosis-rest-api' ), + 'type' => 'number', + 'default' => '', + 'placeholder' => __( '42', 'rosariosis-rest-api' ) + ), + array( + 'id' => 'colour_picker', + 'label' => __( 'Pick a colour', 'rosariosis-rest-api' ), + 'description' => __( 'This uses WordPress\' built-in colour picker - the option is stored as the colour\'s hex code.', 'rosariosis-rest-api' ), + 'type' => 'color', + 'default' => '#21759B', + ), + array( + 'id' => 'an_image', + 'label' => __( 'An Image' , 'rosariosis-rest-api' ), + 'description' => __( 'This will upload an image to your media library and store the attachment ID in the option field. Once you have uploaded an imge the thumbnail will display above these buttons.', 'rosariosis-rest-api' ), + 'type' => 'image', + 'default' => '', + 'placeholder' => '', + ), + array( + 'id' => 'multi_select_box', + 'label' => __( 'A Multi-Select Box', 'rosariosis-rest-api' ), + 'description' => __( 'A standard multi-select box - the saved data is stored as an array.', 'rosariosis-rest-api' ), + 'type' => 'select_multi', + 'options' => array( + 'linux' => 'Linux', + 'mac' => 'Mac', + 'windows' => 'Windows', + ), + 'default' => array( 'linux' ), + ), + ), + ); + + $settings = apply_filters( $this->parent->_token . '_settings_fields', $settings ); + + return $settings; + } + + /** + * Register plugin settings + * + * @return void + */ + public function register_settings() { + if ( is_array( $this->settings ) ) { + + $post_tab = isset( $_POST['tab'] ) ? sanitize_key( $_POST['tab'] ) : null; + $get_tab = isset( $_GET['tab'] ) ? sanitize_key( $_GET['tab'] ) : null; + + // Check posted/selected tab. + $current_section = ''; + if ( $post_tab ) { + $current_section = $post_tab; + } else { + if ( $get_tab ) { + $current_section = $get_tab; + } + } + + foreach ( $this->settings as $section => $data ) { + + if ( $current_section + && $current_section != $section ) { + continue; + } + + // Add section to page. + add_settings_section( $section, $data['title'], array( $this, 'settings_section' ), $this->parent->_token . '_settings' ); + + foreach ( $data['fields'] as $field ) { + + // Validation callback for field. + $validation = ''; + if ( isset( $field['callback'] ) ) { + $validation = $field['callback']; + } + + // Register field. + $option_name = $this->base . $field['id']; + register_setting( $this->parent->_token . '_settings', $option_name, $validation ); + + // Add field to page. + add_settings_field( + $field['id'], + $field['label'], + array( $this->parent->admin, 'display_field' ), + $this->parent->_token . '_settings', + $section, + array( + 'field' => $field, + 'prefix' => $this->base, + ) + ); + } + + if ( ! $current_section ) { + break; + } + } + } + } + + /** + * Settings section + * + * @param array $section Section info. + * + * @return void + */ + public function settings_section( $section ) { + $html = '

    ' . $this->settings[ $section['id'] ]['description'] . '

    ' . "\n"; + echo $html; + } + + /** + * Load settings page content + * + * @return void + */ + public function settings_page() { + + // Build page HTML. + $html = '
    ' . "\n"; + $html .= '

    ' . __( 'Plugin Settings' , 'rosariosis-rest-api' ) . '

    ' . "\n"; + + $get_tab = isset( $_GET['tab'] ) ? sanitize_key( $_GET['tab'] ) : null; + + $tab = ''; + if ( $get_tab ) { + $tab .= $get_tab; + } + + // Show page tabs. + if ( is_array( $this->settings ) && 1 < count( $this->settings ) ) { + + $html .= '' . "\n"; + } + + $html .= '
    ' . "\n"; + + // Get settings fields. + ob_start(); + settings_fields( $this->parent->_token . '_settings' ); + do_settings_sections( $this->parent->_token . '_settings' ); + $html .= ob_get_clean(); + + $html .= '

    ' . "\n"; + $html .= '' . "\n"; + $html .= '' . "\n"; + $html .= '

    ' . "\n"; + $html .= '
    ' . "\n"; + $html .= '
    ' . "\n"; + + echo $html; + } + + /** + * Main RosarioSIS_REST_API_Settings Instance + * + * Ensures only one instance of RosarioSIS_REST_API_Settings is loaded or can be loaded. + * + * @since 1.0.0 + * @static + * @see RosarioSIS_REST_API() + * + * @param object $parent Parent object. + * @return Main RosarioSIS_REST_API_Settings instance + */ + public static function instance( $parent ) { + if ( is_null( self::$_instance ) ) { + self::$_instance = new self( $parent ); + } + return self::$_instance; + } // End instance() + + /** + * Cloning is forbidden. + * + * @since 1.0.0 + */ + public function __clone() { + _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?' ), $this->parent->_version ); + } // End __clone() + + /** + * Unserializing instances of this class is forbidden. + * + * @since 1.0.0 + */ + public function __wakeup() { + _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?' ), $this->parent->_version ); + } // End __wakeup() +} diff --git a/plugins/rosariosis-rest-api/includes/class-rosariosis-rest-api.php b/plugins/rosariosis-rest-api/includes/class-rosariosis-rest-api.php new file mode 100644 index 000000000..eb3409f25 --- /dev/null +++ b/plugins/rosariosis-rest-api/includes/class-rosariosis-rest-api.php @@ -0,0 +1,320 @@ +_version = $version; + $this->_token = 'rosariosis_rest_api'; + + // Load plugin environment variables. + $this->file = $file; + $this->dir = dirname( $this->file ); + $this->assets_dir = trailingslashit( $this->dir ) . 'assets'; + $this->assets_url = esc_url( trailingslashit( plugins_url( '/assets/', $this->file ) ) ); + + $this->script_suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; + + register_activation_hook( $this->file, array( $this, 'install' ) ); + + // Load frontend JS & CSS. + // add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles' ), 10 ); + // add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ), 10 ); + + // Load admin JS & CSS. + // add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ), 10, 1 ); + // add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_styles' ), 10, 1 ); + + // Load API for generic admin functions. + /*if ( is_admin() ) { + $this->admin = new RosarioSIS_REST_API_Admin_API(); + }*/ + + // Handle localisation. + $this->load_plugin_textdomain(); + add_action( 'init', array( $this, 'load_localisation' ), 0 ); + } // End __construct () + + /** + * Wrapper function to register a new post type + * + * @param string $post_type Post type name. + * @param string $plural Post type item plural name. + * @param string $single Post type item single name. + * @param string $description Description of post type. + * @param array $options Post type options. + * @return object Post type class object. + */ + public function register_post_type( $post_type = '', $plural = '', $single = '', $description = '', $options = array() ) { + + if ( ! $post_type || + ! $plural || + ! $single ) { + return; + } + + $post_type = new RosarioSIS_REST_API_Post_Type( $post_type, $plural, $single, $description, $options ); + + return $post_type; + } + + /** + * Wrapper function to register a new taxonomy + * + * @param string $taxonomy Taxonomy name. + * @param string $plural Taxonomy single name. + * @param string $single Taxonomy plural name. + * @param array $post_types Post types to which this taxonomy applies. + * @param array $taxonomy_args Taxonomy arguments. + * @return object Taxonomy class object + */ + public function register_taxonomy( $taxonomy = '', $plural = '', $single = '', $post_types = array(), $taxonomy_args = array() ) { + + if ( ! $taxonomy || + ! $plural || + ! $single ) { + return; + } + + $taxonomy = new RosarioSIS_REST_API_Taxonomy( $taxonomy, $plural, $single, $post_types, $taxonomy_args ); + + return $taxonomy; + } + + /** + * Load frontend CSS. + * + * @access public + * @since 1.0.0 + * @return void + */ + public function enqueue_styles() { + wp_register_style( $this->_token . '-frontend', esc_url( $this->assets_url ) . 'css/frontend.css', array(), $this->_version ); + wp_enqueue_style( $this->_token . '-frontend' ); + } // End enqueue_styles () + + /** + * Load frontend Javascript. + * + * @access public + * @since 1.0.0 + * @return void + */ + public function enqueue_scripts() { + wp_register_script( $this->_token . '-frontend', esc_url( $this->assets_url ) . 'js/frontend' . $this->script_suffix . '.js', array( 'jquery' ), $this->_version ); + wp_enqueue_script( $this->_token . '-frontend' ); + } // End enqueue_scripts () + + /** + * Load admin CSS. + * + * @access public + * @since 1.0.0 + * @return void + */ + public function admin_enqueue_styles( $hook = '' ) { + wp_register_style( $this->_token . '-admin', esc_url( $this->assets_url ) . 'css/admin.css', array(), $this->_version ); + wp_enqueue_style( $this->_token . '-admin' ); + } // End admin_enqueue_styles () + + /** + * Load admin Javascript. + * + * @access public + * @since 1.0.0 + * + * @param string $hook Hook. + * @return void + */ + public function admin_enqueue_scripts( $hook = '' ) { + wp_register_script( $this->_token . '-admin', esc_url( $this->assets_url ) . 'js/admin' . $this->script_suffix . '.js', array( 'jquery' ), $this->_version ); + wp_enqueue_script( $this->_token . '-admin' ); + } // End admin_enqueue_scripts () + + /** + * Load plugin localisation + * + * @access public + * @since 1.0.0 + * @return void + */ + public function load_localisation() { + load_plugin_textdomain( 'rosariosis-rest-api', false, dirname( plugin_basename( $this->file ) ) . '/lang/' ); + } // End load_localisation () + + /** + * Load plugin textdomain + * + * @access public + * @since 1.0.0 + * @return void + */ + public function load_plugin_textdomain() { + $domain = 'rosariosis-rest-api'; + + $locale = apply_filters( 'plugin_locale', get_locale(), $domain ); + + load_textdomain( $domain, WP_LANG_DIR . '/' . $domain . '/' . $domain . '-' . $locale . '.mo' ); + load_plugin_textdomain( $domain, false, dirname( plugin_basename( $this->file ) ) . '/lang/' ); + } // End load_plugin_textdomain () + + /** + * Main RosarioSIS_REST_API Instance + * + * Ensures only one instance of RosarioSIS_REST_API is loaded or can be loaded. + * + * @since 1.0.0 + * @static + * @see RosarioSIS_REST_API() + * + * @param string $file File pathname. + * @param string $version Version number. + * @return RosarioSIS_REST_API instance + */ + public static function instance( $file = '', $version = '1.0.0' ) { + if ( is_null( self::$_instance ) ) { + self::$_instance = new self( $file, $version ); + } + return self::$_instance; + } // End instance () + + /** + * Cloning is forbidden. + * + * @since 1.0.0 + */ + public function __clone() { + _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?' ), $this->_version ); + } // End __clone () + + /** + * Unserializing instances of this class is forbidden. + * + * @since 1.0.0 + */ + public function __wakeup() { + _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?' ), $this->_version ); + } // End __wakeup () + + /** + * Installation. Runs on activation. + * + * @access public + * @since 1.0.0 + * @return void + */ + public function install() { + $this->_log_version_number(); + } // End install () + + /** + * Log the plugin version number. + * + * @access public + * @since 1.0.0 + * @return void + */ + private function _log_version_number() { + update_option( $this->_token . '_version', $this->_version ); + } // End _log_version_number () +} diff --git a/plugins/rosariosis-rest-api/includes/lib/class-rosariosis-rest-api-admin-api.php b/plugins/rosariosis-rest-api/includes/lib/class-rosariosis-rest-api-admin-api.php new file mode 100644 index 000000000..4a8dfa5c0 --- /dev/null +++ b/plugins/rosariosis-rest-api/includes/lib/class-rosariosis-rest-api-admin-api.php @@ -0,0 +1,388 @@ +ID, $field['id'], true ); + + // Get data to display in field. + if ( isset( $option ) ) { + $data = $option; + } + } else { + + // Get saved option. + $option_name .= $field['id']; + $option = get_option( $option_name ); + + // Get data to display in field. + if ( isset( $option ) ) { + $data = $option; + } + } + + // Show default data if no option saved and default is supplied. + if ( $data === false + && isset( $field['default'] ) ) { + $data = $field['default']; + } elseif ( $data === false ) { + $data = ''; + } + + $html = ''; + + switch ( $field['type'] ) { + + case 'text': + case 'url': + case 'email': + case 'date': + $html .= '' . "\n"; + break; + + case 'password': + case 'number': + case 'hidden': + $min = ''; + if ( isset( $field['min'] ) ) { + $min = ' min="' . esc_attr( $field['min'] ) . '"'; + } + + $max = ''; + if ( isset( $field['max'] ) ) { + $max = ' max="' . esc_attr( $field['max'] ) . '"'; + } + $html .= '' . "\n"; + break; + + case 'text_secret': + $html .= '' . "\n"; + break; + + case 'textarea': + $html .= '
    '. "\n"; + break; + + case 'checkbox': + $checked = ''; + if ( $data && 'on' == $data ) { + $checked = 'checked="checked"'; + } + $html .= '' . "\n"; + break; + + case 'checkbox_multi': + foreach ( $field['options'] as $k => $v ) { + $checked = false; + if ( in_array( $k, (array) $data ) ) { + $checked = true; + } + $html .= ' '; + } + break; + + case 'radio': + foreach ( $field['options'] as $k => $v ) { + $checked = false; + if ( $k == $data ) { + $checked = true; + } + $html .= ' '; + } + break; + + case 'select': + $html .= ' '; + break; + + case 'select_multi': + $html .= ' '; + break; + + case 'image': + $image_thumb = ''; + if ( $data ) { + $image_thumb = wp_get_attachment_thumb_url( $data ); + } + $html .= '
    ' . "\n"; + $html .= '' . "\n"; + $html .= '' . "\n"; + $html .= '
    ' . "\n"; + break; + + case 'color': + ?>
    + +
    +
    + ' . $field['description'] . ''; + break; + + default: + if ( ! $post ) { + $html .= '' . "\n"; + } + break; + } + + if ( ! $echo ) { + return $html; + } + + echo $html; + } + + /** + * Validate form field + * + * @param string $data Submitted value. + * @param string $type Type of field to validate. + * @return string Validated value. + */ + public function validate_field( $data = '', $type = 'text' ) { + + switch( $type ) { + case 'text': + $data = esc_attr( $data ); + break; + case 'url': + $data = esc_url( $data ); + break; + case 'email': + $data = is_email( $data ); + break; + } + + return $data; + } + + /** + * Add meta box to the dashboard + * + * @param string $id Unique ID for metabox. + * @param string $title Display title of metabox. + * @param array $post_types Post types to which this metabox applies. + * @param string $context Context in which to display this metabox ('advanced' or 'side'). + * @param string $priority Priority of this metabox ('default', 'low' or 'high'). + * @param array $callback_args Any axtra arguments that will be passed to the display function for this metabox. + * @return void + */ + public function add_meta_box( $id = '', $title = '', $post_types = array(), $context = 'advanced', $priority = 'default', $callback_args = null ) { + + // Get post type(s). + if ( ! is_array( $post_types ) ) { + $post_types = array( $post_types ); + } + + // Generate each metabox. + foreach ( $post_types as $post_type ) { + add_meta_box( $id, $title, array( $this, 'meta_box_content' ), $post_type, $context, $priority, $callback_args ); + } + } + + /** + * Display metabox content + * + * @param object $post Post object. + * @param array $args Arguments unique to this metabox. + * @return void + */ + public function meta_box_content( $post, $args ) { + + $fields = apply_filters( $post->post_type . '_custom_fields', array(), $post->post_type ); + + if ( ! is_array( $fields ) || + 0 === count( $fields ) ) { + return; + } + + echo '
    ' . "\n"; + + foreach ( $fields as $field ) { + + if ( ! isset( $field['metabox'] ) ) { + continue; + } + + if ( ! is_array( $field['metabox'] ) ) { + $field['metabox'] = array( $field['metabox'] ); + } + + if ( in_array( $args['id'], $field['metabox'] ) ) { + $this->display_meta_box_field( $field, $post ); + } + } + + echo '
    ' . "\n"; + } + + /** + * Dispay field in metabox + * + * @param array $field Field data. + * @param object $post Post object. + * @return void + */ + public function display_meta_box_field( $field = array(), $post ) { + + if ( ! is_array( $field ) || + 0 === count( $field ) ) { + return; + } + + $field = '

    ' . $this->display_field( $field, $post, false ) . '

    ' . "\n"; + + echo $field; + } + + /** + * Save metabox fields + * + * @param integer $post_id Post ID. + * @return void + */ + public function save_meta_boxes( $post_id = 0 ) { + + global $post; + + if ( ! $post_id ) { + return; + } + + if ( ! is_admin() ) { + return; + } + + if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { + return; + } + + if ( empty( $post->ID ) ) { + return; + } + + if ( ! current_user_can( 'edit_page', $post->ID ) ) { + return; + } + + $post_type = get_post_type( $post_id ); + + $fields = apply_filters( $post_type . '_custom_fields', array(), $post_type ); + + if ( ! is_array( $fields ) || + 0 === count( $fields ) ) { + return; + } + + foreach ( $fields as $field ) { + if ( isset( $_REQUEST[ $field['id'] ] ) ) { + $request_field = sanitize_meta( $field['id'], $_REQUEST[ $field['id'] ], $post_type ); + + update_post_meta( + $post_id, + $field['id'], + $this->validate_field( $request_field, $field['type'] ) + ); + } else { + update_post_meta( $post_id, $field['id'], '' ); + } + } + } +} diff --git a/plugins/rosariosis-rest-api/includes/lib/class-rosariosis-rest-api-post-type.php b/plugins/rosariosis-rest-api/includes/lib/class-rosariosis-rest-api-post-type.php new file mode 100644 index 000000000..407cad1e7 --- /dev/null +++ b/plugins/rosariosis-rest-api/includes/lib/class-rosariosis-rest-api-post-type.php @@ -0,0 +1,191 @@ +post_type = $post_type; + $this->plural = $plural; + $this->single = $single; + $this->description = $description; + $this->options = $options; + + // Regsiter post type. + add_action( 'init' , array( $this, 'register_post_type' ) ); + + // Display custom update messages for posts edits. + add_filter( 'post_updated_messages', array( $this, 'updated_messages' ) ); + add_filter( 'bulk_post_updated_messages', array( $this, 'bulk_updated_messages' ), 10, 2 ); + } + + /** + * Register new post type + * + * @return void + */ + public function register_post_type() { + + $labels = array( + 'name' => $this->plural, + 'singular_name' => $this->single, + 'name_admin_bar' => $this->single, + 'add_new' => _x( 'Add New', $this->post_type, 'rosariosis-rest-api' ), + 'add_new_item' => sprintf( __( 'Add New %s', 'rosariosis-rest-api' ), $this->single ), + 'edit_item' => sprintf( __( 'Edit %s', 'rosariosis-rest-api' ), $this->single ), + 'new_item' => sprintf( __( 'New %s', 'rosariosis-rest-api' ), $this->single ), + 'all_items' => sprintf( __( 'All %s', 'rosariosis-rest-api' ), $this->plural ), + 'view_item' => sprintf( __( 'View %s', 'rosariosis-rest-api' ), $this->single ), + 'search_items' => sprintf( __( 'Search %s', 'rosariosis-rest-api' ), $this->plural ), + 'not_found' => sprintf( __( 'No %s Found', 'rosariosis-rest-api' ), $this->plural ), + 'not_found_in_trash' => sprintf( __( 'No %s Found In Trash', 'rosariosis-rest-api' ), $this->plural ), + 'parent_item_colon' => sprintf( __( 'Parent %s' ), $this->single ), + 'menu_name' => $this->plural, + ); + + $args = array( + 'labels' => apply_filters( $this->post_type . '_labels', $labels ), + 'description' => $this->description, + 'public' => true, + 'publicly_queryable' => true, + 'exclude_from_search' => false, + 'show_ui' => true, + 'show_in_menu' => true, + 'show_in_nav_menus' => true, + 'query_var' => true, + 'can_export' => true, + 'rewrite' => true, + 'capability_type' => 'post', + 'has_archive' => true, + 'hierarchical' => true, + 'show_in_rest' => true, + 'rest_base' => $this->post_type, + 'rest_controller_class' => 'WP_REST_Posts_Controller', + 'supports' => array( 'title', 'editor', 'excerpt', 'comments', 'thumbnail' ), + 'menu_position' => 5, + 'menu_icon' => 'dashicons-admin-post', + ); + + $args = array_merge( $args, $this->options ); + + register_post_type( $this->post_type, apply_filters( $this->post_type . '_register_args', $args, $this->post_type ) ); + } + + /** + * Set up admin messages for post type + * + * @param array $messages Default message. + * @return array Modified messages. + */ + public function updated_messages( $messages = array() ) { + global $post, + $post_ID; + + $messages[ $this->post_type ] = array( + 0 => '', + 1 => sprintf( __( '%1$s updated. %2$sView %3$s%4$s.' , 'rosariosis-rest-api' ), $this->single, '', $this->single, '' ), + 2 => __( 'Custom field updated.' , 'rosariosis-rest-api' ), + 3 => __( 'Custom field deleted.' , 'rosariosis-rest-api' ), + 4 => sprintf( __( '%1$s updated.' , 'rosariosis-rest-api' ), $this->single ), + 5 => isset( $_GET['revision'] ) ? sprintf( __( '%1$s restored to revision from %2$s.', 'rosariosis-rest-api' ), $this->single, wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, + 6 => sprintf( __( '%1$s published. %2$sView %3$s%4s.' , 'rosariosis-rest-api' ), $this->single, '', $this->single, '' ), + 7 => sprintf( __( '%1$s saved.' , 'rosariosis-rest-api' ), $this->single ), + 8 => sprintf( __( '%1$s submitted. %2$sPreview post%3$s%4$s.' , 'rosariosis-rest-api' ), $this->single, '', $this->single, '' ), + 9 => sprintf( __( '%1$s scheduled for: %2$s. %3$sPreview %4$s%5$s.' , 'rosariosis-rest-api' ), $this->single, '' . date_i18n( __( 'M j, Y @ G:i' , 'rosariosis-rest-api' ), strtotime( $post->post_date ) ) . '', '', $this->single, '' ), + 10 => sprintf( __( '%1$s draft updated. %2$sPreview %3$s%4$s.' , 'rosariosis-rest-api' ), $this->single, '', $this->single, '' ), + ); + + return $messages; + } + + /** + * Set up bulk admin messages for post type + * + * @param array $bulk_messages Default bulk messages. + * @param array $bulk_counts Counts of selected posts in each status. + * @return array Modified messages. + */ + public function bulk_updated_messages( $bulk_messages = array(), $bulk_counts = array() ) { + + $bulk_messages[ $this->post_type ] = array( + 'updated' => sprintf( _n( '%1$s %2$s updated.', '%1$s %3$s updated.', $bulk_counts['updated'], 'rosariosis-rest-api' ), $bulk_counts['updated'], $this->single, $this->plural ), + 'locked' => sprintf( _n( '%1$s %2$s not updated, somebody is editing it.', '%1$s %3$s not updated, somebody is editing them.', $bulk_counts['locked'], 'rosariosis-rest-api' ), $bulk_counts['locked'], $this->single, $this->plural ), + 'deleted' => sprintf( _n( '%1$s %2$s permanently deleted.', '%1$s %3$s permanently deleted.', $bulk_counts['deleted'], 'rosariosis-rest-api' ), $bulk_counts['deleted'], $this->single, $this->plural ), + 'trashed' => sprintf( _n( '%1$s %2$s moved to the Trash.', '%1$s %3$s moved to the Trash.', $bulk_counts['trashed'], 'rosariosis-rest-api' ), $bulk_counts['trashed'], $this->single, $this->plural ), + 'untrashed' => sprintf( _n( '%1$s %2$s restored from the Trash.', '%1$s %3$s restored from the Trash.', $bulk_counts['untrashed'], 'rosariosis-rest-api' ), $bulk_counts['untrashed'], $this->single, $this->plural ), + ); + + return $bulk_messages; + } +} diff --git a/plugins/rosariosis-rest-api/includes/lib/class-rosariosis-rest-api-taxonomy.php b/plugins/rosariosis-rest-api/includes/lib/class-rosariosis-rest-api-taxonomy.php new file mode 100644 index 000000000..08a4b390c --- /dev/null +++ b/plugins/rosariosis-rest-api/includes/lib/class-rosariosis-rest-api-taxonomy.php @@ -0,0 +1,143 @@ +taxonomy = $taxonomy; + $this->plural = $plural; + $this->single = $single; + if ( ! is_array( $post_types ) ) { + $post_types = array( $post_types ); + } + $this->post_types = $post_types; + $this->taxonomy_args = $tax_args; + + // Register taxonomy. + add_action( 'init', array( $this, 'register_taxonomy' ) ); + } + + /** + * Register new taxonomy + * + * @return void + */ + public function register_taxonomy() { + + $labels = array( + 'name' => $this->plural, + 'singular_name' => $this->single, + 'menu_name' => $this->plural, + 'all_items' => sprintf( __( 'All %s' , 'rosariosis-rest-api' ), $this->plural ), + 'edit_item' => sprintf( __( 'Edit %s' , 'rosariosis-rest-api' ), $this->single ), + 'view_item' => sprintf( __( 'View %s' , 'rosariosis-rest-api' ), $this->single ), + 'update_item' => sprintf( __( 'Update %s' , 'rosariosis-rest-api' ), $this->single ), + 'add_new_item' => sprintf( __( 'Add New %s' , 'rosariosis-rest-api' ), $this->single ), + 'new_item_name' => sprintf( __( 'New %s Name' , 'rosariosis-rest-api' ), $this->single ), + 'parent_item' => sprintf( __( 'Parent %s' , 'rosariosis-rest-api' ), $this->single ), + 'parent_item_colon' => sprintf( __( 'Parent %s:' , 'rosariosis-rest-api' ), $this->single ), + 'search_items' => sprintf( __( 'Search %s' , 'rosariosis-rest-api' ), $this->plural ), + 'popular_items' => sprintf( __( 'Popular %s' , 'rosariosis-rest-api' ), $this->plural ), + 'separate_items_with_commas' => sprintf( __( 'Separate %s with commas' , 'rosariosis-rest-api' ), $this->plural ), + 'add_or_remove_items' => sprintf( __( 'Add or remove %s' , 'rosariosis-rest-api' ), $this->plural ), + 'choose_from_most_used' => sprintf( __( 'Choose from the most used %s' , 'rosariosis-rest-api' ), $this->plural ), + 'not_found' => sprintf( __( 'No %s found' , 'rosariosis-rest-api' ), $this->plural ), + ); + + $args = array( + 'label' => $this->plural, + 'labels' => apply_filters( $this->taxonomy . '_labels', $labels ), + 'hierarchical' => true, + 'public' => true, + 'show_ui' => true, + 'show_in_nav_menus' => true, + 'show_tagcloud' => true, + 'meta_box_cb' => null, + 'show_admin_column' => true, + 'show_in_quick_edit' => true, + 'update_count_callback' => '', + 'show_in_rest' => true, + 'rest_base' => $this->taxonomy, + 'rest_controller_class' => 'WP_REST_Terms_Controller', + 'query_var' => $this->taxonomy, + 'rewrite' => true, + 'sort' => '', + ); + + $args = array_merge( $args, $this->taxonomy_args ); + + register_taxonomy( $this->taxonomy, $this->post_types, apply_filters( $this->taxonomy . '_register_args', $args, $this->taxonomy, $this->post_types ) ); + } +} diff --git a/plugins/rosariosis-rest-api/index.php b/plugins/rosariosis-rest-api/index.php new file mode 100644 index 000000000..62200328f --- /dev/null +++ b/plugins/rosariosis-rest-api/index.php @@ -0,0 +1,2 @@ +\n" +"Language: fr_FR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.8.11\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-Basepath: ..\n" +"X-Poedit-KeywordsList: __\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Poedit-SearchPath-0: .\n" +"X-Poedit-SearchPathExcluded-0: includes/lib\n" +"X-Poedit-SearchPathExcluded-1: includes/class-rosariosis-rest-api-settings." +"php\n" + +#: includes/class-rosariosis-rest-api-controller.php:169 +msgid "" +"Please define the ROSARIOSIS_REST_API_URL & ROSARIOSIS_REST_API_USER_TOKEN " +"constants in the wp-config.php file." +msgstr "" +"Merci de définir les constantes ROSARIOSIS_REST_API_URL et " +"ROSARIOSIS_REST_API_USER_TOKEN dans le fichier wp-config.php." + +#: includes/class-rosariosis-rest-api-controller.php:178 +msgid "Please enter a valid ROSARIOSIS_REST_API_URL in the wp-config.php file." +msgstr "" +"Merci d'entrer une ROSARIOSIS_REST_API_URL valide dans le fichier wp-config." +"php." + +#: includes/class-rosariosis-rest-api-controller.php:189 +msgid "" +"Please enter a valid ROSARIOSIS_REST_API_URL and ROSARIOSIS_REST_API_USER_TOKEN in " +"the wp-config.php file." +msgstr "" +"Merci de définir des constantes ROSARIOSIS_REST_API_URL et " +"ROSARIOSIS_REST_API_USER_TOKEN valides dans le fichier wp-config.php." + +#: includes/class-rosariosis-rest-api-controller.php:216 +msgid "Connection successful." +msgstr "Connexion réussie." + +#: includes/class-rosariosis-rest-api-controller.php:547 +msgid "Empty response. Unknown error." +msgstr "Réponse vide. Erreur inconnue." + +#: includes/class-rosariosis-rest-api-controller.php:646 +msgid "RosarioSIS REST API" +msgstr "API REST RosarioSIS" + +#: includes/class-rosariosis-rest-api.php:287 +#: includes/class-rosariosis-rest-api.php:296 +msgid "Cheatin’ huh?" +msgstr "On triche, hein?" diff --git a/plugins/rosariosis-rest-api/lang/rosariosis-rest-api.pot b/plugins/rosariosis-rest-api/lang/rosariosis-rest-api.pot new file mode 100644 index 000000000..16b4db48c --- /dev/null +++ b/plugins/rosariosis-rest-api/lang/rosariosis-rest-api.pot @@ -0,0 +1,49 @@ +# Copyright (C) 2014 RosarioSIS REST API +# This file is distributed under the same license as the RosarioSIS REST API package. +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: RosarioSIS REST API 1.0\n" +"Report-Msgid-Bugs-To: http://wordpress.org/tag/WordPress-Plugin-Template\n" +"POT-Creation-Date: 2018-10-02 11:22+0200\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"PO-Revision-Date: 2014-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: RosarioSIS \n" +"X-Generator: Poedit 1.8.11\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-Basepath: ..\n" +"X-Poedit-KeywordsList: __\n" +"X-Poedit-SearchPath-0: .\n" +"X-Poedit-SearchPathExcluded-0: includes/lib\n" +"X-Poedit-SearchPathExcluded-1: includes/class-rosariosis-rest-api-settings." +"php\n" + +#: includes/class-rosariosis-rest-api-controller.php:142 +msgid "" +"Please define the ROSARIOSIS_REST_API_URL & ROSARIOSIS_REST_API_USER_TOKEN " +"constants in the wp-config.php file." +msgstr "" + +#: includes/class-rosariosis-rest-api-controller.php:151 +msgid "Please enter a valid ROSARIOSIS_REST_API_URL in the wp-config.php file." +msgstr "" + +#: includes/class-rosariosis-rest-api-controller.php:169 +msgid "Connection successful." +msgstr "" + +#: includes/class-rosariosis-rest-api-controller.php:436 +msgid "Empty response. Unknown error." +msgstr "" + +#: includes/class-rosariosis-rest-api-controller.php:499 +msgid "RosarioSIS REST API" +msgstr "" + +#: includes/class-rosariosis-rest-api.php:287 +#: includes/class-rosariosis-rest-api.php:296 +msgid "Cheatin’ huh?" +msgstr "" diff --git a/plugins/rosariosis-rest-api/package.json b/plugins/rosariosis-rest-api/package.json new file mode 100644 index 000000000..a2f0e2624 --- /dev/null +++ b/plugins/rosariosis-rest-api/package.json @@ -0,0 +1,14 @@ +{ + "name": "wordpress-plugin-template", + "title": "WordPress Plugin Template", + "version": "1.0.0", + "homepage": "https://github.com/hlashbrooke/WordPress-Plugin-Template", + "main": "Gruntfile.js", + "devDependencies": { + "grunt": "~1.0.1", + "grunt-contrib-uglify": "~3.2.1", + "grunt-contrib-less": "~1.4.1", + "grunt-contrib-cssmin": "~2.2.1", + "grunt-contrib-watch": "~1.0.0" + } +} diff --git a/plugins/rosariosis-rest-api/readme.txt b/plugins/rosariosis-rest-api/readme.txt new file mode 100644 index 000000000..95b3c9d4e --- /dev/null +++ b/plugins/rosariosis-rest-api/readme.txt @@ -0,0 +1,69 @@ +=== RosarioSIS REST API === +Contributors: rosariosis +Tags: school, sis, student, connect +Requires at least: 4.0 +Tested up to: 5.3 +Stable tag: 1.0.0 +License: GPLv2 or later +License URI: http://www.gnu.org/licenses/gpl-2.0.html + +Plugin helper to connect to the RosarioSIS (free Student Information System) REST API. + +== Description == + +WordPress plugin helper to connect to the RosarioSIS REST API. Connect to RosarioSIS through the REST API to send / retrieve your students, or any data that fits in your SIS. +This plugin has got no interface. You will only get notified in case the RosarioSIS API is not correctly configured from the WordPress admin "Plugins" screen. +This plugin provides a simple tool for developers to use in their own plugin to connect to the RosarioSIS REST API. + +== Installation == + +Installing "RosarioSIS REST API" can be done either by searching for "RosarioSIS REST API" via the "Plugins > Add New" screen in your WordPress dashboard, or by using the following steps: + +1. Download the plugin via WordPress.org +2. Upload the ZIP file through the 'Plugins > Add New > Upload' screen in your WordPress dashboard +3. Activate the plugin through the 'Plugins' menu in WordPress + +RosarioSIS configuration steps: + +1. Install and activate the [REST API](https://gitlab.com/francoisjacquet/REST_API) plugin for RosarioSIS. +2. Copy the admin user API token: go to menu _School > Configuration > Plugins_. Click on the _Configuration_ link next to REST API. Copy the _User Token_ (see screenshot). + +WordPress configuration steps: +1. Add the RosarioSIS URL and your admin user API token to the `wp-config.php` file. Here is an example: +``` +define( 'ROSARIOSIS_REST_API_URL', 'https://my-rosariosis.com/' ); +define( 'ROSARIOSIS_REST_API_USER_TOKEN', 'M1e57FZ69D0ophaizqTRsNB6lQ3d0EA6' ); +``` + +== Frequently Asked Questions == + += Does this plugin depend on any others? = + +No, but it depends on a working instance of [RosarioSIS](https://www.rosariosis.org/), accessible from the network, plus its [REST API](https://gitlab.com/francoisjacquet/REST_API) plugin. + + += Does this create new database tables? = + +No. There are no new database tables with this plugin. + + += Does this load additional JS or CSS files ? = + +No. This plugin does not load additional CSS or JS files. + + += What does this plugin do? = + +This plugin is useless on its own. It should be combined with another plugin that actually interacts with the RosarioSIS REST API (agenda, contacts, third parties, expense, clients, products, etc.). + + += How can I disable the request cache? = + +GET requests can be cached if explicitely stated (see the controller PHP code). Call the page adding `&disable_cache=1` to the URL to disable cache. + + +== Changelog == + += 1.0.0 = +* 2020-02-22 +* Initial release diff --git a/plugins/rosariosis-rest-api/rosariosis-rest-api.php b/plugins/rosariosis-rest-api/rosariosis-rest-api.php new file mode 100644 index 000000000..844c2fa05 --- /dev/null +++ b/plugins/rosariosis-rest-api/rosariosis-rest-api.php @@ -0,0 +1,48 @@ +settings ) ) { + $instance->settings = RosarioSIS_REST_API_Settings::instance( $instance ); + }*/ + + return $instance; +} + +rosariosis_rest_api(); diff --git a/plugins/rosariosis-rest-api/uninstall.php b/plugins/rosariosis-rest-api/uninstall.php new file mode 100644 index 000000000..5bd7790f3 --- /dev/null +++ b/plugins/rosariosis-rest-api/uninstall.php @@ -0,0 +1,16 @@ + + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Composer\Autoload; + +/** + * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. + * + * $loader = new \Composer\Autoload\ClassLoader(); + * + * // register classes with namespaces + * $loader->add('Symfony\Component', __DIR__.'/component'); + * $loader->add('Symfony', __DIR__.'/framework'); + * + * // activate the autoloader + * $loader->register(); + * + * // to enable searching the include path (eg. for PEAR packages) + * $loader->setUseIncludePath(true); + * + * In this example, if you try to use a class in the Symfony\Component + * namespace or one of its children (Symfony\Component\Console for instance), + * the autoloader will first look for the class under the component/ + * directory, and it will then fallback to the framework/ directory if not + * found before giving up. + * + * This class is loosely based on the Symfony UniversalClassLoader. + * + * @author Fabien Potencier + * @author Jordi Boggiano + * @see https://www.php-fig.org/psr/psr-0/ + * @see https://www.php-fig.org/psr/psr-4/ + */ +class ClassLoader +{ + /** @var ?string */ + private $vendorDir; + + // PSR-4 + /** + * @var array[] + * @psalm-var array> + */ + private $prefixLengthsPsr4 = array(); + /** + * @var array[] + * @psalm-var array> + */ + private $prefixDirsPsr4 = array(); + /** + * @var array[] + * @psalm-var array + */ + private $fallbackDirsPsr4 = array(); + + // PSR-0 + /** + * @var array[] + * @psalm-var array> + */ + private $prefixesPsr0 = array(); + /** + * @var array[] + * @psalm-var array + */ + private $fallbackDirsPsr0 = array(); + + /** @var bool */ + private $useIncludePath = false; + + /** + * @var string[] + * @psalm-var array + */ + private $classMap = array(); + + /** @var bool */ + private $classMapAuthoritative = false; + + /** + * @var bool[] + * @psalm-var array + */ + private $missingClasses = array(); + + /** @var ?string */ + private $apcuPrefix; + + /** + * @var self[] + */ + private static $registeredLoaders = array(); + + /** + * @param ?string $vendorDir + */ + public function __construct($vendorDir = null) + { + $this->vendorDir = $vendorDir; + } + + /** + * @return string[] + */ + public function getPrefixes() + { + if (!empty($this->prefixesPsr0)) { + return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); + } + + return array(); + } + + /** + * @return array[] + * @psalm-return array> + */ + public function getPrefixesPsr4() + { + return $this->prefixDirsPsr4; + } + + /** + * @return array[] + * @psalm-return array + */ + public function getFallbackDirs() + { + return $this->fallbackDirsPsr0; + } + + /** + * @return array[] + * @psalm-return array + */ + public function getFallbackDirsPsr4() + { + return $this->fallbackDirsPsr4; + } + + /** + * @return string[] Array of classname => path + * @psalm-return array + */ + public function getClassMap() + { + return $this->classMap; + } + + /** + * @param string[] $classMap Class to filename map + * @psalm-param array $classMap + * + * @return void + */ + public function addClassMap(array $classMap) + { + if ($this->classMap) { + $this->classMap = array_merge($this->classMap, $classMap); + } else { + $this->classMap = $classMap; + } + } + + /** + * Registers a set of PSR-0 directories for a given prefix, either + * appending or prepending to the ones previously set for this prefix. + * + * @param string $prefix The prefix + * @param string[]|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories + * + * @return void + */ + public function add($prefix, $paths, $prepend = false) + { + if (!$prefix) { + if ($prepend) { + $this->fallbackDirsPsr0 = array_merge( + (array) $paths, + $this->fallbackDirsPsr0 + ); + } else { + $this->fallbackDirsPsr0 = array_merge( + $this->fallbackDirsPsr0, + (array) $paths + ); + } + + return; + } + + $first = $prefix[0]; + if (!isset($this->prefixesPsr0[$first][$prefix])) { + $this->prefixesPsr0[$first][$prefix] = (array) $paths; + + return; + } + if ($prepend) { + $this->prefixesPsr0[$first][$prefix] = array_merge( + (array) $paths, + $this->prefixesPsr0[$first][$prefix] + ); + } else { + $this->prefixesPsr0[$first][$prefix] = array_merge( + $this->prefixesPsr0[$first][$prefix], + (array) $paths + ); + } + } + + /** + * Registers a set of PSR-4 directories for a given namespace, either + * appending or prepending to the ones previously set for this namespace. + * + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param string[]|string $paths The PSR-4 base directories + * @param bool $prepend Whether to prepend the directories + * + * @throws \InvalidArgumentException + * + * @return void + */ + public function addPsr4($prefix, $paths, $prepend = false) + { + if (!$prefix) { + // Register directories for the root namespace. + if ($prepend) { + $this->fallbackDirsPsr4 = array_merge( + (array) $paths, + $this->fallbackDirsPsr4 + ); + } else { + $this->fallbackDirsPsr4 = array_merge( + $this->fallbackDirsPsr4, + (array) $paths + ); + } + } elseif (!isset($this->prefixDirsPsr4[$prefix])) { + // Register directories for a new namespace. + $length = strlen($prefix); + if ('\\' !== $prefix[$length - 1]) { + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); + } + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; + $this->prefixDirsPsr4[$prefix] = (array) $paths; + } elseif ($prepend) { + // Prepend directories for an already registered namespace. + $this->prefixDirsPsr4[$prefix] = array_merge( + (array) $paths, + $this->prefixDirsPsr4[$prefix] + ); + } else { + // Append directories for an already registered namespace. + $this->prefixDirsPsr4[$prefix] = array_merge( + $this->prefixDirsPsr4[$prefix], + (array) $paths + ); + } + } + + /** + * Registers a set of PSR-0 directories for a given prefix, + * replacing any others previously set for this prefix. + * + * @param string $prefix The prefix + * @param string[]|string $paths The PSR-0 base directories + * + * @return void + */ + public function set($prefix, $paths) + { + if (!$prefix) { + $this->fallbackDirsPsr0 = (array) $paths; + } else { + $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; + } + } + + /** + * Registers a set of PSR-4 directories for a given namespace, + * replacing any others previously set for this namespace. + * + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param string[]|string $paths The PSR-4 base directories + * + * @throws \InvalidArgumentException + * + * @return void + */ + public function setPsr4($prefix, $paths) + { + if (!$prefix) { + $this->fallbackDirsPsr4 = (array) $paths; + } else { + $length = strlen($prefix); + if ('\\' !== $prefix[$length - 1]) { + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); + } + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; + $this->prefixDirsPsr4[$prefix] = (array) $paths; + } + } + + /** + * Turns on searching the include path for class files. + * + * @param bool $useIncludePath + * + * @return void + */ + public function setUseIncludePath($useIncludePath) + { + $this->useIncludePath = $useIncludePath; + } + + /** + * Can be used to check if the autoloader uses the include path to check + * for classes. + * + * @return bool + */ + public function getUseIncludePath() + { + return $this->useIncludePath; + } + + /** + * Turns off searching the prefix and fallback directories for classes + * that have not been registered with the class map. + * + * @param bool $classMapAuthoritative + * + * @return void + */ + public function setClassMapAuthoritative($classMapAuthoritative) + { + $this->classMapAuthoritative = $classMapAuthoritative; + } + + /** + * Should class lookup fail if not found in the current class map? + * + * @return bool + */ + public function isClassMapAuthoritative() + { + return $this->classMapAuthoritative; + } + + /** + * APCu prefix to use to cache found/not-found classes, if the extension is enabled. + * + * @param string|null $apcuPrefix + * + * @return void + */ + public function setApcuPrefix($apcuPrefix) + { + $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; + } + + /** + * The APCu prefix in use, or null if APCu caching is not enabled. + * + * @return string|null + */ + public function getApcuPrefix() + { + return $this->apcuPrefix; + } + + /** + * Registers this instance as an autoloader. + * + * @param bool $prepend Whether to prepend the autoloader or not + * + * @return void + */ + public function register($prepend = false) + { + spl_autoload_register(array($this, 'loadClass'), true, $prepend); + + if (null === $this->vendorDir) { + return; + } + + if ($prepend) { + self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; + } else { + unset(self::$registeredLoaders[$this->vendorDir]); + self::$registeredLoaders[$this->vendorDir] = $this; + } + } + + /** + * Unregisters this instance as an autoloader. + * + * @return void + */ + public function unregister() + { + spl_autoload_unregister(array($this, 'loadClass')); + + if (null !== $this->vendorDir) { + unset(self::$registeredLoaders[$this->vendorDir]); + } + } + + /** + * Loads the given class or interface. + * + * @param string $class The name of the class + * @return true|null True if loaded, null otherwise + */ + public function loadClass($class) + { + if ($file = $this->findFile($class)) { + includeFile($file); + + return true; + } + + return null; + } + + /** + * Finds the path to the file where the class is defined. + * + * @param string $class The name of the class + * + * @return string|false The path if found, false otherwise + */ + public function findFile($class) + { + // class map lookup + if (isset($this->classMap[$class])) { + return $this->classMap[$class]; + } + if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { + return false; + } + if (null !== $this->apcuPrefix) { + $file = apcu_fetch($this->apcuPrefix.$class, $hit); + if ($hit) { + return $file; + } + } + + $file = $this->findFileWithExtension($class, '.php'); + + // Search for Hack files if we are running on HHVM + if (false === $file && defined('HHVM_VERSION')) { + $file = $this->findFileWithExtension($class, '.hh'); + } + + if (null !== $this->apcuPrefix) { + apcu_add($this->apcuPrefix.$class, $file); + } + + if (false === $file) { + // Remember that this class does not exist. + $this->missingClasses[$class] = true; + } + + return $file; + } + + /** + * Returns the currently registered loaders indexed by their corresponding vendor directories. + * + * @return self[] + */ + public static function getRegisteredLoaders() + { + return self::$registeredLoaders; + } + + /** + * @param string $class + * @param string $ext + * @return string|false + */ + private function findFileWithExtension($class, $ext) + { + // PSR-4 lookup + $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; + + $first = $class[0]; + if (isset($this->prefixLengthsPsr4[$first])) { + $subPath = $class; + while (false !== $lastPos = strrpos($subPath, '\\')) { + $subPath = substr($subPath, 0, $lastPos); + $search = $subPath . '\\'; + if (isset($this->prefixDirsPsr4[$search])) { + $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); + foreach ($this->prefixDirsPsr4[$search] as $dir) { + if (file_exists($file = $dir . $pathEnd)) { + return $file; + } + } + } + } + } + + // PSR-4 fallback dirs + foreach ($this->fallbackDirsPsr4 as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { + return $file; + } + } + + // PSR-0 lookup + if (false !== $pos = strrpos($class, '\\')) { + // namespaced class name + $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) + . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); + } else { + // PEAR-like class name + $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; + } + + if (isset($this->prefixesPsr0[$first])) { + foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { + if (0 === strpos($class, $prefix)) { + foreach ($dirs as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + return $file; + } + } + } + } + } + + // PSR-0 fallback dirs + foreach ($this->fallbackDirsPsr0 as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + return $file; + } + } + + // PSR-0 include paths. + if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { + return $file; + } + + return false; + } +} + +/** + * Scope isolated include. + * + * Prevents access to $this/self from included files. + * + * @param string $file + * @return void + * @private + */ +function includeFile($file) +{ + include $file; +} diff --git a/vendor/composer/InstalledVersions.php b/vendor/composer/InstalledVersions.php new file mode 100644 index 000000000..c6b54af7b --- /dev/null +++ b/vendor/composer/InstalledVersions.php @@ -0,0 +1,352 @@ + + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Composer; + +use Composer\Autoload\ClassLoader; +use Composer\Semver\VersionParser; + +/** + * This class is copied in every Composer installed project and available to all + * + * See also https://getcomposer.org/doc/07-runtime.md#installed-versions + * + * To require its presence, you can require `composer-runtime-api ^2.0` + * + * @final + */ +class InstalledVersions +{ + /** + * @var mixed[]|null + * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}|array{}|null + */ + private static $installed; + + /** + * @var bool|null + */ + private static $canGetVendors; + + /** + * @var array[] + * @psalm-var array}> + */ + private static $installedByVendor = array(); + + /** + * Returns a list of all package names which are present, either by being installed, replaced or provided + * + * @return string[] + * @psalm-return list + */ + public static function getInstalledPackages() + { + $packages = array(); + foreach (self::getInstalled() as $installed) { + $packages[] = array_keys($installed['versions']); + } + + if (1 === \count($packages)) { + return $packages[0]; + } + + return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); + } + + /** + * Returns a list of all package names with a specific type e.g. 'library' + * + * @param string $type + * @return string[] + * @psalm-return list + */ + public static function getInstalledPackagesByType($type) + { + $packagesByType = array(); + + foreach (self::getInstalled() as $installed) { + foreach ($installed['versions'] as $name => $package) { + if (isset($package['type']) && $package['type'] === $type) { + $packagesByType[] = $name; + } + } + } + + return $packagesByType; + } + + /** + * Checks whether the given package is installed + * + * This also returns true if the package name is provided or replaced by another package + * + * @param string $packageName + * @param bool $includeDevRequirements + * @return bool + */ + public static function isInstalled($packageName, $includeDevRequirements = true) + { + foreach (self::getInstalled() as $installed) { + if (isset($installed['versions'][$packageName])) { + return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']); + } + } + + return false; + } + + /** + * Checks whether the given package satisfies a version constraint + * + * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: + * + * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') + * + * @param VersionParser $parser Install composer/semver to have access to this class and functionality + * @param string $packageName + * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package + * @return bool + */ + public static function satisfies(VersionParser $parser, $packageName, $constraint) + { + $constraint = $parser->parseConstraints($constraint); + $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); + + return $provided->matches($constraint); + } + + /** + * Returns a version constraint representing all the range(s) which are installed for a given package + * + * It is easier to use this via isInstalled() with the $constraint argument if you need to check + * whether a given version of a package is installed, and not just whether it exists + * + * @param string $packageName + * @return string Version constraint usable with composer/semver + */ + public static function getVersionRanges($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + $ranges = array(); + if (isset($installed['versions'][$packageName]['pretty_version'])) { + $ranges[] = $installed['versions'][$packageName]['pretty_version']; + } + if (array_key_exists('aliases', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); + } + if (array_key_exists('replaced', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); + } + if (array_key_exists('provided', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); + } + + return implode(' || ', $ranges); + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + public static function getVersion($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['version'])) { + return null; + } + + return $installed['versions'][$packageName]['version']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + public static function getPrettyVersion($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['pretty_version'])) { + return null; + } + + return $installed['versions'][$packageName]['pretty_version']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference + */ + public static function getReference($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['reference'])) { + return null; + } + + return $installed['versions'][$packageName]['reference']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. + */ + public static function getInstallPath($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @return array + * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool} + */ + public static function getRootPackage() + { + $installed = self::getInstalled(); + + return $installed[0]['root']; + } + + /** + * Returns the raw installed.php data for custom implementations + * + * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. + * @return array[] + * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} + */ + public static function getRawData() + { + @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); + + if (null === self::$installed) { + // only require the installed.php file if this file is loaded from its dumped location, + // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 + if (substr(__DIR__, -8, 1) !== 'C') { + self::$installed = include __DIR__ . '/installed.php'; + } else { + self::$installed = array(); + } + } + + return self::$installed; + } + + /** + * Returns the raw data of all installed.php which are currently loaded for custom implementations + * + * @return array[] + * @psalm-return list}> + */ + public static function getAllRawData() + { + return self::getInstalled(); + } + + /** + * Lets you reload the static array from another file + * + * This is only useful for complex integrations in which a project needs to use + * this class but then also needs to execute another project's autoloader in process, + * and wants to ensure both projects have access to their version of installed.php. + * + * A typical case would be PHPUnit, where it would need to make sure it reads all + * the data it needs from this class, then call reload() with + * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure + * the project in which it runs can then also use this class safely, without + * interference between PHPUnit's dependencies and the project's dependencies. + * + * @param array[] $data A vendor/composer/installed.php data set + * @return void + * + * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $data + */ + public static function reload($data) + { + self::$installed = $data; + self::$installedByVendor = array(); + } + + /** + * @return array[] + * @psalm-return list}> + */ + private static function getInstalled() + { + if (null === self::$canGetVendors) { + self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); + } + + $installed = array(); + + if (self::$canGetVendors) { + foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { + if (isset(self::$installedByVendor[$vendorDir])) { + $installed[] = self::$installedByVendor[$vendorDir]; + } elseif (is_file($vendorDir.'/composer/installed.php')) { + $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php'; + if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { + self::$installed = $installed[count($installed) - 1]; + } + } + } + } + + if (null === self::$installed) { + // only require the installed.php file if this file is loaded from its dumped location, + // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 + if (substr(__DIR__, -8, 1) !== 'C') { + self::$installed = require __DIR__ . '/installed.php'; + } else { + self::$installed = array(); + } + } + $installed[] = self::$installed; + + return $installed; + } +} diff --git a/vendor/composer/LICENSE b/vendor/composer/LICENSE new file mode 100644 index 000000000..f27399a04 --- /dev/null +++ b/vendor/composer/LICENSE @@ -0,0 +1,21 @@ + +Copyright (c) Nils Adermann, Jordi Boggiano + +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 above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +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. + diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php new file mode 100644 index 000000000..0fb0a2c19 --- /dev/null +++ b/vendor/composer/autoload_classmap.php @@ -0,0 +1,10 @@ + $vendorDir . '/composer/InstalledVersions.php', +); diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php new file mode 100644 index 000000000..15a2ff3ad --- /dev/null +++ b/vendor/composer/autoload_namespaces.php @@ -0,0 +1,9 @@ +register(true); + + return $loader; + } +} diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php new file mode 100644 index 000000000..ac976d289 --- /dev/null +++ b/vendor/composer/autoload_static.php @@ -0,0 +1,20 @@ + __DIR__ . '/..' . '/composer/InstalledVersions.php', + ); + + public static function getInitializer(ClassLoader $loader) + { + return \Closure::bind(function () use ($loader) { + $loader->classMap = ComposerStaticInit69354004ab1f038b8591872b8c84e0ae::$classMap; + + }, null, ClassLoader::class); + } +} diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json new file mode 100644 index 000000000..87fda747e --- /dev/null +++ b/vendor/composer/installed.json @@ -0,0 +1,5 @@ +{ + "packages": [], + "dev": true, + "dev-package-names": [] +} diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php new file mode 100644 index 000000000..2604285ba --- /dev/null +++ b/vendor/composer/installed.php @@ -0,0 +1,23 @@ + array( + 'name' => 'francoisjacquet/rosariosis', + 'pretty_version' => 'dev-develop', + 'version' => 'dev-develop', + 'reference' => 'b710d3d3d9f52210c577208e7a93abc4efe0b038', + 'type' => 'library', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array(), + 'dev' => true, + ), + 'versions' => array( + 'francoisjacquet/rosariosis' => array( + 'pretty_version' => 'dev-develop', + 'version' => 'dev-develop', + 'reference' => 'b710d3d3d9f52210c577208e7a93abc4efe0b038', + 'type' => 'library', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array(), + 'dev_requirement' => false, + ), + ), +); diff --git a/vendor/composer/platform_check.php b/vendor/composer/platform_check.php new file mode 100644 index 000000000..d11435706 --- /dev/null +++ b/vendor/composer/platform_check.php @@ -0,0 +1,26 @@ += 50445)) { + $issues[] = 'Your Composer dependencies require a PHP version ">= 5.4.45". You are running ' . PHP_VERSION . '.'; +} + +if ($issues) { + if (!headers_sent()) { + header('HTTP/1.1 500 Internal Server Error'); + } + if (!ini_get('display_errors')) { + if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { + fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); + } elseif (!headers_sent()) { + echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; + } + } + trigger_error( + 'Composer detected issues in your platform: ' . implode(' ', $issues), + E_USER_ERROR + ); +}