bs3 first working version
This commit is contained in:
parent
99eb7223ce
commit
5c5a24b86b
src
containers
editable-form
element
inputs
test
@ -24,6 +24,8 @@ Applied as jQuery method.
|
|||||||
containerDataName: null, //object name in element's .data()
|
containerDataName: null, //object name in element's .data()
|
||||||
innerCss: null, //tbd in child class
|
innerCss: null, //tbd in child class
|
||||||
containerClass: 'editable-container editable-popup', //css class applied to container element
|
containerClass: 'editable-container editable-popup', //css class applied to container element
|
||||||
|
defaults: {}, //container itself defaults
|
||||||
|
|
||||||
init: function(element, options) {
|
init: function(element, options) {
|
||||||
this.$element = $(element);
|
this.$element = $(element);
|
||||||
//since 1.4.1 container do not use data-* directly as they already merged into options.
|
//since 1.4.1 container do not use data-* directly as they already merged into options.
|
||||||
@ -101,10 +103,9 @@ Applied as jQuery method.
|
|||||||
throw new Error(this.containerName + ' not found. Have you included corresponding js file?');
|
throw new Error(this.containerName + ' not found. Have you included corresponding js file?');
|
||||||
}
|
}
|
||||||
|
|
||||||
var cDef = $.fn[this.containerName].defaults;
|
|
||||||
//keys defined in container defaults go to container, others go to form
|
//keys defined in container defaults go to container, others go to form
|
||||||
for(var k in this.options) {
|
for(var k in this.options) {
|
||||||
if(k in cDef) {
|
if(k in this.defaults) {
|
||||||
this.containerOptions[k] = this.options[k];
|
this.containerOptions[k] = this.options[k];
|
||||||
} else {
|
} else {
|
||||||
this.formOptions[k] = this.options[k];
|
this.formOptions[k] = this.options[k];
|
||||||
|
@ -11,13 +11,14 @@
|
|||||||
containerName: 'popover',
|
containerName: 'popover',
|
||||||
//for compatibility with bootstrap <= 2.2.1 (content inserted into <p> instead of directly .popover-content)
|
//for compatibility with bootstrap <= 2.2.1 (content inserted into <p> instead of directly .popover-content)
|
||||||
innerCss: $.fn.popover && $($.fn.popover.defaults.template).find('p').length ? '.popover-content p' : '.popover-content',
|
innerCss: $.fn.popover && $($.fn.popover.defaults.template).find('p').length ? '.popover-content p' : '.popover-content',
|
||||||
|
defaults: $.fn.popover.defaults,
|
||||||
|
|
||||||
initContainer: function(){
|
initContainer: function(){
|
||||||
$.extend(this.containerOptions, {
|
$.extend(this.containerOptions, {
|
||||||
trigger: 'manual',
|
trigger: 'manual',
|
||||||
selector: false,
|
selector: false,
|
||||||
content: ' ',
|
content: ' ',
|
||||||
template: $.fn.popover.defaults.template
|
template: this.defaults.template
|
||||||
});
|
});
|
||||||
|
|
||||||
//as template property is used in inputs, hide it from popover
|
//as template property is used in inputs, hide it from popover
|
||||||
|
199
src/containers/editable-popover3.js
Normal file
199
src/containers/editable-popover3.js
Normal file
@ -0,0 +1,199 @@
|
|||||||
|
/**
|
||||||
|
* Editable Popover3 (for Bootstrap 3)
|
||||||
|
* ---------------------
|
||||||
|
* requires bootstrap-popover.js
|
||||||
|
*/
|
||||||
|
(function ($) {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
//extend methods
|
||||||
|
$.extend($.fn.editableContainer.Popup.prototype, {
|
||||||
|
containerName: 'popover',
|
||||||
|
containerDataName: 'bs.popover',
|
||||||
|
innerCss: '.popover-content',
|
||||||
|
defaults: $.fn.popover.Constructor.DEFAULTS,
|
||||||
|
|
||||||
|
initContainer: function(){
|
||||||
|
$.extend(this.containerOptions, {
|
||||||
|
trigger: 'manual',
|
||||||
|
selector: false,
|
||||||
|
content: ' ',
|
||||||
|
template: this.defaults.template
|
||||||
|
});
|
||||||
|
|
||||||
|
//as template property is used in inputs, hide it from popover
|
||||||
|
var t;
|
||||||
|
if(this.$element.data('template')) {
|
||||||
|
t = this.$element.data('template');
|
||||||
|
this.$element.removeData('template');
|
||||||
|
}
|
||||||
|
|
||||||
|
this.call(this.containerOptions);
|
||||||
|
|
||||||
|
if(t) {
|
||||||
|
//restore data('template')
|
||||||
|
this.$element.data('template', t);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/* show */
|
||||||
|
innerShow: function () {
|
||||||
|
this.call('show');
|
||||||
|
},
|
||||||
|
|
||||||
|
/* hide */
|
||||||
|
innerHide: function () {
|
||||||
|
this.call('hide');
|
||||||
|
},
|
||||||
|
|
||||||
|
/* destroy */
|
||||||
|
innerDestroy: function() {
|
||||||
|
this.call('destroy');
|
||||||
|
},
|
||||||
|
|
||||||
|
setContainerOption: function(key, value) {
|
||||||
|
this.container().options[key] = value;
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* move popover to new position. This function mainly copied from bootstrap-popover.
|
||||||
|
*/
|
||||||
|
/*jshint laxcomma: true*/
|
||||||
|
setPosition: function () {
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
/*
|
||||||
|
var $tip = this.tip()
|
||||||
|
, inside
|
||||||
|
, pos
|
||||||
|
, actualWidth
|
||||||
|
, actualHeight
|
||||||
|
, placement
|
||||||
|
, tp
|
||||||
|
, tpt
|
||||||
|
, tpb
|
||||||
|
, tpl
|
||||||
|
, tpr;
|
||||||
|
|
||||||
|
placement = typeof this.options.placement === 'function' ?
|
||||||
|
this.options.placement.call(this, $tip[0], this.$element[0]) :
|
||||||
|
this.options.placement;
|
||||||
|
|
||||||
|
inside = /in/.test(placement);
|
||||||
|
|
||||||
|
$tip
|
||||||
|
// .detach()
|
||||||
|
//vitalets: remove any placement class because otherwise they dont influence on re-positioning of visible popover
|
||||||
|
.removeClass('top right bottom left')
|
||||||
|
.css({ top: 0, left: 0, display: 'block' });
|
||||||
|
// .insertAfter(this.$element);
|
||||||
|
|
||||||
|
pos = this.getPosition(inside);
|
||||||
|
|
||||||
|
actualWidth = $tip[0].offsetWidth;
|
||||||
|
actualHeight = $tip[0].offsetHeight;
|
||||||
|
|
||||||
|
placement = inside ? placement.split(' ')[1] : placement;
|
||||||
|
|
||||||
|
tpb = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2};
|
||||||
|
tpt = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2};
|
||||||
|
tpl = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth};
|
||||||
|
tpr = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width};
|
||||||
|
|
||||||
|
switch (placement) {
|
||||||
|
case 'bottom':
|
||||||
|
if ((tpb.top + actualHeight) > ($(window).scrollTop() + $(window).height())) {
|
||||||
|
if (tpt.top > $(window).scrollTop()) {
|
||||||
|
placement = 'top';
|
||||||
|
} else if ((tpr.left + actualWidth) < ($(window).scrollLeft() + $(window).width())) {
|
||||||
|
placement = 'right';
|
||||||
|
} else if (tpl.left > $(window).scrollLeft()) {
|
||||||
|
placement = 'left';
|
||||||
|
} else {
|
||||||
|
placement = 'right';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'top':
|
||||||
|
if (tpt.top < $(window).scrollTop()) {
|
||||||
|
if ((tpb.top + actualHeight) < ($(window).scrollTop() + $(window).height())) {
|
||||||
|
placement = 'bottom';
|
||||||
|
} else if ((tpr.left + actualWidth) < ($(window).scrollLeft() + $(window).width())) {
|
||||||
|
placement = 'right';
|
||||||
|
} else if (tpl.left > $(window).scrollLeft()) {
|
||||||
|
placement = 'left';
|
||||||
|
} else {
|
||||||
|
placement = 'right';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'left':
|
||||||
|
if (tpl.left < $(window).scrollLeft()) {
|
||||||
|
if ((tpr.left + actualWidth) < ($(window).scrollLeft() + $(window).width())) {
|
||||||
|
placement = 'right';
|
||||||
|
} else if (tpt.top > $(window).scrollTop()) {
|
||||||
|
placement = 'top';
|
||||||
|
} else if (tpt.top > $(window).scrollTop()) {
|
||||||
|
placement = 'bottom';
|
||||||
|
} else {
|
||||||
|
placement = 'right';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'right':
|
||||||
|
if ((tpr.left + actualWidth) > ($(window).scrollLeft() + $(window).width())) {
|
||||||
|
if (tpl.left > $(window).scrollLeft()) {
|
||||||
|
placement = 'left';
|
||||||
|
} else if (tpt.top > $(window).scrollTop()) {
|
||||||
|
placement = 'top';
|
||||||
|
} else if (tpt.top > $(window).scrollTop()) {
|
||||||
|
placement = 'bottom';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (placement) {
|
||||||
|
case 'bottom':
|
||||||
|
tp = tpb;
|
||||||
|
break;
|
||||||
|
case 'top':
|
||||||
|
tp = tpt;
|
||||||
|
break;
|
||||||
|
case 'left':
|
||||||
|
tp = tpl;
|
||||||
|
break;
|
||||||
|
case 'right':
|
||||||
|
tp = tpr;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
$tip
|
||||||
|
.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*/
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}(window.jQuery));
|
@ -10,6 +10,7 @@
|
|||||||
$.extend($.fn.editableContainer.Popup.prototype, {
|
$.extend($.fn.editableContainer.Popup.prototype, {
|
||||||
containerName: 'poshytip',
|
containerName: 'poshytip',
|
||||||
innerCss: 'div.tip-inner',
|
innerCss: 'div.tip-inner',
|
||||||
|
defaults: $.fn.poshytip.defaults,
|
||||||
|
|
||||||
initContainer: function(){
|
initContainer: function(){
|
||||||
this.handlePlacement();
|
this.handlePlacement();
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
//object name in element's .data()
|
//object name in element's .data()
|
||||||
containerDataName: 'ui-tooltip',
|
containerDataName: 'ui-tooltip',
|
||||||
innerCss: '.ui-tooltip-content',
|
innerCss: '.ui-tooltip-content',
|
||||||
|
defaults: $.ui.tooltip.prototype.options,
|
||||||
|
|
||||||
//split options on containerOptions and formOptions
|
//split options on containerOptions and formOptions
|
||||||
splitOptions: function() {
|
splitOptions: function() {
|
||||||
@ -23,10 +24,10 @@
|
|||||||
$.error('Please use jQueryUI with "tooltip" widget! http://jqueryui.com/download');
|
$.error('Please use jQueryUI with "tooltip" widget! http://jqueryui.com/download');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//defaults for tooltip
|
//defaults for tooltip
|
||||||
var cDef = $.ui[this.containerName].prototype.options;
|
|
||||||
for(var k in this.options) {
|
for(var k in this.options) {
|
||||||
if(k in cDef) {
|
if(k in this.defaults) {
|
||||||
this.containerOptions[k] = this.options[k];
|
this.containerOptions[k] = this.options[k];
|
||||||
} else {
|
} else {
|
||||||
this.formOptions[k] = this.options[k];
|
this.formOptions[k] = this.options[k];
|
||||||
|
@ -1,13 +1,31 @@
|
|||||||
/*
|
/*
|
||||||
Editableform based on Twitter Bootstrap
|
Editableform based on Twitter Bootstrap 2
|
||||||
*/
|
*/
|
||||||
(function ($) {
|
(function ($) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
//store parent methods
|
||||||
|
var pInitInput = $.fn.editableform.Constructor.prototype.initInput;
|
||||||
|
|
||||||
$.extend($.fn.editableform.Constructor.prototype, {
|
$.extend($.fn.editableform.Constructor.prototype, {
|
||||||
initTemplate: function() {
|
initTemplate: function() {
|
||||||
this.$form = $($.fn.editableform.template);
|
this.$form = $($.fn.editableform.template);
|
||||||
this.$form.find('.editable-error-block').addClass('help-block');
|
this.$form.find('.editable-error-block').addClass('help-block');
|
||||||
|
},
|
||||||
|
initInput: function() {
|
||||||
|
pInitInput.apply(this);
|
||||||
|
|
||||||
|
//for bs2 set default class `input-medium` to standard inputs
|
||||||
|
var emptyInputClass = this.input.options.inputclass === null || this.input.options.inputclass === false;
|
||||||
|
var defaultClass = 'input-medium';
|
||||||
|
|
||||||
|
//add bs2 default class to standard inputs
|
||||||
|
//if(this.input.$input.is('input,select,textarea')) {
|
||||||
|
var stdtypes = 'text,select,textarea,password,email,url,tel,number,range,time'.split(',');
|
||||||
|
if(~$.inArray(this.input.type, stdtypes) && emptyInputClass) {
|
||||||
|
this.input.options.inputclass = defaultClass;
|
||||||
|
this.input.$input.addClass(defaultClass);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -17,6 +35,8 @@ Editableform based on Twitter Bootstrap
|
|||||||
|
|
||||||
//error classes
|
//error classes
|
||||||
$.fn.editableform.errorGroupClass = 'error';
|
$.fn.editableform.errorGroupClass = 'error';
|
||||||
$.fn.editableform.errorBlockClass = null;
|
$.fn.editableform.errorBlockClass = null;
|
||||||
|
//engine
|
||||||
|
$.fn.editableform.engine = 'bs2';
|
||||||
|
|
||||||
}(window.jQuery));
|
}(window.jQuery));
|
61
src/editable-form/editable-form-bootstrap3.js
Normal file
61
src/editable-form/editable-form-bootstrap3.js
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
/*
|
||||||
|
Editableform based on Twitter Bootstrap 3
|
||||||
|
*/
|
||||||
|
(function ($) {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
//store parent methods
|
||||||
|
var pInitInput = $.fn.editableform.Constructor.prototype.initInput;
|
||||||
|
|
||||||
|
$.extend($.fn.editableform.Constructor.prototype, {
|
||||||
|
initTemplate: function() {
|
||||||
|
this.$form = $($.fn.editableform.template);
|
||||||
|
this.$form.find('.control-group').addClass('form-group');
|
||||||
|
this.$form.find('.editable-error-block').addClass('help-block');
|
||||||
|
},
|
||||||
|
initInput: function() {
|
||||||
|
pInitInput.apply(this);
|
||||||
|
|
||||||
|
//for bs3 set default class `input-sm` to standard inputs
|
||||||
|
var emptyInputClass = this.input.options.inputclass === null || this.input.options.inputclass === false;
|
||||||
|
var defaultClass = 'input-sm';
|
||||||
|
|
||||||
|
//bs3 add `form-control` class to standard inputs
|
||||||
|
var stdtypes = 'text,select,textarea,password,email,url,tel,number,range,time'.split(',');
|
||||||
|
if(~$.inArray(this.input.type, stdtypes)) {
|
||||||
|
this.input.$input.addClass('form-control');
|
||||||
|
if(emptyInputClass) {
|
||||||
|
this.input.options.inputclass = defaultClass;
|
||||||
|
this.input.$input.addClass(defaultClass);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//apply bs3 size class also to buttons (to fit size of control)
|
||||||
|
var $btn = this.$form.find('.editable-buttons');
|
||||||
|
var classes = emptyInputClass ? [defaultClass] : this.input.options.inputclass.split(' ');
|
||||||
|
for(var i=0; i<classes.length; i++) {
|
||||||
|
if(classes[i].toLowerCase() === 'input-sm') {
|
||||||
|
$btn.find('button').addClass('btn-sm');
|
||||||
|
}
|
||||||
|
if(classes[i].toLowerCase() === 'input-lg') {
|
||||||
|
$btn.find('button').addClass('btn-lg');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//buttons
|
||||||
|
$.fn.editableform.buttons =
|
||||||
|
'<button type="submit" class="btn btn-primary editable-submit">'+
|
||||||
|
'<i class="glyphicon glyphicon-ok"></i>'+
|
||||||
|
'</button>'+
|
||||||
|
'<button type="button" class="btn btn-default editable-cancel">'+
|
||||||
|
'<i class="glyphicon glyphicon-remove"></i>'+
|
||||||
|
'</button>';
|
||||||
|
|
||||||
|
//error classes
|
||||||
|
$.fn.editableform.errorGroupClass = 'has-error';
|
||||||
|
$.fn.editableform.errorBlockClass = null;
|
||||||
|
//engine
|
||||||
|
$.fn.editableform.engine = 'bs3';
|
||||||
|
}(window.jQuery));
|
@ -26,5 +26,7 @@ Editableform based on jQuery UI
|
|||||||
//error classes
|
//error classes
|
||||||
$.fn.editableform.errorGroupClass = null;
|
$.fn.editableform.errorGroupClass = null;
|
||||||
$.fn.editableform.errorBlockClass = 'ui-state-error';
|
$.fn.editableform.errorBlockClass = 'ui-state-error';
|
||||||
|
//engine
|
||||||
|
$.fn.editableform.engine = 'jqeury-ui';
|
||||||
|
|
||||||
}(window.jQuery));
|
}(window.jQuery));
|
@ -28,6 +28,9 @@ Editableform is linked with one of input types, e.g. 'text', 'select' etc.
|
|||||||
//set initial value
|
//set initial value
|
||||||
//todo: may be add check: typeof str === 'string' ?
|
//todo: may be add check: typeof str === 'string' ?
|
||||||
this.value = this.input.str2value(this.options.value);
|
this.value = this.input.str2value(this.options.value);
|
||||||
|
|
||||||
|
//prerender: get input.$input
|
||||||
|
this.input.prerender();
|
||||||
},
|
},
|
||||||
initTemplate: function() {
|
initTemplate: function() {
|
||||||
this.$form = $($.fn.editableform.template);
|
this.$form = $($.fn.editableform.template);
|
||||||
@ -75,9 +78,8 @@ Editableform is linked with one of input types, e.g. 'text', 'select' etc.
|
|||||||
this.initInput();
|
this.initInput();
|
||||||
|
|
||||||
//append input to form
|
//append input to form
|
||||||
this.input.prerender();
|
|
||||||
this.$form.find('div.editable-input').append(this.input.$tpl);
|
this.$form.find('div.editable-input').append(this.input.$tpl);
|
||||||
|
|
||||||
//append form to container
|
//append form to container
|
||||||
this.$div.append(this.$form);
|
this.$div.append(this.$form);
|
||||||
|
|
||||||
@ -615,4 +617,7 @@ Editableform is linked with one of input types, e.g. 'text', 'select' etc.
|
|||||||
|
|
||||||
//error class attached to editable-error-block
|
//error class attached to editable-error-block
|
||||||
$.fn.editableform.errorBlockClass = 'editable-error';
|
$.fn.editableform.errorBlockClass = 'editable-error';
|
||||||
|
|
||||||
|
//engine
|
||||||
|
$.fn.editableform.engine = 'jqeury';
|
||||||
}(window.jQuery));
|
}(window.jQuery));
|
||||||
|
@ -806,7 +806,7 @@ Makes editable any HTML element on the page. Applied as jQuery method.
|
|||||||
@since 1.4.5
|
@since 1.4.5
|
||||||
@default #FFFF80
|
@default #FFFF80
|
||||||
**/
|
**/
|
||||||
highlight: '#FFFF80'
|
highlight: '#FFFF80'
|
||||||
};
|
};
|
||||||
|
|
||||||
}(window.jQuery));
|
}(window.jQuery));
|
||||||
|
@ -159,7 +159,7 @@ To create your own input you can inherit from this class.
|
|||||||
},
|
},
|
||||||
|
|
||||||
// -------- helper functions --------
|
// -------- helper functions --------
|
||||||
setClass: function() {
|
setClass: function() {
|
||||||
if(this.options.inputclass) {
|
if(this.options.inputclass) {
|
||||||
this.$input.addClass(this.options.inputclass);
|
this.$input.addClass(this.options.inputclass);
|
||||||
}
|
}
|
||||||
@ -191,9 +191,9 @@ To create your own input you can inherit from this class.
|
|||||||
|
|
||||||
@property inputclass
|
@property inputclass
|
||||||
@type string
|
@type string
|
||||||
@default input-medium
|
@default null
|
||||||
**/
|
**/
|
||||||
inputclass: 'input-medium',
|
inputclass: null,
|
||||||
//scope for external methods (e.g. source defined as function)
|
//scope for external methods (e.g. source defined as function)
|
||||||
//for internal use only
|
//for internal use only
|
||||||
scope: null,
|
scope: null,
|
||||||
|
@ -64,7 +64,14 @@ $(function(){
|
|||||||
$.extend(Constructor.prototype, {
|
$.extend(Constructor.prototype, {
|
||||||
render: function () {
|
render: function () {
|
||||||
this.$input.combodate(this.options.combodate);
|
this.$input.combodate(this.options.combodate);
|
||||||
|
|
||||||
|
if($.fn.editableform.engine === 'bs3') {
|
||||||
|
this.$input.siblings().find('select').addClass('form-control');
|
||||||
|
}
|
||||||
|
|
||||||
|
if(this.options.inputclass) {
|
||||||
|
this.$input.siblings().find('select').addClass(this.options.inputclass);
|
||||||
|
}
|
||||||
//"clear" link
|
//"clear" link
|
||||||
/*
|
/*
|
||||||
if(this.options.clear) {
|
if(this.options.clear) {
|
||||||
|
2
src/inputs/select2/select2.js
vendored
2
src/inputs/select2/select2.js
vendored
@ -316,7 +316,7 @@ $(function(){
|
|||||||
@type string
|
@type string
|
||||||
@default ', '
|
@default ', '
|
||||||
**/
|
**/
|
||||||
viewseparator: ', '
|
viewseparator: ', '
|
||||||
});
|
});
|
||||||
|
|
||||||
$.fn.editabletypes.select2 = Constructor;
|
$.fn.editabletypes.select2 = Constructor;
|
||||||
|
@ -14,15 +14,18 @@ define(function () {
|
|||||||
return {
|
return {
|
||||||
loadCss: loadCss,
|
loadCss: loadCss,
|
||||||
getConfig: function (baseUrl) {
|
getConfig: function (baseUrl) {
|
||||||
|
|
||||||
var
|
var
|
||||||
jqueryui_ver = '1.10.3',
|
jqueryui_ver = '1.10.3',
|
||||||
// jqueryui_ver = '1.9.1',
|
// jqueryui_ver = '1.9.1',
|
||||||
|
bs_ver = '300',
|
||||||
|
bs_major_ver = bs_ver.substr(0,1),
|
||||||
paths = {
|
paths = {
|
||||||
// "bootstrap": "../test/libs/bootstrap221",
|
// "bootstrap": "../test/libs/bootstrap221",
|
||||||
// "bootstrap": "../test/libs/bootstrap222",
|
// "bootstrap": "../test/libs/bootstrap222",
|
||||||
// "bootstrap": "../test/libs/bootstrap231",
|
// "bootstrap": "../test/libs/bootstrap231",
|
||||||
"bootstrap": "../test/libs/bootstrap232",
|
// "bootstrap": "../test/libs/bootstrap232",
|
||||||
|
"bootstrap": "../test/libs/bootstrap"+bs_ver,
|
||||||
|
|
||||||
// "jqueryui": "../test/libs/jquery-ui-"+jqueryui_ver+".custom",
|
// "jqueryui": "../test/libs/jquery-ui-"+jqueryui_ver+".custom",
|
||||||
"jqueryui_js": "../test/libs/jquery-ui-"+jqueryui_ver+".custom/js/jquery-ui-"+jqueryui_ver+".custom",
|
"jqueryui_js": "../test/libs/jquery-ui-"+jqueryui_ver+".custom/js/jquery-ui-"+jqueryui_ver+".custom",
|
||||||
@ -92,17 +95,27 @@ define(function () {
|
|||||||
init: function(require) {
|
init: function(require) {
|
||||||
loadCss(require.toUrl("../css/bootstrap.css"));
|
loadCss(require.toUrl("../css/bootstrap.css"));
|
||||||
//add responsive css
|
//add responsive css
|
||||||
loadCss(require.toUrl("../css/bootstrap-responsive.css"));
|
if(bs_major_ver < 3) {
|
||||||
|
loadCss(require.toUrl("../css/bootstrap-responsive.css"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'editable-form/editable-form-bootstrap': [
|
'editable-form/editable-form-bootstrap': [
|
||||||
'editable-form/editable-form',
|
'editable-form/editable-form',
|
||||||
'bootstrap/js/bootstrap'
|
'bootstrap/js/bootstrap'
|
||||||
],
|
],
|
||||||
|
'editable-form/editable-form-bootstrap3': [
|
||||||
|
'editable-form/editable-form',
|
||||||
|
'bootstrap/js/bootstrap'
|
||||||
|
],
|
||||||
'containers/editable-popover': [
|
'containers/editable-popover': [
|
||||||
'containers/editable-inline',
|
'containers/editable-inline',
|
||||||
'bootstrap/js/bootstrap'
|
'bootstrap/js/bootstrap'
|
||||||
],
|
],
|
||||||
|
'containers/editable-popover3': [
|
||||||
|
'containers/editable-inline',
|
||||||
|
'bootstrap/js/bootstrap'
|
||||||
|
],
|
||||||
'inputs/date/date': {
|
'inputs/date/date': {
|
||||||
deps: ['require',
|
deps: ['require',
|
||||||
'bootstrap/js/bootstrap',
|
'bootstrap/js/bootstrap',
|
||||||
@ -217,12 +230,16 @@ define(function () {
|
|||||||
|
|
||||||
if(f === 'bootstrap') {
|
if(f === 'bootstrap') {
|
||||||
//bootstrap
|
//bootstrap
|
||||||
shim['editable-form/editable-form'].deps.push('inputs/date/datefield');
|
shim['editable-form/editable-form'].deps = shim['editable-form/editable-form'].deps.concat(
|
||||||
shim['editable-form/editable-form'].deps.push('inputs/datetime/datetimefield');
|
[
|
||||||
shim['editable-form/editable-form'].deps.push('inputs-ext/wysihtml5/wysihtml5');
|
'inputs/date/datefield',
|
||||||
shim['editable-form/editable-form'].deps.push('inputs/typeahead');
|
'inputs/datetime/datetimefield',
|
||||||
shim['element/editable-element'].deps.push('editable-form/editable-form-bootstrap');
|
'inputs-ext/wysihtml5/wysihtml5',
|
||||||
shim['element/editable-element'].deps.push('containers/editable-popover');
|
'inputs/typeahead'
|
||||||
|
]);
|
||||||
|
var suffix = bs_major_ver < 3 ? '' : bs_major_ver;
|
||||||
|
shim['element/editable-element'].deps.push('editable-form/editable-form-bootstrap'+suffix);
|
||||||
|
shim['element/editable-element'].deps.push('containers/editable-popover'+suffix);
|
||||||
} else if(f === 'jqueryui') {
|
} else if(f === 'jqueryui') {
|
||||||
//jqueryui
|
//jqueryui
|
||||||
shim['editable-form/editable-form'].deps.push('inputs/dateui/dateuifield');
|
shim['editable-form/editable-form'].deps.push('inputs/dateui/dateuifield');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user