diff --git a/Release/1.2/jquerymy-1.2.6.js b/Release/1.2/jquerymy-1.2.6.js new file mode 100644 index 0000000..1934e4c --- /dev/null +++ b/Release/1.2/jquerymy-1.2.6.js @@ -0,0 +1,4394 @@ +/* + * jQuery.my 1.2.6 + * Requires jQuery 1.11.0+, SugarJS 1.3.9-1.4.x + * + * — fixes #17, modal detects Bootstrap and pass request through if seems BT needed + * — added beta support for .lang field + * — forms with empty .ui section are initialzed bit more fast + * + * More details at jquerymy.com + * + * (c) @ermouth, thanks @carpogoryanin, @ftescht + * 2016-06-27 + */ + +;(function ($) { + + var _version = "jQuery.my 1.2.6"; + + // Some shortcuts and constants + var TMP, lang = "en", + wURL = window.URL || window.webkitURL, + ie8 = !document.addEventListener, + + Lang = ((window.navigator.language || window.navigator.userLanguage || 'en')+'').split('-')[0].toLowerCase(), + + 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) { + // detects promise + return null != a && typeof a == Ob && isF(a.then); + }, + + forms = _getref($,"my.f.repo")? $.my.f.repo():{_src:{}, _name:"Default manifest cache"}, + restyles = _getref($,"my.f.restyles")? $.my.f.restyles():{}, + + Merge = Object.merge, + Clone = Object.clone, + Keys = Object.keys, + $E = $.extend, + $D = $.Deferred, + T = $.type, + + N = null, + n = function (o) {return o!==null && o!==undefined;}, + + // Configurables using $.my[fname](newHandler) + // like $.my.ajax(newGlobalAjaxHandlerFunction) + + _ajax = $.ajax, + _cache = _localCache, + _now = Date.now, + _require = _localRequire; + + //######################################################## + // Storage of rules defined by cascading selectors + // very similar to css. Leafs are processors + // 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,xold,mod,eq,ctr = 0, + $n, $drag, + od = $o.data("formlist")||{}, + gen = od.generator||{}, + itemSel = gen.selector||">.my-form", + merge = !!gen.merge, + tmpl = gen.template||"
", + tmplIsVar = /\{/.test(tmpl), + hasher = gen.hash || _sdbm, + ider = gen.id || _sdbm, + extHasher = gen.ext, + delay = gen.delay||50, + sP = "ui-sortable", + sPlc= "."+sP+"-placeholder", + sortable = $o.is("."+sP), + sorting = !!$o.children(sPlc).size(), + result=[], + redraw = [], + now = _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= []; xold={}; + $c.each(function (i) { + var $x = $(this), xd = $x.data("my"), dd; + if (xd) { + old.push(xd.data); + if (!merge && (dd = $x.data("formlist"))) xold[dd.oid] = xd.data; + } + }); + + //fast compare + eq = _aeq(old, list, "=="); + + if (!eq){ + // We possibly have new data, hash it + var hash=[], oid = [], xoid = {}, present={}; + + redraw = []; + + // Build id <-> idx and hashes + for (i=0;iForm init failed
', + ru:'Ошибка инициализации формы
' + }, + + badInput:{en:"Invalid input", ru:"Неверное значение"}, + 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) {_jquix($o,"selectable",x);}, + ".ui-slider": function (x,$o) {_jquix($o,"slider",x);}, + ".ui-draggable": function (x,$o) {_jquix($o,"draggable",x);}, + ".ui-buttonset": function (x,$o) {_jquix($o,"buttonset",x);}, + ".hasDatepicker": function (x,$o) {_jquix($o,"datepicker",x);}, + ".my-form":function (x,$o){$o.my("disabled", !!x);}, + "div.select2-container+input,div.select2-container+select": + function (x,$o) {_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 + restyle:-1, // delay of '); + } + var h = "", $s = $("style#my-modal-style-"+m.cid); + if (m.nose=="top" || m.nose=="bottom") { + h+='div.my-modal-'+m.cid+'.nose-'+m.nose+':before {left:' + + (m.pos.ox - m.pos.px + m.pos.ow/2 - m.pos.vx) + +'px!important;}'; + $s.text(h); + } + if (m.nose=="left" || m.nose=="right") { + h+='div.my-modal-'+m.cid+'.nose-'+m.nose+':before {top:' + + (m.pos.oy - m.pos.py + m.pos.oh/2 - m.pos.vy) + +'px!important;}'; + $s.text(h); + } + } + } + else $m.css({ + left:"50%", + "margin-left":"-"+((m.width+padx)/2).round(0)+"px" + }); + + + if (m.screen) { + if (!m.global) $bg.css({ + top:0, left:0, position:"absolute", + width: m.pos.pw+"px", + height: m.pos.ph+"px", + display:"block", + background:isS(m.screen)? m.screen:'rgba(40,80,120,0.6)', + "z-index":m.z-1 + }); + else { + $bg.css({ + top:0, left:0, + //width:(m.pos.ww*2)+"px", + //height:(m.pos.wh*2)+"px", + width:"100%", height:"100%", + display:"block", + position:"fixed", + "z-index":m.z-1 + }); + if (isS(m.screen)) $bg.css({ + background:m.screen? m.screen:'rgba(25, 39, 59, 0.88)' + }); + } + } + else if ($bg.size()) $bg.hide(); + + if (m.height> m.pos.wh) { + $m.height(m.pos.wh-30); + $f.css({"overflow-y":$.browser.webkit?"overlay":"scroll"}); + } else { + $f.css({"overflow-y":"none"}); + } + + $m.animate({top: m.pos.vy+"px", opacity:"1"}, m.animate); + } + + // - - - - - - - - - - - - - - - - - - + + function _remove(){ + try { $f.my("remove"); } catch(e){} + try { + // root may not exist + $r.data("modals")[m.cid] = null; + } catch(e){} + $f.parent().off(".my").remove(); + $bg.off(".my"+ m.cid); + if (m.screen) { + (function(g){ + if (!g || !isOpen) $bg.hide(); + if (!!g && !isOpen) { + // repair screen color + $bg.css({background:'rgba(25, 39, 59, 0.88)'}); + } + }).delay(50, m.global); // curry m.global + } + if (m.global) { + isOpen = false; + $("body")[0].style.overflow = null; + } + } + + // - - - - - - - - - - - - - - - - - - + + function _f(msg) { + try { done(null, null); } catch(e) {} + (function () { pi.reject(msg); }).delay(0); + } + + }; + +})(jQuery); \ No newline at end of file diff --git a/Release/1.2/jquerymy-1.2.6.min.js b/Release/1.2/jquerymy-1.2.6.min.js new file mode 100644 index 0000000..7f0c7f1 --- /dev/null +++ b/Release/1.2/jquerymy-1.2.6.min.js @@ -0,0 +1,5 @@ +/* jQuery.my 1.2.6 + * Requires jQuery 2.0+, SugarJS 1.3.9-1.4.x + * More details at jquerymy.com */ +!function(a){function b(){window.console&&console.error.apply(console,arguments)}function c(){window.console&&console.log.apply(console,arguments)}function d(a,b){return a.hasOwnProperty(b)}function e(b){return a.contains(document.documentElement,b[0])}function f(a,b){return Array.prototype.slice.call(a,b||0)}function g(a,b,c){var d=0,e=a.length,f=!0;if(a===b)return"===";if("==="==c)return"";if(e!=b.length)return"";for(;e>d&&f;d++)f=a[d]===b[d];if(f)return"==";if("=="==c)return"";for(f=!0;e>d&&f;d++)f=Object.equal(a[d],b[d]);return f?"=":""}function h(a,b){return(hb(b)?b.split("."):fb(b)?b:[""]).reduce(function(a,b){if(null!=a){if(/=/.test(b)){var c=b.split("=",2);return ib(a)?Object.values(a).find(function(a){return ib(a)||fb(a)?a[c[0]]==c[1]:!1}):fb(a)?a.find(function(a){return ib(a)||fb(a)?a[c[0]]==c[1]:!1}):void 0}if(null!=a&&null!=a[b])return a[b]}return void 0},a)}function i(a){var b=a.my();return b?b.root?b.root.my():b:null}function j(a){var b,c={},d=function(){return null};if(hb(a))a.split(/[,\s]+/).compact(!0).unique().map(function(a){c[a]=d});else if(fb(a))a.compact(!0).unique().map(function(a){c[a]=d});else if(ib(a))for(b in a)c[b]=lb(a[b])?a[b]:function(){return a[b]};return c}function k(a){var b,c=a,d={};if(hb(c)&&(c=c.split(/[,\s]+/)),fb(c)){for(c=c.compact(!0),b=0;bОшибка инициализации формы
'},badInput:{en:"Invalid input",ru:"Неверное значение"},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"+("Micro"===navigator.appName.to(5)?" keyup.my":" input.my"),"":"check.my"},containers:{"*[data-role='fieldcontain'] *":{"input,textarea,select,button,:radio":function(a){return a.parents('[data-role="fieldcontain"]').eq(0)}},".tagstrip *.value":function(a){return a.parents(".tagstrip").eq(0)},"div.redactor_box textarea":function(a){return a.parents("div.redactor_box").eq(0).parent()},".my-tags,.hasDatepicker,.ui-widget,input,textarea,select,button":{".my-cleditor":function(a){return a.parents("div.cleditorMain").eq(0).parent()},"":function(b){var c=b[0].parentNode,d=c.nodeName;return/^(div|span|a|p|form|fieldset|li|ul|td|th|h\d)$/i.test(d)?a(c):b.parents("div,span,a,p,form,fieldset,li,ul,td,th,h1,h2,h3,h4,h5,h6").eq(0)}},"":function(a){return a}},offon:{".ace_editor":function(a,b){ace.edit(b[0]).setReadOnly(a)},".ui-selectable":function(a,b){y(b,"selectable",a)},".ui-slider":function(a,b){y(b,"slider",a)},".ui-draggable":function(a,b){y(b,"draggable",a)},".ui-buttonset":function(a,b){y(b,"buttonset",a)},".hasDatepicker":function(a,b){y(b,"datepicker",a)},".my-form":function(a,b){b.my("disabled",!!a)},"div.select2-container+input,div.select2-container+select":function(a,b){y(b,"select2",a)},".my-cleditor":function(a,b){b.cleditor()[0].disable(!!a)},"":function(a,b){b.attr("disabled",!!a)}},destroy:{".hasDatepicker":function(a){a.datepicker("destroy")},".ui-slider":function(a){a.slider("destroy")},".ui-sortable":{".my-form-list":function(b){b.find(">.my-form").each(function(){a(this).my("remove")}),b.removeClass("my-form-list"),b.sortable("destroy")},"":function(a){a.sortable("destroy")}},".my-form-list":function(b){b.find(">.my-form").each(function(){a(this).my("remove")})},".ui-draggable":function(a){a.draggable("destroy")},".my-redactor-8":function(a){a.destroyEditor(),a.removeClass("my-redactor-8")},"div.select2-container+input,div.select2-container+select":function(a){a.select2("destroy")},".my-form":function(a){a.my("remove")},textarea:{".my-codemirror":function(a){a[0].nextSibling.CodeMirror.toTextArea(),a.removeClass("my-codemirror")}}}};Bb.params={container:function(a){return M(a,Bb.containers)(a)},change:vb,recalcDepth:2,delay:0,strict:!1,restyle:-1,locale:X,messages:Object.map(Bb.msg,function(a,b){return b[X]||b.en}),errorTip:".my-error-tip",errorCss:"my-error",animate:0,effect:function(a,b,c){return b?a.fadeIn(c):(a.fadeOut(c),void 0)},remember:0,silent:!1,history:{},historyDelay:100,loader:function(a){var b=tb(),c=yb(a+"");return c?b.resolve(c):b.reject(null),b.promise()},ajaxTimeout:1e4};var Cb={con:c,clone:function(a){return a.clone?a.clone():a},indom:e,jquix:y,overlap:n,patch:m,kickoff:o,sdbmCode:l,tojson:function(){function a(a){return 10>a?"0"+a:a}function b(a,f,g){var h,i,j,k,l=0,m=f||0,n=d;switch(g&&hb(g)&&(l=String(g).length,n=String(g).repeat(10)),(typeof a).substr(0,3)){case"str":return e(a).replace(/<\/scri/gi,"<\\u002fscri");case"num":return isFinite(a)?""+String(a):"null";case"boo":case"nul":return String(a);case"fun":return e(c(a.toString()).replace(/<\/scri/gi,"<\\u002fscri"));case"obj":if(!a)return"null";if(typeof a.toJSON===cb)return b(a.toJSON(),m+(g?1:0),g);if(h=[],fb(a)){for(i=0;iJ.pos.ph-p?J.pos.vy=J.pos.ph-p-J.height:J.pos.vy
');var c="",d=a("style#my-modal-style-"+J.cid);("top"==J.nose||"bottom"==J.nose)&&(c+="div.my-modal-"+J.cid+".nose-"+J.nose+":before {left:"+(J.pos.ox-J.pos.px+J.pos.ow/2-J.pos.vx)+"px!important;}",d.text(c)),("left"==J.nose||"right"==J.nose)&&(c+="div.my-modal-"+J.cid+".nose-"+J.nose+":before {top:"+(J.pos.oy-J.pos.py+J.pos.oh/2-J.pos.vy)+"px!important;}",d.text(c))}J.screen?J.global?(y.css({top:0,left:0,width:"100%",height:"100%",display:"block",position:"fixed","z-index":J.z-1}),l(J.screen)&&y.css({background:J.screen?J.screen:"rgba(25, 39, 59, 0.88)"})):y.css({top:0,left:0,position:"absolute",width:J.pos.pw+"px",height:J.pos.ph+"px",display:"block",background:l(J.screen)?J.screen:"rgba(40,80,120,0.6)","z-index":J.z-1}):y.size()&&y.hide(),J.height>J.pos.wh?(v.height(J.pos.wh-30),w.css({"overflow-y":a.browser.webkit?"overlay":"scroll"})):w.css({"overflow-y":"none"}),v.animate({top:J.pos.vy+"px",opacity:"1"},J.animate)}function t(){try{w.my("remove")}catch(b){}try{x.data("modals")[J.cid]=null}catch(b){}w.parent().off(".my").remove(),y.off(".my"+J.cid),J.screen&&function(a){a&&g||y.hide(),a&&!g&&y.css({background:"rgba(25, 39, 59, 0.88)"})}.delay(50,J.global),J.global&&(g=!1,a("body")[0].style.overflow=null)}function u(a){try{H(null,null)}catch(b){}(function(){C.reject(a)}).delay(0)}if(d){if(void 0===e&&void 0===p&&void 0===q)return d.call(this);if(m(e)&&(e.hasOwnProperty("backdrop")||e.hasOwnProperty("keyborad")||e.hasOwnProperty("show")))return d.call(this,e,p);if(l(e)&&/^(toggle|show|hide|handleUpdate)$/.test(e))return d.call(this,e,p)}var v,w,x,y,z,A,B,C=a.Deferred(),D={},E=this,F=0,G=0,H=o(p)?p:function(){return!1},I=m(e)?e:{},J=E.data("modal");if(h(E,C.promise()),J){if(null==e||k(e)){if(w=J.form,y=J.bg,x=J.root,H=J.done,A=w.my("data"),B=!1,e){try{H.call(w.my("manifest"),null,null)}catch(K){}try{j(w)?t():""}catch(K){}if(E.removeData("modal"),i[J.cid])try{i[J.cid].reject("Cancelled")}catch(K){}delete i[J.cid],J=null}else{try{B=H.call(w.my("manifest"),w.my("valid")?null:w.my("errors"),A)}catch(K){}if(!B){try{j(w)?t():""}catch(K){}E.removeData("modal"),function(){i[J.cid]&&i[J.cid].resolve(A),delete i[J.cid],J=null}.delay(0)}}return E}if(I)return u("Locked"),E}return E.is(":visible")?(I=b(D,e,{}))?I.global&&g?(u("Locked"),E):(J=h({type:"DOM",source:"manifest",form:null,modal:null,root:null,bgroot:null,caller:E,manifest:{},data:{},global:!1,screen:!1,drag:!1,focus:!0,close:!0,silent:!0,esc:!1,enter:!1,bound:!1,hardClose:!0,nose:"",width:q||300,height:null,x:"0",y:"0",z:"1901",background:"white",css:"",animate:200},I,{promise:C.promise(),cid:Number.random(268435456,4294967295).toString(16)}),J.done=o(J.done)?J.done:H,l(J.align)&&J.align&&(J.x=(J.align.match(/(left|right):\-?\d+(\.\d+)?(%|px)?/g)||["0"])[0],J.y=(J.align.match(/(top|bottom):\-?\d+(\.\d+)?(%|px)?/g)||["0"])[0]),J.width=1*(a.my.f.getref(l(J.manifest)?a.my.cache(J.manifest):J.manifest,"params.width")||J.width),J.type="DOM",E.hasClass("my-form")?(J.type="form",J.root=J.root||E):E.data("my")?(J.type="control",J.root=J.root||E.my().root):(J.root=J.root||E.parents(".my-form").eq(0),J.root.size()||(J.root=a(f))),J.global?(J.root=a(f),J.bgroot=a(c||f)):J.bgroot=J.root,x=J.root,x.data("modals")||x.data("modals",{}),r(),v=a('
'),J.root.find(">.my-modal").size()?v.insertAfter(J.root.find(">.my-modal").last()):v.prependTo(J.root),v.addClass("my-modal-"+J.cid),F=v.outerWidth(),G=v.outerHeight(),v.hide(),v.html(''),w=v.find(".my-modal-form"),J.close&&(z=a(l(J.close)?J.close:'Ошибка инициализации формы
'},badInput:{en:"Invalid input",ru:T},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"+("Micro"===navigator.appName.to(5)?" keyup.my":" input.my"),"":"check.my"},containers:{"*[data-role='fieldcontain'] *":{"input,textarea,select,button,:radio":function(a){return a.parents('[data-role="fieldcontain"]').eq(0) -}},".tagstrip *.value":function(a){return a.parents(".tagstrip").eq(0)},"div.redactor_box textarea":function(a){return a.parents("div.redactor_box").eq(0).parent()},".my-tags,.hasDatepicker,.ui-widget,input,textarea,select,button":{".my-cleditor":function(a){return a.parents("div.cleditorMain").eq(0).parent()},"":function(b){var c=b[0].parentNode,d=c.nodeName;return/^(div|span|a|p|form|fieldset|li|ul|td|th|h\d)$/i.test(d)?a(c):b.parents("div,span,a,p,form,fieldset,li,ul,td,th,h1,h2,h3,h4,h5,h6").eq(0)}},"":function(a){return a}},offon:{".ace_editor":function(a,b){ace.edit(b[0]).setReadOnly(a)},".ui-selectable":function(a,b){y(b,"selectable",a)},".ui-slider":function(a,b){y(b,"slider",a)},".ui-draggable":function(a,b){y(b,"draggable",a)},".ui-buttonset":function(a,b){y(b,"buttonset",a)},".hasDatepicker":function(a,b){y(b,"datepicker",a)},".my-form":function(a,b){b.my("disabled",!!a)},"div.select2-container+input,div.select2-container+select":function(a,b){y(b,"select2",a)},".my-cleditor":function(a,b){b.cleditor()[0].disable(!!a)},"":function(a,b){b.attr("disabled",!!a)}},destroy:{".hasDatepicker":function(a){a.datepicker("destroy")},".ui-slider":function(a){a.slider("destroy")},".ui-sortable":{".my-form-list":function(b){b.find(">.my-form").each(function(){a(this).my("remove")}),b.removeClass("my-form-list"),b.sortable("destroy")},"":function(a){a.sortable("destroy")}},".my-form-list":function(b){b.find(">.my-form").each(function(){a(this).my("remove")})},".ui-draggable":function(a){a.draggable("destroy")},".my-redactor-8":function(a){a.destroyEditor(),a.removeClass("my-redactor-8")},"div.select2-container+input,div.select2-container+select":function(a){a.select2("destroy")},".my-form":function(a){a.my("remove")},textarea:{".my-codemirror":function(a){a[0].nextSibling.CodeMirror.toTextArea(),a.removeClass("my-codemirror")}}}};Ab.params={container:function(a){return L(a,Ab.containers)(a)},change:ub,recalcDepth:2,delay:0,strict:!1,restyle:-1,locale:T=(navigator.language||navigator.userLanguage||"en").substr(0,2),messages:Object.map(Ab.msg,function(a,b){return b[T]||b.en}),errorTip:".my-error-tip",errorCss:"my-error",animate:0,effect:function(a,b,c){return b?a.fadeIn(c):(a.fadeOut(c),void 0)},remember:0,silent:!1,history:{},historyDelay:100,loader:function(a){var b=sb(),c=xb(a+"");return c?b.resolve(c):b.reject(null),b.promise()},ajaxTimeout:1e4};var Bb={con:c,clone:function(a){return a.clone?a.clone():a},indom:e,jquix:y,overlap:n,patch:m,kickoff:o,sdbmCode:l,tojson:function(){function a(a){return 10>a?"0"+a:a}function b(a,f,g){var h,i,j,k,l=0,m=f||0,n=d;switch(g&&gb(g)&&(l=String(g).length,n=String(g).repeat(10)),(typeof a).substr(0,3)){case"str":return e(a).replace(/<\/scri/gi,"<\\u002fscri");case"num":return isFinite(a)?""+String(a):"null";case"boo":case"nul":return String(a);case"fun":return e(c(a.toString()).replace(/<\/scri/gi,"<\\u002fscri"));case"obj":if(!a)return"null";if(typeof a.toJSON===bb)return b(a.toJSON(),m+(g?1:0),g);if(h=[],eb(a)){for(i=0;iI.pos.ph-p?I.pos.vy=I.pos.ph-p-I.height:I.pos.vy
');var c="",d=a("style#my-modal-style-"+I.cid);("top"==I.nose||"bottom"==I.nose)&&(c+="div.my-modal-"+I.cid+".nose-"+I.nose+":before {left:"+(I.pos.ox-I.pos.px+I.pos.ow/2-I.pos.vx)+"px!important;}",d.text(c)),("left"==I.nose||"right"==I.nose)&&(c+="div.my-modal-"+I.cid+".nose-"+I.nose+":before {top:"+(I.pos.oy-I.pos.py+I.pos.oh/2-I.pos.vy)+"px!important;}",d.text(c))}I.screen?I.global?(x.css({top:0,left:0,width:"100%",height:"100%",display:"block",position:"fixed","z-index":I.z-1}),k(I.screen)&&x.css({background:I.screen?I.screen:"rgba(25, 39, 59, 0.88)"})):x.css({top:0,left:0,position:"absolute",width:I.pos.pw+"px",height:I.pos.ph+"px",display:"block",background:k(I.screen)?I.screen:"rgba(40,80,120,0.6)","z-index":I.z-1}):x.size()&&x.hide(),I.height>I.pos.wh?(u.height(I.pos.wh-30),v.css({"overflow-y":a.browser.webkit?"overlay":"scroll"})):v.css({"overflow-y":"none"}),u.animate({top:I.pos.vy+"px",opacity:"1"},I.animate)}function s(){try{v.my("remove")}catch(b){}try{w.data("modals")[I.cid]=null}catch(b){}v.parent().off(".my").remove(),x.off(".my"+I.cid),I.screen&&function(a){a&&f||x.hide(),a&&!f&&x.css({background:"rgba(25, 39, 59, 0.88)"})}.delay(50,I.global),I.global&&(f=!1,a("body")[0].style.overflow=null)}function t(a){try{G(null,null)}catch(b){}(function(){B.reject(a)}).delay(0)}var u,v,w,x,y,z,A,B=a.Deferred(),C={},D=this,E=0,F=0,G=n(o)?o:function(){return!1},H=l(d)?d:{},I=D.data("modal");if(g(D,B.promise()),I){if(null==d||j(d)){if(v=I.form,x=I.bg,w=I.root,G=I.done,z=v.my("data"),A=!1,d){try{G.call(v.my("manifest"),null,null)}catch(J){}try{i(v)?s():""}catch(J){}if(D.removeData("modal"),h[I.cid])try{h[I.cid].reject("Cancelled")}catch(J){}delete h[I.cid],I=null}else{try{A=G.call(v.my("manifest"),v.my("valid")?null:v.my("errors"),z)}catch(J){}if(!A){try{i(v)?s():""}catch(J){}D.removeData("modal"),function(){h[I.cid]&&h[I.cid].resolve(z),delete h[I.cid],I=null}.delay(0)}}return D}if(H)return t("Locked"),D}return D.is(":visible")?(H=b(C,d,{}))?H.global&&f?(t("Locked"),D):(I=g({type:"DOM",source:"manifest",form:null,modal:null,root:null,bgroot:null,caller:D,manifest:{},data:{},global:!1,screen:!1,drag:!1,focus:!0,close:!0,silent:!0,esc:!1,enter:!1,bound:!1,hardClose:!0,nose:"",width:p||300,height:null,x:"0",y:"0",z:"1901",background:"white",css:"",animate:200},H,{promise:B.promise(),cid:Number.random(268435456,4294967295).toString(16)}),I.done=n(I.done)?I.done:G,k(I.align)&&I.align&&(I.x=(I.align.match(/(left|right):\-?\d+(\.\d+)?(%|px)?/g)||["0"])[0],I.y=(I.align.match(/(top|bottom):\-?\d+(\.\d+)?(%|px)?/g)||["0"])[0]),I.width=1*(a.my.f.getref(k(I.manifest)?a.my.cache(I.manifest):I.manifest,"params.width")||I.width),I.type="DOM",D.hasClass("my-form")?(I.type="form",I.root=I.root||D):D.data("my")?(I.type="control",I.root=I.root||D.my().root):(I.root=I.root||D.parents(".my-form").eq(0),I.root.size()||(I.root=a(e))),I.global?(I.root=a(e),I.bgroot=a(c||e)):I.bgroot=I.root,w=I.root,w.data("modals")||w.data("modals",{}),q(),u=a('
'),I.root.find(">.my-modal").size()?u.insertAfter(I.root.find(">.my-modal").last()):u.prependTo(I.root),u.addClass("my-modal-"+I.cid),E=u.outerWidth(),F=u.outerHeight(),u.hide(),u.html(''),v=u.find(".my-modal-form"),I.close&&(y=a(k(I.close)?I.close:'Ошибка инициализации формы
'},badInput:{en:"Invalid input",ru:"Неверное значение"},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"+("Micro"===navigator.appName.to(5)?" keyup.my":" input.my"),"":"check.my"},containers:{"*[data-role='fieldcontain'] *":{"input,textarea,select,button,:radio":function(a){return a.parents('[data-role="fieldcontain"]').eq(0)}},".tagstrip *.value":function(a){return a.parents(".tagstrip").eq(0)},"div.redactor_box textarea":function(a){return a.parents("div.redactor_box").eq(0).parent()},".my-tags,.hasDatepicker,.ui-widget,input,textarea,select,button":{".my-cleditor":function(a){return a.parents("div.cleditorMain").eq(0).parent()},"":function(b){var c=b[0].parentNode,d=c.nodeName;return/^(div|span|a|p|form|fieldset|li|ul|td|th|h\d)$/i.test(d)?a(c):b.parents("div,span,a,p,form,fieldset,li,ul,td,th,h1,h2,h3,h4,h5,h6").eq(0)}},"":function(a){return a}},offon:{".ace_editor":function(a,b){ace.edit(b[0]).setReadOnly(a)},".ui-selectable":function(a,b){y(b,"selectable",a)},".ui-slider":function(a,b){y(b,"slider",a)},".ui-draggable":function(a,b){y(b,"draggable",a)},".ui-buttonset":function(a,b){y(b,"buttonset",a)},".hasDatepicker":function(a,b){y(b,"datepicker",a)},".my-form":function(a,b){b.my("disabled",!!a)},"div.select2-container+input,div.select2-container+select":function(a,b){y(b,"select2",a)},".my-cleditor":function(a,b){b.cleditor()[0].disable(!!a)},"":function(a,b){b.attr("disabled",!!a)}},destroy:{".hasDatepicker":function(a){a.datepicker("destroy")},".ui-slider":function(a){a.slider("destroy")},".ui-sortable":{".my-form-list":function(b){b.find(">.my-form").each(function(){a(this).my("remove")}),b.removeClass("my-form-list"),b.sortable("destroy")},"":function(a){a.sortable("destroy")}},".my-form-list":function(b){b.find(">.my-form").each(function(){a(this).my("remove")})},".ui-draggable":function(a){a.draggable("destroy")},".my-redactor-8":function(a){a.destroyEditor(),a.removeClass("my-redactor-8")},"div.select2-container+input,div.select2-container+select":function(a){a.select2("destroy")},".my-form":function(a){a.my("remove")},textarea:{".my-codemirror":function(a){a[0].nextSibling.CodeMirror.toTextArea(),a.removeClass("my-codemirror")}}}};Bb.params={container:function(a){return M(a,Bb.containers)(a)},change:vb,recalcDepth:2,delay:0,strict:!1,restyle:-1,locale:X,messages:Object.map(Bb.msg,function(a,b){return b[X]||b.en}),errorTip:".my-error-tip",errorCss:"my-error",animate:0,effect:function(a,b,c){return b?a.fadeIn(c):(a.fadeOut(c),void 0)},remember:0,silent:!1,history:{},historyDelay:100,loader:function(a){var b=tb(),c=yb(a+"");return c?b.resolve(c):b.reject(null),b.promise()},ajaxTimeout:1e4};var Cb={con:c,clone:function(a){return a.clone?a.clone():a},indom:e,jquix:y,overlap:n,patch:m,kickoff:o,sdbmCode:l,tojson:function(){function a(a){return 10>a?"0"+a:a}function b(a,f,g){var h,i,j,k,l=0,m=f||0,n=d;switch(g&&hb(g)&&(l=String(g).length,n=String(g).repeat(10)),(typeof a).substr(0,3)){case"str":return e(a).replace(/<\/scri/gi,"<\\u002fscri");case"num":return isFinite(a)?""+String(a):"null";case"boo":case"nul":return String(a);case"fun":return e(c(a.toString()).replace(/<\/scri/gi,"<\\u002fscri"));case"obj":if(!a)return"null";if(typeof a.toJSON===cb)return b(a.toJSON(),m+(g?1:0),g);if(h=[],fb(a)){for(i=0;iJ.pos.ph-p?J.pos.vy=J.pos.ph-p-J.height:J.pos.vy
');var c="",d=a("style#my-modal-style-"+J.cid);("top"==J.nose||"bottom"==J.nose)&&(c+="div.my-modal-"+J.cid+".nose-"+J.nose+":before {left:"+(J.pos.ox-J.pos.px+J.pos.ow/2-J.pos.vx)+"px!important;}",d.text(c)),("left"==J.nose||"right"==J.nose)&&(c+="div.my-modal-"+J.cid+".nose-"+J.nose+":before {top:"+(J.pos.oy-J.pos.py+J.pos.oh/2-J.pos.vy)+"px!important;}",d.text(c))}J.screen?J.global?(y.css({top:0,left:0,width:"100%",height:"100%",display:"block",position:"fixed","z-index":J.z-1}),l(J.screen)&&y.css({background:J.screen?J.screen:"rgba(25, 39, 59, 0.88)"})):y.css({top:0,left:0,position:"absolute",width:J.pos.pw+"px",height:J.pos.ph+"px",display:"block",background:l(J.screen)?J.screen:"rgba(40,80,120,0.6)","z-index":J.z-1}):y.size()&&y.hide(),J.height>J.pos.wh?(v.height(J.pos.wh-30),w.css({"overflow-y":a.browser.webkit?"overlay":"scroll"})):w.css({"overflow-y":"none"}),v.animate({top:J.pos.vy+"px",opacity:"1"},J.animate)}function t(){try{w.my("remove")}catch(b){}try{x.data("modals")[J.cid]=null}catch(b){}w.parent().off(".my").remove(),y.off(".my"+J.cid),J.screen&&function(a){a&&g||y.hide(),a&&!g&&y.css({background:"rgba(25, 39, 59, 0.88)"})}.delay(50,J.global),J.global&&(g=!1,a("body")[0].style.overflow=null)}function u(a){try{H(null,null)}catch(b){}(function(){C.reject(a)}).delay(0)}if(d){if(void 0===e&&void 0===p&&void 0===q)return d.call(this);if(m(e)&&(e.hasOwnProperty("backdrop")||e.hasOwnProperty("keyborad")||e.hasOwnProperty("show")))return d.call(this,e,p);if(l(e)&&/^(toggle|show|hide|handleUpdate)$/.test(e))return d.call(this,e,p)}var v,w,x,y,z,A,B,C=a.Deferred(),D={},E=this,F=0,G=0,H=o(p)?p:function(){return!1},I=m(e)?e:{},J=E.data("modal");if(h(E,C.promise()),J){if(null==e||k(e)){if(w=J.form,y=J.bg,x=J.root,H=J.done,A=w.my("data"),B=!1,e){try{H.call(w.my("manifest"),null,null)}catch(K){}try{j(w)?t():""}catch(K){}if(E.removeData("modal"),i[J.cid])try{i[J.cid].reject("Cancelled")}catch(K){}delete i[J.cid],J=null}else{try{B=H.call(w.my("manifest"),w.my("valid")?null:w.my("errors"),A)}catch(K){}if(!B){try{j(w)?t():""}catch(K){}E.removeData("modal"),function(){i[J.cid]&&i[J.cid].resolve(A),delete i[J.cid],J=null}.delay(0)}}return E}if(I)return u("Locked"),E}return E.is(":visible")?(I=b(D,e,{}))?I.global&&g?(u("Locked"),E):(J=h({type:"DOM",source:"manifest",form:null,modal:null,root:null,bgroot:null,caller:E,manifest:{},data:{},global:!1,screen:!1,drag:!1,focus:!0,close:!0,silent:!0,esc:!1,enter:!1,bound:!1,hardClose:!0,nose:"",width:q||300,height:null,x:"0",y:"0",z:"1901",background:"white",css:"",animate:200},I,{promise:C.promise(),cid:Number.random(268435456,4294967295).toString(16)}),J.done=o(J.done)?J.done:H,l(J.align)&&J.align&&(J.x=(J.align.match(/(left|right):\-?\d+(\.\d+)?(%|px)?/g)||["0"])[0],J.y=(J.align.match(/(top|bottom):\-?\d+(\.\d+)?(%|px)?/g)||["0"])[0]),J.width=1*(a.my.f.getref(l(J.manifest)?a.my.cache(J.manifest):J.manifest,"params.width")||J.width),J.type="DOM",E.hasClass("my-form")?(J.type="form",J.root=J.root||E):E.data("my")?(J.type="control",J.root=J.root||E.my().root):(J.root=J.root||E.parents(".my-form").eq(0),J.root.size()||(J.root=a(f))),J.global?(J.root=a(f),J.bgroot=a(c||f)):J.bgroot=J.root,x=J.root,x.data("modals")||x.data("modals",{}),r(),v=a('
'),J.root.find(">.my-modal").size()?v.insertAfter(J.root.find(">.my-modal").last()):v.prependTo(J.root),v.addClass("my-modal-"+J.cid),F=v.outerWidth(),G=v.outerHeight(),v.hide(),v.html(''),w=v.find(".my-modal-form"),J.close&&(z=a(l(J.close)?J.close:'Ошибка инициализации формы
' }, - badInput:{en:"Invalid input", ru:TMP}, + badInput:{en:"Invalid input", ru:"Неверное значение"}, patternMismatch:{en:"Pattern mismatch", ru:"Не соответствует шаблону"}, rangeOverflow:{en:"Over maximum", ru:"Больше максимума"}, rangeUnderflow:{en:"Under minimum", ru:"Меньше минимума"}, @@ -655,8 +658,8 @@ delay:0, // default delay of bind invocation strict:false, // if true form assumed unjsonned restyle:-1, // delay of "}!Y.style||b&&!pb.is(":visible")||(Q=J(pb,Y,R,S),Q&&Q[0].length&&!b&&(T=a("style#"+R),T.size()||(T=a(c(Q[0],R)).appendTo(a("body"))),T.data("count",1*T.data("count")+1),pb.data("my").style=T),Q&&Q[1].length&&(U=a("style#"+S),U.size()?b&&(a(c(Q[1],S)).replaceAll(U),U=a("style#"+S)):(U=a(c(Q[1],S)).appendTo(a("body")),M.restyle>-1&&!nb[G]&&(nb[G]=function(){p(!0)}.debounce(M.restyle)),pb.data("my").restyle=p.fill(!0).debounce(0)),pb.data("my").localStyle=U,b||pb.addClass("my-restyle")))}function q(){var a,b,c=!0;if(b=s(Y),gb(b))y("Error decoding base64 to local Blob/URL",b),c=!1;else{if(V)for(a=0;aОшибка инициализации формы
'},badInput:{en:"Invalid input",ru:T},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"+("Micro"===navigator.appName.to(5)?" keyup.my":" input.my"),"":"check.my"},containers:{"*[data-role='fieldcontain'] *":{"input,textarea,select,button,:radio":function(a){return a.parents('[data-role="fieldcontain"]').eq(0) -}},".tagstrip *.value":function(a){return a.parents(".tagstrip").eq(0)},"div.redactor_box textarea":function(a){return a.parents("div.redactor_box").eq(0).parent()},".my-tags,.hasDatepicker,.ui-widget,input,textarea,select,button":{".my-cleditor":function(a){return a.parents("div.cleditorMain").eq(0).parent()},"":function(b){var c=b[0].parentNode,d=c.nodeName;return/^(div|span|a|p|form|fieldset|li|ul|td|th|h\d)$/i.test(d)?a(c):b.parents("div,span,a,p,form,fieldset,li,ul,td,th,h1,h2,h3,h4,h5,h6").eq(0)}},"":function(a){return a}},offon:{".ace_editor":function(a,b){ace.edit(b[0]).setReadOnly(a)},".ui-selectable":function(a,b){y(b,"selectable",a)},".ui-slider":function(a,b){y(b,"slider",a)},".ui-draggable":function(a,b){y(b,"draggable",a)},".ui-buttonset":function(a,b){y(b,"buttonset",a)},".hasDatepicker":function(a,b){y(b,"datepicker",a)},".my-form":function(a,b){b.my("disabled",!!a)},"div.select2-container+input,div.select2-container+select":function(a,b){y(b,"select2",a)},".my-cleditor":function(a,b){b.cleditor()[0].disable(!!a)},"":function(a,b){b.attr("disabled",!!a)}},destroy:{".hasDatepicker":function(a){a.datepicker("destroy")},".ui-slider":function(a){a.slider("destroy")},".ui-sortable":{".my-form-list":function(b){b.find(">.my-form").each(function(){a(this).my("remove")}),b.removeClass("my-form-list"),b.sortable("destroy")},"":function(a){a.sortable("destroy")}},".my-form-list":function(b){b.find(">.my-form").each(function(){a(this).my("remove")})},".ui-draggable":function(a){a.draggable("destroy")},".my-redactor-8":function(a){a.destroyEditor(),a.removeClass("my-redactor-8")},"div.select2-container+input,div.select2-container+select":function(a){a.select2("destroy")},".my-form":function(a){a.my("remove")},textarea:{".my-codemirror":function(a){a[0].nextSibling.CodeMirror.toTextArea(),a.removeClass("my-codemirror")}}}};Ab.params={container:function(a){return L(a,Ab.containers)(a)},change:ub,recalcDepth:2,delay:0,strict:!1,restyle:-1,locale:T=(navigator.language||navigator.userLanguage||"en").substr(0,2),messages:Object.map(Ab.msg,function(a,b){return b[T]||b.en}),errorTip:".my-error-tip",errorCss:"my-error",animate:0,effect:function(a,b,c){return b?a.fadeIn(c):(a.fadeOut(c),void 0)},remember:0,silent:!1,history:{},historyDelay:100,loader:function(a){var b=sb(),c=xb(a+"");return c?b.resolve(c):b.reject(null),b.promise()},ajaxTimeout:1e4};var Bb={con:c,clone:function(a){return a.clone?a.clone():a},indom:e,jquix:y,overlap:n,patch:m,kickoff:o,sdbmCode:l,tojson:function(){function a(a){return 10>a?"0"+a:a}function b(a,f,g){var h,i,j,k,l=0,m=f||0,n=d;switch(g&&gb(g)&&(l=String(g).length,n=String(g).repeat(10)),(typeof a).substr(0,3)){case"str":return e(a).replace(/<\/scri/gi,"<\\u002fscri");case"num":return isFinite(a)?""+String(a):"null";case"boo":case"nul":return String(a);case"fun":return e(c(a.toString()).replace(/<\/scri/gi,"<\\u002fscri"));case"obj":if(!a)return"null";if(typeof a.toJSON===bb)return b(a.toJSON(),m+(g?1:0),g);if(h=[],eb(a)){for(i=0;iI.pos.ph-p?I.pos.vy=I.pos.ph-p-I.height:I.pos.vy
');var c="",d=a("style#my-modal-style-"+I.cid);("top"==I.nose||"bottom"==I.nose)&&(c+="div.my-modal-"+I.cid+".nose-"+I.nose+":before {left:"+(I.pos.ox-I.pos.px+I.pos.ow/2-I.pos.vx)+"px!important;}",d.text(c)),("left"==I.nose||"right"==I.nose)&&(c+="div.my-modal-"+I.cid+".nose-"+I.nose+":before {top:"+(I.pos.oy-I.pos.py+I.pos.oh/2-I.pos.vy)+"px!important;}",d.text(c))}I.screen?I.global?(x.css({top:0,left:0,width:"100%",height:"100%",display:"block",position:"fixed","z-index":I.z-1}),k(I.screen)&&x.css({background:I.screen?I.screen:"rgba(25, 39, 59, 0.88)"})):x.css({top:0,left:0,position:"absolute",width:I.pos.pw+"px",height:I.pos.ph+"px",display:"block",background:k(I.screen)?I.screen:"rgba(40,80,120,0.6)","z-index":I.z-1}):x.size()&&x.hide(),I.height>I.pos.wh?(u.height(I.pos.wh-30),v.css({"overflow-y":a.browser.webkit?"overlay":"scroll"})):v.css({"overflow-y":"none"}),u.animate({top:I.pos.vy+"px",opacity:"1"},I.animate)}function s(){try{v.my("remove")}catch(b){}try{w.data("modals")[I.cid]=null}catch(b){}v.parent().off(".my").remove(),x.off(".my"+I.cid),I.screen&&function(a){a&&f||x.hide(),a&&!f&&x.css({background:"rgba(25, 39, 59, 0.88)"})}.delay(50,I.global),I.global&&(f=!1,a("body")[0].style.overflow=null)}function t(a){try{G(null,null)}catch(b){}(function(){B.reject(a)}).delay(0)}var u,v,w,x,y,z,A,B=a.Deferred(),C={},D=this,E=0,F=0,G=n(o)?o:function(){return!1},H=l(d)?d:{},I=D.data("modal");if(g(D,B.promise()),I){if(null==d||j(d)){if(v=I.form,x=I.bg,w=I.root,G=I.done,z=v.my("data"),A=!1,d){try{G.call(v.my("manifest"),null,null)}catch(J){}try{i(v)?s():""}catch(J){}if(D.removeData("modal"),h[I.cid])try{h[I.cid].reject("Cancelled")}catch(J){}delete h[I.cid],I=null}else{try{A=G.call(v.my("manifest"),v.my("valid")?null:v.my("errors"),z)}catch(J){}if(!A){try{i(v)?s():""}catch(J){}D.removeData("modal"),function(){h[I.cid]&&h[I.cid].resolve(z),delete h[I.cid],I=null}.delay(0)}}return D}if(H)return t("Locked"),D}return D.is(":visible")?(H=b(C,d,{}))?H.global&&f?(t("Locked"),D):(I=g({type:"DOM",source:"manifest",form:null,modal:null,root:null,bgroot:null,caller:D,manifest:{},data:{},global:!1,screen:!1,drag:!1,focus:!0,close:!0,silent:!0,esc:!1,enter:!1,bound:!1,hardClose:!0,nose:"",width:p||300,height:null,x:"0",y:"0",z:"1901",background:"white",css:"",animate:200},H,{promise:B.promise(),cid:Number.random(268435456,4294967295).toString(16)}),I.done=n(I.done)?I.done:G,k(I.align)&&I.align&&(I.x=(I.align.match(/(left|right):\-?\d+(\.\d+)?(%|px)?/g)||["0"])[0],I.y=(I.align.match(/(top|bottom):\-?\d+(\.\d+)?(%|px)?/g)||["0"])[0]),I.width=1*(a.my.f.getref(k(I.manifest)?a.my.cache(I.manifest):I.manifest,"params.width")||I.width),I.type="DOM",D.hasClass("my-form")?(I.type="form",I.root=I.root||D):D.data("my")?(I.type="control",I.root=I.root||D.my().root):(I.root=I.root||D.parents(".my-form").eq(0),I.root.size()||(I.root=a(e))),I.global?(I.root=a(e),I.bgroot=a(c||e)):I.bgroot=I.root,w=I.root,w.data("modals")||w.data("modals",{}),q(),u=a('
'),I.root.find(">.my-modal").size()?u.insertAfter(I.root.find(">.my-modal").last()):u.prependTo(I.root),u.addClass("my-modal-"+I.cid),E=u.outerWidth(),F=u.outerHeight(),u.hide(),u.html(''),v=u.find(".my-modal-form"),I.close&&(y=a(k(I.close)?I.close:'Ошибка инициализации формы
'},badInput:{en:"Invalid input",ru:"Неверное значение"},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"+("Micro"===navigator.appName.to(5)?" keyup.my":" input.my"),"":"check.my"},containers:{"*[data-role='fieldcontain'] *":{"input,textarea,select,button,:radio":function(a){return a.parents('[data-role="fieldcontain"]').eq(0)}},".tagstrip *.value":function(a){return a.parents(".tagstrip").eq(0)},"div.redactor_box textarea":function(a){return a.parents("div.redactor_box").eq(0).parent()},".my-tags,.hasDatepicker,.ui-widget,input,textarea,select,button":{".my-cleditor":function(a){return a.parents("div.cleditorMain").eq(0).parent()},"":function(b){var c=b[0].parentNode,d=c.nodeName;return/^(div|span|a|p|form|fieldset|li|ul|td|th|h\d)$/i.test(d)?a(c):b.parents("div,span,a,p,form,fieldset,li,ul,td,th,h1,h2,h3,h4,h5,h6").eq(0)}},"":function(a){return a}},offon:{".ace_editor":function(a,b){ace.edit(b[0]).setReadOnly(a)},".ui-selectable":function(a,b){y(b,"selectable",a)},".ui-slider":function(a,b){y(b,"slider",a)},".ui-draggable":function(a,b){y(b,"draggable",a)},".ui-buttonset":function(a,b){y(b,"buttonset",a)},".hasDatepicker":function(a,b){y(b,"datepicker",a)},".my-form":function(a,b){b.my("disabled",!!a)},"div.select2-container+input,div.select2-container+select":function(a,b){y(b,"select2",a)},".my-cleditor":function(a,b){b.cleditor()[0].disable(!!a)},"":function(a,b){b.attr("disabled",!!a)}},destroy:{".hasDatepicker":function(a){a.datepicker("destroy")},".ui-slider":function(a){a.slider("destroy")},".ui-sortable":{".my-form-list":function(b){b.find(">.my-form").each(function(){a(this).my("remove")}),b.removeClass("my-form-list"),b.sortable("destroy")},"":function(a){a.sortable("destroy")}},".my-form-list":function(b){b.find(">.my-form").each(function(){a(this).my("remove")})},".ui-draggable":function(a){a.draggable("destroy")},".my-redactor-8":function(a){a.destroyEditor(),a.removeClass("my-redactor-8")},"div.select2-container+input,div.select2-container+select":function(a){a.select2("destroy")},".my-form":function(a){a.my("remove")},textarea:{".my-codemirror":function(a){a[0].nextSibling.CodeMirror.toTextArea(),a.removeClass("my-codemirror")}}}};Bb.params={container:function(a){return M(a,Bb.containers)(a)},change:vb,recalcDepth:2,delay:0,strict:!1,restyle:-1,locale:X,messages:Object.map(Bb.msg,function(a,b){return b[X]||b.en}),errorTip:".my-error-tip",errorCss:"my-error",animate:0,effect:function(a,b,c){return b?a.fadeIn(c):(a.fadeOut(c),void 0)},remember:0,silent:!1,history:{},historyDelay:100,loader:function(a){var b=tb(),c=yb(a+"");return c?b.resolve(c):b.reject(null),b.promise()},ajaxTimeout:1e4};var Cb={con:c,clone:function(a){return a.clone?a.clone():a},indom:e,jquix:y,overlap:n,patch:m,kickoff:o,sdbmCode:l,tojson:function(){function a(a){return 10>a?"0"+a:a}function b(a,f,g){var h,i,j,k,l=0,m=f||0,n=d;switch(g&&hb(g)&&(l=String(g).length,n=String(g).repeat(10)),(typeof a).substr(0,3)){case"str":return e(a).replace(/<\/scri/gi,"<\\u002fscri");case"num":return isFinite(a)?""+String(a):"null";case"boo":case"nul":return String(a);case"fun":return e(c(a.toString()).replace(/<\/scri/gi,"<\\u002fscri"));case"obj":if(!a)return"null";if(typeof a.toJSON===cb)return b(a.toJSON(),m+(g?1:0),g);if(h=[],fb(a)){for(i=0;iJ.pos.ph-p?J.pos.vy=J.pos.ph-p-J.height:J.pos.vy
');var c="",d=a("style#my-modal-style-"+J.cid);("top"==J.nose||"bottom"==J.nose)&&(c+="div.my-modal-"+J.cid+".nose-"+J.nose+":before {left:"+(J.pos.ox-J.pos.px+J.pos.ow/2-J.pos.vx)+"px!important;}",d.text(c)),("left"==J.nose||"right"==J.nose)&&(c+="div.my-modal-"+J.cid+".nose-"+J.nose+":before {top:"+(J.pos.oy-J.pos.py+J.pos.oh/2-J.pos.vy)+"px!important;}",d.text(c))}J.screen?J.global?(y.css({top:0,left:0,width:"100%",height:"100%",display:"block",position:"fixed","z-index":J.z-1}),l(J.screen)&&y.css({background:J.screen?J.screen:"rgba(25, 39, 59, 0.88)"})):y.css({top:0,left:0,position:"absolute",width:J.pos.pw+"px",height:J.pos.ph+"px",display:"block",background:l(J.screen)?J.screen:"rgba(40,80,120,0.6)","z-index":J.z-1}):y.size()&&y.hide(),J.height>J.pos.wh?(v.height(J.pos.wh-30),w.css({"overflow-y":a.browser.webkit?"overlay":"scroll"})):w.css({"overflow-y":"none"}),v.animate({top:J.pos.vy+"px",opacity:"1"},J.animate)}function t(){try{w.my("remove")}catch(b){}try{x.data("modals")[J.cid]=null}catch(b){}w.parent().off(".my").remove(),y.off(".my"+J.cid),J.screen&&function(a){a&&g||y.hide(),a&&!g&&y.css({background:"rgba(25, 39, 59, 0.88)"})}.delay(50,J.global),J.global&&(g=!1,a("body")[0].style.overflow=null)}function u(a){try{H(null,null)}catch(b){}(function(){C.reject(a)}).delay(0)}if(d){if(void 0===e&&void 0===p&&void 0===q)return d.call(this);if(m(e)&&(e.hasOwnProperty("backdrop")||e.hasOwnProperty("keyborad")||e.hasOwnProperty("show")))return d.call(this,e,p);if(l(e)&&/^(toggle|show|hide|handleUpdate)$/.test(e))return d.call(this,e,p)}var v,w,x,y,z,A,B,C=a.Deferred(),D={},E=this,F=0,G=0,H=o(p)?p:function(){return!1},I=m(e)?e:{},J=E.data("modal");if(h(E,C.promise()),J){if(null==e||k(e)){if(w=J.form,y=J.bg,x=J.root,H=J.done,A=w.my("data"),B=!1,e){try{H.call(w.my("manifest"),null,null)}catch(K){}try{j(w)?t():""}catch(K){}if(E.removeData("modal"),i[J.cid])try{i[J.cid].reject("Cancelled")}catch(K){}delete i[J.cid],J=null}else{try{B=H.call(w.my("manifest"),w.my("valid")?null:w.my("errors"),A)}catch(K){}if(!B){try{j(w)?t():""}catch(K){}E.removeData("modal"),function(){i[J.cid]&&i[J.cid].resolve(A),delete i[J.cid],J=null}.delay(0)}}return E}if(I)return u("Locked"),E}return E.is(":visible")?(I=b(D,e,{}))?I.global&&g?(u("Locked"),E):(J=h({type:"DOM",source:"manifest",form:null,modal:null,root:null,bgroot:null,caller:E,manifest:{},data:{},global:!1,screen:!1,drag:!1,focus:!0,close:!0,silent:!0,esc:!1,enter:!1,bound:!1,hardClose:!0,nose:"",width:q||300,height:null,x:"0",y:"0",z:"1901",background:"white",css:"",animate:200},I,{promise:C.promise(),cid:Number.random(268435456,4294967295).toString(16)}),J.done=o(J.done)?J.done:H,l(J.align)&&J.align&&(J.x=(J.align.match(/(left|right):\-?\d+(\.\d+)?(%|px)?/g)||["0"])[0],J.y=(J.align.match(/(top|bottom):\-?\d+(\.\d+)?(%|px)?/g)||["0"])[0]),J.width=1*(a.my.f.getref(l(J.manifest)?a.my.cache(J.manifest):J.manifest,"params.width")||J.width),J.type="DOM",E.hasClass("my-form")?(J.type="form",J.root=J.root||E):E.data("my")?(J.type="control",J.root=J.root||E.my().root):(J.root=J.root||E.parents(".my-form").eq(0),J.root.size()||(J.root=a(f))),J.global?(J.root=a(f),J.bgroot=a(c||f)):J.bgroot=J.root,x=J.root,x.data("modals")||x.data("modals",{}),r(),v=a('
'),J.root.find(">.my-modal").size()?v.insertAfter(J.root.find(">.my-modal").last()):v.prependTo(J.root),v.addClass("my-modal-"+J.cid),F=v.outerWidth(),G=v.outerHeight(),v.hide(),v.html(''),w=v.find(".my-modal-form"),J.close&&(z=a(l(J.close)?J.close:'