J.pos.pw-p?J.pos.vx=J.pos.pw-p-J.width-F:J.pos.vxJ.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:y.parent().width()+"px",height:y.parent().height()+"px",display:"block",background:l(J.screen)?J.screen:"rgba(40,80,120,0.6)","z-index":J.z-1}):y.length&&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.length||(J.root=a(f))),J.global?(J.root=a(f),J.bgroot=a(c||f)):J.bgroot=J.bgroot?a(J.bgroot):J.root,x=J.root,x.data("modals")||x.data("modals",{}),r(),v=a('
'),J.root.find(">.my-modal").length?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:'×
').prependTo(v).on("click.my",function(){E.modal(J.hardClose)}),z.css({"z-index":("+"===(J.z+"").to(1)?"+":"")+(1*J.z+1)})),y=J.bgroot.find(">.my-modal-screen"),J.screen&&(y.length||(y=a('').prependTo(J.bgroot)),J.esc&&y.on("click.my"+J.cid,function(){E.modal(!0)})),E.data("modal",J),J.silent&&v.on("change.my",function(){return!1}),v.css({display:"block",height:"none",opacity:"0.005","z-index":J.z,width:"auto"}),v.css(J.global?{position:"fixed",left:"50%",top:J.pos.vy+"px",display:"block",height:"none",opacity:"0.005","z-index":J.z,width:"auto","margin-left":"-"+((J.width+F)/2).round(0)+"px"}:{position:"absolute",left:J.pos.vx+"px",top:J.pos.vy+"px",display:"block",height:"none",opacity:"0.005","z-index":J.z,width:"auto"}),w.my(J.manifest,J.data).then(function(){var b,c,d,e,f;if(h(J,{form:w,bg:y,cancel:function(){E.modal(!0)},commit:function(){E.modal()}}),v.data("modal",J),J.height=v.outerHeight(),"manifest"!==J.source&&(J.width=v.width()),r(),v.css({top:J.pos.vy+"px"}),s(!0),v.removeClass("my-modal-init"),x.data("modals")[J.cid]=J,i[J.cid]=C,w.on("commit.my",function(){return J.commit.delay(50),!1}).on("cancel.my",function(){return J.cancel.delay(50),!1}),v.on("layout.my",function(){s()}.debounce(50)),J.global&&(g=E,a("body").css({overflow:"hidden"})),J.global||!J.esc&&!J.enter||w.on("keydown.my",function(b){var c=b.keyCode;return 27==c&&J.esc?(J.cancel(),!1):13==c&&J.enter&&!a(b.target).is("textarea")?(J.commit.delay(50),!1):void 0}),J.focus===!0){e=!1,f=J.manifest.ui;for(d in f)e||(c=w.find(d),c.length&&c.is("input, textarea","button")&&(e=!0,c.focus()))}else l(J.focus)&&w.find(J.focus).focus();if(b=w.find("img").filter(function(){return""!=a(this).attr("src")}),b.length){var j=function(){"manifest"!==J.source&&v.css({width:"auto"}),s()}.after(b.length);b.each(function(){a(this).bind("load",j)})}J.drag&&a.fn.draggable&&(l(J.drag)?v.draggable({handle:J.drag}):v.draggable(),J.nose&&v.on("dragstart.my",function(){v.removeClass("nose-"+J.nose)})),v.on("mousedown.my",function(b){var c,d=[],e=a(b.currentTarget),f=e.parent(),g=+e.css("z-index"),h=g;f.length&&(c=f.find(">.my-modal").each(function(c,e){var f=+a(e).css("z-index");e!=b.currentTarget&&f>=g&&d.push([f,a(e)]),f>h&&(h=f)}),d.forEach(function(a){a[1].css("z-index",a[0]-1+"")}),e.css("z-index",h+""))}),C.notify("Ready")}).fail(function(a){try{t()}catch(b){}E.data("modal",null),C.reject(a)}),E):(u("Invalid data"),E):(u("Object must be visible"),E)}}(jQuery);
\ No newline at end of file
diff --git a/Release/jquery.my.last.js b/Release/jquery.my.last.js
index 757ffc7..499f23d 100644
--- a/Release/jquery.my.last.js
+++ b/Release/jquery.my.last.js
@@ -1,6 +1,5 @@
-/* jQuery.my 1.2.8, © ermouth
+/* jQuery.my 1.2.9, © ermouth
* Requires jQuery 2.0+, SugarJS 1.3.9-1.4.x
* More details at jquerymy.com */
-/*jQuery.my 1.2.8, © ermouth*/
-!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*";if(/^<.+>$/.test(x.list)?f=x.list:i=x.list||i,!f){var l=d.find(i);f="",l.length&&(f=a(f).append(l.eq(0).clone(!0)).html(),l.eq(0).remove())}d.data("formlist")||d.data("formlist",{}),d.data("formlist").generator={manifest:s,delay:(x.delay||v.delay||10)/1.3,template:f,selector:i,parent:A,bind:x.bind,merge:lb(x.merge)?x.merge.bind(A):x.merge?n:!1,hash:lb(x.hash)?x.hash.bind(A):hb(x.hash)?k.fill(void 0,x.hash):fb(x.hash)?m.fill(void 0,x.hash.slice(0)):null,id:lb(x.id)?x.id.bind(A):hb(x.id)?k.fill(void 0,x.id):fb(x.id)?m.fill(void 0,x.id.slice(0)):null,ext:!(!x.id&&!x.hash),stamp:0},d.on("insert.my",function(b,c){b.stopPropagation();var d={what:void 0,where:0};null==c?d.where=1e6:ib(c)?pb(d,c):(hb(c)||jb(c))&&(d.where=c),a(b.target).my("insert",d.where,d.what)}),d.on("remove.my",function(b){b.stopPropagation(),a(b.target).my("remove")})}else try{b=J.call(d,q(A,s),ib(e)?e:void 0)}catch(p){j("$.my subform init of "+g+" failed: "+p.message,p.stack)}}mb(b)?b.then(o,function(a,b){j("Init of subform "+g+" failed with error: "+a,b)}):o()}function j(a,c){b(a,c),y&&y.reject(a,c)}function k(a,b){var c=h(a,b)||"";return"string"==typeof c?c:l(c)}function m(a,b){return l(C(a,b))}function o(){d.each(function(){var b,c,h,i=a(this),j=!1;if("TEXTAREA"==i[0].nodeName&&(h=i[0].nextSibling,c=h&&h.CodeMirror?h.CodeMirror:null,c&&i.addClass("my-codemirror")),b=x.events||M(i,Bb.events),i.hasClass("my-form")?sb(i.data("my"),{dui:x,root:e,selector:g,dparams:v,devents:b,ddata:u.data,container:v.container(i),derrors:u.errors,single:!0}):(i.data("my",{events:b,selector:g,initial:r,previous:r,root:e,container:v.container(i),id:u.id,ui:x,data:u.data,params:v,errors:u.errors,single:1==B}),f._update=x.delay?N.debounce(x.delay):vb,j=!0),j)if(i.cleditor&&i.parent().hasClass("cleditorMain")){var k=i.cleditor()[0];if(k&&k.$frame&&k.$frame[0]){i.addClass("my-cleditor"),sb(i.data("my"),{container:v.container(i)});var l,m=function(a){i.val(a).trigger(db)},n=Number.random(1e5,1e6-1);a(k.$frame[0]).attr("id","cleditCool"+n),l=document.frames?document.frames["cleditCool"+n].document:a("#cleditCool"+n)[0].contentWindow.document;var o=a(l).find("body");a(l).bind("keyup.my",function(){m(a(this).find("body").html())}),i.parent().find("div.cleditorToolbar").bind("click.my mouseup.my",function(){m(o.html())}),a("body").on("click","div.cleditorPopup",function(){m(o.html())})}}else if(i.is("div.redactor_box textarea")){var p,q="my-redactor-9";try{p=i.getEditor(),q="my-redactor-8"}catch(s){p=i.redactor("getEditor")}p&&(i.addClass(q),p.bind("input.my keyup.my blur.my",function(a){a.trigger("redactor")}.fill(i)))}else i.hasClass("ace_editor")?ace.edit(d[0]).on(db,function(a){a.trigger("ace")}.fill(i)):c&&c.on(db,function(a){a.trigger("codemirror")}.fill(i));i.my()._changed=w.debounce(t),i.my()._recalc=H.debounce(t),i.bind(b,function(a){a.type==db&&a.stopPropagation(),j&&(u.locktill=zb()+f.delay),i.my()._changed(i,e,f,v)}),/check(\.my)?/.test(b+"")||i.on("check.my",function(){return i.my()._changed(i,e,f,v,!0),!1}),j||i.off("redraw.my"),i.on("recalc.my, redraw.my",function(a){a.stopPropagation(),i.my()._recalc(i,e,f,v)})}),y&&y.resolve()}var p,r,s,t,u=e.my(),v=(u||{}).params,x=f,y=null,z=0,A=u.manifest,B=0|d.length;return u?(t=f.delay,B?(x.init!=vb&&(p=G(A,x.init,d,u)),mb(p)?(z+=1,y=tb(),p.then(i,function(a,b){j("Init of "+g+" failed: "+a,b)})):i()):c("Not found "+g+" selector.",e),y):(b("Failed to find $root building "+g+" selector."),null)}function v(c,d){ib(d)&&d.channel&&d.message&&c.find(".my-listen-"+l(d.channel)).each(function(){var c,e=a(this),f=e.data("my"),g=void 0;if(f&&f.ui.listen&&lb(f.ui.listen[d.channel])){c=f.ui.listen[d.channel];try{g=c.call(f.manifest||f.root.my().manifest,f.data,d.message,e)}catch(h){b("Listener failed",h.message,h.stack)}void 0!==g&&(null===g?e.trigger("check"):g&&e.trigger("recalc"))}})}function w(a,b,c,d,e){{var f,g=a.data("my");b.data("my")}g&&(g.disabled?g.ddata||N(a,vb,c.recalcDepth||d.recalcDepth):(A(g.ddata||g.data,g.dparams||g.params),e||(f=g.single?a:b.find(g.selector)),N(a,e?vb:z(f,vb),c.recalcDepth||d.recalcDepth),d.change&&d.change.call(a)))}function x(b,c,d){var e=d.compact(),f=e.replace(/:disabled/g,""),g=f!==e,h="self:"===f.to(5);return h&&(f=f.replace(/^self:/g,"")),c.each(function(){var d=a(this),e=d.my(),i=!h&&e?e.container:d;i.toggleClass(f,!!b),g&&void 0!==e&&!!b!=!!e.disabled&&(d.my().disabled=!!b,e._disable||(d.my()._disable=M(c,Bb.offon).fill(void 0,c)),e._disable(!!b))}),c}function y(a,b,c){return a[b](c?"disable":"enable")}function z(a,b){var c,d,e=a.data("myval");return e||(d=M(a,Bb.vals),lb(d)&&(c=d(a,vb),void 0===c?a.data("myval",function(a,b){return vb!=b&&d(a,b),a.val()}.fill(a,void 0)):a.data("myval",d.fill(a,void 0))),e=a.data("myval")),lb(e)?(c=e(),(c!==b&&(0==b||0==c)||c!=b||ib(b))&&(c=e(b)),c):vb}function A(a,b,c,d){var e,f,g,h,i,j,k,l,m,n=b;if(!ib(n)||isNaN(h=n.remember)||!ib(e=n.history))return vb;if(ib(a)&&h){if(j=qb(a,!0),k=zb(),g=rb(e).sort(),g.length&&(k-g.last()=2*h){for(m={},f=h;2*h>f;f++)m[g[f]]=e[g[f]];b.history=m}return d||n.form.trigger(db),n.history[g.last()]}if(!isNaN(a)||a===vb){if(i=parseInt(a)||0,0>i)return vb;if(g=rb(e).sort(),i>=g.length&&(i=g.length-1),l=qb(n.history[g[g.length-i-1]],!0),c){for(m={},f=0;f=i;i++)if(i===h){if(d)return vb!=b?e[f[i]]=b:void 0===e[f[i]]&&(e[f[i]]=vb),e[f[i]];e[f[i]]=b}else 0===i?(e=a[f[0]],g=a):(g=g[f[i-1]],e=e[f[i]]),(null==e||!ib(e)&&(fb(e)&&!isNaN(f[i+1])&&+f[i]>-1))&&(e=g[f[i]]={});return a}function F(a,b,c){var e=ib(b)?b:null;return Object.each(a,function(b,c){var d=typeof c;/^str|^fu/.test(d)&&(a[b]={bind:c})}),Object.each(a,function(b,f){var g,i,k,l=[],m=[],n=/\s?[,;]\s?/;f.recalc&&(hb(f.recalc)?l=f.recalc.split(n):fb(f.recalc)&&(l=f.recalc),l=l.compact(!0).unique()),l.length&&(a[b].recalc=l),null==f.bind&&(f.bind=function(){});var o;if(f.listen&&(o=j(f.listen),f.listen=Object.size(o)?o:void 0),d(f,"watch"))for(hb(f.watch)?m=f.watch.split(n):fb(f.watch)&&(m=f.watch.slice(0)),m=m.compact(!0).unique(),k=0;ki&&h.resolve()}var d,e,f,g=!1,h=tb(),i=a.length;for(e=0;i>e;e++)d=a[e],f=hb(d.ajax)?w.loader:xb,f(d.ajax).then(function(a,d){eb.test(d.ref)&&(null!=a?sb(!0,b,D(a,d.ref.from(5))):(g=!0,v.push("Invalid data for ‘"+d.ref+"’ resource."))),c()}.fill(void 0,d)).fail(function(a,b){v.push("Failed to load ‘"+b.ref+"’ resource."),g=!0,c()}.fill(void 0,d));return h.promise()}function i(a){var c=!1;return eb.test(a)?null!=h(b,a.from(5))&&(c=!0):null!=h(window,a)&&(c=!0),c}function j(a){for(var b in a)a[b]===!1&&(a[b]=i(b));return a}var k,l,m,n,o,p,q,r,s=tb(),t=[],u={},v=[],w=sb(!0,{ajaxTimeout:1e4,loader:Bb.params.loader},c||{}),x={ref:null,ajax:{type:"GET",async:!0,timeout:w.ajaxTimeout}};if(ib(b))if(fb(b.require)){for(n=b.require,k=0;k'+f+""}!$.style||b&&!rb.is(":visible")||(R=K(rb,$),R&&R[0].length&&!b&&(U=a("style#"+S),U.length||(U=a(c(R[0],S)).appendTo(a("body"))),U.data("count",1*U.data("count")+1),rb.data("my").style=U),R&&R[1].length&&(Y=a("style#"+T),Y.length?b&&(a(c(R[1],T)).replaceAll(Y),Y=a("style#"+T)):(Y=a(c(R[1],T)).appendTo(a("body")),P.restyle>-1&&!ob[I]&&(ob[I]=function(){p(!0)}.debounce(P.restyle)),rb.data("my").restyle=p.fill(!0).debounce(0)),rb.data("my").localStyle=Y,b||rb.addClass("my-restyle")))}function q(){var a,b,c=!0;if(b=s($),hb(b))A("Error decoding base64 to local Blob/URL",b),c=!1;else{if(V)for(a=0;a*").clone();try{Z=G($,Q.init,rb,Q)}catch(b){return A(hb(b)?b:b.message,b.stack),rb}}if(mb(Z)?Z.then(function(){w()},function(a,b){A(a,b)}):w(),!gb){if(!rb.my())return A("Internal error initializing controls.",""),rb;rb.data("my").initial=sb(!0,{},ab),a.mobile&&a.mobile.changePage(a.mobile.activePage)}}function w(){function a(a){gb||(b[a]=z(rb.find(a),vb),d-=1,.5>d&&x(b))}var b={},c=Object.keys(N),d=c.length;0===d?y():(rb.addClass(kb),c.forEach(function(b){if(!gb){var c=rb.find(b),d=u(c,rb,N[b],b);qb[b]=c,mb(d)?d.then(a.fill(b)).fail(function(a,c){A("Error building "+b+", "+a,c)}):gb||a(b)}}))}function x(a){var c,d,e,f,g;for(g in N){if(gb)return;if(c=N[g],e=qb[g],f=e.length){c.listen&&(db[g]=e.eq(0));try{d=t(ab,vb,c,e),d==vb&&a[g]!=vb&&void 0!==d&&t(ab,a[g],c,e)}catch(h){b("Transient fail linking "+g+" of form $('.my-form-"+I+"')",h.message,h.stack)}try{d!=vb&&z(e,d),e.eq(0).trigger("check.my")}catch(h){A("Error linking "+g,h.message,h.stack)}}}y()}function y(){rb.removeClass(kb),rb.on("recalc.my, redraw.my",function(a){a.stopPropagation(),rb.my("redraw")}),pb=null,eb.resolve(ab)}function A(a,c){var d;if(gb=!0,b("Form "+H+" failed to initialize.",a,c),Object.keys(qb).forEach(function(a){delete qb[a]}),rb.removeClass(kb),d=jb(a,c),hb(d)||ib(d)&&d.jquery?rb.html(d):d===!0&&rb.html(pb),P.silent)eb.resolve(ab);else{if(!rb.my().ddata){if(rb.removeData("my"),rb.removeClass("my-form"),U)if("1"==U.data("count"))try{U.remove()}catch(e){}else U.data("count",U.data("count")-1);if(Y)try{delete ob[I],Y.remove()}catch(e){}}eb.reject("Form "+H+" failed to initialize: "+a,c)}}var C,E,H,I,J,M,N,P,Q,R,S,T,U,Y,Z,$={},ab={},bb=null,cb=[],db={},eb=tb(),gb=!1,jb=function(){},kb="my-form-init",nb="std",pb="",qb={};if(hb(d)){if(C=yb(d),!C)return eb.reject("No manifest with id "+d+" found in repo."),eb.promise();ib(f)&&ib(e)?(C=sb(C,e),E=f):E=e,nb="repo"}else C=d,E=e;if(!C)return this;Q=ib(E)&&"repo"!=nb?sb(!0,{},C):C;var rb=this.eq(0),ub=rb.my();return ib(ub)&&ub.id&&ub.ui?(c("jQuery.my is already bound.",rb),rb.my("ui",Q.ui),rb.my(_,Q.data),eb.resolve(rb.my(_)).promise()):(P=Q.params||{},P.strict||lb(Q.init)||(P=sb(!0,{},P),O(P)),P=sb(!0,{},Bb.params,P),eb.fail(function(){rb.removeClass(T+" "+S)}),sb(rb,eb.promise()),ib(E)?(ab=m(E,Q.data||{}),Q.data=ab):ab=Q.data||{},$.data=ab,rb.data("my",{data:ab,params:P,promise:eb.promise(),locktill:0}),rb.addClass(kb),Q.inherit&&i(Q),fb(Q.require)?Ab(Q,P).then(g).fail(function(a){o(),A("Linker of the ‘require’ property failed.",a)}):g(),eb.then(n),rb)}function K(a,b){function c(e,f,g,h){var i,j,k,l,m,n=e,o=/@/.test(f),p=f.split("@")[0],q=lb(n);if(o&&(q?h:g).push("@"+f.split("@")[1].trim()+" {"),hb(n)&&(/[\r\n]/.test(n)||n.split("}",3).length>2?n=Cb.css2json(n):g.push(p+(/\{/.test(n)?n:"{"+n+"}"))),fb(n)&&n.length)for(i=0;ie)return d=i,e=g,void 0;j==$&&c(a,i,g+1)}vb!=b[""]&&typeof b[""]!=$&&g>e&&(d=b[""],e=g)}var d=vb,e=0,f="";return c(a,b,1),d}function N(a,c,d){var e,f,g,h,i,j,k,l,m,n,o,p,q=!1,r=!1,s=a,u=s.my(),v="";if(u){if(m=u.selector,n=u.root,n.hasClass("my-form-init"))return{};if(o=n.find(m),p=n.my().ui,q=a.hasClass("my-form"),q?(f=a,g=u.ddata,h=u.dui,i=u.dparams):(f=u.container,g=u.data,h=u.ui,i=u.params),h.bind!=vb){if(j=wb(c)?c:z(o,t(g,vb,h,o)),vb!=h.check){v="Unknown error";try{v=T(g,j,h,o)}catch(w){b("Error "+w.message+" in .check validator for "+m,n,w.stack)}}var y=i.errorCss,A="ui-state-error";try{vb!=c&&(j=z(o,t(g,c,h,o)))}catch(w){v=i.messages.formError||"Error"}if(vb!=h.check)if(r=a.hasClass("my-form-list"),""==v&&(q||f.hasClass(y)))q?u.derrors[m]="":u.errors[m]="",f.removeClass(y),f.attr("title")&&f.attr("title",""),q||r||i.effect(f.find(i.errorTip),!1,i.animate/2),s.removeClass(A),s.find(".ui-widget").removeClass(A);else if(v){if(q)u.derrors[m]=v;else if(r)u.errors[m]=v;else{f.addClass(y),u.errors[m]=v;var B=f.find(i.errorTip).eq(0);B.length?i.effect(B.addClass(y).html(hb(v)?v:"Error"),!0,i.animate):f.attr("title",(hb(v)?v:"Error").stripTags())}s.hasClass("hasDatepicker")&&(s.is("input")?s.addClass(A):s.find(".ui-widget").addClass(A)),s.hasClass("ui-slider")&&s.addClass(A)}}var C=c==vb?j:c;if(h.css)for(k in h.css)l=h.css[k],kb(l)?x(l.test(C),o,k):lb(l)&&x(l.call(n.my().manifest,g,C,o),o,k);var e,D,E=h.recalc,F=[],G={};if(d&&h.recalc&&n.my()){for(p=n.my().ui,e=0;e-1?"":n;case"s":return c==k?"":n;case"o":return k[c]?"":n;case"b":return e.hasClass("my-form-list")?(h=e.data("listSrc")||e.data("my").listSrc||">*",j={},e.find(h).filter("*:not(.ui-sortable-placeholder)").each(function(b){var c=a(this);c.data("my")&&!c.my("valid")&&(j[b]=c.my("errors"))}),j):e.hasClass("my-form")&&k?e.my("valid")?"":e.my("errors"):""}return l.formError||"Error"}return""}var U="1.2.8",V=window.URL||window.webkitURL,W=!document.addEventListener,X=((window.navigator.language||window.navigator.userLanguage||"en")+"").split("-")[0].toLowerCase(),Y="{yyyy}-{MM}-{dd}",Z="{HH}:{mm}",$="object",_="data",ab="array",bb="string",cb="function",db="change",eb=/^this\./,fb=Object.isArray,gb=Object.isBoolean,hb=Object.isString,ib=Object.isObject,jb=Object.isNumber,kb=Object.isRegExp,lb=Object.isFunction,mb=function(a){return null!=a&&typeof a==$&&lb(a.then)},nb=h(a,"my.f.repo")?a.my.f.repo():{_src:{},_name:"Default manifest cache"},ob=h(a,"my.f.restyles")?a.my.f.restyles():{},pb=Object.merge,qb=Object.clone,rb=Object.keys,sb=a.extend,tb=a.Deferred,ub=a.type,vb=null,wb=function(a){return null!==a&&void 0!==a},xb=a.ajax,yb=p,zb=Date.now,Ab=I,Bb={vals:{".my-form":function(a,b){if(a&&a.my){var c=a.my(_);return Object.equal(c,b)?c:a.my(_,b,!0)}return b||vb},".hasDatepicker":function(a,b){wb(b)&&a.datepicker("setDate",""==b?b:Date.create(b));var c=a.datepicker("getDate");return c?c.format(Y):""},".my-tags":function(a,b){return wb(b)&&(hb(b)||jb(b)?a.tags(_,[b+""]):fb(b)&&a.tags(_,b)),a.tags(_)},".ui-draggable":function(a,b){if(wb(b)&&ib(b)){var c={};isNaN(b.left)||(c.left=Number(b.left).ceil(2)+"px"),isNaN(b.top)||(c.top=Number(b.top).ceil(2)+"px"),(c.left||c.top)&&a.css(c)}var d=a.position();return{left:b&&!isNaN(b.left)?(1*b.left).ceil(2):d.left.ceil(2),top:b&&!isNaN(b.top)?(1*b.top).ceil(2):d.top.ceil(2)}},".my-form-list":function(b,c){function e(){var c,d,e=a(this),f=e.data("my");f&&(c=e.data("formlist"),d=c.index,c.hash=w(f.data,d)+"",c.oid=x!==w?x(f.data,d)+"":c.hash),b.trigger("check.my")}function f(a){a.data("my").locktill+z/1.3.my-form",t=!!r.merge,u=r.template||"",v=/\{/.test(u),w=r.hash||l,x=r.id||l,y=r.ext,z=r.delay||50,A="ui-sortable",B="."+A+"-placeholder",C=b.is("."+A),D=!!b.children(B).length,E=[],F=[],G=zb(),H=b.find(C?b.sortable("option","items"):s);if(wb(c)&&fb(c)){if(D)return c;if(i=[],j={},H.each(function(){var b,c=a(this),d=c.data("my");d&&(i.push(d.data),!t&&(b=c.data("formlist"))&&(j[b.oid]=d.data))}),m=g(i,c,"=="),!m){var I=[],K=[],L={},M={};for(F=[],h=0;h1.4*z||G-r.stamp>100||!r.stashed||r.stashed.length!==H.length-(D?1:0)){D&&(o=b.find(">."+A+"-helper"));var N=0;for(H.each(function(b,c){var d,e,f,g=a(c),h=!1;D&&g.hasClass(A+"-helper")||(D&&g.hasClass(A+"-placeholder")&&(g=o),d=g.data("my"),e=g.data("formlist"),d&&e&&(E.push(d.data),N!=e.index&&(e.index=N,h=!0),y&&(f=w(d.data,N)+"",f!==e.hash&&(e.hash=f,h=!0)),N+=1,h&&F.push(g)))}),h=0;h-1){var f=b.eq(d);f.is(":checked")||(f.prop("checked",!0),e&&f.checkboxradio("refresh"))}else e||b.each(function(){a(this).prop("checked",!1)})}if(-1==d)for(var g=0;gForm 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:"Обязательное поле"}},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;ii;i++)h[i]=e.charCodeAt(i);return d=new Blob([h],{type:c||"application/octet-stream"}),lb(b)?(b(d),void 0):d},base64:function(b,c,d){var e=null,f=hb(b)?b:a.my.tojson(b),g=hb(d)?"data:"+d+";base64,":"";if(c){try{e=decodeURIComponent(escape(window.atob(f)))}catch(h){e=null}if(null!==e&&/(^".*"$)|(^\[.*\]$)|(^\{.*\}$)/.test(e))try{e=Cb.fromjson(e)}catch(h){e=null}return e}return g+window.btoa((d===!0?"":"")+unescape(encodeURIComponent(f)))},_s2css:K,css2json:function(a){var b="",c=(a+"").replace(/\/\*[\s\S]+\*\//gm,"").replace(/@charset[^;]+;/gim,"").replace(/[\n\t\s]+/g," ").replace(/\s*@media[^{]*\{/g,function(a){return a.to(-1).trim()+"ᴥ"}).replace(/\}/g,"}ᴥ").replace(/^\n+/g,"").replace(/[\n\s]+$/g,"").split("ᴥ").compact(!0).reduce(function(a,c){var d,e,f,g=c.trim();return"}"==g?b="":/^[^{]+\{[^\}]+\}$/.test(g)?(d=g.to(-1).split("{"),e=" "+d[0].trim(),f=d[1].trim(),";"!=f.last()&&(f+=";"),b?a[b][e]=(a[b][e]||"")+f:a[e]=(a[e]||"")+f):/^@media/.test(g)&&(a[g]={},b=g),a},{});return c}},Db={container:function(a){return M(a,Bb.containers)(a)},data:function(a,b){var c=this;return ib(a)&&(c.my().data=n(c.my().data,a),this.my("redraw",b)),c.my().data},disabled:function(a){var b,c,d,e,f=this,g=f.my();if(!g)return void 0;if(a==vb)return g.disabled;if(a){for(c in g.ui)b=f.find(c).eq(0),d=b.my(),d&&(d.predisabled=d.disabled),x(!0,b,":disabled");f.addClass("my-disabled")}else{for(c in g.ui)b=f.find(c).eq(0),d=b.my(),e=!1,d&&d.predisabled&&(e=!0),x(e,b,":disabled");f.removeClass("my-disabled"),f.my("redraw")}},errors:function(){var b=a(this).my().errors,c={};for(var d in b)b[d]&&hb(b[d])&&(c[d]=b[d]),ib(b[d])&&rb(b[d]).length&&(c[d]=b[d]);return c},find:function(a){var b=this,c=b.my();return c&&c.root&&(b=c.root),b.find(a)},history:function(a,b){return A(a,this.my().params,b)},id:function(a,b){if(hb(a))return yb(a,b);var c=this.my();return c&&c.id?c.id:vb},index:function(){var a=this.my().root&&!this.my().ddata?this.my().root:this;return(a.data("formlist")||{}).index},indom:function(){return e(this)},init:J,insert:function(a,b){var c,d,e=this.hasClass("my-form-list")?this:this.my().root||this,f=e.hasClass("my-form-list")?e:e.parent(".my-form-list"),g=(e.data("formlist")||{}).index,i=b,j=f.data("formlist").generator;if(null==g&&(g=0),c=eb.test(j.bind)?h(f.my().manifest,j.bind.replace(eb,"")):h(f.my().data,j.bind),!ib(i))if(ib(j.manifest))i=qb(j.manifest.data,!0)||{};else{if(f===e)throw"No data to insert, cannot guess when manifest is a function.";i=qb(e.my().manifest.data,!0)}if("before"===a)d=g;else if("after"===a)d=g+1;else{if(isNaN(a))throw"Invalid position for insertion";d=(1*a).clamp(0,c.length)}c.add(i,d),f.trigger("redraw")},manifest:function(a){return"json"==a?Cb.tojson(this.my().manifest):this.my().manifest},promise:function(a){return lb(a)&&this.my().promise.then(a),this.my().promise},radio:function(a,b){this.trigger("radio",hb(a)?{channel:a,message:b}:a)},redraw:function(a,b){var c=this,d=c.my();return d&&d.ui&&(d.ui.each(function(b){var e=c.find(b);N(e,a?vb:void 0,d.params.recalcDepth),a||(e.is(".my-form")&&e.my("redraw"),e.trigger(e.is(".my-form-list")?"redraw":"check.my"))}),!b&&a&&c.trigger(db)),c},remove:function(a){var b,c,d,e,f,g,h,i,j=this;if(!this.my())return vb;if(this.my().root&&!this.my().ddata&&(j=this.my().root),d=j.my(),f=d.data,h=d.cid,i=d.mid,j.unbind(".my"),ib(d)&&d.manifest&&lb(d.manifest.die))try{d.manifest.die.call(d.manifest,j,d.manifest)}catch(k){}if(b=d.style)if("1"==b.data("count"))try{b.remove()}catch(k){}else b.data("count",b.data("count")-1);if(c=d.localStyle)try{delete ob[h],c.remove()}catch(k){}if(window.URL&&(e=d.locFiles)&&e.length)for(var l=0;lg?vb:(d.params.errors&&d.params.errors.values().compact(!0).length?Object.equal(d.data,d.lastCorrect)||(g+=1):Object.equal(e[f.last()],d.data)&&(g+=1),b=A(g,d.params,!0),b&&(o(c.my().data,b),c.my("redraw")),c.my().data)},val:function(a){return z(this,a)},valid:function(){var b=a(this).my().errors,c=0;for(var d in b)b[d]&&hb(b[d])?c++:ib(b[d])&&rb(b[d]).length&&c++;return!c},version:function(){return U}},Eb=Object.keys(Db);a.my||(a.my={}),sb(a.my,{f:a.extend({},Cb),tojson:Cb.tojson,fromjson:Cb.fromjson,radio:function(b,c){v(a(document),hb(b)?{channel:b,message:c}:b)},rules:Bb,locale:function(a){return hb(a)?(X=a.toLowerCase(),Bb.params.locale=X,void 0):X},ajax:function(a){return lb(a)?xb=a:xb.apply(this,f(arguments,0))},cache:function(a,b){return lb(a)?yb=a:yb(a,b)},now:function(a){return lb(a)?(zb=a,void 0):zb()},require:function(a){return lb(a)?Ab=a:Ab.apply(this,f(arguments,0))},chain:function(){function a(){if(d.length&&e){var b,c=d.shift(),f=function(){a.delay(c[1])}.once();try{b=c[0]()}catch(g){f()}mb(b)?(b.then(f,f),f.delay(c[1])):f()}}var b=1,c=1e3,d=[],e=!1,f=function(e,f,g){d.push([e,f||b,g||c]),a()};return f.delay=function(a){return isNaN(a)||(b=(a-0).clamp(0,1e6)),b},f.timeout=function(a){return isNaN(a)||(c=(a-0).clamp(1,1e6)),c},f.start=function(){e=!0,a()},f.stop=function(){e=!1},f}(),version:function(){return U}}),a.my.version.toString=function(){return U},a.fn.my=function(b){var c;if(void 0===b)return this.data("my");if(hb(b)&&"{"==b.substr(0,1)){try{c=JSON.parse(b)}catch(d){}if(c)return Db.init.apply(this,[c].add(f(arguments,1)))}return hb(b)&&Db[b]?Db[b].apply(this,f(arguments,1)):hb(b)&&yb(b,"exist")?Db.init.apply(this,arguments):typeof b!==$&&b?(a.error("Method "+b+" does not exist on jQuery.my"),void 0):Db.init.apply(this,arguments)},a(window).off(".my").on("radio.my",function(b,c){b.stopPropagation(),v(a(document),c)}).on("resize.my",function(){for(var a in ob)try{ob[a]()}catch(b){}}.debounce(67))}(jQuery),function(a){function b(a,b,c){if(i(b))return a+b;if(j(b))return c=e(!0,c,b),a;if(h(b)&&b.length>1&&i(b[1])){for(var d,k,m,n,o,p,q,r,s=b[0],t="",u=1;u'+(s?"<"+c.labelTag+' class="'+c.labelCss+'" '+(c.label?'style="display:inline-block;width:'+c.label+";margin-left:-"+c.label+'" ':"")+">"+s+""+c.labelTag+">":"")+t+""+c.rowTag+">"),a+t}return a}function c(a){var b=a;if(i(b)&&(b=b.split(/[\s,]/).compact(!0)),h(b)){for(var c={},d=0;d',inp:k+'text" {ext}/>',sli:k+'range" {ext}/>',dat:k+'date" {ext}/>',btn:k+'button" {ext}/>',pwd:k+'password" {ext}/>',but:"",div:"{txt}
",spn:"{txt}",sel:"",mul:'',txt:"",err:' {txt}',msg:'{txt}
',val:function(a){if(!h(a.vals))return"";var b=e({style:"",css:""},a);return b.txt=a.vals.reduce(function(a,b){return a+""+b+" "}," "),'{txt}'.assign(b)},"":"<{_tag} {ext}>{txt}{_tag}>"},txt:{sel:function(a){if(!a.vals)return"";var b=c(a.vals);return Object.keys(b).reduce(function(a,c){return a+'"},"")}},params:{styles:{num:"width:30%;",dat:"width:30%;",inp:"width:100%",pwd:"width:100%",but:"width:30%",txt:"width:100%;max-width:100%;min-height:1px;word-break:break-word;",err:"display:none",msg:"display:none"},alias:{number:"num",date:"dat",slider:"sli",textarea:"txt",input:"inp",span:"spn",select:"select",vals:"val"},row:"",rowTag:"div",rowCss:"my-row",label:"",labelTag:"span",labelCss:"my-label"},defaults:{id:"","class":"",style:"",placeholder:"",value:"",rows:1},attnames:{css:"class",plc:"placeholder",val:"value",txt:"",vals:"",tip:"title"}},m={init:function(b,c){return a(this).html(d(b,c))}};a.my||(a.my={}),a.my.formgen=d,a.fn.formgen=function(b){return i(b)&&m[b]?m[b].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof b&&b?(a.error("Method "+b+" does not exist on jQuery.formgen"),void 0):m.init.apply(this,arguments)}}(jQuery),function(a){function b(b,c,d,e){var f,g,i,j,k,n,o;if("object"==typeof c&&c.jquery)c.is("img")&&(n=c,k=c.attr("alt")||c.attr("title")||c.data("text")||"",g=n[0].naturalWidth||n[0].width,f=n[0].naturalHeight||n[0].height,1>f&&(f=1),1>g&&(g=1),j=a(window).width()-90,i=a(window).height()-90,f>i&&(g=g*(i/f)|0,f=i),g>j&&(g=j,f=f*(j/g)|0),o=300>g?300:g,h(b,{source:"image",manifest:{init:function(a){a.html(this.HTML),a.on("click.my","img:eq(0)",function(){a.trigger("cancel")})},HTML:'',ui:{"img:eq(0)":"img",h4:{bind:"text",css:{hide:function(a,b){return!b}}}}},data:{img:n.attr("src"),text:k},esc:!0,screen:!0,width:e||o,focus:!1,global:!0,z:"1995"},d));else if(m(c)&&c.manifest)h(b,c,d);else{if(!l(c))return null;h(b,{source:"html",manifest:{init:function(a){a.html(this.HTML)},HTML:c,ui:{"div:eq(0)":function(){}}},data:{},esc:!0,focus:!1,width:e},d)}return b}var c,d,e={},f="body",g=!1,h=a.extend,i={},j=a.my.f.indom,k=(Object.isArray,Object.isBoolean),l=Object.isString,m=Object.isObject,n=Object.isNumber,o=(Object.isRegExp,Object.isFunction);if(a.fn.modal&&o(a().emulateTransitionEnd)&&(d=a.fn.modal),a(document).off(".modal"),a(document).on("keydown.modal",function(a){var b,c,d=a.keyCode;if(!1!==g&&(13===d||27===d)){if(c=g.data("modal"),b=c.form,27==d&&(c.esc||Object.equal(b.data("my").initial,b.my("data"))))return g.modal(!0),!1;if(13==d&&c.enter)return function(a){a.modal()}.fill(g).delay(50),!1}}),o(a.my.f.getref(a,"my.modal.parent"))){var p=a.my.f.getref(a,"my.modal.parent")().attr("id");p&&(f="#"+p)}e.modal=function(c,d,e){var h,i={},j=a(f),l=j.find(">.my-modal-proxy"),m={global:!0,screen:!0,done:o(d)?d:void 0,z:"1995"};return k(c)||null==c?l.modal(c):(h=a.Deferred(),b(i,c,m,e)?g?h.reject("Locked").promise():(l.length||(l=a('').prependTo(j),l.css({position:"absolute",top:"0",left:"0",margin:"0",padding:"0",width:"1px",height:"0"})),l.modal(i)):h.reject("Invalid data").promise())},e.modal.loading=function(b){a(f).find(">.my-modal").toggleClass("my-modal-loading",!!b)},e.modal.parent=function(b){return b&&a(b).length?(f=b,void 0):a(f)},e.modal.parentBack=function(b){return b&&a(b).length?(c=b,void 0):a(c||f)},e.modal.visible=function(){return!!g},a.my||(a.my={}),a.my.modal=e.modal,a.fn.modal=function(e,p,q){function r(){var b,c,d=window,e=!!J.global,f=x.offset(),g=E.offset(),h=x.scrollTop();J.pos={px:f.left,py:f.top,pw:x.outerWidth(),ph:x.outerHeight(),ox:g.left,oy:g.top,ow:E.outerWidth(),oh:E.outerHeight(),ww:c,wh:b};var i=1*(J.x.match(/\-?\d+(\.\d+)?/)||[0])[0],j=1*(J.y.match(/\-?\d+(\.\d+)?/)||[0])[0],k=J.x.has("left")?-1:J.x.has("right")?1:0,l=J.y.has("top")?-1:J.y.has("bottom")?1:0,m=J.pos.ox+J.pos.ow/2-J.pos.px,o=J.pos.oy+J.pos.oh/2-J.pos.py;if(e&&(J.pos.wh=b=d.innerHeight||a(d).height(),J.pos.ww=c=d.innerWidth||a(d).width(),m=c/2,o=b/2.5),i=J.x.has("%")?J.pos.ow/100*i:i,j=J.y.has("%")?J.pos.oh/100*j:j,J.pos.pix=m,J.pos.piy=o,m=m+k*(J.pos.ow/2)+i*(k>0?-1:1)-(J.width+F)*(k+1)/2,e?(o=(b-J.height-20)/3,10>o&&(o=10)):o=o+l*(J.pos.oh/2)+j*(l>0?-1:1)-(J.height||0)*(l+1)/2,m=m.round(1),o=(o+h).round(1),J.pos.vx=m,J.pos.vy=o,J.bound!==!1&&!J.global){var p=(n(J.bound)?J.bound:0).clamp(-100,100);J.pos.pw-2*pJ.pos.pw-p?J.pos.vx=J.pos.pw-p-J.width-F:J.pos.vxJ.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.length&&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.length||(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").length?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:'×
').prependTo(v).on("click.my",function(){E.modal(J.hardClose)}),z.css({"z-index":("+"===(J.z+"").to(1)?"+":"")+(1*J.z+1)})),y=J.bgroot.find(">.my-modal-screen"),J.screen&&(y.length||(y=a('').prependTo(J.root)),J.esc&&y.on("click.my"+J.cid,function(){E.modal(!0)})),E.data("modal",J),J.silent&&v.on("change.my",function(){return!1}),v.css({display:"block",height:"none",opacity:"0.005","z-index":J.z,width:"auto"}),v.css(J.global?{position:"fixed",left:"50%",top:J.pos.vy+"px",display:"block",height:"none",opacity:"0.005","z-index":J.z,width:"auto","margin-left":"-"+((J.width+F)/2).round(0)+"px"}:{position:"absolute",left:J.pos.vx+"px",top:J.pos.vy+"px",display:"block",height:"none",opacity:"0.005","z-index":J.z,width:"auto"}),w.my(J.manifest,J.data).then(function(){var b,c,d,e,f;if(h(J,{form:w,bg:y,cancel:function(){E.modal(!0)},commit:function(){E.modal()}}),v.data("modal",J),J.height=v.outerHeight(),"manifest"!==J.source&&(J.width=v.width()),r(),v.css({top:J.pos.vy+"px"}),s(!0),x.data("modals")[J.cid]=J,i[J.cid]=C,w.bind("commit.my",function(){return J.commit.delay(50),!1}).bind("cancel.my",function(){return J.cancel.delay(50),!1}),v.bind("layout.my",function(){s()}.debounce(50)),J.global&&(g=E,a("body").css({overflow:"hidden"})),J.global||!J.esc&&!J.enter||w.bind("keydown.my",function(b){var c=b.keyCode;return 27==c&&J.esc?(J.cancel(),!1):13==c&&J.enter&&!a(b.target).is("textarea")?(J.commit.delay(50),!1):void 0}),J.focus===!0){e=!1,f=J.manifest.ui;for(d in f)e||(c=w.find(d),c.length&&c.is("input, textarea","button")&&(e=!0,c.focus()))}else l(J.focus)&&w.find(J.focus).focus();if(b=w.find("img").filter(function(){return""!=a(this).attr("src")}),b.length){var j=function(){"manifest"!==J.source&&v.css({width:"auto"}),s()}.after(b.length);b.each(function(){a(this).bind("load",j)})}J.drag&&a.fn.draggable&&(l(J.drag)?v.draggable({handle:J.drag}):v.draggable(),J.nose&&v.on("dragstart.my",function(){v.removeClass("nose-"+J.nose)})),v.on("mousedown.my",function(b){var c,d=[],e=a(b.currentTarget),f=e.parent(),g=+e.css("z-index"),h=g;f.length&&(c=f.find(">.my-modal").each(function(c,e){var f=+a(e).css("z-index");e!=b.currentTarget&&f>=g&&d.push([f,a(e)]),f>h&&(h=f)}),d.forEach(function(a){a[1].css("z-index",a[0]-1+"")}),e.css("z-index",h+""))}),C.notify("Ready")}).fail(function(a){try{t()}catch(b){}E.data("modal",null),C.reject(a)}),E):(u("Invalid data"),E):(u("Object must be visible"),E)}}(jQuery);
\ No newline at end of file
+!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(ib(b)?b.split("."):gb(b)?b:[""]).reduce(function(a,b){if(null!=a){if(/=/.test(b)){var c=b.split("=",2);return jb(a)?Object.values(a).find(function(a){return jb(a)||gb(a)?a[c[0]]==c[1]:!1}):gb(a)?a.find(function(a){return jb(a)||gb(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(ib(a))a.split(/[,\s]+/).compact(!0).unique().map(function(a){c[a]=d});else if(gb(a))a.compact(!0).unique().map(function(a){c[a]=d});else if(jb(a))for(b in a)c[b]=mb(a[b])?a[b]:function(){return a[b]};return c}function k(a){var b,c=a,d={};if(ib(c)&&(c=c.split(/[,\s]+/)),gb(c)){for(c=c.compact(!0),b=0;b*";if(/^<.+>$/.test(y.list)?f=y.list:i=y.list||i,!f){var l=">*"==i?a(d[0].children):p(d,i,!0);f="",l.length&&(f=a(f).append(l.eq(0).clone(!0)).html(),l.eq(0).remove())}d.data("formlist")||d.data("formlist",{}),d.data("formlist").generator={manifest:t,delay:(y.delay||w.delay||10)/1.3,template:f,selector:i,parent:B,bind:y.bind,merge:mb(y.merge)?y.merge.bind(B):y.merge?n:!1,hash:mb(y.hash)?y.hash.bind(B):ib(y.hash)?k.fill(void 0,y.hash):gb(y.hash)?m.fill(void 0,y.hash.slice(0)):null,id:mb(y.id)?y.id.bind(B):ib(y.id)?k.fill(void 0,y.id):gb(y.id)?m.fill(void 0,y.id.slice(0)):null,ext:!(!y.id&&!y.hash),stamp:0},d.on("insert.my",function(b,c){b.stopPropagation();var d={what:void 0,where:0};null==c?d.where=1e6:jb(c)?qb(d,c):(ib(c)||kb(c))&&(d.where=c),a(b.target).my("insert",d.where,d.what)}),d.on("remove.my",function(b){b.stopPropagation(),a(b.target).my("remove")})}else try{b=K.call(d,r(B,t),jb(e)?e:void 0)}catch(q){j("$.my subform init of "+g+" failed: "+q.message,q.stack)}}nb(b)?b.then(o,function(a,b){j("Init of subform "+g+" failed with error: "+a,b)}):o()}function j(a,c){b(a,c),z&&z.reject(a,c)}function k(a,b){var c=h(a,b)||"";return"string"==typeof c?c:l(c)}function m(a,b){return l(D(a,b))}function o(){d.each(function(){var b,c,h,i=a(this),j=i[0].nodeName,k=!1;if("TEXTAREA"==j&&(h=i[0].nextSibling,c=h&&h.CodeMirror?h.CodeMirror:null,c&&i.addClass("my-codemirror")),b=y.events||N(i,Cb.events),i.hasClass("my-form")?tb(i.data("my"),{dui:y,root:e,selector:g,dparams:w,devents:b,ddata:v.data,container:w.container(i),derrors:v.errors,single:!0}):(i.data("my",{events:b,selector:g,initial:s,previous:s,root:e,container:w.container(i),id:v.id,ui:y,data:v.data,params:w,errors:v.errors,single:1==C}),f._update=y.delay?O.debounce(y.delay):wb,k=!0),k)if(i.cleditor&&i.parent().hasClass("cleditorMain")){var l=i.cleditor()[0];if(l&&l.$frame&&l.$frame[0]){i.addClass("my-cleditor"),tb(i.data("my"),{container:w.container(i)});var m,n=function(a){i.val(a).trigger(eb)},o=Number.random(1e5,1e6-1);a(l.$frame[0]).attr("id","cleditCool"+o),m=document.frames?document.frames["cleditCool"+o].document:a("#cleditCool"+o)[0].contentWindow.document;var p=a(m).find("body");a(m).on("keyup.my",function(){n(a(this).find("body").html())}),i.parent().find("div.cleditorToolbar").on("click.my mouseup.my",function(){n(p.html())}),a("body").on("click","div.cleditorPopup",function(){n(p.html())})}}else if("TEXTAREA"==j&&i.parent().hasClass("redactor_box")){var q,r="my-redactor-9";try{q=i.getEditor(),r="my-redactor-8"}catch(t){q=i.redactor("getEditor")}q&&(i.addClass(r),q.on("input.my keyup.my blur.my",function(a){a.trigger("redactor")}.fill(i)))}else i.hasClass("ace_editor")?ace.edit(d[0]).on(eb,function(a){a.trigger("ace")}.fill(i)):c&&c.on(eb,function(a){a.trigger("codemirror")}.fill(i));i.my()._changed=x.debounce(u),i.my()._recalc=I.debounce(u),i.on(b,function(a){a.type==eb&&a.stopPropagation(),k&&(v.locktill=Ab()+f.delay),i.my()._changed(i,e,f,w)}),/check(\.my)?/.test(b+"")||i.on("check.my",function(){return i.my()._changed(i,e,f,w,!0),!1}),k||i.off("redraw.my"),i.on("recalc.my, redraw.my",function(a){a.stopPropagation(),i.my()._recalc(i,e,f,w)})}),z&&z.resolve()}var q,s,t,u,v=e.my(),w=(v||{}).params,y=f,z=null,A=0,B=v.manifest,C=0|d.length;return v?(u=f.delay,C?(y.init!=wb&&(q=H(B,y.init,d,v)),nb(q)?(A+=1,z=ub(),q.then(i,function(a,b){j("Init of "+g+" failed: "+a,b)})):i()):c("Not found "+g+" selector.",e),z):(b("Failed to find $root building "+g+" selector."),null)}function w(c,d){jb(d)&&d.channel&&d.message&&p(c,".my-listen-"+l(d.channel)).each(function(){var c,e=a(this),f=e.data("my"),g=void 0;if(f&&f.ui.listen&&mb(f.ui.listen[d.channel])){c=f.ui.listen[d.channel];try{g=c.call(f.manifest||f.root.my().manifest,f.data,d.message,e)}catch(h){b("Listener failed",h.message,h.stack)}void 0!==g&&(null===g?e.trigger("check"):g&&e.trigger("recalc"))}})}function x(a,b,c,d,e){{var f,g=a.data("my");b.data("my")}g&&(g.disabled?g.ddata||O(a,wb,c.recalcDepth||d.recalcDepth):(B(g.ddata||g.data,g.dparams||g.params),e||(f=g.single?a:p(b,g.selector)),O(a,e?wb:A(f,wb),c.recalcDepth||d.recalcDepth),d.change&&d.change.call(a)))}function y(b,c,d){var e=d.compact(),f=e.replace(/:disabled/g,""),g=f!==e,h="self:"===f.to(5);return h&&(f=f.replace(/^self:/g,"")),c.each(function(){var d=a(this),e=d.my(),i=!h&&e?e.container:d;i.toggleClass(f,!!b),g&&void 0!==e&&!!b!=!!e.disabled&&(d.my().disabled=!!b,e._disable||(d.my()._disable=N(c,Cb.offon).fill(void 0,c)),e._disable(!!b))}),c}function z(a,b,c){return a[b](c?"disable":"enable")}function A(a,b){var c,d,e=a.data("myval");return e||(d=N(a,Cb.vals),mb(d)&&(c=d(a,wb),void 0===c?a.data("myval",function(a,b){return wb!=b&&d(a,b),a.val()}.fill(a,void 0)):a.data("myval",d.fill(a,void 0))),e=a.data("myval")),mb(e)?(c=e(),(c!==b&&(0==b||0==c)||c!=b||jb(b))&&(c=e(b)),c):wb}function B(a,b,c,d){var e,f,g,h,i,j,k,l,m,n=b;if(!jb(n)||isNaN(h=n.remember)||!jb(e=n.history))return wb;if(jb(a)&&h){if(j=rb(a,!0),k=Ab(),g=sb(e).sort(),g.length&&(k-g.last()=2*h){for(m={},f=h;2*h>f;f++)m[g[f]]=e[g[f]];b.history=m}return d||n.form.trigger(eb),n.history[g.last()]}if(!isNaN(a)||a===wb){if(i=parseInt(a)||0,0>i)return wb;if(g=sb(e).sort(),i>=g.length&&(i=g.length-1),l=rb(n.history[g[g.length-i-1]],!0),c){for(m={},f=0;f=i;i++)if(i===h){if(d)return wb!=b?e[f[i]]=b:void 0===e[f[i]]&&(e[f[i]]=wb),e[f[i]];e[f[i]]=b}else 0===i?(e=a[f[0]],g=a):(g=g[f[i-1]],e=e[f[i]]),(null==e||!jb(e)&&(gb(e)&&!isNaN(f[i+1])&&+f[i]>-1))&&(e=g[f[i]]={});return a}function G(a,b,c){var e=jb(b)?b:null;return Object.each(a,function(b,c){var d=typeof c;/^str|^fu/.test(d)&&(a[b]={bind:c})}),Object.each(a,function(b,f){var g,i,k,l=[],m=[],n=/\s?[,;]\s?/;f.recalc&&(ib(f.recalc)?l=f.recalc.split(n):gb(f.recalc)&&(l=f.recalc),l=l.compact(!0).unique()),l.length&&(a[b].recalc=l),null==f.bind&&(f.bind=function(){});var o;if(f.listen&&(o=j(f.listen),f.listen=Object.size(o)?o:void 0),d(f,"events")&&(f.events=(f.events+"").replace(/,\s*|\s+/g," ")),d(f,"watch"))for(ib(f.watch)?m=f.watch.split(n):gb(f.watch)&&(m=f.watch.slice(0)),m=m.compact(!0).unique(),k=0;ki&&h.resolve()}var d,e,f,g=!1,h=ub(),i=a.length;for(e=0;i>e;e++)d=a[e],f=ib(d.ajax)?w.loader:yb,f(d.ajax).then(function(a,d){fb.test(d.ref)&&(null!=a?tb(!0,b,E(a,d.ref.from(5))):(g=!0,v.push("Invalid data for ‘"+d.ref+"’ resource."))),c()}.fill(void 0,d)).fail(function(a,b){v.push("Failed to load ‘"+b.ref+"’ resource."),g=!0,c()}.fill(void 0,d));return h.promise()}function i(a){var c=!1;return fb.test(a)?null!=h(b,a.from(5))&&(c=!0):null!=h(window,a)&&(c=!0),c}function j(a){for(var b in a)a[b]===!1&&(a[b]=i(b));return a}var k,l,m,n,o,p,q,r,s=ub(),t=[],u={},v=[],w=tb(!0,{ajaxTimeout:1e4,loader:Cb.params.loader},c||{}),x={ref:null,ajax:{type:"GET",async:!0,timeout:w.ajaxTimeout}};if(jb(b))if(gb(b.require)){for(n=b.require,k=0;k'+f+""}!_.style||b&&!sb.is(":visible")||(S=L(sb,_),S&&S[0].length&&!b&&(V=a("style#"+T),V.length||(V=a(c(S[0],T)).appendTo(a("body"))),V.data("count",1*V.data("count")+1),sb.data("my").style=V),S&&S[1].length&&(Z=a("style#"+U),Z.length?b&&(a(c(S[1],U)).replaceAll(Z),Z=a("style#"+U)):(Z=a(c(S[1],U)).appendTo(a("body")),Q.restyle>-1&&!pb[J]&&(pb[J]=function(){q(!0)}.debounce(Q.restyle)),sb.data("my").restyle=q.fill(!0).debounce(0)),sb.data("my").localStyle=Z,b||sb.addClass("my-restyle")))}function r(){var a,b,c=!0;if(b=t(_),ib(b))B("Error decoding base64 to local Blob/URL",b),c=!1;else{if(W)for(a=0;a*").clone();try{$=H(_,R.init,sb,R)}catch(b){return B(ib(b)?b:b.message,b.stack),sb}}if(nb($)?$.then(function(){x()},function(a,b){B(a,b)}):x(),!hb){if(!sb.my())return B("Internal error initializing controls.",""),sb;sb.data("my").initial=tb(!0,{},bb),a.mobile&&a.mobile.changePage(a.mobile.activePage)}}function x(){function a(a){hb||(b[a]=A(p(sb,a),wb),d-=1,.5>d&&y(b))}var b={},c=Object.keys(O),d=c.length;0===d?z():(sb.addClass(lb),c.forEach(function(b){if(!hb){var c=p(sb,b),d=v(c,sb,O[b],b);rb[b]=c,nb(d)?d.then(a.fill(b)).fail(function(a,c){B("Error building "+b+", "+a,c)}):hb||a(b)}}))}function y(a){var c,d,e,f,g;for(g in O){if(hb)return;if(c=O[g],e=rb[g],f=e.length){c.listen&&(eb[g]=e.eq(0));try{d=u(bb,wb,c,e),d==wb&&a[g]!=wb&&void 0!==d&&u(bb,a[g],c,e)}catch(h){b("Transient fail linking "+g+" of form $('.my-form-"+J+"')",h.message,h.stack)}try{d!=wb&&A(e,d),e.eq(0).trigger("check.my")}catch(h){B("Error linking "+g,h.message,h.stack)}}}z()}function z(){sb.removeClass(lb),sb.on("recalc.my, redraw.my",function(a){a.stopPropagation(),sb.my("redraw")}),qb=null,fb.resolve(bb)}function B(a,c){var d;if(hb=!0,b("Form "+I+" failed to initialize.",a,c),Object.keys(rb).forEach(function(a){delete rb[a]}),sb.removeClass(lb),d=kb(a,c),ib(d)||jb(d)&&d.jquery?sb.html(d):d===!0&&sb.html(qb),Q.silent)fb.resolve(bb);else{if(!sb.my().ddata){if(sb.removeData("my"),sb.removeClass("my-form"),V)if("1"==V.data("count"))try{V.remove()}catch(e){}else V.data("count",V.data("count")-1);if(Z)try{delete pb[J],Z.remove()}catch(e){}}fb.reject("Form "+I+" failed to initialize: "+a,c)}}var D,F,I,J,K,N,O,Q,R,S,T,U,V,Z,$,_={},bb={},cb=null,db=[],eb={},fb=ub(),hb=!1,kb=function(){},lb="my-form-init",ob="std",qb="",rb={};if(ib(d)){if(D=zb(d),!D)return fb.reject("No manifest with id "+d+" found in repo."),fb.promise();jb(f)&&jb(e)?(D=tb(D,e),F=f):F=e,ob="repo"}else D=d,F=e;if(!D)return this;R=jb(F)&&"repo"!=ob?tb(!0,{},D):D;var sb=this.eq(0),vb=sb.my();return jb(vb)&&vb.id&&vb.ui?(c("jQuery.my is already bound.",sb),sb.my("ui",R.ui),sb.my(ab,R.data),fb.resolve(sb.my(ab)).promise()):(Q=R.params||{},Q.strict||mb(R.init)||(Q=tb(!0,{},Q),P(Q)),Q=tb(!0,{},Cb.params,Q),fb.fail(function(){sb.removeClass(U+" "+T)}),tb(sb,fb.promise()),jb(F)?(bb=m(F,R.data||{}),R.data=bb):bb=R.data||{},_.data=bb,sb.data("my",{data:bb,params:Q,promise:fb.promise(),locktill:0}),sb.addClass(lb),R.inherit&&i(R),gb(R.require)?Bb(R,Q).then(g).fail(function(a){o(),B("Linker of the ‘require’ property failed.",a)}):g(),fb.then(n),sb)}function L(a,b){function c(e,f,g,h){var i,j,k,l,m,n=e,o=/@/.test(f),p=f.split("@")[0],q=mb(n);if(o&&(q?h:g).push("@"+f.split("@")[1].trim()+" {"),ib(n)&&(/[\r\n]/.test(n)||n.split("}",3).length>2?n=Db.css2json(n):g.push(p+(/\{/.test(n)?n:"{"+n+"}"))),gb(n)&&n.length)for(i=0;ie)return d=i,e=g,void 0;j==_&&c(a,i,g+1)}wb!=b[""]&&typeof b[""]!=_&&g>e&&(d=b[""],e=g)}var d=wb,e=0,f="";return c(a,b,1),d}function O(a,c,d){var e,f,g,h,i,j,k,l,m,n,o,q,r=!1,s=!1,t=a,v=t.my(),w="";if(v){if(m=v.selector,n=v.root,n.hasClass("my-form-init"))return{};if(o=p(n,m),q=n.my().ui,r=a.hasClass("my-form"),r?(f=a,g=v.ddata,h=v.dui,i=v.dparams):(f=v.container,g=v.data,h=v.ui,i=v.params),h.bind!=wb){if(j=xb(c)?c:A(o,u(g,wb,h,o)),wb!=h.check){w="Unknown error";try{w=U(g,j,h,o)}catch(x){b("Error "+x.message+" in .check validator for "+m,n,x.stack)}}var z=i.errorCss,B="ui-state-error";try{wb!=c&&(j=A(o,u(g,c,h,o)))}catch(x){w=i.messages.formError||"Error"}if(wb!=h.check)if(s=a.hasClass("my-form-list"),""==w&&(r||f.hasClass(z)))r?v.derrors[m]="":v.errors[m]="",f.removeClass(z),f.attr("title")&&f.attr("title",""),r||s||i.effect(p(f,i.errorTip),!1,i.animate/2),t.removeClass(B),p(t,".ui-widget").removeClass(B);else if(w){if(r)v.derrors[m]=w;else if(s)v.errors[m]=w;else{f.addClass(z),v.errors[m]=w;var C=p(f,i.errorTip);C.length?i.effect(C.addClass(z).html(ib(w)?w:"Error"),!0,i.animate):f.attr("title",(ib(w)?w:"Error").stripTags())}t.hasClass("hasDatepicker")&&(t.is("input")?t.addClass(B):p(t,".ui-widget").addClass(B)),t.hasClass("ui-slider")&&t.addClass(B)}}var D=c==wb?j:c;if(h.css)for(k in h.css)l=h.css[k],lb(l)?y(l.test(D),o,k):mb(l)&&y(l.call(n.my().manifest,g,D,o),o,k);var e,E,F=h.recalc,G=[],H={};if(d&&h.recalc&&n.my()){for(q=n.my().ui,e=0;e-1?"":o;case"s":return c==k?"":o;case"o":return k[c]?"":o;case"b":return e.hasClass("my-form-list")?(h=e.data("listSrc")||e.data("my").listSrc||">*",j={},l=0,(">*"==h?a(e[0].children):p(e,h,!0)).each(function(){var b=a(this);b.hasClass("ui-sortable-placeholder")||(b.data("my")&&!b.my("valid")&&(j[l]=b.my("errors")),l+=1)}),j):e.hasClass("my-form")&&k?e.my("valid")?"":e.my("errors"):""}return m.formError||"Error"}return""}var V="1.2.9",W=window.URL||window.webkitURL,X=!document.addEventListener,Y=((window.navigator.language||window.navigator.userLanguage||"en")+"").split("-")[0].toLowerCase(),Z="{yyyy}-{MM}-{dd}",$="{HH}:{mm}",_="object",ab="data",bb="array",cb="string",db="function",eb="change",fb=/^this\./,gb=Object.isArray,hb=Object.isBoolean,ib=Object.isString,jb=Object.isObject,kb=Object.isNumber,lb=Object.isRegExp,mb=Object.isFunction,nb=function(a){return null!=a&&typeof a==_&&mb(a.then)},ob=h(a,"my.f.repo")?a.my.f.repo():{_src:{},_name:"Default manifest cache"},pb=h(a,"my.f.restyles")?a.my.f.restyles():{},qb=Object.merge,rb=Object.clone,sb=Object.keys,tb=a.extend,ub=a.Deferred,vb=a.type,wb=null,xb=function(a){return null!==a&&void 0!==a},yb=a.ajax,zb=q,Ab=Date.now,Bb=J,Cb={vals:{".my-form":function(a,b){if(a&&a.my){var c=a.my(ab);return Object.equal(c,b)?c:a.my(ab,b,!0)}return b||wb},".hasDatepicker":function(a,b){xb(b)&&a.datepicker("setDate",""==b?b:Date.create(b));var c=a.datepicker("getDate");return c?c.format(Z):""},".my-tags":function(a,b){return xb(b)&&(ib(b)||kb(b)?a.tags(ab,[b+""]):gb(b)&&a.tags(ab,b)),a.tags(ab)},".ui-draggable":function(a,b){if(xb(b)&&jb(b)){var c={};isNaN(b.left)||(c.left=Number(b.left).ceil(2)+"px"),isNaN(b.top)||(c.top=Number(b.top).ceil(2)+"px"),(c.left||c.top)&&a.css(c)}var d=a.position();return{left:b&&!isNaN(b.left)?(1*b.left).ceil(2):d.left.ceil(2),top:b&&!isNaN(b.top)?(1*b.top).ceil(2):d.top.ceil(2)}},".my-form-list":function(b,c){function e(){var c,d,e=a(this),f=e.data("my");f&&(c=e.data("formlist"),d=c.index,c.hash=w(f.data,d)+"",c.oid=x!==w?x(f.data,d)+"":c.hash),b.trigger("check.my")}function f(a){a.data("my").locktill+z/1.3.my-form",t=!!q.merge,u=q.template||"",v=/\{/.test(u),w=q.hash||l,x=q.id||l,y=q.ext,z=q.delay||50,A="ui-sortable",B="."+A+"-placeholder",C=b.is("."+A),D=!!b.children(B).length,E=[],F=[],G=Ab(),H=b.find(C?b.sortable("option","items"):s);if(xb(c)&&gb(c)){if(D)return c;if(i=[],j={},H.each(function(){var b,c=a(this),d=c.data("my");d&&(i.push(d.data),!t&&(b=c.data("formlist"))&&(j[b.oid]=d.data))}),m=g(i,c,"=="),!m){var I=[],J=[],L={},M={};for(F=[],h=0;h1.4*z||G-q.stamp>100||!q.stashed||q.stashed.length!==H.length-(D?1:0)){D&&(o=b.find(">."+A+"-helper"));var N=0;for(H.each(function(b,c){var d,e,f,g=a(c),h=!1;D&&g.hasClass(A+"-helper")||(D&&g.hasClass(A+"-placeholder")&&(g=o),d=g.data("my"),e=g.data("formlist"),d&&e&&(E.push(d.data),N!=e.index&&(e.index=N,h=!0),y&&(f=w(d.data,N)+"",f!==e.hash&&(e.hash=f,h=!0)),N+=1,h&&F.push(g)))}),h=0;h-1){var f=b.eq(d);f.is(":checked")||(f.prop("checked",!0),e&&f.checkboxradio("refresh"))}else e||b.each(function(){a(this).prop("checked",!1)})}if(-1==d)for(var g=0;gForm 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:"Обязательное поле"}},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){z(b,"selectable",a)},".ui-slider":function(a,b){z(b,"slider",a)},".ui-draggable":function(a,b){z(b,"draggable",a)},".ui-buttonset":function(a,b){z(b,"buttonset",a)},".hasDatepicker":function(a,b){z(b,"datepicker",a)},".my-form":function(a,b){b.my("disabled",!!a)},"div.select2-container+input,div.select2-container+select":function(a,b){z(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")}}}};Cb.params={container:function(a){return N(a,Cb.containers)(a)},change:wb,recalcDepth:2,delay:0,strict:!1,restyle:-1,locale:Y,messages:Object.map(Cb.msg,function(a,b){return b[Y]||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=ub(),c=zb(a+"");return c?b.resolve(c):b.reject(null),b.promise()},ajaxTimeout:1e4};var Db={con:c,clone:function(a){return a.clone?a.clone():a},indom:e,jquix:z,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&&ib(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===db)return b(a.toJSON(),m+(g?1:0),g);if(h=[],gb(a)){for(i=0;ii;i++)h[i]=e.charCodeAt(i);return d=new Blob([h],{type:c||"application/octet-stream"}),mb(b)?(b(d),void 0):d},base64:function(b,c,d){var e=null,f=ib(b)?b:a.my.tojson(b),g=ib(d)?"data:"+d+";base64,":"";if(c){try{e=decodeURIComponent(escape(window.atob(f)))}catch(h){e=null}if(null!==e&&/(^".*"$)|(^\[.*\]$)|(^\{.*\}$)/.test(e))try{e=Db.fromjson(e)}catch(h){e=null}return e}return g+window.btoa((d===!0?"":"")+unescape(encodeURIComponent(f)))},_s2css:L,css2json:function(a){var b="",c=(a+"").replace(/\/\*[\s\S]+\*\//gm,"").replace(/@charset[^;]+;/gim,"").replace(/[\n\t\s]+/g," ").replace(/\s*@media[^{]*\{/g,function(a){return a.to(-1).trim()+"ᴥ"}).replace(/\}/g,"}ᴥ").replace(/^\n+/g,"").replace(/[\n\s]+$/g,"").split("ᴥ").compact(!0).reduce(function(a,c){var d,e,f,g=c.trim();return"}"==g?b="":/^[^{]+\{[^\}]+\}$/.test(g)?(d=g.to(-1).split("{"),e=" "+d[0].trim(),f=d[1].trim(),";"!=f.last()&&(f+=";"),b?a[b][e]=(a[b][e]||"")+f:a[e]=(a[e]||"")+f):/^@media/.test(g)&&(a[g]={},b=g),a},{});return c}},Eb={container:function(a){return N(a,Cb.containers)(a)},data:function(a,b){var c=this;return jb(a)&&(c.my().data=n(c.my().data,a),this.my("redraw",b)),c.my().data},disabled:function(a){var b,c,d,e,f=this,g=f.my();if(!g)return void 0;if(a==wb)return g.disabled;if(a){for(c in g.ui)b=p(f,c),d=b.my(),d&&(d.predisabled=d.disabled),y(!0,b,":disabled");f.addClass("my-disabled")}else{for(c in g.ui)b=p(f,c),d=b.my(),e=!1,d&&d.predisabled&&(e=!0),y(e,b,":disabled");f.removeClass("my-disabled"),f.my("redraw")}},errors:function(){var b=a(this).my().errors,c={};for(var d in b)b[d]&&ib(b[d])&&(c[d]=b[d]),jb(b[d])&&sb(b[d]).length&&(c[d]=b[d]);return c},find:function(a){var b=this,c=b.my();return c&&c.root&&(b=c.root),b.find(a)},history:function(a,b){return B(a,this.my().params,b)},id:function(a,b){if(ib(a))return zb(a,b);var c=this.my();return c&&c.id?c.id:wb},index:function(){var a=this.my().root&&!this.my().ddata?this.my().root:this;return(a.data("formlist")||{}).index},indom:function(){return e(this)},init:K,insert:function(a,b){var c,d,e=this.hasClass("my-form-list")?this:this.my().root||this,f=e.hasClass("my-form-list")?e:e.parent(".my-form-list"),g=(e.data("formlist")||{}).index,i=b,j=f.data("formlist").generator;if(null==g&&(g=0),c=fb.test(j.bind)?h(f.my().manifest,j.bind.replace(fb,"")):h(f.my().data,j.bind),!jb(i))if(jb(j.manifest))i=rb(j.manifest.data,!0)||{};else{if(f===e)throw"No data to insert, cannot guess when manifest is a function.";i=rb(e.my().manifest.data,!0)}if("before"===a)d=g;else if("after"===a)d=g+1;else{if(isNaN(a))throw"Invalid position for insertion";d=(1*a).clamp(0,c.length)}c.add(i,d),f.trigger("redraw")},manifest:function(a){return"json"==a?Db.tojson(this.my().manifest):this.my().manifest},promise:function(a){return mb(a)&&this.my().promise.then(a),this.my().promise},radio:function(a,b){this.trigger("radio",ib(a)?{channel:a,message:b}:a)},redraw:function(a,b){var c=this,d=c.my(),e=2;return d&&jb(d.ui)&&(e=d.params.recalcDepth,Object.keys(d.ui).forEach(function(b){var d=p(c,b);O(d,a?wb:void 0,e),a||(d.hasClass("my-form")&&d.my("redraw"),d.trigger(d.hasClass("my-form-list")?"redraw":"check.my"))}),!b&&a&&c.trigger(eb)),c},remove:function(a){var b,c,d,e,f,g,h,i,j=this;if(!this.my())return wb;if(this.my().root&&!this.my().ddata&&(j=this.my().root),d=j.my(),f=d.data,h=d.cid,i=d.mid,j.unbind(".my"),jb(d)&&d.manifest&&mb(d.manifest.die))try{d.manifest.die.call(d.manifest,j,d.manifest)}catch(k){}if(b=d.style)if("1"==b.data("count"))try{b.remove()}catch(k){}else b.data("count",b.data("count")-1);if(c=d.localStyle)try{delete pb[h],c.remove()}catch(k){}if(window.URL&&(e=d.locFiles)&&e.length)for(var l=0;lg?wb:(d.params.errors&&d.params.errors.values().compact(!0).length?Object.equal(d.data,d.lastCorrect)||(g+=1):Object.equal(e[f.last()],d.data)&&(g+=1),b=B(g,d.params,!0),b&&(o(c.my().data,b),c.my("redraw")),c.my().data)},val:function(a){return A(this,a)},valid:function(){var b=a(this).my().errors,c=0;for(var d in b)b[d]&&ib(b[d])?c++:jb(b[d])&&sb(b[d]).length&&c++;return!c},version:function(){return V}},Fb=Object.keys(Eb);a.my||(a.my={}),tb(a.my,{f:a.extend({},Db),tojson:Db.tojson,fromjson:Db.fromjson,radio:function(b,c){w(a(document),ib(b)?{channel:b,message:c}:b)},rules:Cb,locale:function(a){return ib(a)?(Y=a.toLowerCase(),Cb.params.locale=Y,void 0):Y},ajax:function(a){return mb(a)?yb=a:yb.apply(this,f(arguments,0))},cache:function(a,b){return mb(a)?zb=a:zb(a,b)},now:function(a){return mb(a)?(Ab=a,void 0):Ab()},require:function(a){return mb(a)?Bb=a:Bb.apply(this,f(arguments,0))},chain:function(){function a(){if(d.length&&e){var b,c=d.shift(),f=function(){a.delay(c[1])}.once();try{b=c[0]()}catch(g){f()}nb(b)?(b.then(f,f),f.delay(c[1])):f()}}var b=1,c=1e3,d=[],e=!1,f=function(e,f,g){d.push([e,f||b,g||c]),a()};return f.delay=function(a){return isNaN(a)||(b=(a-0).clamp(0,1e6)),b},f.timeout=function(a){return isNaN(a)||(c=(a-0).clamp(1,1e6)),c},f.start=function(){e=!0,a()},f.stop=function(){e=!1},f}(),version:function(){return V}}),a.my.version.toString=function(){return V},a.fn.my=function(b){var c;if(void 0===b)return this.data("my");if(ib(b)&&"{"==b.substr(0,1)){try{c=JSON.parse(b)}catch(d){}if(c)return Eb.init.apply(this,[c].add(f(arguments,1)))}return ib(b)&&Eb[b]?Eb[b].apply(this,f(arguments,1)):ib(b)&&zb(b,"exist")?Eb.init.apply(this,arguments):typeof b!==_&&b?(a.error("Method "+b+" does not exist on jQuery.my"),void 0):Eb.init.apply(this,arguments)},a(window).off(".my").on("radio.my",function(b,c){b.stopPropagation(),w(a(document),c)}).on("resize.my",function(){for(var a in pb)try{pb[a]()}catch(b){}}.debounce(67))}(jQuery),function(a){function b(a,b,c){if(i(b))return a+b;if(j(b))return c=e(!0,c,b),a;if(h(b)&&b.length>1&&i(b[1])){for(var d,k,m,n,o,p,q,r,s=b[0],t="",u=1;u'+(s?"<"+c.labelTag+' class="'+c.labelCss+'" '+(c.label?'style="display:inline-block;width:'+c.label+";margin-left:-"+c.label+'" ':"")+">"+s+""+c.labelTag+">":"")+t+""+c.rowTag+">"),a+t}return a}function c(a){var b=a;if(i(b)&&(b=b.split(/[\s,]/).compact(!0)),h(b)){for(var c={},d=0;d',inp:k+'text" {ext}/>',sli:k+'range" {ext}/>',dat:k+'date" {ext}/>',btn:k+'button" {ext}/>',pwd:k+'password" {ext}/>',but:"",div:"{txt}
",spn:"{txt}",sel:"",mul:'',txt:"",err:' {txt}',msg:'{txt}
',val:function(a){if(!h(a.vals))return"";var b=e({style:"",css:""},a);return b.txt=a.vals.reduce(function(a,b){return a+""+b+" "}," "),'{txt}'.assign(b)},"":"<{_tag} {ext}>{txt}{_tag}>"},txt:{sel:function(a){if(!a.vals)return"";var b=c(a.vals);return Object.keys(b).reduce(function(a,c){return a+'"},"")}},params:{styles:{num:"width:30%;",dat:"width:30%;",inp:"width:100%",pwd:"width:100%",but:"width:30%",txt:"width:100%;max-width:100%;min-height:1px;word-break:break-word;",err:"display:none",msg:"display:none"},alias:{number:"num",date:"dat",slider:"sli",textarea:"txt",input:"inp",span:"spn",select:"select",vals:"val"},row:"",rowTag:"div",rowCss:"my-row",label:"",labelTag:"span",labelCss:"my-label"},defaults:{id:"","class":"",style:"",placeholder:"",value:"",rows:1},attnames:{css:"class",plc:"placeholder",val:"value",txt:"",vals:"",tip:"title"}},m={init:function(b,c){return a(this).html(d(b,c))}};a.my||(a.my={}),a.my.formgen=d,a.fn.formgen=function(b){return i(b)&&m[b]?m[b].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof b&&b?(a.error("Method "+b+" does not exist on jQuery.formgen"),void 0):m.init.apply(this,arguments)}}(jQuery),function(a){function b(b,c,d,e){var f,g,i,j,k,n,o;if("object"==typeof c&&c.jquery)c.is("img")&&(n=c,k=c.attr("alt")||c.attr("title")||c.data("text")||"",g=n[0].naturalWidth||n[0].width,f=n[0].naturalHeight||n[0].height,1>f&&(f=1),1>g&&(g=1),j=a(window).width()-90,i=a(window).height()-90,f>i&&(g=g*(i/f)|0,f=i),g>j&&(g=j,f=f*(j/g)|0),o=300>g?300:g,h(b,{source:"image",manifest:{init:function(a){a.html(this.HTML),a.on("click.my","img:eq(0)",function(){a.trigger("cancel")})},HTML:'',ui:{"img:eq(0)":"img",h4:{bind:"text",css:{hide:function(a,b){return!b}}}}},data:{img:n.attr("src"),text:k},esc:!0,screen:!0,width:e||o,focus:!1,global:!0,z:"1995"},d));else if(m(c)&&c.manifest)h(b,c,d);else{if(!l(c))return null;h(b,{source:"html",manifest:{init:function(a){a.html(this.HTML)},HTML:c,ui:{"div:eq(0)":function(){}}},data:{},esc:!0,focus:!1,width:e},d)}return b}var c,d,e={},f="body",g=!1,h=a.extend,i={},j=a.my.f.indom,k=(Object.isArray,Object.isBoolean),l=Object.isString,m=Object.isObject,n=Object.isNumber,o=(Object.isRegExp,Object.isFunction);if(a.fn.modal&&o(a().emulateTransitionEnd)&&(d=a.fn.modal),a(document).off(".modal"),a(document).on("keydown.modal",function(a){var b,c,d=a.keyCode;if(!1!==g&&(13===d||27===d)){if(c=g.data("modal"),b=c.form,27==d&&(c.esc||Object.equal(b.data("my").initial,b.my("data"))))return g.modal(!0),!1;if(13==d&&c.enter)return function(a){a.modal()}.fill(g).delay(50),!1}}),o(a.my.f.getref(a,"my.modal.parent"))){var p=a.my.f.getref(a,"my.modal.parent")().attr("id");p&&(f="#"+p)}e.modal=function(c,d,e){var h,i={},j=a(f),l=j.find(">.my-modal-proxy"),m={global:!0,screen:!0,done:o(d)?d:void 0,z:"1995"};return k(c)||null==c?l.modal(c):(h=a.Deferred(),b(i,c,m,e)?g?h.reject("Locked").promise():(l.length||(l=a('').prependTo(j),l.css({position:"absolute",top:"0",left:"0",margin:"0",padding:"0",width:"1px",height:"0"})),l.modal(i)):h.reject("Invalid data").promise())},e.modal.loading=function(b){a(f).find(">.my-modal").toggleClass("my-modal-loading",!!b)},e.modal.parent=function(b){return b&&a(b).length?(f=b,void 0):a(f)},e.modal.parentBack=function(b){return b&&a(b).length?(c=b,void 0):a(c||f)},e.modal.visible=function(){return!!g},a.my||(a.my={}),a.my.modal=e.modal,a.fn.modal=function(e,p,q){function r(){var b,c,d=window,e=!!J.global,f=x.offset(),g=E.offset(),h=x.scrollTop();J.pos={px:f.left,py:f.top,pw:x.outerWidth(),ph:x.outerHeight(),ox:g.left,oy:g.top,ow:E.outerWidth(),oh:E.outerHeight(),ww:c,wh:b};var i=1*(J.x.match(/\-?\d+(\.\d+)?/)||[0])[0],j=1*(J.y.match(/\-?\d+(\.\d+)?/)||[0])[0],k=J.x.has("left")?-1:J.x.has("right")?1:0,l=J.y.has("top")?-1:J.y.has("bottom")?1:0,m=J.pos.ox+J.pos.ow/2-J.pos.px,o=J.pos.oy+J.pos.oh/2-J.pos.py;if(e&&(J.pos.wh=b=d.innerHeight||a(d).height(),J.pos.ww=c=d.innerWidth||a(d).width(),m=c/2,o=b/2.5),i=J.x.has("%")?J.pos.ow/100*i:i,j=J.y.has("%")?J.pos.oh/100*j:j,J.pos.pix=m,J.pos.piy=o,m=m+k*(J.pos.ow/2)+i*(k>0?-1:1)-(J.width+F)*(k+1)/2,e?(o=(b-J.height-20)/3,10>o&&(o=10)):o=o+l*(J.pos.oh/2)+j*(l>0?-1:1)-(J.height||0)*(l+1)/2,m=m.round(1),o=(o+h).round(1),J.pos.vx=m,J.pos.vy=o,J.bound!==!1&&!J.global){var p=(n(J.bound)?J.bound:0).clamp(-100,100);J.pos.pw-2*pJ.pos.pw-p?J.pos.vx=J.pos.pw-p-J.width-F:J.pos.vxJ.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:y.parent().width()+"px",height:y.parent().height()+"px",display:"block",background:l(J.screen)?J.screen:"rgba(40,80,120,0.6)","z-index":J.z-1}):y.length&&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.length||(J.root=a(f))),J.global?(J.root=a(f),J.bgroot=a(c||f)):J.bgroot=J.bgroot?a(J.bgroot):J.root,x=J.root,x.data("modals")||x.data("modals",{}),r(),v=a('
'),J.root.find(">.my-modal").length?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:'×
').prependTo(v).on("click.my",function(){E.modal(J.hardClose)}),z.css({"z-index":("+"===(J.z+"").to(1)?"+":"")+(1*J.z+1)})),y=J.bgroot.find(">.my-modal-screen"),J.screen&&(y.length||(y=a('').prependTo(J.bgroot)),J.esc&&y.on("click.my"+J.cid,function(){E.modal(!0)})),E.data("modal",J),J.silent&&v.on("change.my",function(){return!1}),v.css({display:"block",height:"none",opacity:"0.005","z-index":J.z,width:"auto"}),v.css(J.global?{position:"fixed",left:"50%",top:J.pos.vy+"px",display:"block",height:"none",opacity:"0.005","z-index":J.z,width:"auto","margin-left":"-"+((J.width+F)/2).round(0)+"px"}:{position:"absolute",left:J.pos.vx+"px",top:J.pos.vy+"px",display:"block",height:"none",opacity:"0.005","z-index":J.z,width:"auto"}),w.my(J.manifest,J.data).then(function(){var b,c,d,e,f;if(h(J,{form:w,bg:y,cancel:function(){E.modal(!0)},commit:function(){E.modal()}}),v.data("modal",J),J.height=v.outerHeight(),"manifest"!==J.source&&(J.width=v.width()),r(),v.css({top:J.pos.vy+"px"}),s(!0),v.removeClass("my-modal-init"),x.data("modals")[J.cid]=J,i[J.cid]=C,w.on("commit.my",function(){return J.commit.delay(50),!1}).on("cancel.my",function(){return J.cancel.delay(50),!1}),v.on("layout.my",function(){s()}.debounce(50)),J.global&&(g=E,a("body").css({overflow:"hidden"})),J.global||!J.esc&&!J.enter||w.on("keydown.my",function(b){var c=b.keyCode;return 27==c&&J.esc?(J.cancel(),!1):13==c&&J.enter&&!a(b.target).is("textarea")?(J.commit.delay(50),!1):void 0}),J.focus===!0){e=!1,f=J.manifest.ui;for(d in f)e||(c=w.find(d),c.length&&c.is("input, textarea","button")&&(e=!0,c.focus()))}else l(J.focus)&&w.find(J.focus).focus();if(b=w.find("img").filter(function(){return""!=a(this).attr("src")}),b.length){var j=function(){"manifest"!==J.source&&v.css({width:"auto"}),s()}.after(b.length);b.each(function(){a(this).bind("load",j)})}J.drag&&a.fn.draggable&&(l(J.drag)?v.draggable({handle:J.drag}):v.draggable(),J.nose&&v.on("dragstart.my",function(){v.removeClass("nose-"+J.nose)})),v.on("mousedown.my",function(b){var c,d=[],e=a(b.currentTarget),f=e.parent(),g=+e.css("z-index"),h=g;f.length&&(c=f.find(">.my-modal").each(function(c,e){var f=+a(e).css("z-index");e!=b.currentTarget&&f>=g&&d.push([f,a(e)]),f>h&&(h=f)}),d.forEach(function(a){a[1].css("z-index",a[0]-1+"")}),e.css("z-index",h+""))}),C.notify("Ready")}).fail(function(a){try{t()}catch(b){}E.data("modal",null),C.reject(a)}),E):(u("Invalid data"),E):(u("Object must be visible"),E)}}(jQuery);
\ No newline at end of file
diff --git a/bower.json b/bower.json
index 2a99aed..d88c67d 100644
--- a/bower.json
+++ b/bower.json
@@ -1,6 +1,6 @@
{
"name": "jquerymy",
- "version": "1.2.8",
+ "version": "1.2.9",
"description": "A lightweight jQuery plugin for complex two-way data binding in real time.",
"main": "./jquerymy.js",
"authors": [
diff --git a/jquerymy.js b/jquerymy.js
index 24dda36..f91a7da 100644
--- a/jquerymy.js
+++ b/jquerymy.js
@@ -1,19 +1,19 @@
/*
- * jQuery.my 1.2.8
- * Requires jQuery 1.11.0+, SugarJS 1.3.9-1.4.x
+ * jQuery.my 1.2.9
+ * Requires jQuery 2.0+, SugarJS 1.3.9-1.4.x
*
- * — Fixed #34: styler no more corrupts @keyframes definitions
- * — Fixed #35: $.my.locale(locale) works correctly during runtime
+ * — replaced $.find() with direct .querySelector calls, where possible
+ * — some $.my.modal fixes and improvements
*
* More details at jquerymy.com
*
* (c) @ermouth, thanks @carpogoryanin, @ftescht
- * 2016-11-04
+ * 2017-04-08
*/
;(function ($) {
- var _version = "1.2.8";
+ var _version = "1.2.9";
// Some shortcuts and constants
var TMP, lang = "en",
@@ -875,7 +875,7 @@
if (!!bool) {
//disable all controls
for (i in d.ui) {
- $d = $x.find(i).eq(0);
+ $d = _find($x, i);
dn = $d.my();
if (dn) dn.predisabled = dn.disabled;
_css(true, $d, ":disabled");
@@ -883,7 +883,7 @@
$x.addClass("my-disabled");
} else {
for (i in d.ui) {
- $d = $x.find(i).eq(0);
+ $d = _find($x, i);
dn = $d.my();
onOff = false;
if (dn && dn.predisabled) onOff=true;
@@ -959,14 +959,17 @@
},
redraw: (function ( noRecalc, silent) {
// Redraws the form
- var $x = this, d = $x.my();
- if (d && d.ui) {
- d.ui.each(function (key) {
- var $n = $x.find(key);
- _update($n, noRecalc?N:undefined , d.params.recalcDepth);
+ var $x = this,
+ d = $x.my(),
+ depth = 2;
+ if (d && isO(d.ui)) {
+ depth = d.params.recalcDepth;
+ Object.keys(d.ui).forEach(function (key) {
+ var $n = _find($x, key);
+ _update($n, noRecalc?N:undefined , depth);
if (!noRecalc) {
- if ($n.is(".my-form")) $n.my("redraw");
- if ($n.is(".my-form-list")) $n.trigger("redraw");
+ if ($n.hasClass("my-form")) $n.my("redraw");
+ if ($n.hasClass("my-form-list")) $n.trigger("redraw");
else $n.trigger("check.my");
}
});
@@ -1026,7 +1029,7 @@
ui = (m||{}).ui;
if (ui) {
ui.each(function (key){
- var $we = $o.find(key), f, mw, i;
+ var $we = _find($o, key), f, mw, i;
// close dependent modal
if (mw = $we.data("modal")) {
@@ -1044,16 +1047,14 @@
f = _traverse($we, MY.destroy);
if (isF(f)) f($we);
}catch(e){}
- $we .removeData("formlist")
+ $we.removeData("formlist")
.removeData("myval")
.removeData("my");
});
}
- if (fromDOM && $o.is(".my-form")){
- $o.remove();
- }
- else if ($o.data("formlist") && $o.is(".my-form")) {
+ if (fromDOM && $o.hasClass("my-form"))$o.remove();
+ else if ($o.data("formlist") && $o.hasClass("my-form")) {
var $p = $o.parents(".my-form-list").eq(0);
$o.remove();
$p.trigger("check");
@@ -1085,7 +1086,7 @@
// get cids
cid = ($o.data("my")||{}).cid;
if (cid) cids.push(cid);
- if (! skipChilds ) $o.find(".my-restyle").each(function(){
+ if (! skipChilds ) _find($o, ".my-restyle", true).each(function(){
var $f = $(this),
cid = ($f.data("my")||{}).cid;
if (cid) cids.push(cid);
@@ -1102,14 +1103,20 @@
} else return false;
}),
ui: (function (u) {
- var $x = this, d = $x.my(), a=[], i;
+ var $x = this,
+ d = $x.my(),
+ a=[],
+ i;
if (!d) return N;
+
var ui = $E(true, {}, d.ui);
+
if (!isO(u)) return d.ui;
- for (i in u) if (true || !ui[i]) a.push(i); //controls to (re)init
+
+ for (i in u) a.push(i); //controls to (re)init
d.ui = _normalize(_overlap(d.ui, u));
- for (i=0;i$/.test(ui.list)) ltmpl=ui.list;
else lsel = ui.list||lsel;
if (!ltmpl) {
- var $t0 = $o.find(lsel);
+ var $t0 = lsel == ">*"?$($o[0].children):_find($o, lsel, true);
ltmpl='';
if ($t0.length) {
ltmpl = $(ltmpl).append($t0.eq(0).clone(true)).html();
@@ -1786,12 +1808,13 @@
//right before this moment all controls are irresponsive
$o.each(function () {
var $this = $(this),
+ nodename = $this[0].nodeName,
events,
cm, isControl = false,
ns;
//codemirror fix
- if ($this[0].nodeName == "TEXTAREA") {
+ if (nodename == "TEXTAREA") {
ns = $this[0].nextSibling;
cm = ( ns && ns.CodeMirror)?ns.CodeMirror:null;
if (cm) $this.addClass("my-codemirror");
@@ -1853,12 +1876,12 @@
cleditFrame = $("#cleditCool" + r)[0].contentWindow.document;
else cleditFrame = document.frames["cleditCool" + r].document;
var $ibody = $(cleditFrame).find("body");
- $(cleditFrame).bind('keyup.my', function () {
+ $(cleditFrame).on('keyup.my', function () {
cChange($(this).find("body").html());
});
$this.parent()
.find("div.cleditorToolbar")
- .bind("click.my mouseup.my", function () {
+ .on("click.my mouseup.my", function () {
cChange($ibody.html());
});
$("body").on("click", "div.cleditorPopup", function () {
@@ -1868,7 +1891,7 @@
}
//redactor fix
- else if ($this.is("div.redactor_box textarea")) {
+ else if (nodename == 'TEXTAREA' && $this.parent().hasClass("redactor_box")) {
var editor, version = 'my-redactor-9';
try {
editor = $this.getEditor();
@@ -1878,7 +1901,7 @@
}
if (editor) {
$this.addClass(version);
- editor.bind("input.my keyup.my blur.my", (function ($o) {
+ editor.on("input.my keyup.my blur.my", (function ($o) {
$o.trigger("redactor");
}).fill($this));
}
@@ -1903,8 +1926,8 @@
$this.my()._recalc = (_recalc).debounce(delay);
//bind events to the control
- $this.bind(events, function (evt) {
- if (evt.type==Ch) evt.stopPropagation();
+ $this.on(events, function (evt) {
+ if (evt.type == Ch) evt.stopPropagation();
if (isControl) rd.locktill = _now()+uiNode.delay;
$this.my()._changed($this, $root, uiNode, p);
});
@@ -1933,7 +1956,7 @@
function _broadcast($root, msg) {
var supress = false, fc, next;
if (isO(msg) && msg.channel && msg.message) {
- $root.find(".my-listen-"+_sdbm(msg.channel))
+ _find($root, ".my-listen-"+_sdbm(msg.channel))
.each(function(){
var $c = $(this),
my = $c.data("my"),
@@ -1964,7 +1987,7 @@
if (d) {
if (!d.disabled) {
_history(d.ddata || d.data, d.dparams || d.params);
- if (!silent) $we = d.single?$o:$root.find(d.selector);
+ if (!silent) $we = d.single?$o:_find($root, d.selector);
_update(
$o,
!silent?_field($we, N):N,
@@ -2278,23 +2301,28 @@
if (Object.size(listen)) v.listen = listen;
else v.listen = undefined;
}
+
+ // normalize events
+ if (_has(v, 'events')) {
+ v.events = (v.events+'').replace(/,\s*|\s+/g,' ');
+ }
// unfold 'watch' and extend appropriate 'recalc'
- if (_has(v, "watch")) {
+ if (_has(v, 'watch')) {
if (isS(v.watch)) watch = v.watch.split(re);
else if (isA(v.watch)) watch = v.watch.slice(0);
watch = watch.compact(true).unique();
for (j=0; j*";
+ sel = $formNode.data("listSrc") || $formNode.data("my").listSrc || ">*";
ret={};
- $formNode.find(sel).filter("*:not(.ui-sortable-placeholder)")
+ ctr = 0;
+ (sel == ">*"?$($formNode[0].children):_find($formNode, sel, true))
.each(function (idx){
var $e = $(this);
- if ($e.data("my") && !$e.my("valid")) ret[idx]=$e.my("errors");
+ if ($e.hasClass('ui-sortable-placeholder')) return;
+ if (
+ $e.data("my")
+ && !$e.my("valid")
+ ) ret[ctr] = $e.my("errors");
+ ctr += 1;
});
return ret;
- } else if ($formNode.hasClass("my-form")){
+ }
+ else if ($formNode.hasClass("my-form")){
return !pat?"":$formNode.my("valid")?"":$formNode.my("errors");
}
return "";
@@ -3618,8 +3653,8 @@
//#############################################################################################
-/* jQuery.my.modal 1.1.7
- * Requires Sugar 1.4.~, jQuery 1.11+, $.my 1.2.0+
+/* jQuery.my.modal 1.1.8
+ * Requires Sugar 1.4.~, jQuery 2.0+, $.my 1.2.8+
*
* Modal dialog constructor/manager.
*
@@ -4017,7 +4052,8 @@
if (m.global) {
m.root = $(parent);
m.bgroot = $(parentBack||parent);
- } else m.bgroot = m.root;
+ }
+ else m.bgroot = m.bgroot?$(m.bgroot):m.root;
$r = m.root;
if (!$r.data("modals")) $r.data("modals",{});
@@ -4030,7 +4066,7 @@
// ##### Create modal DOM wrapper #####
// create wrappers if none defined
- $m= $('');
if (!m.root.find(">.my-modal").length) $m.prependTo(m.root);
@@ -4056,7 +4092,7 @@
$bg = m.bgroot.find(">.my-modal-screen");
if (m.screen) {
if (!$bg.length) {
- $bg = $('').prependTo(m.root);
+ $bg = $('').prependTo(m.bgroot);
}
if (m.esc) $bg.on("click.my"+ m.cid, function () { $o.modal(true); });
@@ -4101,7 +4137,8 @@
// try to init form
- $f.my(m.manifest, m.data).then(function () {
+ $f.my(m.manifest, m.data)
+ .then(function () {
var $img, $i, i, focus, ui;
//success
$E(m,{
@@ -4118,6 +4155,8 @@
_measure();
$m.css({top:m.pos.vy+"px"});
_adjust(true);
+
+ $m.removeClass('my-modal-init');
// remember cid in parent form root
$r.data("modals")[m.cid] = m;
@@ -4126,15 +4165,15 @@
M[m.cid] = pi;
// bind event listeners
- $f.bind("commit.my", function(){
+ $f.on("commit.my", function(){
m.commit.delay(50);
return false;
- }).bind("cancel.my", function(){
+ }).on("cancel.my", function(){
m.cancel.delay(50);
return false;
});
- $m.bind("layout.my", function(){
+ $m.on("layout.my", function(){
_adjust();
}.debounce(50));
@@ -4146,7 +4185,7 @@
// esc and enter monitors
if (!m.global && (m.esc || m.enter)) {
- $f.bind("keydown.my", function(e) {
+ $f.on("keydown.my", function(e) {
var code = e.keyCode;
if (code == 27 && m.esc) {
m.cancel();
@@ -4362,8 +4401,8 @@
if (m.screen) {
if (!m.global) $bg.css({
top:0, left:0, position:"absolute",
- width: m.pos.pw+"px",
- height: m.pos.ph+"px",
+ width: $bg.parent().width()+'px',//m.pos.pw+"px",
+ height: $bg.parent().height()+'px',//m.pos.ph+"px",
display:"block",
background:isS(m.screen)? m.screen:'rgba(40,80,120,0.6)',
"z-index":m.z-1
diff --git a/jquerymy.min.js b/jquerymy.min.js
index 757ffc7..499f23d 100644
--- a/jquerymy.min.js
+++ b/jquerymy.min.js
@@ -1,6 +1,5 @@
-/* jQuery.my 1.2.8, © ermouth
+/* jQuery.my 1.2.9, © ermouth
* Requires jQuery 2.0+, SugarJS 1.3.9-1.4.x
* More details at jquerymy.com */
-/*jQuery.my 1.2.8, © ermouth*/
-!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*";if(/^<.+>$/.test(x.list)?f=x.list:i=x.list||i,!f){var l=d.find(i);f="",l.length&&(f=a(f).append(l.eq(0).clone(!0)).html(),l.eq(0).remove())}d.data("formlist")||d.data("formlist",{}),d.data("formlist").generator={manifest:s,delay:(x.delay||v.delay||10)/1.3,template:f,selector:i,parent:A,bind:x.bind,merge:lb(x.merge)?x.merge.bind(A):x.merge?n:!1,hash:lb(x.hash)?x.hash.bind(A):hb(x.hash)?k.fill(void 0,x.hash):fb(x.hash)?m.fill(void 0,x.hash.slice(0)):null,id:lb(x.id)?x.id.bind(A):hb(x.id)?k.fill(void 0,x.id):fb(x.id)?m.fill(void 0,x.id.slice(0)):null,ext:!(!x.id&&!x.hash),stamp:0},d.on("insert.my",function(b,c){b.stopPropagation();var d={what:void 0,where:0};null==c?d.where=1e6:ib(c)?pb(d,c):(hb(c)||jb(c))&&(d.where=c),a(b.target).my("insert",d.where,d.what)}),d.on("remove.my",function(b){b.stopPropagation(),a(b.target).my("remove")})}else try{b=J.call(d,q(A,s),ib(e)?e:void 0)}catch(p){j("$.my subform init of "+g+" failed: "+p.message,p.stack)}}mb(b)?b.then(o,function(a,b){j("Init of subform "+g+" failed with error: "+a,b)}):o()}function j(a,c){b(a,c),y&&y.reject(a,c)}function k(a,b){var c=h(a,b)||"";return"string"==typeof c?c:l(c)}function m(a,b){return l(C(a,b))}function o(){d.each(function(){var b,c,h,i=a(this),j=!1;if("TEXTAREA"==i[0].nodeName&&(h=i[0].nextSibling,c=h&&h.CodeMirror?h.CodeMirror:null,c&&i.addClass("my-codemirror")),b=x.events||M(i,Bb.events),i.hasClass("my-form")?sb(i.data("my"),{dui:x,root:e,selector:g,dparams:v,devents:b,ddata:u.data,container:v.container(i),derrors:u.errors,single:!0}):(i.data("my",{events:b,selector:g,initial:r,previous:r,root:e,container:v.container(i),id:u.id,ui:x,data:u.data,params:v,errors:u.errors,single:1==B}),f._update=x.delay?N.debounce(x.delay):vb,j=!0),j)if(i.cleditor&&i.parent().hasClass("cleditorMain")){var k=i.cleditor()[0];if(k&&k.$frame&&k.$frame[0]){i.addClass("my-cleditor"),sb(i.data("my"),{container:v.container(i)});var l,m=function(a){i.val(a).trigger(db)},n=Number.random(1e5,1e6-1);a(k.$frame[0]).attr("id","cleditCool"+n),l=document.frames?document.frames["cleditCool"+n].document:a("#cleditCool"+n)[0].contentWindow.document;var o=a(l).find("body");a(l).bind("keyup.my",function(){m(a(this).find("body").html())}),i.parent().find("div.cleditorToolbar").bind("click.my mouseup.my",function(){m(o.html())}),a("body").on("click","div.cleditorPopup",function(){m(o.html())})}}else if(i.is("div.redactor_box textarea")){var p,q="my-redactor-9";try{p=i.getEditor(),q="my-redactor-8"}catch(s){p=i.redactor("getEditor")}p&&(i.addClass(q),p.bind("input.my keyup.my blur.my",function(a){a.trigger("redactor")}.fill(i)))}else i.hasClass("ace_editor")?ace.edit(d[0]).on(db,function(a){a.trigger("ace")}.fill(i)):c&&c.on(db,function(a){a.trigger("codemirror")}.fill(i));i.my()._changed=w.debounce(t),i.my()._recalc=H.debounce(t),i.bind(b,function(a){a.type==db&&a.stopPropagation(),j&&(u.locktill=zb()+f.delay),i.my()._changed(i,e,f,v)}),/check(\.my)?/.test(b+"")||i.on("check.my",function(){return i.my()._changed(i,e,f,v,!0),!1}),j||i.off("redraw.my"),i.on("recalc.my, redraw.my",function(a){a.stopPropagation(),i.my()._recalc(i,e,f,v)})}),y&&y.resolve()}var p,r,s,t,u=e.my(),v=(u||{}).params,x=f,y=null,z=0,A=u.manifest,B=0|d.length;return u?(t=f.delay,B?(x.init!=vb&&(p=G(A,x.init,d,u)),mb(p)?(z+=1,y=tb(),p.then(i,function(a,b){j("Init of "+g+" failed: "+a,b)})):i()):c("Not found "+g+" selector.",e),y):(b("Failed to find $root building "+g+" selector."),null)}function v(c,d){ib(d)&&d.channel&&d.message&&c.find(".my-listen-"+l(d.channel)).each(function(){var c,e=a(this),f=e.data("my"),g=void 0;if(f&&f.ui.listen&&lb(f.ui.listen[d.channel])){c=f.ui.listen[d.channel];try{g=c.call(f.manifest||f.root.my().manifest,f.data,d.message,e)}catch(h){b("Listener failed",h.message,h.stack)}void 0!==g&&(null===g?e.trigger("check"):g&&e.trigger("recalc"))}})}function w(a,b,c,d,e){{var f,g=a.data("my");b.data("my")}g&&(g.disabled?g.ddata||N(a,vb,c.recalcDepth||d.recalcDepth):(A(g.ddata||g.data,g.dparams||g.params),e||(f=g.single?a:b.find(g.selector)),N(a,e?vb:z(f,vb),c.recalcDepth||d.recalcDepth),d.change&&d.change.call(a)))}function x(b,c,d){var e=d.compact(),f=e.replace(/:disabled/g,""),g=f!==e,h="self:"===f.to(5);return h&&(f=f.replace(/^self:/g,"")),c.each(function(){var d=a(this),e=d.my(),i=!h&&e?e.container:d;i.toggleClass(f,!!b),g&&void 0!==e&&!!b!=!!e.disabled&&(d.my().disabled=!!b,e._disable||(d.my()._disable=M(c,Bb.offon).fill(void 0,c)),e._disable(!!b))}),c}function y(a,b,c){return a[b](c?"disable":"enable")}function z(a,b){var c,d,e=a.data("myval");return e||(d=M(a,Bb.vals),lb(d)&&(c=d(a,vb),void 0===c?a.data("myval",function(a,b){return vb!=b&&d(a,b),a.val()}.fill(a,void 0)):a.data("myval",d.fill(a,void 0))),e=a.data("myval")),lb(e)?(c=e(),(c!==b&&(0==b||0==c)||c!=b||ib(b))&&(c=e(b)),c):vb}function A(a,b,c,d){var e,f,g,h,i,j,k,l,m,n=b;if(!ib(n)||isNaN(h=n.remember)||!ib(e=n.history))return vb;if(ib(a)&&h){if(j=qb(a,!0),k=zb(),g=rb(e).sort(),g.length&&(k-g.last()=2*h){for(m={},f=h;2*h>f;f++)m[g[f]]=e[g[f]];b.history=m}return d||n.form.trigger(db),n.history[g.last()]}if(!isNaN(a)||a===vb){if(i=parseInt(a)||0,0>i)return vb;if(g=rb(e).sort(),i>=g.length&&(i=g.length-1),l=qb(n.history[g[g.length-i-1]],!0),c){for(m={},f=0;f=i;i++)if(i===h){if(d)return vb!=b?e[f[i]]=b:void 0===e[f[i]]&&(e[f[i]]=vb),e[f[i]];e[f[i]]=b}else 0===i?(e=a[f[0]],g=a):(g=g[f[i-1]],e=e[f[i]]),(null==e||!ib(e)&&(fb(e)&&!isNaN(f[i+1])&&+f[i]>-1))&&(e=g[f[i]]={});return a}function F(a,b,c){var e=ib(b)?b:null;return Object.each(a,function(b,c){var d=typeof c;/^str|^fu/.test(d)&&(a[b]={bind:c})}),Object.each(a,function(b,f){var g,i,k,l=[],m=[],n=/\s?[,;]\s?/;f.recalc&&(hb(f.recalc)?l=f.recalc.split(n):fb(f.recalc)&&(l=f.recalc),l=l.compact(!0).unique()),l.length&&(a[b].recalc=l),null==f.bind&&(f.bind=function(){});var o;if(f.listen&&(o=j(f.listen),f.listen=Object.size(o)?o:void 0),d(f,"watch"))for(hb(f.watch)?m=f.watch.split(n):fb(f.watch)&&(m=f.watch.slice(0)),m=m.compact(!0).unique(),k=0;ki&&h.resolve()}var d,e,f,g=!1,h=tb(),i=a.length;for(e=0;i>e;e++)d=a[e],f=hb(d.ajax)?w.loader:xb,f(d.ajax).then(function(a,d){eb.test(d.ref)&&(null!=a?sb(!0,b,D(a,d.ref.from(5))):(g=!0,v.push("Invalid data for ‘"+d.ref+"’ resource."))),c()}.fill(void 0,d)).fail(function(a,b){v.push("Failed to load ‘"+b.ref+"’ resource."),g=!0,c()}.fill(void 0,d));return h.promise()}function i(a){var c=!1;return eb.test(a)?null!=h(b,a.from(5))&&(c=!0):null!=h(window,a)&&(c=!0),c}function j(a){for(var b in a)a[b]===!1&&(a[b]=i(b));return a}var k,l,m,n,o,p,q,r,s=tb(),t=[],u={},v=[],w=sb(!0,{ajaxTimeout:1e4,loader:Bb.params.loader},c||{}),x={ref:null,ajax:{type:"GET",async:!0,timeout:w.ajaxTimeout}};if(ib(b))if(fb(b.require)){for(n=b.require,k=0;k'+f+""}!$.style||b&&!rb.is(":visible")||(R=K(rb,$),R&&R[0].length&&!b&&(U=a("style#"+S),U.length||(U=a(c(R[0],S)).appendTo(a("body"))),U.data("count",1*U.data("count")+1),rb.data("my").style=U),R&&R[1].length&&(Y=a("style#"+T),Y.length?b&&(a(c(R[1],T)).replaceAll(Y),Y=a("style#"+T)):(Y=a(c(R[1],T)).appendTo(a("body")),P.restyle>-1&&!ob[I]&&(ob[I]=function(){p(!0)}.debounce(P.restyle)),rb.data("my").restyle=p.fill(!0).debounce(0)),rb.data("my").localStyle=Y,b||rb.addClass("my-restyle")))}function q(){var a,b,c=!0;if(b=s($),hb(b))A("Error decoding base64 to local Blob/URL",b),c=!1;else{if(V)for(a=0;a*").clone();try{Z=G($,Q.init,rb,Q)}catch(b){return A(hb(b)?b:b.message,b.stack),rb}}if(mb(Z)?Z.then(function(){w()},function(a,b){A(a,b)}):w(),!gb){if(!rb.my())return A("Internal error initializing controls.",""),rb;rb.data("my").initial=sb(!0,{},ab),a.mobile&&a.mobile.changePage(a.mobile.activePage)}}function w(){function a(a){gb||(b[a]=z(rb.find(a),vb),d-=1,.5>d&&x(b))}var b={},c=Object.keys(N),d=c.length;0===d?y():(rb.addClass(kb),c.forEach(function(b){if(!gb){var c=rb.find(b),d=u(c,rb,N[b],b);qb[b]=c,mb(d)?d.then(a.fill(b)).fail(function(a,c){A("Error building "+b+", "+a,c)}):gb||a(b)}}))}function x(a){var c,d,e,f,g;for(g in N){if(gb)return;if(c=N[g],e=qb[g],f=e.length){c.listen&&(db[g]=e.eq(0));try{d=t(ab,vb,c,e),d==vb&&a[g]!=vb&&void 0!==d&&t(ab,a[g],c,e)}catch(h){b("Transient fail linking "+g+" of form $('.my-form-"+I+"')",h.message,h.stack)}try{d!=vb&&z(e,d),e.eq(0).trigger("check.my")}catch(h){A("Error linking "+g,h.message,h.stack)}}}y()}function y(){rb.removeClass(kb),rb.on("recalc.my, redraw.my",function(a){a.stopPropagation(),rb.my("redraw")}),pb=null,eb.resolve(ab)}function A(a,c){var d;if(gb=!0,b("Form "+H+" failed to initialize.",a,c),Object.keys(qb).forEach(function(a){delete qb[a]}),rb.removeClass(kb),d=jb(a,c),hb(d)||ib(d)&&d.jquery?rb.html(d):d===!0&&rb.html(pb),P.silent)eb.resolve(ab);else{if(!rb.my().ddata){if(rb.removeData("my"),rb.removeClass("my-form"),U)if("1"==U.data("count"))try{U.remove()}catch(e){}else U.data("count",U.data("count")-1);if(Y)try{delete ob[I],Y.remove()}catch(e){}}eb.reject("Form "+H+" failed to initialize: "+a,c)}}var C,E,H,I,J,M,N,P,Q,R,S,T,U,Y,Z,$={},ab={},bb=null,cb=[],db={},eb=tb(),gb=!1,jb=function(){},kb="my-form-init",nb="std",pb="",qb={};if(hb(d)){if(C=yb(d),!C)return eb.reject("No manifest with id "+d+" found in repo."),eb.promise();ib(f)&&ib(e)?(C=sb(C,e),E=f):E=e,nb="repo"}else C=d,E=e;if(!C)return this;Q=ib(E)&&"repo"!=nb?sb(!0,{},C):C;var rb=this.eq(0),ub=rb.my();return ib(ub)&&ub.id&&ub.ui?(c("jQuery.my is already bound.",rb),rb.my("ui",Q.ui),rb.my(_,Q.data),eb.resolve(rb.my(_)).promise()):(P=Q.params||{},P.strict||lb(Q.init)||(P=sb(!0,{},P),O(P)),P=sb(!0,{},Bb.params,P),eb.fail(function(){rb.removeClass(T+" "+S)}),sb(rb,eb.promise()),ib(E)?(ab=m(E,Q.data||{}),Q.data=ab):ab=Q.data||{},$.data=ab,rb.data("my",{data:ab,params:P,promise:eb.promise(),locktill:0}),rb.addClass(kb),Q.inherit&&i(Q),fb(Q.require)?Ab(Q,P).then(g).fail(function(a){o(),A("Linker of the ‘require’ property failed.",a)}):g(),eb.then(n),rb)}function K(a,b){function c(e,f,g,h){var i,j,k,l,m,n=e,o=/@/.test(f),p=f.split("@")[0],q=lb(n);if(o&&(q?h:g).push("@"+f.split("@")[1].trim()+" {"),hb(n)&&(/[\r\n]/.test(n)||n.split("}",3).length>2?n=Cb.css2json(n):g.push(p+(/\{/.test(n)?n:"{"+n+"}"))),fb(n)&&n.length)for(i=0;ie)return d=i,e=g,void 0;j==$&&c(a,i,g+1)}vb!=b[""]&&typeof b[""]!=$&&g>e&&(d=b[""],e=g)}var d=vb,e=0,f="";return c(a,b,1),d}function N(a,c,d){var e,f,g,h,i,j,k,l,m,n,o,p,q=!1,r=!1,s=a,u=s.my(),v="";if(u){if(m=u.selector,n=u.root,n.hasClass("my-form-init"))return{};if(o=n.find(m),p=n.my().ui,q=a.hasClass("my-form"),q?(f=a,g=u.ddata,h=u.dui,i=u.dparams):(f=u.container,g=u.data,h=u.ui,i=u.params),h.bind!=vb){if(j=wb(c)?c:z(o,t(g,vb,h,o)),vb!=h.check){v="Unknown error";try{v=T(g,j,h,o)}catch(w){b("Error "+w.message+" in .check validator for "+m,n,w.stack)}}var y=i.errorCss,A="ui-state-error";try{vb!=c&&(j=z(o,t(g,c,h,o)))}catch(w){v=i.messages.formError||"Error"}if(vb!=h.check)if(r=a.hasClass("my-form-list"),""==v&&(q||f.hasClass(y)))q?u.derrors[m]="":u.errors[m]="",f.removeClass(y),f.attr("title")&&f.attr("title",""),q||r||i.effect(f.find(i.errorTip),!1,i.animate/2),s.removeClass(A),s.find(".ui-widget").removeClass(A);else if(v){if(q)u.derrors[m]=v;else if(r)u.errors[m]=v;else{f.addClass(y),u.errors[m]=v;var B=f.find(i.errorTip).eq(0);B.length?i.effect(B.addClass(y).html(hb(v)?v:"Error"),!0,i.animate):f.attr("title",(hb(v)?v:"Error").stripTags())}s.hasClass("hasDatepicker")&&(s.is("input")?s.addClass(A):s.find(".ui-widget").addClass(A)),s.hasClass("ui-slider")&&s.addClass(A)}}var C=c==vb?j:c;if(h.css)for(k in h.css)l=h.css[k],kb(l)?x(l.test(C),o,k):lb(l)&&x(l.call(n.my().manifest,g,C,o),o,k);var e,D,E=h.recalc,F=[],G={};if(d&&h.recalc&&n.my()){for(p=n.my().ui,e=0;e-1?"":n;case"s":return c==k?"":n;case"o":return k[c]?"":n;case"b":return e.hasClass("my-form-list")?(h=e.data("listSrc")||e.data("my").listSrc||">*",j={},e.find(h).filter("*:not(.ui-sortable-placeholder)").each(function(b){var c=a(this);c.data("my")&&!c.my("valid")&&(j[b]=c.my("errors"))}),j):e.hasClass("my-form")&&k?e.my("valid")?"":e.my("errors"):""}return l.formError||"Error"}return""}var U="1.2.8",V=window.URL||window.webkitURL,W=!document.addEventListener,X=((window.navigator.language||window.navigator.userLanguage||"en")+"").split("-")[0].toLowerCase(),Y="{yyyy}-{MM}-{dd}",Z="{HH}:{mm}",$="object",_="data",ab="array",bb="string",cb="function",db="change",eb=/^this\./,fb=Object.isArray,gb=Object.isBoolean,hb=Object.isString,ib=Object.isObject,jb=Object.isNumber,kb=Object.isRegExp,lb=Object.isFunction,mb=function(a){return null!=a&&typeof a==$&&lb(a.then)},nb=h(a,"my.f.repo")?a.my.f.repo():{_src:{},_name:"Default manifest cache"},ob=h(a,"my.f.restyles")?a.my.f.restyles():{},pb=Object.merge,qb=Object.clone,rb=Object.keys,sb=a.extend,tb=a.Deferred,ub=a.type,vb=null,wb=function(a){return null!==a&&void 0!==a},xb=a.ajax,yb=p,zb=Date.now,Ab=I,Bb={vals:{".my-form":function(a,b){if(a&&a.my){var c=a.my(_);return Object.equal(c,b)?c:a.my(_,b,!0)}return b||vb},".hasDatepicker":function(a,b){wb(b)&&a.datepicker("setDate",""==b?b:Date.create(b));var c=a.datepicker("getDate");return c?c.format(Y):""},".my-tags":function(a,b){return wb(b)&&(hb(b)||jb(b)?a.tags(_,[b+""]):fb(b)&&a.tags(_,b)),a.tags(_)},".ui-draggable":function(a,b){if(wb(b)&&ib(b)){var c={};isNaN(b.left)||(c.left=Number(b.left).ceil(2)+"px"),isNaN(b.top)||(c.top=Number(b.top).ceil(2)+"px"),(c.left||c.top)&&a.css(c)}var d=a.position();return{left:b&&!isNaN(b.left)?(1*b.left).ceil(2):d.left.ceil(2),top:b&&!isNaN(b.top)?(1*b.top).ceil(2):d.top.ceil(2)}},".my-form-list":function(b,c){function e(){var c,d,e=a(this),f=e.data("my");f&&(c=e.data("formlist"),d=c.index,c.hash=w(f.data,d)+"",c.oid=x!==w?x(f.data,d)+"":c.hash),b.trigger("check.my")}function f(a){a.data("my").locktill+z/1.3.my-form",t=!!r.merge,u=r.template||"",v=/\{/.test(u),w=r.hash||l,x=r.id||l,y=r.ext,z=r.delay||50,A="ui-sortable",B="."+A+"-placeholder",C=b.is("."+A),D=!!b.children(B).length,E=[],F=[],G=zb(),H=b.find(C?b.sortable("option","items"):s);if(wb(c)&&fb(c)){if(D)return c;if(i=[],j={},H.each(function(){var b,c=a(this),d=c.data("my");d&&(i.push(d.data),!t&&(b=c.data("formlist"))&&(j[b.oid]=d.data))}),m=g(i,c,"=="),!m){var I=[],K=[],L={},M={};for(F=[],h=0;h1.4*z||G-r.stamp>100||!r.stashed||r.stashed.length!==H.length-(D?1:0)){D&&(o=b.find(">."+A+"-helper"));var N=0;for(H.each(function(b,c){var d,e,f,g=a(c),h=!1;D&&g.hasClass(A+"-helper")||(D&&g.hasClass(A+"-placeholder")&&(g=o),d=g.data("my"),e=g.data("formlist"),d&&e&&(E.push(d.data),N!=e.index&&(e.index=N,h=!0),y&&(f=w(d.data,N)+"",f!==e.hash&&(e.hash=f,h=!0)),N+=1,h&&F.push(g)))}),h=0;h-1){var f=b.eq(d);f.is(":checked")||(f.prop("checked",!0),e&&f.checkboxradio("refresh"))}else e||b.each(function(){a(this).prop("checked",!1)})}if(-1==d)for(var g=0;gForm 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:"Обязательное поле"}},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;ii;i++)h[i]=e.charCodeAt(i);return d=new Blob([h],{type:c||"application/octet-stream"}),lb(b)?(b(d),void 0):d},base64:function(b,c,d){var e=null,f=hb(b)?b:a.my.tojson(b),g=hb(d)?"data:"+d+";base64,":"";if(c){try{e=decodeURIComponent(escape(window.atob(f)))}catch(h){e=null}if(null!==e&&/(^".*"$)|(^\[.*\]$)|(^\{.*\}$)/.test(e))try{e=Cb.fromjson(e)}catch(h){e=null}return e}return g+window.btoa((d===!0?"":"")+unescape(encodeURIComponent(f)))},_s2css:K,css2json:function(a){var b="",c=(a+"").replace(/\/\*[\s\S]+\*\//gm,"").replace(/@charset[^;]+;/gim,"").replace(/[\n\t\s]+/g," ").replace(/\s*@media[^{]*\{/g,function(a){return a.to(-1).trim()+"ᴥ"}).replace(/\}/g,"}ᴥ").replace(/^\n+/g,"").replace(/[\n\s]+$/g,"").split("ᴥ").compact(!0).reduce(function(a,c){var d,e,f,g=c.trim();return"}"==g?b="":/^[^{]+\{[^\}]+\}$/.test(g)?(d=g.to(-1).split("{"),e=" "+d[0].trim(),f=d[1].trim(),";"!=f.last()&&(f+=";"),b?a[b][e]=(a[b][e]||"")+f:a[e]=(a[e]||"")+f):/^@media/.test(g)&&(a[g]={},b=g),a},{});return c}},Db={container:function(a){return M(a,Bb.containers)(a)},data:function(a,b){var c=this;return ib(a)&&(c.my().data=n(c.my().data,a),this.my("redraw",b)),c.my().data},disabled:function(a){var b,c,d,e,f=this,g=f.my();if(!g)return void 0;if(a==vb)return g.disabled;if(a){for(c in g.ui)b=f.find(c).eq(0),d=b.my(),d&&(d.predisabled=d.disabled),x(!0,b,":disabled");f.addClass("my-disabled")}else{for(c in g.ui)b=f.find(c).eq(0),d=b.my(),e=!1,d&&d.predisabled&&(e=!0),x(e,b,":disabled");f.removeClass("my-disabled"),f.my("redraw")}},errors:function(){var b=a(this).my().errors,c={};for(var d in b)b[d]&&hb(b[d])&&(c[d]=b[d]),ib(b[d])&&rb(b[d]).length&&(c[d]=b[d]);return c},find:function(a){var b=this,c=b.my();return c&&c.root&&(b=c.root),b.find(a)},history:function(a,b){return A(a,this.my().params,b)},id:function(a,b){if(hb(a))return yb(a,b);var c=this.my();return c&&c.id?c.id:vb},index:function(){var a=this.my().root&&!this.my().ddata?this.my().root:this;return(a.data("formlist")||{}).index},indom:function(){return e(this)},init:J,insert:function(a,b){var c,d,e=this.hasClass("my-form-list")?this:this.my().root||this,f=e.hasClass("my-form-list")?e:e.parent(".my-form-list"),g=(e.data("formlist")||{}).index,i=b,j=f.data("formlist").generator;if(null==g&&(g=0),c=eb.test(j.bind)?h(f.my().manifest,j.bind.replace(eb,"")):h(f.my().data,j.bind),!ib(i))if(ib(j.manifest))i=qb(j.manifest.data,!0)||{};else{if(f===e)throw"No data to insert, cannot guess when manifest is a function.";i=qb(e.my().manifest.data,!0)}if("before"===a)d=g;else if("after"===a)d=g+1;else{if(isNaN(a))throw"Invalid position for insertion";d=(1*a).clamp(0,c.length)}c.add(i,d),f.trigger("redraw")},manifest:function(a){return"json"==a?Cb.tojson(this.my().manifest):this.my().manifest},promise:function(a){return lb(a)&&this.my().promise.then(a),this.my().promise},radio:function(a,b){this.trigger("radio",hb(a)?{channel:a,message:b}:a)},redraw:function(a,b){var c=this,d=c.my();return d&&d.ui&&(d.ui.each(function(b){var e=c.find(b);N(e,a?vb:void 0,d.params.recalcDepth),a||(e.is(".my-form")&&e.my("redraw"),e.trigger(e.is(".my-form-list")?"redraw":"check.my"))}),!b&&a&&c.trigger(db)),c},remove:function(a){var b,c,d,e,f,g,h,i,j=this;if(!this.my())return vb;if(this.my().root&&!this.my().ddata&&(j=this.my().root),d=j.my(),f=d.data,h=d.cid,i=d.mid,j.unbind(".my"),ib(d)&&d.manifest&&lb(d.manifest.die))try{d.manifest.die.call(d.manifest,j,d.manifest)}catch(k){}if(b=d.style)if("1"==b.data("count"))try{b.remove()}catch(k){}else b.data("count",b.data("count")-1);if(c=d.localStyle)try{delete ob[h],c.remove()}catch(k){}if(window.URL&&(e=d.locFiles)&&e.length)for(var l=0;lg?vb:(d.params.errors&&d.params.errors.values().compact(!0).length?Object.equal(d.data,d.lastCorrect)||(g+=1):Object.equal(e[f.last()],d.data)&&(g+=1),b=A(g,d.params,!0),b&&(o(c.my().data,b),c.my("redraw")),c.my().data)},val:function(a){return z(this,a)},valid:function(){var b=a(this).my().errors,c=0;for(var d in b)b[d]&&hb(b[d])?c++:ib(b[d])&&rb(b[d]).length&&c++;return!c},version:function(){return U}},Eb=Object.keys(Db);a.my||(a.my={}),sb(a.my,{f:a.extend({},Cb),tojson:Cb.tojson,fromjson:Cb.fromjson,radio:function(b,c){v(a(document),hb(b)?{channel:b,message:c}:b)},rules:Bb,locale:function(a){return hb(a)?(X=a.toLowerCase(),Bb.params.locale=X,void 0):X},ajax:function(a){return lb(a)?xb=a:xb.apply(this,f(arguments,0))},cache:function(a,b){return lb(a)?yb=a:yb(a,b)},now:function(a){return lb(a)?(zb=a,void 0):zb()},require:function(a){return lb(a)?Ab=a:Ab.apply(this,f(arguments,0))},chain:function(){function a(){if(d.length&&e){var b,c=d.shift(),f=function(){a.delay(c[1])}.once();try{b=c[0]()}catch(g){f()}mb(b)?(b.then(f,f),f.delay(c[1])):f()}}var b=1,c=1e3,d=[],e=!1,f=function(e,f,g){d.push([e,f||b,g||c]),a()};return f.delay=function(a){return isNaN(a)||(b=(a-0).clamp(0,1e6)),b},f.timeout=function(a){return isNaN(a)||(c=(a-0).clamp(1,1e6)),c},f.start=function(){e=!0,a()},f.stop=function(){e=!1},f}(),version:function(){return U}}),a.my.version.toString=function(){return U},a.fn.my=function(b){var c;if(void 0===b)return this.data("my");if(hb(b)&&"{"==b.substr(0,1)){try{c=JSON.parse(b)}catch(d){}if(c)return Db.init.apply(this,[c].add(f(arguments,1)))}return hb(b)&&Db[b]?Db[b].apply(this,f(arguments,1)):hb(b)&&yb(b,"exist")?Db.init.apply(this,arguments):typeof b!==$&&b?(a.error("Method "+b+" does not exist on jQuery.my"),void 0):Db.init.apply(this,arguments)},a(window).off(".my").on("radio.my",function(b,c){b.stopPropagation(),v(a(document),c)}).on("resize.my",function(){for(var a in ob)try{ob[a]()}catch(b){}}.debounce(67))}(jQuery),function(a){function b(a,b,c){if(i(b))return a+b;if(j(b))return c=e(!0,c,b),a;if(h(b)&&b.length>1&&i(b[1])){for(var d,k,m,n,o,p,q,r,s=b[0],t="",u=1;u'+(s?"<"+c.labelTag+' class="'+c.labelCss+'" '+(c.label?'style="display:inline-block;width:'+c.label+";margin-left:-"+c.label+'" ':"")+">"+s+""+c.labelTag+">":"")+t+""+c.rowTag+">"),a+t}return a}function c(a){var b=a;if(i(b)&&(b=b.split(/[\s,]/).compact(!0)),h(b)){for(var c={},d=0;d',inp:k+'text" {ext}/>',sli:k+'range" {ext}/>',dat:k+'date" {ext}/>',btn:k+'button" {ext}/>',pwd:k+'password" {ext}/>',but:"",div:"{txt}
",spn:"{txt}",sel:"",mul:'',txt:"",err:' {txt}',msg:'{txt}
',val:function(a){if(!h(a.vals))return"";var b=e({style:"",css:""},a);return b.txt=a.vals.reduce(function(a,b){return a+""+b+" "}," "),'{txt}'.assign(b)},"":"<{_tag} {ext}>{txt}{_tag}>"},txt:{sel:function(a){if(!a.vals)return"";var b=c(a.vals);return Object.keys(b).reduce(function(a,c){return a+'"},"")}},params:{styles:{num:"width:30%;",dat:"width:30%;",inp:"width:100%",pwd:"width:100%",but:"width:30%",txt:"width:100%;max-width:100%;min-height:1px;word-break:break-word;",err:"display:none",msg:"display:none"},alias:{number:"num",date:"dat",slider:"sli",textarea:"txt",input:"inp",span:"spn",select:"select",vals:"val"},row:"",rowTag:"div",rowCss:"my-row",label:"",labelTag:"span",labelCss:"my-label"},defaults:{id:"","class":"",style:"",placeholder:"",value:"",rows:1},attnames:{css:"class",plc:"placeholder",val:"value",txt:"",vals:"",tip:"title"}},m={init:function(b,c){return a(this).html(d(b,c))}};a.my||(a.my={}),a.my.formgen=d,a.fn.formgen=function(b){return i(b)&&m[b]?m[b].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof b&&b?(a.error("Method "+b+" does not exist on jQuery.formgen"),void 0):m.init.apply(this,arguments)}}(jQuery),function(a){function b(b,c,d,e){var f,g,i,j,k,n,o;if("object"==typeof c&&c.jquery)c.is("img")&&(n=c,k=c.attr("alt")||c.attr("title")||c.data("text")||"",g=n[0].naturalWidth||n[0].width,f=n[0].naturalHeight||n[0].height,1>f&&(f=1),1>g&&(g=1),j=a(window).width()-90,i=a(window).height()-90,f>i&&(g=g*(i/f)|0,f=i),g>j&&(g=j,f=f*(j/g)|0),o=300>g?300:g,h(b,{source:"image",manifest:{init:function(a){a.html(this.HTML),a.on("click.my","img:eq(0)",function(){a.trigger("cancel")})},HTML:'',ui:{"img:eq(0)":"img",h4:{bind:"text",css:{hide:function(a,b){return!b}}}}},data:{img:n.attr("src"),text:k},esc:!0,screen:!0,width:e||o,focus:!1,global:!0,z:"1995"},d));else if(m(c)&&c.manifest)h(b,c,d);else{if(!l(c))return null;h(b,{source:"html",manifest:{init:function(a){a.html(this.HTML)},HTML:c,ui:{"div:eq(0)":function(){}}},data:{},esc:!0,focus:!1,width:e},d)}return b}var c,d,e={},f="body",g=!1,h=a.extend,i={},j=a.my.f.indom,k=(Object.isArray,Object.isBoolean),l=Object.isString,m=Object.isObject,n=Object.isNumber,o=(Object.isRegExp,Object.isFunction);if(a.fn.modal&&o(a().emulateTransitionEnd)&&(d=a.fn.modal),a(document).off(".modal"),a(document).on("keydown.modal",function(a){var b,c,d=a.keyCode;if(!1!==g&&(13===d||27===d)){if(c=g.data("modal"),b=c.form,27==d&&(c.esc||Object.equal(b.data("my").initial,b.my("data"))))return g.modal(!0),!1;if(13==d&&c.enter)return function(a){a.modal()}.fill(g).delay(50),!1}}),o(a.my.f.getref(a,"my.modal.parent"))){var p=a.my.f.getref(a,"my.modal.parent")().attr("id");p&&(f="#"+p)}e.modal=function(c,d,e){var h,i={},j=a(f),l=j.find(">.my-modal-proxy"),m={global:!0,screen:!0,done:o(d)?d:void 0,z:"1995"};return k(c)||null==c?l.modal(c):(h=a.Deferred(),b(i,c,m,e)?g?h.reject("Locked").promise():(l.length||(l=a('').prependTo(j),l.css({position:"absolute",top:"0",left:"0",margin:"0",padding:"0",width:"1px",height:"0"})),l.modal(i)):h.reject("Invalid data").promise())},e.modal.loading=function(b){a(f).find(">.my-modal").toggleClass("my-modal-loading",!!b)},e.modal.parent=function(b){return b&&a(b).length?(f=b,void 0):a(f)},e.modal.parentBack=function(b){return b&&a(b).length?(c=b,void 0):a(c||f)},e.modal.visible=function(){return!!g},a.my||(a.my={}),a.my.modal=e.modal,a.fn.modal=function(e,p,q){function r(){var b,c,d=window,e=!!J.global,f=x.offset(),g=E.offset(),h=x.scrollTop();J.pos={px:f.left,py:f.top,pw:x.outerWidth(),ph:x.outerHeight(),ox:g.left,oy:g.top,ow:E.outerWidth(),oh:E.outerHeight(),ww:c,wh:b};var i=1*(J.x.match(/\-?\d+(\.\d+)?/)||[0])[0],j=1*(J.y.match(/\-?\d+(\.\d+)?/)||[0])[0],k=J.x.has("left")?-1:J.x.has("right")?1:0,l=J.y.has("top")?-1:J.y.has("bottom")?1:0,m=J.pos.ox+J.pos.ow/2-J.pos.px,o=J.pos.oy+J.pos.oh/2-J.pos.py;if(e&&(J.pos.wh=b=d.innerHeight||a(d).height(),J.pos.ww=c=d.innerWidth||a(d).width(),m=c/2,o=b/2.5),i=J.x.has("%")?J.pos.ow/100*i:i,j=J.y.has("%")?J.pos.oh/100*j:j,J.pos.pix=m,J.pos.piy=o,m=m+k*(J.pos.ow/2)+i*(k>0?-1:1)-(J.width+F)*(k+1)/2,e?(o=(b-J.height-20)/3,10>o&&(o=10)):o=o+l*(J.pos.oh/2)+j*(l>0?-1:1)-(J.height||0)*(l+1)/2,m=m.round(1),o=(o+h).round(1),J.pos.vx=m,J.pos.vy=o,J.bound!==!1&&!J.global){var p=(n(J.bound)?J.bound:0).clamp(-100,100);J.pos.pw-2*pJ.pos.pw-p?J.pos.vx=J.pos.pw-p-J.width-F:J.pos.vxJ.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.length&&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.length||(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").length?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:'×
').prependTo(v).on("click.my",function(){E.modal(J.hardClose)}),z.css({"z-index":("+"===(J.z+"").to(1)?"+":"")+(1*J.z+1)})),y=J.bgroot.find(">.my-modal-screen"),J.screen&&(y.length||(y=a('').prependTo(J.root)),J.esc&&y.on("click.my"+J.cid,function(){E.modal(!0)})),E.data("modal",J),J.silent&&v.on("change.my",function(){return!1}),v.css({display:"block",height:"none",opacity:"0.005","z-index":J.z,width:"auto"}),v.css(J.global?{position:"fixed",left:"50%",top:J.pos.vy+"px",display:"block",height:"none",opacity:"0.005","z-index":J.z,width:"auto","margin-left":"-"+((J.width+F)/2).round(0)+"px"}:{position:"absolute",left:J.pos.vx+"px",top:J.pos.vy+"px",display:"block",height:"none",opacity:"0.005","z-index":J.z,width:"auto"}),w.my(J.manifest,J.data).then(function(){var b,c,d,e,f;if(h(J,{form:w,bg:y,cancel:function(){E.modal(!0)},commit:function(){E.modal()}}),v.data("modal",J),J.height=v.outerHeight(),"manifest"!==J.source&&(J.width=v.width()),r(),v.css({top:J.pos.vy+"px"}),s(!0),x.data("modals")[J.cid]=J,i[J.cid]=C,w.bind("commit.my",function(){return J.commit.delay(50),!1}).bind("cancel.my",function(){return J.cancel.delay(50),!1}),v.bind("layout.my",function(){s()}.debounce(50)),J.global&&(g=E,a("body").css({overflow:"hidden"})),J.global||!J.esc&&!J.enter||w.bind("keydown.my",function(b){var c=b.keyCode;return 27==c&&J.esc?(J.cancel(),!1):13==c&&J.enter&&!a(b.target).is("textarea")?(J.commit.delay(50),!1):void 0}),J.focus===!0){e=!1,f=J.manifest.ui;for(d in f)e||(c=w.find(d),c.length&&c.is("input, textarea","button")&&(e=!0,c.focus()))}else l(J.focus)&&w.find(J.focus).focus();if(b=w.find("img").filter(function(){return""!=a(this).attr("src")}),b.length){var j=function(){"manifest"!==J.source&&v.css({width:"auto"}),s()}.after(b.length);b.each(function(){a(this).bind("load",j)})}J.drag&&a.fn.draggable&&(l(J.drag)?v.draggable({handle:J.drag}):v.draggable(),J.nose&&v.on("dragstart.my",function(){v.removeClass("nose-"+J.nose)})),v.on("mousedown.my",function(b){var c,d=[],e=a(b.currentTarget),f=e.parent(),g=+e.css("z-index"),h=g;f.length&&(c=f.find(">.my-modal").each(function(c,e){var f=+a(e).css("z-index");e!=b.currentTarget&&f>=g&&d.push([f,a(e)]),f>h&&(h=f)}),d.forEach(function(a){a[1].css("z-index",a[0]-1+"")}),e.css("z-index",h+""))}),C.notify("Ready")}).fail(function(a){try{t()}catch(b){}E.data("modal",null),C.reject(a)}),E):(u("Invalid data"),E):(u("Object must be visible"),E)}}(jQuery);
\ No newline at end of file
+!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(ib(b)?b.split("."):gb(b)?b:[""]).reduce(function(a,b){if(null!=a){if(/=/.test(b)){var c=b.split("=",2);return jb(a)?Object.values(a).find(function(a){return jb(a)||gb(a)?a[c[0]]==c[1]:!1}):gb(a)?a.find(function(a){return jb(a)||gb(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(ib(a))a.split(/[,\s]+/).compact(!0).unique().map(function(a){c[a]=d});else if(gb(a))a.compact(!0).unique().map(function(a){c[a]=d});else if(jb(a))for(b in a)c[b]=mb(a[b])?a[b]:function(){return a[b]};return c}function k(a){var b,c=a,d={};if(ib(c)&&(c=c.split(/[,\s]+/)),gb(c)){for(c=c.compact(!0),b=0;b*";if(/^<.+>$/.test(y.list)?f=y.list:i=y.list||i,!f){var l=">*"==i?a(d[0].children):p(d,i,!0);f="",l.length&&(f=a(f).append(l.eq(0).clone(!0)).html(),l.eq(0).remove())}d.data("formlist")||d.data("formlist",{}),d.data("formlist").generator={manifest:t,delay:(y.delay||w.delay||10)/1.3,template:f,selector:i,parent:B,bind:y.bind,merge:mb(y.merge)?y.merge.bind(B):y.merge?n:!1,hash:mb(y.hash)?y.hash.bind(B):ib(y.hash)?k.fill(void 0,y.hash):gb(y.hash)?m.fill(void 0,y.hash.slice(0)):null,id:mb(y.id)?y.id.bind(B):ib(y.id)?k.fill(void 0,y.id):gb(y.id)?m.fill(void 0,y.id.slice(0)):null,ext:!(!y.id&&!y.hash),stamp:0},d.on("insert.my",function(b,c){b.stopPropagation();var d={what:void 0,where:0};null==c?d.where=1e6:jb(c)?qb(d,c):(ib(c)||kb(c))&&(d.where=c),a(b.target).my("insert",d.where,d.what)}),d.on("remove.my",function(b){b.stopPropagation(),a(b.target).my("remove")})}else try{b=K.call(d,r(B,t),jb(e)?e:void 0)}catch(q){j("$.my subform init of "+g+" failed: "+q.message,q.stack)}}nb(b)?b.then(o,function(a,b){j("Init of subform "+g+" failed with error: "+a,b)}):o()}function j(a,c){b(a,c),z&&z.reject(a,c)}function k(a,b){var c=h(a,b)||"";return"string"==typeof c?c:l(c)}function m(a,b){return l(D(a,b))}function o(){d.each(function(){var b,c,h,i=a(this),j=i[0].nodeName,k=!1;if("TEXTAREA"==j&&(h=i[0].nextSibling,c=h&&h.CodeMirror?h.CodeMirror:null,c&&i.addClass("my-codemirror")),b=y.events||N(i,Cb.events),i.hasClass("my-form")?tb(i.data("my"),{dui:y,root:e,selector:g,dparams:w,devents:b,ddata:v.data,container:w.container(i),derrors:v.errors,single:!0}):(i.data("my",{events:b,selector:g,initial:s,previous:s,root:e,container:w.container(i),id:v.id,ui:y,data:v.data,params:w,errors:v.errors,single:1==C}),f._update=y.delay?O.debounce(y.delay):wb,k=!0),k)if(i.cleditor&&i.parent().hasClass("cleditorMain")){var l=i.cleditor()[0];if(l&&l.$frame&&l.$frame[0]){i.addClass("my-cleditor"),tb(i.data("my"),{container:w.container(i)});var m,n=function(a){i.val(a).trigger(eb)},o=Number.random(1e5,1e6-1);a(l.$frame[0]).attr("id","cleditCool"+o),m=document.frames?document.frames["cleditCool"+o].document:a("#cleditCool"+o)[0].contentWindow.document;var p=a(m).find("body");a(m).on("keyup.my",function(){n(a(this).find("body").html())}),i.parent().find("div.cleditorToolbar").on("click.my mouseup.my",function(){n(p.html())}),a("body").on("click","div.cleditorPopup",function(){n(p.html())})}}else if("TEXTAREA"==j&&i.parent().hasClass("redactor_box")){var q,r="my-redactor-9";try{q=i.getEditor(),r="my-redactor-8"}catch(t){q=i.redactor("getEditor")}q&&(i.addClass(r),q.on("input.my keyup.my blur.my",function(a){a.trigger("redactor")}.fill(i)))}else i.hasClass("ace_editor")?ace.edit(d[0]).on(eb,function(a){a.trigger("ace")}.fill(i)):c&&c.on(eb,function(a){a.trigger("codemirror")}.fill(i));i.my()._changed=x.debounce(u),i.my()._recalc=I.debounce(u),i.on(b,function(a){a.type==eb&&a.stopPropagation(),k&&(v.locktill=Ab()+f.delay),i.my()._changed(i,e,f,w)}),/check(\.my)?/.test(b+"")||i.on("check.my",function(){return i.my()._changed(i,e,f,w,!0),!1}),k||i.off("redraw.my"),i.on("recalc.my, redraw.my",function(a){a.stopPropagation(),i.my()._recalc(i,e,f,w)})}),z&&z.resolve()}var q,s,t,u,v=e.my(),w=(v||{}).params,y=f,z=null,A=0,B=v.manifest,C=0|d.length;return v?(u=f.delay,C?(y.init!=wb&&(q=H(B,y.init,d,v)),nb(q)?(A+=1,z=ub(),q.then(i,function(a,b){j("Init of "+g+" failed: "+a,b)})):i()):c("Not found "+g+" selector.",e),z):(b("Failed to find $root building "+g+" selector."),null)}function w(c,d){jb(d)&&d.channel&&d.message&&p(c,".my-listen-"+l(d.channel)).each(function(){var c,e=a(this),f=e.data("my"),g=void 0;if(f&&f.ui.listen&&mb(f.ui.listen[d.channel])){c=f.ui.listen[d.channel];try{g=c.call(f.manifest||f.root.my().manifest,f.data,d.message,e)}catch(h){b("Listener failed",h.message,h.stack)}void 0!==g&&(null===g?e.trigger("check"):g&&e.trigger("recalc"))}})}function x(a,b,c,d,e){{var f,g=a.data("my");b.data("my")}g&&(g.disabled?g.ddata||O(a,wb,c.recalcDepth||d.recalcDepth):(B(g.ddata||g.data,g.dparams||g.params),e||(f=g.single?a:p(b,g.selector)),O(a,e?wb:A(f,wb),c.recalcDepth||d.recalcDepth),d.change&&d.change.call(a)))}function y(b,c,d){var e=d.compact(),f=e.replace(/:disabled/g,""),g=f!==e,h="self:"===f.to(5);return h&&(f=f.replace(/^self:/g,"")),c.each(function(){var d=a(this),e=d.my(),i=!h&&e?e.container:d;i.toggleClass(f,!!b),g&&void 0!==e&&!!b!=!!e.disabled&&(d.my().disabled=!!b,e._disable||(d.my()._disable=N(c,Cb.offon).fill(void 0,c)),e._disable(!!b))}),c}function z(a,b,c){return a[b](c?"disable":"enable")}function A(a,b){var c,d,e=a.data("myval");return e||(d=N(a,Cb.vals),mb(d)&&(c=d(a,wb),void 0===c?a.data("myval",function(a,b){return wb!=b&&d(a,b),a.val()}.fill(a,void 0)):a.data("myval",d.fill(a,void 0))),e=a.data("myval")),mb(e)?(c=e(),(c!==b&&(0==b||0==c)||c!=b||jb(b))&&(c=e(b)),c):wb}function B(a,b,c,d){var e,f,g,h,i,j,k,l,m,n=b;if(!jb(n)||isNaN(h=n.remember)||!jb(e=n.history))return wb;if(jb(a)&&h){if(j=rb(a,!0),k=Ab(),g=sb(e).sort(),g.length&&(k-g.last()=2*h){for(m={},f=h;2*h>f;f++)m[g[f]]=e[g[f]];b.history=m}return d||n.form.trigger(eb),n.history[g.last()]}if(!isNaN(a)||a===wb){if(i=parseInt(a)||0,0>i)return wb;if(g=sb(e).sort(),i>=g.length&&(i=g.length-1),l=rb(n.history[g[g.length-i-1]],!0),c){for(m={},f=0;f=i;i++)if(i===h){if(d)return wb!=b?e[f[i]]=b:void 0===e[f[i]]&&(e[f[i]]=wb),e[f[i]];e[f[i]]=b}else 0===i?(e=a[f[0]],g=a):(g=g[f[i-1]],e=e[f[i]]),(null==e||!jb(e)&&(gb(e)&&!isNaN(f[i+1])&&+f[i]>-1))&&(e=g[f[i]]={});return a}function G(a,b,c){var e=jb(b)?b:null;return Object.each(a,function(b,c){var d=typeof c;/^str|^fu/.test(d)&&(a[b]={bind:c})}),Object.each(a,function(b,f){var g,i,k,l=[],m=[],n=/\s?[,;]\s?/;f.recalc&&(ib(f.recalc)?l=f.recalc.split(n):gb(f.recalc)&&(l=f.recalc),l=l.compact(!0).unique()),l.length&&(a[b].recalc=l),null==f.bind&&(f.bind=function(){});var o;if(f.listen&&(o=j(f.listen),f.listen=Object.size(o)?o:void 0),d(f,"events")&&(f.events=(f.events+"").replace(/,\s*|\s+/g," ")),d(f,"watch"))for(ib(f.watch)?m=f.watch.split(n):gb(f.watch)&&(m=f.watch.slice(0)),m=m.compact(!0).unique(),k=0;ki&&h.resolve()}var d,e,f,g=!1,h=ub(),i=a.length;for(e=0;i>e;e++)d=a[e],f=ib(d.ajax)?w.loader:yb,f(d.ajax).then(function(a,d){fb.test(d.ref)&&(null!=a?tb(!0,b,E(a,d.ref.from(5))):(g=!0,v.push("Invalid data for ‘"+d.ref+"’ resource."))),c()}.fill(void 0,d)).fail(function(a,b){v.push("Failed to load ‘"+b.ref+"’ resource."),g=!0,c()}.fill(void 0,d));return h.promise()}function i(a){var c=!1;return fb.test(a)?null!=h(b,a.from(5))&&(c=!0):null!=h(window,a)&&(c=!0),c}function j(a){for(var b in a)a[b]===!1&&(a[b]=i(b));return a}var k,l,m,n,o,p,q,r,s=ub(),t=[],u={},v=[],w=tb(!0,{ajaxTimeout:1e4,loader:Cb.params.loader},c||{}),x={ref:null,ajax:{type:"GET",async:!0,timeout:w.ajaxTimeout}};if(jb(b))if(gb(b.require)){for(n=b.require,k=0;k'+f+""}!_.style||b&&!sb.is(":visible")||(S=L(sb,_),S&&S[0].length&&!b&&(V=a("style#"+T),V.length||(V=a(c(S[0],T)).appendTo(a("body"))),V.data("count",1*V.data("count")+1),sb.data("my").style=V),S&&S[1].length&&(Z=a("style#"+U),Z.length?b&&(a(c(S[1],U)).replaceAll(Z),Z=a("style#"+U)):(Z=a(c(S[1],U)).appendTo(a("body")),Q.restyle>-1&&!pb[J]&&(pb[J]=function(){q(!0)}.debounce(Q.restyle)),sb.data("my").restyle=q.fill(!0).debounce(0)),sb.data("my").localStyle=Z,b||sb.addClass("my-restyle")))}function r(){var a,b,c=!0;if(b=t(_),ib(b))B("Error decoding base64 to local Blob/URL",b),c=!1;else{if(W)for(a=0;a*").clone();try{$=H(_,R.init,sb,R)}catch(b){return B(ib(b)?b:b.message,b.stack),sb}}if(nb($)?$.then(function(){x()},function(a,b){B(a,b)}):x(),!hb){if(!sb.my())return B("Internal error initializing controls.",""),sb;sb.data("my").initial=tb(!0,{},bb),a.mobile&&a.mobile.changePage(a.mobile.activePage)}}function x(){function a(a){hb||(b[a]=A(p(sb,a),wb),d-=1,.5>d&&y(b))}var b={},c=Object.keys(O),d=c.length;0===d?z():(sb.addClass(lb),c.forEach(function(b){if(!hb){var c=p(sb,b),d=v(c,sb,O[b],b);rb[b]=c,nb(d)?d.then(a.fill(b)).fail(function(a,c){B("Error building "+b+", "+a,c)}):hb||a(b)}}))}function y(a){var c,d,e,f,g;for(g in O){if(hb)return;if(c=O[g],e=rb[g],f=e.length){c.listen&&(eb[g]=e.eq(0));try{d=u(bb,wb,c,e),d==wb&&a[g]!=wb&&void 0!==d&&u(bb,a[g],c,e)}catch(h){b("Transient fail linking "+g+" of form $('.my-form-"+J+"')",h.message,h.stack)}try{d!=wb&&A(e,d),e.eq(0).trigger("check.my")}catch(h){B("Error linking "+g,h.message,h.stack)}}}z()}function z(){sb.removeClass(lb),sb.on("recalc.my, redraw.my",function(a){a.stopPropagation(),sb.my("redraw")}),qb=null,fb.resolve(bb)}function B(a,c){var d;if(hb=!0,b("Form "+I+" failed to initialize.",a,c),Object.keys(rb).forEach(function(a){delete rb[a]}),sb.removeClass(lb),d=kb(a,c),ib(d)||jb(d)&&d.jquery?sb.html(d):d===!0&&sb.html(qb),Q.silent)fb.resolve(bb);else{if(!sb.my().ddata){if(sb.removeData("my"),sb.removeClass("my-form"),V)if("1"==V.data("count"))try{V.remove()}catch(e){}else V.data("count",V.data("count")-1);if(Z)try{delete pb[J],Z.remove()}catch(e){}}fb.reject("Form "+I+" failed to initialize: "+a,c)}}var D,F,I,J,K,N,O,Q,R,S,T,U,V,Z,$,_={},bb={},cb=null,db=[],eb={},fb=ub(),hb=!1,kb=function(){},lb="my-form-init",ob="std",qb="",rb={};if(ib(d)){if(D=zb(d),!D)return fb.reject("No manifest with id "+d+" found in repo."),fb.promise();jb(f)&&jb(e)?(D=tb(D,e),F=f):F=e,ob="repo"}else D=d,F=e;if(!D)return this;R=jb(F)&&"repo"!=ob?tb(!0,{},D):D;var sb=this.eq(0),vb=sb.my();return jb(vb)&&vb.id&&vb.ui?(c("jQuery.my is already bound.",sb),sb.my("ui",R.ui),sb.my(ab,R.data),fb.resolve(sb.my(ab)).promise()):(Q=R.params||{},Q.strict||mb(R.init)||(Q=tb(!0,{},Q),P(Q)),Q=tb(!0,{},Cb.params,Q),fb.fail(function(){sb.removeClass(U+" "+T)}),tb(sb,fb.promise()),jb(F)?(bb=m(F,R.data||{}),R.data=bb):bb=R.data||{},_.data=bb,sb.data("my",{data:bb,params:Q,promise:fb.promise(),locktill:0}),sb.addClass(lb),R.inherit&&i(R),gb(R.require)?Bb(R,Q).then(g).fail(function(a){o(),B("Linker of the ‘require’ property failed.",a)}):g(),fb.then(n),sb)}function L(a,b){function c(e,f,g,h){var i,j,k,l,m,n=e,o=/@/.test(f),p=f.split("@")[0],q=mb(n);if(o&&(q?h:g).push("@"+f.split("@")[1].trim()+" {"),ib(n)&&(/[\r\n]/.test(n)||n.split("}",3).length>2?n=Db.css2json(n):g.push(p+(/\{/.test(n)?n:"{"+n+"}"))),gb(n)&&n.length)for(i=0;ie)return d=i,e=g,void 0;j==_&&c(a,i,g+1)}wb!=b[""]&&typeof b[""]!=_&&g>e&&(d=b[""],e=g)}var d=wb,e=0,f="";return c(a,b,1),d}function O(a,c,d){var e,f,g,h,i,j,k,l,m,n,o,q,r=!1,s=!1,t=a,v=t.my(),w="";if(v){if(m=v.selector,n=v.root,n.hasClass("my-form-init"))return{};if(o=p(n,m),q=n.my().ui,r=a.hasClass("my-form"),r?(f=a,g=v.ddata,h=v.dui,i=v.dparams):(f=v.container,g=v.data,h=v.ui,i=v.params),h.bind!=wb){if(j=xb(c)?c:A(o,u(g,wb,h,o)),wb!=h.check){w="Unknown error";try{w=U(g,j,h,o)}catch(x){b("Error "+x.message+" in .check validator for "+m,n,x.stack)}}var z=i.errorCss,B="ui-state-error";try{wb!=c&&(j=A(o,u(g,c,h,o)))}catch(x){w=i.messages.formError||"Error"}if(wb!=h.check)if(s=a.hasClass("my-form-list"),""==w&&(r||f.hasClass(z)))r?v.derrors[m]="":v.errors[m]="",f.removeClass(z),f.attr("title")&&f.attr("title",""),r||s||i.effect(p(f,i.errorTip),!1,i.animate/2),t.removeClass(B),p(t,".ui-widget").removeClass(B);else if(w){if(r)v.derrors[m]=w;else if(s)v.errors[m]=w;else{f.addClass(z),v.errors[m]=w;var C=p(f,i.errorTip);C.length?i.effect(C.addClass(z).html(ib(w)?w:"Error"),!0,i.animate):f.attr("title",(ib(w)?w:"Error").stripTags())}t.hasClass("hasDatepicker")&&(t.is("input")?t.addClass(B):p(t,".ui-widget").addClass(B)),t.hasClass("ui-slider")&&t.addClass(B)}}var D=c==wb?j:c;if(h.css)for(k in h.css)l=h.css[k],lb(l)?y(l.test(D),o,k):mb(l)&&y(l.call(n.my().manifest,g,D,o),o,k);var e,E,F=h.recalc,G=[],H={};if(d&&h.recalc&&n.my()){for(q=n.my().ui,e=0;e-1?"":o;case"s":return c==k?"":o;case"o":return k[c]?"":o;case"b":return e.hasClass("my-form-list")?(h=e.data("listSrc")||e.data("my").listSrc||">*",j={},l=0,(">*"==h?a(e[0].children):p(e,h,!0)).each(function(){var b=a(this);b.hasClass("ui-sortable-placeholder")||(b.data("my")&&!b.my("valid")&&(j[l]=b.my("errors")),l+=1)}),j):e.hasClass("my-form")&&k?e.my("valid")?"":e.my("errors"):""}return m.formError||"Error"}return""}var V="1.2.9",W=window.URL||window.webkitURL,X=!document.addEventListener,Y=((window.navigator.language||window.navigator.userLanguage||"en")+"").split("-")[0].toLowerCase(),Z="{yyyy}-{MM}-{dd}",$="{HH}:{mm}",_="object",ab="data",bb="array",cb="string",db="function",eb="change",fb=/^this\./,gb=Object.isArray,hb=Object.isBoolean,ib=Object.isString,jb=Object.isObject,kb=Object.isNumber,lb=Object.isRegExp,mb=Object.isFunction,nb=function(a){return null!=a&&typeof a==_&&mb(a.then)},ob=h(a,"my.f.repo")?a.my.f.repo():{_src:{},_name:"Default manifest cache"},pb=h(a,"my.f.restyles")?a.my.f.restyles():{},qb=Object.merge,rb=Object.clone,sb=Object.keys,tb=a.extend,ub=a.Deferred,vb=a.type,wb=null,xb=function(a){return null!==a&&void 0!==a},yb=a.ajax,zb=q,Ab=Date.now,Bb=J,Cb={vals:{".my-form":function(a,b){if(a&&a.my){var c=a.my(ab);return Object.equal(c,b)?c:a.my(ab,b,!0)}return b||wb},".hasDatepicker":function(a,b){xb(b)&&a.datepicker("setDate",""==b?b:Date.create(b));var c=a.datepicker("getDate");return c?c.format(Z):""},".my-tags":function(a,b){return xb(b)&&(ib(b)||kb(b)?a.tags(ab,[b+""]):gb(b)&&a.tags(ab,b)),a.tags(ab)},".ui-draggable":function(a,b){if(xb(b)&&jb(b)){var c={};isNaN(b.left)||(c.left=Number(b.left).ceil(2)+"px"),isNaN(b.top)||(c.top=Number(b.top).ceil(2)+"px"),(c.left||c.top)&&a.css(c)}var d=a.position();return{left:b&&!isNaN(b.left)?(1*b.left).ceil(2):d.left.ceil(2),top:b&&!isNaN(b.top)?(1*b.top).ceil(2):d.top.ceil(2)}},".my-form-list":function(b,c){function e(){var c,d,e=a(this),f=e.data("my");f&&(c=e.data("formlist"),d=c.index,c.hash=w(f.data,d)+"",c.oid=x!==w?x(f.data,d)+"":c.hash),b.trigger("check.my")}function f(a){a.data("my").locktill+z/1.3.my-form",t=!!q.merge,u=q.template||"",v=/\{/.test(u),w=q.hash||l,x=q.id||l,y=q.ext,z=q.delay||50,A="ui-sortable",B="."+A+"-placeholder",C=b.is("."+A),D=!!b.children(B).length,E=[],F=[],G=Ab(),H=b.find(C?b.sortable("option","items"):s);if(xb(c)&&gb(c)){if(D)return c;if(i=[],j={},H.each(function(){var b,c=a(this),d=c.data("my");d&&(i.push(d.data),!t&&(b=c.data("formlist"))&&(j[b.oid]=d.data))}),m=g(i,c,"=="),!m){var I=[],J=[],L={},M={};for(F=[],h=0;h1.4*z||G-q.stamp>100||!q.stashed||q.stashed.length!==H.length-(D?1:0)){D&&(o=b.find(">."+A+"-helper"));var N=0;for(H.each(function(b,c){var d,e,f,g=a(c),h=!1;D&&g.hasClass(A+"-helper")||(D&&g.hasClass(A+"-placeholder")&&(g=o),d=g.data("my"),e=g.data("formlist"),d&&e&&(E.push(d.data),N!=e.index&&(e.index=N,h=!0),y&&(f=w(d.data,N)+"",f!==e.hash&&(e.hash=f,h=!0)),N+=1,h&&F.push(g)))}),h=0;h-1){var f=b.eq(d);f.is(":checked")||(f.prop("checked",!0),e&&f.checkboxradio("refresh"))}else e||b.each(function(){a(this).prop("checked",!1)})}if(-1==d)for(var g=0;gForm 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:"Обязательное поле"}},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){z(b,"selectable",a)},".ui-slider":function(a,b){z(b,"slider",a)},".ui-draggable":function(a,b){z(b,"draggable",a)},".ui-buttonset":function(a,b){z(b,"buttonset",a)},".hasDatepicker":function(a,b){z(b,"datepicker",a)},".my-form":function(a,b){b.my("disabled",!!a)},"div.select2-container+input,div.select2-container+select":function(a,b){z(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")}}}};Cb.params={container:function(a){return N(a,Cb.containers)(a)},change:wb,recalcDepth:2,delay:0,strict:!1,restyle:-1,locale:Y,messages:Object.map(Cb.msg,function(a,b){return b[Y]||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=ub(),c=zb(a+"");return c?b.resolve(c):b.reject(null),b.promise()},ajaxTimeout:1e4};var Db={con:c,clone:function(a){return a.clone?a.clone():a},indom:e,jquix:z,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&&ib(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===db)return b(a.toJSON(),m+(g?1:0),g);if(h=[],gb(a)){for(i=0;ii;i++)h[i]=e.charCodeAt(i);return d=new Blob([h],{type:c||"application/octet-stream"}),mb(b)?(b(d),void 0):d},base64:function(b,c,d){var e=null,f=ib(b)?b:a.my.tojson(b),g=ib(d)?"data:"+d+";base64,":"";if(c){try{e=decodeURIComponent(escape(window.atob(f)))}catch(h){e=null}if(null!==e&&/(^".*"$)|(^\[.*\]$)|(^\{.*\}$)/.test(e))try{e=Db.fromjson(e)}catch(h){e=null}return e}return g+window.btoa((d===!0?"":"")+unescape(encodeURIComponent(f)))},_s2css:L,css2json:function(a){var b="",c=(a+"").replace(/\/\*[\s\S]+\*\//gm,"").replace(/@charset[^;]+;/gim,"").replace(/[\n\t\s]+/g," ").replace(/\s*@media[^{]*\{/g,function(a){return a.to(-1).trim()+"ᴥ"}).replace(/\}/g,"}ᴥ").replace(/^\n+/g,"").replace(/[\n\s]+$/g,"").split("ᴥ").compact(!0).reduce(function(a,c){var d,e,f,g=c.trim();return"}"==g?b="":/^[^{]+\{[^\}]+\}$/.test(g)?(d=g.to(-1).split("{"),e=" "+d[0].trim(),f=d[1].trim(),";"!=f.last()&&(f+=";"),b?a[b][e]=(a[b][e]||"")+f:a[e]=(a[e]||"")+f):/^@media/.test(g)&&(a[g]={},b=g),a},{});return c}},Eb={container:function(a){return N(a,Cb.containers)(a)},data:function(a,b){var c=this;return jb(a)&&(c.my().data=n(c.my().data,a),this.my("redraw",b)),c.my().data},disabled:function(a){var b,c,d,e,f=this,g=f.my();if(!g)return void 0;if(a==wb)return g.disabled;if(a){for(c in g.ui)b=p(f,c),d=b.my(),d&&(d.predisabled=d.disabled),y(!0,b,":disabled");f.addClass("my-disabled")}else{for(c in g.ui)b=p(f,c),d=b.my(),e=!1,d&&d.predisabled&&(e=!0),y(e,b,":disabled");f.removeClass("my-disabled"),f.my("redraw")}},errors:function(){var b=a(this).my().errors,c={};for(var d in b)b[d]&&ib(b[d])&&(c[d]=b[d]),jb(b[d])&&sb(b[d]).length&&(c[d]=b[d]);return c},find:function(a){var b=this,c=b.my();return c&&c.root&&(b=c.root),b.find(a)},history:function(a,b){return B(a,this.my().params,b)},id:function(a,b){if(ib(a))return zb(a,b);var c=this.my();return c&&c.id?c.id:wb},index:function(){var a=this.my().root&&!this.my().ddata?this.my().root:this;return(a.data("formlist")||{}).index},indom:function(){return e(this)},init:K,insert:function(a,b){var c,d,e=this.hasClass("my-form-list")?this:this.my().root||this,f=e.hasClass("my-form-list")?e:e.parent(".my-form-list"),g=(e.data("formlist")||{}).index,i=b,j=f.data("formlist").generator;if(null==g&&(g=0),c=fb.test(j.bind)?h(f.my().manifest,j.bind.replace(fb,"")):h(f.my().data,j.bind),!jb(i))if(jb(j.manifest))i=rb(j.manifest.data,!0)||{};else{if(f===e)throw"No data to insert, cannot guess when manifest is a function.";i=rb(e.my().manifest.data,!0)}if("before"===a)d=g;else if("after"===a)d=g+1;else{if(isNaN(a))throw"Invalid position for insertion";d=(1*a).clamp(0,c.length)}c.add(i,d),f.trigger("redraw")},manifest:function(a){return"json"==a?Db.tojson(this.my().manifest):this.my().manifest},promise:function(a){return mb(a)&&this.my().promise.then(a),this.my().promise},radio:function(a,b){this.trigger("radio",ib(a)?{channel:a,message:b}:a)},redraw:function(a,b){var c=this,d=c.my(),e=2;return d&&jb(d.ui)&&(e=d.params.recalcDepth,Object.keys(d.ui).forEach(function(b){var d=p(c,b);O(d,a?wb:void 0,e),a||(d.hasClass("my-form")&&d.my("redraw"),d.trigger(d.hasClass("my-form-list")?"redraw":"check.my"))}),!b&&a&&c.trigger(eb)),c},remove:function(a){var b,c,d,e,f,g,h,i,j=this;if(!this.my())return wb;if(this.my().root&&!this.my().ddata&&(j=this.my().root),d=j.my(),f=d.data,h=d.cid,i=d.mid,j.unbind(".my"),jb(d)&&d.manifest&&mb(d.manifest.die))try{d.manifest.die.call(d.manifest,j,d.manifest)}catch(k){}if(b=d.style)if("1"==b.data("count"))try{b.remove()}catch(k){}else b.data("count",b.data("count")-1);if(c=d.localStyle)try{delete pb[h],c.remove()}catch(k){}if(window.URL&&(e=d.locFiles)&&e.length)for(var l=0;lg?wb:(d.params.errors&&d.params.errors.values().compact(!0).length?Object.equal(d.data,d.lastCorrect)||(g+=1):Object.equal(e[f.last()],d.data)&&(g+=1),b=B(g,d.params,!0),b&&(o(c.my().data,b),c.my("redraw")),c.my().data)},val:function(a){return A(this,a)},valid:function(){var b=a(this).my().errors,c=0;for(var d in b)b[d]&&ib(b[d])?c++:jb(b[d])&&sb(b[d]).length&&c++;return!c},version:function(){return V}},Fb=Object.keys(Eb);a.my||(a.my={}),tb(a.my,{f:a.extend({},Db),tojson:Db.tojson,fromjson:Db.fromjson,radio:function(b,c){w(a(document),ib(b)?{channel:b,message:c}:b)},rules:Cb,locale:function(a){return ib(a)?(Y=a.toLowerCase(),Cb.params.locale=Y,void 0):Y},ajax:function(a){return mb(a)?yb=a:yb.apply(this,f(arguments,0))},cache:function(a,b){return mb(a)?zb=a:zb(a,b)},now:function(a){return mb(a)?(Ab=a,void 0):Ab()},require:function(a){return mb(a)?Bb=a:Bb.apply(this,f(arguments,0))},chain:function(){function a(){if(d.length&&e){var b,c=d.shift(),f=function(){a.delay(c[1])}.once();try{b=c[0]()}catch(g){f()}nb(b)?(b.then(f,f),f.delay(c[1])):f()}}var b=1,c=1e3,d=[],e=!1,f=function(e,f,g){d.push([e,f||b,g||c]),a()};return f.delay=function(a){return isNaN(a)||(b=(a-0).clamp(0,1e6)),b},f.timeout=function(a){return isNaN(a)||(c=(a-0).clamp(1,1e6)),c},f.start=function(){e=!0,a()},f.stop=function(){e=!1},f}(),version:function(){return V}}),a.my.version.toString=function(){return V},a.fn.my=function(b){var c;if(void 0===b)return this.data("my");if(ib(b)&&"{"==b.substr(0,1)){try{c=JSON.parse(b)}catch(d){}if(c)return Eb.init.apply(this,[c].add(f(arguments,1)))}return ib(b)&&Eb[b]?Eb[b].apply(this,f(arguments,1)):ib(b)&&zb(b,"exist")?Eb.init.apply(this,arguments):typeof b!==_&&b?(a.error("Method "+b+" does not exist on jQuery.my"),void 0):Eb.init.apply(this,arguments)},a(window).off(".my").on("radio.my",function(b,c){b.stopPropagation(),w(a(document),c)}).on("resize.my",function(){for(var a in pb)try{pb[a]()}catch(b){}}.debounce(67))}(jQuery),function(a){function b(a,b,c){if(i(b))return a+b;if(j(b))return c=e(!0,c,b),a;if(h(b)&&b.length>1&&i(b[1])){for(var d,k,m,n,o,p,q,r,s=b[0],t="",u=1;u'+(s?"<"+c.labelTag+' class="'+c.labelCss+'" '+(c.label?'style="display:inline-block;width:'+c.label+";margin-left:-"+c.label+'" ':"")+">"+s+""+c.labelTag+">":"")+t+""+c.rowTag+">"),a+t}return a}function c(a){var b=a;if(i(b)&&(b=b.split(/[\s,]/).compact(!0)),h(b)){for(var c={},d=0;d',inp:k+'text" {ext}/>',sli:k+'range" {ext}/>',dat:k+'date" {ext}/>',btn:k+'button" {ext}/>',pwd:k+'password" {ext}/>',but:"",div:"{txt}
",spn:"{txt}",sel:"",mul:'',txt:"",err:' {txt}',msg:'{txt}
',val:function(a){if(!h(a.vals))return"";var b=e({style:"",css:""},a);return b.txt=a.vals.reduce(function(a,b){return a+""+b+" "}," "),'{txt}'.assign(b)},"":"<{_tag} {ext}>{txt}{_tag}>"},txt:{sel:function(a){if(!a.vals)return"";var b=c(a.vals);return Object.keys(b).reduce(function(a,c){return a+'"},"")}},params:{styles:{num:"width:30%;",dat:"width:30%;",inp:"width:100%",pwd:"width:100%",but:"width:30%",txt:"width:100%;max-width:100%;min-height:1px;word-break:break-word;",err:"display:none",msg:"display:none"},alias:{number:"num",date:"dat",slider:"sli",textarea:"txt",input:"inp",span:"spn",select:"select",vals:"val"},row:"",rowTag:"div",rowCss:"my-row",label:"",labelTag:"span",labelCss:"my-label"},defaults:{id:"","class":"",style:"",placeholder:"",value:"",rows:1},attnames:{css:"class",plc:"placeholder",val:"value",txt:"",vals:"",tip:"title"}},m={init:function(b,c){return a(this).html(d(b,c))}};a.my||(a.my={}),a.my.formgen=d,a.fn.formgen=function(b){return i(b)&&m[b]?m[b].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof b&&b?(a.error("Method "+b+" does not exist on jQuery.formgen"),void 0):m.init.apply(this,arguments)}}(jQuery),function(a){function b(b,c,d,e){var f,g,i,j,k,n,o;if("object"==typeof c&&c.jquery)c.is("img")&&(n=c,k=c.attr("alt")||c.attr("title")||c.data("text")||"",g=n[0].naturalWidth||n[0].width,f=n[0].naturalHeight||n[0].height,1>f&&(f=1),1>g&&(g=1),j=a(window).width()-90,i=a(window).height()-90,f>i&&(g=g*(i/f)|0,f=i),g>j&&(g=j,f=f*(j/g)|0),o=300>g?300:g,h(b,{source:"image",manifest:{init:function(a){a.html(this.HTML),a.on("click.my","img:eq(0)",function(){a.trigger("cancel")})},HTML:'',ui:{"img:eq(0)":"img",h4:{bind:"text",css:{hide:function(a,b){return!b}}}}},data:{img:n.attr("src"),text:k},esc:!0,screen:!0,width:e||o,focus:!1,global:!0,z:"1995"},d));else if(m(c)&&c.manifest)h(b,c,d);else{if(!l(c))return null;h(b,{source:"html",manifest:{init:function(a){a.html(this.HTML)},HTML:c,ui:{"div:eq(0)":function(){}}},data:{},esc:!0,focus:!1,width:e},d)}return b}var c,d,e={},f="body",g=!1,h=a.extend,i={},j=a.my.f.indom,k=(Object.isArray,Object.isBoolean),l=Object.isString,m=Object.isObject,n=Object.isNumber,o=(Object.isRegExp,Object.isFunction);if(a.fn.modal&&o(a().emulateTransitionEnd)&&(d=a.fn.modal),a(document).off(".modal"),a(document).on("keydown.modal",function(a){var b,c,d=a.keyCode;if(!1!==g&&(13===d||27===d)){if(c=g.data("modal"),b=c.form,27==d&&(c.esc||Object.equal(b.data("my").initial,b.my("data"))))return g.modal(!0),!1;if(13==d&&c.enter)return function(a){a.modal()}.fill(g).delay(50),!1}}),o(a.my.f.getref(a,"my.modal.parent"))){var p=a.my.f.getref(a,"my.modal.parent")().attr("id");p&&(f="#"+p)}e.modal=function(c,d,e){var h,i={},j=a(f),l=j.find(">.my-modal-proxy"),m={global:!0,screen:!0,done:o(d)?d:void 0,z:"1995"};return k(c)||null==c?l.modal(c):(h=a.Deferred(),b(i,c,m,e)?g?h.reject("Locked").promise():(l.length||(l=a('').prependTo(j),l.css({position:"absolute",top:"0",left:"0",margin:"0",padding:"0",width:"1px",height:"0"})),l.modal(i)):h.reject("Invalid data").promise())},e.modal.loading=function(b){a(f).find(">.my-modal").toggleClass("my-modal-loading",!!b)},e.modal.parent=function(b){return b&&a(b).length?(f=b,void 0):a(f)},e.modal.parentBack=function(b){return b&&a(b).length?(c=b,void 0):a(c||f)},e.modal.visible=function(){return!!g},a.my||(a.my={}),a.my.modal=e.modal,a.fn.modal=function(e,p,q){function r(){var b,c,d=window,e=!!J.global,f=x.offset(),g=E.offset(),h=x.scrollTop();J.pos={px:f.left,py:f.top,pw:x.outerWidth(),ph:x.outerHeight(),ox:g.left,oy:g.top,ow:E.outerWidth(),oh:E.outerHeight(),ww:c,wh:b};var i=1*(J.x.match(/\-?\d+(\.\d+)?/)||[0])[0],j=1*(J.y.match(/\-?\d+(\.\d+)?/)||[0])[0],k=J.x.has("left")?-1:J.x.has("right")?1:0,l=J.y.has("top")?-1:J.y.has("bottom")?1:0,m=J.pos.ox+J.pos.ow/2-J.pos.px,o=J.pos.oy+J.pos.oh/2-J.pos.py;if(e&&(J.pos.wh=b=d.innerHeight||a(d).height(),J.pos.ww=c=d.innerWidth||a(d).width(),m=c/2,o=b/2.5),i=J.x.has("%")?J.pos.ow/100*i:i,j=J.y.has("%")?J.pos.oh/100*j:j,J.pos.pix=m,J.pos.piy=o,m=m+k*(J.pos.ow/2)+i*(k>0?-1:1)-(J.width+F)*(k+1)/2,e?(o=(b-J.height-20)/3,10>o&&(o=10)):o=o+l*(J.pos.oh/2)+j*(l>0?-1:1)-(J.height||0)*(l+1)/2,m=m.round(1),o=(o+h).round(1),J.pos.vx=m,J.pos.vy=o,J.bound!==!1&&!J.global){var p=(n(J.bound)?J.bound:0).clamp(-100,100);J.pos.pw-2*pJ.pos.pw-p?J.pos.vx=J.pos.pw-p-J.width-F:J.pos.vxJ.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:y.parent().width()+"px",height:y.parent().height()+"px",display:"block",background:l(J.screen)?J.screen:"rgba(40,80,120,0.6)","z-index":J.z-1}):y.length&&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.length||(J.root=a(f))),J.global?(J.root=a(f),J.bgroot=a(c||f)):J.bgroot=J.bgroot?a(J.bgroot):J.root,x=J.root,x.data("modals")||x.data("modals",{}),r(),v=a('
'),J.root.find(">.my-modal").length?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:'×
').prependTo(v).on("click.my",function(){E.modal(J.hardClose)}),z.css({"z-index":("+"===(J.z+"").to(1)?"+":"")+(1*J.z+1)})),y=J.bgroot.find(">.my-modal-screen"),J.screen&&(y.length||(y=a('').prependTo(J.bgroot)),J.esc&&y.on("click.my"+J.cid,function(){E.modal(!0)})),E.data("modal",J),J.silent&&v.on("change.my",function(){return!1}),v.css({display:"block",height:"none",opacity:"0.005","z-index":J.z,width:"auto"}),v.css(J.global?{position:"fixed",left:"50%",top:J.pos.vy+"px",display:"block",height:"none",opacity:"0.005","z-index":J.z,width:"auto","margin-left":"-"+((J.width+F)/2).round(0)+"px"}:{position:"absolute",left:J.pos.vx+"px",top:J.pos.vy+"px",display:"block",height:"none",opacity:"0.005","z-index":J.z,width:"auto"}),w.my(J.manifest,J.data).then(function(){var b,c,d,e,f;if(h(J,{form:w,bg:y,cancel:function(){E.modal(!0)},commit:function(){E.modal()}}),v.data("modal",J),J.height=v.outerHeight(),"manifest"!==J.source&&(J.width=v.width()),r(),v.css({top:J.pos.vy+"px"}),s(!0),v.removeClass("my-modal-init"),x.data("modals")[J.cid]=J,i[J.cid]=C,w.on("commit.my",function(){return J.commit.delay(50),!1}).on("cancel.my",function(){return J.cancel.delay(50),!1}),v.on("layout.my",function(){s()}.debounce(50)),J.global&&(g=E,a("body").css({overflow:"hidden"})),J.global||!J.esc&&!J.enter||w.on("keydown.my",function(b){var c=b.keyCode;return 27==c&&J.esc?(J.cancel(),!1):13==c&&J.enter&&!a(b.target).is("textarea")?(J.commit.delay(50),!1):void 0}),J.focus===!0){e=!1,f=J.manifest.ui;for(d in f)e||(c=w.find(d),c.length&&c.is("input, textarea","button")&&(e=!0,c.focus()))}else l(J.focus)&&w.find(J.focus).focus();if(b=w.find("img").filter(function(){return""!=a(this).attr("src")}),b.length){var j=function(){"manifest"!==J.source&&v.css({width:"auto"}),s()}.after(b.length);b.each(function(){a(this).bind("load",j)})}J.drag&&a.fn.draggable&&(l(J.drag)?v.draggable({handle:J.drag}):v.draggable(),J.nose&&v.on("dragstart.my",function(){v.removeClass("nose-"+J.nose)})),v.on("mousedown.my",function(b){var c,d=[],e=a(b.currentTarget),f=e.parent(),g=+e.css("z-index"),h=g;f.length&&(c=f.find(">.my-modal").each(function(c,e){var f=+a(e).css("z-index");e!=b.currentTarget&&f>=g&&d.push([f,a(e)]),f>h&&(h=f)}),d.forEach(function(a){a[1].css("z-index",a[0]-1+"")}),e.css("z-index",h+""))}),C.notify("Ready")}).fail(function(a){try{t()}catch(b){}E.data("modal",null),C.reject(a)}),E):(u("Invalid data"),E):(u("Object must be visible"),E)}}(jQuery);
\ No newline at end of file
diff --git a/my.jquery.json b/my.jquery.json
index b19c5d8..6349379 100644
--- a/my.jquery.json
+++ b/my.jquery.json
@@ -5,7 +5,7 @@
"keywords": [
"MVVM", "framework", "ui", "form", "validation", "data binding"
],
- "version": "1.2.8",
+ "version": "1.2.9",
"author": {
"name": "ermouth",
"url": "https://github.com/ermouth"
diff --git a/package.json b/package.json
index 4000f58..076127f 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "jquerymy",
- "version": "1.2.8",
+ "version": "1.2.9",
"description": "A lightweight jQuery plugin for complex two-way data binding in real time.",
"homepage": "http://jquerymy.com/",
"author": "ermouth ",