x-editable-rails 0.0.3 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +1 -1
  3. data/README.md +31 -14
  4. data/lib/x-editable-rails.rb +5 -1
  5. data/lib/x-editable-rails/version.rb +1 -1
  6. data/lib/x-editable-rails/view_helpers.rb +20 -0
  7. data/vendor/assets/images/editable/clear.png +0 -0
  8. data/vendor/assets/images/{loading.gif → editable/loading.gif} +0 -0
  9. data/vendor/assets/javascripts/{bootstrap-editable.js → editable/bootstrap-editable.js} +3816 -1425
  10. data/vendor/assets/javascripts/{jquery-editable-poshytip.js → editable/jquery-editable-poshytip.js} +2171 -541
  11. data/vendor/assets/javascripts/{jqueryui-editable.js → editable/jqueryui-editable.js} +2080 -478
  12. data/vendor/assets/javascripts/{rails-editable.js.coffee → editable/rails.js.coffee} +3 -0
  13. data/vendor/assets/stylesheets/editable/bootstrap-editable.css +495 -0
  14. data/vendor/assets/stylesheets/{jquery-editable.css → editable/jquery-editable.css} +63 -18
  15. data/vendor/assets/stylesheets/{jqueryui-editable.css → editable/jqueryui-editable.css} +63 -18
  16. metadata +79 -66
  17. data/.gitignore +0 -19
  18. data/Gemfile +0 -4
  19. data/Rakefile +0 -1
  20. data/vendor/assets/javascripts/bootstrap-editable-inline.js +0 -3769
  21. data/vendor/assets/javascripts/bootstrap-editable-inline.min.js +0 -5
  22. data/vendor/assets/javascripts/bootstrap-editable.min.js +0 -5
  23. data/vendor/assets/javascripts/jquery-editable-inline.js +0 -2892
  24. data/vendor/assets/javascripts/jquery-editable-inline.min.js +0 -5
  25. data/vendor/assets/javascripts/jquery-editable-poshytip.min.js +0 -5
  26. data/vendor/assets/javascripts/jqueryui-editable-inline.js +0 -2916
  27. data/vendor/assets/javascripts/jqueryui-editable-inline.min.js +0 -5
  28. data/vendor/assets/javascripts/jqueryui-editable.min.js +0 -5
  29. data/vendor/assets/stylesheets/bootstrap-editable.css +0 -434
  30. data/x-editable-rails.gemspec +0 -19
