/*! X-editable - v1.4.6 * 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)},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.input.prerender();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 c,f=this.input.input2value();if(c=this.validate(f)){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"}(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(b.trim(this.$element.html())===""){this.isEmpty=true}else{if(b.trim(this.$element.text())!==""){this.isEmpty=false}else{this.isEmpty=!this.$element.height()||!this.$element.width()}}}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(h){var c={},g=arguments,e="editable";switch(h){case"validate":this.each(function(){var m=b(this),l=m.data(e),k;if(l&&(k=l.validate())){c[l.options.name]=k}});return c;case"getValue":if(arguments.length===2&&arguments[1]===true){c=this.eq(0).data(e).value}else{this.each(function(){var l=b(this),k=l.data(e);if(k&&k.value!==undefined&&k.value!==null){c[k.options.name]=k.input.value2submit(k.value)}})}return c;case"submit":var f=arguments[1]||{},j=this,i=this.editable("validate"),d;if(b.isEmptyObject(i)){d=this.editable("getValue");if(f.data){b.extend(d,f.data)}b.ajax(b.extend({url:f.url,data:d,type:"POST"},f.ajaxOptions)).success(function(k){if(typeof f.success==="function"){f.success.call(j,k,f)}}).error(function(){if(typeof f.error==="function"){f.error.apply(j,arguments)}})}else{if(typeof f.error==="function"){f.error.call(j,i)}}return this}return this.each(function(){var m=b(this),l=m.data(e),k=typeof h==="object"&&h;if(k&&k.selector){l=new a(this,k);return}if(!l){m.data(e,(l=new a(this,k)))}if(typeof h==="string"){l[h].apply(l,Array.prototype.slice.call(g,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).text(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:"input-medium",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(i,d){var f;if(b.isFunction(this.options.source)){f=this.options.source.call(this.options.scope);this.sourceData=null}else{f=this.options.source}if(this.options.sourceCache&&b.isArray(this.sourceData)){i.call(this);return}try{f=b.fn.editableutils.tryParseJson(f,false)}catch(h){d.call(this);return}if(typeof f==="string"){if(this.options.sourceCache){var g=f,c;if(!b(document).data(g)){b(document).data(g,{})}c=b(document).data(g);if(c.loading===false&&c.sourceData){this.sourceData=c.sourceData;this.doPrepend();i.call(this);return}else{if(c.loading===true){c.callbacks.push(b.proxy(function(){this.sourceData=c.sourceData;this.doPrepend();i.call(this)},this));c.err_callbacks.push(b.proxy(d,this));return}else{c.loading=true;c.callbacks=[];c.err_callbacks=[]}}}b.ajax({url:f,type:"get",cache:false,dataType:"json",success:b.proxy(function(e){if(c){c.loading=false}this.sourceData=this.makeArray(e);if(b.isArray(this.sourceData)){if(c){c.sourceData=this.sourceData;b.each(c.callbacks,function(){this.call()})}this.doPrepend();i.call(this)}else{d.call(this);if(c){b.each(c.err_callbacks,function(){this.call()})}}},this),error:b.proxy(function(){d.call(this);if(c){c.loading=false;b.each(c.err_callbacks,function(){this.call()})}},this)})}else{this.sourceData=this.makeArray(f);if(b.isArray(this.sourceData)){this.doPrepend();i.call(this)}else{d.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});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("