diff --git a/Release/1.0/jquerymy-1.0.2.js b/Release/1.0/jquerymy-1.0.2.js new file mode 100644 index 0000000..f349d58 --- /dev/null +++ b/Release/1.0/jquerymy-1.0.2.js @@ -0,0 +1,3649 @@ +/* + * jQuery.my 1.0.2 + * Requires jQuery 1.11.0+, SugarJS 1.3.9-1.4.x + * + * + * More details at jquerymy.com + * + * @ermouth, thanks @carpogoryanin, @ftescht + * 2014-09-11 ✈ + */ + +;(function ($) {var _version = "jQuery.my 1.0.2"; + + // Some shortcuts and constants + var lang = "en", + wURL = window.URL || window.webkitURL, + ie8 = !document.addEventListener, + forms = _getref($,"my.f.repo")? $.my.f.repo():{_src:{}, _name:"Global manifest cache"}, + $E = $.extend, T = $.type, N = null, TMP, + n = function (o) {return o!==null && o!==undefined;}, + d8 = "{yyyy}-{MM}-{dd}", h24="{HH}:{mm}", + Ob = "object", Da = "data", Ar = "array", + St = "string", Fu = "function", Ch = "change", + rthis = /^this\./, + isA = Object.isArray, + isB = Object.isBoolean, + isS = Object.isString, + isO = Object.isObject, + isN = Object.isNumber, + isR = Object.isRegExp, + isF = Object.isFunction, + isP = function (a) {/*is promise*/return !!(null!=a&&(isO(a)||a.jquery)&&isF(a.then)&&isF(a.fail)&&isF(a.state));}; + + + //======================================= + // Manifest repo getter/setter and helpers + + var _cache = function _localCache (A1, A2) { + // ( no args ) – returns all forms obj container + // ({manifest}, {container}) – caches form in container, id must be defined, return form or null + // ({manifest}) – caches form in local container, id must be defined + // ("form.Id", "exist") – true/false + // ("form.Id", {container}) – get from container + // ("form.Id") – get from local cache + var ref, obj; + if (isS(A1)) { + ref=A1; + obj = _getref(isO(A2)?A2:forms, ref); + if ("exist"===A2) return isO(obj); + return !obj?null:Object.clone(obj,true); + } else if (isO(A1)){ + obj = _putmanifest (A1, A2); + if (!isO(obj)) { + console.log(obj); + return null; + } + return obj; + } else if (undefined===A1) { + return forms._src; + } else if (null===A1) { + return Object.reject(forms,/^_/); + }else return null; + }; + + // - - - - - - - - - - - - - - - - - - - - + + function _getref(obj,ref) { + //gets branch of obj by string ref like "data.list.items.1" + return (ref||"").split(".").reduce(function (a,b){ + if (null!=a && null!=a[b]) return a[b]; + else return undefined; + }, obj); + } + + // - - - - - - - - - - - - - - - - - - - - + + function _manifest (manifest, ref) { + // Dereferences pointer to form component, + // manifest is caller manifest obj, + // internal function + var t, ext; + if (isO(ref)) return ref; + else if (isS(ref)) { + + //try to find it on manifest + t = _getref(manifest, ref); + + //then in local repo as original + if (null==t) t = Object.clone(forms._src[ref],true); + + //then in local repo as part of component + if (null==t) { + t = _getref(forms, ref); + if (isO(t) && isO(t._self)) t=Object.clone(t._self,true); + else if (isO(t)) t = Object.clone(t,true); + } + + //then in ext repo as part of component + if (null==t && _getref(manifest,"params.cache")) { + ext = _getref(manifest,"params.cache"); + if (isF(ext)) t = ext(ref); + else if (isO(ext)) t = _cache(ref, ext); + + if (isO(t)){ + if (isO(t._self)) t=Object.clone(t._self,true); + Object.merge(t, {params:{cache:ext}}, true); + } + } + + if (null!=t && isO(t)) { + ext = ext||_getref(manifest,"params.cache"); + if (ext) Object.merge(t, {params:{cache:ext}}, true); + return t; + } + else throw "Component "+ref+" not found"; + + } else if (isF(ref)) { + return ref.apply(manifest, Array.prototype.slice.call(arguments, 2)); + } else return null; + } + + // - - - - - - - - - - - - - - - - - - - - + + function _putmanifest (obj0, root0) { + // Mounts obj to root in a branch, defined in + // obj.id property. If id =="x.y.z", root will be + // deep extended with {x:{y:{z:obj}}}. + // obj also is unjsonned and extended with _self ref, + // which point to original version of obj. + + //Returns direct link to entire branch obj or string error. + + var i, file, root=root0||forms, obj=obj0, path, id, prev, res; + + if (!(isO(root) && isO(obj) && isO(obj.ui) && isS(obj.id))) + return "Invalid arguments."; + + if (!root.hasOwnProperty("_src")) root._src={}; + + id = obj.id; + + + //path = id.split("."); + + try {obj=Object.clone(obj0, true);} + catch (e) {return "Can't mount circular-referencing obj.";} + + //unwind string defs of functions + try {if (!obj.params || (obj.params && !obj.params.strict)) _unjson(obj, true);} + catch (e) { + return "Invalid manifest, parse error."; + } + + //blobify files + i = _files2urls (obj); + if (isS(i)) { + f.con(i); + return i; + } + + //mark manifest as unjsonned + Object.merge(obj,{params:{strict:true}}, true); + // save it + root._src[id] = obj; + + + if (prev=f.mask(root, id)) { + if (prev.params && prev.params.protect) return "Can't mount on protected"; + if (prev._self) delete prev._self; + } //else { + //no prev node, mount + Object.merge(root,f.unmask(obj, id),true); + //} + res = _getref(root,id); + + if (ie8) res["_self"] = root._src[id]; + else Object.defineProperty(res, "_self", { + get: function () { return root._src[id]; }, + set: function () { throw "Can not change repo";}, + enumerable : false, + configurable : true + }); + + return res; + } + + + function _files2urls (obj) { + var i, flist = [], file; + if (isO(obj.files) && Object.size(obj.files)) { + //blobify files + for (i in obj.files) { + file = obj.files[i]; + if (isO(file) && file.data && !file.url) { + if (wURL) { + try { + f.base642blob(file.data,function(res){ + file.blob = res; + file.url = wURL.createObjectURL(file.blob); + },(file.content_type||file.mime)); + flist.push(i); + } catch(e) { + return "Invalid base64 data in files/"+i+"."; + } + } else { + //ie8-9 fallback + file.url = 'data:'+(file.content_type||file.mime)+';base64,'+file.data; + flist.push(i); + } + } + } + } + return flist; + } + + + //######################################################## + // Storage of rules defined by cascading selectors + // very similar to css. Leafs are processor + // or processing rules for this type of node + + var MY = { + + + //getter and setter functions for different types of nodes + + vals : { + + /**/ ".my-form": function ($o, v) { + //object is jQuery.my instance + if ($o && $o.my ) {var d = $o.my(Da); return Object.equal(d,v)?d:$o.my(Da, v, true);} + else return v||N; + }, + + /**/ ".hasDatepicker":function ($o,v) { + //object has jQ UI datepicker + if(n(v)) $o.datepicker("setDate", ((v=="")?v:Date.create(v))); + var date = $o.datepicker("getDate"); + return (date?date.format(d8):""); + }, + + /**/ ".my-tags": function ($o,v) { + //object is jQ tags control + if (n(v)) { + if (isS(v) || isN(v)) $o.tags(Da,[v+""]); + else if (isA(v)) $o.tags(Da,v); + } + return $o.tags(Da); + }, + + /**/ ".ui-draggable": function ($o,v) { + //object is jQ UI draggable + if (n(v) && isO(v)) { + var c = {}; + if (!isNaN(v.left)) c.left = Number(v.left).ceil(2)+"px"; + if (!isNaN(v.top)) c.top = Number(v.top).ceil(2)+"px"; + if (c.left || c.top) $o.css(c); + } + var p = $o.position(); + return { + left:((v&&!isNaN(v.left))?(v.left*1).ceil(2):p.left.ceil(2)), + top:((v&&!isNaN(v.top))?(v.top*1).ceil(2):p.top.ceil(2)) + }; + }, + + /**/ ".my-form-list": function ($o,list) { + //object is list of forms + var i,old,mod,eq,ctr = 0, + sP = "ui-sortable", sPlc= "."+sP+"-placeholder", + od = $o.data("formlist")||{}, + gen = od.generator||{}, + itemSel = gen.selector||">.my-form", + tmpl = gen.template||"
", + tmplIsVar = /\{/.test(tmpl), + hasher = gen.hash|| f.sdbmCode, + ider = gen.id|| f.sdbmCode, + extHasher = gen.ext, + delay = gen.delay||50, + sortable = $o.is("."+sP), + sorting = !!$o.children(sPlc).size(), + result=[], redraw = [], + $n, $drag, now = Date.now(); + var $c = sortable?$o.find($o.sortable("option","items")):$o.find(itemSel); + + if (n(list) && isA(list)) { + //return list passed if dragging taking place + if (sorting) return list; + // first we must estimate + // if putting new data over old + // changes anything + old= []; $c.each(function () { + var $x = $(this), xd = $x.data("my"); + if (xd) old.push(xd.data); + }); + + //fast compare + eq=false; + if (old.length===list.length) for (eq=true, i=0;iForm init failed
', + ru:'Ошибка инициализации формы
' + }, + + badInput:{en:"Invalid input", ru:TMP}, + patternMismatch:{en:"Pattern mismatch", ru:"Не соответствует шаблону"}, + rangeOverflow:{en:"Over maximum", ru:"Больше максимума"}, + rangeUnderflow:{en:"Under minimum", ru:"Меньше минимума"}, + stepMismatch:{en:"Step mismatch", ru:"Не кратно шагу"}, + tooLong:{en:"Too long", ru:"Слишком длинно"}, + typeMismatch:{en:"Invalid type", ru:"Неверный тип"}, + valueMissing:{en:"Required", ru:"Обязательное поле"} + }, + + + //different controls' events to watch for + //######################################################## + + events: { + ".hasDatepicker":"change.my check.my", + ".my-form,.my-tags":"change.my check.my", + ".ui-slider":"slide.my check.my", + "div.redactor_box textarea":"redactor.my check.my", + ".my-codemirror":"codemirror.my check.my", + ".ace_editor":"ace.my check.my", + ".my-form-list":"sortupdate.my check.my", + ".ui-sortable":"sortchange.my sortupdate.my check.my", + ".ui-draggable":"drag.my dragstop.my check.my", + "a, .pseudolink, input[type=button], button": "click.my", + "img, :radio, :checkbox": "click.my check.my", + "div.select2-container+input,div.select2-container+select":"change.my check.my input.my", + ".ui-buttonset,input, select, textarea":"blur.my change.my check.my"+(navigator.appName.to(5)==="Micro"?" keyup.my":" input.my"), + "":"check.my" + }, + + //functions retrieving container for different controls + //######################################################## + + containers: { + "*[data-role='fieldcontain'] *":{ //jQuery Mobile + "input,textarea,select,button,:radio": function ($o) { + return $o.parents('[data-role="fieldcontain"]').eq(0); + } + }, + ".tagstrip *.value": function ($o){ //$.tagstrip() + return $o.parents('.tagstrip').eq(0); + }, + "div.redactor_box textarea":function ($o){ + return $o.parents('div.redactor_box').eq(0).parent(); + }, + ".my-tags,.hasDatepicker,.ui-widget,input,textarea,select,button" :{ + ".my-cleditor": function ($o) { + return $o.parents('div.cleditorMain').eq(0).parent(); + }, + "": function ($o) { + var p = $o[0].parentNode, t = p.nodeName; + if (/^(div|span|a|p|form|fieldset|li|ul|td|th|h\d)$/i.test(t)) return $(p); + else return $o.parents('div,span,a,p,form,fieldset,li,ul,td,th,h1,h2,h3,h4,h5,h6').eq(0); + } + }, + "": function ($o) {return $o;} + + }, + + //disablers and enablers + //######################################################## + + offon: { //if x==true disables control else enables + ".ace_editor": function (x,$o) {ace.edit($o[0]).setReadOnly(x);}, + ".ui-selectable": function (x,$o) {f.jquix($o,"selectable",x);}, + ".ui-slider": function (x,$o) {f.jquix($o,"slider",x);}, + ".ui-draggable": function (x,$o) {f.jquix($o,"draggable",x);}, + ".ui-buttonset": function (x,$o) {f.jquix($o,"buttonset",x);}, + ".hasDatepicker": function (x,$o) {f.jquix($o,"datepicker",x);}, + ".my-form":function (x,$o){$o.my("disabled", !!x);}, + "div.select2-container+input,div.select2-container+select": function (x,$o) {f.jquix($o,"select2",x);}, + ".my-cleditor": function (x,$o) { $o.cleditor()[0].disable(!!x);}, + "": function (x, $o) {$o.attr("disabled", !!x);} + }, + + //destructors + //######################################################## + destroy:{ + ".hasDatepicker":function ($o){$o.datepicker("destroy");}, + ".ui-slider":function ($o){$o.slider("destroy");}, + ".ui-sortable":{ + ".my-form-list":function ($o){ + $o.find(">.my-form").each(function () { + $(this).my("remove"); + }); + $o.removeClass("my-form-list"); + $o.sortable("destroy"); + }, + "":function ($o){$o.sortable("destroy");} + }, + ".my-form-list":function ($o){ + $o.find(">.my-form").each(function () { + $(this).my("remove"); + }); + + }, + ".ui-draggable":function ($o){$o.draggable("destroy");}, + ".my-redactor-8":function ($o){ + $o.destroyEditor(); + $o.removeClass("my-redactor-8"); + }, + "div.select2-container+input,div.select2-container+select":function ($o){$o.select2('destroy');}, + ".my-form": function ($o) {$o.my("remove");}, + "textarea": { + ".my-codemirror": function ($o) { + $o[0].nextSibling.CodeMirror.toTextArea(); + $o.removeClass("my-codemirror") + } + } + } + }; + + //default values for .params section of manifest + //######################################################## + + MY.params = { + container:function ($o) { // container getter + return _traverse($o, MY.containers)($o); + }, + change:N, + recalcDepth:2, // depth of dependencies resolver tree + delay:0, // default delay of bind invocation + strict:false, // if true form assumed unjsonned + locale:(TMP=(navigator.language||navigator.userLanguage||"en").substr(0,2)), + messages:Object.map(MY.msg, function (k,v){return v[TMP]||v.en;}), + errorTip:".my-error-tip", // $ selector of err tip container + errorCss:"my-error", // class applied on container on err + animate:0, // err tips animation duration + effect: function ($e, onoff, duration) { // err tips animation effect + if (onoff) return $e.fadeIn(duration); $e.fadeOut(duration); + }, + remember:0, // undo steps to remember + silent:false, + history:{}, // form undo history + historyDelay:100, // delay in ms between subsequent calls of history(), + loader: function (manifestId, parentId) { // default loader + var pi = $.Deferred(), m = _cache(manifestId+""); + if (m) pi.resolve(m); + else pi.reject(null); + return pi.promise(); + }, + ajaxTimeout:10000 + }; + + var f = _getHelpersLib(); + f.require = _require; + + //########## SYSTEM FUNCTIONS ########## + + + function _require(man ,params0){ + // Checks and loads required libs, + // returns promise resolved with manifest + // or rejected with err list. + var i, j, k, pi = $.Deferred(), + chunks = [], checks = {}, err=[], r, line, + params = $E(true, { + ajaxTimeout:10000, + loader: MY.params.loader + }, params0||{}), + row, subrow, chunk, + Row = {ref:null, ajax:{type:"GET", async:true, timeout: params.ajaxTimeout}}; + + if (!isO(man)) pi.reject(["Invalid manifest."]); + else if (!isA(man.require)) pi.resolve(man); + else { + r = man.require; + for (i=0;i< r.length;i++) { + line = r[i]; + if (isS(line)) checks[line] = _exist(line); + else if (isO(line)) { + chunk = []; + for (j in line) { + row=null; + if (line[j]===true) { + // global, we can’t load it, just check presence + checks[j] = _exist(j); + } + else if (isS(line[j]) || isO(line[j])) { + row = _row(line[j], j); + } else if (isA(line[j])) { + row = []; + // array of requests + for (k=0;kОшибка инициализации формы
'},badInput:{en:"Invalid input",ru:f},patternMismatch:{en:"Pattern mismatch",ru:"Не соответствует шаблону"},rangeOverflow:{en:"Over maximum",ru:"Больше максимума"},rangeUnderflow:{en:"Under minimum",ru:"Меньше минимума"},stepMismatch:{en:"Step mismatch",ru:"Не кратно шагу"},tooLong:{en:"Too long",ru:"Слишком длинно"},typeMismatch:{en:"Invalid type",ru:"Неверный тип"},valueMissing:{en:"Required",ru:"Обязательное поле"}},events:{".hasDatepicker":"change.my check.my",".my-form,.my-tags":"change.my check.my",".ui-slider":"slide.my check.my","div.redactor_box textarea":"redactor.my check.my",".my-codemirror":"codemirror.my check.my",".ace_editor":"ace.my check.my",".my-form-list":"sortupdate.my check.my",".ui-sortable":"sortchange.my sortupdate.my check.my",".ui-draggable":"drag.my dragstop.my check.my","a, .pseudolink, input[type=button], button":"click.my","img, :radio, :checkbox":"click.my check.my","div.select2-container+input,div.select2-container+select":"change.my check.my input.my",".ui-buttonset,input, select, textarea":"blur.my change.my check.my"+(navigator.appName.to(5)==="Micro"?" keyup.my":" input.my"),"":"check.my"},containers:{"*[data-role='fieldcontain'] *":{"input,textarea,select,button,:radio":function(e){return e.parents('[data-role="fieldcontain"]').eq(0)}},".tagstrip *.value":function(e){return e.parents(".tagstrip").eq(0)},"div.redactor_box textarea":function(e){return e.parents("div.redactor_box").eq(0).parent()},".my-tags,.hasDatepicker,.ui-widget,input,textarea,select,button":{".my-cleditor":function(e){return e.parents("div.cleditorMain").eq(0).parent()},"":function(t){var n=t[0].parentNode,r=n.nodeName;if(/^(div|span|a|p|form|fieldset|li|ul|td|th|h\d)$/i.test(r))return e(n);else return t.parents("div,span,a,p,form,fieldset,li,ul,td,th,h1,h2,h3,h4,h5,h6").eq(0)}},"":function(e){return e}},offon:{".ace_editor":function(e,t){ace.edit(t[0]).setReadOnly(e)},".ui-selectable":function(e,t){P.jquix(t,"selectable",e)},".ui-slider":function(e,t){P.jquix(t,"slider",e)},".ui-draggable":function(e,t){P.jquix(t,"draggable",e)},".ui-buttonset":function(e,t){P.jquix(t,"buttonset",e)},".hasDatepicker":function(e,t){P.jquix(t,"datepicker",e)},".my-form":function(e,t){t.my("disabled",!!e)},"div.select2-container+input,div.select2-container+select":function(e,t){P.jquix(t,"select2",e)},".my-cleditor":function(e,t){t.cleditor()[0].disable(!!e)},"":function(e,t){t.attr("disabled",!!e)}},destroy:{".hasDatepicker":function(e){e.datepicker("destroy")},".ui-slider":function(e){e.slider("destroy")},".ui-sortable":{".my-form-list":function(t){t.find(">.my-form").each(function(){e(this).my("remove")});t.removeClass("my-form-list");t.sortable("destroy")},"":function(e){e.sortable("destroy")}},".my-form-list":function(t){t.find(">.my-form").each(function(){e(this).my("remove")})},".ui-draggable":function(e){e.draggable("destroy")},".my-redactor-8":function(e){e.destroyEditor();e.removeClass("my-redactor-8")},"div.select2-container+input,div.select2-container+select":function(e){e.select2("destroy")},".my-form":function(e){e.my("remove")},textarea:{".my-codemirror":function(e){e[0].nextSibling.CodeMirror.toTextArea();e.removeClass("my-codemirror")}}}};D.params={container:function(e){return j(e,D.containers)(e)},change:a,recalcDepth:2,delay:0,strict:false,locale:f=(navigator.language||navigator.userLanguage||"en").substr(0,2),messages:Object.map(D.msg,function(e,t){return t[f]||t.en}),errorTip:".my-error-tip",errorCss:"my-error",animate:0,effect:function(e,t,n){if(t)return e.fadeIn(n);e.fadeOut(n)},remember:0,silent:false,history:{},historyDelay:100,loader:function(t,n){var r=e.Deferred(),i=L(t+"");if(i)r.resolve(i);else r.reject(null);return r.promise()},ajaxTimeout:1e4};var P=Y();P.require=H;var G={init:function(t,n,i){function G(){if(!g.strict)J(y,true);h=o(true,h,Object.reject(y,["data"]));m=K(o(true,{},y.ui||{}),h,g);l=Number.random(268435456,4294967295).toString(16);f=y.id||"my"+l;c=P.sdbmCode(f);h.id=f;g.form=X;if(y.params&&y.params.depth)g.recalcDepth=y.params.depth;for(b in h)if(C(h[b]))h[b].bind(h);if(y.error){if(S(y.error)){q=function(e,t){return y.error.assign(o({message:e+"",err:t+""},y))}}else if(C(y.error)){q=function(e,t){p=null;try{p=y.error(e,t)}catch(n){p=g.messages.initFailed}return p}}}o(X.data("my"),{id:f,cid:l,mid:c,errors:Object.extended(),ui:Object.extended(m),disabled:false,manifest:h,locFiles:[],modals:{}});X.addClass("my-form");T="my-manifest-"+c;N="my-form-"+l;X.addClass(N+" "+T)}function Y(){if(h.style){E=Q(X,h,T,N);if(E&&E[0].length){A=e("style#"+T);if(!A.size()){A=e('").appendTo(e("body"))}A.data("count",A.data("count")*1+1);X.data("my").style=A}if(E&&E[1].length){O=e("style#"+N);if(!O.size()){O=e('").appendTo(e("body"))}X.data("my").localStyle=O}}}function Z(){var t,n=e.Deferred(),i;i=_(h);if(S(i)){rt("Error decoding base64 to local Blob/URL",i);n.reject()}else{if(r)for(t=0;tОшибка инициализации формы
'},badInput:{en:"Invalid input",ru:f},patternMismatch:{en:"Pattern mismatch",ru:"Не соответствует шаблону"},rangeOverflow:{en:"Over maximum",ru:"Больше максимума"},rangeUnderflow:{en:"Under minimum",ru:"Меньше минимума"},stepMismatch:{en:"Step mismatch",ru:"Не кратно шагу"},tooLong:{en:"Too long",ru:"Слишком длинно"},typeMismatch:{en:"Invalid type",ru:"Неверный тип"},valueMissing:{en:"Required",ru:"Обязательное поле"}},events:{".hasDatepicker":"change.my check.my",".my-form,.my-tags":"change.my check.my",".ui-slider":"slide.my check.my","div.redactor_box textarea":"redactor.my check.my",".my-codemirror":"codemirror.my check.my",".ace_editor":"ace.my check.my",".my-form-list":"sortupdate.my check.my",".ui-sortable":"sortchange.my sortupdate.my check.my",".ui-draggable":"drag.my dragstop.my check.my","a, .pseudolink, input[type=button], button":"click.my","img, :radio, :checkbox":"click.my check.my","div.select2-container+input,div.select2-container+select":"change.my check.my input.my",".ui-buttonset,input, select, textarea":"blur.my change.my check.my"+(navigator.appName.to(5)==="Micro"?" keyup.my":" input.my"),"":"check.my"},containers:{"*[data-role='fieldcontain'] *":{"input,textarea,select,button,:radio":function(e){return e.parents('[data-role="fieldcontain"]').eq(0)}},".tagstrip *.value":function(e){return e.parents(".tagstrip").eq(0)},"div.redactor_box textarea":function(e){return e.parents("div.redactor_box").eq(0).parent()},".my-tags,.hasDatepicker,.ui-widget,input,textarea,select,button":{".my-cleditor":function(e){return e.parents("div.cleditorMain").eq(0).parent()},"":function(t){var n=t[0].parentNode,r=n.nodeName;if(/^(div|span|a|p|form|fieldset|li|ul|td|th|h\d)$/i.test(r))return e(n);else return t.parents("div,span,a,p,form,fieldset,li,ul,td,th,h1,h2,h3,h4,h5,h6").eq(0)}},"":function(e){return e}},offon:{".ace_editor":function(e,t){ace.edit(t[0]).setReadOnly(e)},".ui-selectable":function(e,t){H.jquix(t,"selectable",e)},".ui-slider":function(e,t){H.jquix(t,"slider",e)},".ui-draggable":function(e,t){H.jquix(t,"draggable",e)},".ui-buttonset":function(e,t){H.jquix(t,"buttonset",e)},".hasDatepicker":function(e,t){H.jquix(t,"datepicker",e)},".my-form":function(e,t){t.my("disabled",!!e)},"div.select2-container+input,div.select2-container+select":function(e,t){H.jquix(t,"select2",e)},".my-cleditor":function(e,t){t.cleditor()[0].disable(!!e)},"":function(e,t){t.attr("disabled",!!e)}},destroy:{".hasDatepicker":function(e){e.datepicker("destroy")},".ui-slider":function(e){e.slider("destroy")},".ui-sortable":{".my-form-list":function(t){t.find(">.my-form").each(function(){e(this).my("remove")});t.removeClass("my-form-list");t.sortable("destroy")},"":function(e){e.sortable("destroy")}},".my-form-list":function(t){t.find(">.my-form").each(function(){e(this).my("remove")})},".ui-draggable":function(e){e.draggable("destroy")},".my-redactor-8":function(e){e.destroyEditor();e.removeClass("my-redactor-8")},"div.select2-container+input,div.select2-container+select":function(e){e.select2("destroy")},".my-form":function(e){e.my("remove")},textarea:{".my-codemirror":function(e){e[0].nextSibling.CodeMirror.toTextArea();e.removeClass("my-codemirror")}}}};P.params={container:function(e){return F(e,P.containers)(e)},change:a,recalcDepth:2,delay:0,strict:false,locale:f=(navigator.language||navigator.userLanguage||"en").substr(0,2),messages:Object.map(P.msg,function(e,t){return t[f]||t.en}),errorTip:".my-error-tip",errorCss:"my-error",animate:0,effect:function(e,t,n){if(t)return e.fadeIn(n);e.fadeOut(n)},remember:0,silent:false,history:{},historyDelay:100,loader:function(t,n){var r=e.Deferred(),i=A(t+"");if(i)r.resolve(i);else r.reject(null);return r.promise()},ajaxTimeout:1e4};var H=Z();H.require=B;var Y={init:function(t,n,i){function $(){if(!g.strict)K(y,true);h=o(true,h,Object.reject(y,["data"]));m=Q(o(true,{},y.ui||{}),h,g);l=Number.random(268435456,4294967295).toString(16);f=y.id||"my"+l;c=H.sdbmCode(f);h.id=f;g.form=W;if(y.params&&y.params.depth)g.recalcDepth=y.params.depth;for(b in h)if(C(h[b]))h[b].bind(h);if(y.error){if(S(y.error)){q=function(e,t){return y.error.assign(o({message:e+"",err:t+""},y))}}else if(C(y.error)){q=function(e,t){p=null;try{p=y.error(e,t)}catch(n){p=g.messages.initFailed}return p}}}o(W.data("my"),{id:f,cid:l,mid:c,errors:Object.extended(),ui:Object.extended(m),disabled:false,manifest:h,locFiles:[]});W.addClass("my-form");T="my-manifest-"+c;N="my-form-"+l;W.addClass(N+" "+T)}function Y(){if(h.style){E=G(W,h,T,N);if(E&&E[0].length){L=e("style#"+T);if(!L.size()){L=e('").appendTo(e("body"))}L.data("count",L.data("count")*1+1);W.data("my").style=L}if(E&&E[1].length){O=e("style#"+N);if(!O.size()){O=e('").appendTo(e("body"))}W.data("my").localStyle=O}}}function Z(){var t,n=e.Deferred(),i;i=D(h);if(S(i)){rt("Error decoding base64 to local Blob/URL",i);n.reject()}else{if(r)for(t=0;tОшибка инициализации формы
'},badInput:{en:"Invalid input",ru:f},patternMismatch:{en:"Pattern mismatch",ru:"Не соответствует шаблону"},rangeOverflow:{en:"Over maximum",ru:"Больше максимума"},rangeUnderflow:{en:"Under minimum",ru:"Меньше минимума"},stepMismatch:{en:"Step mismatch",ru:"Не кратно шагу"},tooLong:{en:"Too long",ru:"Слишком длинно"},typeMismatch:{en:"Invalid type",ru:"Неверный тип"},valueMissing:{en:"Required",ru:"Обязательное поле"}},events:{".hasDatepicker":"change.my check.my",".my-form,.my-tags":"change.my check.my",".ui-slider":"slide.my check.my","div.redactor_box textarea":"redactor.my check.my",".my-codemirror":"codemirror.my check.my",".ace_editor":"ace.my check.my",".my-form-list":"sortupdate.my check.my",".ui-sortable":"sortchange.my sortupdate.my check.my",".ui-draggable":"drag.my dragstop.my check.my","a, .pseudolink, input[type=button], button":"click.my","img, :radio, :checkbox":"click.my check.my","div.select2-container+input,div.select2-container+select":"change.my check.my input.my",".ui-buttonset,input, select, textarea":"blur.my change.my check.my"+(navigator.appName.to(5)==="Micro"?" keyup.my":" input.my"),"":"check.my"},containers:{"*[data-role='fieldcontain'] *":{"input,textarea,select,button,:radio":function(e){return e.parents('[data-role="fieldcontain"]').eq(0)}},".tagstrip *.value":function(e){return e.parents(".tagstrip").eq(0)},"div.redactor_box textarea":function(e){return e.parents("div.redactor_box").eq(0).parent()},".my-tags,.hasDatepicker,.ui-widget,input,textarea,select,button":{".my-cleditor":function(e){return e.parents("div.cleditorMain").eq(0).parent()},"":function(t){var n=t[0].parentNode,r=n.nodeName;if(/^(div|span|a|p|form|fieldset|li|ul|td|th|h\d)$/i.test(r))return e(n);else return t.parents("div,span,a,p,form,fieldset,li,ul,td,th,h1,h2,h3,h4,h5,h6").eq(0)}},"":function(e){return e}},offon:{".ace_editor":function(e,t){ace.edit(t[0]).setReadOnly(e)},".ui-selectable":function(e,t){P.jquix(t,"selectable",e)},".ui-slider":function(e,t){P.jquix(t,"slider",e)},".ui-draggable":function(e,t){P.jquix(t,"draggable",e)},".ui-buttonset":function(e,t){P.jquix(t,"buttonset",e)},".hasDatepicker":function(e,t){P.jquix(t,"datepicker",e)},".my-form":function(e,t){t.my("disabled",!!e)},"div.select2-container+input,div.select2-container+select":function(e,t){P.jquix(t,"select2",e)},".my-cleditor":function(e,t){t.cleditor()[0].disable(!!e)},"":function(e,t){t.attr("disabled",!!e)}},destroy:{".hasDatepicker":function(e){e.datepicker("destroy")},".ui-slider":function(e){e.slider("destroy")},".ui-sortable":{".my-form-list":function(t){t.find(">.my-form").each(function(){e(this).my("remove")});t.removeClass("my-form-list");t.sortable("destroy")},"":function(e){e.sortable("destroy")}},".my-form-list":function(t){t.find(">.my-form").each(function(){e(this).my("remove")})},".ui-draggable":function(e){e.draggable("destroy")},".my-redactor-8":function(e){e.destroyEditor();e.removeClass("my-redactor-8")},"div.select2-container+input,div.select2-container+select":function(e){e.select2("destroy")},".my-form":function(e){e.my("remove")},textarea:{".my-codemirror":function(e){e[0].nextSibling.CodeMirror.toTextArea();e.removeClass("my-codemirror")}}}};D.params={container:function(e){return j(e,D.containers)(e)},change:a,recalcDepth:2,delay:0,strict:false,locale:f=(navigator.language||navigator.userLanguage||"en").substr(0,2),messages:Object.map(D.msg,function(e,t){return t[f]||t.en}),errorTip:".my-error-tip",errorCss:"my-error",animate:0,effect:function(e,t,n){if(t)return e.fadeIn(n);e.fadeOut(n)},remember:0,silent:false,history:{},historyDelay:100,loader:function(t,n){var r=e.Deferred(),i=L(t+"");if(i)r.resolve(i);else r.reject(null);return r.promise()},ajaxTimeout:1e4};var P=Y();P.require=H;var G={init:function(t,n,i){function G(){if(!g.strict)J(y,true);h=o(true,h,Object.reject(y,["data"]));m=K(o(true,{},y.ui||{}),h,g);l=Number.random(268435456,4294967295).toString(16);f=y.id||"my"+l;c=P.sdbmCode(f);h.id=f;g.form=X;if(y.params&&y.params.depth)g.recalcDepth=y.params.depth;for(b in h)if(C(h[b]))h[b].bind(h);if(y.error){if(S(y.error)){q=function(e,t){return y.error.assign(o({message:e+"",err:t+""},y))}}else if(C(y.error)){q=function(e,t){p=null;try{p=y.error(e,t)}catch(n){p=g.messages.initFailed}return p}}}o(X.data("my"),{id:f,cid:l,mid:c,errors:Object.extended(),ui:Object.extended(m),disabled:false,manifest:h,locFiles:[],modals:{}});X.addClass("my-form");T="my-manifest-"+c;N="my-form-"+l;X.addClass(N+" "+T)}function Y(){if(h.style){E=Q(X,h,T,N);if(E&&E[0].length){A=e("style#"+T);if(!A.size()){A=e('").appendTo(e("body"))}A.data("count",A.data("count")*1+1);X.data("my").style=A}if(E&&E[1].length){O=e("style#"+N);if(!O.size()){O=e('").appendTo(e("body"))}X.data("my").localStyle=O}}}function Z(){var t,n=e.Deferred(),i;i=_(h);if(S(i)){rt("Error decoding base64 to local Blob/URL",i);n.reject()}else{if(r)for(t=0;tОшибка инициализации формы
'},badInput:{en:"Invalid input",ru:f},patternMismatch:{en:"Pattern mismatch",ru:"Не соответствует шаблону"},rangeOverflow:{en:"Over maximum",ru:"Больше максимума"},rangeUnderflow:{en:"Under minimum",ru:"Меньше минимума"},stepMismatch:{en:"Step mismatch",ru:"Не кратно шагу"},tooLong:{en:"Too long",ru:"Слишком длинно"},typeMismatch:{en:"Invalid type",ru:"Неверный тип"},valueMissing:{en:"Required",ru:"Обязательное поле"}},events:{".hasDatepicker":"change.my check.my",".my-form,.my-tags":"change.my check.my",".ui-slider":"slide.my check.my","div.redactor_box textarea":"redactor.my check.my",".my-codemirror":"codemirror.my check.my",".ace_editor":"ace.my check.my",".my-form-list":"sortupdate.my check.my",".ui-sortable":"sortchange.my sortupdate.my check.my",".ui-draggable":"drag.my dragstop.my check.my","a, .pseudolink, input[type=button], button":"click.my","img, :radio, :checkbox":"click.my check.my","div.select2-container+input,div.select2-container+select":"change.my check.my input.my",".ui-buttonset,input, select, textarea":"blur.my change.my check.my"+(navigator.appName.to(5)==="Micro"?" keyup.my":" input.my"),"":"check.my"},containers:{"*[data-role='fieldcontain'] *":{"input,textarea,select,button,:radio":function(e){return e.parents('[data-role="fieldcontain"]').eq(0)}},".tagstrip *.value":function(e){return e.parents(".tagstrip").eq(0)},"div.redactor_box textarea":function(e){return e.parents("div.redactor_box").eq(0).parent()},".my-tags,.hasDatepicker,.ui-widget,input,textarea,select,button":{".my-cleditor":function(e){return e.parents("div.cleditorMain").eq(0).parent()},"":function(t){var n=t[0].parentNode,r=n.nodeName;if(/^(div|span|a|p|form|fieldset|li|ul|td|th|h\d)$/i.test(r))return e(n);else return t.parents("div,span,a,p,form,fieldset,li,ul,td,th,h1,h2,h3,h4,h5,h6").eq(0)}},"":function(e){return e}},offon:{".ace_editor":function(e,t){ace.edit(t[0]).setReadOnly(e)},".ui-selectable":function(e,t){H.jquix(t,"selectable",e)},".ui-slider":function(e,t){H.jquix(t,"slider",e)},".ui-draggable":function(e,t){H.jquix(t,"draggable",e)},".ui-buttonset":function(e,t){H.jquix(t,"buttonset",e)},".hasDatepicker":function(e,t){H.jquix(t,"datepicker",e)},".my-form":function(e,t){t.my("disabled",!!e)},"div.select2-container+input,div.select2-container+select":function(e,t){H.jquix(t,"select2",e)},".my-cleditor":function(e,t){t.cleditor()[0].disable(!!e)},"":function(e,t){t.attr("disabled",!!e)}},destroy:{".hasDatepicker":function(e){e.datepicker("destroy")},".ui-slider":function(e){e.slider("destroy")},".ui-sortable":{".my-form-list":function(t){t.find(">.my-form").each(function(){e(this).my("remove")});t.removeClass("my-form-list");t.sortable("destroy")},"":function(e){e.sortable("destroy")}},".my-form-list":function(t){t.find(">.my-form").each(function(){e(this).my("remove")})},".ui-draggable":function(e){e.draggable("destroy")},".my-redactor-8":function(e){e.destroyEditor();e.removeClass("my-redactor-8")},"div.select2-container+input,div.select2-container+select":function(e){e.select2("destroy")},".my-form":function(e){e.my("remove")},textarea:{".my-codemirror":function(e){e[0].nextSibling.CodeMirror.toTextArea();e.removeClass("my-codemirror")}}}};P.params={container:function(e){return F(e,P.containers)(e)},change:a,recalcDepth:2,delay:0,strict:false,locale:f=(navigator.language||navigator.userLanguage||"en").substr(0,2),messages:Object.map(P.msg,function(e,t){return t[f]||t.en}),errorTip:".my-error-tip",errorCss:"my-error",animate:0,effect:function(e,t,n){if(t)return e.fadeIn(n);e.fadeOut(n)},remember:0,silent:false,history:{},historyDelay:100,loader:function(t,n){var r=e.Deferred(),i=A(t+"");if(i)r.resolve(i);else r.reject(null);return r.promise()},ajaxTimeout:1e4};var H=Z();H.require=B;var Y={init:function(t,n,i){function $(){if(!g.strict)K(y,true);h=o(true,h,Object.reject(y,["data"]));m=Q(o(true,{},y.ui||{}),h,g);l=Number.random(268435456,4294967295).toString(16);f=y.id||"my"+l;c=H.sdbmCode(f);h.id=f;g.form=W;if(y.params&&y.params.depth)g.recalcDepth=y.params.depth;for(b in h)if(C(h[b]))h[b].bind(h);if(y.error){if(S(y.error)){q=function(e,t){return y.error.assign(o({message:e+"",err:t+""},y))}}else if(C(y.error)){q=function(e,t){p=null;try{p=y.error(e,t)}catch(n){p=g.messages.initFailed}return p}}}o(W.data("my"),{id:f,cid:l,mid:c,errors:Object.extended(),ui:Object.extended(m),disabled:false,manifest:h,locFiles:[]});W.addClass("my-form");T="my-manifest-"+c;N="my-form-"+l;W.addClass(N+" "+T)}function Y(){if(h.style){E=G(W,h,T,N);if(E&&E[0].length){L=e("style#"+T);if(!L.size()){L=e('").appendTo(e("body"))}L.data("count",L.data("count")*1+1);W.data("my").style=L}if(E&&E[1].length){O=e("style#"+N);if(!O.size()){O=e('").appendTo(e("body"))}W.data("my").localStyle=O}}}function Z(){var t,n=e.Deferred(),i;i=D(h);if(S(i)){rt("Error decoding base64 to local Blob/URL",i);n.reject()}else{if(r)for(t=0;tОшибка инициализации формы
'},badInput:{en:"Invalid input",ru:f},patternMismatch:{en:"Pattern mismatch",ru:"Не соответствует шаблону"},rangeOverflow:{en:"Over maximum",ru:"Больше максимума"},rangeUnderflow:{en:"Under minimum",ru:"Меньше минимума"},stepMismatch:{en:"Step mismatch",ru:"Не кратно шагу"},tooLong:{en:"Too long",ru:"Слишком длинно"},typeMismatch:{en:"Invalid type",ru:"Неверный тип"},valueMissing:{en:"Required",ru:"Обязательное поле"}},events:{".hasDatepicker":"change.my check.my",".my-form,.my-tags":"change.my check.my",".ui-slider":"slide.my check.my","div.redactor_box textarea":"redactor.my check.my",".my-codemirror":"codemirror.my check.my",".ace_editor":"ace.my check.my",".my-form-list":"sortupdate.my check.my",".ui-sortable":"sortchange.my sortupdate.my check.my",".ui-draggable":"drag.my dragstop.my check.my","a, .pseudolink, input[type=button], button":"click.my","img, :radio, :checkbox":"click.my check.my","div.select2-container+input,div.select2-container+select":"change.my check.my input.my",".ui-buttonset,input, select, textarea":"blur.my change.my check.my"+(navigator.appName.to(5)==="Micro"?" keyup.my":" input.my"),"":"check.my"},containers:{"*[data-role='fieldcontain'] *":{"input,textarea,select,button,:radio":function(e){return e.parents('[data-role="fieldcontain"]').eq(0)}},".tagstrip *.value":function(e){return e.parents(".tagstrip").eq(0)},"div.redactor_box textarea":function(e){return e.parents("div.redactor_box").eq(0).parent()},".my-tags,.hasDatepicker,.ui-widget,input,textarea,select,button":{".my-cleditor":function(e){return e.parents("div.cleditorMain").eq(0).parent()},"":function(t){var n=t[0].parentNode,r=n.nodeName;if(/^(div|span|a|p|form|fieldset|li|ul|td|th|h\d)$/i.test(r))return e(n);else return t.parents("div,span,a,p,form,fieldset,li,ul,td,th,h1,h2,h3,h4,h5,h6").eq(0)}},"":function(e){return e}},offon:{".ace_editor":function(e,t){ace.edit(t[0]).setReadOnly(e)},".ui-selectable":function(e,t){P.jquix(t,"selectable",e)},".ui-slider":function(e,t){P.jquix(t,"slider",e)},".ui-draggable":function(e,t){P.jquix(t,"draggable",e)},".ui-buttonset":function(e,t){P.jquix(t,"buttonset",e)},".hasDatepicker":function(e,t){P.jquix(t,"datepicker",e)},".my-form":function(e,t){t.my("disabled",!!e)},"div.select2-container+input,div.select2-container+select":function(e,t){P.jquix(t,"select2",e)},".my-cleditor":function(e,t){t.cleditor()[0].disable(!!e)},"":function(e,t){t.attr("disabled",!!e)}},destroy:{".hasDatepicker":function(e){e.datepicker("destroy")},".ui-slider":function(e){e.slider("destroy")},".ui-sortable":{".my-form-list":function(t){t.find(">.my-form").each(function(){e(this).my("remove")});t.removeClass("my-form-list");t.sortable("destroy")},"":function(e){e.sortable("destroy")}},".my-form-list":function(t){t.find(">.my-form").each(function(){e(this).my("remove")})},".ui-draggable":function(e){e.draggable("destroy")},".my-redactor-8":function(e){e.destroyEditor();e.removeClass("my-redactor-8")},"div.select2-container+input,div.select2-container+select":function(e){e.select2("destroy")},".my-form":function(e){e.my("remove")},textarea:{".my-codemirror":function(e){e[0].nextSibling.CodeMirror.toTextArea();e.removeClass("my-codemirror")}}}};D.params={container:function(e){return j(e,D.containers)(e)},change:a,recalcDepth:2,delay:0,strict:false,locale:f=(navigator.language||navigator.userLanguage||"en").substr(0,2),messages:Object.map(D.msg,function(e,t){return t[f]||t.en}),errorTip:".my-error-tip",errorCss:"my-error",animate:0,effect:function(e,t,n){if(t)return e.fadeIn(n);e.fadeOut(n)},remember:0,silent:false,history:{},historyDelay:100,loader:function(t,n){var r=e.Deferred(),i=L(t+"");if(i)r.resolve(i);else r.reject(null);return r.promise()},ajaxTimeout:1e4};var P=Y();P.require=H;var G={init:function(t,n,i){function G(){if(!g.strict)J(y,true);h=o(true,h,Object.reject(y,["data"]));m=K(o(true,{},y.ui||{}),h,g);l=Number.random(268435456,4294967295).toString(16);f=y.id||"my"+l;c=P.sdbmCode(f);h.id=f;g.form=X;if(y.params&&y.params.depth)g.recalcDepth=y.params.depth;for(b in h)if(C(h[b]))h[b].bind(h);if(y.error){if(S(y.error)){q=function(e,t){return y.error.assign(o({message:e+"",err:t+""},y))}}else if(C(y.error)){q=function(e,t){p=null;try{p=y.error(e,t)}catch(n){p=g.messages.initFailed}return p}}}o(X.data("my"),{id:f,cid:l,mid:c,errors:Object.extended(),ui:Object.extended(m),disabled:false,manifest:h,locFiles:[],modals:{}});X.addClass("my-form");T="my-manifest-"+c;N="my-form-"+l;X.addClass(N+" "+T)}function Y(){if(h.style){E=Q(X,h,T,N);if(E&&E[0].length){A=e("style#"+T);if(!A.size()){A=e('").appendTo(e("body"))}A.data("count",A.data("count")*1+1);X.data("my").style=A}if(E&&E[1].length){O=e("style#"+N);if(!O.size()){O=e('").appendTo(e("body"))}X.data("my").localStyle=O}}}function Z(){var t,n=e.Deferred(),i;i=_(h);if(S(i)){rt("Error decoding base64 to local Blob/URL",i);n.reject()}else{if(r)for(t=0;t