@@ -1,5 +0,0 @@
1
- /*! X-editable - v1.3.0
2
- * In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery
3
- * http://github.com/vitalets/x-editable
4
- * Copyright (c) 2012 Vitaliy Potapov; Licensed MIT */
5
- (function(e){var t=function(t,n){this.options=e.extend({},e.fn.editableform.defaults,n),this.$div=e(t),this.options.scope||(this.options.scope=this),this.initInput()};t.prototype={constructor:t,initInput:function(){var t,n;if(typeof e.fn.editabletypes[this.options.type]!="function"){e.error("Unknown type: "+this.options.type);return}t=e.fn.editabletypes[this.options.type],n=e.fn.editableutils.sliceObj(this.options,e.fn.editableutils.objectKeys(t.defaults)),this.input=new t(n),this.value=this.input.str2value(this.options.value)},initTemplate:function(){this.$form=e(e.fn.editableform.template)},initButtons:function(){this.$form.find(".editable-buttons").append(e.fn.editableform.buttons)},render:function(){this.$loading=e(e.fn.editableform.loading),this.$div.empty().append(this.$loading),this.showLoading(),this.initTemplate(),this.options.showbuttons?this.initButtons():this.$form.find(".editable-buttons").remove(),this.$div.triggerHandler("rendering"),e.when(this.input.render()).then(e.proxy(function(){this.$form.find("div.editable-input").append(this.input.$input),this.options.showbuttons||this.input.autosubmit(),this.input.$clear&&this.$form.find("div.editable-input").append(e('<div class="editable-clear">').append(this.input.$clear)),this.$div.append(this.$form),this.$form.find(".editable-cancel").click(e.proxy(this.cancel,this)),this.input.error?(this.error(this.input.error),this.$form.find(".editable-submit").attr("disabled",!0),this.input.$input.attr("disabled",!0),this.$form.submit(function(e){e.preventDefault()})):(this.error(!1),this.input.$input.removeAttr("disabled"),this.$form.find(".editable-submit").removeAttr("disabled"),this.input.value2input(this.value),this.$form.submit(e.proxy(this.submit,this))),this.$div.triggerHandler("rendered"),this.showForm()},this))},cancel:function(){this.$div.triggerHandler("cancel")},showLoading:function(){var e;this.$form?(this.$loading.width(this.$form.outerWidth()),this.$loading.height(this.$form.outerHeight()),this.$form.hide()):(e=this.$loading.parent().width(),e&&this.$loading.width(e)),this.$loading.show()},showForm:function(e){this.$loading.hide(),this.$form.show(),e!==!1&&this.input.activate(),this.$div.triggerHandler("show")},error:function(t){var n=this.$form.find(".control-group"),r=this.$form.find(".editable-error-block");t===!1?(n.removeClass(e.fn.editableform.errorGroupClass),r.removeClass(e.fn.editableform.errorBlockClass).empty().hide()):(n.addClass(e.fn.editableform.errorGroupClass),r.addClass(e.fn.editableform.errorBlockClass).text(t).show())},submit:function(t){t.stopPropagation(),t.preventDefault();var n,r=this.input.input2value();if(n=this.validate(r)){this.error(n),this.showForm();return}if(!this.options.savenochange&&this.input.value2str(r)==this.input.value2str(this.value)){this.$div.triggerHandler("nochange");return}e.when(this.save(r)).done(e.proxy(function(e){var t=typeof this.options.success=="function"?this.options.success.call(this.options.scope,e,r):null;if(t===!1){this.error(!1),this.showForm(!1);return}if(typeof t=="string"){this.error(t),this.showForm();return}t&&typeof t=="object"&&t.hasOwnProperty("newValue")&&(r=t.newValue),this.error(!1),this.value=r,this.$div.triggerHandler("save",{newValue:r,response:e})},this)).fail(e.proxy(function(e){this.error(typeof e=="string"?e:e.responseText||e.statusText||"Unknown error!"),this.showForm()},this))},save:function(t){var n=this.input.value2submit(t);this.options.pk=e.fn.editableutils.tryParseJson(this.options.pk,!0);var r=typeof this.options.pk=="function"?this.options.pk.call(this.options.scope):this.options.pk,i=!!(typeof this.options.url=="function"||this.options.url&&(this.options.send==="always"||this.options.send==="auto"&&r)),s;if(i)return this.showLoading(),s={name:this.options.name||"",value:n,pk:r},typeof this.options.params=="function"?s=this.options.params.call(this.options.scope,s):(this.options.params=e.fn.editableutils.tryParseJson(this.options.params,!0),e.extend(s,this.options.params)),typeof this.options.url=="function"?this.options.url.call(this.options.scope,s):e.ajax(e.extend({url:this.options.url,data:s,type:"POST"},this.options.ajaxOptions))},validate:function(e){e===undefined&&(e=this.value);if(typeof this.options.validate=="function")return this.options.validate.call(this.options.scope,e)},option:function(e,t){this.options[e]=t,e==="value"&&this.setValue(t)},setValue:function(e,t){t?this.value=this.input.str2value(e):this.value=e}},e.fn.editableform=function(n){var r=arguments;return this.each(function(){var i=e(this),s=i.data("editableform"),o=typeof n=="object"&&n;s||i.data("editableform",s=new t(this,o)),typeof n=="string"&&s[n].apply(s,Array.prototype.slice.call(r,1))})},e.fn.editableform.Constructor=t,e.fn.editableform.defaults={type:"text",url:null,params:null,name:null,pk:null,value:null,send:"auto",validate:null,success:null,ajaxOptions:null,showbuttons:!0,scope:null,savenochange:!1},e.fn.editableform.template='<form class="form-inline editableform"><div class="control-group"><div><div class="editable-input"></div><div class="editable-buttons"></div></div><div class="editable-error-block"></div></div></form>',e.fn.editableform.loading='<div class="editableform-loading"></div>',e.fn.editableform.buttons='<button type="submit" class="editable-submit">ok</button><button type="button" class="editable-cancel">cancel</button>',e.fn.editableform.errorGroupClass=null,e.fn.editableform.errorBlockClass="editable-error"})(window.jQuery),function(e){e.fn.editableutils={inherit:function(e,t){var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.superclass=t.prototype},setCursorPosition:function(e,t){if(e.setSelectionRange)e.setSelectionRange(t,t);else if(e.createTextRange){var n=e.createTextRange();n.collapse(!0),n.moveEnd("character",t),n.moveStart("character",t),n.select()}},tryParseJson:function(e,t){if(typeof e=="string"&&e.length&&e.match(/^[\{\[].*[\}\]]$/))if(t)try{e=(new Function("return "+e))()}catch(n){}finally{return e}else e=(new Function("return "+e))();return e},sliceObj:function(t,n,r){var i,s,o={};if(!e.isArray(n)||!n.length)return o;for(var u=0;u<n.length;u++){i=n[u],t.hasOwnProperty(i)&&(o[i]=t[i]);if(r===!0)continue;s=i.toLowerCase(),t.hasOwnProperty(s)&&(o[i]=t[s])}return o},getConfigData:function(t){var n={};return e.each(t.data(),function(e,t){if(typeof t!="object"||t&&typeof t=="object"&&t.constructor===Object)n[e]=t}),n},objectKeys:function(e){if(Object.keys)return Object.keys(e);if(e!==Object(e))throw new TypeError("Object.keys called on a non-object");var t=[],n;for(n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},escape:function(t){return e("<div>").text(t).html()}}}(window.jQuery),function(e){var t=function(e,t){this.init(e,t)};t.prototype={containerName:null,innerCss:null,init:function(n,r){this.$element=e(n),this.options=e.extend({},e.fn.editableContainer.defaults,e.fn.editableutils.getConfigData(this.$element),r),this.splitOptions(),this.initContainer(),this.$element.on("destroyed",e.proxy(function(){this.destroy()},this)),e(document).data("editable-handlers-attached")||(e(document).on("keyup.editable",function(t){t.which===27&&e(".editable-open").editableContainer("hide")}),e(document).on("click.editable",function(n){var r=e(n.target);if(r.is(".editable-container")||r.parents(".editable-container").length||r.parents(".ui-datepicker-header").length)return;t.prototype.closeOthers(n.target)}),e(document).data("editable-handlers-attached",!0))},splitOptions:function(){this.containerOptions={},this.formOptions={};var t=e.fn[this.containerName].defaults;for(var n in this.options)n in t?this.containerOptions[n]=this.options[n]:this.formOptions[n]=this.options[n]},initContainer:function(){this.call(this.containerOptions)},initForm:function(){return this.formOptions.scope=this.$element[0],this.$form=e("<div>").editableform(this.formOptions).on({save:e.proxy(this.save,this),cancel:e.proxy(function(){this.hide("cancel")},this),nochange:e.proxy(function(){this.hide("nochange")},this),show:e.proxy(this.setPosition,this),rendering:e.proxy(this.setPosition,this),rendered:e.proxy(function(){this.$element.triggerHandler("shown")},this)}),this.$form},tip:function(){return this.container().$tip},container:function(){return this.$element.data(this.containerName)},call:function(){this.$element[this.containerName].apply(this.$element,arguments)},show:function(e){this.$element.addClass("editable-open"),e!==!1&&this.closeOthers(this.$element[0]),this.innerShow()},innerShow:function(){this.call("show"),this.tip().addClass("editable-container"),this.initForm(),this.tip().find(this.innerCss).empty().append(this.$form),this.$form.editableform("render")},hide:function(e){if(!this.tip()||!this.tip().is(":visible")||!this.$element.hasClass("editable-open"))return;this.$element.removeClass("editable-open"),this.innerHide(),this.$element.triggerHandler("hidden",e)},innerHide:function(){this.call("hide")},toggle:function(e){this.tip&&this.tip().is(":visible")?this.hide():this.show(e)},setPosition:function(){},save:function(e,t){this.hide("save"),this.$element.triggerHandler("save",t)},option:function(e,t){this.options[e]=t,e in this.containerOptions?(this.containerOptions[e]=t,this.setContainerOption(e,t)):(this.formOptions[e]=t,this.$form&&this.$form.editableform("option",e,t))},setContainerOption:function(e,t){this.call("option",e,t)},destroy:function(){this.call("destroy")},closeOthers:function(t){e(".editable-open").each(function(n,r){if(r===t||e(r).find(t).length)return;var i=e(r),s=i.data("editableContainer");if(!s)return;s.options.onblur==="cancel"?i.data("editableContainer").hide("onblur"):s.options.onblur==="submit"&&i.data("editableContainer").tip().find("form").submit()})},activate:function(){this.tip&&this.tip().is(":visible")&&this.$form&&this.$form.data("editableform").input.activate()}},e.fn.editableContainer=function(n){var r=arguments;return this.each(function(){var i=e(this),s="editableContainer",o=i.data(s),u=typeof n=="object"&&n;o||i.data(s,o=new t(this,u)),typeof n=="string"&&o[n].apply(o,Array.prototype.slice.call(r,1))})},e.fn.editableContainer.Constructor=t,e.fn.editableContainer.defaults={value:null,placement:"top",autohide:!0,onblur:"cancel"},jQuery.event.special.destroyed={remove:function(e){e.handler&&e.handler()}}}(window.jQuery),function(e){var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.editable.defaults,e.fn.editableutils.getConfigData(this.$element),n),this.init()};t.prototype={constructor:t,init:function(){var t,n=!1,r,i;if(!e.fn.editableContainer){e.error("You must define $.fn.editableContainer via including corresponding file (e.g. editable-popover.js)");return}this.options.name=this.options.name||this.$element.attr("id");if(typeof e.fn.editabletypes[this.options.type]!="function"){e.error("Unknown type: "+this.options.type);return}t=e.fn.editabletypes[this.options.type],this.typeOptions=e.fn.editableutils.sliceObj(this.options,e.fn.editableutils.objectKeys(t.defaults)),this.input=new t(this.typeOptions),this.options.value===undefined||this.options.value===null?(this.value=this.input.html2value(e.trim(this.$element.html())),n=!0):(this.options.value=e.fn.editableutils.tryParseJson(this.options.value,!0),typeof this.options.value=="string"?this.value=this.input.str2value(this.options.value):this.value=this.options.value),this.$element.addClass("editable"),this.options.toggle!=="manual"?(this.$element.addClass("editable-click"),this.$element.on(this.options.toggle+".editable",e.proxy(function(e){e.preventDefault();if(this.options.toggle==="mouseenter")this.show();else{var t=this.options.toggle!=="click";this.toggle(t)}},this))):this.$element.attr("tabindex",-1),r=!n&&this.value!==null&&this.value!==undefined,r&=this.options.autotext==="always"||this.options.autotext==="auto"&&!this.$element.text().length,e.when(r?this.render():!0).then(e.proxy(function(){this.options.disabled?this.disable():this.enable(),this.$element.triggerHandler("init",this)},this))},render:function(){if(this.options.display===!1)return;return this.input.options.hasOwnProperty("source")?this.input.value2html(this.value,this.$element[0],this.options.display):typeof this.options.display=="function"?this.options.display.call(this.$element[0],this.value):this.input.value2html(this.value,this.$element[0])},enable:function(){this.options.disabled=!1,this.$element.removeClass("editable-disabled"),this.handleEmpty(),this.options.toggle!=="manual"&&this.$element.attr("tabindex")==="-1"&&this.$element.removeAttr("tabindex")},disable:function(){this.options.disabled=!0,this.hide(),this.$element.addClass("editable-disabled"),this.handleEmpty(),this.$element.attr("tabindex",-1)},toggleDisabled:function(){this.options.disabled?this.enable():this.disable()},option:function(t,n){if(t&&typeof t=="object"){e.each(t,e.proxy(function(t,n){this.option(e.trim(t),n)},this));return}this.options[t]=n;if(t==="disabled"){n?this.disable():this.enable();return}t==="value"&&this.setValue(n),this.container&&this.container.option(t,n)},handleEmpty:function(){if(this.options.display===!1)return;var t="editable-empty";this.options.disabled?this.$element.hasClass(t)&&(this.$element.empty(),this.$element.removeClass(t)):e.trim(this.$element.text())===""?this.$element.addClass(t).text(this.options.emptytext):this.$element.removeClass(t)},show:function(t){if(this.options.disabled)return;if(!this.container){var n=e.extend({},this.options,{value:this.value});this.$element.editableContainer(n),this.$element.on("save.internal",e.proxy(this.save,this)),this.container=this.$element.data("editableContainer")}else if(this.container.tip().is(":visible"))return;this.container.show(t)},hide:function(){this.container&&this.container.hide()},toggle:function(e){this.container&&this.container.tip().is(":visible")?this.hide():this.show(e)},save:function(e,t){typeof this.options.url!="function"&&this.options.display!==!1&&t.response===undefined&&this.input.value2str(this.value)!==this.input.value2str(t.newValue)?this.$element.addClass("editable-unsaved"):this.$element.removeClass("editable-unsaved"),this.setValue(t.newValue)},validate:function(){if(typeof this.options.validate=="function")return this.options.validate.call(this,this.value)},setValue:function(t,n){n?this.value=this.input.str2value(t):this.value=t,this.container&&this.container.option("value",this.value),e.when(this.render()).then(e.proxy(function(){this.handleEmpty()},this))},activate:function(){this.container&&this.container.activate()}},e.fn.editable=function(n){var r={},i=arguments,s="editable";switch(n){case"validate":return this.each(function(){var t=e(this),n=t.data(s),i;n&&(i=n.validate())&&(r[n.options.name]=i)}),r;case"getValue":return this.each(function(){var t=e(this),n=t.data(s);n&&n.value!==undefined&&n.value!==null&&(r[n.options.name]=n.input.value2submit(n.value))}),r;case"submit":var o=arguments[1]||{},u=this,a=this.editable("validate"),f;return e.isEmptyObject(a)?(f=this.editable("getValue"),o.data&&e.extend(f,o.data),e.ajax(e.extend({url:o.url,data:f,type:"POST"},o.ajaxOptions)).success(function(e){typeof o.success=="function"&&o.success.call(u,e,o)}).error(function(){typeof o.error=="function"&&o.error.apply(u,arguments)})):typeof o.error=="function"&&o.error.call(u,a),this}return this.each(function(){var r=e(this),o=r.data(s),u=typeof n=="object"&&n;o||r.data(s,o=new t(this,u)),typeof n=="string"&&o[n].apply(o,Array.prototype.slice.call(i,1))})},e.fn.editable.defaults={type:"text",disabled:!1,toggle:"click",emptytext:"Empty",autotext:"auto",value:null,display:null}}(window.jQuery),function(e){e.fn.editabletypes={};var t=function(){};t.prototype={init:function(t,n,r){this.type=t,this.options=e.extend({},r,n),this.$input=null,this.$clear=null,this.error=null},render:function(){this.$input=e(this.options.tpl),this.options.inputclass&&this.$input.addClass(this.options.inputclass),this.options.placeholder&&this.$input.attr("placeholder",this.options.placeholder)},value2html:function(t,n){e(n).text(t)},html2value:function(t){return e("<div>").html(t).text()},value2str:function(e){return e},str2value:function(e){return e},value2submit:function(e){return e},value2input:function(e){this.$input.val(e)},input2value:function(){return this.$input.val()},activate:function(){this.$input.is(":visible")&&this.$input.focus()},clear:function(){this.$input.val(null)},escape:function(t){return e("<div>").text(t).html()},autosubmit:function(){}},t.defaults={tpl:"",inputclass:"input-medium",name:null},e.extend(e.fn.editabletypes,{abstractinput:t})}(window.jQuery),function(e){var t=function(e){};e.fn.editableutils.inherit(t,e.fn.editabletypes.abstractinput),e.extend(t.prototype,{render:function(){t.superclass.render.call(this);var n=e.Deferred();return this.error=null,this.sourceData=null,this.prependData=null,this.onSourceReady(function(){this.renderList(),n.resolve()},function(){this.error=this.options.sourceError,n.resolve()}),n.promise()},html2value:function(e){return null},value2html:function(t,n,r){var i=e.Deferred();return this.onSourceReady(function(){typeof r=="function"?r.call(n,t,this.sourceData):this.value2htmlFinal(t,n),i.resolve()},function(){i.resolve()}),i.promise()},onSourceReady:function(t,n){if(e.isArray(this.sourceData)){t.call(this);return}try{this.options.source=e.fn.editableutils.tryParseJson(this.options.source,!1)}catch(r){n.call(this);return}if(typeof this.options.source=="string"){if(this.options.sourceCache){var i=this.options.source+(this.options.name?"-"+this.options.name:""),s;e(document).data(i)||e(document).data(i,{}),s=e(document).data(i);if(s.loading===!1&&s.sourceData){this.sourceData=s.sourceData,t.call(this);return}if(s.loading===!0){s.callbacks.push(e.proxy(function(){this.sourceData=s.sourceData,t.call(this)},this)),s.err_callbacks.push(e.proxy(n,this));return}s.loading=!0,s.callbacks=[],s.err_callbacks=[]}e.ajax({url:this.options.source,type:"get",cache:!1,data:this.options.name?{name:this.options.name}:{},dataType:"json",success:e.proxy(function(r){s&&(s.loading=!1),this.sourceData=this.makeArray(r),e.isArray(this.sourceData)?(this.doPrepend(),t.call(this),s&&(s.sourceData=this.sourceData,e.each(s.callbacks,function(){this.call()}))):(n.call(this),s&&e.each(s.err_callbacks,function(){this.call()}))},this),error:e.proxy(function(){n.call(this),s&&(s.loading=!1,e.each(s.err_callbacks,function(){this.call()}))},this)})}else this.sourceData=this.makeArray(this.options.source),e.isArray(this.sourceData)?(this.doPrepend(),t.call(this)):n.call(this)},doPrepend:function(){if(this.options.prepend===null||this.options.prepend===undefined)return;e.isArray(this.prependData)||(this.options.prepend=e.fn.editableutils.tryParseJson(this.options.prepend,!0),typeof this.options.prepend=="string"&&(this.options.prepend={"":this.options.prepend}),this.prependData=this.makeArray(this.options.prepend)),e.isArray(this.prependData)&&e.isArray(this.sourceData)&&(this.sourceData=this.prependData.concat(this.sourceData))},renderList:function(){},value2htmlFinal:function(e,t){},makeArray:function(t){var n,r,i=[],s;if(!t||typeof t=="string")return null;if(e.isArray(t)){s=function(e,t){r={value:e,text:t};if(n++>=2)return!1};for(var o=0;o<t.length;o++)typeof t[o]=="object"?(n=0,e.each(t[o],s),n===1?i.push(r):n>1&&t[o].hasOwnProperty("value")&&t[o].hasOwnProperty("text")&&i.push(t[o])):i.push({value:t[o],text:t[o]})}else e.each(t,function(e,t){i.push({value:e,text:t})});return i},itemByVal:function(t){if(e.isArray(this.sourceData))for(var n=0;n<this.sourceData.length;n++)if(this.sourceData[n].value==t)return this.sourceData[n]}}),t.defaults=e.extend({},e.fn.editabletypes.abstractinput.defaults,{source:null,prepend:!1,sourceError:"Error when loading list",sourceCache:!0}),e.fn.editabletypes.list=t}(window.jQuery),function(e){var t=function(e){this.init("text",e,t.defaults)};e.fn.editableutils.inherit(t,e.fn.editabletypes.abstractinput),e.extend(t.prototype,{activate:function(){this.$input.is(":visible")&&(this.$input.focus(),e.fn.editableutils.setCursorPosition(this.$input.get(0),this.$input.val().length))}}),t.defaults=e.extend({},e.fn.editabletypes.abstractinput.defaults,{tpl:'<input type="text">',placeholder:null}),e.fn.editabletypes.text=t}(window.jQuery),function(e){var t=function(e){this.init("textarea",e,t.defaults)};e.fn.editableutils.inherit(t,e.fn.editabletypes.abstractinput),e.extend(t.prototype,{render:function(){t.superclass.render.call(this),this.$input.keydown(function(t){t.ctrlKey&&t.which===13&&e(this).closest("form").submit()})},value2html:function(t,n){var r="",i;if(t){i=t.split("\n");for(var s=0;s<i.length;s++)i[s]=e("<div>").text(i[s]).html();r=i.join("<br>")}e(n).html(r)},html2value:function(t){if(!t)return"";var n=t.split(/<br\s*\/?>/i);for(var r=0;r<n.length;r++)n[r]=e("<div>").html(n[r]).text();return n.join("\n")},activate:function(){this.$input.is(":visible")&&(e.fn.editableutils.setCursorPosition(this.$input.get(0),this.$input.val().length),this.$input.focus())}}),t.defaults=e.extend({},e.fn.editabletypes.abstractinput.defaults,{tpl:"<textarea></textarea>",inputclass:"input-large",placeholder:null}),e.fn.editabletypes.textarea=t}(window.jQuery),function(e){var t=function(e){this.init("select",e,t.defaults)};e.fn.editableutils.inherit(t,e.fn.editabletypes.list),e.extend(t.prototype,{renderList:function(){if(!e.isArray(this.sourceData))return;for(var t=0;t<this.sourceData.length;t++)this.$input.append(e("<option>",{value:this.sourceData[t].value}).text(this.sourceData[t].text));this.$input.on("keydown.editable",function(t){t.which===13&&e(this).closest("form").submit()})},value2htmlFinal:function(e,n){var r="",i=this.itemByVal(e);i&&(r=i.text),t.superclass.constructor.superclass.value2html(r,n)},autosubmit:function(){this.$input.off("keydown.editable").on("change.editable",function(){e(this).closest("form").submit()})}}),t.defaults=e.extend({},e.fn.editabletypes.list.defaults,{tpl:"<select></select>"}),e.fn.editabletypes.select=t}(window.jQuery),function(e){var t=function(e){this.init("checklist",e,t.defaults)};e.fn.editableutils.inherit(t,e.fn.editabletypes.list),e.extend(t.prototype,{renderList:function(){var t,n;if(!e.isArray(this.sourceData))return;for(var r=0;r<this.sourceData.length;r++)t=e("<label>").append(e("<input>",{type:"checkbox",value:this.sourceData[r].value,name:this.options.name})).append(e("<span>").text(" "+this.sourceData[r].text)),e("<div>").append(t).appendTo(this.$input)},value2str:function(t){return e.isArray(t)?t.sort().join(e.trim(this.options.separator)):""},str2value:function(t){var n,r=null;return typeof t=="string"&&t.length?(n=new RegExp("\\s*"+e.trim(this.options.separator)+"\\s*"),r=t.split(n)):e.isArray(t)&&(r=t),r},value2input:function(t){var n=this.$input.find('input[type="checkbox"]');n.removeAttr("checked"),e.isArray(t)&&t.length&&n.each(function(n,r){var i=e(r);e.each(t,function(e,t){i.val()==t&&i.attr("checked","checked")})})},input2value:function(){var t=[];return this.$input.find("input:checked").each(function(n,r){t.push(e(r).val())}),t},value2htmlFinal:function(t,n){var r=[],i=e.grep(this.sourceData,function(n){return e.grep(t,function(e){return e==n.value}).length});i.length?(e.each(i,function(t,n){r.push(e.fn.editableutils.escape(n.text))}),e(n).html(r.join("<br>"))):e(n).empty()},activate:function(){this.$input.find('input[type="checkbox"]').first().focus()},autosubmit:function(){this.$input.find('input[type="checkbox"]').on("keydown",function(t){t.which===13&&e(this).closest("form").submit()})}}),t.defaults=e.extend({},e.fn.editabletypes.list.defaults,{tpl:"<div></div>",inputclass:"editable-checklist",separator:","}),e.fn.editabletypes.checklist=t}(window.jQuery),function(e){var t=function(e){this.init("password",e,t.defaults)};e.fn.editableutils.inherit(t,e.fn.editabletypes.text),e.extend(t.prototype,{value2html:function(t,n){t?e(n).text("[hidden]"):e(n).empty()},html2value:function(e){return null}}),t.defaults=e.extend({},e.fn.editabletypes.text.defaults,{tpl:'<input type="password">'}),e.fn.editabletypes.password=t}(window.jQuery),function(e){var t=function(e){this.init("email",e,t.defaults)};e.fn.editableutils.inherit(t,e.fn.editabletypes.text),t.defaults=e.extend({},e.fn.editabletypes.text.defaults,{tpl:'<input type="email">'}),e.fn.editabletypes.email=t}(window.jQuery),function(e){var t=function(e){this.init("url",e,t.defaults)};e.fn.editableutils.inherit(t,e.fn.editabletypes.text),t.defaults=e.extend({},e.fn.editabletypes.text.defaults,{tpl:'<input type="url">'}),e.fn.editabletypes.url=t}(window.jQuery),function(e){var t=function(e){this.init("tel",e,t.defaults)};e.fn.editableutils.inherit(t,e.fn.editabletypes.text),t.defaults=e.extend({},e.fn.editabletypes.text.defaults,{tpl:'<input type="tel">'}),e.fn.editabletypes.tel=t}(window.jQuery),function(e){var t=function(e){this.init("number",e,t.defaults)};e.fn.editableutils.inherit(t,e.fn.editabletypes.text),e.extend(t.prototype,{render:function(){t.superclass.render.call(this),this.options.min!==null&&this.$input.attr("min",this.options.min),this.options.max!==null&&this.$input.attr("max",this.options.max),this.options.step!==null&&this.$input.attr("step",this.options.step)}}),t.defaults=e.extend({},e.fn.editabletypes.text.defaults,{tpl:'<input type="number">',inputclass:"input-mini",min:null,max:null,step:null}),e.fn.editabletypes.number=t}(window.jQuery),function(e){var t=function(e){this.init("range",e,t.defaults)};e.fn.editableutils.inherit(t,e.fn.editabletypes.number),e.extend(t.prototype,{render:function(){this.$input=e(this.options.tpl);var t=this.$input.filter("input");this.options.inputclass&&t.addClass(this.options.inputclass),this.options.min!==null&&t.attr("min",this.options.min),this.options.max!==null&&t.attr("max",this.options.max),this.options.step!==null&&t.attr("step",this.options.step),t.on("input",function(){e(this).siblings("output").text(e(this).val())})},activate:function(){this.$input.filter("input").focus()}}),t.defaults=e.extend({},e.fn.editabletypes.number.defaults,{tpl:'<input type="range"><output style="width: 30px; display: inline-block"></output>',inputclass:"input-medium"}),e.fn.editabletypes.range=t}(window.jQuery),function(e){e.extend(e.fn.editableform.Constructor.prototype,{initButtons:function(){this.$form.find(".editable-buttons").append(e.fn.editableform.buttons),this.$form.find(".editable-submit").button({icons:{primary:"ui-icon-check"},text:!1}).removeAttr("title"),this.$form.find(".editable-cancel").button({icons:{primary:"ui-icon-closethick"},text:!1}).removeAttr("title")}}),e.fn.editableform.errorGroupClass=null,e.fn.editableform.errorBlockClass="ui-state-error"}(window.jQuery),function(e){e.extend(e.fn.editableContainer.Constructor.prototype,{containerName:"editableform",innerCss:null,initContainer:function(){this.options.anim||(this.options.anim=0)},splitOptions:function(){this.containerOptions={},this.formOptions=this.options},tip:function(){return this.$form},innerShow:function(){this.$element.hide(),this.$form&&this.$form.remove(),this.initForm(),this.tip().addClass("editable-container").addClass("editable-inline"),this.$form.insertAfter(this.$element),this.$form.show(this.options.anim),this.$form.editableform("render")},innerHide:function(){this.$form.hide(this.options.anim,e.proxy(function(){this.$element.show()},this))},destroy:function(){this.tip().remove()}}),e.fn.editableContainer.defaults=e.extend({},e.fn.editableContainer.defaults,{anim:"fast"})}(window.jQuery),function(e){var t=function(n){this.init("dateui",n,t.defaults);var r=e.fn.editableutils.sliceObj(this.options,["format"]);this.options.datepicker=e.extend({},t.defaults.datepicker,r,n.datepicker),this.options.viewformat||(this.options.viewformat=this.options.datepicker.format),this.options.viewformat=this.options.viewformat.replace("yyyy","yy"),this.options.datepicker.format=this.options.datepicker.format.replace("yyyy","yy"),this.options.datepicker.dateFormat=this.options.datepicker.format};e.fn.editableutils.inherit(t,e.fn.editabletypes.abstractinput),e.extend(t.prototype,{render:function(){t.superclass.render.call(this),this.$input.datepicker(this.options.datepicker),this.options.clear&&(this.$clear=e('<a href="#"></a>').html(this.options.clear).click(e.proxy(function(e){e.preventDefault(),e.stopPropagation(),this.clear()},this)))},value2html:function(n,r){var i=e.datepicker.formatDate(this.options.viewformat,n);t.superclass.value2html(i,r)},html2value:function(t){if(typeof t!="string")return t;var n;try{n=e.datepicker.parseDate(this.options.viewformat,t)}catch(r){}return n},value2str:function(t){return e.datepicker.formatDate(this.options.datepicker.dateFormat,t)},str2value:function(t){if(typeof t!="string")return t;var n;try{n=e.datepicker.parseDate(this.options.datepicker.dateFormat,t)}catch(r){}return n},value2submit:function(e){return this.value2str(e)},value2input:function(e){this.$input.datepicker("setDate",e)},input2value:function(){return this.$input.datepicker("getDate")},activate:function(){},clear:function(){this.$input.datepicker("setDate",null)},autosubmit:function(){this.$input.on("mouseup","table.ui-datepicker-calendar a.ui-state-default",function(t){var n=e(this).closest("form");setTimeout(function(){n.submit()},200)})}}),t.defaults=e.extend({},e.fn.editabletypes.abstractinput.defaults,{tpl:"<div></div>",inputclass:"editable-date",format:"yyyy-mm-dd",viewformat:null,datepicker:{firstDay:0,changeYear:!0,changeMonth:!0},clear:"&times; clear"}),e.fn.editabletypes.dateui=t,e.fn.editabletypes.date=t}(window.jQuery);
@@ -1,5 +0,0 @@
1
- /*! X-editable - v1.3.0
2
- * In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery
3
- * http://github.com/vitalets/x-editable
4
- * Copyright (c) 2012 Vitaliy Potapov; Licensed MIT */
5
- (function(e){var t=function(t,n){this.options=e.extend({},e.fn.editableform.defaults,n),this.$div=e(t),this.options.scope||(this.options.scope=this),this.initInput()};t.prototype={constructor:t,initInput:function(){var t,n;if(typeof e.fn.editabletypes[this.options.type]!="function"){e.error("Unknown type: "+this.options.type);return}t=e.fn.editabletypes[this.options.type],n=e.fn.editableutils.sliceObj(this.options,e.fn.editableutils.objectKeys(t.defaults)),this.input=new t(n),this.value=this.input.str2value(this.options.value)},initTemplate:function(){this.$form=e(e.fn.editableform.template)},initButtons:function(){this.$form.find(".editable-buttons").append(e.fn.editableform.buttons)},render:function(){this.$loading=e(e.fn.editableform.loading),this.$div.empty().append(this.$loading),this.showLoading(),this.initTemplate(),this.options.showbuttons?this.initButtons():this.$form.find(".editable-buttons").remove(),this.$div.triggerHandler("rendering"),e.when(this.input.render()).then(e.proxy(function(){this.$form.find("div.editable-input").append(this.input.$input),this.options.showbuttons||this.input.autosubmit(),this.input.$clear&&this.$form.find("div.editable-input").append(e('<div class="editable-clear">').append(this.input.$clear)),this.$div.append(this.$form),this.$form.find(".editable-cancel").click(e.proxy(this.cancel,this)),this.input.error?(this.error(this.input.error),this.$form.find(".editable-submit").attr("disabled",!0),this.input.$input.attr("disabled",!0),this.$form.submit(function(e){e.preventDefault()})):(this.error(!1),this.input.$input.removeAttr("disabled"),this.$form.find(".editable-submit").removeAttr("disabled"),this.input.value2input(this.value),this.$form.submit(e.proxy(this.submit,this))),this.$div.triggerHandler("rendered"),this.showForm()},this))},cancel:function(){this.$div.triggerHandler("cancel")},showLoading:function(){var e;this.$form?(this.$loading.width(this.$form.outerWidth()),this.$loading.height(this.$form.outerHeight()),this.$form.hide()):(e=this.$loading.parent().width(),e&&this.$loading.width(e)),this.$loading.show()},showForm:function(e){this.$loading.hide(),this.$form.show(),e!==!1&&this.input.activate(),this.$div.triggerHandler("show")},error:function(t){var n=this.$form.find(".control-group"),r=this.$form.find(".editable-error-block");t===!1?(n.removeClass(e.fn.editableform.errorGroupClass),r.removeClass(e.fn.editableform.errorBlockClass).empty().hide()):(n.addClass(e.fn.editableform.errorGroupClass),r.addClass(e.fn.editableform.errorBlockClass).text(t).show())},submit:function(t){t.stopPropagation(),t.preventDefault();var n,r=this.input.input2value();if(n=this.validate(r)){this.error(n),this.showForm();return}if(!this.options.savenochange&&this.input.value2str(r)==this.input.value2str(this.value)){this.$div.triggerHandler("nochange");return}e.when(this.save(r)).done(e.proxy(function(e){var t=typeof this.options.success=="function"?this.options.success.call(this.options.scope,e,r):null;if(t===!1){this.error(!1),this.showForm(!1);return}if(typeof t=="string"){this.error(t),this.showForm();return}t&&typeof t=="object"&&t.hasOwnProperty("newValue")&&(r=t.newValue),this.error(!1),this.value=r,this.$div.triggerHandler("save",{newValue:r,response:e})},this)).fail(e.proxy(function(e){this.error(typeof e=="string"?e:e.responseText||e.statusText||"Unknown error!"),this.showForm()},this))},save:function(t){var n=this.input.value2submit(t);this.options.pk=e.fn.editableutils.tryParseJson(this.options.pk,!0);var r=typeof this.options.pk=="function"?this.options.pk.call(this.options.scope):this.options.pk,i=!!(typeof this.options.url=="function"||this.options.url&&(this.options.send==="always"||this.options.send==="auto"&&r)),s;if(i)return this.showLoading(),s={name:this.options.name||"",value:n,pk:r},typeof this.options.params=="function"?s=this.options.params.call(this.options.scope,s):(this.options.params=e.fn.editableutils.tryParseJson(this.options.params,!0),e.extend(s,this.options.params)),typeof this.options.url=="function"?this.options.url.call(this.options.scope,s):e.ajax(e.extend({url:this.options.url,data:s,type:"POST"},this.options.ajaxOptions))},validate:function(e){e===undefined&&(e=this.value);if(typeof this.options.validate=="function")return this.options.validate.call(this.options.scope,e)},option:function(e,t){this.options[e]=t,e==="value"&&this.setValue(t)},setValue:function(e,t){t?this.value=this.input.str2value(e):this.value=e}},e.fn.editableform=function(n){var r=arguments;return this.each(function(){var i=e(this),s=i.data("editableform"),o=typeof n=="object"&&n;s||i.data("editableform",s=new t(this,o)),typeof n=="string"&&s[n].apply(s,Array.prototype.slice.call(r,1))})},e.fn.editableform.Constructor=t,e.fn.editableform.defaults={type:"text",url:null,params:null,name:null,pk:null,value:null,send:"auto",validate:null,success:null,ajaxOptions:null,showbuttons:!0,scope:null,savenochange:!1},e.fn.editableform.template='<form class="form-inline editableform"><div class="control-group"><div><div class="editable-input"></div><div class="editable-buttons"></div></div><div class="editable-error-block"></div></div></form>',e.fn.editableform.loading='<div class="editableform-loading"></div>',e.fn.editableform.buttons='<button type="submit" class="editable-submit">ok</button><button type="button" class="editable-cancel">cancel</button>',e.fn.editableform.errorGroupClass=null,e.fn.editableform.errorBlockClass="editable-error"})(window.jQuery),function(e){e.fn.editableutils={inherit:function(e,t){var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.superclass=t.prototype},setCursorPosition:function(e,t){if(e.setSelectionRange)e.setSelectionRange(t,t);else if(e.createTextRange){var n=e.createTextRange();n.collapse(!0),n.moveEnd("character",t),n.moveStart("character",t),n.select()}},tryParseJson:function(e,t){if(typeof e=="string"&&e.length&&e.match(/^[\{\[].*[\}\]]$/))if(t)try{e=(new Function("return "+e))()}catch(n){}finally{return e}else e=(new Function("return "+e))();return e},sliceObj:function(t,n,r){var i,s,o={};if(!e.isArray(n)||!n.length)return o;for(var u=0;u<n.length;u++){i=n[u],t.hasOwnProperty(i)&&(o[i]=t[i]);if(r===!0)continue;s=i.toLowerCase(),t.hasOwnProperty(s)&&(o[i]=t[s])}return o},getConfigData:function(t){var n={};return e.each(t.data(),function(e,t){if(typeof t!="object"||t&&typeof t=="object"&&t.constructor===Object)n[e]=t}),n},objectKeys:function(e){if(Object.keys)return Object.keys(e);if(e!==Object(e))throw new TypeError("Object.keys called on a non-object");var t=[],n;for(n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},escape:function(t){return e("<div>").text(t).html()}}}(window.jQuery),function(e){var t=function(e,t){this.init(e,t)};t.prototype={containerName:null,innerCss:null,init:function(n,r){this.$element=e(n),this.options=e.extend({},e.fn.editableContainer.defaults,e.fn.editableutils.getConfigData(this.$element),r),this.splitOptions(),this.initContainer(),this.$element.on("destroyed",e.proxy(function(){this.destroy()},this)),e(document).data("editable-handlers-attached")||(e(document).on("keyup.editable",function(t){t.which===27&&e(".editable-open").editableContainer("hide")}),e(document).on("click.editable",function(n){var r=e(n.target);if(r.is(".editable-container")||r.parents(".editable-container").length||r.parents(".ui-datepicker-header").length)return;t.prototype.closeOthers(n.target)}),e(document).data("editable-handlers-attached",!0))},splitOptions:function(){this.containerOptions={},this.formOptions={};var t=e.fn[this.containerName].defaults;for(var n in this.options)n in t?this.containerOptions[n]=this.options[n]:this.formOptions[n]=this.options[n]},initContainer:function(){this.call(this.containerOptions)},initForm:function(){return this.formOptions.scope=this.$element[0],this.$form=e("<div>").editableform(this.formOptions).on({save:e.proxy(this.save,this),cancel:e.proxy(function(){this.hide("cancel")},this),nochange:e.proxy(function(){this.hide("nochange")},this),show:e.proxy(this.setPosition,this),rendering:e.proxy(this.setPosition,this),rendered:e.proxy(function(){this.$element.triggerHandler("shown")},this)}),this.$form},tip:function(){return this.container().$tip},container:function(){return this.$element.data(this.containerName)},call:function(){this.$element[this.containerName].apply(this.$element,arguments)},show:function(e){this.$element.addClass("editable-open"),e!==!1&&this.closeOthers(this.$element[0]),this.innerShow()},innerShow:function(){this.call("show"),this.tip().addClass("editable-container"),this.initForm(),this.tip().find(this.innerCss).empty().append(this.$form),this.$form.editableform("render")},hide:function(e){if(!this.tip()||!this.tip().is(":visible")||!this.$element.hasClass("editable-open"))return;this.$element.removeClass("editable-open"),this.innerHide(),this.$element.triggerHandler("hidden",e)},innerHide:function(){this.call("hide")},toggle:function(e){this.tip&&this.tip().is(":visible")?this.hide():this.show(e)},setPosition:function(){},save:function(e,t){this.hide("save"),this.$element.triggerHandler("save",t)},option:function(e,t){this.options[e]=t,e in this.containerOptions?(this.containerOptions[e]=t,this.setContainerOption(e,t)):(this.formOptions[e]=t,this.$form&&this.$form.editableform("option",e,t))},setContainerOption:function(e,t){this.call("option",e,t)},destroy:function(){this.call("destroy")},closeOthers:function(t){e(".editable-open").each(function(n,r){if(r===t||e(r).find(t).length)return;var i=e(r),s=i.data("editableContainer");if(!s)return;s.options.onblur==="cancel"?i.data("editableContainer").hide("onblur"):s.options.onblur==="submit"&&i.data("editableContainer").tip().find("form").submit()})},activate:function(){this.tip&&this.tip().is(":visible")&&this.$form&&this.$form.data("editableform").input.activate()}},e.fn.editableContainer=function(n){var r=arguments;return this.each(function(){var i=e(this),s="editableContainer",o=i.data(s),u=typeof n=="object"&&n;o||i.data(s,o=new t(this,u)),typeof n=="string"&&o[n].apply(o,Array.prototype.slice.call(r,1))})},e.fn.editableContainer.Constructor=t,e.fn.editableContainer.defaults={value:null,placement:"top",autohide:!0,onblur:"cancel"},jQuery.event.special.destroyed={remove:function(e){e.handler&&e.handler()}}}(window.jQuery),function(e){var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.editable.defaults,e.fn.editableutils.getConfigData(this.$element),n),this.init()};t.prototype={constructor:t,init:function(){var t,n=!1,r,i;if(!e.fn.editableContainer){e.error("You must define $.fn.editableContainer via including corresponding file (e.g. editable-popover.js)");return}this.options.name=this.options.name||this.$element.attr("id");if(typeof e.fn.editabletypes[this.options.type]!="function"){e.error("Unknown type: "+this.options.type);return}t=e.fn.editabletypes[this.options.type],this.typeOptions=e.fn.editableutils.sliceObj(this.options,e.fn.editableutils.objectKeys(t.defaults)),this.input=new t(this.typeOptions),this.options.value===undefined||this.options.value===null?(this.value=this.input.html2value(e.trim(this.$element.html())),n=!0):(this.options.value=e.fn.editableutils.tryParseJson(this.options.value,!0),typeof this.options.value=="string"?this.value=this.input.str2value(this.options.value):this.value=this.options.value),this.$element.addClass("editable"),this.options.toggle!=="manual"?(this.$element.addClass("editable-click"),this.$element.on(this.options.toggle+".editable",e.proxy(function(e){e.preventDefault();if(this.options.toggle==="mouseenter")this.show();else{var t=this.options.toggle!=="click";this.toggle(t)}},this))):this.$element.attr("tabindex",-1),r=!n&&this.value!==null&&this.value!==undefined,r&=this.options.autotext==="always"||this.options.autotext==="auto"&&!this.$element.text().length,e.when(r?this.render():!0).then(e.proxy(function(){this.options.disabled?this.disable():this.enable(),this.$element.triggerHandler("init",this)},this))},render:function(){if(this.options.display===!1)return;return this.input.options.hasOwnProperty("source")?this.input.value2html(this.value,this.$element[0],this.options.display):typeof this.options.display=="function"?this.options.display.call(this.$element[0],this.value):this.input.value2html(this.value,this.$element[0])},enable:function(){this.options.disabled=!1,this.$element.removeClass("editable-disabled"),this.handleEmpty(),this.options.toggle!=="manual"&&this.$element.attr("tabindex")==="-1"&&this.$element.removeAttr("tabindex")},disable:function(){this.options.disabled=!0,this.hide(),this.$element.addClass("editable-disabled"),this.handleEmpty(),this.$element.attr("tabindex",-1)},toggleDisabled:function(){this.options.disabled?this.enable():this.disable()},option:function(t,n){if(t&&typeof t=="object"){e.each(t,e.proxy(function(t,n){this.option(e.trim(t),n)},this));return}this.options[t]=n;if(t==="disabled"){n?this.disable():this.enable();return}t==="value"&&this.setValue(n),this.container&&this.container.option(t,n)},handleEmpty:function(){if(this.options.display===!1)return;var t="editable-empty";this.options.disabled?this.$element.hasClass(t)&&(this.$element.empty(),this.$element.removeClass(t)):e.trim(this.$element.text())===""?this.$element.addClass(t).text(this.options.emptytext):this.$element.removeClass(t)},show:function(t){if(this.options.disabled)return;if(!this.container){var n=e.extend({},this.options,{value:this.value});this.$element.editableContainer(n),this.$element.on("save.internal",e.proxy(this.save,this)),this.container=this.$element.data("editableContainer")}else if(this.container.tip().is(":visible"))return;this.container.show(t)},hide:function(){this.container&&this.container.hide()},toggle:function(e){this.container&&this.container.tip().is(":visible")?this.hide():this.show(e)},save:function(e,t){typeof this.options.url!="function"&&this.options.display!==!1&&t.response===undefined&&this.input.value2str(this.value)!==this.input.value2str(t.newValue)?this.$element.addClass("editable-unsaved"):this.$element.removeClass("editable-unsaved"),this.setValue(t.newValue)},validate:function(){if(typeof this.options.validate=="function")return this.options.validate.call(this,this.value)},setValue:function(t,n){n?this.value=this.input.str2value(t):this.value=t,this.container&&this.container.option("value",this.value),e.when(this.render()).then(e.proxy(function(){this.handleEmpty()},this))},activate:function(){this.container&&this.container.activate()}},e.fn.editable=function(n){var r={},i=arguments,s="editable";switch(n){case"validate":return this.each(function(){var t=e(this),n=t.data(s),i;n&&(i=n.validate())&&(r[n.options.name]=i)}),r;case"getValue":return this.each(function(){var t=e(this),n=t.data(s);n&&n.value!==undefined&&n.value!==null&&(r[n.options.name]=n.input.value2submit(n.value))}),r;case"submit":var o=arguments[1]||{},u=this,a=this.editable("validate"),f;return e.isEmptyObject(a)?(f=this.editable("getValue"),o.data&&e.extend(f,o.data),e.ajax(e.extend({url:o.url,data:f,type:"POST"},o.ajaxOptions)).success(function(e){typeof o.success=="function"&&o.success.call(u,e,o)}).error(function(){typeof o.error=="function"&&o.error.apply(u,arguments)})):typeof o.error=="function"&&o.error.call(u,a),this}return this.each(function(){var r=e(this),o=r.data(s),u=typeof n=="object"&&n;o||r.data(s,o=new t(this,u)),typeof n=="string"&&o[n].apply(o,Array.prototype.slice.call(i,1))})},e.fn.editable.defaults={type:"text",disabled:!1,toggle:"click",emptytext:"Empty",autotext:"auto",value:null,display:null}}(window.jQuery),function(e){e.fn.editabletypes={};var t=function(){};t.prototype={init:function(t,n,r){this.type=t,this.options=e.extend({},r,n),this.$input=null,this.$clear=null,this.error=null},render:function(){this.$input=e(this.options.tpl),this.options.inputclass&&this.$input.addClass(this.options.inputclass),this.options.placeholder&&this.$input.attr("placeholder",this.options.placeholder)},value2html:function(t,n){e(n).text(t)},html2value:function(t){return e("<div>").html(t).text()},value2str:function(e){return e},str2value:function(e){return e},value2submit:function(e){return e},value2input:function(e){this.$input.val(e)},input2value:function(){return this.$input.val()},activate:function(){this.$input.is(":visible")&&this.$input.focus()},clear:function(){this.$input.val(null)},escape:function(t){return e("<div>").text(t).html()},autosubmit:function(){}},t.defaults={tpl:"",inputclass:"input-medium",name:null},e.extend(e.fn.editabletypes,{abstractinput:t})}(window.jQuery),function(e){var t=function(e){};e.fn.editableutils.inherit(t,e.fn.editabletypes.abstractinput),e.extend(t.prototype,{render:function(){t.superclass.render.call(this);var n=e.Deferred();return this.error=null,this.sourceData=null,this.prependData=null,this.onSourceReady(function(){this.renderList(),n.resolve()},function(){this.error=this.options.sourceError,n.resolve()}),n.promise()},html2value:function(e){return null},value2html:function(t,n,r){var i=e.Deferred();return this.onSourceReady(function(){typeof r=="function"?r.call(n,t,this.sourceData):this.value2htmlFinal(t,n),i.resolve()},function(){i.resolve()}),i.promise()},onSourceReady:function(t,n){if(e.isArray(this.sourceData)){t.call(this);return}try{this.options.source=e.fn.editableutils.tryParseJson(this.options.source,!1)}catch(r){n.call(this);return}if(typeof this.options.source=="string"){if(this.options.sourceCache){var i=this.options.source+(this.options.name?"-"+this.options.name:""),s;e(document).data(i)||e(document).data(i,{}),s=e(document).data(i);if(s.loading===!1&&s.sourceData){this.sourceData=s.sourceData,t.call(this);return}if(s.loading===!0){s.callbacks.push(e.proxy(function(){this.sourceData=s.sourceData,t.call(this)},this)),s.err_callbacks.push(e.proxy(n,this));return}s.loading=!0,s.callbacks=[],s.err_callbacks=[]}e.ajax({url:this.options.source,type:"get",cache:!1,data:this.options.name?{name:this.options.name}:{},dataType:"json",success:e.proxy(function(r){s&&(s.loading=!1),this.sourceData=this.makeArray(r),e.isArray(this.sourceData)?(this.doPrepend(),t.call(this),s&&(s.sourceData=this.sourceData,e.each(s.callbacks,function(){this.call()}))):(n.call(this),s&&e.each(s.err_callbacks,function(){this.call()}))},this),error:e.proxy(function(){n.call(this),s&&(s.loading=!1,e.each(s.err_callbacks,function(){this.call()}))},this)})}else this.sourceData=this.makeArray(this.options.source),e.isArray(this.sourceData)?(this.doPrepend(),t.call(this)):n.call(this)},doPrepend:function(){if(this.options.prepend===null||this.options.prepend===undefined)return;e.isArray(this.prependData)||(this.options.prepend=e.fn.editableutils.tryParseJson(this.options.prepend,!0),typeof this.options.prepend=="string"&&(this.options.prepend={"":this.options.prepend}),this.prependData=this.makeArray(this.options.prepend)),e.isArray(this.prependData)&&e.isArray(this.sourceData)&&(this.sourceData=this.prependData.concat(this.sourceData))},renderList:function(){},value2htmlFinal:function(e,t){},makeArray:function(t){var n,r,i=[],s;if(!t||typeof t=="string")return null;if(e.isArray(t)){s=function(e,t){r={value:e,text:t};if(n++>=2)return!1};for(var o=0;o<t.length;o++)typeof t[o]=="object"?(n=0,e.each(t[o],s),n===1?i.push(r):n>1&&t[o].hasOwnProperty("value")&&t[o].hasOwnProperty("text")&&i.push(t[o])):i.push({value:t[o],text:t[o]})}else e.each(t,function(e,t){i.push({value:e,text:t})});return i},itemByVal:function(t){if(e.isArray(this.sourceData))for(var n=0;n<this.sourceData.length;n++)if(this.sourceData[n].value==t)return this.sourceData[n]}}),t.defaults=e.extend({},e.fn.editabletypes.abstractinput.defaults,{source:null,prepend:!1,sourceError:"Error when loading list",sourceCache:!0}),e.fn.editabletypes.list=t}(window.jQuery),function(e){var t=function(e){this.init("text",e,t.defaults)};e.fn.editableutils.inherit(t,e.fn.editabletypes.abstractinput),e.extend(t.prototype,{activate:function(){this.$input.is(":visible")&&(this.$input.focus(),e.fn.editableutils.setCursorPosition(this.$input.get(0),this.$input.val().length))}}),t.defaults=e.extend({},e.fn.editabletypes.abstractinput.defaults,{tpl:'<input type="text">',placeholder:null}),e.fn.editabletypes.text=t}(window.jQuery),function(e){var t=function(e){this.init("textarea",e,t.defaults)};e.fn.editableutils.inherit(t,e.fn.editabletypes.abstractinput),e.extend(t.prototype,{render:function(){t.superclass.render.call(this),this.$input.keydown(function(t){t.ctrlKey&&t.which===13&&e(this).closest("form").submit()})},value2html:function(t,n){var r="",i;if(t){i=t.split("\n");for(var s=0;s<i.length;s++)i[s]=e("<div>").text(i[s]).html();r=i.join("<br>")}e(n).html(r)},html2value:function(t){if(!t)return"";var n=t.split(/<br\s*\/?>/i);for(var r=0;r<n.length;r++)n[r]=e("<div>").html(n[r]).text();return n.join("\n")},activate:function(){this.$input.is(":visible")&&(e.fn.editableutils.setCursorPosition(this.$input.get(0),this.$input.val().length),this.$input.focus())}}),t.defaults=e.extend({},e.fn.editabletypes.abstractinput.defaults,{tpl:"<textarea></textarea>",inputclass:"input-large",placeholder:null}),e.fn.editabletypes.textarea=t}(window.jQuery),function(e){var t=function(e){this.init("select",e,t.defaults)};e.fn.editableutils.inherit(t,e.fn.editabletypes.list),e.extend(t.prototype,{renderList:function(){if(!e.isArray(this.sourceData))return;for(var t=0;t<this.sourceData.length;t++)this.$input.append(e("<option>",{value:this.sourceData[t].value}).text(this.sourceData[t].text));this.$input.on("keydown.editable",function(t){t.which===13&&e(this).closest("form").submit()})},value2htmlFinal:function(e,n){var r="",i=this.itemByVal(e);i&&(r=i.text),t.superclass.constructor.superclass.value2html(r,n)},autosubmit:function(){this.$input.off("keydown.editable").on("change.editable",function(){e(this).closest("form").submit()})}}),t.defaults=e.extend({},e.fn.editabletypes.list.defaults,{tpl:"<select></select>"}),e.fn.editabletypes.select=t}(window.jQuery),function(e){var t=function(e){this.init("checklist",e,t.defaults)};e.fn.editableutils.inherit(t,e.fn.editabletypes.list),e.extend(t.prototype,{renderList:function(){var t,n;if(!e.isArray(this.sourceData))return;for(var r=0;r<this.sourceData.length;r++)t=e("<label>").append(e("<input>",{type:"checkbox",value:this.sourceData[r].value,name:this.options.name})).append(e("<span>").text(" "+this.sourceData[r].text)),e("<div>").append(t).appendTo(this.$input)},value2str:function(t){return e.isArray(t)?t.sort().join(e.trim(this.options.separator)):""},str2value:function(t){var n,r=null;return typeof t=="string"&&t.length?(n=new RegExp("\\s*"+e.trim(this.options.separator)+"\\s*"),r=t.split(n)):e.isArray(t)&&(r=t),r},value2input:function(t){var n=this.$input.find('input[type="checkbox"]');n.removeAttr("checked"),e.isArray(t)&&t.length&&n.each(function(n,r){var i=e(r);e.each(t,function(e,t){i.val()==t&&i.attr("checked","checked")})})},input2value:function(){var t=[];return this.$input.find("input:checked").each(function(n,r){t.push(e(r).val())}),t},value2htmlFinal:function(t,n){var r=[],i=e.grep(this.sourceData,function(n){return e.grep(t,function(e){return e==n.value}).length});i.length?(e.each(i,function(t,n){r.push(e.fn.editableutils.escape(n.text))}),e(n).html(r.join("<br>"))):e(n).empty()},activate:function(){this.$input.find('input[type="checkbox"]').first().focus()},autosubmit:function(){this.$input.find('input[type="checkbox"]').on("keydown",function(t){t.which===13&&e(this).closest("form").submit()})}}),t.defaults=e.extend({},e.fn.editabletypes.list.defaults,{tpl:"<div></div>",inputclass:"editable-checklist",separator:","}),e.fn.editabletypes.checklist=t}(window.jQuery),function(e){var t=function(e){this.init("password",e,t.defaults)};e.fn.editableutils.inherit(t,e.fn.editabletypes.text),e.extend(t.prototype,{value2html:function(t,n){t?e(n).text("[hidden]"):e(n).empty()},html2value:function(e){return null}}),t.defaults=e.extend({},e.fn.editabletypes.text.defaults,{tpl:'<input type="password">'}),e.fn.editabletypes.password=t}(window.jQuery),function(e){var t=function(e){this.init("email",e,t.defaults)};e.fn.editableutils.inherit(t,e.fn.editabletypes.text),t.defaults=e.extend({},e.fn.editabletypes.text.defaults,{tpl:'<input type="email">'}),e.fn.editabletypes.email=t}(window.jQuery),function(e){var t=function(e){this.init("url",e,t.defaults)};e.fn.editableutils.inherit(t,e.fn.editabletypes.text),t.defaults=e.extend({},e.fn.editabletypes.text.defaults,{tpl:'<input type="url">'}),e.fn.editabletypes.url=t}(window.jQuery),function(e){var t=function(e){this.init("tel",e,t.defaults)};e.fn.editableutils.inherit(t,e.fn.editabletypes.text),t.defaults=e.extend({},e.fn.editabletypes.text.defaults,{tpl:'<input type="tel">'}),e.fn.editabletypes.tel=t}(window.jQuery),function(e){var t=function(e){this.init("number",e,t.defaults)};e.fn.editableutils.inherit(t,e.fn.editabletypes.text),e.extend(t.prototype,{render:function(){t.superclass.render.call(this),this.options.min!==null&&this.$input.attr("min",this.options.min),this.options.max!==null&&this.$input.attr("max",this.options.max),this.options.step!==null&&this.$input.attr("step",this.options.step)}}),t.defaults=e.extend({},e.fn.editabletypes.text.defaults,{tpl:'<input type="number">',inputclass:"input-mini",min:null,max:null,step:null}),e.fn.editabletypes.number=t}(window.jQuery),function(e){var t=function(e){this.init("range",e,t.defaults)};e.fn.editableutils.inherit(t,e.fn.editabletypes.number),e.extend(t.prototype,{render:function(){this.$input=e(this.options.tpl);var t=this.$input.filter("input");this.options.inputclass&&t.addClass(this.options.inputclass),this.options.min!==null&&t.attr("min",this.options.min),this.options.max!==null&&t.attr("max",this.options.max),this.options.step!==null&&t.attr("step",this.options.step),t.on("input",function(){e(this).siblings("output").text(e(this).val())})},activate:function(){this.$input.filter("input").focus()}}),t.defaults=e.extend({},e.fn.editabletypes.number.defaults,{tpl:'<input type="range"><output style="width: 30px; display: inline-block"></output>',inputclass:"input-medium"}),e.fn.editabletypes.range=t}(window.jQuery),function(e){e.extend(e.fn.editableform.Constructor.prototype,{initButtons:function(){this.$form.find(".editable-buttons").append(e.fn.editableform.buttons),this.$form.find(".editable-submit").button({icons:{primary:"ui-icon-check"},text:!1}).removeAttr("title"),this.$form.find(".editable-cancel").button({icons:{primary:"ui-icon-closethick"},text:!1}).removeAttr("title")}}),e.fn.editableform.errorGroupClass=null,e.fn.editableform.errorBlockClass="ui-state-error"}(window.jQuery),function(e){e.extend(e.fn.editableContainer.Constructor.prototype,{containerName:"tooltip",innerCss:".ui-tooltip-content",splitOptions:function(){this.containerOptions={},this.formOptions={};var t=e.ui[this.containerName].prototype.options;for(var n in this.options)n in t?this.containerOptions[n]=this.options[n]:this.formOptions[n]=this.options[n]},initContainer:function(){this.handlePlacement(),e.extend(this.containerOptions,{items:"*",content:" ",track:!1,open:e.proxy(function(){this.container()._on(this.container().element,{mouseleave:function(e){e.stopImmediatePropagation()},focusout:function(e){e.stopImmediatePropagation()}})},this)}),this.call(this.containerOptions),this.container()._off(this.container().element,"mouseover focusin")},tip:function(){return this.container()._find(this.container().element)},innerShow:function(){this.call("open"),this.tip().addClass("editable-container"),this.initForm(),this.tip().find(this.innerCss).empty().append(e("<label>").text(this.options.title||this.$element.data("ui-tooltip-title")||this.$element.data("originalTitle"))).append(this.$form),this.$form.editableform("render")},innerHide:function(){this.call("close")},setPosition:function(){this.tip().position(e.extend({of:this.$element},this.containerOptions.position))},handlePlacement:function(){var e;switch(this.options.placement){case"top":e={my:"center bottom-5",at:"center top"};break;case"right":e={my:"left+5 center",at:"right center"};break;case"bottom":e={my:"center top+5",at:"center bottom"};break;case"left":e={my:"right-5 center",at:"left center"}}this.containerOptions.position=e},destroy:function(){}})}(window.jQuery),function(e){var t=function(n){this.init("dateui",n,t.defaults);var r=e.fn.editableutils.sliceObj(this.options,["format"]);this.options.datepicker=e.extend({},t.defaults.datepicker,r,n.datepicker),this.options.viewformat||(this.options.viewformat=this.options.datepicker.format),this.options.viewformat=this.options.viewformat.replace("yyyy","yy"),this.options.datepicker.format=this.options.datepicker.format.replace("yyyy","yy"),this.options.datepicker.dateFormat=this.options.datepicker.format};e.fn.editableutils.inherit(t,e.fn.editabletypes.abstractinput),e.extend(t.prototype,{render:function(){t.superclass.render.call(this),this.$input.datepicker(this.options.datepicker),this.options.clear&&(this.$clear=e('<a href="#"></a>').html(this.options.clear).click(e.proxy(function(e){e.preventDefault(),e.stopPropagation(),this.clear()},this)))},value2html:function(n,r){var i=e.datepicker.formatDate(this.options.viewformat,n);t.superclass.value2html(i,r)},html2value:function(t){if(typeof t!="string")return t;var n;try{n=e.datepicker.parseDate(this.options.viewformat,t)}catch(r){}return n},value2str:function(t){return e.datepicker.formatDate(this.options.datepicker.dateFormat,t)},str2value:function(t){if(typeof t!="string")return t;var n;try{n=e.datepicker.parseDate(this.options.datepicker.dateFormat,t)}catch(r){}return n},value2submit:function(e){return this.value2str(e)},value2input:function(e){this.$input.datepicker("setDate",e)},input2value:function(){return this.$input.datepicker("getDate")},activate:function(){},clear:function(){this.$input.datepicker("setDate",null)},autosubmit:function(){this.$input.on("mouseup","table.ui-datepicker-calendar a.ui-state-default",function(t){var n=e(this).closest("form");setTimeout(function(){n.submit()},200)})}}),t.defaults=e.extend({},e.fn.editabletypes.abstractinput.defaults,{tpl:"<div></div>",inputclass:"editable-date",format:"yyyy-mm-dd",viewformat:null,datepicker:{firstDay:0,changeYear:!0,changeMonth:!0},clear:"&times; clear"}),e.fn.editabletypes.dateui=t,e.fn.editabletypes.date=t}(window.jQuery);
@@ -1,434 +0,0 @@
1
- /*! X-editable - v1.3.0
2
- * In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery
3
- * http://github.com/vitalets/x-editable
4
- * Copyright (c) 2012 Vitaliy Potapov; Licensed MIT */
5
-
6
- .editableform {
7
- margin-bottom: 0; /* overwrites bootstrap margin */
8
- }
9
-
10
- .editableform .control-group {
11
- margin-bottom: 0; /* overwrites bootstrap margin */
12
- white-space: nowrap; /* prevent wrapping buttons on new line */
13
- }
14
-
15
- .editable-buttons {
16
- display: inline-block; /* should be inline to take effect of parent's white-space: nowrap */
17
- vertical-align: top;
18
- margin-left: 7px;
19
- /* display-inline emulation for IE7*/
20
- zoom: 1;
21
- *display: inline;
22
- }
23
-
24
-
25
-
26
- .editable-input {
27
- vertical-align: top;
28
- display: inline-block; /* should be inline to take effect of parent's white-space: nowrap */
29
- width: auto; /* bootstrap-responsive has width: 100% that breakes layout */
30
- white-space: normal; /* reset white-space decalred in parent*/
31
- /* display-inline emulation for IE7*/
32
- zoom: 1;
33
- *display: inline;
34
- }
35
-
36
- .editable-buttons .editable-cancel {
37
- margin-left: 7px;
38
- }
39
-
40
- /*for jquery-ui buttons need set height to look more pretty*/
41
- .editable-buttons button.ui-button-icon-only {
42
- height: 24px;
43
- width: 30px;
44
- }
45
-
46
- .editableform-loading {
47
- background: url('img/loading.gif') center center no-repeat;
48
- height: 25px;
49
- width: auto;
50
- min-width: 25px;
51
- }
52
-
53
- .editable-inline .editableform-loading {
54
- background-position: left 5px;
55
- }
56
-
57
- .editable-error-block {
58
- max-width: 300px;
59
- margin: 5px 0 0 0;
60
- width: auto;
61
- white-space: normal;
62
- }
63
-
64
- /*add padding for jquery ui*/
65
- .editable-error-block.ui-state-error {
66
- padding: 3px;
67
- }
68
-
69
- .editable-error {
70
- color: red;
71
- }
72
-
73
- .editableform textarea {
74
- height: 150px; /*default height for textarea*/
75
- }
76
-
77
- .editableform .editable-date {
78
- padding: 0;
79
- margin: 0;
80
- float: left;
81
- }
82
-
83
-
84
- /* checklist vertical alignment */
85
- .editable-checklist label input[type="checkbox"],
86
- .editable-checklist label span {
87
- vertical-align: middle;
88
- margin: 0;
89
- }
90
-
91
- .editable-checklist label {
92
- white-space: nowrap;
93
- }
94
-
95
- .editable-clear {
96
- clear: both;
97
- font-size: 0.9em;
98
- text-decoration: none;
99
- text-align: right;
100
- }
101
- .editable-container {
102
- max-width: none !important; /* without this rule poshytip/tooltip does not stretch */
103
- }
104
-
105
- .editable-container.popover {
106
- /* width: 300px;*/ /* debug */
107
- width: auto; /* without this rule popover does not stretch */
108
- }
109
-
110
- .editable-container.editable-inline {
111
- /* display: inline; */ /* display: inline does not correctly work with show()/hide() in jquery <= 1.7.2 */
112
- display: inline-block;
113
- vertical-align: middle;
114
- }
115
-
116
- .editable-container.ui-widget {
117
- font-size: inherit; /* jqueryui widget font 1.1em too big, overwrite it */
118
- }
119
- .editable-click,
120
- a.editable-click,
121
- a.editable-click:hover {
122
- text-decoration: none;
123
- border-bottom: dashed 1px #0088cc;
124
- }
125
-
126
- .editable-click.editable-disabled,
127
- a.editable-click.editable-disabled,
128
- a.editable-click.editable-disabled:hover {
129
- color: #585858;
130
- cursor: default;
131
- border-bottom: none;
132
- }
133
-
134
- .editable-empty, .editable-empty:hover{
135
- font-style: italic;
136
- color: #DD1144;
137
- border-bottom: none;
138
- text-decoration: none;
139
- }
140
-
141
- .editable-unsaved {
142
- font-weight: bold;
143
- }
144
-
145
- .editable-unsaved:after {
146
- /* content: '*'*/
147
- }
148
-
149
-
150
- /*!
151
- * Datepicker for Bootstrap
152
- *
153
- * Copyright 2012 Stefan Petre
154
- * Improvements by Andrew Rowls
155
- * Licensed under the Apache License v2.0
156
- * http://www.apache.org/licenses/LICENSE-2.0
157
- *
158
- */
159
- .datepicker {
160
- padding: 4px;
161
- margin-top: 1px;
162
- -webkit-border-radius: 4px;
163
- -moz-border-radius: 4px;
164
- border-radius: 4px;
165
- /*.dow {
166
- border-top: 1px solid #ddd !important;
167
- }*/
168
- }
169
-
170
- .datepicker-inline {
171
- width: 220px;
172
- /* height: 220px; */
173
- }
174
-
175
- .datepicker-float {
176
- top: 0;
177
- left: 0;
178
- }
179
-
180
- .datepicker-float:before {
181
- content: '';
182
- display: inline-block;
183
- border-left: 7px solid transparent;
184
- border-right: 7px solid transparent;
185
- border-bottom: 7px solid #ccc;
186
- border-bottom-color: rgba(0, 0, 0, 0.2);
187
- position: absolute;
188
- top: -7px;
189
- left: 6px;
190
- }
191
- .datepicker-float:after {
192
- content: '';
193
- display: inline-block;
194
- border-left: 6px solid transparent;
195
- border-right: 6px solid transparent;
196
- border-bottom: 6px solid #ffffff;
197
- position: absolute;
198
- top: -6px;
199
- left: 7px;
200
- }
201
- .datepicker > div {
202
- display: none;
203
- }
204
- .datepicker.days div.datepicker-days {
205
- display: block;
206
- }
207
- .datepicker.months div.datepicker-months {
208
- display: block;
209
- }
210
- .datepicker.years div.datepicker-years {
211
- display: block;
212
- }
213
- .datepicker table {
214
- margin: 0;
215
- }
216
- .datepicker td,
217
- .datepicker th {
218
- text-align: center;
219
- width: 20px;
220
- height: 20px;
221
- -webkit-border-radius: 4px;
222
- -moz-border-radius: 4px;
223
- border-radius: 4px;
224
- /* vitalets: required to disable css inheritance when display inline inside table */
225
- border: none !important;
226
- background-color: transparent !important;
227
- }
228
- .datepicker td.day:hover {
229
- background: #eeeeee !important; /* disable inheritance for inline */
230
- cursor: pointer;
231
- }
232
- .datepicker td.old,
233
- .datepicker td.new {
234
- color: #999999;
235
- }
236
- .datepicker td.disabled,
237
- .datepicker td.disabled:hover {
238
- background: none;
239
- color: #999999;
240
- cursor: default;
241
- }
242
- .datepicker td.today,
243
- .datepicker td.today:hover,
244
- .datepicker td.today.disabled,
245
- .datepicker td.today.disabled:hover {
246
- background-color: #fde19a !important; /* disable inheritance for inline */
247
- background-image: -moz-linear-gradient(top, #fdd49a, #fdf59a);
248
- background-image: -ms-linear-gradient(top, #fdd49a, #fdf59a);
249
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fdd49a), to(#fdf59a));
250
- background-image: -webkit-linear-gradient(top, #fdd49a, #fdf59a);
251
- background-image: -o-linear-gradient(top, #fdd49a, #fdf59a);
252
- background-image: linear-gradient(top, #fdd49a, #fdf59a);
253
- background-repeat: repeat-x;
254
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fdd49a', endColorstr='#fdf59a', GradientType=0);
255
- border-color: #fdf59a #fdf59a #fbed50;
256
- border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
257
- filter: progid:dximagetransform.microsoft.gradient(enabled=false);
258
- }
259
- .datepicker td.today:hover,
260
- .datepicker td.today:hover:hover,
261
- .datepicker td.today.disabled:hover,
262
- .datepicker td.today.disabled:hover:hover,
263
- .datepicker td.today:active,
264
- .datepicker td.today:hover:active,
265
- .datepicker td.today.disabled:active,
266
- .datepicker td.today.disabled:hover:active,
267
- .datepicker td.today.active,
268
- .datepicker td.today:hover.active,
269
- .datepicker td.today.disabled.active,
270
- .datepicker td.today.disabled:hover.active,
271
- .datepicker td.today.disabled,
272
- .datepicker td.today:hover.disabled,
273
- .datepicker td.today.disabled.disabled,
274
- .datepicker td.today.disabled:hover.disabled,
275
- .datepicker td.today[disabled],
276
- .datepicker td.today:hover[disabled],
277
- .datepicker td.today.disabled[disabled],
278
- .datepicker td.today.disabled:hover[disabled] {
279
- background-color: #fdf59a !important; /* disable inheritance for inline */
280
- }
281
- .datepicker td.today:active,
282
- .datepicker td.today:hover:active,
283
- .datepicker td.today.disabled:active,
284
- .datepicker td.today.disabled:hover:active,
285
- .datepicker td.today.active,
286
- .datepicker td.today:hover.active,
287
- .datepicker td.today.disabled.active,
288
- .datepicker td.today.disabled:hover.active {
289
- background-color: #fbf069 \9;
290
- }
291
- .datepicker td.active,
292
- .datepicker td.active:hover,
293
- .datepicker td.active.disabled,
294
- .datepicker td.active.disabled:hover {
295
- background-color: #006dcc !important; /* disable inheritance for inline */
296
- background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
297
- background-image: -ms-linear-gradient(top, #0088cc, #0044cc);
298
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
299
- background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
300
- background-image: -o-linear-gradient(top, #0088cc, #0044cc);
301
- background-image: linear-gradient(top, #0088cc, #0044cc);
302
- background-repeat: repeat-x;
303
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0);
304
- border-color: #0044cc #0044cc #002a80;
305
- border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
306
- filter: progid:dximagetransform.microsoft.gradient(enabled=false);
307
- color: #fff;
308
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
309
- }
310
- .datepicker td.active:hover,
311
- .datepicker td.active:hover:hover,
312
- .datepicker td.active.disabled:hover,
313
- .datepicker td.active.disabled:hover:hover,
314
- .datepicker td.active:active,
315
- .datepicker td.active:hover:active,
316
- .datepicker td.active.disabled:active,
317
- .datepicker td.active.disabled:hover:active,
318
- .datepicker td.active.active,
319
- .datepicker td.active:hover.active,
320
- .datepicker td.active.disabled.active,
321
- .datepicker td.active.disabled:hover.active,
322
- .datepicker td.active.disabled,
323
- .datepicker td.active:hover.disabled,
324
- .datepicker td.active.disabled.disabled,
325
- .datepicker td.active.disabled:hover.disabled,
326
- .datepicker td.active[disabled],
327
- .datepicker td.active:hover[disabled],
328
- .datepicker td.active.disabled[disabled],
329
- .datepicker td.active.disabled:hover[disabled] {
330
- background-color: #0044cc;
331
- }
332
- .datepicker td.active:active,
333
- .datepicker td.active:hover:active,
334
- .datepicker td.active.disabled:active,
335
- .datepicker td.active.disabled:hover:active,
336
- .datepicker td.active.active,
337
- .datepicker td.active:hover.active,
338
- .datepicker td.active.disabled.active,
339
- .datepicker td.active.disabled:hover.active {
340
- background-color: #003399 \9;
341
- }
342
- .datepicker td span {
343
- display: block;
344
- width: 23%;
345
- height: 54px;
346
- line-height: 54px;
347
- float: left;
348
- margin: 1%;
349
- cursor: pointer;
350
- -webkit-border-radius: 4px;
351
- -moz-border-radius: 4px;
352
- border-radius: 4px;
353
- }
354
- .datepicker td span:hover {
355
- background: #eeeeee;
356
- }
357
- .datepicker td span.disabled,
358
- .datepicker td span.disabled:hover {
359
- background: none;
360
- color: #999999;
361
- cursor: default;
362
- }
363
- .datepicker td span.active,
364
- .datepicker td span.active:hover,
365
- .datepicker td span.active.disabled,
366
- .datepicker td span.active.disabled:hover {
367
- background-color: #006dcc;
368
- background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
369
- background-image: -ms-linear-gradient(top, #0088cc, #0044cc);
370
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
371
- background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
372
- background-image: -o-linear-gradient(top, #0088cc, #0044cc);
373
- background-image: linear-gradient(top, #0088cc, #0044cc);
374
- background-repeat: repeat-x;
375
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0);
376
- border-color: #0044cc #0044cc #002a80;
377
- border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
378
- filter: progid:dximagetransform.microsoft.gradient(enabled=false);
379
- color: #fff;
380
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
381
- }
382
- .datepicker td span.active:hover,
383
- .datepicker td span.active:hover:hover,
384
- .datepicker td span.active.disabled:hover,
385
- .datepicker td span.active.disabled:hover:hover,
386
- .datepicker td span.active:active,
387
- .datepicker td span.active:hover:active,
388
- .datepicker td span.active.disabled:active,
389
- .datepicker td span.active.disabled:hover:active,
390
- .datepicker td span.active.active,
391
- .datepicker td span.active:hover.active,
392
- .datepicker td span.active.disabled.active,
393
- .datepicker td span.active.disabled:hover.active,
394
- .datepicker td span.active.disabled,
395
- .datepicker td span.active:hover.disabled,
396
- .datepicker td span.active.disabled.disabled,
397
- .datepicker td span.active.disabled:hover.disabled,
398
- .datepicker td span.active[disabled],
399
- .datepicker td span.active:hover[disabled],
400
- .datepicker td span.active.disabled[disabled],
401
- .datepicker td span.active.disabled:hover[disabled] {
402
- background-color: #0044cc;
403
- }
404
- .datepicker td span.active:active,
405
- .datepicker td span.active:hover:active,
406
- .datepicker td span.active.disabled:active,
407
- .datepicker td span.active.disabled:hover:active,
408
- .datepicker td span.active.active,
409
- .datepicker td span.active:hover.active,
410
- .datepicker td span.active.disabled.active,
411
- .datepicker td span.active.disabled:hover.active {
412
- background-color: #003399 \9;
413
- }
414
- .datepicker td span.old {
415
- color: #999999;
416
- }
417
- .datepicker th.switch {
418
- width: 145px;
419
- }
420
- .datepicker thead tr:first-child th,
421
- .datepicker tfoot tr:first-child th {
422
- cursor: pointer;
423
- }
424
- .datepicker thead tr:first-child th:hover,
425
- .datepicker tfoot tr:first-child th:hover {
426
- background: #eeeeee;
427
- }
428
- .input-append.date .add-on i,
429
- .input-prepend.date .add-on i {
430
- display: block;
431
- cursor: pointer;
432
- width: 16px;
433
- height: 16px;
434
- }
@@ -1,19 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'x-editable-rails/version'
5
-
6
- Gem::Specification.new do |gem|
7
- gem.name = "x-editable-rails"
8
- gem.version = X::Editable::Rails::VERSION
9
- gem.authors = ["Jiri Kolarik"]
10
- gem.email = ["jiri.kolarik@imin.cz"]
11
- gem.description = %q{X-editable for Rails}
12
- gem.summary = %q{X-editable for Rails}
13
- gem.homepage = ""
14
-
15
- gem.files = `git ls-files`.split($/)
16
- gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
- gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
- gem.require_paths = ["lib"]
19
- end