mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-12 04:23:19 +00:00
tag 3.1.13
This commit is contained in:
@@ -1,2 +1,2 @@
|
||||
<?php
|
||||
define('GV_version','3.1.12');
|
||||
define('GV_version','3.1.13');
|
||||
|
@@ -13,7 +13,7 @@
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*/
|
||||
|
||||
/*jsl:ignore*/;/*jsl:end*/(function($) {
|
||||
(function($) {
|
||||
|
||||
// the tooltip element
|
||||
var helper = {},
|
||||
@@ -28,6 +28,9 @@
|
||||
|
||||
$.tooltip = {
|
||||
blocked: false,
|
||||
ajaxTimeout : false,
|
||||
ajaxRequest : false,
|
||||
ajaxEvent : false,
|
||||
current: null,
|
||||
visible: false,
|
||||
defaults: {
|
||||
@@ -43,6 +46,20 @@
|
||||
},
|
||||
block: function() {
|
||||
$.tooltip.blocked = !$.tooltip.blocked;
|
||||
},
|
||||
|
||||
delayAjax : function(a,b,c)
|
||||
{
|
||||
$.tooltip.ajaxRequest = $.ajax({
|
||||
url: $.tooltip.current.tooltipSrc,
|
||||
success: function(data) {
|
||||
title = data;
|
||||
positioning($.tooltip.ajaxEvent);
|
||||
},
|
||||
"error":function(){
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -53,7 +70,12 @@
|
||||
return this.each(function() {
|
||||
$.data(this, "tooltip", settings);
|
||||
// copy tooltip into its own expando and remove the title
|
||||
this.tooltipText = this.title;
|
||||
this.tooltipText = $(this).attr('title');
|
||||
this.tooltipSrc = $(this).attr('tooltipsrc');
|
||||
|
||||
this.ajaxLoad = (this.tooltipText === '' && this.tooltipSrc !== '');
|
||||
this.ajaxTimeout;
|
||||
|
||||
this.orEl = $(this);
|
||||
$(this).removeAttr("title");
|
||||
// also remove alt attribute to prevent default tooltip in IE
|
||||
@@ -78,12 +100,19 @@
|
||||
});
|
||||
}
|
||||
});
|
||||
} : function() { return this; },
|
||||
} : function() {
|
||||
return this;
|
||||
},
|
||||
unfixPNG: IE ? function() {
|
||||
return this.each(function () {
|
||||
$(this).css({'filter': '', backgroundImage: ''});
|
||||
$(this).css({
|
||||
'filter': '',
|
||||
backgroundImage: ''
|
||||
});
|
||||
} : function() { return this; },
|
||||
});
|
||||
} : function() {
|
||||
return this;
|
||||
},
|
||||
hideWhenEmpty: function() {
|
||||
return this.each(function() {
|
||||
$(this)[ $(this).html() ? "show" : "hide" ]();
|
||||
@@ -99,7 +128,7 @@
|
||||
if( helper.parent )
|
||||
return;
|
||||
// create the helper, h3 for title, div for url
|
||||
helper.parent = $('<div id="' + settings.id + '"><div class="ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix"><a class="tooltip_closer ui-dialog-titlebar-close ui-corner-all" style="background-color:black;position:absolute;top:0;right:0;cursor:pointer;display:none;" onclick="unfix_tooltip();return false;" href="#"><span class="ui-icon ui-icon-closethick" unselectable="on" style="-moz-user-select: none;">close</span></a></div><div class="body"></div></div>')
|
||||
helper.parent = $('<div id="' + settings.id + '"><div class="ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix"><a class="tooltip_closer ui-dialog-titlebar-close ui-corner-all" style="background-color:black;position:absolute;top:0;right:0;cursor:pointer;display:none;z-index:100;" onclick="unfix_tooltip();return false;" href="#"><span class="ui-icon ui-icon-closethick" unselectable="on" style="-moz-user-select: none;">close</span></a></div><div class="body"></div></div>')
|
||||
// add to document
|
||||
.appendTo(document.body)
|
||||
// hide it at first
|
||||
@@ -148,35 +177,35 @@
|
||||
|
||||
event.cancelBubble = true;
|
||||
|
||||
if ( $.tooltip.blocked || this == $.tooltip.current || (!this.tooltipText && !settings(this).bodyHandler) )
|
||||
if ( $.tooltip.blocked || this == $.tooltip.current || (!this.tooltipText && !this.tooltipSrc && !settings(this).bodyHandler) )
|
||||
return;
|
||||
|
||||
// save current
|
||||
$.tooltip.current = this;
|
||||
title = this.tooltipText;
|
||||
|
||||
if ( settings(this).bodyHandler ) {
|
||||
helper.title.hide();
|
||||
var bodyContent = settings(this).bodyHandler.call(this);
|
||||
if (bodyContent.nodeType || bodyContent.jquery) {
|
||||
helper.body.empty().append(bodyContent);
|
||||
} else {
|
||||
helper.body.html( bodyContent );
|
||||
}
|
||||
helper.body.show();
|
||||
} else if ( settings(this).showBody ) {
|
||||
var parts = title.split(settings(this).showBody);
|
||||
helper.title.html(parts.shift()).show();
|
||||
helper.body.empty();
|
||||
for(var i = 0, part; (part = parts[i]); i++) {
|
||||
if(i > 0)
|
||||
helper.body.append("<br/>");
|
||||
helper.body.append(part);
|
||||
}
|
||||
helper.body.hideWhenEmpty();
|
||||
} else {
|
||||
helper.body.html(title).show();
|
||||
}
|
||||
// if ( settings(this).bodyHandler ) {
|
||||
// helper.title.hide();
|
||||
// var bodyContent = settings(this).bodyHandler.call(this);
|
||||
// if (bodyContent.nodeType || bodyContent.jquery) {
|
||||
// helper.body.empty().append(bodyContent);
|
||||
// } else {
|
||||
// helper.body.html( bodyContent );
|
||||
// }
|
||||
// helper.body.show();
|
||||
// } else if ( settings(this).showBody ) {
|
||||
// var parts = title.split(settings(this).showBody);
|
||||
// helper.title.html(parts.shift()).show();
|
||||
// helper.body.empty();
|
||||
// for(var i = 0, part; (part = parts[i]); i++) {
|
||||
// if(i > 0)
|
||||
// helper.body.append("<br/>");
|
||||
// helper.body.append(part);
|
||||
// }
|
||||
// helper.body.hideWhenEmpty();
|
||||
// } else {
|
||||
// helper.body.html(title).show();
|
||||
// }
|
||||
|
||||
// if element has href or src, add and show it, otherwise hide it
|
||||
if( settings(this).showURL && $(this).url() )
|
||||
@@ -186,11 +215,29 @@
|
||||
|
||||
// add an optional class for this tip
|
||||
// helper.parent.addClass(settings(this).extraClass);
|
||||
if(this.ajaxLoad)
|
||||
{
|
||||
clearTimeout($.tooltip.ajaxTimeout);
|
||||
$.tooltip.ajaxTimeout = setTimeout("$.tooltip.delayAjax()", 300);
|
||||
$.tooltip.ajaxEvent = event;
|
||||
}
|
||||
else
|
||||
{
|
||||
positioning.apply(this, arguments);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
function positioning(event)
|
||||
{
|
||||
|
||||
helper.body.html(title).show();
|
||||
$this = $.tooltip.current;
|
||||
// fix PNG background for IE
|
||||
if (settings(this).fixPNG )
|
||||
if (settings($this).fixPNG )
|
||||
helper.parent.fixPNG();
|
||||
if(settings(this).outside)
|
||||
if(settings($this).outside)
|
||||
{
|
||||
var width = 'auto';
|
||||
var height = 'auto';
|
||||
@@ -217,12 +264,17 @@
|
||||
width = ($(h).width()>(v.x-40))?(v.x-40):$(h).width();
|
||||
height = ($(h).height()>(v.y-40))?(v.y-40):$(h).height();
|
||||
|
||||
// $('#' + settings($.tooltip.current).id + ' .thumb_wrapper').width('auto').height('auto');
|
||||
|
||||
if($('#' + settings($.tooltip.current).id + ' .audioTips').length > 0)
|
||||
{
|
||||
height = height < 26 ? 26 : height;
|
||||
}
|
||||
|
||||
$(h).css({width:width,height:height});
|
||||
$(h).css({
|
||||
width:width,
|
||||
height:height
|
||||
});
|
||||
|
||||
if (event) {
|
||||
|
||||
@@ -361,7 +413,8 @@
|
||||
}
|
||||
width = nw;
|
||||
}
|
||||
}else{
|
||||
}else
|
||||
{
|
||||
if(vertS < horS)
|
||||
{
|
||||
height = 'auto';
|
||||
@@ -375,16 +428,24 @@
|
||||
top: top
|
||||
});
|
||||
|
||||
$('#' + settings($.tooltip.current).id + ' .imgTips').css({
|
||||
var $imgTips = $('#' + settings($.tooltip.current).id + ' .imgTips');
|
||||
$imgTips.css({
|
||||
width: width,
|
||||
height: height,
|
||||
left: left,
|
||||
top: top
|
||||
});
|
||||
|
||||
// if($imgTips.size() > 0)
|
||||
// {
|
||||
// $('#' + settings($.tooltip.current).id).image_enhance('destroy').image_enhance({
|
||||
// zoomable:true
|
||||
// });
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
handle.apply(this, arguments);
|
||||
handle.apply($this, arguments);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -480,12 +541,16 @@
|
||||
// check horizontal position
|
||||
if (v.x + v.cx < h.offsetLeft + h.offsetWidth) {
|
||||
left -= h.offsetWidth + 20 + settings($.tooltip.current).left;
|
||||
helper.parent.css({left: left + 'px'}).addClass("viewport-right");
|
||||
helper.parent.css({
|
||||
left: left + 'px'
|
||||
}).addClass("viewport-right");
|
||||
}
|
||||
// check vertical position
|
||||
if (v.y + v.cy < h.offsetTop + h.offsetHeight) {
|
||||
top -= h.offsetHeight + 20 + settings($.tooltip.current).top;
|
||||
helper.parent.css({top: top + 'px'}).addClass("viewport-bottom");
|
||||
helper.parent.css({
|
||||
top: top + 'px'
|
||||
}).addClass("viewport-bottom");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -511,12 +576,14 @@
|
||||
// no more current element
|
||||
$.tooltip.visible = false;
|
||||
var tsettings = settings($.tooltip.current);
|
||||
clearTimeout($.tooltip.ajaxTimeout);
|
||||
if($.tooltip.ajaxRequest && $.tooltip.ajaxRequest.abort)
|
||||
{
|
||||
$.tooltip.ajaxRequest.abort();
|
||||
}
|
||||
$.tooltip.current = null;
|
||||
function complete() {
|
||||
helper.parent.removeClass( tsettings.extraClass ).hide().css("opacity", "");
|
||||
var el =helper.parent.find('object').parent();
|
||||
el.empty();
|
||||
el.remove();
|
||||
}
|
||||
if ((!IE || !$.fn.bgiframe) && tsettings.fade) {
|
||||
if (helper.parent.is(':animated'))
|
||||
|
Reference in New Issue
Block a user