Remove legacy framework support: clean up for Bootstrap 5 only
- Remove all Bootstrap 2/3 source files and containers - Remove jQuery UI datepicker dependencies and files - Remove legacy input extensions (select2, typeahead, wysihtml5) - Remove old test framework libraries - Clean up dist files to match source removal - Prepare codebase for Bootstrap 5 only distribution
This commit is contained in:
@@ -1,180 +0,0 @@
|
||||
/**
|
||||
* Editable Popover
|
||||
* ---------------------
|
||||
* requires bootstrap-popover.js
|
||||
*/
|
||||
(function ($) {
|
||||
"use strict";
|
||||
|
||||
//extend methods
|
||||
$.extend($.fn.editableContainer.Popup.prototype, {
|
||||
containerName: 'popover',
|
||||
//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',
|
||||
defaults: $.fn.popover.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');
|
||||
|
||||
}).call(this.container());
|
||||
/*jshint laxcomma: false*/
|
||||
}
|
||||
});
|
||||
|
||||
}(window.jQuery));
|
@@ -1,207 +0,0 @@
|
||||
/**
|
||||
* Editable Poshytip
|
||||
* ---------------------
|
||||
* requires jquery.poshytip.js
|
||||
*/
|
||||
(function ($) {
|
||||
"use strict";
|
||||
|
||||
//extend methods
|
||||
$.extend($.fn.editableContainer.Popup.prototype, {
|
||||
containerName: 'poshytip',
|
||||
innerCss: 'div.tip-inner',
|
||||
defaults: $.fn.poshytip.defaults,
|
||||
|
||||
initContainer: function(){
|
||||
this.handlePlacement();
|
||||
|
||||
$.extend(this.containerOptions, {
|
||||
showOn: 'none',
|
||||
content: '',
|
||||
alignTo: 'target'
|
||||
});
|
||||
|
||||
this.call(this.containerOptions);
|
||||
},
|
||||
|
||||
/*
|
||||
Overwrite totally show() method as poshytip requires content is set before show
|
||||
*/
|
||||
show: function (closeAll) {
|
||||
this.$element.addClass('editable-open');
|
||||
if(closeAll !== false) {
|
||||
//close all open containers (except this)
|
||||
this.closeOthers(this.$element[0]);
|
||||
}
|
||||
|
||||
//render form
|
||||
this.$form = $('<div>');
|
||||
this.renderForm();
|
||||
|
||||
var $label = $('<label>').text(this.options.title || this.$element.data( "title") || this.$element.data( "originalTitle")),
|
||||
$content = $('<div>').append($label).append(this.$form);
|
||||
|
||||
this.call('update', $content);
|
||||
this.call('show');
|
||||
|
||||
this.tip().addClass(this.containerClass);
|
||||
this.$form.data('editableform').input.activate();
|
||||
},
|
||||
|
||||
/* hide */
|
||||
innerHide: function () {
|
||||
this.call('hide');
|
||||
},
|
||||
|
||||
/* destroy */
|
||||
innerDestroy: function() {
|
||||
this.call('destroy');
|
||||
},
|
||||
|
||||
setPosition: function() {
|
||||
this.container().refresh(false);
|
||||
},
|
||||
|
||||
handlePlacement: function() {
|
||||
var x, y, ox = 0, oy = 0;
|
||||
switch(this.options.placement) {
|
||||
case 'top':
|
||||
x = 'center';
|
||||
y = 'top';
|
||||
oy = 5;
|
||||
break;
|
||||
case 'right':
|
||||
x = 'right';
|
||||
y = 'center';
|
||||
ox = 10;
|
||||
break;
|
||||
case 'bottom':
|
||||
x = 'center';
|
||||
y = 'bottom';
|
||||
oy = 5;
|
||||
break;
|
||||
case 'left':
|
||||
x = 'left';
|
||||
y = 'center';
|
||||
ox = 10;
|
||||
break;
|
||||
}
|
||||
|
||||
$.extend(this.containerOptions, {
|
||||
alignX: x,
|
||||
offsetX: ox,
|
||||
alignY: y,
|
||||
offsetY:oy
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
//defaults
|
||||
$.fn.editableContainer.defaults = $.extend({}, $.fn.editableContainer.defaults, {
|
||||
className: 'tip-yellowsimple'
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* Poshytip fix: disable incorrect table display
|
||||
* see https://github.com/vadikom/poshytip/issues/7
|
||||
*/
|
||||
/*jshint eqeqeq:false, curly: false*/
|
||||
if($.Poshytip) { //need this check, because in inline mode poshytip may not be loaded!
|
||||
var tips = [],
|
||||
reBgImage = /^url\(["']?([^"'\)]*)["']?\);?$/i,
|
||||
rePNG = /\.png$/i,
|
||||
ie6 = !!window.createPopup && document.documentElement.currentStyle.minWidth == 'undefined';
|
||||
|
||||
$.Poshytip.prototype.refresh = function(async) {
|
||||
if (this.disabled)
|
||||
return;
|
||||
|
||||
var currPos;
|
||||
if (async) {
|
||||
if (!this.$tip.data('active'))
|
||||
return;
|
||||
// save current position as we will need to animate
|
||||
currPos = {left: this.$tip.css('left'), top: this.$tip.css('top')};
|
||||
}
|
||||
|
||||
// reset position to avoid text wrapping, etc.
|
||||
this.$tip.css({left: 0, top: 0}).appendTo(document.body);
|
||||
|
||||
// save default opacity
|
||||
if (this.opacity === undefined)
|
||||
this.opacity = this.$tip.css('opacity');
|
||||
|
||||
// check for images - this code is here (i.e. executed each time we show the tip and not on init) due to some browser inconsistencies
|
||||
var bgImage = this.$tip.css('background-image').match(reBgImage),
|
||||
arrow = this.$arrow.css('background-image').match(reBgImage);
|
||||
|
||||
if (bgImage) {
|
||||
var bgImagePNG = rePNG.test(bgImage[1]);
|
||||
// fallback to background-color/padding/border in IE6 if a PNG is used
|
||||
if (ie6 && bgImagePNG) {
|
||||
this.$tip.css('background-image', 'none');
|
||||
this.$inner.css({margin: 0, border: 0, padding: 0});
|
||||
bgImage = bgImagePNG = false;
|
||||
} else {
|
||||
this.$tip.prepend('<table class="fallback" border="0" cellpadding="0" cellspacing="0"><tr><td class="tip-top tip-bg-image" colspan="2"><span></span></td><td class="tip-right tip-bg-image" rowspan="2"><span></span></td></tr><tr><td class="tip-left tip-bg-image" rowspan="2"><span></span></td><td></td></tr><tr><td class="tip-bottom tip-bg-image" colspan="2"><span></span></td></tr></table>')
|
||||
.css({border: 0, padding: 0, 'background-image': 'none', 'background-color': 'transparent'})
|
||||
.find('.tip-bg-image').css('background-image', 'url("' + bgImage[1] +'")').end()
|
||||
.find('td').eq(3).append(this.$inner);
|
||||
}
|
||||
// disable fade effect in IE due to Alpha filter + translucent PNG issue
|
||||
if (bgImagePNG && !$.support.opacity)
|
||||
this.opts.fade = false;
|
||||
}
|
||||
// IE arrow fixes
|
||||
if (arrow && !$.support.opacity) {
|
||||
// disable arrow in IE6 if using a PNG
|
||||
if (ie6 && rePNG.test(arrow[1])) {
|
||||
arrow = false;
|
||||
this.$arrow.css('background-image', 'none');
|
||||
}
|
||||
// disable fade effect in IE due to Alpha filter + translucent PNG issue
|
||||
this.opts.fade = false;
|
||||
}
|
||||
|
||||
var $table = this.$tip.find('table.fallback');
|
||||
if (ie6) {
|
||||
// fix min/max-width in IE6
|
||||
this.$tip[0].style.width = '';
|
||||
$table.width('auto').find('td').eq(3).width('auto');
|
||||
var tipW = this.$tip.width(),
|
||||
minW = parseInt(this.$tip.css('min-width'), 10),
|
||||
maxW = parseInt(this.$tip.css('max-width'), 10);
|
||||
if (!isNaN(minW) && tipW < minW)
|
||||
tipW = minW;
|
||||
else if (!isNaN(maxW) && tipW > maxW)
|
||||
tipW = maxW;
|
||||
this.$tip.add($table).width(tipW).eq(0).find('td').eq(3).width('100%');
|
||||
} else if ($table[0]) {
|
||||
// fix the table width if we are using a background image
|
||||
// IE9, FF4 use float numbers for width/height so use getComputedStyle for them to avoid text wrapping
|
||||
// for details look at: http://vadikom.com/dailies/offsetwidth-offsetheight-useless-in-ie9-firefox4/
|
||||
$table.width('auto').find('td').eq(3).width('auto').end().end().width(document.defaultView && document.defaultView.getComputedStyle && parseFloat(document.defaultView.getComputedStyle(this.$tip[0], null).width) || this.$tip.width()).find('td').eq(3).width('100%');
|
||||
}
|
||||
this.tipOuterW = this.$tip.outerWidth();
|
||||
this.tipOuterH = this.$tip.outerHeight();
|
||||
|
||||
this.calcPos();
|
||||
|
||||
// position and show the arrow image
|
||||
if (arrow && this.pos.arrow) {
|
||||
this.$arrow[0].className = 'tip-arrow tip-arrow-' + this.pos.arrow;
|
||||
this.$arrow.css('visibility', 'inherit');
|
||||
}
|
||||
|
||||
if (async) {
|
||||
this.asyncAnimating = true;
|
||||
var self = this;
|
||||
this.$tip.css(currPos).animate({left: this.pos.l, top: this.pos.t}, 200, function() { self.asyncAnimating = false; });
|
||||
} else {
|
||||
this.$tip.css({left: this.pos.l, top: this.pos.t});
|
||||
}
|
||||
};
|
||||
}
|
||||
/*jshinteqeqeq: true, curly: true*/
|
||||
}(window.jQuery));
|
@@ -1,121 +0,0 @@
|
||||
/**
|
||||
* Editable jQuery UI Tooltip
|
||||
* ---------------------
|
||||
* requires jquery ui 1.9.x
|
||||
*/
|
||||
(function ($) {
|
||||
"use strict";
|
||||
|
||||
//extend methods
|
||||
$.extend($.fn.editableContainer.Popup.prototype, {
|
||||
containerName: 'tooltip', //jQuery method, aplying the widget
|
||||
//object name in element's .data()
|
||||
containerDataName: 'ui-tooltip',
|
||||
innerCss: '.ui-tooltip-content',
|
||||
defaults: $.ui.tooltip.prototype.options,
|
||||
|
||||
//split options on containerOptions and formOptions
|
||||
splitOptions: function() {
|
||||
this.containerOptions = {};
|
||||
this.formOptions = {};
|
||||
|
||||
//check that jQueryUI build contains tooltip widget
|
||||
if(!$.ui[this.containerName]) {
|
||||
$.error('Please use jQueryUI with "tooltip" widget! http://jqueryui.com/download');
|
||||
return;
|
||||
}
|
||||
|
||||
//defaults for tooltip
|
||||
for(var k in this.options) {
|
||||
if(k in this.defaults) {
|
||||
this.containerOptions[k] = this.options[k];
|
||||
} else {
|
||||
this.formOptions[k] = this.options[k];
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
initContainer: function(){
|
||||
this.handlePlacement();
|
||||
$.extend(this.containerOptions, {
|
||||
items: '*',
|
||||
content: ' ',
|
||||
track: false,
|
||||
open: $.proxy(function() {
|
||||
//disable events hiding tooltip by default
|
||||
this.container()._on(this.container().element, {
|
||||
mouseleave: function(e){ e.stopImmediatePropagation(); },
|
||||
focusout: function(e){ e.stopImmediatePropagation(); }
|
||||
});
|
||||
}, this)
|
||||
});
|
||||
|
||||
this.call(this.containerOptions);
|
||||
|
||||
//disable standart triggering tooltip events
|
||||
this.container()._off(this.container().element, 'mouseover focusin');
|
||||
},
|
||||
|
||||
tip: function() {
|
||||
return this.container() ? this.container()._find(this.container().element) : null;
|
||||
},
|
||||
|
||||
innerShow: function() {
|
||||
this.call('open');
|
||||
var label = this.options.title || this.$element.data( "ui-tooltip-title") || this.$element.data( "originalTitle");
|
||||
this.tip().find(this.innerCss).empty().append($('<label>').text(label));
|
||||
},
|
||||
|
||||
innerHide: function() {
|
||||
this.call('close');
|
||||
},
|
||||
|
||||
innerDestroy: function() {
|
||||
/* tooltip destroys itself on hide */
|
||||
},
|
||||
|
||||
setPosition: function() {
|
||||
this.tip().position( $.extend({
|
||||
of: this.$element
|
||||
}, this.containerOptions.position ) );
|
||||
},
|
||||
|
||||
handlePlacement: function() {
|
||||
var pos;
|
||||
switch(this.options.placement) {
|
||||
case 'top':
|
||||
pos = {
|
||||
my: "center bottom-5",
|
||||
at: "center top",
|
||||
collision: 'flipfit'
|
||||
};
|
||||
break;
|
||||
case 'right':
|
||||
pos = {
|
||||
my: "left+5 center",
|
||||
at: "right center",
|
||||
collision: 'flipfit'
|
||||
};
|
||||
break;
|
||||
case 'bottom':
|
||||
pos = {
|
||||
my: "center top+5",
|
||||
at: "center bottom",
|
||||
collision: 'flipfit'
|
||||
};
|
||||
break;
|
||||
case 'left':
|
||||
pos = {
|
||||
my: "right-5 center",
|
||||
at: "left center",
|
||||
collision: 'flipfit'
|
||||
};
|
||||
break;
|
||||
}
|
||||
|
||||
this.containerOptions.position = pos;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}(window.jQuery));
|
Reference in New Issue
Block a user