1&&this.options.showImageNumberLabel?this.$lightbox.find(".lb-number").text(this.options.albumLabel(this.currentImageIndex+1,this.album.length)).fadeIn("fast"):this.$lightbox.find(".lb-number").hide(),this.$outerContainer.removeClass("animating"),this.$lightbox.find(".lb-dataContainer").fadeIn(this.options.resizeDuration,function(){return b.sizeOverlay()})},b.prototype.preloadNeighboringImages=function(){if(this.album.length>this.currentImageIndex+1){var a=new Image;a.src=this.album[this.currentImageIndex+1].link}if(this.currentImageIndex>0){var b=new Image;b.src=this.album[this.currentImageIndex-1].link}},b.prototype.enableKeyboardNav=function(){a(document).on("keyup.keyboard",a.proxy(this.keyboardAction,this))},b.prototype.disableKeyboardNav=function(){a(document).off(".keyboard")},b.prototype.keyboardAction=function(a){var b=27,c=37,d=39,e=a.keyCode,f=String.fromCharCode(e).toLowerCase();e===b||f.match(/x|o|c/)?this.end():"p"===f||e===c?0!==this.currentImageIndex?this.changeImage(this.currentImageIndex-1):this.options.wrapAround&&this.album.length>1&&this.changeImage(this.album.length-1):("n"===f||e===d)&&(this.currentImageIndex!==this.album.length-1?this.changeImage(this.currentImageIndex+1):this.options.wrapAround&&this.album.length>1&&this.changeImage(0))},b.prototype.end=function(){this.disableKeyboardNav(),a(window).off("resize",this.sizeOverlay),this.$lightbox.fadeOut(this.options.fadeDuration),this.$overlay.fadeOut(this.options.fadeDuration),a("select, object, embed").css({visibility:"visible"})},b}();a(function(){{var a=new b;new c(a)}})}).call(this);
/* pasteimage - ? - https://github.com/vladmalik/pasteimage - Licensed under GPLv3 */
(function($) {
$.pasteimage = function(callback) {
var allowPaste = true;
var foundImage = false;
if(typeof(callback) == "function")
{
// Patch jQuery to add clipboardData property support in the event object
$.event.props.push('clipboardData');
// Add the paste event listener
$(document).on("paste", doPaste);
// If Firefox (doesn't support clipboard object), create DIV to catch pasted image
if (!window.Clipboard) { // Firefox
var pasteCatcher = $("", {contenteditable:"true", id:'pastecatcher'});
pasteCatcher.css({"position" : "absolute", "left" : "-999", width : "0", height : "0", "overflow" : "hidden", outline : 0});
$('body').prepend(pasteCatcher);
}
}
// Handle paste event
function doPaste(e)
{
if(allowPaste == true)
{ // conditionally set allowPaste to false in situations where you want to do regular paste instead
// Check for event.clipboardData support
if(e.clipboardData.items) // Chrome
{
// Get the items from the clipboard
var items = e.clipboardData.items;
if(items)
{
// Search clipboard items for an image
for (var i = 0; i < items.length; i++) { // removed: i < items.length, items[i].type.indexOf("image") !== -1
if (items[i].type.indexOf("image") !== -1) {
//foundImage = true; Not sure why this was here
// Convert image to blob using File API
var blob = items[i].getAsFile();
var reader = new FileReader();
reader.onload = function(event){
callback(event.target.result); //event.target.results contains the base64 code to create the image
};
/* Convert the blob from clipboard to base64 */
reader.readAsDataURL(blob);
//foundImage = false; Not sure why this was here
}
}
} else databap.feedback('error', 'Aucune image trouvée dans le presse-papier. Navigateur non supporté ?');
}
else
{
/* If we can't handle clipboard data directly (Firefox), we need to read what was pasted from the contenteditable element */
//Since paste event detected, focus on DIV to receive pasted image
pasteCatcher.get(0).focus();
foundImage = true;
// "This is a cheap trick to make sure we read the data AFTER it has been inserted"
setTimeout(checkInput, 150); // May need to be longer if large image
}
}
}
/* Parse the input in the paste catcher element */
function checkInput()
{
// Store the pasted content in a variable
if(foundImage == true)
{
var child = pasteCatcher.children().last().get(0);
if(child)
{
// If the user pastes an image, the src attribute will represent the image as a base64 encoded string.
if (child.tagName === "IMG" && child.src.substr(0, 5) == 'data:')
{
callback(child.src);
foundImage = false;
}
else databap.feedback('error', 'Ceci n\'est pas une image');
//pasteCatcher.html(""); // erase contents of pasteCatcher DIV
}
else databap.feedback('warning', 'Déselectionner la barre de message avant de copier l\'image');
}
else databap.feedback('error', 'Aucune image trouvée dans le presse-papier');
}
}
})(jQuery);
/* Tinyscrollbar - v2.1.7 - http://www.baijs.com/tinyscrollbar - Licensed under the MIT license */
//!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?a(require("jquery")):a(jQuery)}(function(a){"use strict";function b(b,e){function f(){return m.update(),h(),m}function g(){r.css(x,m.contentPosition/m.trackRatio),o.css(x,-m.contentPosition),p.css(w,m.trackSize),q.css(w,m.trackSize),r.css(w,m.thumbSize)}function h(){u?n[0].ontouchstart=function(a){1===a.touches.length&&(a.stopPropagation(),i(a.touches[0]))}:(r.bind("mousedown",i),q.bind("mousedown",k)),a(window).resize(function(){m.update("relative")}),m.options.wheel&&window.addEventListener?b[0].addEventListener(v,j,!1):m.options.wheel&&(b[0].onmousewheel=j)}function i(b){a("body").addClass("noSelect"),s=t?b.pageX:b.pageY,m.thumbPosition=parseInt(r.css(x),10)||0,u?(document.ontouchmove=function(a){a.preventDefault(),k(a.touches[0])},document.ontouchend=l):(a(document).bind("mousemove",k),a(document).bind("mouseup",l),r.bind("mouseup",l))}function j(c){if(m.contentRatio<1){var d=c||window.event,e="delta"+m.options.axis.toUpperCase(),f=-(d[e]||d.detail||-1/3*d.wheelDelta)/40;m.contentPosition-=f*m.options.wheelSpeed,m.contentPosition=Math.min(m.contentSize-m.viewportSize,Math.max(0,m.contentPosition)),b.trigger("move"),r.css(x,m.contentPosition/m.trackRatio),o.css(x,-m.contentPosition),(m.options.wheelLock||m.contentPosition!==m.contentSize-m.viewportSize&&0!==m.contentPosition)&&(d=a.event.fix(d),d.preventDefault())}}function k(a){if(m.contentRatio<1){var c=t?a.pageX:a.pageY,d=c-s;m.options.scrollInvert&&u&&(d=s-c);var e=Math.min(m.trackSize-m.thumbSize,Math.max(0,m.thumbPosition+d));m.contentPosition=e*m.trackRatio,b.trigger("move"),r.css(x,e),o.css(x,-m.contentPosition)}}function l(){a("body").removeClass("noSelect"),a(document).unbind("mousemove",k),a(document).unbind("mouseup",l),r.unbind("mouseup",l),document.ontouchmove=document.ontouchend=null}this.options=a.extend({},d,e),this._defaults=d,this._name=c;var m=this,n=b.find(".viewport"),o=b.find(".overview"),p=b.find(".scrollbar"),q=p.find(".track"),r=p.find(".thumb"),s=0,t="x"===this.options.axis,u="ontouchstart"in document.documentElement,v="onwheel"in document||document.documentMode>=9?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll",w=t?"width":"height",x=t?"left":"top";return this.contentPosition=0,this.viewportSize=0,this.contentSize=0,this.contentRatio=0,this.trackSize=0,this.trackRatio=0,this.thumbSize=0,this.thumbPosition=0,this.update=function(a){var b=w.charAt(0).toUpperCase()+w.slice(1).toLowerCase();switch(this.viewportSize=n[0]["offset"+b],this.contentSize=o[0]["scroll"+b],this.contentRatio=this.viewportSize/this.contentSize,this.trackSize=this.options.trackSize||this.viewportSize,this.thumbSize=Math.min(this.trackSize,Math.max(0,this.options.thumbSize||this.trackSize*this.contentRatio)),this.trackRatio=this.options.thumbSize?(this.contentSize-this.viewportSize)/(this.trackSize-this.thumbSize):this.contentSize/this.trackSize,p.toggleClass("disable",this.contentRatio>=1),a){case"bottom":this.contentPosition=this.contentSize-this.viewportSize;break;case"relative":this.contentPosition=Math.min(Math.max(this.contentSize-this.viewportSize,0),Math.max(0,this.contentPosition));break;default:this.contentPosition=parseInt(a,10)||0}return g(),m},f()}var c="tinyscrollbar",d={axis:"y",wheel:!0,wheelSpeed:40,wheelLock:!0,scrollInvert:!1,trackSize:!1,thumbSize:!1};a.fn[c]=function(d){return this.each(function(){a.data(this,"plugin_"+c)||a.data(this,"plugin_"+c,new b(a(this),d))})}});
(
function($)
{
$.tiny = $.tiny||{};
$.tiny.scrollbar = {options:{axis:'y',wheel:40,scroll:true,size:'auto',sizethumb:'auto'}};
$.fn.tinyscrollbar=function(options){var options=$.extend({},$.tiny.scrollbar.options,options);this.each(function(){$(this).data('tsb',new Scrollbar($(this),options));});return this;};
$.fn.tinyscrollbar_update=function(sScroll){return $(this).data('tsb').update(sScroll);};
/* Adding getPos function - Start */
$.fn.tinyscrollbar_isBottom=function(){return $(this).data('tsb').isBottom();};
/* Adding getPos function - End */
function Scrollbar(root,options)
{
var oSelf=this;
var oWrapper=root;
var oViewport={obj:$(options.viewport,root)};
var oContent={obj:$(options.overview,root)};
var oScrollbar={obj:$('.scrollbar',root)};
var oTrack={obj:$('.track',oScrollbar.obj)};
var oThumb={obj:$('.thumb',oScrollbar.obj)};
var sAxis=options.axis=='x',sDirection=sAxis?'left':'top',sSize=sAxis?'Width':'Height';
var iScroll,iPosition={start:0,now:0},iMouse={};
function initialize()
{
oSelf.update();
setEvents();
return oSelf;
}
this.update=function(sScroll)
{
oViewport[options.axis]=oViewport.obj[0]['offset'+sSize];
oContent[options.axis] = oContent.obj[0]['scroll'+sSize];
/* Adding border - Start */
oContent[options.axis] += oViewport.obj.outerHeight() - oViewport.obj.innerHeight();
/* Adding border - End */
oContent.ratio=oViewport[options.axis]/oContent[options.axis];
oScrollbar.obj.toggleClass('disable',oContent.ratio>=1);
oTrack[options.axis]=options.size=='auto'?oViewport[options.axis]:options.size;
oThumb[options.axis]=Math.min(oTrack[options.axis],Math.max(0,(options.sizethumb=='auto'?(oTrack[options.axis]*oContent.ratio):options.sizethumb)));
oScrollbar.ratio=options.sizethumb=='auto'?(oContent[options.axis]/oTrack[options.axis]):(oContent[options.axis]-oViewport[options.axis])/(oTrack[options.axis]-oThumb[options.axis]);
iScroll=(sScroll=='relative'&&oContent.ratio<=1)?Math.min((oContent[options.axis]-oViewport[options.axis]),Math.max(0,iScroll)):0;
iScroll=(sScroll=='bottom'&&oContent.ratio<=1)?(oContent[options.axis]-oViewport[options.axis]):isNaN(parseInt(sScroll))?iScroll:parseInt(sScroll);
setSize();
};
/* Adding isBottom function - Start */
this.isBottom=function()
{
return (oContent.ratio > 1 || iScroll == (oContent[options.axis] - oViewport[options.axis]));
};
/* Adding isBottom function - End */
function setSize()
{
oThumb.obj.css(sDirection,iScroll/oScrollbar.ratio);
oContent.obj.css(sDirection,-iScroll);
iMouse['start']=oThumb.obj.offset()[sDirection];
var sCssSize=sSize.toLowerCase();
oScrollbar.obj.css(sCssSize,oTrack[options.axis]);
oTrack.obj.css(sCssSize,oTrack[options.axis]);
oThumb.obj.css(sCssSize,oThumb[options.axis]);
};
function setEvents()
{
oThumb.obj.bind('mousedown',start);
//[+]oViewport.obj.bind('mousedown',start);
oThumb.obj[0].ontouchstart=function(oEvent)
{
oEvent.preventDefault();
oThumb.obj.unbind('mousedown');
start(oEvent.touches[0]);
return false;
};
oTrack.obj.bind('mouseup',drag);
if(options.scroll&&this.addEventListener)
{
oWrapper[0].addEventListener('DOMMouseScroll',wheel,false);
oWrapper[0].addEventListener('mousewheel',wheel,false);
}
else if(options.scroll){oWrapper[0].onmousewheel=wheel;}
};
function start(oEvent)
{
iMouse.start=sAxis?oEvent.pageX:oEvent.pageY;
var oThumbDir=parseInt(oThumb.obj.css(sDirection));
iPosition.start=oThumbDir=='auto'?0:oThumbDir;
$(document).bind('mousemove',drag);
document.ontouchmove=function(oEvent)
{
$(document).unbind('mousemove');
drag(oEvent.touches[0]);
};
$(document).bind('mouseup',end);
oThumb.obj.bind('mouseup',end);
oThumb.obj[0].ontouchend=document.ontouchend=function(oEvent)
{
$(document).unbind('mouseup');
oThumb.obj.unbind('mouseup');
end(oEvent.touches[0]);
};
return false;
};
function wheel(oEvent)
{
if(!(oContent.ratio>=1))
{
//[-]oEvent=$.event.fix(oEvent||window.event);
var iDelta=oEvent.wheelDelta?oEvent.wheelDelta/120:-oEvent.detail/3;
iScroll-=iDelta*options.wheel;
iScroll=Math.min((oContent[options.axis]-oViewport[options.axis]),Math.max(0,iScroll));
oThumb.obj.css(sDirection,iScroll/oScrollbar.ratio);oContent.obj.css(sDirection,-iScroll);
oEvent.preventDefault();
};
};
function end(oEvent)
{
$(document).unbind('mousemove',drag);
$(document).unbind('mouseup',end);
oThumb.obj.unbind('mouseup',end);
document.ontouchmove=oThumb.obj[0].ontouchend=document.ontouchend=null;
return false;
};
function drag(oEvent)
{
if(!(oContent.ratio>=1))
{
iPosition.now=Math.min((oTrack[options.axis]-oThumb[options.axis]),Math.max(0,(iPosition.start+((sAxis?oEvent.pageX:oEvent.pageY)-iMouse.start))));
iScroll=iPosition.now*oScrollbar.ratio;oContent.obj.css(sDirection,-iScroll);
oThumb.obj.css(sDirection,iPosition.now);;
}
return false;
};
return initialize();
};
}
)
(jQuery);