').append(this.$clear)))},value2html:function(a,c){var d=a?this.dpg.formatDate(a,this.parsedViewFormat,this.options.datepicker.language):"";b.superclass.value2html.call(this,d,c)},html2value:function(a){return this.parseDate(a,this.parsedViewFormat)},value2str:function(a){return a?this.dpg.formatDate(a,this.parsedFormat,this.options.datepicker.language):""},str2value:function(a){return this.parseDate(a,this.parsedFormat)},value2submit:function(a){return this.value2str(a)},value2input:function(a){this.$input.bdatepicker("update",a)},input2value:function(){return this.$input.data("datepicker").date},activate:function(){},clear:function(){this.$input.data("datepicker").date=null,this.$input.find(".active").removeClass("active"),this.options.showbuttons||this.$input.closest("form").submit()},autosubmit:function(){this.$input.on("mouseup",".day",function(b){if(!a(b.currentTarget).is(".old")&&!a(b.currentTarget).is(".new")){var c=a(this).closest("form");setTimeout(function(){c.submit()},200)}})},parseDate:function(a,b){var c,d=null;return a&&(d=this.dpg.parseDate(a,b,this.options.datepicker.language),"string"==typeof a&&(c=this.dpg.formatDate(d,b,this.options.datepicker.language),a!==c&&(d=null))),d}}),b.defaults=a.extend({},a.fn.editabletypes.abstractinput.defaults,{tpl:'
',inputclass:null,format:"yyyy-mm-dd",viewformat:null,datepicker:{weekStart:0,startView:0,minViewMode:0,autoclose:!1},clear:"× clear"}),a.fn.editabletypes.date=b}(window.jQuery),function(a){"use strict";var b=function(a){this.init("datefield",a,b.defaults),this.initPicker(a,b.defaults)};a.fn.editableutils.inherit(b,a.fn.editabletypes.date),a.extend(b.prototype,{render:function(){this.$input=this.$tpl.find("input"),this.setClass(),this.setAttr("placeholder"),this.$input.bdatepicker(this.options.datepicker),this.$input.off("focus keydown"),this.$input.keyup(a.proxy(function(){this.$tpl.removeData("date"),this.$tpl.bdatepicker("update")},this))},value2input:function(a){this.$input.val(a?this.dpg.formatDate(a,this.parsedViewFormat,this.options.datepicker.language):""),this.$tpl.bdatepicker("update")},input2value:function(){return this.html2value(this.$input.val())},activate:function(){a.fn.editabletypes.text.prototype.activate.call(this)},autosubmit:function(){}}),b.defaults=a.extend({},a.fn.editabletypes.date.defaults,{tpl:'
',inputclass:"input-small",datepicker:{weekStart:0,startView:0,minViewMode:0,autoclose:!0}}),a.fn.editabletypes.datefield=b}(window.jQuery),function(a){"use strict";var b=function(a){this.init("datetime",a,b.defaults),this.initPicker(a,b.defaults)};a.fn.editableutils.inherit(b,a.fn.editabletypes.abstractinput),a.extend(b.prototype,{initPicker:function(b,c){this.options.viewformat||(this.options.viewformat=this.options.format),b.datetimepicker=a.fn.editableutils.tryParseJson(b.datetimepicker,!0),this.options.datetimepicker=a.extend({},c.datetimepicker,b.datetimepicker,{format:this.options.viewformat}),this.options.datetimepicker.language=this.options.datetimepicker.language||"en",this.dpg=a.fn.datetimepicker.DPGlobal,this.parsedFormat=this.dpg.parseFormat(this.options.format,this.options.formatType),this.parsedViewFormat=this.dpg.parseFormat(this.options.viewformat,this.options.formatType)},render:function(){this.$input.datetimepicker(this.options.datetimepicker),this.$input.on("changeMode",function(b){var c=a(this).closest("form").parent();setTimeout(function(){c.triggerHandler("resize")},0)}),this.options.clear&&(this.$clear=a('
').html(this.options.clear).click(a.proxy(function(a){a.preventDefault(),a.stopPropagation(),this.clear()},this)),this.$tpl.parent().append(a('
').append(this.$clear)))},value2html:function(a,c){var d=a?this.dpg.formatDate(this.toUTC(a),this.parsedViewFormat,this.options.datetimepicker.language,this.options.formatType):"";return c?void b.superclass.value2html.call(this,d,c):d},html2value:function(a){var b=this.parseDate(a,this.parsedViewFormat);return b?this.fromUTC(b):null},value2str:function(a){return a?this.dpg.formatDate(this.toUTC(a),this.parsedFormat,this.options.datetimepicker.language,this.options.formatType):""},str2value:function(a){var b=this.parseDate(a,this.parsedFormat);return b?this.fromUTC(b):null},value2submit:function(a){return this.value2str(a)},value2input:function(a){a&&this.$input.data("datetimepicker").setDate(a)},input2value:function(){var a=this.$input.data("datetimepicker");return a.date?a.getDate():null},activate:function(){},clear:function(){this.$input.data("datetimepicker").date=null,this.$input.find(".active").removeClass("active"),this.options.showbuttons||this.$input.closest("form").submit()},autosubmit:function(){this.$input.on("mouseup",".minute",function(b){var c=a(this).closest("form");setTimeout(function(){c.submit()},200)})},toUTC:function(a){return a?new Date(a.valueOf()-6e4*a.getTimezoneOffset()):a},fromUTC:function(a){return a?new Date(a.valueOf()+6e4*a.getTimezoneOffset()):a},parseDate:function(a,b){var c,d=null;return a&&(d=this.dpg.parseDate(a,b,this.options.datetimepicker.language,this.options.formatType),"string"==typeof a&&(c=this.dpg.formatDate(d,b,this.options.datetimepicker.language,this.options.formatType),a!==c&&(d=null))),d}}),b.defaults=a.extend({},a.fn.editabletypes.abstractinput.defaults,{tpl:'
',inputclass:null,format:"yyyy-mm-dd hh:ii",formatType:"standard",viewformat:null,datetimepicker:{todayHighlight:!1,autoclose:!1},clear:"× clear"}),a.fn.editabletypes.datetime=b}(window.jQuery),function(a){"use strict";var b=function(a){this.init("datetimefield",a,b.defaults),this.initPicker(a,b.defaults)};a.fn.editableutils.inherit(b,a.fn.editabletypes.datetime),a.extend(b.prototype,{render:function(){this.$input=this.$tpl.find("input"),this.setClass(),this.setAttr("placeholder"),this.$tpl.datetimepicker(this.options.datetimepicker),this.$input.off("focus keydown"),this.$input.keyup(a.proxy(function(){this.$tpl.removeData("date"),this.$tpl.datetimepicker("update")},this))},value2input:function(a){this.$input.val(this.value2html(a)),this.$tpl.datetimepicker("update")},input2value:function(){return this.html2value(this.$input.val())},activate:function(){a.fn.editabletypes.text.prototype.activate.call(this)},autosubmit:function(){}}),b.defaults=a.extend({},a.fn.editabletypes.datetime.defaults,{tpl:'
',inputclass:"input-medium",datetimepicker:{todayHighlight:!1,autoclose:!0}}),a.fn.editabletypes.datetimefield=b}(window.jQuery);
\ No newline at end of file
diff --git a/dist/inputs-ext/wysihtml5/wysihtml5.js b/dist/inputs-ext/wysihtml5/wysihtml5.js
index 998f840f..521ddb03 100644
--- a/dist/inputs-ext/wysihtml5/wysihtml5.js
+++ b/dist/inputs-ext/wysihtml5/wysihtml5.js
@@ -98,6 +98,9 @@ $(function(){
//e.g. '
![]()
', '
', '
'
return !$element.height() || !$element.width();
}
+ },
+ destroy:function (){
+ this.$input.data('wysihtml5').editor.destroy();
}
});
diff --git a/dist/jquery-editable/css/jquery-editable.css b/dist/jquery-editable/css/jquery-editable.css
index 9eafa03e..156558c5 100644
--- a/dist/jquery-editable/css/jquery-editable.css
+++ b/dist/jquery-editable/css/jquery-editable.css
@@ -1,7 +1,7 @@
/*! X-editable - v1.5.3
* In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery
* http://github.com/vitalets/x-editable
-* Copyright (c) 2015 Vitaliy Potapov; Licensed MIT */
+* Copyright (c) 2018 Vitaliy Potapov; Licensed MIT */
.editableform {
margin-bottom: 0; /* overwrites bootstrap margin */
}
@@ -12,6 +12,16 @@
line-height: 20px; /* overwriting bootstrap line-height. See #133 */
}
+/*
+ BS3 fix: stop css from breaking when the form is inside a popup and inside a form with the class .form-horizontal
+ See: https://github.com/vitalets/x-editable/issues/682
+*/
+.form-horizontal .editable-popup .editableform .form-group {
+ margin-left:0;
+ margin-right:0;
+}
+
+
/*
BS3 width:1005 for inputs breaks editable form in popup
See: https://github.com/vitalets/x-editable/issues/393
@@ -145,6 +155,7 @@
.editable-pre-wrapped {
white-space: pre-wrap;
}
+
.editable-container.editable-popup {
max-width: none !important; /* without this rule poshytip/tooltip does not stretch */
}
diff --git a/dist/jquery-editable/js/jquery-editable-poshytip.js b/dist/jquery-editable/js/jquery-editable-poshytip.js
index ab1f9f4b..ee8e7247 100644
--- a/dist/jquery-editable/js/jquery-editable-poshytip.js
+++ b/dist/jquery-editable/js/jquery-editable-poshytip.js
@@ -1,7 +1,7 @@
/*! X-editable - v1.5.3
* In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery
* http://github.com/vitalets/x-editable
-* Copyright (c) 2015 Vitaliy Potapov; Licensed MIT */
+* Copyright (c) 2018 Vitaliy Potapov; Licensed MIT */
/**
Form with single input element, two buttons and two states: normal/loading.
Applied as jQuery method to DIV tag (not to form tag!). This is because form can be in loading state when spinner shown.
@@ -664,7 +664,7 @@ Editableform is linked with one of input types, e.g. 'text', 'select' etc.
*/
setCursorPosition: function(elem, pos) {
if (elem.setSelectionRange) {
- elem.setSelectionRange(pos, pos);
+ try { elem.setSelectionRange(pos, pos); } catch (e) {}
} else if (elem.createTextRange) {
var range = elem.createTextRange();
range.collapse(true);
@@ -736,7 +736,7 @@ Editableform is linked with one of input types, e.g. 'text', 'select' etc.
*/
getConfigData: function($element) {
var data = {};
- $.each($element.data(), function(k, v) {
+ $.each($element[0].dataset, function(k, v) {
if(typeof v !== 'object' || (v && typeof v === 'object' && (v.constructor === Object || v.constructor === Array))) {
data[k] = v;
}
@@ -941,7 +941,7 @@ Applied as jQuery method.
//close all on escape
$(document).on('keyup.editable', function (e) {
if (e.which === 27) {
- $('.editable-open').editableContainer('hide');
+ $('.editable-open').editableContainer('hide', 'cancel');
//todo: return focus on element
}
});
@@ -1613,7 +1613,7 @@ Makes editable any HTML element on the page. Applied as jQuery method.
this.options.autotext = 'never';
//listen toggle events
this.$element.on(this.options.toggle + '.editable', selector, $.proxy(function(e){
- var $target = $(e.target);
+ var $target = $(e.target).closest(selector);
if(!$target.data('editable')) {
//if delegated element initially empty, we need to clear it's text (that was manually set to `empty` by user)
//see https://github.com/vitalets/x-editable/issues/137
@@ -2400,7 +2400,7 @@ To create your own input you can inherit from this class.
@returns {string}
**/
value2str: function(value) {
- return value;
+ return String(value);
},
/**
@@ -2913,7 +2913,7 @@ $(function(){
**/
(function ($) {
"use strict";
-
+
var Text = function (options) {
this.init('text', options, Text.defaults);
};
@@ -2926,19 +2926,21 @@ $(function(){
this.setClass();
this.setAttr('placeholder');
},
-
+
activate: function() {
if(this.$input.is(':visible')) {
this.$input.focus();
+// if (this.$input.is('input,textarea') && !this.$input.is('[type="checkbox"],[type="range"],[type="number"],[type="email"]')) {
if (this.$input.is('input,textarea') && !this.$input.is('[type="checkbox"],[type="range"]')) {
$.fn.editableutils.setCursorPosition(this.$input.get(0), this.$input.val().length);
}
+
if(this.toggleClear) {
this.toggleClear();
}
}
},
-
+
//render clear button
renderClear: function() {
if (this.options.clear) {
@@ -2949,21 +2951,21 @@ $(function(){
//arrows, enter, tab, etc
if(~$.inArray(e.keyCode, [40,38,9,13,27])) {
return;
- }
+ }
clearTimeout(this.t);
var that = this;
this.t = setTimeout(function() {
that.toggleClear(e);
}, 100);
-
+
}, this))
.parent().css('position', 'relative');
-
- this.$clear.click($.proxy(this.clear, this));
- }
+
+ this.$clear.click($.proxy(this.clear, this));
+ }
},
-
+
postrender: function() {
/*
//now `clear` is positioned via css
@@ -2972,57 +2974,57 @@ $(function(){
// var h = this.$input.outerHeight(true) || 20,
var h = this.$clear.parent().height(),
delta = (h - this.$clear.height()) / 2;
-
+
//this.$clear.css({bottom: delta, right: delta});
}
- */
+ */
},
-
+
//show / hide clear button
toggleClear: function(e) {
if(!this.$clear) {
return;
}
-
+
var len = this.$input.val().length,
visible = this.$clear.is(':visible');
-
+
if(len && !visible) {
this.$clear.show();
- }
-
+ }
+
if(!len && visible) {
this.$clear.hide();
- }
+ }
},
-
+
clear: function() {
this.$clear.hide();
this.$input.val('').focus();
- }
+ }
});
Text.defaults = $.extend({}, $.fn.editabletypes.abstractinput.defaults, {
/**
- @property tpl
+ @property tpl
@default
- **/
+ **/
tpl: '
',
/**
Placeholder attribute of input. Shown when input is empty.
- @property placeholder
+ @property placeholder
@type string
@default null
- **/
+ **/
placeholder: null,
-
+
/**
- Whether to show `clear` button
-
- @property clear
+ Whether to show `clear` button
+
+ @property clear
@type boolean
- @default true
+ @default true
**/
clear: true
});
@@ -3711,7 +3713,7 @@ $(function(){
options.select2 = options.select2 || {};
this.sourceData = null;
-
+
//placeholder
if(options.placeholder) {
options.select2.placeholder = options.placeholder;
@@ -3916,9 +3918,15 @@ $(function(){
return source;
},
+ activate: function() {
+ this.$input.select2('open');
+ },
+
destroy: function() {
- if(this.$input.data('select2')) {
- this.$input.select2('destroy');
+ if(this.$input) {
+ if(this.$input.data('select2')) {
+ this.$input.select2('destroy');
+ }
}
}
@@ -3971,22 +3979,22 @@ $(function(){
}(window.jQuery));
/**
-* Combodate - 1.0.5
+* Combodate - 1.1.0
* Dropdown date and time picker.
* Converts text input into dropdowns to pick day, month, year, hour, minute and second.
* Uses momentjs as datetime library http://momentjs.com.
-* For i18n include corresponding file from https://github.com/timrwood/moment/tree/master/lang
+* For i18n include corresponding file from https://github.com/timrwood/moment/tree/master/lang
*
* Confusion at noon and midnight - see http://en.wikipedia.org/wiki/12-hour_clock#Confusion_at_noon_and_midnight
-* In combodate:
+* In combodate:
* 12:00 pm --> 12:00 (24-h format, midday)
* 12:00 am --> 00:00 (24-h format, midnight, start of day)
-*
+*
* Differs from momentjs parse rules:
* 00:00 pm, 12:00 pm --> 12:00 (24-h format, day not change)
* 00:00 am, 12:00 am --> 00:00 (24-h format, day not change)
-*
-*
+*
+*
* Author: Vitaliy Potapov
* Project page: http://github.com/vitalets/combodate
* Copyright (c) 2012 Vitaliy Potapov. Released under MIT License.
@@ -4000,28 +4008,31 @@ $(function(){
return;
}
this.options = $.extend({}, $.fn.combodate.defaults, options, this.$element.data());
- this.init();
+ this.init();
};
Combodate.prototype = {
- constructor: Combodate,
+ constructor: Combodate,
init: function () {
this.map = {
//key regexp moment.method
- day: ['D', 'date'],
- month: ['M', 'month'],
- year: ['Y', 'year'],
+ day: ['D', 'date'],
+ month: ['M', 'month'],
+ year: ['Y', 'year'],
hour: ['[Hh]', 'hours'],
- minute: ['m', 'minutes'],
+ minute: ['m', 'minutes'],
second: ['s', 'seconds'],
- ampm: ['[Aa]', '']
+ ampm: ['[Aa]', '']
};
-
+
this.$widget = $('
').html(this.getTemplate());
-
+
this.initCombos();
-
- //update original input on change
+
+ // internal momentjs instance
+ this.datetime = null;
+
+ //update original input on change
this.$widget.on('change', 'select', $.proxy(function(e) {
this.$element.val(this.getValue()).change();
// update days count if month or year changes
@@ -4031,28 +4042,30 @@ $(function(){
}
}
}, this));
-
+
this.$widget.find('select').css('width', 'auto');
-
- // hide original input and insert widget
+
+ // hide original input and insert widget
this.$element.hide().after(this.$widget);
-
+
// set initial value
this.setValue(this.$element.val() || this.options.value);
},
-
+
/*
- Replace tokens in template with