'+
- '';
+ $.fn.editableform.buttons =
+ ''+
+ '';
//error classes
- $.fn.editableform.errorGroupClass = 'error';
- $.fn.editableform.errorBlockClass = null;
-
-}(window.jQuery));
+ $.fn.editableform.errorGroupClass = 'has-error';
+ $.fn.editableform.errorBlockClass = null;
+ //engine
+ $.fn.editableform.engine = 'bs3';
+}(window.jQuery));
/**
-* Editable Popover
+* Editable Popover3 (for Bootstrap 3)
* ---------------------
* requires bootstrap-popover.js
*/
@@ -4500,15 +4554,16 @@ Editableform based on Twitter Bootstrap
//extend methods
$.extend($.fn.editableContainer.Popup.prototype, {
containerName: 'popover',
- //for compatibility with bootstrap <= 2.2.1 (content inserted into instead of directly .popover-content)
- innerCss: $.fn.popover && $($.fn.popover.defaults.template).find('p').length ? '.popover-content p' : '.popover-content',
+ containerDataName: 'bs.popover',
+ innerCss: '.popover-content',
+ defaults: $.fn.popover.Constructor.DEFAULTS,
initContainer: function(){
$.extend(this.containerOptions, {
trigger: 'manual',
selector: false,
content: ' ',
- template: $.fn.popover.defaults.template
+ template: this.defaults.template
});
//as template property is used in inputs, hide it from popover
@@ -4548,10 +4603,11 @@ Editableform based on Twitter Bootstrap
/**
* move popover to new position. This function mainly copied from bootstrap-popover.
*/
- /*jshint laxcomma: true*/
+ /*jshint laxcomma: true, eqeqeq: false*/
setPosition: function () {
- (function() {
+ (function() {
+ /*
var $tip = this.tip()
, inside
, pos
@@ -4661,14 +4717,32 @@ Editableform based on Twitter Bootstrap
.offset(tp)
.addClass(placement)
.addClass('in');
+ */
+
+
+ var $tip = this.tip();
+
+ var placement = typeof this.options.placement == 'function' ?
+ this.options.placement.call(this, $tip[0], this.$element[0]) :
+ this.options.placement;
+
+
+ var pos = this.getPosition();
+ var actualWidth = $tip[0].offsetWidth;
+ var actualHeight = $tip[0].offsetHeight;
+ var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight);
+
+ this.applyPlacement(calculatedOffset, placement);
+
+
}).call(this.container());
- /*jshint laxcomma: false*/
+ /*jshint laxcomma: false, eqeqeq: true*/
}
});
}(window.jQuery));
-
+
/* =========================================================
* bootstrap-datepicker.js
* http://www.eyecon.ro/bootstrap-datepicker
@@ -5923,7 +5997,7 @@ Editableform based on Twitter Bootstrap
});
}( window.jQuery ));
-
+
/**
Bootstrap-datepicker.
Description and examples: https://github.com/eternicode/bootstrap-datepicker.
@@ -6153,7 +6227,7 @@ $(function(){
$.fn.editabletypes.date = Date;
}(window.jQuery));
-
+
/**
Bootstrap datefield input - modification for inline mode.
Shows normal and binds popup datepicker.
@@ -6234,7 +6308,7 @@ Automatically shown in inline mode.
$.fn.editabletypes.datefield = DateField;
-}(window.jQuery));
+}(window.jQuery));
/**
Bootstrap-datetimepicker.
Based on [smalot bootstrap-datetimepicker plugin](https://github.com/smalot/bootstrap-datetimepicker).
@@ -6478,7 +6552,7 @@ $(function(){
$.fn.editabletypes.datetime = DateTime;
-}(window.jQuery));
+}(window.jQuery));
/**
Bootstrap datetimefield input - datetime input for inline mode.
Shows normal and binds popup datetimepicker.
@@ -6555,273 +6629,4 @@ Automatically shown in inline mode.
$.fn.editabletypes.datetimefield = DateTimeField;
-}(window.jQuery));
-/**
-Typeahead input (bootstrap only). Based on Twitter Bootstrap [typeahead](http://twitter.github.com/bootstrap/javascript.html#typeahead).
-Depending on `source` format typeahead operates in two modes:
-
-* **strings**:
- When `source` defined as array of strings, e.g. `['text1', 'text2', 'text3' ...]`.
- User can submit one of these strings or any text entered in input (even if it is not matching source).
-
-* **objects**:
- When `source` defined as array of objects, e.g. `[{value: 1, text: "text1"}, {value: 2, text: "text2"}, ...]`.
- User can submit only values that are in source (otherwise `null` is submitted). This is more like *dropdown* behavior.
-
-@class typeahead
-@extends list
-@since 1.4.1
-@final
-@example
-
-
-**/
-(function ($) {
- "use strict";
-
- var Constructor = function (options) {
- this.init('typeahead', options, Constructor.defaults);
-
- //overriding objects in config (as by default jQuery extend() is not recursive)
- this.options.typeahead = $.extend({}, Constructor.defaults.typeahead, {
- //set default methods for typeahead to work with objects
- matcher: this.matcher,
- sorter: this.sorter,
- highlighter: this.highlighter,
- updater: this.updater
- }, options.typeahead);
- };
-
- $.fn.editableutils.inherit(Constructor, $.fn.editabletypes.list);
-
- $.extend(Constructor.prototype, {
- renderList: function() {
- this.$input = this.$tpl.is('input') ? this.$tpl : this.$tpl.find('input[type="text"]');
-
- //set source of typeahead
- this.options.typeahead.source = this.sourceData;
-
- //apply typeahead
- this.$input.typeahead(this.options.typeahead);
-
- //patch some methods in typeahead
- var ta = this.$input.data('typeahead');
- ta.render = $.proxy(this.typeaheadRender, ta);
- ta.select = $.proxy(this.typeaheadSelect, ta);
- ta.move = $.proxy(this.typeaheadMove, ta);
-
- this.renderClear();
- this.setClass();
- this.setAttr('placeholder');
- },
-
- value2htmlFinal: function(value, element) {
- if(this.getIsObjects()) {
- var items = $.fn.editableutils.itemsByValue(value, this.sourceData);
- $(element).text(items.length ? items[0].text : '');
- } else {
- $(element).text(value);
- }
- },
-
- html2value: function (html) {
- return html ? html : null;
- },
-
- value2input: function(value) {
- if(this.getIsObjects()) {
- var items = $.fn.editableutils.itemsByValue(value, this.sourceData);
- this.$input.data('value', value).val(items.length ? items[0].text : '');
- } else {
- this.$input.val(value);
- }
- },
-
- input2value: function() {
- if(this.getIsObjects()) {
- var value = this.$input.data('value'),
- items = $.fn.editableutils.itemsByValue(value, this.sourceData);
-
- if(items.length && items[0].text.toLowerCase() === this.$input.val().toLowerCase()) {
- return value;
- } else {
- return null; //entered string not found in source
- }
- } else {
- return this.$input.val();
- }
- },
-
- /*
- if in sourceData values <> texts, typeahead in "objects" mode:
- user must pick some value from list, otherwise `null` returned.
- if all values == texts put typeahead in "strings" mode:
- anything what entered is submited.
- */
- getIsObjects: function() {
- if(this.isObjects === undefined) {
- this.isObjects = false;
- for(var i=0; i
- **/
- tpl:'',
- /**
- Configuration of typeahead. [Full list of options](http://twitter.github.com/bootstrap/javascript.html#typeahead).
-
- @property typeahead
- @type object
- @default null
- **/
- typeahead: null,
- /**
- Whether to show `clear` button
-
- @property clear
- @type boolean
- @default true
- **/
- clear: true
- });
-
- $.fn.editabletypes.typeahead = Constructor;
-
}(window.jQuery));
\ No newline at end of file
diff --git a/templates/admin/default/assets/js/bootstrap-switch/bootstrap-switch.js b/templates/admin/default/assets/js/bootstrap-switch/bootstrap-switch.js
new file mode 100644
index 000000000..1538f9df1
--- /dev/null
+++ b/templates/admin/default/assets/js/bootstrap-switch/bootstrap-switch.js
@@ -0,0 +1,382 @@
+/*! ============================================================
+ * bootstrapSwitch v1.8 by Larentis Mattia @SpiritualGuru
+ * http://www.larentis.eu/
+ *
+ * Enhanced for radiobuttons by Stein, Peter @BdMdesigN
+ * http://www.bdmdesign.org/
+ *
+ * Project site:
+ * http://www.larentis.eu/switch/
+ * ============================================================
+ * Licensed under the Apache License, Version 2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * ============================================================ */
+
+!function ($) {
+ "use strict";
+
+ $.fn['bootstrapSwitch'] = function (method) {
+ var inputSelector = 'input[type!="hidden"]';
+ var methods = {
+ init: function () {
+ return this.each(function () {
+ var $element = $(this)
+ , $div
+ , $switchLeft
+ , $switchRight
+ , $label
+ , $form = $element.closest('form')
+ , myClasses = ""
+ , classes = $element.attr('class')
+ , color
+ , moving
+ , onLabel = "ON"
+ , offLabel = "OFF"
+ , icon = false
+ , textLabel = false;
+
+ $.each(['switch-mini', 'switch-small', 'switch-large'], function (i, el) {
+ if (classes.indexOf(el) >= 0)
+ myClasses = el;
+ });
+
+ $element.addClass('has-switch');
+
+ if ($element.data('on') !== undefined)
+ color = "switch-" + $element.data('on');
+
+ if ($element.data('on-label') !== undefined)
+ onLabel = $element.data('on-label');
+
+ if ($element.data('off-label') !== undefined)
+ offLabel = $element.data('off-label');
+
+ if ($element.data('label-icon') !== undefined)
+ icon = $element.data('label-icon');
+
+ if ($element.data('text-label') !== undefined)
+ textLabel = $element.data('text-label');
+
+ $switchLeft = $('')
+ .addClass("switch-left")
+ .addClass(myClasses)
+ .addClass(color)
+ .html(onLabel);
+
+ color = '';
+ if ($element.data('off') !== undefined)
+ color = "switch-" + $element.data('off');
+
+ $switchRight = $('')
+ .addClass("switch-right")
+ .addClass(myClasses)
+ .addClass(color)
+ .html(offLabel);
+
+ $label = $('