init
This commit is contained in:
.gitignoreCHANGELOG.txtLICENSE-GPLLICENSE-MITREADME.mdgrunt.jsjquery.ui.datepicker-ru.jsmakezippackage.json
libs
bootstrap204
css
img
js
bootstrap211
css
img
js
bootstrap221
css
img
js
jquery-ui-1.9.1.custom
css
redmond
images
ui-bg_flat_0_aaaaaa_40x100.pngui-bg_flat_55_fbec88_40x100.pngui-bg_glass_75_d0e5f5_1x400.pngui-bg_glass_85_dfeffc_1x400.pngui-bg_glass_95_fef1ec_1x400.pngui-bg_gloss-wave_55_5c9ccc_500x100.pngui-bg_inset-hard_100_f5f8f9_1x100.pngui-bg_inset-hard_100_fcfdfd_1x100.pngui-icons_217bc0_256x240.pngui-icons_2e83ff_256x240.pngui-icons_469bdd_256x240.pngui-icons_6da8d5_256x240.pngui-icons_cd0a0a_256x240.pngui-icons_d8e7f3_256x240.pngui-icons_f9bd01_256x240.png
jquery-ui-1.9.1.custom.cssjquery-ui-1.9.1.custom.min.csssmoothness
images
ui-bg_flat_0_aaaaaa_40x100.pngui-bg_flat_75_ffffff_40x100.pngui-bg_glass_55_fbf9ee_1x400.pngui-bg_glass_65_ffffff_1x400.pngui-bg_glass_75_dadada_1x400.pngui-bg_glass_75_e6e6e6_1x400.pngui-bg_glass_95_fef1ec_1x400.pngui-bg_highlight-soft_75_cccccc_1x100.pngui-icons_222222_256x240.pngui-icons_2e83ff_256x240.pngui-icons_454545_256x240.pngui-icons_888888_256x240.pngui-icons_cd0a0a_256x240.png
jquery-ui-1.9.1.custom.cssjquery-ui-1.9.1.custom.min.cssjs
jquery-ui-datepicker
jquery
mockjax
poshytip
jquery.poshytip.jsjquery.poshytip.min.jsjquery.poshytip_corrected.js
tip-darkgray
tip-green
tip-skyblue
tip-twitter
tip-violet
tip-yellow
tip-yellowsimple
qunit
src
containers
editable-container.csseditable-container.jseditable-inline.jseditable-popover.jseditable-poshytip.jseditable-tooltip.js
editable-form
editable-form-bootstrap.jseditable-form-jqueryui.jseditable-form-utils.jseditable-form.csseditable-form.js
img
element
inputs
abstract.js
date
bootstrap-datepicker.jsdate.jsdatepicker.css
dateui.jsselect.jstext.jstextarea.jslocales
bootstrap-datepicker.bg.jsbootstrap-datepicker.br.jsbootstrap-datepicker.cs.jsbootstrap-datepicker.da.jsbootstrap-datepicker.de.jsbootstrap-datepicker.es.jsbootstrap-datepicker.fi.jsbootstrap-datepicker.fr.jsbootstrap-datepicker.id.jsbootstrap-datepicker.is.jsbootstrap-datepicker.it.jsbootstrap-datepicker.ja.jsbootstrap-datepicker.kr.jsbootstrap-datepicker.lt.jsbootstrap-datepicker.lv.jsbootstrap-datepicker.ms.jsbootstrap-datepicker.nb.jsbootstrap-datepicker.nl.jsbootstrap-datepicker.pl.jsbootstrap-datepicker.pt-BR.jsbootstrap-datepicker.pt.jsbootstrap-datepicker.ru.jsbootstrap-datepicker.sl.jsbootstrap-datepicker.sv.jsbootstrap-datepicker.th.jsbootstrap-datepicker.tr.jsbootstrap-datepicker.zh-CN.jsbootstrap-datepicker.zh-TW.js
test
179
src/containers/editable-poshytip.js
Normal file
179
src/containers/editable-poshytip.js
Normal file
@ -0,0 +1,179 @@
|
||||
/**
|
||||
* Editable Poshytip
|
||||
* ---------------------
|
||||
* requires jquery.poshytip.js
|
||||
*/
|
||||
(function ($) {
|
||||
|
||||
//extend methods
|
||||
$.extend($.fn.editableContainer.Constructor.prototype, {
|
||||
containerName: 'poshytip',
|
||||
innerCss: 'div.tip-inner',
|
||||
|
||||
initContainer: function(){
|
||||
this.handlePlacement();
|
||||
this.call(this.options);
|
||||
|
||||
var $content = $('<div>')
|
||||
.append($('<label>').text(this.options.title || this.$element.data( "ui-tooltip-title") || this.$element.data( "originalTitle")))
|
||||
.append(this.initForm());
|
||||
|
||||
this.call('update', $content);
|
||||
},
|
||||
|
||||
show: function () {
|
||||
this.$form.editableform('render');
|
||||
this.tip().addClass('editable-container');
|
||||
|
||||
|
||||
this.call('show');
|
||||
this.$form.data('editableform').input.activate();
|
||||
},
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
this.options.alignX = x;
|
||||
this.options.offsetX = ox;
|
||||
|
||||
this.options.alignY = y;
|
||||
this.options.offsetY = oy;
|
||||
}
|
||||
});
|
||||
|
||||
//defaults
|
||||
$.fn.editableContainer.defaults = $.extend({}, $.fn.poshytip.defaults, $.fn.editableContainer.defaults, {
|
||||
className: 'tip-yellowsimple',
|
||||
showOn: 'none',
|
||||
content: '',
|
||||
alignTo: 'target'
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* Poshytip fix: disable incorrect table display
|
||||
* see https://github.com/vadikom/poshytip/issues/7
|
||||
*/
|
||||
/*jshint eqeqeq:false, curly: false*/
|
||||
var tips = [],
|
||||
reBgImage = /^url\(["']?([^"'\)]*)["']?\);?$/i,
|
||||
rePNG = /\.png$/i,
|
||||
ie6 = $.browser.msie && $.browser.version == 6;
|
||||
|
||||
$.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));
|
Reference in New Issue
Block a user