/*! X-editable - v1.5.1 * In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery * http://github.com/vitalets/x-editable * Copyright (c) 2013 Vitaliy Potapov; Licensed MIT */ (function(b){var a=function(d,c){this.options=b.extend({},b.fn.editableform.defaults,c);this.$div=b(d);if(!this.options.scope){this.options.scope=this}};a.prototype={constructor:a,initInput:function(){this.input=this.options.input;this.value=this.input.str2value(this.options.value);this.input.prerender()},initTemplate:function(){this.$form=b(b.fn.editableform.template)},initButtons:function(){var c=this.$form.find(".editable-buttons");c.append(b.fn.editableform.buttons);if(this.options.showbuttons==="bottom"){c.addClass("editable-buttons-bottom")}},render:function(){this.$loading=b(b.fn.editableform.loading);this.$div.empty().append(this.$loading);this.initTemplate();if(this.options.showbuttons){this.initButtons()}else{this.$form.find(".editable-buttons").remove()}this.showLoading();this.isSaving=false;this.$div.triggerHandler("rendering");this.initInput();this.$form.find("div.editable-input").append(this.input.$tpl);this.$div.append(this.$form);b.when(this.input.render()).then(b.proxy(function(){if(!this.options.showbuttons){this.input.autosubmit()}this.$form.find(".editable-cancel").click(b.proxy(this.cancel,this));if(this.input.error){this.error(this.input.error);this.$form.find(".editable-submit").attr("disabled",true);this.input.$input.attr("disabled",true);this.$form.submit(function(d){d.preventDefault()})}else{this.error(false);this.input.$input.removeAttr("disabled");this.$form.find(".editable-submit").removeAttr("disabled");var c=(this.value===null||this.value===undefined||this.value==="")?this.options.defaultValue:this.value;this.input.value2input(c);this.$form.submit(b.proxy(this.submit,this))}this.$div.triggerHandler("rendered");this.showForm();if(this.input.postrender){this.input.postrender()}},this))},cancel:function(){this.$div.triggerHandler("cancel")},showLoading:function(){var c,d;if(this.$form){c=this.$form.outerWidth();d=this.$form.outerHeight();if(c){this.$loading.width(c)}if(d){this.$loading.height(d)}this.$form.hide()}else{c=this.$loading.parent().width();if(c){this.$loading.width(c)}}this.$loading.show()},showForm:function(c){this.$loading.hide();this.$form.show();if(c!==false){this.input.activate()}this.$div.triggerHandler("show")},error:function(g){var e=this.$form.find(".control-group"),f=this.$form.find(".editable-error-block"),c;if(g===false){e.removeClass(b.fn.editableform.errorGroupClass);f.removeClass(b.fn.editableform.errorBlockClass).empty().hide()}else{if(g){c=(""+g).split("\n");for(var d=0;d").text(c[d]).html()}g=c.join("
")}e.addClass(b.fn.editableform.errorGroupClass);f.addClass(b.fn.editableform.errorBlockClass).html(g).show()}},submit:function(g){g.stopPropagation();g.preventDefault();var f=this.input.input2value();var c=this.validate(f);if(b.type(c)==="object"&&c.newValue!==undefined){f=c.newValue;this.input.value2input(f);if(typeof c.msg==="string"){this.error(c.msg);this.showForm();return}}else{if(c){this.error(c);this.showForm();return}}if(!this.options.savenochange&&this.input.value2str(f)==this.input.value2str(this.value)){this.$div.triggerHandler("nochange");return}var d=this.input.value2submit(f);this.isSaving=true;b.when(this.save(d)).done(b.proxy(function(e){this.isSaving=false;var h=typeof this.options.success==="function"?this.options.success.call(this.options.scope,e,f):null;if(h===false){this.error(false);this.showForm(false);return}if(typeof h==="string"){this.error(h);this.showForm();return}if(h&&typeof h==="object"&&h.hasOwnProperty("newValue")){f=h.newValue}this.error(false);this.value=f;this.$div.triggerHandler("save",{newValue:f,submitValue:d,response:e})},this)).fail(b.proxy(function(h){this.isSaving=false;var e;if(typeof this.options.error==="function"){e=this.options.error.call(this.options.scope,h,f)}else{e=typeof h==="string"?h:h.responseText||h.statusText||"Unknown error!"}this.error(e);this.showForm()},this))},save:function(d){this.options.pk=b.fn.editableutils.tryParseJson(this.options.pk,true);var c=(typeof this.options.pk==="function")?this.options.pk.call(this.options.scope):this.options.pk,e=!!(typeof this.options.url==="function"||(this.options.url&&((this.options.send==="always")||(this.options.send==="auto"&&c!==null&&c!==undefined)))),f;if(e){this.showLoading();f={name:this.options.name||"",value:d,pk:c};if(typeof this.options.params==="function"){f=this.options.params.call(this.options.scope,f)}else{this.options.params=b.fn.editableutils.tryParseJson(this.options.params,true);b.extend(f,this.options.params)}if(typeof this.options.url==="function"){return this.options.url.call(this.options.scope,f)}else{return b.ajax(b.extend({url:this.options.url,data:f,type:"POST"},this.options.ajaxOptions))}}},validate:function(c){if(c===undefined){c=this.value}if(typeof this.options.validate==="function"){return this.options.validate.call(this.options.scope,c)}},option:function(c,d){if(c in this.options){this.options[c]=d}if(c==="value"){this.setValue(d)}},setValue:function(c,d){if(d){this.value=this.input.str2value(c)}else{this.value=c}if(this.$form&&this.$form.is(":visible")){this.input.value2input(this.value)}}};b.fn.editableform=function(d){var c=arguments;return this.each(function(){var g=b(this),f=g.data("editableform"),e=typeof d==="object"&&d;if(!f){g.data("editableform",(f=new a(this,e)))}if(typeof d==="string"){f[d].apply(f,Array.prototype.slice.call(c,1))}})};b.fn.editableform.Constructor=a;b.fn.editableform.defaults={type:"text",url:null,params:null,name:null,pk:null,value:null,defaultValue:null,send:"auto",validate:null,success:null,error:null,ajaxOptions:null,showbuttons:true,scope:null,savenochange:false};b.fn.editableform.template='
';b.fn.editableform.loading='
';b.fn.editableform.buttons='';b.fn.editableform.errorGroupClass=null;b.fn.editableform.errorBlockClass="editable-error";b.fn.editableform.engine="jquery"}(window.jQuery));(function(a){a.fn.editableutils={inherit:function(c,b){var d=function(){};d.prototype=b.prototype;c.prototype=new d();c.prototype.constructor=c;c.superclass=b.prototype},setCursorPosition:function(c,d){if(c.setSelectionRange){c.setSelectionRange(d,d)}else{if(c.createTextRange){var b=c.createTextRange();b.collapse(true);b.moveEnd("character",d);b.moveStart("character",d);b.select()}}},tryParseJson:function(b,c){if(typeof b==="string"&&b.length&&b.match(/^[\{\[].*[\}\]]$/)){if(c){try{b=(new Function("return "+b))()}catch(d){}finally{return b}}else{b=(new Function("return "+b))()}}return b},sliceObj:function(h,g,b){var f,e,c={};if(!a.isArray(g)||!g.length){return c}for(var d=0;d").text(b).html()},itemsByValue:function(h,g,e){if(!g||h===null){return[]}if(typeof(e)!=="function"){var c=e||"value";e=function(i){return i[c]}}var d=a.isArray(h),b=[],f=this;a.each(g,function(j,l){if(l.children){b=b.concat(f.itemsByValue(h,l.children,e))}else{if(d){if(a.grep(h,function(i){return i==(l&&typeof l==="object"?e(l):l)}).length){b.push(l)}}else{var k=(l&&(typeof l==="object"))?e(l):l;if(h==k){b.push(l)}}}});return b},createInput:function(c){var e,f,b,d=c.type;if(d==="date"){if(c.mode==="inline"){if(a.fn.editabletypes.datefield){d="datefield"}else{if(a.fn.editabletypes.dateuifield){d="dateuifield"}}}else{if(a.fn.editabletypes.date){d="date"}else{if(a.fn.editabletypes.dateui){d="dateui"}}}if(d==="date"&&!a.fn.editabletypes.date){d="combodate"}}if(d==="datetime"&&c.mode==="inline"){d="datetimefield"}if(d==="wysihtml5"&&!a.fn.editabletypes[d]){d="textarea"}if(typeof a.fn.editabletypes[d]==="function"){e=a.fn.editabletypes[d];f=this.sliceObj(c,this.objectKeys(e.defaults));b=new e(f);return b}else{a.error("Unknown type: "+d);return false}},supportsTransitions:function(){var c=document.body||document.documentElement,f=c.style,g="transition",d=["Moz","Webkit","Khtml","O","ms"];if(typeof f[g]==="string"){return true}g=g.charAt(0).toUpperCase()+g.substr(1);for(var e=0;e");if(this.tip().is(this.innerCss)){this.tip().append(this.$form)}else{this.tip().find(this.innerCss).append(this.$form)}this.renderForm()},hide:function(d){if(!this.tip()||!this.tip().is(":visible")||!this.$element.hasClass("editable-open")){return}if(this.$form.data("editableform").isSaving){this.delayedHide={reason:d};return}else{this.delayedHide=false}this.$element.removeClass("editable-open");this.innerHide();this.$element.triggerHandler("hidden",d||"manual")},innerShow:function(){},innerHide:function(){},toggle:function(d){if(this.container()&&this.tip()&&this.tip().is(":visible")){this.hide()}else{this.show(d)}},setPosition:function(){},save:function(d,f){this.$element.triggerHandler("save",f);this.hide("save")},option:function(d,e){this.options[d]=e;if(d in this.containerOptions){this.containerOptions[d]=e;this.setContainerOption(d,e)}else{this.formOptions[d]=e;if(this.$form){this.$form.editableform("option",d,e)}}},setContainerOption:function(d,e){this.call("option",d,e)},destroy:function(){this.hide();this.innerDestroy();this.$element.off("destroyed");this.$element.removeData("editableContainer")},innerDestroy:function(){},closeOthers:function(d){c(".editable-open").each(function(g,h){if(h===d||c(h).find(d).length){return}var f=c(h),e=f.data("editableContainer");if(!e){return}if(e.options.onblur==="cancel"){f.data("editableContainer").hide("onblur")}else{if(e.options.onblur==="submit"){f.data("editableContainer").tip().find("form").submit()}}})},activate:function(){if(this.tip&&this.tip().is(":visible")&&this.$form){this.$form.data("editableform").input.activate()}}};c.fn.editableContainer=function(e){var d=arguments;return this.each(function(){var h=c(this),j="editableContainer",g=h.data(j),f=typeof e==="object"&&e,i=(f.mode==="inline")?a:b;if(!g){h.data(j,(g=new i(this,f)))}if(typeof e==="string"){g[e].apply(g,Array.prototype.slice.call(d,1))}})};c.fn.editableContainer.Popup=b;c.fn.editableContainer.Inline=a;c.fn.editableContainer.defaults={value:null,placement:"top",autohide:true,onblur:"cancel",anim:false,mode:"popup"};jQuery.event.special.destroyed={remove:function(d){if(d.handler){d.handler()}}}}(window.jQuery));(function(a){a.extend(a.fn.editableContainer.Inline.prototype,a.fn.editableContainer.Popup.prototype,{containerName:"editableform",innerCss:".editable-inline",containerClass:"editable-container editable-inline",initContainer:function(){this.$tip=a("");if(!this.options.anim){this.options.anim=0}},splitOptions:function(){this.containerOptions={};this.formOptions=this.options},tip:function(){return this.$tip},innerShow:function(){this.$element.hide();this.tip().insertAfter(this.$element).show()},innerHide:function(){this.$tip.hide(this.options.anim,a.proxy(function(){this.$element.show();this.innerDestroy()},this))},innerDestroy:function(){if(this.tip()){this.tip().empty().remove()}}})}(window.jQuery));(function(b){var a=function(d,c){this.$element=b(d);this.options=b.extend({},b.fn.editable.defaults,c,b.fn.editableutils.getConfigData(this.$element));if(this.options.selector){this.initLive()}else{this.init()}if(this.options.highlight&&!b.fn.editableutils.supportsTransitions()){this.options.highlight=false}};a.prototype={constructor:a,init:function(){var c=false,d,e;this.options.name=this.options.name||this.$element.attr("id");this.options.scope=this.$element[0];this.input=b.fn.editableutils.createInput(this.options);if(!this.input){return}if(this.options.value===undefined||this.options.value===null){this.value=this.input.html2value(b.trim(this.$element.html()));c=true}else{this.options.value=b.fn.editableutils.tryParseJson(this.options.value,true);if(typeof this.options.value==="string"){this.value=this.input.str2value(this.options.value)}else{this.value=this.options.value}}this.$element.addClass("editable");if(this.input.type==="textarea"){this.$element.addClass("editable-pre-wrapped")}if(this.options.toggle!=="manual"){this.$element.addClass("editable-click");this.$element.on(this.options.toggle+".editable",b.proxy(function(g){if(!this.options.disabled){g.preventDefault()}if(this.options.toggle==="mouseenter"){this.show()}else{var f=(this.options.toggle!=="click");this.toggle(f)}},this))}else{this.$element.attr("tabindex",-1)}if(typeof this.options.display==="function"){this.options.autotext="always"}switch(this.options.autotext){case"always":d=true;break;case"auto":d=!b.trim(this.$element.text()).length&&this.value!==null&&this.value!==undefined&&!c;break;default:d=false}b.when(d?this.render():true).then(b.proxy(function(){if(this.options.disabled){this.disable()}else{this.enable()}this.$element.triggerHandler("init",this)},this))},initLive:function(){var c=this.options.selector;this.options.selector=false;this.options.autotext="never";this.$element.on(this.options.toggle+".editable",c,b.proxy(function(f){var d=b(f.target);if(!d.data("editable")){if(d.hasClass(this.options.emptyclass)){d.empty()}d.editable(this.options).trigger(f)}},this))},render:function(c){if(this.options.display===false){return}if(this.input.value2htmlFinal){return this.input.value2html(this.value,this.$element[0],this.options.display,c)}else{if(typeof this.options.display==="function"){return this.options.display.call(this.$element[0],this.value,c)}else{return this.input.value2html(this.value,this.$element[0])}}},enable:function(){this.options.disabled=false;this.$element.removeClass("editable-disabled");this.handleEmpty(this.isEmpty);if(this.options.toggle!=="manual"){if(this.$element.attr("tabindex")==="-1"){this.$element.removeAttr("tabindex")}}},disable:function(){this.options.disabled=true;this.hide();this.$element.addClass("editable-disabled");this.handleEmpty(this.isEmpty);this.$element.attr("tabindex",-1)},toggleDisabled:function(){if(this.options.disabled){this.enable()}else{this.disable()}},option:function(c,d){if(c&&typeof c==="object"){b.each(c,b.proxy(function(f,e){this.option(b.trim(f),e)},this));return}this.options[c]=d;if(c==="disabled"){return d?this.disable():this.enable()}if(c==="value"){this.setValue(d)}if(this.container){this.container.option(c,d)}if(this.input.option){this.input.option(c,d)}},handleEmpty:function(c){if(this.options.display===false){return}if(c!==undefined){this.isEmpty=c}else{if(typeof(this.input.isEmpty)==="function"){this.isEmpty=this.input.isEmpty(this.$element)}else{this.isEmpty=b.trim(this.$element.html())===""}}if(!this.options.disabled){if(this.isEmpty){this.$element.html(this.options.emptytext);if(this.options.emptyclass){this.$element.addClass(this.options.emptyclass)}}else{if(this.options.emptyclass){this.$element.removeClass(this.options.emptyclass)}}}else{if(this.isEmpty){this.$element.empty();if(this.options.emptyclass){this.$element.removeClass(this.options.emptyclass)}}}},show:function(c){if(this.options.disabled){return}if(!this.container){var d=b.extend({},this.options,{value:this.value,input:this.input});this.$element.editableContainer(d);this.$element.on("save.internal",b.proxy(this.save,this));this.container=this.$element.data("editableContainer")}else{if(this.container.tip().is(":visible")){return}}this.container.show(c)},hide:function(){if(this.container){this.container.hide()}},toggle:function(c){if(this.container&&this.container.tip().is(":visible")){this.hide()}else{this.show(c)}},save:function(g,h){if(this.options.unsavedclass){var d=false;d=d||typeof this.options.url==="function";d=d||this.options.display===false;d=d||h.response!==undefined;d=d||(this.options.savenochange&&this.input.value2str(this.value)!==this.input.value2str(h.newValue));if(d){this.$element.removeClass(this.options.unsavedclass)}else{this.$element.addClass(this.options.unsavedclass)}}if(this.options.highlight){var c=this.$element,f=c.css("background-color");c.css("background-color",this.options.highlight);setTimeout(function(){if(f==="transparent"){f=""}c.css("background-color",f);c.addClass("editable-bg-transition");setTimeout(function(){c.removeClass("editable-bg-transition")},1700)},10)}this.setValue(h.newValue,false,h.response)},validate:function(){if(typeof this.options.validate==="function"){return this.options.validate.call(this,this.value)}},setValue:function(d,e,c){if(e){this.value=this.input.str2value(d)}else{this.value=d}if(this.container){this.container.option("value",this.value)}b.when(this.render(c)).then(b.proxy(function(){this.handleEmpty()},this))},activate:function(){if(this.container){this.container.activate()}},destroy:function(){this.disable();if(this.container){this.container.destroy()}this.input.destroy();if(this.options.toggle!=="manual"){this.$element.removeClass("editable-click");this.$element.off(this.options.toggle+".editable")}this.$element.off("save.internal");this.$element.removeClass("editable editable-open editable-disabled");this.$element.removeData("editable")}};b.fn.editable=function(i){var m={},j=arguments,h="editable";switch(i){case"validate":this.each(function(){var p=b(this),o=p.data(h),n;if(o&&(n=o.validate())){m[o.options.name]=n}});return m;case"getValue":if(arguments.length===2&&arguments[1]===true){m=this.eq(0).data(h).value}else{this.each(function(){var o=b(this),n=o.data(h);if(n&&n.value!==undefined&&n.value!==null){m[n.options.name]=n.input.value2submit(n.value)}})}return m;case"submit":var e=arguments[1]||{},c=this,k=this.editable("validate");if(b.isEmptyObject(k)){var f={};if(c.length===1){var d=c.data("editable");var g={name:d.options.name||"",value:d.input.value2submit(d.value),pk:(typeof d.options.pk==="function")?d.options.pk.call(d.options.scope):d.options.pk};if(typeof d.options.params==="function"){g=d.options.params.call(d.options.scope,g)}else{d.options.params=b.fn.editableutils.tryParseJson(d.options.params,true);b.extend(g,d.options.params)}f={url:d.options.url,data:g,type:"POST"};e.success=e.success||d.options.success;e.error=e.error||d.options.error}else{var l=this.editable("getValue");f={url:e.url,data:l,type:"POST"}}f.success=typeof e.success==="function"?function(n){e.success.call(c,n,e)}:b.noop;f.error=typeof e.error==="function"?function(){e.error.apply(c,arguments)}:b.noop;if(e.ajaxOptions){b.extend(f,e.ajaxOptions)}if(e.data){b.extend(f.data,e.data)}b.ajax(f)}else{if(typeof e.error==="function"){e.error.call(c,k)}}return this}return this.each(function(){var p=b(this),o=p.data(h),n=typeof i==="object"&&i;if(n&&n.selector){o=new a(this,n);return}if(!o){p.data(h,(o=new a(this,n)))}if(typeof i==="string"){o[i].apply(o,Array.prototype.slice.call(j,1))}})};b.fn.editable.defaults={type:"text",disabled:false,toggle:"click",emptytext:"Empty",autotext:"auto",value:null,display:null,emptyclass:"editable-empty",unsavedclass:"editable-unsaved",selector:null,highlight:"#FFFF80"}}(window.jQuery));(function(b){b.fn.editabletypes={};var a=function(){};a.prototype={init:function(d,c,e){this.type=d;this.options=b.extend({},e,c)},prerender:function(){this.$tpl=b(this.options.tpl);this.$input=this.$tpl;this.$clear=null;this.error=null},render:function(){},value2html:function(d,c){b(c)[this.options.escape?"text":"html"](b.trim(d))},html2value:function(c){return b("
").html(c).text()},value2str:function(c){return c},str2value:function(c){return c},value2submit:function(c){return c},value2input:function(c){this.$input.val(c)},input2value:function(){return this.$input.val()},activate:function(){if(this.$input.is(":visible")){this.$input.focus()}},clear:function(){this.$input.val(null)},escape:function(c){return b("
").text(c).html()},autosubmit:function(){},destroy:function(){},setClass:function(){if(this.options.inputclass){this.$input.addClass(this.options.inputclass)}},setAttr:function(c){if(this.options[c]!==undefined&&this.options[c]!==null){this.$input.attr(c,this.options[c])}},option:function(c,d){this.options[c]=d}};a.defaults={tpl:"",inputclass:null,escape:true,scope:null,showbuttons:true};b.extend(b.fn.editabletypes,{abstractinput:a})}(window.jQuery));(function(b){var a=function(c){};b.fn.editableutils.inherit(a,b.fn.editabletypes.abstractinput);b.extend(a.prototype,{render:function(){var c=b.Deferred();this.error=null;this.onSourceReady(function(){this.renderList();c.resolve()},function(){this.error=this.options.sourceError;c.resolve()});return c.promise()},html2value:function(c){return null},value2html:function(f,e,g,d){var c=b.Deferred(),h=function(){if(typeof g==="function"){g.call(e,f,this.sourceData,d)}else{this.value2htmlFinal(f,e)}c.resolve()};if(f===null){h.call(this)}else{this.onSourceReady(h,function(){c.resolve()})}return c.promise()},onSourceReady:function(j,f){var g;if(b.isFunction(this.options.source)){g=this.options.source.call(this.options.scope);this.sourceData=null}else{g=this.options.source}if(this.options.sourceCache&&b.isArray(this.sourceData)){j.call(this);return}try{g=b.fn.editableutils.tryParseJson(g,false)}catch(i){f.call(this);return}if(typeof g==="string"){if(this.options.sourceCache){var h=g,d;if(!b(document).data(h)){b(document).data(h,{})}d=b(document).data(h);if(d.loading===false&&d.sourceData){this.sourceData=d.sourceData;this.doPrepend();j.call(this);return}else{if(d.loading===true){d.callbacks.push(b.proxy(function(){this.sourceData=d.sourceData;this.doPrepend();j.call(this)},this));d.err_callbacks.push(b.proxy(f,this));return}else{d.loading=true;d.callbacks=[];d.err_callbacks=[]}}}var c=b.extend({url:g,type:"get",cache:false,dataType:"json",success:b.proxy(function(e){if(d){d.loading=false}this.sourceData=this.makeArray(e);if(b.isArray(this.sourceData)){if(d){d.sourceData=this.sourceData;b.each(d.callbacks,function(){this.call()})}this.doPrepend();j.call(this)}else{f.call(this);if(d){b.each(d.err_callbacks,function(){this.call()})}}},this),error:b.proxy(function(){f.call(this);if(d){d.loading=false;b.each(d.err_callbacks,function(){this.call()})}},this)},this.options.sourceOptions);b.ajax(c)}else{this.sourceData=this.makeArray(g);if(b.isArray(this.sourceData)){this.doPrepend();j.call(this)}else{f.call(this)}}},doPrepend:function(){if(this.options.prepend===null||this.options.prepend===undefined){return}if(!b.isArray(this.prependData)){if(b.isFunction(this.options.prepend)){this.options.prepend=this.options.prepend.call(this.options.scope)}this.options.prepend=b.fn.editableutils.tryParseJson(this.options.prepend,true);if(typeof this.options.prepend==="string"){this.options.prepend={"":this.options.prepend}}this.prependData=this.makeArray(this.options.prepend)}if(b.isArray(this.prependData)&&b.isArray(this.sourceData)){this.sourceData=this.prependData.concat(this.sourceData)}},renderList:function(){},value2htmlFinal:function(d,c){},makeArray:function(h){var g,j,c=[],f,d;if(!h||typeof h==="string"){return null}if(b.isArray(h)){d=function(l,i){j={value:l,text:i};if(g++>=2){return false}};for(var e=0;e1){if(f.children){f.children=this.makeArray(f.children)}c.push(f)}}}else{c.push({value:f,text:f})}}}else{b.each(h,function(l,i){c.push({value:l,text:i})})}return c},option:function(c,d){this.options[c]=d;if(c==="source"){this.sourceData=null}if(c==="prepend"){this.prependData=null}}});a.defaults=b.extend({},b.fn.editabletypes.abstractinput.defaults,{source:null,prepend:false,sourceError:"Error when loading list",sourceCache:true,sourceOptions:null});b.fn.editabletypes.list=a}(window.jQuery));(function(b){var a=function(c){this.init("text",c,a.defaults)};b.fn.editableutils.inherit(a,b.fn.editabletypes.abstractinput);b.extend(a.prototype,{render:function(){this.renderClear();this.setClass();this.setAttr("placeholder")},activate:function(){if(this.$input.is(":visible")){this.$input.focus();b.fn.editableutils.setCursorPosition(this.$input.get(0),this.$input.val().length);if(this.toggleClear){this.toggleClear()}}},renderClear:function(){if(this.options.clear){this.$clear=b('');this.$input.after(this.$clear).css("padding-right",24).keyup(b.proxy(function(d){if(~b.inArray(d.keyCode,[40,38,9,13,27])){return}clearTimeout(this.t);var c=this;this.t=setTimeout(function(){c.toggleClear(d)},100)},this)).parent().css("position","relative");this.$clear.click(b.proxy(this.clear,this))}},postrender:function(){},toggleClear:function(d){if(!this.$clear){return}var c=this.$input.val().length,f=this.$clear.is(":visible");if(c&&!f){this.$clear.show()}if(!c&&f){this.$clear.hide()}},clear:function(){this.$clear.hide();this.$input.val("").focus()}});a.defaults=b.extend({},b.fn.editabletypes.abstractinput.defaults,{tpl:'',placeholder:null,clear:true});b.fn.editabletypes.text=a}(window.jQuery));(function(b){var a=function(c){this.init("textarea",c,a.defaults)};b.fn.editableutils.inherit(a,b.fn.editabletypes.abstractinput);b.extend(a.prototype,{render:function(){this.setClass();this.setAttr("placeholder");this.setAttr("rows");this.$input.keydown(function(c){if(c.ctrlKey&&c.which===13){b(this).closest("form").submit()}})},activate:function(){b.fn.editabletypes.text.prototype.activate.call(this)}});a.defaults=b.extend({},b.fn.editabletypes.abstractinput.defaults,{tpl:"",inputclass:"input-large",placeholder:null,rows:7});b.fn.editabletypes.textarea=a}(window.jQuery));(function(a){var b=function(c){this.init("select",c,b.defaults)};a.fn.editableutils.inherit(b,a.fn.editabletypes.list);a.extend(b.prototype,{renderList:function(){this.$input.empty();var c=function(f,g){var d;if(a.isArray(g)){for(var e=0;e",d),g[e].children))}else{d.value=g[e].value;if(g[e].disabled){d.disabled=true}f.append(a("