init
This commit is contained in:
@@ -0,0 +1,417 @@
|
||||
/*
|
||||
* Project: Bootstrap Notify = v3.1.5
|
||||
* Description: Turns standard Bootstrap alerts into "Growl-like" notifications.
|
||||
* Author: Mouse0270 aka Robert McIntosh
|
||||
* License: MIT License
|
||||
* Website: https://github.com/mouse0270/bootstrap-growl
|
||||
*/
|
||||
|
||||
/* global define:false, require: false, jQuery:false */
|
||||
|
||||
(function (factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['jquery'], factory);
|
||||
} else if (typeof exports === 'object') {
|
||||
// Node/CommonJS
|
||||
factory(require('jquery'));
|
||||
} else {
|
||||
// Browser globals
|
||||
factory(jQuery);
|
||||
}
|
||||
}(function ($) {
|
||||
// Create the defaults once
|
||||
var defaults = {
|
||||
element: 'body',
|
||||
position: null,
|
||||
type: "info",
|
||||
allow_dismiss: true,
|
||||
allow_duplicates: true,
|
||||
newest_on_top: false,
|
||||
showProgressbar: false,
|
||||
placement: {
|
||||
from: "top",
|
||||
align: "right"
|
||||
},
|
||||
offset: 20,
|
||||
spacing: 10,
|
||||
z_index: 1031,
|
||||
delay: 5000,
|
||||
timer: 1000,
|
||||
url_target: '_blank',
|
||||
mouse_over: null,
|
||||
animate: {
|
||||
enter: 'animated fadeInDown',
|
||||
exit: 'animated fadeOutUp'
|
||||
},
|
||||
onShow: null,
|
||||
onShown: null,
|
||||
onClose: null,
|
||||
onClosed: null,
|
||||
onClick: null,
|
||||
icon_type: 'class',
|
||||
template: '<div data-notify="container" class="col-xs-11 col-sm-4 alert alert-{0}" role="alert"><button type="button" aria-hidden="true" class="close" data-notify="dismiss">×</button><span data-notify="icon"></span> <span data-notify="title">{1}</span> <span data-notify="message">{2}</span><div class="progress" data-notify="progressbar"><div class="progress-bar progress-bar-{0}" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%;"></div></div><a href="{3}" target="{4}" data-notify="url"></a></div>'
|
||||
};
|
||||
|
||||
String.format = function () {
|
||||
var args = arguments;
|
||||
var str = arguments[0];
|
||||
return str.replace(/(\{\{\d\}\}|\{\d\})/g, function (str) {
|
||||
if (str.substring(0, 2) === "{{") return str;
|
||||
var num = parseInt(str.match(/\d/)[0]);
|
||||
return args[num + 1];
|
||||
});
|
||||
};
|
||||
|
||||
function isDuplicateNotification(notification) {
|
||||
var isDupe = false;
|
||||
|
||||
$('[data-notify="container"]').each(function (i, el) {
|
||||
var $el = $(el);
|
||||
var title = $el.find('[data-notify="title"]').html().trim();
|
||||
var message = $el.find('[data-notify="message"]').html().trim();
|
||||
|
||||
// The input string might be different than the actual parsed HTML string!
|
||||
// (<br> vs <br /> for example)
|
||||
// So we have to force-parse this as HTML here!
|
||||
var isSameTitle = title === $("<div>" + notification.settings.content.title + "</div>").html().trim();
|
||||
var isSameMsg = message === $("<div>" + notification.settings.content.message + "</div>").html().trim();
|
||||
var isSameType = $el.hasClass('alert-' + notification.settings.type);
|
||||
|
||||
if (isSameTitle && isSameMsg && isSameType) {
|
||||
//we found the dupe. Set the var and stop checking.
|
||||
isDupe = true;
|
||||
}
|
||||
return !isDupe;
|
||||
});
|
||||
|
||||
return isDupe;
|
||||
}
|
||||
|
||||
function Notify(element, content, options) {
|
||||
// Setup Content of Notify
|
||||
var contentObj = {
|
||||
content: {
|
||||
message: typeof content === 'object' ? content.message : content,
|
||||
title: content.title ? content.title : '',
|
||||
icon: content.icon ? content.icon : '',
|
||||
url: content.url ? content.url : '#',
|
||||
target: content.target ? content.target : '-'
|
||||
}
|
||||
};
|
||||
|
||||
options = $.extend(true, {}, contentObj, options);
|
||||
this.settings = $.extend(true, {}, defaults, options);
|
||||
this._defaults = defaults;
|
||||
if (this.settings.content.target === "-") {
|
||||
this.settings.content.target = this.settings.url_target;
|
||||
}
|
||||
this.animations = {
|
||||
start: 'webkitAnimationStart oanimationstart MSAnimationStart animationstart',
|
||||
end: 'webkitAnimationEnd oanimationend MSAnimationEnd animationend'
|
||||
};
|
||||
|
||||
if (typeof this.settings.offset === 'number') {
|
||||
this.settings.offset = {
|
||||
x: this.settings.offset,
|
||||
y: this.settings.offset
|
||||
};
|
||||
}
|
||||
|
||||
//if duplicate messages are not allowed, then only continue if this new message is not a duplicate of one that it already showing
|
||||
if (this.settings.allow_duplicates || (!this.settings.allow_duplicates && !isDuplicateNotification(this))) {
|
||||
this.init();
|
||||
}
|
||||
}
|
||||
|
||||
$.extend(Notify.prototype, {
|
||||
init: function () {
|
||||
var self = this;
|
||||
|
||||
this.buildNotify();
|
||||
if (this.settings.content.icon) {
|
||||
this.setIcon();
|
||||
}
|
||||
if (this.settings.content.url != "#") {
|
||||
this.styleURL();
|
||||
}
|
||||
this.styleDismiss();
|
||||
this.placement();
|
||||
this.bind();
|
||||
|
||||
this.notify = {
|
||||
$ele: this.$ele,
|
||||
update: function (command, update) {
|
||||
var commands = {};
|
||||
if (typeof command === "string") {
|
||||
commands[command] = update;
|
||||
} else {
|
||||
commands = command;
|
||||
}
|
||||
for (var cmd in commands) {
|
||||
switch (cmd) {
|
||||
case "type":
|
||||
this.$ele.removeClass('alert-' + self.settings.type);
|
||||
this.$ele.find('[data-notify="progressbar"] > .progress-bar').removeClass('progress-bar-' + self.settings.type);
|
||||
self.settings.type = commands[cmd];
|
||||
this.$ele.addClass('alert-' + commands[cmd]).find('[data-notify="progressbar"] > .progress-bar').addClass('progress-bar-' + commands[cmd]);
|
||||
break;
|
||||
case "icon":
|
||||
var $icon = this.$ele.find('[data-notify="icon"]');
|
||||
if (self.settings.icon_type.toLowerCase() === 'class') {
|
||||
$icon.removeClass(self.settings.content.icon).addClass(commands[cmd]);
|
||||
} else {
|
||||
if (!$icon.is('img')) {
|
||||
$icon.find('img');
|
||||
}
|
||||
$icon.attr('src', commands[cmd]);
|
||||
}
|
||||
self.settings.content.icon = commands[command];
|
||||
break;
|
||||
case "progress":
|
||||
var newDelay = self.settings.delay - (self.settings.delay * (commands[cmd] / 100));
|
||||
this.$ele.data('notify-delay', newDelay);
|
||||
this.$ele.find('[data-notify="progressbar"] > div').attr('aria-valuenow', commands[cmd]).css('width', commands[cmd] + '%');
|
||||
break;
|
||||
case "url":
|
||||
this.$ele.find('[data-notify="url"]').attr('href', commands[cmd]);
|
||||
break;
|
||||
case "target":
|
||||
this.$ele.find('[data-notify="url"]').attr('target', commands[cmd]);
|
||||
break;
|
||||
default:
|
||||
this.$ele.find('[data-notify="' + cmd + '"]').html(commands[cmd]);
|
||||
}
|
||||
}
|
||||
var posX = this.$ele.outerHeight() + parseInt(self.settings.spacing) + parseInt(self.settings.offset.y);
|
||||
self.reposition(posX);
|
||||
},
|
||||
close: function () {
|
||||
self.close();
|
||||
}
|
||||
};
|
||||
|
||||
},
|
||||
buildNotify: function () {
|
||||
var content = this.settings.content;
|
||||
this.$ele = $(String.format(this.settings.template, this.settings.type, content.title, content.message, content.url, content.target));
|
||||
this.$ele.attr('data-notify-position', this.settings.placement.from + '-' + this.settings.placement.align);
|
||||
if (!this.settings.allow_dismiss) {
|
||||
this.$ele.find('[data-notify="dismiss"]').css('display', 'none');
|
||||
}
|
||||
if ((this.settings.delay <= 0 && !this.settings.showProgressbar) || !this.settings.showProgressbar) {
|
||||
this.$ele.find('[data-notify="progressbar"]').remove();
|
||||
}
|
||||
},
|
||||
setIcon: function () {
|
||||
if (this.settings.icon_type.toLowerCase() === 'class') {
|
||||
this.$ele.find('[data-notify="icon"]').addClass(this.settings.content.icon);
|
||||
} else {
|
||||
if (this.$ele.find('[data-notify="icon"]').is('img')) {
|
||||
this.$ele.find('[data-notify="icon"]').attr('src', this.settings.content.icon);
|
||||
} else {
|
||||
this.$ele.find('[data-notify="icon"]').append('<img src="' + this.settings.content.icon + '" alt="Notify Icon" />');
|
||||
}
|
||||
}
|
||||
},
|
||||
styleDismiss: function () {
|
||||
this.$ele.find('[data-notify="dismiss"]').css({
|
||||
position: 'absolute',
|
||||
right: '10px',
|
||||
top: '5px',
|
||||
zIndex: this.settings.z_index + 2
|
||||
});
|
||||
},
|
||||
styleURL: function () {
|
||||
this.$ele.find('[data-notify="url"]').css({
|
||||
backgroundImage: 'url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)',
|
||||
height: '100%',
|
||||
left: 0,
|
||||
position: 'absolute',
|
||||
top: 0,
|
||||
width: '100%',
|
||||
zIndex: this.settings.z_index + 1
|
||||
});
|
||||
},
|
||||
placement: function () {
|
||||
var self = this,
|
||||
offsetAmt = this.settings.offset.y,
|
||||
css = {
|
||||
display: 'inline-block',
|
||||
margin: '0px auto',
|
||||
position: this.settings.position ? this.settings.position : (this.settings.element === 'body' ? 'fixed' : 'absolute'),
|
||||
transition: 'all .5s ease-in-out',
|
||||
zIndex: this.settings.z_index
|
||||
},
|
||||
hasAnimation = false,
|
||||
settings = this.settings;
|
||||
|
||||
$('[data-notify-position="' + this.settings.placement.from + '-' + this.settings.placement.align + '"]:not([data-closing="true"])').each(function () {
|
||||
offsetAmt = Math.max(offsetAmt, parseInt($(this).css(settings.placement.from)) + parseInt($(this).outerHeight()) + parseInt(settings.spacing));
|
||||
});
|
||||
if (this.settings.newest_on_top === true) {
|
||||
offsetAmt = this.settings.offset.y;
|
||||
}
|
||||
css[this.settings.placement.from] = offsetAmt + 'px';
|
||||
|
||||
switch (this.settings.placement.align) {
|
||||
case "left":
|
||||
case "right":
|
||||
css[this.settings.placement.align] = this.settings.offset.x + 'px';
|
||||
break;
|
||||
case "center":
|
||||
css.left = 0;
|
||||
css.right = 0;
|
||||
break;
|
||||
}
|
||||
this.$ele.css(css).addClass(this.settings.animate.enter);
|
||||
$.each(Array('webkit-', 'moz-', 'o-', 'ms-', ''), function (index, prefix) {
|
||||
self.$ele[0].style[prefix + 'AnimationIterationCount'] = 1;
|
||||
});
|
||||
|
||||
$(this.settings.element).append(this.$ele);
|
||||
|
||||
if (this.settings.newest_on_top === true) {
|
||||
offsetAmt = (parseInt(offsetAmt) + parseInt(this.settings.spacing)) + this.$ele.outerHeight();
|
||||
this.reposition(offsetAmt);
|
||||
}
|
||||
|
||||
if ($.isFunction(self.settings.onShow)) {
|
||||
self.settings.onShow.call(this.$ele);
|
||||
}
|
||||
|
||||
this.$ele.one(this.animations.start, function () {
|
||||
hasAnimation = true;
|
||||
}).one(this.animations.end, function () {
|
||||
self.$ele.removeClass(self.settings.animate.enter);
|
||||
if ($.isFunction(self.settings.onShown)) {
|
||||
self.settings.onShown.call(this);
|
||||
}
|
||||
});
|
||||
|
||||
setTimeout(function () {
|
||||
if (!hasAnimation) {
|
||||
if ($.isFunction(self.settings.onShown)) {
|
||||
self.settings.onShown.call(this);
|
||||
}
|
||||
}
|
||||
}, 600);
|
||||
},
|
||||
bind: function () {
|
||||
var self = this;
|
||||
|
||||
this.$ele.find('[data-notify="dismiss"]').on('click', function () {
|
||||
self.close();
|
||||
});
|
||||
|
||||
if ($.isFunction(self.settings.onClick)) {
|
||||
this.$ele.on('click', function (event) {
|
||||
if (event.target != self.$ele.find('[data-notify="dismiss"]')[0]) {
|
||||
self.settings.onClick.call(this, event);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.$ele.mouseover(function () {
|
||||
$(this).data('data-hover', "true");
|
||||
}).mouseout(function () {
|
||||
$(this).data('data-hover', "false");
|
||||
});
|
||||
this.$ele.data('data-hover', "false");
|
||||
|
||||
if (this.settings.delay > 0) {
|
||||
self.$ele.data('notify-delay', self.settings.delay);
|
||||
var timer = setInterval(function () {
|
||||
var delay = parseInt(self.$ele.data('notify-delay')) - self.settings.timer;
|
||||
if ((self.$ele.data('data-hover') === 'false' && self.settings.mouse_over === "pause") || self.settings.mouse_over != "pause") {
|
||||
var percent = ((self.settings.delay - delay) / self.settings.delay) * 100;
|
||||
self.$ele.data('notify-delay', delay);
|
||||
self.$ele.find('[data-notify="progressbar"] > div').attr('aria-valuenow', percent).css('width', percent + '%');
|
||||
}
|
||||
if (delay <= -(self.settings.timer)) {
|
||||
clearInterval(timer);
|
||||
self.close();
|
||||
}
|
||||
}, self.settings.timer);
|
||||
}
|
||||
},
|
||||
close: function () {
|
||||
var self = this,
|
||||
posX = parseInt(this.$ele.css(this.settings.placement.from)),
|
||||
hasAnimation = false;
|
||||
|
||||
this.$ele.attr('data-closing', 'true').addClass(this.settings.animate.exit);
|
||||
self.reposition(posX);
|
||||
|
||||
if ($.isFunction(self.settings.onClose)) {
|
||||
self.settings.onClose.call(this.$ele);
|
||||
}
|
||||
|
||||
this.$ele.one(this.animations.start, function () {
|
||||
hasAnimation = true;
|
||||
}).one(this.animations.end, function () {
|
||||
$(this).remove();
|
||||
if ($.isFunction(self.settings.onClosed)) {
|
||||
self.settings.onClosed.call(this);
|
||||
}
|
||||
});
|
||||
|
||||
setTimeout(function () {
|
||||
if (!hasAnimation) {
|
||||
self.$ele.remove();
|
||||
if (self.settings.onClosed) {
|
||||
self.settings.onClosed(self.$ele);
|
||||
}
|
||||
}
|
||||
}, 600);
|
||||
},
|
||||
reposition: function (posX) {
|
||||
var self = this,
|
||||
notifies = '[data-notify-position="' + this.settings.placement.from + '-' + this.settings.placement.align + '"]:not([data-closing="true"])',
|
||||
$elements = this.$ele.nextAll(notifies);
|
||||
if (this.settings.newest_on_top === true) {
|
||||
$elements = this.$ele.prevAll(notifies);
|
||||
}
|
||||
$elements.each(function () {
|
||||
$(this).css(self.settings.placement.from, posX);
|
||||
posX = (parseInt(posX) + parseInt(self.settings.spacing)) + $(this).outerHeight();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$.notify = function (content, options) {
|
||||
var plugin = new Notify(this, content, options);
|
||||
return plugin.notify;
|
||||
};
|
||||
$.notifyDefaults = function (options) {
|
||||
defaults = $.extend(true, {}, defaults, options);
|
||||
return defaults;
|
||||
};
|
||||
|
||||
$.notifyClose = function (selector) {
|
||||
|
||||
if (typeof selector === "undefined" || selector === "all") {
|
||||
$('[data-notify]').find('[data-notify="dismiss"]').trigger('click');
|
||||
}else if(selector === 'success' || selector === 'info' || selector === 'warning' || selector === 'danger'){
|
||||
$('.alert-' + selector + '[data-notify]').find('[data-notify="dismiss"]').trigger('click');
|
||||
} else if(selector){
|
||||
$(selector + '[data-notify]').find('[data-notify="dismiss"]').trigger('click');
|
||||
}
|
||||
else {
|
||||
$('[data-notify-position="' + selector + '"]').find('[data-notify="dismiss"]').trigger('click');
|
||||
}
|
||||
};
|
||||
|
||||
$.notifyCloseExcept = function (selector) {
|
||||
|
||||
if(selector === 'success' || selector === 'info' || selector === 'warning' || selector === 'danger'){
|
||||
$('[data-notify]').not('.alert-' + selector).find('[data-notify="dismiss"]').trigger('click');
|
||||
} else{
|
||||
$('[data-notify]').not(selector).find('[data-notify="dismiss"]').trigger('click');
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
}));
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t("object"==typeof exports?require("jquery"):jQuery)}(function(t){function s(s){var e=!1;return t('[data-notify="container"]').each(function(i,n){var a=t(n),o=a.find('[data-notify="title"]').text().trim(),r=a.find('[data-notify="message"]').html().trim(),l=o===t("<div>"+s.settings.content.title+"</div>").html().trim(),d=r===t("<div>"+s.settings.content.message+"</div>").html().trim(),g=a.hasClass("alert-"+s.settings.type);return l&&d&&g&&(e=!0),!e}),e}function e(e,n,a){var o={content:{message:"object"==typeof n?n.message:n,title:n.title?n.title:"",icon:n.icon?n.icon:"",url:n.url?n.url:"#",target:n.target?n.target:"-"}};a=t.extend(!0,{},o,a),this.settings=t.extend(!0,{},i,a),this._defaults=i,"-"===this.settings.content.target&&(this.settings.content.target=this.settings.url_target),this.animations={start:"webkitAnimationStart oanimationstart MSAnimationStart animationstart",end:"webkitAnimationEnd oanimationend MSAnimationEnd animationend"},"number"==typeof this.settings.offset&&(this.settings.offset={x:this.settings.offset,y:this.settings.offset}),(this.settings.allow_duplicates||!this.settings.allow_duplicates&&!s(this))&&this.init()}var i={element:"body",position:null,type:"info",allow_dismiss:!0,allow_duplicates:!0,newest_on_top:!1,showProgressbar:!1,placement:{from:"top",align:"right"},offset:20,spacing:10,z_index:1031,delay:5e3,timer:1e3,url_target:"_blank",mouse_over:null,animate:{enter:"animated fadeInDown",exit:"animated fadeOutUp"},onShow:null,onShown:null,onClose:null,onClosed:null,icon_type:"class",template:'<div data-notify="container" class="col-xs-11 col-sm-4 alert alert-{0}" role="alert"><button type="button" aria-hidden="true" class="close" data-notify="dismiss">×</button><span data-notify="icon"></span> <span data-notify="title">{1}</span> <span data-notify="message">{2}</span><div class="progress" data-notify="progressbar"><div class="progress-bar progress-bar-{0}" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%;"></div></div><a href="{3}" target="{4}" data-notify="url"></a></div>'};String.format=function(){for(var t=arguments[0],s=1;s<arguments.length;s++)t=t.replace(RegExp("\\{"+(s-1)+"\\}","gm"),arguments[s]);return t},t.extend(e.prototype,{init:function(){var t=this;this.buildNotify(),this.settings.content.icon&&this.setIcon(),"#"!=this.settings.content.url&&this.styleURL(),this.styleDismiss(),this.placement(),this.bind(),this.notify={$ele:this.$ele,update:function(s,e){var i={};"string"==typeof s?i[s]=e:i=s;for(var n in i)switch(n){case"type":this.$ele.removeClass("alert-"+t.settings.type),this.$ele.find('[data-notify="progressbar"] > .progress-bar').removeClass("progress-bar-"+t.settings.type),t.settings.type=i[n],this.$ele.addClass("alert-"+i[n]).find('[data-notify="progressbar"] > .progress-bar').addClass("progress-bar-"+i[n]);break;case"icon":var a=this.$ele.find('[data-notify="icon"]');"class"===t.settings.icon_type.toLowerCase()?a.removeClass(t.settings.content.icon).addClass(i[n]):(a.is("img")||a.find("img"),a.attr("src",i[n]));break;case"progress":var o=t.settings.delay-t.settings.delay*(i[n]/100);this.$ele.data("notify-delay",o),this.$ele.find('[data-notify="progressbar"] > div').attr("aria-valuenow",i[n]).css("width",i[n]+"%");break;case"url":this.$ele.find('[data-notify="url"]').attr("href",i[n]);break;case"target":this.$ele.find('[data-notify="url"]').attr("target",i[n]);break;default:this.$ele.find('[data-notify="'+n+'"]').html(i[n])}var r=this.$ele.outerHeight()+parseInt(t.settings.spacing)+parseInt(t.settings.offset.y);t.reposition(r)},close:function(){t.close()}}},buildNotify:function(){var s=this.settings.content;this.$ele=t(String.format(this.settings.template,this.settings.type,s.title,s.message,s.url,s.target)),this.$ele.attr("data-notify-position",this.settings.placement.from+"-"+this.settings.placement.align),this.settings.allow_dismiss||this.$ele.find('[data-notify="dismiss"]').css("display","none"),(this.settings.delay<=0&&!this.settings.showProgressbar||!this.settings.showProgressbar)&&this.$ele.find('[data-notify="progressbar"]').remove()},setIcon:function(){"class"===this.settings.icon_type.toLowerCase()?this.$ele.find('[data-notify="icon"]').addClass(this.settings.content.icon):this.$ele.find('[data-notify="icon"]').is("img")?this.$ele.find('[data-notify="icon"]').attr("src",this.settings.content.icon):this.$ele.find('[data-notify="icon"]').append('<img src="'+this.settings.content.icon+'" alt="Notify Icon" />')},styleDismiss:function(){this.$ele.find('[data-notify="dismiss"]').css({position:"absolute",right:"10px",top:"5px",zIndex:this.settings.z_index+2})},styleURL:function(){this.$ele.find('[data-notify="url"]').css({backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)",height:"100%",left:0,position:"absolute",top:0,width:"100%",zIndex:this.settings.z_index+1})},placement:function(){var s=this,e=this.settings.offset.y,i={display:"inline-block",margin:"0px auto",position:this.settings.position?this.settings.position:"body"===this.settings.element?"fixed":"absolute",transition:"all .5s ease-in-out",zIndex:this.settings.z_index},n=!1,a=this.settings;switch(t('[data-notify-position="'+this.settings.placement.from+"-"+this.settings.placement.align+'"]:not([data-closing="true"])').each(function(){e=Math.max(e,parseInt(t(this).css(a.placement.from))+parseInt(t(this).outerHeight())+parseInt(a.spacing))}),this.settings.newest_on_top===!0&&(e=this.settings.offset.y),i[this.settings.placement.from]=e+"px",this.settings.placement.align){case"left":case"right":i[this.settings.placement.align]=this.settings.offset.x+"px";break;case"center":i.left=0,i.right=0}this.$ele.css(i).addClass(this.settings.animate.enter),t.each(Array("webkit-","moz-","o-","ms-",""),function(t,e){s.$ele[0].style[e+"AnimationIterationCount"]=1}),t(this.settings.element).append(this.$ele),this.settings.newest_on_top===!0&&(e=parseInt(e)+parseInt(this.settings.spacing)+this.$ele.outerHeight(),this.reposition(e)),t.isFunction(s.settings.onShow)&&s.settings.onShow.call(this.$ele),this.$ele.one(this.animations.start,function(){n=!0}).one(this.animations.end,function(){s.$ele.removeClass(s.settings.animate.enter),t.isFunction(s.settings.onShown)&&s.settings.onShown.call(this)}),setTimeout(function(){n||t.isFunction(s.settings.onShown)&&s.settings.onShown.call(this)},600)},bind:function(){var s=this;if(this.$ele.find('[data-notify="dismiss"]').on("click",function(){s.close()}),this.$ele.mouseover(function(){t(this).data("data-hover","true")}).mouseout(function(){t(this).data("data-hover","false")}),this.$ele.data("data-hover","false"),this.settings.delay>0){s.$ele.data("notify-delay",s.settings.delay);var e=setInterval(function(){var t=parseInt(s.$ele.data("notify-delay"))-s.settings.timer;if("false"===s.$ele.data("data-hover")&&"pause"===s.settings.mouse_over||"pause"!=s.settings.mouse_over){var i=(s.settings.delay-t)/s.settings.delay*100;s.$ele.data("notify-delay",t),s.$ele.find('[data-notify="progressbar"] > div').attr("aria-valuenow",i).css("width",i+"%")}t<=-s.settings.timer&&(clearInterval(e),s.close())},s.settings.timer)}},close:function(){var s=this,e=parseInt(this.$ele.css(this.settings.placement.from)),i=!1;this.$ele.attr("data-closing","true").addClass(this.settings.animate.exit),s.reposition(e),t.isFunction(s.settings.onClose)&&s.settings.onClose.call(this.$ele),this.$ele.one(this.animations.start,function(){i=!0}).one(this.animations.end,function(){t(this).remove(),t.isFunction(s.settings.onClosed)&&s.settings.onClosed.call(this)}),setTimeout(function(){i||(s.$ele.remove(),s.settings.onClosed&&s.settings.onClosed(s.$ele))},600)},reposition:function(s){var e=this,i='[data-notify-position="'+this.settings.placement.from+"-"+this.settings.placement.align+'"]:not([data-closing="true"])',n=this.$ele.nextAll(i);this.settings.newest_on_top===!0&&(n=this.$ele.prevAll(i)),n.each(function(){t(this).css(e.settings.placement.from,s),s=parseInt(s)+parseInt(e.settings.spacing)+t(this).outerHeight()})}}),t.notify=function(t,s){var i=new e(this,t,s);return i.notify},t.notifyDefaults=function(s){return i=t.extend(!0,{},i,s)},t.notifyClose=function(s){"warning"===s&&(s="danger"),"undefined"==typeof s||"all"===s?t("[data-notify]").find('[data-notify="dismiss"]').trigger("click"):"success"===s||"info"===s||"warning"===s||"danger"===s?t(".alert-"+s+"[data-notify]").find('[data-notify="dismiss"]').trigger("click"):s?t(s+"[data-notify]").find('[data-notify="dismiss"]').trigger("click"):t('[data-notify-position="'+s+'"]').find('[data-notify="dismiss"]').trigger("click")},t.notifyCloseExcept=function(s){"warning"===s&&(s="danger"),"success"===s||"info"===s||"warning"===s||"danger"===s?t("[data-notify]").not(".alert-"+s).find('[data-notify="dismiss"]').trigger("click"):t("[data-notify]").not(s).find('[data-notify="dismiss"]').trigger("click")}});
|
||||
@@ -0,0 +1,359 @@
|
||||
/*
|
||||
* FancyBox - jQuery Plugin
|
||||
* Simple and fancy lightbox alternative
|
||||
*
|
||||
* Examples and documentation at: http://fancybox.net
|
||||
*
|
||||
* Copyright (c) 2008 - 2010 Janis Skarnelis
|
||||
* That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
|
||||
*
|
||||
* Version: 1.3.4 (11/11/2010)
|
||||
* Requires: jQuery v1.3+
|
||||
*
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*/
|
||||
|
||||
#fancybox-loading {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
margin-top: -20px;
|
||||
margin-left: -20px;
|
||||
cursor: pointer;
|
||||
overflow: hidden;
|
||||
z-index: 1104;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#fancybox-loading div {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 40px;
|
||||
height: 480px;
|
||||
background-image: url('fancybox.png');
|
||||
}
|
||||
|
||||
#fancybox-overlay {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
z-index: 1100;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#fancybox-tmp {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border: 0;
|
||||
overflow: auto;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#fancybox-wrap {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
padding: 20px;
|
||||
z-index: 1101;
|
||||
outline: none;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#fancybox-outer {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
#fancybox-content {
|
||||
width: 0;
|
||||
height: 0;
|
||||
padding: 0;
|
||||
outline: none;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
z-index: 1102;
|
||||
border: 0px solid #fff;
|
||||
}
|
||||
|
||||
#fancybox-hide-sel-frame {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: transparent;
|
||||
z-index: 1101;
|
||||
}
|
||||
|
||||
#fancybox-close {
|
||||
position: absolute;
|
||||
top: -15px;
|
||||
right: -15px;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
background: transparent url('fancybox.png') -40px 0px;
|
||||
cursor: pointer;
|
||||
z-index: 1103;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#fancybox-error {
|
||||
color: #444;
|
||||
font: normal 12px/20px Arial;
|
||||
padding: 14px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#fancybox-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border: none;
|
||||
outline: none;
|
||||
line-height: 0;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
#fancybox-frame {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: none;
|
||||
display: block;
|
||||
}
|
||||
|
||||
#fancybox-left, #fancybox-right {
|
||||
position: absolute;
|
||||
bottom: 0px;
|
||||
height: 100%;
|
||||
width: 35%;
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
background: transparent url('blank.gif');
|
||||
z-index: 1102;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#fancybox-left {
|
||||
left: 0px;
|
||||
}
|
||||
|
||||
#fancybox-right {
|
||||
right: 0px;
|
||||
}
|
||||
|
||||
#fancybox-left-ico, #fancybox-right-ico {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: -9999px;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
margin-top: -15px;
|
||||
cursor: pointer;
|
||||
z-index: 1102;
|
||||
display: block;
|
||||
}
|
||||
|
||||
#fancybox-left-ico {
|
||||
background-image: url('fancybox.png');
|
||||
background-position: -40px -30px;
|
||||
}
|
||||
|
||||
#fancybox-right-ico {
|
||||
background-image: url('fancybox.png');
|
||||
background-position: -40px -60px;
|
||||
}
|
||||
|
||||
#fancybox-left:hover, #fancybox-right:hover {
|
||||
visibility: visible; /* IE6 */
|
||||
}
|
||||
|
||||
#fancybox-left:hover span {
|
||||
left: 20px;
|
||||
}
|
||||
|
||||
#fancybox-right:hover span {
|
||||
left: auto;
|
||||
right: 20px;
|
||||
}
|
||||
|
||||
.fancybox-bg {
|
||||
position: absolute;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border: 0;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
z-index: 1001;
|
||||
}
|
||||
|
||||
#fancybox-bg-n {
|
||||
top: -20px;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
background-image: url('fancybox-x.png');
|
||||
}
|
||||
|
||||
#fancybox-bg-ne {
|
||||
top: -20px;
|
||||
right: -20px;
|
||||
background-image: url('fancybox.png');
|
||||
background-position: -40px -162px;
|
||||
}
|
||||
|
||||
#fancybox-bg-e {
|
||||
top: 0;
|
||||
right: -20px;
|
||||
height: 100%;
|
||||
background-image: url('fancybox-y.png');
|
||||
background-position: -20px 0px;
|
||||
}
|
||||
|
||||
#fancybox-bg-se {
|
||||
bottom: -20px;
|
||||
right: -20px;
|
||||
background-image: url('fancybox.png');
|
||||
background-position: -40px -182px;
|
||||
}
|
||||
|
||||
#fancybox-bg-s {
|
||||
bottom: -20px;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
background-image: url('fancybox-x.png');
|
||||
background-position: 0px -20px;
|
||||
}
|
||||
|
||||
#fancybox-bg-sw {
|
||||
bottom: -20px;
|
||||
left: -20px;
|
||||
background-image: url('fancybox.png');
|
||||
background-position: -40px -142px;
|
||||
}
|
||||
|
||||
#fancybox-bg-w {
|
||||
top: 0;
|
||||
left: -20px;
|
||||
height: 100%;
|
||||
background-image: url('fancybox-y.png');
|
||||
}
|
||||
|
||||
#fancybox-bg-nw {
|
||||
top: -20px;
|
||||
left: -20px;
|
||||
background-image: url('fancybox.png');
|
||||
background-position: -40px -122px;
|
||||
}
|
||||
|
||||
#fancybox-title {
|
||||
font-family: Helvetica;
|
||||
font-size: 12px;
|
||||
z-index: 1102;
|
||||
}
|
||||
|
||||
.fancybox-title-inside {
|
||||
padding-bottom: 10px;
|
||||
text-align: center;
|
||||
color: #333;
|
||||
background: #fff;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.fancybox-title-outside {
|
||||
padding-top: 10px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.fancybox-title-over {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
color: #FFF;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#fancybox-title-over {
|
||||
padding: 10px;
|
||||
background-image: url('fancy_title_over.png');
|
||||
display: block;
|
||||
}
|
||||
|
||||
.fancybox-title-float {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: -20px;
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
#fancybox-title-float-wrap {
|
||||
border: none;
|
||||
border-collapse: collapse;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
#fancybox-title-float-wrap td {
|
||||
border: none;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#fancybox-title-float-left {
|
||||
padding: 0 0 0 15px;
|
||||
background: url('fancybox.png') -40px -90px no-repeat;
|
||||
}
|
||||
|
||||
#fancybox-title-float-main {
|
||||
color: #FFF;
|
||||
line-height: 29px;
|
||||
font-weight: bold;
|
||||
padding: 0 0 3px 0;
|
||||
background: url('fancybox-x.png') 0px -40px;
|
||||
}
|
||||
|
||||
#fancybox-title-float-right {
|
||||
padding: 0 0 0 15px;
|
||||
background: url('fancybox.png') -55px -90px no-repeat;
|
||||
}
|
||||
|
||||
/* IE6 */
|
||||
|
||||
.fancybox-ie6 #fancybox-close { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_close.png', sizingMethod='scale'); }
|
||||
|
||||
.fancybox-ie6 #fancybox-left-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_left.png', sizingMethod='scale'); }
|
||||
.fancybox-ie6 #fancybox-right-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_right.png', sizingMethod='scale'); }
|
||||
|
||||
.fancybox-ie6 #fancybox-title-over { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_over.png', sizingMethod='scale'); zoom: 1; }
|
||||
.fancybox-ie6 #fancybox-title-float-left { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_left.png', sizingMethod='scale'); }
|
||||
.fancybox-ie6 #fancybox-title-float-main { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_main.png', sizingMethod='scale'); }
|
||||
.fancybox-ie6 #fancybox-title-float-right { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_right.png', sizingMethod='scale'); }
|
||||
|
||||
.fancybox-ie6 #fancybox-bg-w, .fancybox-ie6 #fancybox-bg-e, .fancybox-ie6 #fancybox-left, .fancybox-ie6 #fancybox-right, #fancybox-hide-sel-frame {
|
||||
height: expression(this.parentNode.clientHeight + "px");
|
||||
}
|
||||
|
||||
#fancybox-loading.fancybox-ie6 {
|
||||
position: absolute; margin-top: 0;
|
||||
top: expression( (-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px');
|
||||
}
|
||||
|
||||
#fancybox-loading.fancybox-ie6 div { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_loading.png', sizingMethod='scale'); }
|
||||
|
||||
/* IE6, IE7, IE8 */
|
||||
|
||||
.fancybox-ie .fancybox-bg { background: transparent !important; }
|
||||
|
||||
.fancybox-ie #fancybox-bg-n { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_n.png', sizingMethod='scale'); }
|
||||
.fancybox-ie #fancybox-bg-ne { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_ne.png', sizingMethod='scale'); }
|
||||
.fancybox-ie #fancybox-bg-e { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_e.png', sizingMethod='scale'); }
|
||||
.fancybox-ie #fancybox-bg-se { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_se.png', sizingMethod='scale'); }
|
||||
.fancybox-ie #fancybox-bg-s { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_s.png', sizingMethod='scale'); }
|
||||
.fancybox-ie #fancybox-bg-sw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_sw.png', sizingMethod='scale'); }
|
||||
.fancybox-ie #fancybox-bg-w { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_w.png', sizingMethod='scale'); }
|
||||
.fancybox-ie #fancybox-bg-nw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_nw.png', sizingMethod='scale'); }
|
||||
@@ -0,0 +1,97 @@
|
||||
#fancybox-buttons {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
z-index: 8050;
|
||||
}
|
||||
|
||||
#fancybox-buttons.top {
|
||||
top: 10px;
|
||||
}
|
||||
|
||||
#fancybox-buttons.bottom {
|
||||
bottom: 10px;
|
||||
}
|
||||
|
||||
#fancybox-buttons ul {
|
||||
display: block;
|
||||
width: 166px;
|
||||
height: 30px;
|
||||
margin: 0 auto;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
border: 1px solid #111;
|
||||
border-radius: 3px;
|
||||
-webkit-box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
|
||||
-moz-box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
|
||||
box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
|
||||
background: rgb(50,50,50);
|
||||
background: -moz-linear-gradient(top, rgb(68,68,68) 0%, rgb(52,52,52) 50%, rgb(41,41,41) 50%, rgb(51,51,51) 100%);
|
||||
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgb(68,68,68)), color-stop(50%,rgb(52,52,52)), color-stop(50%,rgb(41,41,41)), color-stop(100%,rgb(51,51,51)));
|
||||
background: -webkit-linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%);
|
||||
background: -o-linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%);
|
||||
background: -ms-linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%);
|
||||
background: linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#444444', endColorstr='#222222',GradientType=0 );
|
||||
}
|
||||
|
||||
#fancybox-buttons ul li {
|
||||
float: left;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#fancybox-buttons a {
|
||||
display: block;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
text-indent: -9999px;
|
||||
background-color: transparent;
|
||||
background-image: url('fancybox_buttons.png');
|
||||
background-repeat: no-repeat;
|
||||
outline: none;
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
#fancybox-buttons a:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
#fancybox-buttons a.btnPrev {
|
||||
background-position: 5px 0;
|
||||
}
|
||||
|
||||
#fancybox-buttons a.btnNext {
|
||||
background-position: -33px 0;
|
||||
border-right: 1px solid #3e3e3e;
|
||||
}
|
||||
|
||||
#fancybox-buttons a.btnPlay {
|
||||
background-position: 0 -30px;
|
||||
}
|
||||
|
||||
#fancybox-buttons a.btnPlayOn {
|
||||
background-position: -30px -30px;
|
||||
}
|
||||
|
||||
#fancybox-buttons a.btnToggle {
|
||||
background-position: 3px -60px;
|
||||
border-left: 1px solid #111;
|
||||
border-right: 1px solid #3e3e3e;
|
||||
width: 35px
|
||||
}
|
||||
|
||||
#fancybox-buttons a.btnToggleOn {
|
||||
background-position: -27px -60px;
|
||||
}
|
||||
|
||||
#fancybox-buttons a.btnClose {
|
||||
border-left: 1px solid #111;
|
||||
width: 35px;
|
||||
background-position: -56px 0px;
|
||||
}
|
||||
|
||||
#fancybox-buttons a.btnDisabled {
|
||||
opacity : 0.4;
|
||||
cursor: default;
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
#fancybox-thumbs {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
z-index: 8050;
|
||||
}
|
||||
|
||||
#fancybox-thumbs.bottom {
|
||||
bottom: 2px;
|
||||
}
|
||||
|
||||
#fancybox-thumbs.top {
|
||||
top: 2px;
|
||||
}
|
||||
|
||||
#fancybox-thumbs ul {
|
||||
position: relative;
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#fancybox-thumbs ul li {
|
||||
float: left;
|
||||
padding: 1px;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
#fancybox-thumbs ul li.active {
|
||||
opacity: 0.75;
|
||||
padding: 0;
|
||||
border: 1px solid #fff;
|
||||
}
|
||||
|
||||
#fancybox-thumbs ul li:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
#fancybox-thumbs ul li a {
|
||||
display: block;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
border: 1px solid #222;
|
||||
background: #111;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
#fancybox-thumbs ul li img {
|
||||
display: block;
|
||||
position: relative;
|
||||
border: 0;
|
||||
padding: 0;
|
||||
max-width: none;
|
||||
}
|
||||
@@ -0,0 +1,274 @@
|
||||
/*! fancyBox v2.1.5 fancyapps.com | fancyapps.com/fancybox/#license */
|
||||
.fancybox-wrap,
|
||||
.fancybox-skin,
|
||||
.fancybox-outer,
|
||||
.fancybox-inner,
|
||||
.fancybox-image,
|
||||
.fancybox-wrap iframe,
|
||||
.fancybox-wrap object,
|
||||
.fancybox-nav,
|
||||
.fancybox-nav span,
|
||||
.fancybox-tmp
|
||||
{
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border: 0;
|
||||
outline: none;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.fancybox-wrap {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 8020;
|
||||
}
|
||||
|
||||
.fancybox-skin {
|
||||
position: relative;
|
||||
background: #f9f9f9;
|
||||
color: #444;
|
||||
text-shadow: none;
|
||||
-webkit-border-radius: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.fancybox-opened {
|
||||
z-index: 8030;
|
||||
}
|
||||
|
||||
.fancybox-opened .fancybox-skin {
|
||||
-webkit-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
|
||||
-moz-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
|
||||
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
.fancybox-outer, .fancybox-inner {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.fancybox-inner {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.fancybox-type-iframe .fancybox-inner {
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
.fancybox-error {
|
||||
color: #444;
|
||||
font: 14px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;
|
||||
margin: 0;
|
||||
padding: 15px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.fancybox-image, .fancybox-iframe {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.fancybox-image {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
}
|
||||
|
||||
#fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span {
|
||||
background-image: url('../images/fancybox_sprite.png');
|
||||
}
|
||||
|
||||
#fancybox-loading {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
margin-top: -22px;
|
||||
margin-left: -22px;
|
||||
background-position: 0 -108px;
|
||||
opacity: 0.8;
|
||||
cursor: pointer;
|
||||
z-index: 8060;
|
||||
}
|
||||
|
||||
#fancybox-loading div {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
background: url('../images/fancybox_loading.gif') center center no-repeat;
|
||||
}
|
||||
|
||||
.fancybox-close {
|
||||
position: absolute;
|
||||
top: -18px;
|
||||
right: -18px;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
cursor: pointer;
|
||||
z-index: 8040;
|
||||
}
|
||||
|
||||
.fancybox-nav {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
width: 40%;
|
||||
height: 100%;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
background: transparent url('../images/blank.gif'); /* helps IE */
|
||||
-webkit-tap-highlight-color: rgba(0,0,0,0);
|
||||
z-index: 8040;
|
||||
}
|
||||
|
||||
.fancybox-prev {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.fancybox-next {
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.fancybox-nav span {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
width: 36px;
|
||||
height: 34px;
|
||||
margin-top: -18px;
|
||||
cursor: pointer;
|
||||
z-index: 8040;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.fancybox-prev span {
|
||||
left: 10px;
|
||||
background-position: 0 -36px;
|
||||
}
|
||||
|
||||
.fancybox-next span {
|
||||
right: 10px;
|
||||
background-position: 0 -72px;
|
||||
}
|
||||
|
||||
.fancybox-nav:hover span {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
.fancybox-tmp {
|
||||
position: absolute;
|
||||
top: -99999px;
|
||||
left: -99999px;
|
||||
visibility: hidden;
|
||||
max-width: 99999px;
|
||||
max-height: 99999px;
|
||||
overflow: visible !important;
|
||||
}
|
||||
|
||||
/* Overlay helper */
|
||||
|
||||
.fancybox-lock {
|
||||
overflow: hidden !important;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.fancybox-lock body {
|
||||
overflow: hidden !important;
|
||||
}
|
||||
|
||||
.fancybox-lock-test {
|
||||
overflow-y: hidden !important;
|
||||
}
|
||||
|
||||
.fancybox-overlay {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
overflow: hidden;
|
||||
display: none;
|
||||
z-index: 8010;
|
||||
background: url('../images/fancybox_overlay.png');
|
||||
}
|
||||
|
||||
.fancybox-overlay-fixed {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.fancybox-lock .fancybox-overlay {
|
||||
overflow: auto;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
/* Title helper */
|
||||
|
||||
.fancybox-title {
|
||||
visibility: hidden;
|
||||
font: normal 13px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;
|
||||
position: relative;
|
||||
text-shadow: none;
|
||||
z-index: 8050;
|
||||
}
|
||||
|
||||
.fancybox-opened .fancybox-title {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
.fancybox-title-float-wrap {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 50%;
|
||||
margin-bottom: -35px;
|
||||
z-index: 8050;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.fancybox-title-float-wrap .child {
|
||||
display: inline-block;
|
||||
margin-right: -100%;
|
||||
padding: 2px 20px;
|
||||
background: transparent; /* Fallback for web browsers that doesn't support RGBa */
|
||||
background: rgba(0, 0, 0, 0.8);
|
||||
-webkit-border-radius: 15px;
|
||||
-moz-border-radius: 15px;
|
||||
border-radius: 15px;
|
||||
text-shadow: 0 1px 2px #222;
|
||||
color: #FFF;
|
||||
font-weight: bold;
|
||||
line-height: 24px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.fancybox-title-outside-wrap {
|
||||
position: relative;
|
||||
margin-top: 10px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.fancybox-title-inside-wrap {
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
.fancybox-title-over-wrap {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
color: #fff;
|
||||
padding: 10px;
|
||||
background: #000;
|
||||
background: rgba(0, 0, 0, .8);
|
||||
}
|
||||
|
||||
/*Retina graphics!*/
|
||||
@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
|
||||
only screen and (min--moz-device-pixel-ratio: 1.5),
|
||||
only screen and (min-device-pixel-ratio: 1.5){
|
||||
|
||||
#fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span {
|
||||
background-image: url('../images/fancybox_sprite_2x.png');
|
||||
background-size: 44px 152px; /*The size of the normal image, half the size of the hi-res image*/
|
||||
}
|
||||
|
||||
#fancybox-loading div {
|
||||
background-image: url('../images/fancybox_loading_2x.gif');
|
||||
background-size: 24px 24px; /*The size of the normal image, half the size of the hi-res image*/
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 6.4 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1003 B |
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 6.4 KiB |
@@ -0,0 +1,1156 @@
|
||||
/*
|
||||
* FancyBox - jQuery Plugin
|
||||
* Simple and fancy lightbox alternative
|
||||
*
|
||||
* Examples and documentation at: http://fancybox.net
|
||||
*
|
||||
* Copyright (c) 2008 - 2010 Janis Skarnelis
|
||||
* That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
|
||||
*
|
||||
* Version: 1.3.4 (11/11/2010)
|
||||
* Requires: jQuery v1.3+
|
||||
*
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*/
|
||||
|
||||
;(function($) {
|
||||
var tmp, loading, overlay, wrap, outer, content, close, title, nav_left, nav_right,
|
||||
|
||||
selectedIndex = 0, selectedOpts = {}, selectedArray = [], currentIndex = 0, currentOpts = {}, currentArray = [],
|
||||
|
||||
ajaxLoader = null, imgPreloader = new Image(), imgRegExp = /\.(jpg|gif|png|bmp|jpeg)(.*)?$/i, swfRegExp = /[^\.]\.(swf)\s*$/i,
|
||||
|
||||
loadingTimer, loadingFrame = 1,
|
||||
|
||||
titleHeight = 0, titleStr = '', start_pos, final_pos, busy = false, fx = $.extend($('<div/>')[0], { prop: 0 }),
|
||||
|
||||
isIE6 = $.browser.msie && $.browser.version < 7 && !window.XMLHttpRequest,
|
||||
|
||||
/*
|
||||
* Private methods
|
||||
*/
|
||||
|
||||
_abort = function() {
|
||||
loading.hide();
|
||||
|
||||
imgPreloader.onerror = imgPreloader.onload = null;
|
||||
|
||||
if (ajaxLoader) {
|
||||
ajaxLoader.abort();
|
||||
}
|
||||
|
||||
tmp.empty();
|
||||
},
|
||||
|
||||
_error = function() {
|
||||
if (false === selectedOpts.onError(selectedArray, selectedIndex, selectedOpts)) {
|
||||
loading.hide();
|
||||
busy = false;
|
||||
return;
|
||||
}
|
||||
|
||||
selectedOpts.titleShow = false;
|
||||
|
||||
selectedOpts.width = 'auto';
|
||||
selectedOpts.height = 'auto';
|
||||
|
||||
tmp.html( '<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>' );
|
||||
|
||||
_process_inline();
|
||||
},
|
||||
|
||||
_start = function() {
|
||||
var obj = selectedArray[ selectedIndex ],
|
||||
href,
|
||||
type,
|
||||
title,
|
||||
str,
|
||||
emb,
|
||||
ret;
|
||||
|
||||
_abort();
|
||||
|
||||
selectedOpts = $.extend({}, $.fn.fancybox.defaults, (typeof $(obj).data('fancybox') == 'undefined' ? selectedOpts : $(obj).data('fancybox')));
|
||||
|
||||
ret = selectedOpts.onStart(selectedArray, selectedIndex, selectedOpts);
|
||||
|
||||
if (ret === false) {
|
||||
busy = false;
|
||||
return;
|
||||
} else if (typeof ret == 'object') {
|
||||
selectedOpts = $.extend(selectedOpts, ret);
|
||||
}
|
||||
|
||||
title = selectedOpts.title || (obj.nodeName ? $(obj).attr('title') : obj.title) || '';
|
||||
|
||||
if (obj.nodeName && !selectedOpts.orig) {
|
||||
selectedOpts.orig = $(obj).children("img:first").length ? $(obj).children("img:first") : $(obj);
|
||||
}
|
||||
|
||||
if (title === '' && selectedOpts.orig && selectedOpts.titleFromAlt) {
|
||||
title = selectedOpts.orig.attr('alt');
|
||||
}
|
||||
|
||||
href = selectedOpts.href || (obj.nodeName ? $(obj).attr('href') : obj.href) || null;
|
||||
|
||||
if ((/^(?:javascript)/i).test(href) || href == '#') {
|
||||
href = null;
|
||||
}
|
||||
|
||||
if (selectedOpts.type) {
|
||||
type = selectedOpts.type;
|
||||
|
||||
if (!href) {
|
||||
href = selectedOpts.content;
|
||||
}
|
||||
|
||||
} else if (selectedOpts.content) {
|
||||
type = 'html';
|
||||
|
||||
} else if (href) {
|
||||
if (href.match(imgRegExp)) {
|
||||
type = 'image';
|
||||
|
||||
} else if (href.match(swfRegExp)) {
|
||||
type = 'swf';
|
||||
|
||||
} else if ($(obj).hasClass("iframe")) {
|
||||
type = 'iframe';
|
||||
|
||||
} else if (href.indexOf("#") === 0) {
|
||||
type = 'inline';
|
||||
|
||||
} else {
|
||||
type = 'ajax';
|
||||
}
|
||||
}
|
||||
|
||||
if (!type) {
|
||||
_error();
|
||||
return;
|
||||
}
|
||||
|
||||
if (type == 'inline') {
|
||||
obj = href.substr(href.indexOf("#"));
|
||||
type = $(obj).length > 0 ? 'inline' : 'ajax';
|
||||
}
|
||||
|
||||
selectedOpts.type = type;
|
||||
selectedOpts.href = href;
|
||||
selectedOpts.title = title;
|
||||
|
||||
if (selectedOpts.autoDimensions) {
|
||||
if (selectedOpts.type == 'html' || selectedOpts.type == 'inline' || selectedOpts.type == 'ajax') {
|
||||
selectedOpts.width = 'auto';
|
||||
selectedOpts.height = 'auto';
|
||||
} else {
|
||||
selectedOpts.autoDimensions = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (selectedOpts.modal) {
|
||||
selectedOpts.overlayShow = true;
|
||||
selectedOpts.hideOnOverlayClick = false;
|
||||
selectedOpts.hideOnContentClick = false;
|
||||
selectedOpts.enableEscapeButton = false;
|
||||
selectedOpts.showCloseButton = false;
|
||||
}
|
||||
|
||||
selectedOpts.padding = parseInt(selectedOpts.padding, 10);
|
||||
selectedOpts.margin = parseInt(selectedOpts.margin, 10);
|
||||
|
||||
tmp.css('padding', (selectedOpts.padding + selectedOpts.margin));
|
||||
|
||||
$('.fancybox-inline-tmp').unbind('fancybox-cancel').bind('fancybox-change', function() {
|
||||
$(this).replaceWith(content.children());
|
||||
});
|
||||
|
||||
switch (type) {
|
||||
case 'html' :
|
||||
tmp.html( selectedOpts.content );
|
||||
_process_inline();
|
||||
break;
|
||||
|
||||
case 'inline' :
|
||||
if ( $(obj).parent().is('#fancybox-content') === true) {
|
||||
busy = false;
|
||||
return;
|
||||
}
|
||||
|
||||
$('<div class="fancybox-inline-tmp" />')
|
||||
.hide()
|
||||
.insertBefore( $(obj) )
|
||||
.bind('fancybox-cleanup', function() {
|
||||
$(this).replaceWith(content.children());
|
||||
}).bind('fancybox-cancel', function() {
|
||||
$(this).replaceWith(tmp.children());
|
||||
});
|
||||
|
||||
$(obj).appendTo(tmp);
|
||||
|
||||
_process_inline();
|
||||
break;
|
||||
|
||||
case 'image':
|
||||
busy = false;
|
||||
|
||||
$.fancybox.showActivity();
|
||||
|
||||
imgPreloader = new Image();
|
||||
|
||||
imgPreloader.onerror = function() {
|
||||
_error();
|
||||
};
|
||||
|
||||
imgPreloader.onload = function() {
|
||||
busy = true;
|
||||
|
||||
imgPreloader.onerror = imgPreloader.onload = null;
|
||||
|
||||
_process_image();
|
||||
};
|
||||
|
||||
imgPreloader.src = href;
|
||||
break;
|
||||
|
||||
case 'swf':
|
||||
selectedOpts.scrolling = 'no';
|
||||
|
||||
str = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + selectedOpts.width + '" height="' + selectedOpts.height + '"><param name="movie" value="' + href + '"></param>';
|
||||
emb = '';
|
||||
|
||||
$.each(selectedOpts.swf, function(name, val) {
|
||||
str += '<param name="' + name + '" value="' + val + '"></param>';
|
||||
emb += ' ' + name + '="' + val + '"';
|
||||
});
|
||||
|
||||
str += '<embed src="' + href + '" type="application/x-shockwave-flash" width="' + selectedOpts.width + '" height="' + selectedOpts.height + '"' + emb + '></embed></object>';
|
||||
|
||||
tmp.html(str);
|
||||
|
||||
_process_inline();
|
||||
break;
|
||||
|
||||
case 'ajax':
|
||||
busy = false;
|
||||
|
||||
$.fancybox.showActivity();
|
||||
|
||||
selectedOpts.ajax.win = selectedOpts.ajax.success;
|
||||
|
||||
ajaxLoader = $.ajax($.extend({}, selectedOpts.ajax, {
|
||||
url : href,
|
||||
data : selectedOpts.ajax.data || {},
|
||||
error : function(XMLHttpRequest, textStatus, errorThrown) {
|
||||
if ( XMLHttpRequest.status > 0 ) {
|
||||
_error();
|
||||
}
|
||||
},
|
||||
success : function(data, textStatus, XMLHttpRequest) {
|
||||
var o = typeof XMLHttpRequest == 'object' ? XMLHttpRequest : ajaxLoader;
|
||||
if (o.status == 200) {
|
||||
if ( typeof selectedOpts.ajax.win == 'function' ) {
|
||||
ret = selectedOpts.ajax.win(href, data, textStatus, XMLHttpRequest);
|
||||
|
||||
if (ret === false) {
|
||||
loading.hide();
|
||||
return;
|
||||
} else if (typeof ret == 'string' || typeof ret == 'object') {
|
||||
data = ret;
|
||||
}
|
||||
}
|
||||
|
||||
tmp.html( data );
|
||||
_process_inline();
|
||||
}
|
||||
}
|
||||
}));
|
||||
|
||||
break;
|
||||
|
||||
case 'iframe':
|
||||
_show();
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
_process_inline = function() {
|
||||
var
|
||||
w = selectedOpts.width,
|
||||
h = selectedOpts.height;
|
||||
|
||||
if (w.toString().indexOf('%') > -1) {
|
||||
w = parseInt( ($(window).width() - (selectedOpts.margin * 2)) * parseFloat(w) / 100, 10) + 'px';
|
||||
|
||||
} else {
|
||||
w = w == 'auto' ? 'auto' : w + 'px';
|
||||
}
|
||||
|
||||
if (h.toString().indexOf('%') > -1) {
|
||||
h = parseInt( ($(window).height() - (selectedOpts.margin * 2)) * parseFloat(h) / 100, 10) + 'px';
|
||||
|
||||
} else {
|
||||
h = h == 'auto' ? 'auto' : h + 'px';
|
||||
}
|
||||
|
||||
tmp.wrapInner('<div style="width:' + w + ';height:' + h + ';overflow: ' + (selectedOpts.scrolling == 'auto' ? 'auto' : (selectedOpts.scrolling == 'yes' ? 'scroll' : 'hidden')) + ';position:relative;"></div>');
|
||||
|
||||
selectedOpts.width = tmp.width();
|
||||
selectedOpts.height = tmp.height();
|
||||
|
||||
_show();
|
||||
},
|
||||
|
||||
_process_image = function() {
|
||||
selectedOpts.width = imgPreloader.width;
|
||||
selectedOpts.height = imgPreloader.height;
|
||||
|
||||
$("<img />").attr({
|
||||
'id' : 'fancybox-img',
|
||||
'src' : imgPreloader.src,
|
||||
'alt' : selectedOpts.title
|
||||
}).appendTo( tmp );
|
||||
|
||||
_show();
|
||||
},
|
||||
|
||||
_show = function() {
|
||||
var pos, equal;
|
||||
|
||||
loading.hide();
|
||||
|
||||
if (wrap.is(":visible") && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) {
|
||||
$.event.trigger('fancybox-cancel');
|
||||
|
||||
busy = false;
|
||||
return;
|
||||
}
|
||||
|
||||
busy = true;
|
||||
|
||||
$(content.add( overlay )).unbind();
|
||||
|
||||
$(window).unbind("resize.fb scroll.fb");
|
||||
$(document).unbind('keydown.fb');
|
||||
|
||||
if (wrap.is(":visible") && currentOpts.titlePosition !== 'outside') {
|
||||
wrap.css('height', wrap.height());
|
||||
}
|
||||
|
||||
currentArray = selectedArray;
|
||||
currentIndex = selectedIndex;
|
||||
currentOpts = selectedOpts;
|
||||
|
||||
if (currentOpts.overlayShow) {
|
||||
overlay.css({
|
||||
'background-color' : currentOpts.overlayColor,
|
||||
'opacity' : currentOpts.overlayOpacity,
|
||||
'cursor' : currentOpts.hideOnOverlayClick ? 'pointer' : 'auto',
|
||||
'height' : $(document).height()
|
||||
});
|
||||
|
||||
if (!overlay.is(':visible')) {
|
||||
if (isIE6) {
|
||||
$('select:not(#fancybox-tmp select)').filter(function() {
|
||||
return this.style.visibility !== 'hidden';
|
||||
}).css({'visibility' : 'hidden'}).one('fancybox-cleanup', function() {
|
||||
this.style.visibility = 'inherit';
|
||||
});
|
||||
}
|
||||
|
||||
overlay.show();
|
||||
}
|
||||
} else {
|
||||
overlay.hide();
|
||||
}
|
||||
|
||||
final_pos = _get_zoom_to();
|
||||
|
||||
_process_title();
|
||||
|
||||
if (wrap.is(":visible")) {
|
||||
$( close.add( nav_left ).add( nav_right ) ).hide();
|
||||
|
||||
pos = wrap.position(),
|
||||
|
||||
start_pos = {
|
||||
top : pos.top,
|
||||
left : pos.left,
|
||||
width : wrap.width(),
|
||||
height : wrap.height()
|
||||
};
|
||||
|
||||
equal = (start_pos.width == final_pos.width && start_pos.height == final_pos.height);
|
||||
|
||||
content.fadeTo(currentOpts.changeFade, 0.3, function() {
|
||||
var finish_resizing = function() {
|
||||
content.html( tmp.contents() ).fadeTo(currentOpts.changeFade, 1, _finish);
|
||||
};
|
||||
|
||||
$.event.trigger('fancybox-change');
|
||||
|
||||
content
|
||||
.empty()
|
||||
.removeAttr('filter')
|
||||
.css({
|
||||
'border-width' : currentOpts.padding,
|
||||
'width' : final_pos.width - currentOpts.padding * 2,
|
||||
'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2
|
||||
});
|
||||
|
||||
if (equal) {
|
||||
finish_resizing();
|
||||
|
||||
} else {
|
||||
fx.prop = 0;
|
||||
|
||||
$(fx).animate({prop: 1}, {
|
||||
duration : currentOpts.changeSpeed,
|
||||
easing : currentOpts.easingChange,
|
||||
step : _draw,
|
||||
complete : finish_resizing
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
wrap.removeAttr("style");
|
||||
|
||||
content.css('border-width', currentOpts.padding);
|
||||
|
||||
if (currentOpts.transitionIn == 'elastic') {
|
||||
start_pos = _get_zoom_from();
|
||||
|
||||
content.html( tmp.contents() );
|
||||
|
||||
wrap.show();
|
||||
|
||||
if (currentOpts.opacity) {
|
||||
final_pos.opacity = 0;
|
||||
}
|
||||
|
||||
fx.prop = 0;
|
||||
|
||||
$(fx).animate({prop: 1}, {
|
||||
duration : currentOpts.speedIn,
|
||||
easing : currentOpts.easingIn,
|
||||
step : _draw,
|
||||
complete : _finish
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (currentOpts.titlePosition == 'inside' && titleHeight > 0) {
|
||||
title.show();
|
||||
}
|
||||
|
||||
content
|
||||
.css({
|
||||
'width' : final_pos.width - currentOpts.padding * 2,
|
||||
'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2
|
||||
})
|
||||
.html( tmp.contents() );
|
||||
|
||||
wrap
|
||||
.css(final_pos)
|
||||
.fadeIn( currentOpts.transitionIn == 'none' ? 0 : currentOpts.speedIn, _finish );
|
||||
},
|
||||
|
||||
_format_title = function(title) {
|
||||
if (title && title.length) {
|
||||
if (currentOpts.titlePosition == 'float') {
|
||||
return '<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">' + title + '</td><td id="fancybox-title-float-right"></td></tr></table>';
|
||||
}
|
||||
|
||||
return '<div id="fancybox-title-' + currentOpts.titlePosition + '">' + title + '</div>';
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
_process_title = function() {
|
||||
titleStr = currentOpts.title || '';
|
||||
titleHeight = 0;
|
||||
|
||||
title
|
||||
.empty()
|
||||
.removeAttr('style')
|
||||
.removeClass();
|
||||
|
||||
if (currentOpts.titleShow === false) {
|
||||
title.hide();
|
||||
return;
|
||||
}
|
||||
|
||||
titleStr = $.isFunction(currentOpts.titleFormat) ? currentOpts.titleFormat(titleStr, currentArray, currentIndex, currentOpts) : _format_title(titleStr);
|
||||
|
||||
if (!titleStr || titleStr === '') {
|
||||
title.hide();
|
||||
return;
|
||||
}
|
||||
|
||||
title
|
||||
.addClass('fancybox-title-' + currentOpts.titlePosition)
|
||||
.html( titleStr )
|
||||
.appendTo( 'body' )
|
||||
.show();
|
||||
|
||||
switch (currentOpts.titlePosition) {
|
||||
case 'inside':
|
||||
title
|
||||
.css({
|
||||
'width' : final_pos.width - (currentOpts.padding * 2),
|
||||
'marginLeft' : currentOpts.padding,
|
||||
'marginRight' : currentOpts.padding
|
||||
});
|
||||
|
||||
titleHeight = title.outerHeight(true);
|
||||
|
||||
title.appendTo( outer );
|
||||
|
||||
final_pos.height += titleHeight;
|
||||
break;
|
||||
|
||||
case 'over':
|
||||
title
|
||||
.css({
|
||||
'marginLeft' : currentOpts.padding,
|
||||
'width' : final_pos.width - (currentOpts.padding * 2),
|
||||
'bottom' : currentOpts.padding
|
||||
})
|
||||
.appendTo( outer );
|
||||
break;
|
||||
|
||||
case 'float':
|
||||
title
|
||||
.css('left', parseInt((title.width() - final_pos.width - 40)/ 2, 10) * -1)
|
||||
.appendTo( wrap );
|
||||
break;
|
||||
|
||||
default:
|
||||
title
|
||||
.css({
|
||||
'width' : final_pos.width - (currentOpts.padding * 2),
|
||||
'paddingLeft' : currentOpts.padding,
|
||||
'paddingRight' : currentOpts.padding
|
||||
})
|
||||
.appendTo( wrap );
|
||||
break;
|
||||
}
|
||||
|
||||
title.hide();
|
||||
},
|
||||
|
||||
_set_navigation = function() {
|
||||
if (currentOpts.enableEscapeButton || currentOpts.enableKeyboardNav) {
|
||||
$(document).bind('keydown.fb', function(e) {
|
||||
if (e.keyCode == 27 && currentOpts.enableEscapeButton) {
|
||||
e.preventDefault();
|
||||
$.fancybox.close();
|
||||
|
||||
} else if ((e.keyCode == 37 || e.keyCode == 39) && currentOpts.enableKeyboardNav && e.target.tagName !== 'INPUT' && e.target.tagName !== 'TEXTAREA' && e.target.tagName !== 'SELECT') {
|
||||
e.preventDefault();
|
||||
$.fancybox[ e.keyCode == 37 ? 'prev' : 'next']();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (!currentOpts.showNavArrows) {
|
||||
nav_left.hide();
|
||||
nav_right.hide();
|
||||
return;
|
||||
}
|
||||
|
||||
if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex !== 0) {
|
||||
nav_left.show();
|
||||
}
|
||||
|
||||
if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex != (currentArray.length -1)) {
|
||||
nav_right.show();
|
||||
}
|
||||
},
|
||||
|
||||
_finish = function () {
|
||||
if (!$.support.opacity) {
|
||||
content.get(0).style.removeAttribute('filter');
|
||||
wrap.get(0).style.removeAttribute('filter');
|
||||
}
|
||||
|
||||
if (selectedOpts.autoDimensions) {
|
||||
content.css('height', 'auto');
|
||||
}
|
||||
|
||||
wrap.css('height', 'auto');
|
||||
|
||||
if (titleStr && titleStr.length) {
|
||||
title.show();
|
||||
}
|
||||
|
||||
if (currentOpts.showCloseButton) {
|
||||
close.show();
|
||||
}
|
||||
|
||||
_set_navigation();
|
||||
|
||||
if (currentOpts.hideOnContentClick) {
|
||||
content.bind('click', $.fancybox.close);
|
||||
}
|
||||
|
||||
if (currentOpts.hideOnOverlayClick) {
|
||||
overlay.bind('click', $.fancybox.close);
|
||||
}
|
||||
|
||||
$(window).bind("resize.fb", $.fancybox.resize);
|
||||
|
||||
if (currentOpts.centerOnScroll) {
|
||||
$(window).bind("scroll.fb", $.fancybox.center);
|
||||
}
|
||||
|
||||
if (currentOpts.type == 'iframe') {
|
||||
$('<iframe id="fancybox-frame" name="fancybox-frame' + new Date().getTime() + '" frameborder="0" hspace="0" ' + ($.browser.msie ? 'allowtransparency="true""' : '') + ' scrolling="' + selectedOpts.scrolling + '" src="' + currentOpts.href + '"></iframe>').appendTo(content);
|
||||
}
|
||||
|
||||
wrap.show();
|
||||
|
||||
busy = false;
|
||||
|
||||
$.fancybox.center();
|
||||
|
||||
currentOpts.onComplete(currentArray, currentIndex, currentOpts);
|
||||
|
||||
_preload_images();
|
||||
},
|
||||
|
||||
_preload_images = function() {
|
||||
var href,
|
||||
objNext;
|
||||
|
||||
if ((currentArray.length -1) > currentIndex) {
|
||||
href = currentArray[ currentIndex + 1 ].href;
|
||||
|
||||
if (typeof href !== 'undefined' && href.match(imgRegExp)) {
|
||||
objNext = new Image();
|
||||
objNext.src = href;
|
||||
}
|
||||
}
|
||||
|
||||
if (currentIndex > 0) {
|
||||
href = currentArray[ currentIndex - 1 ].href;
|
||||
|
||||
if (typeof href !== 'undefined' && href.match(imgRegExp)) {
|
||||
objNext = new Image();
|
||||
objNext.src = href;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
_draw = function(pos) {
|
||||
var dim = {
|
||||
width : parseInt(start_pos.width + (final_pos.width - start_pos.width) * pos, 10),
|
||||
height : parseInt(start_pos.height + (final_pos.height - start_pos.height) * pos, 10),
|
||||
|
||||
top : parseInt(start_pos.top + (final_pos.top - start_pos.top) * pos, 10),
|
||||
left : parseInt(start_pos.left + (final_pos.left - start_pos.left) * pos, 10)
|
||||
};
|
||||
|
||||
if (typeof final_pos.opacity !== 'undefined') {
|
||||
dim.opacity = pos < 0.5 ? 0.5 : pos;
|
||||
}
|
||||
|
||||
wrap.css(dim);
|
||||
|
||||
content.css({
|
||||
'width' : dim.width - currentOpts.padding * 2,
|
||||
'height' : dim.height - (titleHeight * pos) - currentOpts.padding * 2
|
||||
});
|
||||
},
|
||||
|
||||
_get_viewport = function() {
|
||||
return [
|
||||
$(window).width() - (currentOpts.margin * 2),
|
||||
$(window).height() - (currentOpts.margin * 2),
|
||||
$(document).scrollLeft() + currentOpts.margin,
|
||||
$(document).scrollTop() + currentOpts.margin
|
||||
];
|
||||
},
|
||||
|
||||
_get_zoom_to = function () {
|
||||
var view = _get_viewport(),
|
||||
to = {},
|
||||
resize = currentOpts.autoScale,
|
||||
double_padding = currentOpts.padding * 2,
|
||||
ratio;
|
||||
|
||||
if (currentOpts.width.toString().indexOf('%') > -1) {
|
||||
to.width = parseInt((view[0] * parseFloat(currentOpts.width)) / 100, 10);
|
||||
} else {
|
||||
to.width = currentOpts.width + double_padding;
|
||||
}
|
||||
|
||||
if (currentOpts.height.toString().indexOf('%') > -1) {
|
||||
to.height = parseInt((view[1] * parseFloat(currentOpts.height)) / 100, 10);
|
||||
} else {
|
||||
to.height = currentOpts.height + double_padding;
|
||||
}
|
||||
|
||||
if (resize && (to.width > view[0] || to.height > view[1])) {
|
||||
if (selectedOpts.type == 'image' || selectedOpts.type == 'swf') {
|
||||
ratio = (currentOpts.width ) / (currentOpts.height );
|
||||
|
||||
if ((to.width ) > view[0]) {
|
||||
to.width = view[0];
|
||||
to.height = parseInt(((to.width - double_padding) / ratio) + double_padding, 10);
|
||||
}
|
||||
|
||||
if ((to.height) > view[1]) {
|
||||
to.height = view[1];
|
||||
to.width = parseInt(((to.height - double_padding) * ratio) + double_padding, 10);
|
||||
}
|
||||
|
||||
} else {
|
||||
to.width = Math.min(to.width, view[0]);
|
||||
to.height = Math.min(to.height, view[1]);
|
||||
}
|
||||
}
|
||||
|
||||
to.top = parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - to.height - 40) * 0.5)), 10);
|
||||
to.left = parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - to.width - 40) * 0.5)), 10);
|
||||
|
||||
return to;
|
||||
},
|
||||
|
||||
_get_obj_pos = function(obj) {
|
||||
var pos = obj.offset();
|
||||
|
||||
pos.top += parseInt( obj.css('paddingTop'), 10 ) || 0;
|
||||
pos.left += parseInt( obj.css('paddingLeft'), 10 ) || 0;
|
||||
|
||||
pos.top += parseInt( obj.css('border-top-width'), 10 ) || 0;
|
||||
pos.left += parseInt( obj.css('border-left-width'), 10 ) || 0;
|
||||
|
||||
pos.width = obj.width();
|
||||
pos.height = obj.height();
|
||||
|
||||
return pos;
|
||||
},
|
||||
|
||||
_get_zoom_from = function() {
|
||||
var orig = selectedOpts.orig ? $(selectedOpts.orig) : false,
|
||||
from = {},
|
||||
pos,
|
||||
view;
|
||||
|
||||
if (orig && orig.length) {
|
||||
pos = _get_obj_pos(orig);
|
||||
|
||||
from = {
|
||||
width : pos.width + (currentOpts.padding * 2),
|
||||
height : pos.height + (currentOpts.padding * 2),
|
||||
top : pos.top - currentOpts.padding - 20,
|
||||
left : pos.left - currentOpts.padding - 20
|
||||
};
|
||||
|
||||
} else {
|
||||
view = _get_viewport();
|
||||
|
||||
from = {
|
||||
width : currentOpts.padding * 2,
|
||||
height : currentOpts.padding * 2,
|
||||
top : parseInt(view[3] + view[1] * 0.5, 10),
|
||||
left : parseInt(view[2] + view[0] * 0.5, 10)
|
||||
};
|
||||
}
|
||||
|
||||
return from;
|
||||
},
|
||||
|
||||
_animate_loading = function() {
|
||||
if (!loading.is(':visible')){
|
||||
clearInterval(loadingTimer);
|
||||
return;
|
||||
}
|
||||
|
||||
$('div', loading).css('top', (loadingFrame * -40) + 'px');
|
||||
|
||||
loadingFrame = (loadingFrame + 1) % 12;
|
||||
};
|
||||
|
||||
/*
|
||||
* Public methods
|
||||
*/
|
||||
|
||||
$.fn.fancybox = function(options) {
|
||||
if (!$(this).length) {
|
||||
return this;
|
||||
}
|
||||
|
||||
$(this)
|
||||
.data('fancybox', $.extend({}, options, ($.metadata ? $(this).metadata() : {})))
|
||||
.unbind('click.fb')
|
||||
.bind('click.fb', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
if (busy) {
|
||||
return;
|
||||
}
|
||||
|
||||
busy = true;
|
||||
|
||||
$(this).blur();
|
||||
|
||||
selectedArray = [];
|
||||
selectedIndex = 0;
|
||||
|
||||
var rel = $(this).attr('rel') || '';
|
||||
|
||||
if (!rel || rel == '' || rel === 'nofollow') {
|
||||
selectedArray.push(this);
|
||||
|
||||
} else {
|
||||
selectedArray = $("a[rel=" + rel + "], area[rel=" + rel + "]");
|
||||
selectedIndex = selectedArray.index( this );
|
||||
}
|
||||
|
||||
_start();
|
||||
|
||||
return;
|
||||
});
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
$.fancybox = function(obj) {
|
||||
var opts;
|
||||
|
||||
if (busy) {
|
||||
return;
|
||||
}
|
||||
|
||||
busy = true;
|
||||
opts = typeof arguments[1] !== 'undefined' ? arguments[1] : {};
|
||||
|
||||
selectedArray = [];
|
||||
selectedIndex = parseInt(opts.index, 10) || 0;
|
||||
|
||||
if ($.isArray(obj)) {
|
||||
for (var i = 0, j = obj.length; i < j; i++) {
|
||||
if (typeof obj[i] == 'object') {
|
||||
$(obj[i]).data('fancybox', $.extend({}, opts, obj[i]));
|
||||
} else {
|
||||
obj[i] = $({}).data('fancybox', $.extend({content : obj[i]}, opts));
|
||||
}
|
||||
}
|
||||
|
||||
selectedArray = jQuery.merge(selectedArray, obj);
|
||||
|
||||
} else {
|
||||
if (typeof obj == 'object') {
|
||||
$(obj).data('fancybox', $.extend({}, opts, obj));
|
||||
} else {
|
||||
obj = $({}).data('fancybox', $.extend({content : obj}, opts));
|
||||
}
|
||||
|
||||
selectedArray.push(obj);
|
||||
}
|
||||
|
||||
if (selectedIndex > selectedArray.length || selectedIndex < 0) {
|
||||
selectedIndex = 0;
|
||||
}
|
||||
|
||||
_start();
|
||||
};
|
||||
|
||||
$.fancybox.showActivity = function() {
|
||||
clearInterval(loadingTimer);
|
||||
|
||||
loading.show();
|
||||
loadingTimer = setInterval(_animate_loading, 66);
|
||||
};
|
||||
|
||||
$.fancybox.hideActivity = function() {
|
||||
loading.hide();
|
||||
};
|
||||
|
||||
$.fancybox.next = function() {
|
||||
return $.fancybox.pos( currentIndex + 1);
|
||||
};
|
||||
|
||||
$.fancybox.prev = function() {
|
||||
return $.fancybox.pos( currentIndex - 1);
|
||||
};
|
||||
|
||||
$.fancybox.pos = function(pos) {
|
||||
if (busy) {
|
||||
return;
|
||||
}
|
||||
|
||||
pos = parseInt(pos);
|
||||
|
||||
selectedArray = currentArray;
|
||||
|
||||
if (pos > -1 && pos < currentArray.length) {
|
||||
selectedIndex = pos;
|
||||
_start();
|
||||
|
||||
} else if (currentOpts.cyclic && currentArray.length > 1) {
|
||||
selectedIndex = pos >= currentArray.length ? 0 : currentArray.length - 1;
|
||||
_start();
|
||||
}
|
||||
|
||||
return;
|
||||
};
|
||||
|
||||
$.fancybox.cancel = function() {
|
||||
if (busy) {
|
||||
return;
|
||||
}
|
||||
|
||||
busy = true;
|
||||
|
||||
$.event.trigger('fancybox-cancel');
|
||||
|
||||
_abort();
|
||||
|
||||
selectedOpts.onCancel(selectedArray, selectedIndex, selectedOpts);
|
||||
|
||||
busy = false;
|
||||
};
|
||||
|
||||
// Note: within an iframe use - parent.$.fancybox.close();
|
||||
$.fancybox.close = function() {
|
||||
if (busy || wrap.is(':hidden')) {
|
||||
return;
|
||||
}
|
||||
|
||||
busy = true;
|
||||
|
||||
if (currentOpts && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) {
|
||||
busy = false;
|
||||
return;
|
||||
}
|
||||
|
||||
_abort();
|
||||
|
||||
$(close.add( nav_left ).add( nav_right )).hide();
|
||||
|
||||
$(content.add( overlay )).unbind();
|
||||
|
||||
$(window).unbind("resize.fb scroll.fb");
|
||||
$(document).unbind('keydown.fb');
|
||||
|
||||
content.find('iframe').attr('src', isIE6 && /^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank');
|
||||
|
||||
if (currentOpts.titlePosition !== 'inside') {
|
||||
title.empty();
|
||||
}
|
||||
|
||||
wrap.stop();
|
||||
|
||||
function _cleanup() {
|
||||
overlay.fadeOut('fast');
|
||||
|
||||
title.empty().hide();
|
||||
wrap.hide();
|
||||
|
||||
$.event.trigger('fancybox-cleanup');
|
||||
|
||||
content.empty();
|
||||
|
||||
currentOpts.onClosed(currentArray, currentIndex, currentOpts);
|
||||
|
||||
currentArray = selectedOpts = [];
|
||||
currentIndex = selectedIndex = 0;
|
||||
currentOpts = selectedOpts = {};
|
||||
|
||||
busy = false;
|
||||
}
|
||||
|
||||
if (currentOpts.transitionOut == 'elastic') {
|
||||
start_pos = _get_zoom_from();
|
||||
|
||||
var pos = wrap.position();
|
||||
|
||||
final_pos = {
|
||||
top : pos.top ,
|
||||
left : pos.left,
|
||||
width : wrap.width(),
|
||||
height : wrap.height()
|
||||
};
|
||||
|
||||
if (currentOpts.opacity) {
|
||||
final_pos.opacity = 1;
|
||||
}
|
||||
|
||||
title.empty().hide();
|
||||
|
||||
fx.prop = 1;
|
||||
|
||||
$(fx).animate({ prop: 0 }, {
|
||||
duration : currentOpts.speedOut,
|
||||
easing : currentOpts.easingOut,
|
||||
step : _draw,
|
||||
complete : _cleanup
|
||||
});
|
||||
|
||||
} else {
|
||||
wrap.fadeOut( currentOpts.transitionOut == 'none' ? 0 : currentOpts.speedOut, _cleanup);
|
||||
}
|
||||
};
|
||||
|
||||
$.fancybox.resize = function() {
|
||||
if (overlay.is(':visible')) {
|
||||
overlay.css('height', $(document).height());
|
||||
}
|
||||
|
||||
$.fancybox.center(true);
|
||||
};
|
||||
|
||||
$.fancybox.center = function() {
|
||||
var view, align;
|
||||
|
||||
if (busy) {
|
||||
return;
|
||||
}
|
||||
|
||||
align = arguments[0] === true ? 1 : 0;
|
||||
view = _get_viewport();
|
||||
|
||||
if (!align && (wrap.width() > view[0] || wrap.height() > view[1])) {
|
||||
return;
|
||||
}
|
||||
|
||||
wrap
|
||||
.stop()
|
||||
.animate({
|
||||
'top' : parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - content.height() - 40) * 0.5) - currentOpts.padding)),
|
||||
'left' : parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - content.width() - 40) * 0.5) - currentOpts.padding))
|
||||
}, typeof arguments[0] == 'number' ? arguments[0] : 200);
|
||||
};
|
||||
|
||||
$.fancybox.init = function() {
|
||||
if ($("#fancybox-wrap").length) {
|
||||
return;
|
||||
}
|
||||
|
||||
$('body').append(
|
||||
tmp = $('<div id="fancybox-tmp"></div>'),
|
||||
loading = $('<div id="fancybox-loading"><div></div></div>'),
|
||||
overlay = $('<div id="fancybox-overlay"></div>'),
|
||||
wrap = $('<div id="fancybox-wrap"></div>')
|
||||
);
|
||||
|
||||
outer = $('<div id="fancybox-outer"></div>')
|
||||
.append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>')
|
||||
.appendTo( wrap );
|
||||
|
||||
outer.append(
|
||||
content = $('<div id="fancybox-content"></div>'),
|
||||
close = $('<a id="fancybox-close"></a>'),
|
||||
title = $('<div id="fancybox-title"></div>'),
|
||||
|
||||
nav_left = $('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),
|
||||
nav_right = $('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>')
|
||||
);
|
||||
|
||||
close.click($.fancybox.close);
|
||||
loading.click($.fancybox.cancel);
|
||||
|
||||
nav_left.click(function(e) {
|
||||
e.preventDefault();
|
||||
$.fancybox.prev();
|
||||
});
|
||||
|
||||
nav_right.click(function(e) {
|
||||
e.preventDefault();
|
||||
$.fancybox.next();
|
||||
});
|
||||
|
||||
if ($.fn.mousewheel) {
|
||||
wrap.bind('mousewheel.fb', function(e, delta) {
|
||||
if (busy) {
|
||||
e.preventDefault();
|
||||
|
||||
} else if ($(e.target).get(0).clientHeight == 0 || $(e.target).get(0).scrollHeight === $(e.target).get(0).clientHeight) {
|
||||
e.preventDefault();
|
||||
$.fancybox[ delta > 0 ? 'prev' : 'next']();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (!$.support.opacity) {
|
||||
wrap.addClass('fancybox-ie');
|
||||
}
|
||||
|
||||
if (isIE6) {
|
||||
loading.addClass('fancybox-ie6');
|
||||
wrap.addClass('fancybox-ie6');
|
||||
|
||||
$('<iframe id="fancybox-hide-sel-frame" src="' + (/^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank' ) + '" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(outer);
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.fancybox.defaults = {
|
||||
padding : 10,
|
||||
margin : 40,
|
||||
opacity : false,
|
||||
modal : false,
|
||||
cyclic : false,
|
||||
scrolling : 'auto', // 'auto', 'yes' or 'no'
|
||||
|
||||
width : 560,
|
||||
height : 340,
|
||||
|
||||
autoScale : true,
|
||||
autoDimensions : true,
|
||||
centerOnScroll : false,
|
||||
|
||||
ajax : {},
|
||||
swf : { wmode: 'transparent' },
|
||||
|
||||
hideOnOverlayClick : true,
|
||||
hideOnContentClick : false,
|
||||
|
||||
overlayShow : true,
|
||||
overlayOpacity : 0.7,
|
||||
overlayColor : '#777',
|
||||
|
||||
titleShow : true,
|
||||
titlePosition : 'float', // 'float', 'outside', 'inside' or 'over'
|
||||
titleFormat : null,
|
||||
titleFromAlt : false,
|
||||
|
||||
transitionIn : 'fade', // 'elastic', 'fade' or 'none'
|
||||
transitionOut : 'fade', // 'elastic', 'fade' or 'none'
|
||||
|
||||
speedIn : 300,
|
||||
speedOut : 300,
|
||||
|
||||
changeSpeed : 300,
|
||||
changeFade : 'fast',
|
||||
|
||||
easingIn : 'swing',
|
||||
easingOut : 'swing',
|
||||
|
||||
showCloseButton : true,
|
||||
showNavArrows : true,
|
||||
enableEscapeButton : true,
|
||||
enableKeyboardNav : true,
|
||||
|
||||
onStart : function(){},
|
||||
onCancel : function(){},
|
||||
onComplete : function(){},
|
||||
onCleanup : function(){},
|
||||
onClosed : function(){},
|
||||
onError : function(){}
|
||||
};
|
||||
|
||||
$(document).ready(function() {
|
||||
$.fancybox.init();
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* FancyBox - jQuery Plugin
|
||||
* Simple and fancy lightbox alternative
|
||||
*
|
||||
* Examples and documentation at: http://fancybox.net
|
||||
*
|
||||
* Copyright (c) 2008 - 2010 Janis Skarnelis
|
||||
* That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
|
||||
*
|
||||
* Version: 1.3.4 (11/11/2010)
|
||||
* Requires: jQuery v1.3+
|
||||
*
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*/
|
||||
|
||||
;(function(b){var m,t,u,f,D,j,E,n,z,A,q=0,e={},o=[],p=0,d={},l=[],G=null,v=new Image,J=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,W=/[^\.]\.(swf)\s*$/i,K,L=1,y=0,s="",r,i,h=false,B=b.extend(b("<div/>")[0],{prop:0}),M=b.browser.msie&&b.browser.version<7&&!window.XMLHttpRequest,N=function(){t.hide();v.onerror=v.onload=null;G&&G.abort();m.empty()},O=function(){if(false===e.onError(o,q,e)){t.hide();h=false}else{e.titleShow=false;e.width="auto";e.height="auto";m.html('<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>');
|
||||
F()}},I=function(){var a=o[q],c,g,k,C,P,w;N();e=b.extend({},b.fn.fancybox.defaults,typeof b(a).data("fancybox")=="undefined"?e:b(a).data("fancybox"));w=e.onStart(o,q,e);if(w===false)h=false;else{if(typeof w=="object")e=b.extend(e,w);k=e.title||(a.nodeName?b(a).attr("title"):a.title)||"";if(a.nodeName&&!e.orig)e.orig=b(a).children("img:first").length?b(a).children("img:first"):b(a);if(k===""&&e.orig&&e.titleFromAlt)k=e.orig.attr("alt");c=e.href||(a.nodeName?b(a).attr("href"):a.href)||null;if(/^(?:javascript)/i.test(c)||
|
||||
c=="#")c=null;if(e.type){g=e.type;if(!c)c=e.content}else if(e.content)g="html";else if(c)g=c.match(J)?"image":c.match(W)?"swf":b(a).hasClass("iframe")?"iframe":c.indexOf("#")===0?"inline":"ajax";if(g){if(g=="inline"){a=c.substr(c.indexOf("#"));g=b(a).length>0?"inline":"ajax"}e.type=g;e.href=c;e.title=k;if(e.autoDimensions)if(e.type=="html"||e.type=="inline"||e.type=="ajax"){e.width="auto";e.height="auto"}else e.autoDimensions=false;if(e.modal){e.overlayShow=true;e.hideOnOverlayClick=false;e.hideOnContentClick=
|
||||
false;e.enableEscapeButton=false;e.showCloseButton=false}e.padding=parseInt(e.padding,10);e.margin=parseInt(e.margin,10);m.css("padding",e.padding+e.margin);b(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){b(this).replaceWith(j.children())});switch(g){case "html":m.html(e.content);F();break;case "inline":if(b(a).parent().is("#fancybox-content")===true){h=false;break}b('<div class="fancybox-inline-tmp" />').hide().insertBefore(b(a)).bind("fancybox-cleanup",function(){b(this).replaceWith(j.children())}).bind("fancybox-cancel",
|
||||
function(){b(this).replaceWith(m.children())});b(a).appendTo(m);F();break;case "image":h=false;b.fancybox.showActivity();v=new Image;v.onerror=function(){O()};v.onload=function(){h=true;v.onerror=v.onload=null;e.width=v.width;e.height=v.height;b("<img />").attr({id:"fancybox-img",src:v.src,alt:e.title}).appendTo(m);Q()};v.src=c;break;case "swf":e.scrolling="no";C='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+e.width+'" height="'+e.height+'"><param name="movie" value="'+c+
|
||||
'"></param>';P="";b.each(e.swf,function(x,H){C+='<param name="'+x+'" value="'+H+'"></param>';P+=" "+x+'="'+H+'"'});C+='<embed src="'+c+'" type="application/x-shockwave-flash" width="'+e.width+'" height="'+e.height+'"'+P+"></embed></object>";m.html(C);F();break;case "ajax":h=false;b.fancybox.showActivity();e.ajax.win=e.ajax.success;G=b.ajax(b.extend({},e.ajax,{url:c,data:e.ajax.data||{},error:function(x){x.status>0&&O()},success:function(x,H,R){if((typeof R=="object"?R:G).status==200){if(typeof e.ajax.win==
|
||||
"function"){w=e.ajax.win(c,x,H,R);if(w===false){t.hide();return}else if(typeof w=="string"||typeof w=="object")x=w}m.html(x);F()}}}));break;case "iframe":Q()}}else O()}},F=function(){var a=e.width,c=e.height;a=a.toString().indexOf("%")>-1?parseInt((b(window).width()-e.margin*2)*parseFloat(a)/100,10)+"px":a=="auto"?"auto":a+"px";c=c.toString().indexOf("%")>-1?parseInt((b(window).height()-e.margin*2)*parseFloat(c)/100,10)+"px":c=="auto"?"auto":c+"px";m.wrapInner('<div style="width:'+a+";height:"+c+
|
||||
";overflow: "+(e.scrolling=="auto"?"auto":e.scrolling=="yes"?"scroll":"hidden")+';position:relative;"></div>');e.width=m.width();e.height=m.height();Q()},Q=function(){var a,c;t.hide();if(f.is(":visible")&&false===d.onCleanup(l,p,d)){b.event.trigger("fancybox-cancel");h=false}else{h=true;b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");f.is(":visible")&&d.titlePosition!=="outside"&&f.css("height",f.height());l=o;p=q;d=e;if(d.overlayShow){u.css({"background-color":d.overlayColor,
|
||||
opacity:d.overlayOpacity,cursor:d.hideOnOverlayClick?"pointer":"auto",height:b(document).height()});if(!u.is(":visible")){M&&b("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"});u.show()}}else u.hide();i=X();s=d.title||"";y=0;n.empty().removeAttr("style").removeClass();if(d.titleShow!==false){if(b.isFunction(d.titleFormat))a=d.titleFormat(s,l,p,d);else a=s&&s.length?
|
||||
d.titlePosition=="float"?'<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">'+s+'</td><td id="fancybox-title-float-right"></td></tr></table>':'<div id="fancybox-title-'+d.titlePosition+'">'+s+"</div>":false;s=a;if(!(!s||s==="")){n.addClass("fancybox-title-"+d.titlePosition).html(s).appendTo("body").show();switch(d.titlePosition){case "inside":n.css({width:i.width-d.padding*2,marginLeft:d.padding,marginRight:d.padding});
|
||||
y=n.outerHeight(true);n.appendTo(D);i.height+=y;break;case "over":n.css({marginLeft:d.padding,width:i.width-d.padding*2,bottom:d.padding}).appendTo(D);break;case "float":n.css("left",parseInt((n.width()-i.width-40)/2,10)*-1).appendTo(f);break;default:n.css({width:i.width-d.padding*2,paddingLeft:d.padding,paddingRight:d.padding}).appendTo(f)}}}n.hide();if(f.is(":visible")){b(E.add(z).add(A)).hide();a=f.position();r={top:a.top,left:a.left,width:f.width(),height:f.height()};c=r.width==i.width&&r.height==
|
||||
i.height;j.fadeTo(d.changeFade,0.3,function(){var g=function(){j.html(m.contents()).fadeTo(d.changeFade,1,S)};b.event.trigger("fancybox-change");j.empty().removeAttr("filter").css({"border-width":d.padding,width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2});if(c)g();else{B.prop=0;b(B).animate({prop:1},{duration:d.changeSpeed,easing:d.easingChange,step:T,complete:g})}})}else{f.removeAttr("style");j.css("border-width",d.padding);if(d.transitionIn=="elastic"){r=V();j.html(m.contents());
|
||||
f.show();if(d.opacity)i.opacity=0;B.prop=0;b(B).animate({prop:1},{duration:d.speedIn,easing:d.easingIn,step:T,complete:S})}else{d.titlePosition=="inside"&&y>0&&n.show();j.css({width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2}).html(m.contents());f.css(i).fadeIn(d.transitionIn=="none"?0:d.speedIn,S)}}}},Y=function(){if(d.enableEscapeButton||d.enableKeyboardNav)b(document).bind("keydown.fb",function(a){if(a.keyCode==27&&d.enableEscapeButton){a.preventDefault();b.fancybox.close()}else if((a.keyCode==
|
||||
37||a.keyCode==39)&&d.enableKeyboardNav&&a.target.tagName!=="INPUT"&&a.target.tagName!=="TEXTAREA"&&a.target.tagName!=="SELECT"){a.preventDefault();b.fancybox[a.keyCode==37?"prev":"next"]()}});if(d.showNavArrows){if(d.cyclic&&l.length>1||p!==0)z.show();if(d.cyclic&&l.length>1||p!=l.length-1)A.show()}else{z.hide();A.hide()}},S=function(){if(!b.support.opacity){j.get(0).style.removeAttribute("filter");f.get(0).style.removeAttribute("filter")}e.autoDimensions&&j.css("height","auto");f.css("height","auto");
|
||||
s&&s.length&&n.show();d.showCloseButton&&E.show();Y();d.hideOnContentClick&&j.bind("click",b.fancybox.close);d.hideOnOverlayClick&&u.bind("click",b.fancybox.close);b(window).bind("resize.fb",b.fancybox.resize);d.centerOnScroll&&b(window).bind("scroll.fb",b.fancybox.center);if(d.type=="iframe")b('<iframe id="fancybox-frame" name="fancybox-frame'+(new Date).getTime()+'" frameborder="0" hspace="0" '+(b.browser.msie?'allowtransparency="true""':"")+' scrolling="'+e.scrolling+'" src="'+d.href+'"></iframe>').appendTo(j);
|
||||
f.show();h=false;b.fancybox.center();d.onComplete(l,p,d);var a,c;if(l.length-1>p){a=l[p+1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}if(p>0){a=l[p-1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}},T=function(a){var c={width:parseInt(r.width+(i.width-r.width)*a,10),height:parseInt(r.height+(i.height-r.height)*a,10),top:parseInt(r.top+(i.top-r.top)*a,10),left:parseInt(r.left+(i.left-r.left)*a,10)};if(typeof i.opacity!=="undefined")c.opacity=a<0.5?0.5:a;f.css(c);
|
||||
j.css({width:c.width-d.padding*2,height:c.height-y*a-d.padding*2})},U=function(){return[b(window).width()-d.margin*2,b(window).height()-d.margin*2,b(document).scrollLeft()+d.margin,b(document).scrollTop()+d.margin]},X=function(){var a=U(),c={},g=d.autoScale,k=d.padding*2;c.width=d.width.toString().indexOf("%")>-1?parseInt(a[0]*parseFloat(d.width)/100,10):d.width+k;c.height=d.height.toString().indexOf("%")>-1?parseInt(a[1]*parseFloat(d.height)/100,10):d.height+k;if(g&&(c.width>a[0]||c.height>a[1]))if(e.type==
|
||||
"image"||e.type=="swf"){g=d.width/d.height;if(c.width>a[0]){c.width=a[0];c.height=parseInt((c.width-k)/g+k,10)}if(c.height>a[1]){c.height=a[1];c.width=parseInt((c.height-k)*g+k,10)}}else{c.width=Math.min(c.width,a[0]);c.height=Math.min(c.height,a[1])}c.top=parseInt(Math.max(a[3]-20,a[3]+(a[1]-c.height-40)*0.5),10);c.left=parseInt(Math.max(a[2]-20,a[2]+(a[0]-c.width-40)*0.5),10);return c},V=function(){var a=e.orig?b(e.orig):false,c={};if(a&&a.length){c=a.offset();c.top+=parseInt(a.css("paddingTop"),
|
||||
10)||0;c.left+=parseInt(a.css("paddingLeft"),10)||0;c.top+=parseInt(a.css("border-top-width"),10)||0;c.left+=parseInt(a.css("border-left-width"),10)||0;c.width=a.width();c.height=a.height();c={width:c.width+d.padding*2,height:c.height+d.padding*2,top:c.top-d.padding-20,left:c.left-d.padding-20}}else{a=U();c={width:d.padding*2,height:d.padding*2,top:parseInt(a[3]+a[1]*0.5,10),left:parseInt(a[2]+a[0]*0.5,10)}}return c},Z=function(){if(t.is(":visible")){b("div",t).css("top",L*-40+"px");L=(L+1)%12}else clearInterval(K)};
|
||||
b.fn.fancybox=function(a){if(!b(this).length)return this;b(this).data("fancybox",b.extend({},a,b.metadata?b(this).metadata():{})).unbind("click.fb").bind("click.fb",function(c){c.preventDefault();if(!h){h=true;b(this).blur();o=[];q=0;c=b(this).attr("rel")||"";if(!c||c==""||c==="nofollow")o.push(this);else{o=b("a[rel="+c+"], area[rel="+c+"]");q=o.index(this)}I()}});return this};b.fancybox=function(a,c){var g;if(!h){h=true;g=typeof c!=="undefined"?c:{};o=[];q=parseInt(g.index,10)||0;if(b.isArray(a)){for(var k=
|
||||
0,C=a.length;k<C;k++)if(typeof a[k]=="object")b(a[k]).data("fancybox",b.extend({},g,a[k]));else a[k]=b({}).data("fancybox",b.extend({content:a[k]},g));o=jQuery.merge(o,a)}else{if(typeof a=="object")b(a).data("fancybox",b.extend({},g,a));else a=b({}).data("fancybox",b.extend({content:a},g));o.push(a)}if(q>o.length||q<0)q=0;I()}};b.fancybox.showActivity=function(){clearInterval(K);t.show();K=setInterval(Z,66)};b.fancybox.hideActivity=function(){t.hide()};b.fancybox.next=function(){return b.fancybox.pos(p+
|
||||
1)};b.fancybox.prev=function(){return b.fancybox.pos(p-1)};b.fancybox.pos=function(a){if(!h){a=parseInt(a);o=l;if(a>-1&&a<l.length){q=a;I()}else if(d.cyclic&&l.length>1){q=a>=l.length?0:l.length-1;I()}}};b.fancybox.cancel=function(){if(!h){h=true;b.event.trigger("fancybox-cancel");N();e.onCancel(o,q,e);h=false}};b.fancybox.close=function(){function a(){u.fadeOut("fast");n.empty().hide();f.hide();b.event.trigger("fancybox-cleanup");j.empty();d.onClosed(l,p,d);l=e=[];p=q=0;d=e={};h=false}if(!(h||f.is(":hidden"))){h=
|
||||
true;if(d&&false===d.onCleanup(l,p,d))h=false;else{N();b(E.add(z).add(A)).hide();b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");j.find("iframe").attr("src",M&&/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank");d.titlePosition!=="inside"&&n.empty();f.stop();if(d.transitionOut=="elastic"){r=V();var c=f.position();i={top:c.top,left:c.left,width:f.width(),height:f.height()};if(d.opacity)i.opacity=1;n.empty().hide();B.prop=1;
|
||||
b(B).animate({prop:0},{duration:d.speedOut,easing:d.easingOut,step:T,complete:a})}else f.fadeOut(d.transitionOut=="none"?0:d.speedOut,a)}}};b.fancybox.resize=function(){u.is(":visible")&&u.css("height",b(document).height());b.fancybox.center(true)};b.fancybox.center=function(a){var c,g;if(!h){g=a===true?1:0;c=U();!g&&(f.width()>c[0]||f.height()>c[1])||f.stop().animate({top:parseInt(Math.max(c[3]-20,c[3]+(c[1]-j.height()-40)*0.5-d.padding)),left:parseInt(Math.max(c[2]-20,c[2]+(c[0]-j.width()-40)*0.5-
|
||||
d.padding))},typeof a=="number"?a:200)}};b.fancybox.init=function(){if(!b("#fancybox-wrap").length){b("body").append(m=b('<div id="fancybox-tmp"></div>'),t=b('<div id="fancybox-loading"><div></div></div>'),u=b('<div id="fancybox-overlay"></div>'),f=b('<div id="fancybox-wrap"></div>'));D=b('<div id="fancybox-outer"></div>').append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>').appendTo(f);
|
||||
D.append(j=b('<div id="fancybox-content"></div>'),E=b('<a id="fancybox-close"></a>'),n=b('<div id="fancybox-title"></div>'),z=b('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),A=b('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));E.click(b.fancybox.close);t.click(b.fancybox.cancel);z.click(function(a){a.preventDefault();b.fancybox.prev()});A.click(function(a){a.preventDefault();b.fancybox.next()});
|
||||
b.fn.mousewheel&&f.bind("mousewheel.fb",function(a,c){if(h)a.preventDefault();else if(b(a.target).get(0).clientHeight==0||b(a.target).get(0).scrollHeight===b(a.target).get(0).clientHeight){a.preventDefault();b.fancybox[c>0?"prev":"next"]()}});b.support.opacity||f.addClass("fancybox-ie");if(M){t.addClass("fancybox-ie6");f.addClass("fancybox-ie6");b('<iframe id="fancybox-hide-sel-frame" src="'+(/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank")+'" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(D)}}};
|
||||
b.fn.fancybox.defaults={padding:10,margin:40,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.7,overlayColor:"#777",titleShow:true,titlePosition:"float",titleFormat:null,titleFromAlt:false,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing",
|
||||
easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,enableKeyboardNav:true,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}};b(document).ready(function(){b.fancybox.init()})})(jQuery);
|
||||
@@ -0,0 +1,122 @@
|
||||
/*!
|
||||
* Buttons helper for fancyBox
|
||||
* version: 1.0.5 (Mon, 15 Oct 2012)
|
||||
* @requires fancyBox v2.0 or later
|
||||
*
|
||||
* Usage:
|
||||
* $(".fancybox").fancybox({
|
||||
* helpers : {
|
||||
* buttons: {
|
||||
* position : 'top'
|
||||
* }
|
||||
* }
|
||||
* });
|
||||
*
|
||||
*/
|
||||
(function ($) {
|
||||
//Shortcut for fancyBox object
|
||||
var F = $.fancybox;
|
||||
|
||||
//Add helper object
|
||||
F.helpers.buttons = {
|
||||
defaults : {
|
||||
skipSingle : false, // disables if gallery contains single image
|
||||
position : 'top', // 'top' or 'bottom'
|
||||
tpl : '<div id="fancybox-buttons"><ul><li><a class="btnPrev" title="Previous" href="javascript:;"></a></li><li><a class="btnPlay" title="Start slideshow" href="javascript:;"></a></li><li><a class="btnNext" title="Next" href="javascript:;"></a></li><li><a class="btnToggle" title="Toggle size" href="javascript:;"></a></li><li><a class="btnClose" title="Close" href="javascript:;"></a></li></ul></div>'
|
||||
},
|
||||
|
||||
list : null,
|
||||
buttons: null,
|
||||
|
||||
beforeLoad: function (opts, obj) {
|
||||
//Remove self if gallery do not have at least two items
|
||||
|
||||
if (opts.skipSingle && obj.group.length < 2) {
|
||||
obj.helpers.buttons = false;
|
||||
obj.closeBtn = true;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//Increase top margin to give space for buttons
|
||||
obj.margin[ opts.position === 'bottom' ? 2 : 0 ] += 30;
|
||||
},
|
||||
|
||||
onPlayStart: function () {
|
||||
if (this.buttons) {
|
||||
this.buttons.play.attr('title', 'Pause slideshow').addClass('btnPlayOn');
|
||||
}
|
||||
},
|
||||
|
||||
onPlayEnd: function () {
|
||||
if (this.buttons) {
|
||||
this.buttons.play.attr('title', 'Start slideshow').removeClass('btnPlayOn');
|
||||
}
|
||||
},
|
||||
|
||||
afterShow: function (opts, obj) {
|
||||
var buttons = this.buttons;
|
||||
|
||||
if (!buttons) {
|
||||
this.list = $(opts.tpl).addClass(opts.position).appendTo('body');
|
||||
|
||||
buttons = {
|
||||
prev : this.list.find('.btnPrev').click( F.prev ),
|
||||
next : this.list.find('.btnNext').click( F.next ),
|
||||
play : this.list.find('.btnPlay').click( F.play ),
|
||||
toggle : this.list.find('.btnToggle').click( F.toggle ),
|
||||
close : this.list.find('.btnClose').click( F.close )
|
||||
}
|
||||
}
|
||||
|
||||
//Prev
|
||||
if (obj.index > 0 || obj.loop) {
|
||||
buttons.prev.removeClass('btnDisabled');
|
||||
} else {
|
||||
buttons.prev.addClass('btnDisabled');
|
||||
}
|
||||
|
||||
//Next / Play
|
||||
if (obj.loop || obj.index < obj.group.length - 1) {
|
||||
buttons.next.removeClass('btnDisabled');
|
||||
buttons.play.removeClass('btnDisabled');
|
||||
|
||||
} else {
|
||||
buttons.next.addClass('btnDisabled');
|
||||
buttons.play.addClass('btnDisabled');
|
||||
}
|
||||
|
||||
this.buttons = buttons;
|
||||
|
||||
this.onUpdate(opts, obj);
|
||||
},
|
||||
|
||||
onUpdate: function (opts, obj) {
|
||||
var toggle;
|
||||
|
||||
if (!this.buttons) {
|
||||
return;
|
||||
}
|
||||
|
||||
toggle = this.buttons.toggle.removeClass('btnDisabled btnToggleOn');
|
||||
|
||||
//Size toggle button
|
||||
if (obj.canShrink) {
|
||||
toggle.addClass('btnToggleOn');
|
||||
|
||||
} else if (!obj.canExpand) {
|
||||
toggle.addClass('btnDisabled');
|
||||
}
|
||||
},
|
||||
|
||||
beforeClose: function () {
|
||||
if (this.list) {
|
||||
this.list.remove();
|
||||
}
|
||||
|
||||
this.list = null;
|
||||
this.buttons = null;
|
||||
}
|
||||
};
|
||||
|
||||
}(jQuery));
|
||||
@@ -0,0 +1,199 @@
|
||||
/*!
|
||||
* Media helper for fancyBox
|
||||
* version: 1.0.6 (Fri, 14 Jun 2013)
|
||||
* @requires fancyBox v2.0 or later
|
||||
*
|
||||
* Usage:
|
||||
* $(".fancybox").fancybox({
|
||||
* helpers : {
|
||||
* media: true
|
||||
* }
|
||||
* });
|
||||
*
|
||||
* Set custom URL parameters:
|
||||
* $(".fancybox").fancybox({
|
||||
* helpers : {
|
||||
* media: {
|
||||
* youtube : {
|
||||
* params : {
|
||||
* autoplay : 0
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
* });
|
||||
*
|
||||
* Or:
|
||||
* $(".fancybox").fancybox({,
|
||||
* helpers : {
|
||||
* media: true
|
||||
* },
|
||||
* youtube : {
|
||||
* autoplay: 0
|
||||
* }
|
||||
* });
|
||||
*
|
||||
* Supports:
|
||||
*
|
||||
* Youtube
|
||||
* http://www.youtube.com/watch?v=opj24KnzrWo
|
||||
* http://www.youtube.com/embed/opj24KnzrWo
|
||||
* http://youtu.be/opj24KnzrWo
|
||||
* http://www.youtube-nocookie.com/embed/opj24KnzrWo
|
||||
* Vimeo
|
||||
* http://vimeo.com/40648169
|
||||
* http://vimeo.com/channels/staffpicks/38843628
|
||||
* http://vimeo.com/groups/surrealism/videos/36516384
|
||||
* http://player.vimeo.com/video/45074303
|
||||
* Metacafe
|
||||
* http://www.metacafe.com/watch/7635964/dr_seuss_the_lorax_movie_trailer/
|
||||
* http://www.metacafe.com/watch/7635964/
|
||||
* Dailymotion
|
||||
* http://www.dailymotion.com/video/xoytqh_dr-seuss-the-lorax-premiere_people
|
||||
* Twitvid
|
||||
* http://twitvid.com/QY7MD
|
||||
* Twitpic
|
||||
* http://twitpic.com/7p93st
|
||||
* Instagram
|
||||
* http://instagr.am/p/IejkuUGxQn/
|
||||
* http://instagram.com/p/IejkuUGxQn/
|
||||
* Google maps
|
||||
* http://maps.google.com/maps?q=Eiffel+Tower,+Avenue+Gustave+Eiffel,+Paris,+France&t=h&z=17
|
||||
* http://maps.google.com/?ll=48.857995,2.294297&spn=0.007666,0.021136&t=m&z=16
|
||||
* http://maps.google.com/?ll=48.859463,2.292626&spn=0.000965,0.002642&t=m&z=19&layer=c&cbll=48.859524,2.292532&panoid=YJ0lq28OOy3VT2IqIuVY0g&cbp=12,151.58,,0,-15.56
|
||||
*/
|
||||
(function ($) {
|
||||
"use strict";
|
||||
|
||||
//Shortcut for fancyBox object
|
||||
var F = $.fancybox,
|
||||
format = function( url, rez, params ) {
|
||||
params = params || '';
|
||||
|
||||
if ( $.type( params ) === "object" ) {
|
||||
params = $.param(params, true);
|
||||
}
|
||||
|
||||
$.each(rez, function(key, value) {
|
||||
url = url.replace( '$' + key, value || '' );
|
||||
});
|
||||
|
||||
if (params.length) {
|
||||
url += ( url.indexOf('?') > 0 ? '&' : '?' ) + params;
|
||||
}
|
||||
|
||||
return url;
|
||||
};
|
||||
|
||||
//Add helper object
|
||||
F.helpers.media = {
|
||||
defaults : {
|
||||
youtube : {
|
||||
matcher : /(youtube\.com|youtu\.be|youtube-nocookie\.com)\/(watch\?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*)).*/i,
|
||||
params : {
|
||||
autoplay : 1,
|
||||
autohide : 1,
|
||||
fs : 1,
|
||||
rel : 0,
|
||||
hd : 1,
|
||||
wmode : 'opaque',
|
||||
enablejsapi : 1
|
||||
},
|
||||
type : 'iframe',
|
||||
url : '//www.youtube.com/embed/$3'
|
||||
},
|
||||
vimeo : {
|
||||
matcher : /(?:vimeo(?:pro)?.com)\/(?:[^\d]+)?(\d+)(?:.*)/,
|
||||
params : {
|
||||
autoplay : 1,
|
||||
hd : 1,
|
||||
show_title : 1,
|
||||
show_byline : 1,
|
||||
show_portrait : 0,
|
||||
fullscreen : 1
|
||||
},
|
||||
type : 'iframe',
|
||||
url : '//player.vimeo.com/video/$1'
|
||||
},
|
||||
metacafe : {
|
||||
matcher : /metacafe.com\/(?:watch|fplayer)\/([\w\-]{1,10})/,
|
||||
params : {
|
||||
autoPlay : 'yes'
|
||||
},
|
||||
type : 'swf',
|
||||
url : function( rez, params, obj ) {
|
||||
obj.swf.flashVars = 'playerVars=' + $.param( params, true );
|
||||
|
||||
return '//www.metacafe.com/fplayer/' + rez[1] + '/.swf';
|
||||
}
|
||||
},
|
||||
dailymotion : {
|
||||
matcher : /dailymotion.com\/video\/(.*)\/?(.*)/,
|
||||
params : {
|
||||
additionalInfos : 0,
|
||||
autoStart : 1
|
||||
},
|
||||
type : 'swf',
|
||||
url : '//www.dailymotion.com/swf/video/$1'
|
||||
},
|
||||
twitvid : {
|
||||
matcher : /twitvid\.com\/([a-zA-Z0-9_\-\?\=]+)/i,
|
||||
params : {
|
||||
autoplay : 0
|
||||
},
|
||||
type : 'iframe',
|
||||
url : '//www.twitvid.com/embed.php?guid=$1'
|
||||
},
|
||||
twitpic : {
|
||||
matcher : /twitpic\.com\/(?!(?:place|photos|events)\/)([a-zA-Z0-9\?\=\-]+)/i,
|
||||
type : 'image',
|
||||
url : '//twitpic.com/show/full/$1/'
|
||||
},
|
||||
instagram : {
|
||||
matcher : /(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i,
|
||||
type : 'image',
|
||||
url : '//$1/p/$2/media/?size=l'
|
||||
},
|
||||
google_maps : {
|
||||
matcher : /maps\.google\.([a-z]{2,3}(\.[a-z]{2})?)\/(\?ll=|maps\?)(.*)/i,
|
||||
type : 'iframe',
|
||||
url : function( rez ) {
|
||||
return '//maps.google.' + rez[1] + '/' + rez[3] + '' + rez[4] + '&output=' + (rez[4].indexOf('layer=c') > 0 ? 'svembed' : 'embed');
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
beforeLoad : function(opts, obj) {
|
||||
var url = obj.href || '',
|
||||
type = false,
|
||||
what,
|
||||
item,
|
||||
rez,
|
||||
params;
|
||||
|
||||
for (what in opts) {
|
||||
if (opts.hasOwnProperty(what)) {
|
||||
item = opts[ what ];
|
||||
rez = url.match( item.matcher );
|
||||
|
||||
if (rez) {
|
||||
type = item.type;
|
||||
params = $.extend(true, {}, item.params, obj[ what ] || ($.isPlainObject(opts[ what ]) ? opts[ what ].params : null));
|
||||
|
||||
url = $.type( item.url ) === "function" ? item.url.call( this, rez, params, obj ) : format( item.url, rez, params );
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (type) {
|
||||
obj.href = url;
|
||||
obj.type = type;
|
||||
|
||||
obj.autoHeight = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
}(jQuery));
|
||||
@@ -0,0 +1,162 @@
|
||||
/*!
|
||||
* Thumbnail helper for fancyBox
|
||||
* version: 1.0.7 (Mon, 01 Oct 2012)
|
||||
* @requires fancyBox v2.0 or later
|
||||
*
|
||||
* Usage:
|
||||
* $(".fancybox").fancybox({
|
||||
* helpers : {
|
||||
* thumbs: {
|
||||
* width : 50,
|
||||
* height : 50
|
||||
* }
|
||||
* }
|
||||
* });
|
||||
*
|
||||
*/
|
||||
(function ($) {
|
||||
//Shortcut for fancyBox object
|
||||
var F = $.fancybox;
|
||||
|
||||
//Add helper object
|
||||
F.helpers.thumbs = {
|
||||
defaults : {
|
||||
width : 50, // thumbnail width
|
||||
height : 50, // thumbnail height
|
||||
position : 'bottom', // 'top' or 'bottom'
|
||||
source : function ( item ) { // function to obtain the URL of the thumbnail image
|
||||
var href;
|
||||
|
||||
if (item.element) {
|
||||
href = $(item.element).find('img').attr('src');
|
||||
}
|
||||
|
||||
if (!href && item.type === 'image' && item.href) {
|
||||
href = item.href;
|
||||
}
|
||||
|
||||
return href;
|
||||
}
|
||||
},
|
||||
|
||||
wrap : null,
|
||||
list : null,
|
||||
width : 0,
|
||||
|
||||
init: function (opts, obj) {
|
||||
var that = this,
|
||||
list,
|
||||
thumbWidth = opts.width,
|
||||
thumbHeight = opts.height,
|
||||
thumbSource = opts.source;
|
||||
|
||||
//Build list structure
|
||||
list = '';
|
||||
|
||||
for (var n = 0; n < obj.group.length; n++) {
|
||||
list += '<li><a style="width:' + thumbWidth + 'px;height:' + thumbHeight + 'px;" href="javascript:jQuery.fancybox.jumpto(' + n + ');"></a></li>';
|
||||
}
|
||||
|
||||
this.wrap = $('<div id="fancybox-thumbs"></div>').addClass(opts.position).appendTo('body');
|
||||
this.list = $('<ul>' + list + '</ul>').appendTo(this.wrap);
|
||||
|
||||
//Load each thumbnail
|
||||
$.each(obj.group, function (i) {
|
||||
var href = thumbSource( obj.group[ i ] );
|
||||
|
||||
if (!href) {
|
||||
return;
|
||||
}
|
||||
|
||||
$("<img />").load(function () {
|
||||
var width = this.width,
|
||||
height = this.height,
|
||||
widthRatio, heightRatio, parent;
|
||||
|
||||
if (!that.list || !width || !height) {
|
||||
return;
|
||||
}
|
||||
|
||||
//Calculate thumbnail width/height and center it
|
||||
widthRatio = width / thumbWidth;
|
||||
heightRatio = height / thumbHeight;
|
||||
|
||||
parent = that.list.children().eq(i).find('a');
|
||||
|
||||
if (widthRatio >= 1 && heightRatio >= 1) {
|
||||
if (widthRatio > heightRatio) {
|
||||
width = Math.floor(width / heightRatio);
|
||||
height = thumbHeight;
|
||||
|
||||
} else {
|
||||
width = thumbWidth;
|
||||
height = Math.floor(height / widthRatio);
|
||||
}
|
||||
}
|
||||
|
||||
$(this).css({
|
||||
width : width,
|
||||
height : height,
|
||||
top : Math.floor(thumbHeight / 2 - height / 2),
|
||||
left : Math.floor(thumbWidth / 2 - width / 2)
|
||||
});
|
||||
|
||||
parent.width(thumbWidth).height(thumbHeight);
|
||||
|
||||
$(this).hide().appendTo(parent).fadeIn(300);
|
||||
|
||||
}).attr('src', href);
|
||||
});
|
||||
|
||||
//Set initial width
|
||||
this.width = this.list.children().eq(0).outerWidth(true);
|
||||
|
||||
this.list.width(this.width * (obj.group.length + 1)).css('left', Math.floor($(window).width() * 0.5 - (obj.index * this.width + this.width * 0.5)));
|
||||
},
|
||||
|
||||
beforeLoad: function (opts, obj) {
|
||||
//Remove self if gallery do not have at least two items
|
||||
if (obj.group.length < 2) {
|
||||
obj.helpers.thumbs = false;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//Increase bottom margin to give space for thumbs
|
||||
obj.margin[ opts.position === 'top' ? 0 : 2 ] += ((opts.height) + 15);
|
||||
},
|
||||
|
||||
afterShow: function (opts, obj) {
|
||||
//Check if exists and create or update list
|
||||
if (this.list) {
|
||||
this.onUpdate(opts, obj);
|
||||
|
||||
} else {
|
||||
this.init(opts, obj);
|
||||
}
|
||||
|
||||
//Set active element
|
||||
this.list.children().removeClass('active').eq(obj.index).addClass('active');
|
||||
},
|
||||
|
||||
//Center list
|
||||
onUpdate: function (opts, obj) {
|
||||
if (this.list) {
|
||||
this.list.stop(true).animate({
|
||||
'left': Math.floor($(window).width() * 0.5 - (obj.index * this.width + this.width * 0.5))
|
||||
}, 150);
|
||||
}
|
||||
},
|
||||
|
||||
beforeClose: function () {
|
||||
if (this.wrap) {
|
||||
this.wrap.remove();
|
||||
}
|
||||
|
||||
this.wrap = null;
|
||||
this.list = null;
|
||||
this.width = 0;
|
||||
}
|
||||
}
|
||||
|
||||
}(jQuery));
|
||||
@@ -0,0 +1,2023 @@
|
||||
/*!
|
||||
* fancyBox - jQuery Plugin
|
||||
* version: 2.1.5 (Fri, 14 Jun 2013)
|
||||
* @requires jQuery v1.6 or later
|
||||
*
|
||||
* Examples at http://fancyapps.com/fancybox/
|
||||
* License: www.fancyapps.com/fancybox/#license
|
||||
*
|
||||
* Copyright 2012 Janis Skarnelis - [email protected]
|
||||
*
|
||||
*/
|
||||
|
||||
(function (window, document, $, undefined) {
|
||||
"use strict";
|
||||
|
||||
var H = $("html"),
|
||||
W = $(window),
|
||||
D = $(document),
|
||||
F = $.fancybox = function () {
|
||||
F.open.apply( this, arguments );
|
||||
},
|
||||
IE = navigator.userAgent.match(/msie/i),
|
||||
didUpdate = null,
|
||||
isTouch = document.createTouch !== undefined,
|
||||
|
||||
isQuery = function(obj) {
|
||||
return obj && obj.hasOwnProperty && obj instanceof $;
|
||||
},
|
||||
isString = function(str) {
|
||||
return str && $.type(str) === "string";
|
||||
},
|
||||
isPercentage = function(str) {
|
||||
return isString(str) && str.indexOf('%') > 0;
|
||||
},
|
||||
isScrollable = function(el) {
|
||||
return (el && !(el.style.overflow && el.style.overflow === 'hidden') && ((el.clientWidth && el.scrollWidth > el.clientWidth) || (el.clientHeight && el.scrollHeight > el.clientHeight)));
|
||||
},
|
||||
getScalar = function(orig, dim) {
|
||||
var value = parseInt(orig, 10) || 0;
|
||||
|
||||
if (dim && isPercentage(orig)) {
|
||||
value = F.getViewport()[ dim ] / 100 * value;
|
||||
}
|
||||
|
||||
return Math.ceil(value);
|
||||
},
|
||||
getValue = function(value, dim) {
|
||||
return getScalar(value, dim) + 'px';
|
||||
};
|
||||
|
||||
$.extend(F, {
|
||||
// The current version of fancyBox
|
||||
version: '2.1.5',
|
||||
|
||||
defaults: {
|
||||
padding : 15,
|
||||
margin : 20,
|
||||
|
||||
width : 800,
|
||||
height : 600,
|
||||
minWidth : 100,
|
||||
minHeight : 100,
|
||||
maxWidth : 9999,
|
||||
maxHeight : 9999,
|
||||
pixelRatio: 1, // Set to 2 for retina display support
|
||||
|
||||
autoSize : true,
|
||||
autoHeight : false,
|
||||
autoWidth : false,
|
||||
|
||||
autoResize : true,
|
||||
autoCenter : !isTouch,
|
||||
fitToView : true,
|
||||
aspectRatio : false,
|
||||
topRatio : 0.5,
|
||||
leftRatio : 0.5,
|
||||
|
||||
scrolling : 'auto', // 'auto', 'yes' or 'no'
|
||||
wrapCSS : '',
|
||||
|
||||
arrows : true,
|
||||
closeBtn : true,
|
||||
closeClick : false,
|
||||
nextClick : false,
|
||||
mouseWheel : true,
|
||||
autoPlay : false,
|
||||
playSpeed : 3000,
|
||||
preload : 3,
|
||||
modal : false,
|
||||
loop : true,
|
||||
|
||||
ajax : {
|
||||
dataType : 'html',
|
||||
headers : { 'X-fancyBox': true }
|
||||
},
|
||||
iframe : {
|
||||
scrolling : 'auto',
|
||||
preload : true
|
||||
},
|
||||
swf : {
|
||||
wmode: 'transparent',
|
||||
allowfullscreen : 'true',
|
||||
allowscriptaccess : 'always'
|
||||
},
|
||||
|
||||
keys : {
|
||||
next : {
|
||||
13 : 'left', // enter
|
||||
34 : 'up', // page down
|
||||
39 : 'left', // right arrow
|
||||
40 : 'up' // down arrow
|
||||
},
|
||||
prev : {
|
||||
8 : 'right', // backspace
|
||||
33 : 'down', // page up
|
||||
37 : 'right', // left arrow
|
||||
38 : 'down' // up arrow
|
||||
},
|
||||
close : [27], // escape key
|
||||
play : [32], // space - start/stop slideshow
|
||||
toggle : [70] // letter "f" - toggle fullscreen
|
||||
},
|
||||
|
||||
direction : {
|
||||
next : 'left',
|
||||
prev : 'right'
|
||||
},
|
||||
|
||||
scrollOutside : true,
|
||||
|
||||
// Override some properties
|
||||
index : 0,
|
||||
type : null,
|
||||
href : null,
|
||||
content : null,
|
||||
title : null,
|
||||
|
||||
// HTML templates
|
||||
tpl: {
|
||||
wrap : '<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>',
|
||||
image : '<img class="fancybox-image" src="{href}" alt="" />',
|
||||
iframe : '<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen' + (IE ? ' allowtransparency="true"' : '') + '></iframe>',
|
||||
error : '<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>',
|
||||
closeBtn : '<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"></a>',
|
||||
next : '<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>',
|
||||
prev : '<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>'
|
||||
},
|
||||
|
||||
// Properties for each animation type
|
||||
// Opening fancyBox
|
||||
openEffect : 'fade', // 'elastic', 'fade' or 'none'
|
||||
openSpeed : 250,
|
||||
openEasing : 'swing',
|
||||
openOpacity : true,
|
||||
openMethod : 'zoomIn',
|
||||
|
||||
// Closing fancyBox
|
||||
closeEffect : 'fade', // 'elastic', 'fade' or 'none'
|
||||
closeSpeed : 250,
|
||||
closeEasing : 'swing',
|
||||
closeOpacity : true,
|
||||
closeMethod : 'zoomOut',
|
||||
|
||||
// Changing next gallery item
|
||||
nextEffect : 'elastic', // 'elastic', 'fade' or 'none'
|
||||
nextSpeed : 250,
|
||||
nextEasing : 'swing',
|
||||
nextMethod : 'changeIn',
|
||||
|
||||
// Changing previous gallery item
|
||||
prevEffect : 'elastic', // 'elastic', 'fade' or 'none'
|
||||
prevSpeed : 250,
|
||||
prevEasing : 'swing',
|
||||
prevMethod : 'changeOut',
|
||||
|
||||
// Enable default helpers
|
||||
helpers : {
|
||||
overlay : true,
|
||||
title : true
|
||||
},
|
||||
|
||||
// Callbacks
|
||||
onCancel : $.noop, // If canceling
|
||||
beforeLoad : $.noop, // Before loading
|
||||
afterLoad : $.noop, // After loading
|
||||
beforeShow : $.noop, // Before changing in current item
|
||||
afterShow : $.noop, // After opening
|
||||
beforeChange : $.noop, // Before changing gallery item
|
||||
beforeClose : $.noop, // Before closing
|
||||
afterClose : $.noop // After closing
|
||||
},
|
||||
|
||||
//Current state
|
||||
group : {}, // Selected group
|
||||
opts : {}, // Group options
|
||||
previous : null, // Previous element
|
||||
coming : null, // Element being loaded
|
||||
current : null, // Currently loaded element
|
||||
isActive : false, // Is activated
|
||||
isOpen : false, // Is currently open
|
||||
isOpened : false, // Have been fully opened at least once
|
||||
|
||||
wrap : null,
|
||||
skin : null,
|
||||
outer : null,
|
||||
inner : null,
|
||||
|
||||
player : {
|
||||
timer : null,
|
||||
isActive : false
|
||||
},
|
||||
|
||||
// Loaders
|
||||
ajaxLoad : null,
|
||||
imgPreload : null,
|
||||
|
||||
// Some collections
|
||||
transitions : {},
|
||||
helpers : {},
|
||||
|
||||
/*
|
||||
* Static methods
|
||||
*/
|
||||
|
||||
open: function (group, opts) {
|
||||
if (!group) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$.isPlainObject(opts)) {
|
||||
opts = {};
|
||||
}
|
||||
|
||||
// Close if already active
|
||||
if (false === F.close(true)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Normalize group
|
||||
if (!$.isArray(group)) {
|
||||
group = isQuery(group) ? $(group).get() : [group];
|
||||
}
|
||||
|
||||
// Recheck if the type of each element is `object` and set content type (image, ajax, etc)
|
||||
$.each(group, function(i, element) {
|
||||
var obj = {},
|
||||
href,
|
||||
title,
|
||||
content,
|
||||
type,
|
||||
rez,
|
||||
hrefParts,
|
||||
selector;
|
||||
|
||||
if ($.type(element) === "object") {
|
||||
// Check if is DOM element
|
||||
if (element.nodeType) {
|
||||
element = $(element);
|
||||
}
|
||||
|
||||
if (isQuery(element)) {
|
||||
obj = {
|
||||
href : element.data('fancybox-href') || element.attr('href'),
|
||||
title : element.data('fancybox-title') || element.attr('title'),
|
||||
isDom : true,
|
||||
element : element
|
||||
};
|
||||
|
||||
if ($.metadata) {
|
||||
$.extend(true, obj, element.metadata());
|
||||
}
|
||||
|
||||
} else {
|
||||
obj = element;
|
||||
}
|
||||
}
|
||||
|
||||
href = opts.href || obj.href || (isString(element) ? element : null);
|
||||
title = opts.title !== undefined ? opts.title : obj.title || '';
|
||||
|
||||
content = opts.content || obj.content;
|
||||
type = content ? 'html' : (opts.type || obj.type);
|
||||
|
||||
if (!type && obj.isDom) {
|
||||
type = element.data('fancybox-type');
|
||||
|
||||
if (!type) {
|
||||
rez = element.prop('class').match(/fancybox\.(\w+)/);
|
||||
type = rez ? rez[1] : null;
|
||||
}
|
||||
}
|
||||
|
||||
if (isString(href)) {
|
||||
// Try to guess the content type
|
||||
if (!type) {
|
||||
if (F.isImage(href)) {
|
||||
type = 'image';
|
||||
|
||||
} else if (F.isSWF(href)) {
|
||||
type = 'swf';
|
||||
|
||||
} else if (href.charAt(0) === '#') {
|
||||
type = 'inline';
|
||||
|
||||
} else if (isString(element)) {
|
||||
type = 'html';
|
||||
content = element;
|
||||
}
|
||||
}
|
||||
|
||||
// Split url into two pieces with source url and content selector, e.g,
|
||||
// "/mypage.html #my_id" will load "/mypage.html" and display element having id "my_id"
|
||||
if (type === 'ajax') {
|
||||
hrefParts = href.split(/\s+/, 2);
|
||||
href = hrefParts.shift();
|
||||
selector = hrefParts.shift();
|
||||
}
|
||||
}
|
||||
|
||||
if (!content) {
|
||||
if (type === 'inline') {
|
||||
if (href) {
|
||||
content = $( isString(href) ? href.replace(/.*(?=#[^\s]+$)/, '') : href ); //strip for ie7
|
||||
|
||||
} else if (obj.isDom) {
|
||||
content = element;
|
||||
}
|
||||
|
||||
} else if (type === 'html') {
|
||||
content = href;
|
||||
|
||||
} else if (!type && !href && obj.isDom) {
|
||||
type = 'inline';
|
||||
content = element;
|
||||
}
|
||||
}
|
||||
|
||||
$.extend(obj, {
|
||||
href : href,
|
||||
type : type,
|
||||
content : content,
|
||||
title : title,
|
||||
selector : selector
|
||||
});
|
||||
|
||||
group[ i ] = obj;
|
||||
});
|
||||
|
||||
// Extend the defaults
|
||||
F.opts = $.extend(true, {}, F.defaults, opts);
|
||||
|
||||
// All options are merged recursive except keys
|
||||
if (opts.keys !== undefined) {
|
||||
F.opts.keys = opts.keys ? $.extend({}, F.defaults.keys, opts.keys) : false;
|
||||
}
|
||||
|
||||
F.group = group;
|
||||
|
||||
return F._start(F.opts.index);
|
||||
},
|
||||
|
||||
// Cancel image loading or abort ajax request
|
||||
cancel: function () {
|
||||
var coming = F.coming;
|
||||
|
||||
if (!coming || false === F.trigger('onCancel')) {
|
||||
return;
|
||||
}
|
||||
|
||||
F.hideLoading();
|
||||
|
||||
if (F.ajaxLoad) {
|
||||
F.ajaxLoad.abort();
|
||||
}
|
||||
|
||||
F.ajaxLoad = null;
|
||||
|
||||
if (F.imgPreload) {
|
||||
F.imgPreload.onload = F.imgPreload.onerror = null;
|
||||
}
|
||||
|
||||
if (coming.wrap) {
|
||||
coming.wrap.stop(true, true).trigger('onReset').remove();
|
||||
}
|
||||
|
||||
F.coming = null;
|
||||
|
||||
// If the first item has been canceled, then clear everything
|
||||
if (!F.current) {
|
||||
F._afterZoomOut( coming );
|
||||
}
|
||||
},
|
||||
|
||||
// Start closing animation if is open; remove immediately if opening/closing
|
||||
close: function (event) {
|
||||
F.cancel();
|
||||
|
||||
if (false === F.trigger('beforeClose')) {
|
||||
return;
|
||||
}
|
||||
|
||||
F.unbindEvents();
|
||||
|
||||
if (!F.isActive) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!F.isOpen || event === true) {
|
||||
$('.fancybox-wrap').stop(true).trigger('onReset').remove();
|
||||
|
||||
F._afterZoomOut();
|
||||
|
||||
} else {
|
||||
F.isOpen = F.isOpened = false;
|
||||
F.isClosing = true;
|
||||
|
||||
$('.fancybox-item, .fancybox-nav').remove();
|
||||
|
||||
F.wrap.stop(true, true).removeClass('fancybox-opened');
|
||||
|
||||
F.transitions[ F.current.closeMethod ]();
|
||||
}
|
||||
},
|
||||
|
||||
// Manage slideshow:
|
||||
// $.fancybox.play(); - toggle slideshow
|
||||
// $.fancybox.play( true ); - start
|
||||
// $.fancybox.play( false ); - stop
|
||||
play: function ( action ) {
|
||||
var clear = function () {
|
||||
clearTimeout(F.player.timer);
|
||||
},
|
||||
set = function () {
|
||||
clear();
|
||||
|
||||
if (F.current && F.player.isActive) {
|
||||
F.player.timer = setTimeout(F.next, F.current.playSpeed);
|
||||
}
|
||||
},
|
||||
stop = function () {
|
||||
clear();
|
||||
|
||||
D.unbind('.player');
|
||||
|
||||
F.player.isActive = false;
|
||||
|
||||
F.trigger('onPlayEnd');
|
||||
},
|
||||
start = function () {
|
||||
if (F.current && (F.current.loop || F.current.index < F.group.length - 1)) {
|
||||
F.player.isActive = true;
|
||||
|
||||
D.bind({
|
||||
'onCancel.player beforeClose.player' : stop,
|
||||
'onUpdate.player' : set,
|
||||
'beforeLoad.player' : clear
|
||||
});
|
||||
|
||||
set();
|
||||
|
||||
F.trigger('onPlayStart');
|
||||
}
|
||||
};
|
||||
|
||||
if (action === true || (!F.player.isActive && action !== false)) {
|
||||
start();
|
||||
} else {
|
||||
stop();
|
||||
}
|
||||
},
|
||||
|
||||
// Navigate to next gallery item
|
||||
next: function ( direction ) {
|
||||
var current = F.current;
|
||||
|
||||
if (current) {
|
||||
if (!isString(direction)) {
|
||||
direction = current.direction.next;
|
||||
}
|
||||
|
||||
F.jumpto(current.index + 1, direction, 'next');
|
||||
}
|
||||
},
|
||||
|
||||
// Navigate to previous gallery item
|
||||
prev: function ( direction ) {
|
||||
var current = F.current;
|
||||
|
||||
if (current) {
|
||||
if (!isString(direction)) {
|
||||
direction = current.direction.prev;
|
||||
}
|
||||
|
||||
F.jumpto(current.index - 1, direction, 'prev');
|
||||
}
|
||||
},
|
||||
|
||||
// Navigate to gallery item by index
|
||||
jumpto: function ( index, direction, router ) {
|
||||
var current = F.current;
|
||||
|
||||
if (!current) {
|
||||
return;
|
||||
}
|
||||
|
||||
index = getScalar(index);
|
||||
|
||||
F.direction = direction || current.direction[ (index >= current.index ? 'next' : 'prev') ];
|
||||
F.router = router || 'jumpto';
|
||||
|
||||
if (current.loop) {
|
||||
if (index < 0) {
|
||||
index = current.group.length + (index % current.group.length);
|
||||
}
|
||||
|
||||
index = index % current.group.length;
|
||||
}
|
||||
|
||||
if (current.group[ index ] !== undefined) {
|
||||
F.cancel();
|
||||
|
||||
F._start(index);
|
||||
}
|
||||
},
|
||||
|
||||
// Center inside viewport and toggle position type to fixed or absolute if needed
|
||||
reposition: function (e, onlyAbsolute) {
|
||||
var current = F.current,
|
||||
wrap = current ? current.wrap : null,
|
||||
pos;
|
||||
|
||||
if (wrap) {
|
||||
pos = F._getPosition(onlyAbsolute);
|
||||
|
||||
if (e && e.type === 'scroll') {
|
||||
delete pos.position;
|
||||
|
||||
wrap.stop(true, true).animate(pos, 200);
|
||||
|
||||
} else {
|
||||
wrap.css(pos);
|
||||
|
||||
current.pos = $.extend({}, current.dim, pos);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
update: function (e) {
|
||||
var type = (e && e.type),
|
||||
anyway = !type || type === 'orientationchange';
|
||||
|
||||
if (anyway) {
|
||||
clearTimeout(didUpdate);
|
||||
|
||||
didUpdate = null;
|
||||
}
|
||||
|
||||
if (!F.isOpen || didUpdate) {
|
||||
return;
|
||||
}
|
||||
|
||||
didUpdate = setTimeout(function() {
|
||||
var current = F.current;
|
||||
|
||||
if (!current || F.isClosing) {
|
||||
return;
|
||||
}
|
||||
|
||||
F.wrap.removeClass('fancybox-tmp');
|
||||
|
||||
if (anyway || type === 'load' || (type === 'resize' && current.autoResize)) {
|
||||
F._setDimension();
|
||||
}
|
||||
|
||||
if (!(type === 'scroll' && current.canShrink)) {
|
||||
F.reposition(e);
|
||||
}
|
||||
|
||||
F.trigger('onUpdate');
|
||||
|
||||
didUpdate = null;
|
||||
|
||||
}, (anyway && !isTouch ? 0 : 300));
|
||||
},
|
||||
|
||||
// Shrink content to fit inside viewport or restore if resized
|
||||
toggle: function ( action ) {
|
||||
if (F.isOpen) {
|
||||
F.current.fitToView = $.type(action) === "boolean" ? action : !F.current.fitToView;
|
||||
|
||||
// Help browser to restore document dimensions
|
||||
if (isTouch) {
|
||||
F.wrap.removeAttr('style').addClass('fancybox-tmp');
|
||||
|
||||
F.trigger('onUpdate');
|
||||
}
|
||||
|
||||
F.update();
|
||||
}
|
||||
},
|
||||
|
||||
hideLoading: function () {
|
||||
D.unbind('.loading');
|
||||
|
||||
$('#fancybox-loading').remove();
|
||||
},
|
||||
|
||||
showLoading: function () {
|
||||
var el, viewport;
|
||||
|
||||
F.hideLoading();
|
||||
|
||||
el = $('<div id="fancybox-loading"><div></div></div>').click(F.cancel).appendTo('body');
|
||||
|
||||
// If user will press the escape-button, the request will be canceled
|
||||
D.bind('keydown.loading', function(e) {
|
||||
if ((e.which || e.keyCode) === 27) {
|
||||
e.preventDefault();
|
||||
|
||||
F.cancel();
|
||||
}
|
||||
});
|
||||
|
||||
if (!F.defaults.fixed) {
|
||||
viewport = F.getViewport();
|
||||
|
||||
el.css({
|
||||
position : 'absolute',
|
||||
top : (viewport.h * 0.5) + viewport.y,
|
||||
left : (viewport.w * 0.5) + viewport.x
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
getViewport: function () {
|
||||
var locked = (F.current && F.current.locked) || false,
|
||||
rez = {
|
||||
x: W.scrollLeft(),
|
||||
y: W.scrollTop()
|
||||
};
|
||||
|
||||
if (locked) {
|
||||
rez.w = locked[0].clientWidth;
|
||||
rez.h = locked[0].clientHeight;
|
||||
|
||||
} else {
|
||||
// See http://bugs.jquery.com/ticket/6724
|
||||
rez.w = isTouch && window.innerWidth ? window.innerWidth : W.width();
|
||||
rez.h = isTouch && window.innerHeight ? window.innerHeight : W.height();
|
||||
}
|
||||
|
||||
return rez;
|
||||
},
|
||||
|
||||
// Unbind the keyboard / clicking actions
|
||||
unbindEvents: function () {
|
||||
if (F.wrap && isQuery(F.wrap)) {
|
||||
F.wrap.unbind('.fb');
|
||||
}
|
||||
|
||||
D.unbind('.fb');
|
||||
W.unbind('.fb');
|
||||
},
|
||||
|
||||
bindEvents: function () {
|
||||
var current = F.current,
|
||||
keys;
|
||||
|
||||
if (!current) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Changing document height on iOS devices triggers a 'resize' event,
|
||||
// that can change document height... repeating infinitely
|
||||
W.bind('orientationchange.fb' + (isTouch ? '' : ' resize.fb') + (current.autoCenter && !current.locked ? ' scroll.fb' : ''), F.update);
|
||||
|
||||
keys = current.keys;
|
||||
|
||||
if (keys) {
|
||||
D.bind('keydown.fb', function (e) {
|
||||
var code = e.which || e.keyCode,
|
||||
target = e.target || e.srcElement;
|
||||
|
||||
// Skip esc key if loading, because showLoading will cancel preloading
|
||||
if (code === 27 && F.coming) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Ignore key combinations and key events within form elements
|
||||
if (!e.ctrlKey && !e.altKey && !e.shiftKey && !e.metaKey && !(target && (target.type || $(target).is('[contenteditable]')))) {
|
||||
$.each(keys, function(i, val) {
|
||||
if (current.group.length > 1 && val[ code ] !== undefined) {
|
||||
F[ i ]( val[ code ] );
|
||||
|
||||
e.preventDefault();
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($.inArray(code, val) > -1) {
|
||||
F[ i ] ();
|
||||
|
||||
e.preventDefault();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if ($.fn.mousewheel && current.mouseWheel) {
|
||||
F.wrap.bind('mousewheel.fb', function (e, delta, deltaX, deltaY) {
|
||||
var target = e.target || null,
|
||||
parent = $(target),
|
||||
canScroll = false;
|
||||
|
||||
while (parent.length) {
|
||||
if (canScroll || parent.is('.fancybox-skin') || parent.is('.fancybox-wrap')) {
|
||||
break;
|
||||
}
|
||||
|
||||
canScroll = isScrollable( parent[0] );
|
||||
parent = $(parent).parent();
|
||||
}
|
||||
|
||||
if (delta !== 0 && !canScroll) {
|
||||
if (F.group.length > 1 && !current.canShrink) {
|
||||
if (deltaY > 0 || deltaX > 0) {
|
||||
F.prev( deltaY > 0 ? 'down' : 'left' );
|
||||
|
||||
} else if (deltaY < 0 || deltaX < 0) {
|
||||
F.next( deltaY < 0 ? 'up' : 'right' );
|
||||
}
|
||||
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
trigger: function (event, o) {
|
||||
var ret, obj = o || F.coming || F.current;
|
||||
|
||||
if (!obj) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($.isFunction( obj[event] )) {
|
||||
ret = obj[event].apply(obj, Array.prototype.slice.call(arguments, 1));
|
||||
}
|
||||
|
||||
if (ret === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (obj.helpers) {
|
||||
$.each(obj.helpers, function (helper, opts) {
|
||||
if (opts && F.helpers[helper] && $.isFunction(F.helpers[helper][event])) {
|
||||
F.helpers[helper][event]($.extend(true, {}, F.helpers[helper].defaults, opts), obj);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
D.trigger(event);
|
||||
},
|
||||
|
||||
isImage: function (str) {
|
||||
return isString(str) && str.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i);
|
||||
},
|
||||
|
||||
isSWF: function (str) {
|
||||
return isString(str) && str.match(/\.(swf)((\?|#).*)?$/i);
|
||||
},
|
||||
|
||||
_start: function (index) {
|
||||
var coming = {},
|
||||
obj,
|
||||
href,
|
||||
type,
|
||||
margin,
|
||||
padding;
|
||||
|
||||
index = getScalar( index );
|
||||
obj = F.group[ index ] || null;
|
||||
|
||||
if (!obj) {
|
||||
return false;
|
||||
}
|
||||
|
||||
coming = $.extend(true, {}, F.opts, obj);
|
||||
|
||||
// Convert margin and padding properties to array - top, right, bottom, left
|
||||
margin = coming.margin;
|
||||
padding = coming.padding;
|
||||
|
||||
if ($.type(margin) === 'number') {
|
||||
coming.margin = [margin, margin, margin, margin];
|
||||
}
|
||||
|
||||
if ($.type(padding) === 'number') {
|
||||
coming.padding = [padding, padding, padding, padding];
|
||||
}
|
||||
|
||||
// 'modal' propery is just a shortcut
|
||||
if (coming.modal) {
|
||||
$.extend(true, coming, {
|
||||
closeBtn : false,
|
||||
closeClick : false,
|
||||
nextClick : false,
|
||||
arrows : false,
|
||||
mouseWheel : false,
|
||||
keys : null,
|
||||
helpers: {
|
||||
overlay : {
|
||||
closeClick : false
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 'autoSize' property is a shortcut, too
|
||||
if (coming.autoSize) {
|
||||
coming.autoWidth = coming.autoHeight = true;
|
||||
}
|
||||
|
||||
if (coming.width === 'auto') {
|
||||
coming.autoWidth = true;
|
||||
}
|
||||
|
||||
if (coming.height === 'auto') {
|
||||
coming.autoHeight = true;
|
||||
}
|
||||
|
||||
/*
|
||||
* Add reference to the group, so it`s possible to access from callbacks, example:
|
||||
* afterLoad : function() {
|
||||
* this.title = 'Image ' + (this.index + 1) + ' of ' + this.group.length + (this.title ? ' - ' + this.title : '');
|
||||
* }
|
||||
*/
|
||||
|
||||
coming.group = F.group;
|
||||
coming.index = index;
|
||||
|
||||
// Give a chance for callback or helpers to update coming item (type, title, etc)
|
||||
F.coming = coming;
|
||||
|
||||
if (false === F.trigger('beforeLoad')) {
|
||||
F.coming = null;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
type = coming.type;
|
||||
href = coming.href;
|
||||
|
||||
if (!type) {
|
||||
F.coming = null;
|
||||
|
||||
//If we can not determine content type then drop silently or display next/prev item if looping through gallery
|
||||
if (F.current && F.router && F.router !== 'jumpto') {
|
||||
F.current.index = index;
|
||||
|
||||
return F[ F.router ]( F.direction );
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
F.isActive = true;
|
||||
|
||||
if (type === 'image' || type === 'swf') {
|
||||
coming.autoHeight = coming.autoWidth = false;
|
||||
coming.scrolling = 'visible';
|
||||
}
|
||||
|
||||
if (type === 'image') {
|
||||
coming.aspectRatio = true;
|
||||
}
|
||||
|
||||
if (type === 'iframe' && isTouch) {
|
||||
coming.scrolling = 'scroll';
|
||||
}
|
||||
|
||||
// Build the neccessary markup
|
||||
coming.wrap = $(coming.tpl.wrap).addClass('fancybox-' + (isTouch ? 'mobile' : 'desktop') + ' fancybox-type-' + type + ' fancybox-tmp ' + coming.wrapCSS).appendTo( coming.parent || 'body' );
|
||||
|
||||
$.extend(coming, {
|
||||
skin : $('.fancybox-skin', coming.wrap),
|
||||
outer : $('.fancybox-outer', coming.wrap),
|
||||
inner : $('.fancybox-inner', coming.wrap)
|
||||
});
|
||||
|
||||
$.each(["Top", "Right", "Bottom", "Left"], function(i, v) {
|
||||
coming.skin.css('padding' + v, getValue(coming.padding[ i ]));
|
||||
});
|
||||
|
||||
F.trigger('onReady');
|
||||
|
||||
// Check before try to load; 'inline' and 'html' types need content, others - href
|
||||
if (type === 'inline' || type === 'html') {
|
||||
if (!coming.content || !coming.content.length) {
|
||||
return F._error( 'content' );
|
||||
}
|
||||
|
||||
} else if (!href) {
|
||||
return F._error( 'href' );
|
||||
}
|
||||
|
||||
if (type === 'image') {
|
||||
F._loadImage();
|
||||
|
||||
} else if (type === 'ajax') {
|
||||
F._loadAjax();
|
||||
|
||||
} else if (type === 'iframe') {
|
||||
F._loadIframe();
|
||||
|
||||
} else {
|
||||
F._afterLoad();
|
||||
}
|
||||
},
|
||||
|
||||
_error: function ( type ) {
|
||||
$.extend(F.coming, {
|
||||
type : 'html',
|
||||
autoWidth : true,
|
||||
autoHeight : true,
|
||||
minWidth : 0,
|
||||
minHeight : 0,
|
||||
scrolling : 'no',
|
||||
hasError : type,
|
||||
content : F.coming.tpl.error
|
||||
});
|
||||
|
||||
F._afterLoad();
|
||||
},
|
||||
|
||||
_loadImage: function () {
|
||||
// Reset preload image so it is later possible to check "complete" property
|
||||
var img = F.imgPreload = new Image();
|
||||
|
||||
img.onload = function () {
|
||||
this.onload = this.onerror = null;
|
||||
|
||||
F.coming.width = this.width / F.opts.pixelRatio;
|
||||
F.coming.height = this.height / F.opts.pixelRatio;
|
||||
|
||||
F._afterLoad();
|
||||
};
|
||||
|
||||
img.onerror = function () {
|
||||
this.onload = this.onerror = null;
|
||||
|
||||
F._error( 'image' );
|
||||
};
|
||||
|
||||
img.src = F.coming.href;
|
||||
|
||||
if (img.complete !== true) {
|
||||
F.showLoading();
|
||||
}
|
||||
},
|
||||
|
||||
_loadAjax: function () {
|
||||
var coming = F.coming;
|
||||
|
||||
F.showLoading();
|
||||
|
||||
F.ajaxLoad = $.ajax($.extend({}, coming.ajax, {
|
||||
url: coming.href,
|
||||
error: function (jqXHR, textStatus) {
|
||||
if (F.coming && textStatus !== 'abort') {
|
||||
F._error( 'ajax', jqXHR );
|
||||
|
||||
} else {
|
||||
F.hideLoading();
|
||||
}
|
||||
},
|
||||
success: function (data, textStatus) {
|
||||
if (textStatus === 'success') {
|
||||
coming.content = data;
|
||||
|
||||
F._afterLoad();
|
||||
}
|
||||
}
|
||||
}));
|
||||
},
|
||||
|
||||
_loadIframe: function() {
|
||||
var coming = F.coming,
|
||||
iframe = $(coming.tpl.iframe.replace(/\{rnd\}/g, new Date().getTime()))
|
||||
.attr('scrolling', isTouch ? 'auto' : coming.iframe.scrolling)
|
||||
.attr('src', coming.href);
|
||||
|
||||
// This helps IE
|
||||
$(coming.wrap).bind('onReset', function () {
|
||||
try {
|
||||
$(this).find('iframe').hide().attr('src', '//about:blank').end().empty();
|
||||
} catch (e) {}
|
||||
});
|
||||
|
||||
if (coming.iframe.preload) {
|
||||
F.showLoading();
|
||||
|
||||
iframe.one('load', function() {
|
||||
$(this).data('ready', 1);
|
||||
|
||||
// iOS will lose scrolling if we resize
|
||||
if (!isTouch) {
|
||||
$(this).bind('load.fb', F.update);
|
||||
}
|
||||
|
||||
// Without this trick:
|
||||
// - iframe won't scroll on iOS devices
|
||||
// - IE7 sometimes displays empty iframe
|
||||
$(this).parents('.fancybox-wrap').width('100%').removeClass('fancybox-tmp').show();
|
||||
|
||||
F._afterLoad();
|
||||
});
|
||||
}
|
||||
|
||||
coming.content = iframe.appendTo( coming.inner );
|
||||
|
||||
if (!coming.iframe.preload) {
|
||||
F._afterLoad();
|
||||
}
|
||||
},
|
||||
|
||||
_preloadImages: function() {
|
||||
var group = F.group,
|
||||
current = F.current,
|
||||
len = group.length,
|
||||
cnt = current.preload ? Math.min(current.preload, len - 1) : 0,
|
||||
item,
|
||||
i;
|
||||
|
||||
for (i = 1; i <= cnt; i += 1) {
|
||||
item = group[ (current.index + i ) % len ];
|
||||
|
||||
if (item.type === 'image' && item.href) {
|
||||
new Image().src = item.href;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
_afterLoad: function () {
|
||||
var coming = F.coming,
|
||||
previous = F.current,
|
||||
placeholder = 'fancybox-placeholder',
|
||||
current,
|
||||
content,
|
||||
type,
|
||||
scrolling,
|
||||
href,
|
||||
embed;
|
||||
|
||||
F.hideLoading();
|
||||
|
||||
if (!coming || F.isActive === false) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (false === F.trigger('afterLoad', coming, previous)) {
|
||||
coming.wrap.stop(true).trigger('onReset').remove();
|
||||
|
||||
F.coming = null;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (previous) {
|
||||
F.trigger('beforeChange', previous);
|
||||
|
||||
previous.wrap.stop(true).removeClass('fancybox-opened')
|
||||
.find('.fancybox-item, .fancybox-nav')
|
||||
.remove();
|
||||
}
|
||||
|
||||
F.unbindEvents();
|
||||
|
||||
current = coming;
|
||||
content = coming.content;
|
||||
type = coming.type;
|
||||
scrolling = coming.scrolling;
|
||||
|
||||
$.extend(F, {
|
||||
wrap : current.wrap,
|
||||
skin : current.skin,
|
||||
outer : current.outer,
|
||||
inner : current.inner,
|
||||
current : current,
|
||||
previous : previous
|
||||
});
|
||||
|
||||
href = current.href;
|
||||
|
||||
switch (type) {
|
||||
case 'inline':
|
||||
case 'ajax':
|
||||
case 'html':
|
||||
if (current.selector) {
|
||||
content = $('<div>').html(content).find(current.selector);
|
||||
|
||||
} else if (isQuery(content)) {
|
||||
if (!content.data(placeholder)) {
|
||||
content.data(placeholder, $('<div class="' + placeholder + '"></div>').insertAfter( content ).hide() );
|
||||
}
|
||||
|
||||
content = content.show().detach();
|
||||
|
||||
current.wrap.bind('onReset', function () {
|
||||
if ($(this).find(content).length) {
|
||||
content.hide().replaceAll( content.data(placeholder) ).data(placeholder, false);
|
||||
}
|
||||
});
|
||||
}
|
||||
break;
|
||||
|
||||
case 'image':
|
||||
content = current.tpl.image.replace('{href}', href);
|
||||
break;
|
||||
|
||||
case 'swf':
|
||||
content = '<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="' + href + '"></param>';
|
||||
embed = '';
|
||||
|
||||
$.each(current.swf, function(name, val) {
|
||||
content += '<param name="' + name + '" value="' + val + '"></param>';
|
||||
embed += ' ' + name + '="' + val + '"';
|
||||
});
|
||||
|
||||
content += '<embed src="' + href + '" type="application/x-shockwave-flash" width="100%" height="100%"' + embed + '></embed></object>';
|
||||
break;
|
||||
}
|
||||
|
||||
if (!(isQuery(content) && content.parent().is(current.inner))) {
|
||||
current.inner.append( content );
|
||||
}
|
||||
|
||||
// Give a chance for helpers or callbacks to update elements
|
||||
F.trigger('beforeShow');
|
||||
|
||||
// Set scrolling before calculating dimensions
|
||||
current.inner.css('overflow', scrolling === 'yes' ? 'scroll' : (scrolling === 'no' ? 'hidden' : scrolling));
|
||||
|
||||
// Set initial dimensions and start position
|
||||
F._setDimension();
|
||||
|
||||
F.reposition();
|
||||
|
||||
F.isOpen = false;
|
||||
F.coming = null;
|
||||
|
||||
F.bindEvents();
|
||||
|
||||
if (!F.isOpened) {
|
||||
$('.fancybox-wrap').not( current.wrap ).stop(true).trigger('onReset').remove();
|
||||
|
||||
} else if (previous.prevMethod) {
|
||||
F.transitions[ previous.prevMethod ]();
|
||||
}
|
||||
|
||||
F.transitions[ F.isOpened ? current.nextMethod : current.openMethod ]();
|
||||
|
||||
F._preloadImages();
|
||||
},
|
||||
|
||||
_setDimension: function () {
|
||||
var viewport = F.getViewport(),
|
||||
steps = 0,
|
||||
canShrink = false,
|
||||
canExpand = false,
|
||||
wrap = F.wrap,
|
||||
skin = F.skin,
|
||||
inner = F.inner,
|
||||
current = F.current,
|
||||
width = current.width,
|
||||
height = current.height,
|
||||
minWidth = current.minWidth,
|
||||
minHeight = current.minHeight,
|
||||
maxWidth = current.maxWidth,
|
||||
maxHeight = current.maxHeight,
|
||||
scrolling = current.scrolling,
|
||||
scrollOut = current.scrollOutside ? current.scrollbarWidth : 0,
|
||||
margin = current.margin,
|
||||
wMargin = getScalar(margin[1] + margin[3]),
|
||||
hMargin = getScalar(margin[0] + margin[2]),
|
||||
wPadding,
|
||||
hPadding,
|
||||
wSpace,
|
||||
hSpace,
|
||||
origWidth,
|
||||
origHeight,
|
||||
origMaxWidth,
|
||||
origMaxHeight,
|
||||
ratio,
|
||||
width_,
|
||||
height_,
|
||||
maxWidth_,
|
||||
maxHeight_,
|
||||
iframe,
|
||||
body;
|
||||
|
||||
// Reset dimensions so we could re-check actual size
|
||||
wrap.add(skin).add(inner).width('auto').height('auto').removeClass('fancybox-tmp');
|
||||
|
||||
wPadding = getScalar(skin.outerWidth(true) - skin.width());
|
||||
hPadding = getScalar(skin.outerHeight(true) - skin.height());
|
||||
|
||||
// Any space between content and viewport (margin, padding, border, title)
|
||||
wSpace = wMargin + wPadding;
|
||||
hSpace = hMargin + hPadding;
|
||||
|
||||
origWidth = isPercentage(width) ? (viewport.w - wSpace) * getScalar(width) / 100 : width;
|
||||
origHeight = isPercentage(height) ? (viewport.h - hSpace) * getScalar(height) / 100 : height;
|
||||
|
||||
if (current.type === 'iframe') {
|
||||
iframe = current.content;
|
||||
|
||||
if (current.autoHeight && iframe.data('ready') === 1) {
|
||||
try {
|
||||
if (iframe[0].contentWindow.document.location) {
|
||||
inner.width( origWidth ).height(9999);
|
||||
|
||||
body = iframe.contents().find('body');
|
||||
|
||||
if (scrollOut) {
|
||||
body.css('overflow-x', 'hidden');
|
||||
}
|
||||
|
||||
origHeight = body.outerHeight(true);
|
||||
}
|
||||
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
} else if (current.autoWidth || current.autoHeight) {
|
||||
inner.addClass( 'fancybox-tmp' );
|
||||
|
||||
// Set width or height in case we need to calculate only one dimension
|
||||
if (!current.autoWidth) {
|
||||
inner.width( origWidth );
|
||||
}
|
||||
|
||||
if (!current.autoHeight) {
|
||||
inner.height( origHeight );
|
||||
}
|
||||
|
||||
if (current.autoWidth) {
|
||||
origWidth = inner.width();
|
||||
}
|
||||
|
||||
if (current.autoHeight) {
|
||||
origHeight = inner.height();
|
||||
}
|
||||
|
||||
inner.removeClass( 'fancybox-tmp' );
|
||||
}
|
||||
|
||||
width = getScalar( origWidth );
|
||||
height = getScalar( origHeight );
|
||||
|
||||
ratio = origWidth / origHeight;
|
||||
|
||||
// Calculations for the content
|
||||
minWidth = getScalar(isPercentage(minWidth) ? getScalar(minWidth, 'w') - wSpace : minWidth);
|
||||
maxWidth = getScalar(isPercentage(maxWidth) ? getScalar(maxWidth, 'w') - wSpace : maxWidth);
|
||||
|
||||
minHeight = getScalar(isPercentage(minHeight) ? getScalar(minHeight, 'h') - hSpace : minHeight);
|
||||
maxHeight = getScalar(isPercentage(maxHeight) ? getScalar(maxHeight, 'h') - hSpace : maxHeight);
|
||||
|
||||
// These will be used to determine if wrap can fit in the viewport
|
||||
origMaxWidth = maxWidth;
|
||||
origMaxHeight = maxHeight;
|
||||
|
||||
if (current.fitToView) {
|
||||
maxWidth = Math.min(viewport.w - wSpace, maxWidth);
|
||||
maxHeight = Math.min(viewport.h - hSpace, maxHeight);
|
||||
}
|
||||
|
||||
maxWidth_ = viewport.w - wMargin;
|
||||
maxHeight_ = viewport.h - hMargin;
|
||||
|
||||
if (current.aspectRatio) {
|
||||
if (width > maxWidth) {
|
||||
width = maxWidth;
|
||||
height = getScalar(width / ratio);
|
||||
}
|
||||
|
||||
if (height > maxHeight) {
|
||||
height = maxHeight;
|
||||
width = getScalar(height * ratio);
|
||||
}
|
||||
|
||||
if (width < minWidth) {
|
||||
width = minWidth;
|
||||
height = getScalar(width / ratio);
|
||||
}
|
||||
|
||||
if (height < minHeight) {
|
||||
height = minHeight;
|
||||
width = getScalar(height * ratio);
|
||||
}
|
||||
|
||||
} else {
|
||||
width = Math.max(minWidth, Math.min(width, maxWidth));
|
||||
|
||||
if (current.autoHeight && current.type !== 'iframe') {
|
||||
inner.width( width );
|
||||
|
||||
height = inner.height();
|
||||
}
|
||||
|
||||
height = Math.max(minHeight, Math.min(height, maxHeight));
|
||||
}
|
||||
|
||||
// Try to fit inside viewport (including the title)
|
||||
if (current.fitToView) {
|
||||
inner.width( width ).height( height );
|
||||
|
||||
wrap.width( width + wPadding );
|
||||
|
||||
// Real wrap dimensions
|
||||
width_ = wrap.width();
|
||||
height_ = wrap.height();
|
||||
|
||||
if (current.aspectRatio) {
|
||||
while ((width_ > maxWidth_ || height_ > maxHeight_) && width > minWidth && height > minHeight) {
|
||||
if (steps++ > 19) {
|
||||
break;
|
||||
}
|
||||
|
||||
height = Math.max(minHeight, Math.min(maxHeight, height - 10));
|
||||
width = getScalar(height * ratio);
|
||||
|
||||
if (width < minWidth) {
|
||||
width = minWidth;
|
||||
height = getScalar(width / ratio);
|
||||
}
|
||||
|
||||
if (width > maxWidth) {
|
||||
width = maxWidth;
|
||||
height = getScalar(width / ratio);
|
||||
}
|
||||
|
||||
inner.width( width ).height( height );
|
||||
|
||||
wrap.width( width + wPadding );
|
||||
|
||||
width_ = wrap.width();
|
||||
height_ = wrap.height();
|
||||
}
|
||||
|
||||
} else {
|
||||
width = Math.max(minWidth, Math.min(width, width - (width_ - maxWidth_)));
|
||||
height = Math.max(minHeight, Math.min(height, height - (height_ - maxHeight_)));
|
||||
}
|
||||
}
|
||||
|
||||
if (scrollOut && scrolling === 'auto' && height < origHeight && (width + wPadding + scrollOut) < maxWidth_) {
|
||||
width += scrollOut;
|
||||
}
|
||||
|
||||
inner.width( width ).height( height );
|
||||
|
||||
wrap.width( width + wPadding );
|
||||
|
||||
width_ = wrap.width();
|
||||
height_ = wrap.height();
|
||||
|
||||
canShrink = (width_ > maxWidth_ || height_ > maxHeight_) && width > minWidth && height > minHeight;
|
||||
canExpand = current.aspectRatio ? (width < origMaxWidth && height < origMaxHeight && width < origWidth && height < origHeight) : ((width < origMaxWidth || height < origMaxHeight) && (width < origWidth || height < origHeight));
|
||||
|
||||
$.extend(current, {
|
||||
dim : {
|
||||
width : getValue( width_ ),
|
||||
height : getValue( height_ )
|
||||
},
|
||||
origWidth : origWidth,
|
||||
origHeight : origHeight,
|
||||
canShrink : canShrink,
|
||||
canExpand : canExpand,
|
||||
wPadding : wPadding,
|
||||
hPadding : hPadding,
|
||||
wrapSpace : height_ - skin.outerHeight(true),
|
||||
skinSpace : skin.height() - height
|
||||
});
|
||||
|
||||
if (!iframe && current.autoHeight && height > minHeight && height < maxHeight && !canExpand) {
|
||||
inner.height('auto');
|
||||
}
|
||||
},
|
||||
|
||||
_getPosition: function (onlyAbsolute) {
|
||||
var current = F.current,
|
||||
viewport = F.getViewport(),
|
||||
margin = current.margin,
|
||||
width = F.wrap.width() + margin[1] + margin[3],
|
||||
height = F.wrap.height() + margin[0] + margin[2],
|
||||
rez = {
|
||||
position: 'absolute',
|
||||
top : margin[0],
|
||||
left : margin[3]
|
||||
};
|
||||
|
||||
if (current.autoCenter && current.fixed && !onlyAbsolute && height <= viewport.h && width <= viewport.w) {
|
||||
rez.position = 'fixed';
|
||||
|
||||
} else if (!current.locked) {
|
||||
rez.top += viewport.y;
|
||||
rez.left += viewport.x;
|
||||
}
|
||||
|
||||
rez.top = getValue(Math.max(rez.top, rez.top + ((viewport.h - height) * current.topRatio)));
|
||||
rez.left = getValue(Math.max(rez.left, rez.left + ((viewport.w - width) * current.leftRatio)));
|
||||
|
||||
return rez;
|
||||
},
|
||||
|
||||
_afterZoomIn: function () {
|
||||
var current = F.current;
|
||||
|
||||
if (!current) {
|
||||
return;
|
||||
}
|
||||
|
||||
F.isOpen = F.isOpened = true;
|
||||
|
||||
F.wrap.css('overflow', 'visible').addClass('fancybox-opened');
|
||||
|
||||
F.update();
|
||||
|
||||
// Assign a click event
|
||||
if ( current.closeClick || (current.nextClick && F.group.length > 1) ) {
|
||||
F.inner.css('cursor', 'pointer').bind('click.fb', function(e) {
|
||||
if (!$(e.target).is('a') && !$(e.target).parent().is('a')) {
|
||||
e.preventDefault();
|
||||
|
||||
F[ current.closeClick ? 'close' : 'next' ]();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Create a close button
|
||||
if (current.closeBtn) {
|
||||
$(current.tpl.closeBtn).appendTo(F.skin).bind('click.fb', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
F.close();
|
||||
});
|
||||
}
|
||||
|
||||
// Create navigation arrows
|
||||
if (current.arrows && F.group.length > 1) {
|
||||
if (current.loop || current.index > 0) {
|
||||
$(current.tpl.prev).appendTo(F.outer).bind('click.fb', F.prev);
|
||||
}
|
||||
|
||||
if (current.loop || current.index < F.group.length - 1) {
|
||||
$(current.tpl.next).appendTo(F.outer).bind('click.fb', F.next);
|
||||
}
|
||||
}
|
||||
|
||||
F.trigger('afterShow');
|
||||
|
||||
// Stop the slideshow if this is the last item
|
||||
if (!current.loop && current.index === current.group.length - 1) {
|
||||
F.play( false );
|
||||
|
||||
} else if (F.opts.autoPlay && !F.player.isActive) {
|
||||
F.opts.autoPlay = false;
|
||||
|
||||
F.play();
|
||||
}
|
||||
},
|
||||
|
||||
_afterZoomOut: function ( obj ) {
|
||||
obj = obj || F.current;
|
||||
|
||||
$('.fancybox-wrap').trigger('onReset').remove();
|
||||
|
||||
$.extend(F, {
|
||||
group : {},
|
||||
opts : {},
|
||||
router : false,
|
||||
current : null,
|
||||
isActive : false,
|
||||
isOpened : false,
|
||||
isOpen : false,
|
||||
isClosing : false,
|
||||
wrap : null,
|
||||
skin : null,
|
||||
outer : null,
|
||||
inner : null
|
||||
});
|
||||
|
||||
F.trigger('afterClose', obj);
|
||||
}
|
||||
});
|
||||
|
||||
/*
|
||||
* Default transitions
|
||||
*/
|
||||
|
||||
F.transitions = {
|
||||
getOrigPosition: function () {
|
||||
var current = F.current,
|
||||
element = current.element,
|
||||
orig = current.orig,
|
||||
pos = {},
|
||||
width = 50,
|
||||
height = 50,
|
||||
hPadding = current.hPadding,
|
||||
wPadding = current.wPadding,
|
||||
viewport = F.getViewport();
|
||||
|
||||
if (!orig && current.isDom && element.is(':visible')) {
|
||||
orig = element.find('img:first');
|
||||
|
||||
if (!orig.length) {
|
||||
orig = element;
|
||||
}
|
||||
}
|
||||
|
||||
if (isQuery(orig)) {
|
||||
pos = orig.offset();
|
||||
|
||||
if (orig.is('img')) {
|
||||
width = orig.outerWidth();
|
||||
height = orig.outerHeight();
|
||||
}
|
||||
|
||||
} else {
|
||||
pos.top = viewport.y + (viewport.h - height) * current.topRatio;
|
||||
pos.left = viewport.x + (viewport.w - width) * current.leftRatio;
|
||||
}
|
||||
|
||||
if (F.wrap.css('position') === 'fixed' || current.locked) {
|
||||
pos.top -= viewport.y;
|
||||
pos.left -= viewport.x;
|
||||
}
|
||||
|
||||
pos = {
|
||||
top : getValue(pos.top - hPadding * current.topRatio),
|
||||
left : getValue(pos.left - wPadding * current.leftRatio),
|
||||
width : getValue(width + wPadding),
|
||||
height : getValue(height + hPadding)
|
||||
};
|
||||
|
||||
return pos;
|
||||
},
|
||||
|
||||
step: function (now, fx) {
|
||||
var ratio,
|
||||
padding,
|
||||
value,
|
||||
prop = fx.prop,
|
||||
current = F.current,
|
||||
wrapSpace = current.wrapSpace,
|
||||
skinSpace = current.skinSpace;
|
||||
|
||||
if (prop === 'width' || prop === 'height') {
|
||||
ratio = fx.end === fx.start ? 1 : (now - fx.start) / (fx.end - fx.start);
|
||||
|
||||
if (F.isClosing) {
|
||||
ratio = 1 - ratio;
|
||||
}
|
||||
|
||||
padding = prop === 'width' ? current.wPadding : current.hPadding;
|
||||
value = now - padding;
|
||||
|
||||
F.skin[ prop ]( getScalar( prop === 'width' ? value : value - (wrapSpace * ratio) ) );
|
||||
F.inner[ prop ]( getScalar( prop === 'width' ? value : value - (wrapSpace * ratio) - (skinSpace * ratio) ) );
|
||||
}
|
||||
},
|
||||
|
||||
zoomIn: function () {
|
||||
var current = F.current,
|
||||
startPos = current.pos,
|
||||
effect = current.openEffect,
|
||||
elastic = effect === 'elastic',
|
||||
endPos = $.extend({opacity : 1}, startPos);
|
||||
|
||||
// Remove "position" property that breaks older IE
|
||||
delete endPos.position;
|
||||
|
||||
if (elastic) {
|
||||
startPos = this.getOrigPosition();
|
||||
|
||||
if (current.openOpacity) {
|
||||
startPos.opacity = 0.1;
|
||||
}
|
||||
|
||||
} else if (effect === 'fade') {
|
||||
startPos.opacity = 0.1;
|
||||
}
|
||||
|
||||
F.wrap.css(startPos).animate(endPos, {
|
||||
duration : effect === 'none' ? 0 : current.openSpeed,
|
||||
easing : current.openEasing,
|
||||
step : elastic ? this.step : null,
|
||||
complete : F._afterZoomIn
|
||||
});
|
||||
},
|
||||
|
||||
zoomOut: function () {
|
||||
var current = F.current,
|
||||
effect = current.closeEffect,
|
||||
elastic = effect === 'elastic',
|
||||
endPos = {opacity : 0.1};
|
||||
|
||||
if (elastic) {
|
||||
endPos = this.getOrigPosition();
|
||||
|
||||
if (current.closeOpacity) {
|
||||
endPos.opacity = 0.1;
|
||||
}
|
||||
}
|
||||
|
||||
F.wrap.animate(endPos, {
|
||||
duration : effect === 'none' ? 0 : current.closeSpeed,
|
||||
easing : current.closeEasing,
|
||||
step : elastic ? this.step : null,
|
||||
complete : F._afterZoomOut
|
||||
});
|
||||
},
|
||||
|
||||
changeIn: function () {
|
||||
var current = F.current,
|
||||
effect = current.nextEffect,
|
||||
startPos = current.pos,
|
||||
endPos = { opacity : 1 },
|
||||
direction = F.direction,
|
||||
distance = 200,
|
||||
field;
|
||||
|
||||
startPos.opacity = 0.1;
|
||||
|
||||
if (effect === 'elastic') {
|
||||
field = direction === 'down' || direction === 'up' ? 'top' : 'left';
|
||||
|
||||
if (direction === 'down' || direction === 'right') {
|
||||
startPos[ field ] = getValue(getScalar(startPos[ field ]) - distance);
|
||||
endPos[ field ] = '+=' + distance + 'px';
|
||||
|
||||
} else {
|
||||
startPos[ field ] = getValue(getScalar(startPos[ field ]) + distance);
|
||||
endPos[ field ] = '-=' + distance + 'px';
|
||||
}
|
||||
}
|
||||
|
||||
// Workaround for http://bugs.jquery.com/ticket/12273
|
||||
if (effect === 'none') {
|
||||
F._afterZoomIn();
|
||||
|
||||
} else {
|
||||
F.wrap.css(startPos).animate(endPos, {
|
||||
duration : current.nextSpeed,
|
||||
easing : current.nextEasing,
|
||||
complete : F._afterZoomIn
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
changeOut: function () {
|
||||
var previous = F.previous,
|
||||
effect = previous.prevEffect,
|
||||
endPos = { opacity : 0.1 },
|
||||
direction = F.direction,
|
||||
distance = 200;
|
||||
|
||||
if (effect === 'elastic') {
|
||||
endPos[ direction === 'down' || direction === 'up' ? 'top' : 'left' ] = ( direction === 'up' || direction === 'left' ? '-' : '+' ) + '=' + distance + 'px';
|
||||
}
|
||||
|
||||
previous.wrap.animate(endPos, {
|
||||
duration : effect === 'none' ? 0 : previous.prevSpeed,
|
||||
easing : previous.prevEasing,
|
||||
complete : function () {
|
||||
$(this).trigger('onReset').remove();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
* Overlay helper
|
||||
*/
|
||||
|
||||
F.helpers.overlay = {
|
||||
defaults : {
|
||||
closeClick : true, // if true, fancyBox will be closed when user clicks on the overlay
|
||||
speedOut : 200, // duration of fadeOut animation
|
||||
showEarly : true, // indicates if should be opened immediately or wait until the content is ready
|
||||
css : {}, // custom CSS properties
|
||||
locked : !isTouch, // if true, the content will be locked into overlay
|
||||
fixed : true // if false, the overlay CSS position property will not be set to "fixed"
|
||||
},
|
||||
|
||||
overlay : null, // current handle
|
||||
fixed : false, // indicates if the overlay has position "fixed"
|
||||
el : $('html'), // element that contains "the lock"
|
||||
|
||||
// Public methods
|
||||
create : function(opts) {
|
||||
opts = $.extend({}, this.defaults, opts);
|
||||
|
||||
if (this.overlay) {
|
||||
this.close();
|
||||
}
|
||||
|
||||
this.overlay = $('<div class="fancybox-overlay"></div>').appendTo( F.coming ? F.coming.parent : opts.parent );
|
||||
this.fixed = false;
|
||||
|
||||
if (opts.fixed && F.defaults.fixed) {
|
||||
this.overlay.addClass('fancybox-overlay-fixed');
|
||||
|
||||
this.fixed = true;
|
||||
}
|
||||
},
|
||||
|
||||
open : function(opts) {
|
||||
var that = this;
|
||||
|
||||
opts = $.extend({}, this.defaults, opts);
|
||||
|
||||
if (this.overlay) {
|
||||
this.overlay.unbind('.overlay').width('auto').height('auto');
|
||||
|
||||
} else {
|
||||
this.create(opts);
|
||||
}
|
||||
|
||||
if (!this.fixed) {
|
||||
W.bind('resize.overlay', $.proxy( this.update, this) );
|
||||
|
||||
this.update();
|
||||
}
|
||||
|
||||
if (opts.closeClick) {
|
||||
this.overlay.bind('click.overlay', function(e) {
|
||||
if ($(e.target).hasClass('fancybox-overlay')) {
|
||||
if (F.isActive) {
|
||||
F.close();
|
||||
} else {
|
||||
that.close();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.overlay.css( opts.css ).show();
|
||||
},
|
||||
|
||||
close : function() {
|
||||
var scrollV, scrollH;
|
||||
|
||||
W.unbind('resize.overlay');
|
||||
|
||||
if (this.el.hasClass('fancybox-lock')) {
|
||||
$('.fancybox-margin').removeClass('fancybox-margin');
|
||||
|
||||
scrollV = W.scrollTop();
|
||||
scrollH = W.scrollLeft();
|
||||
|
||||
this.el.removeClass('fancybox-lock');
|
||||
|
||||
W.scrollTop( scrollV ).scrollLeft( scrollH );
|
||||
}
|
||||
|
||||
$('.fancybox-overlay').remove().hide();
|
||||
|
||||
$.extend(this, {
|
||||
overlay : null,
|
||||
fixed : false
|
||||
});
|
||||
},
|
||||
|
||||
// Private, callbacks
|
||||
|
||||
update : function () {
|
||||
var width = '100%', offsetWidth;
|
||||
|
||||
// Reset width/height so it will not mess
|
||||
this.overlay.width(width).height('100%');
|
||||
|
||||
// jQuery does not return reliable result for IE
|
||||
if (IE) {
|
||||
offsetWidth = Math.max(document.documentElement.offsetWidth, document.body.offsetWidth);
|
||||
|
||||
if (D.width() > offsetWidth) {
|
||||
width = D.width();
|
||||
}
|
||||
|
||||
} else if (D.width() > W.width()) {
|
||||
width = D.width();
|
||||
}
|
||||
|
||||
this.overlay.width(width).height(D.height());
|
||||
},
|
||||
|
||||
// This is where we can manipulate DOM, because later it would cause iframes to reload
|
||||
onReady : function (opts, obj) {
|
||||
//bugfix modified by baishen
|
||||
//issue: https://github.com/fancyapps/fancyBox/issues/993
|
||||
//var overlay = this.overlay;
|
||||
var overlay = null;
|
||||
|
||||
$('.fancybox-overlay').stop(true, true);
|
||||
|
||||
if (!overlay) {
|
||||
this.create(opts);
|
||||
}
|
||||
|
||||
if (opts.locked && this.fixed && obj.fixed) {
|
||||
if (!overlay) {
|
||||
this.margin = D.height() > W.height() ? $('html').css('margin-right').replace("px", "") : false;
|
||||
}
|
||||
|
||||
obj.locked = this.overlay.append( obj.wrap );
|
||||
obj.fixed = false;
|
||||
}
|
||||
|
||||
if (opts.showEarly === true) {
|
||||
this.beforeShow.apply(this, arguments);
|
||||
}
|
||||
},
|
||||
|
||||
beforeShow : function(opts, obj) {
|
||||
var scrollV, scrollH;
|
||||
|
||||
if (obj.locked) {
|
||||
if (this.margin !== false) {
|
||||
$('*').filter(function(){
|
||||
return ($(this).css('position') === 'fixed' && !$(this).hasClass("fancybox-overlay") && !$(this).hasClass("fancybox-wrap") );
|
||||
}).addClass('fancybox-margin');
|
||||
|
||||
this.el.addClass('fancybox-margin');
|
||||
}
|
||||
|
||||
scrollV = W.scrollTop();
|
||||
scrollH = W.scrollLeft();
|
||||
|
||||
this.el.addClass('fancybox-lock');
|
||||
|
||||
W.scrollTop( scrollV ).scrollLeft( scrollH );
|
||||
}
|
||||
|
||||
this.open(opts);
|
||||
},
|
||||
|
||||
onUpdate : function() {
|
||||
if (!this.fixed) {
|
||||
this.update();
|
||||
}
|
||||
},
|
||||
|
||||
afterClose: function (opts) {
|
||||
// Remove overlay if exists and fancyBox is not opening
|
||||
// (e.g., it is not being open using afterClose callback)
|
||||
//if (this.overlay && !F.isActive) {
|
||||
if (this.overlay && !F.coming) {
|
||||
this.overlay.fadeOut(opts.speedOut, $.proxy( this.close, this ));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
* Title helper
|
||||
*/
|
||||
|
||||
F.helpers.title = {
|
||||
defaults : {
|
||||
type : 'float', // 'float', 'inside', 'outside' or 'over',
|
||||
position : 'bottom' // 'top' or 'bottom'
|
||||
},
|
||||
|
||||
beforeShow: function (opts) {
|
||||
var current = F.current,
|
||||
text = current.title,
|
||||
type = opts.type,
|
||||
title,
|
||||
target;
|
||||
|
||||
if ($.isFunction(text)) {
|
||||
text = text.call(current.element, current);
|
||||
}
|
||||
|
||||
if (!isString(text) || $.trim(text) === '') {
|
||||
return;
|
||||
}
|
||||
|
||||
title = $('<div class="fancybox-title fancybox-title-' + type + '-wrap">' + text + '</div>');
|
||||
|
||||
switch (type) {
|
||||
case 'inside':
|
||||
target = F.skin;
|
||||
break;
|
||||
|
||||
case 'outside':
|
||||
target = F.wrap;
|
||||
break;
|
||||
|
||||
case 'over':
|
||||
target = F.inner;
|
||||
break;
|
||||
|
||||
default: // 'float'
|
||||
target = F.skin;
|
||||
|
||||
title.appendTo('body');
|
||||
|
||||
if (IE) {
|
||||
title.width( title.width() );
|
||||
}
|
||||
|
||||
title.wrapInner('<span class="child"></span>');
|
||||
|
||||
//Increase bottom margin so this title will also fit into viewport
|
||||
F.current.margin[2] += Math.abs( getScalar(title.css('margin-bottom')) );
|
||||
break;
|
||||
}
|
||||
|
||||
title[ (opts.position === 'top' ? 'prependTo' : 'appendTo') ](target);
|
||||
}
|
||||
};
|
||||
|
||||
// jQuery plugin initialization
|
||||
$.fn.fancybox = function (options) {
|
||||
var index,
|
||||
that = $(this),
|
||||
selector = this.selector || '',
|
||||
run = function(e) {
|
||||
var what = $(this).blur(), idx = index, relType, relVal;
|
||||
|
||||
if (!(e.ctrlKey || e.altKey || e.shiftKey || e.metaKey) && !what.is('.fancybox-wrap')) {
|
||||
relType = options.groupAttr || 'data-fancybox-group';
|
||||
relVal = what.attr(relType);
|
||||
|
||||
if (!relVal) {
|
||||
relType = 'rel';
|
||||
relVal = what.get(0)[ relType ];
|
||||
}
|
||||
|
||||
if (relVal && relVal !== '' && relVal !== 'nofollow') {
|
||||
what = selector.length ? $(selector) : that;
|
||||
what = what.filter('[' + relType + '="' + relVal + '"]');
|
||||
idx = what.index(this);
|
||||
}
|
||||
|
||||
options.index = idx;
|
||||
|
||||
// Stop an event from bubbling if everything is fine
|
||||
if (F.open(what, options) !== false) {
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
options = options || {};
|
||||
index = options.index || 0;
|
||||
|
||||
if (!selector || options.live === false) {
|
||||
that.unbind('click.fb-start').bind('click.fb-start', run);
|
||||
|
||||
} else {
|
||||
D.undelegate(selector, 'click.fb-start').delegate(selector + ":not('.fancybox-item, .fancybox-nav')", 'click.fb-start', run);
|
||||
}
|
||||
|
||||
this.filter('[data-fancybox-start=1]').trigger('click');
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
// Tests that need a body at doc ready
|
||||
D.ready(function() {
|
||||
var w1, w2;
|
||||
|
||||
if ( $.scrollbarWidth === undefined ) {
|
||||
// http://benalman.com/projects/jquery-misc-plugins/#scrollbarwidth
|
||||
$.scrollbarWidth = function() {
|
||||
var parent = $('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo('body'),
|
||||
child = parent.children(),
|
||||
width = child.innerWidth() - child.height( 99 ).innerWidth();
|
||||
|
||||
parent.remove();
|
||||
|
||||
return width;
|
||||
};
|
||||
}
|
||||
|
||||
if ( $.support.fixedPosition === undefined ) {
|
||||
$.support.fixedPosition = (function() {
|
||||
var elem = $('<div style="position:fixed;top:20px;"></div>').appendTo('body'),
|
||||
fixed = ( elem[0].offsetTop === 20 || elem[0].offsetTop === 15 );
|
||||
|
||||
elem.remove();
|
||||
|
||||
return fixed;
|
||||
}());
|
||||
}
|
||||
|
||||
$.extend(F.defaults, {
|
||||
scrollbarWidth : $.scrollbarWidth(),
|
||||
fixed : $.support.fixedPosition,
|
||||
parent : $('body')
|
||||
});
|
||||
|
||||
//Get real width of page scroll-bar
|
||||
w1 = $(window).width();
|
||||
|
||||
H.addClass('fancybox-lock-test');
|
||||
|
||||
w2 = $(window).width();
|
||||
|
||||
H.removeClass('fancybox-lock-test');
|
||||
|
||||
$("<style type='text/css'>.fancybox-margin{margin-right:" + (w2 - w1) + "px;}</style>").appendTo("head");
|
||||
});
|
||||
|
||||
}(window, document, jQuery));
|
||||
+625
@@ -0,0 +1,625 @@
|
||||
/* Notify.js - http://notifyjs.com/ Copyright (c) 2015 MIT */
|
||||
(function (factory) {
|
||||
// UMD start
|
||||
// https://github.com/umdjs/umd/blob/master/jqueryPluginCommonjs.js
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['jquery'], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// Node/CommonJS
|
||||
module.exports = function( root, jQuery ) {
|
||||
if ( jQuery === undefined ) {
|
||||
// require('jQuery') returns a factory that requires window to
|
||||
// build a jQuery instance, we normalize how we use modules
|
||||
// that require this pattern but the window provided is a noop
|
||||
// if it's defined (how jquery works)
|
||||
if ( typeof window !== 'undefined' ) {
|
||||
jQuery = require('jquery');
|
||||
}
|
||||
else {
|
||||
jQuery = require('jquery')(root);
|
||||
}
|
||||
}
|
||||
factory(jQuery);
|
||||
return jQuery;
|
||||
};
|
||||
} else {
|
||||
// Browser globals
|
||||
factory(jQuery);
|
||||
}
|
||||
}(function ($) {
|
||||
//IE8 indexOf polyfill
|
||||
var indexOf = [].indexOf || function(item) {
|
||||
for (var i = 0, l = this.length; i < l; i++) {
|
||||
if (i in this && this[i] === item) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
};
|
||||
|
||||
var pluginName = "notify";
|
||||
var pluginClassName = pluginName + "js";
|
||||
var blankFieldName = pluginName + "!blank";
|
||||
|
||||
var positions = {
|
||||
t: "top",
|
||||
m: "middle",
|
||||
b: "bottom",
|
||||
l: "left",
|
||||
c: "center",
|
||||
r: "right"
|
||||
};
|
||||
var hAligns = ["l", "c", "r"];
|
||||
var vAligns = ["t", "m", "b"];
|
||||
var mainPositions = ["t", "b", "l", "r"];
|
||||
var opposites = {
|
||||
t: "b",
|
||||
m: null,
|
||||
b: "t",
|
||||
l: "r",
|
||||
c: null,
|
||||
r: "l"
|
||||
};
|
||||
|
||||
var parsePosition = function(str) {
|
||||
var pos;
|
||||
pos = [];
|
||||
$.each(str.split(/\W+/), function(i, word) {
|
||||
var w;
|
||||
w = word.toLowerCase().charAt(0);
|
||||
if (positions[w]) {
|
||||
return pos.push(w);
|
||||
}
|
||||
});
|
||||
return pos;
|
||||
};
|
||||
|
||||
var styles = {};
|
||||
|
||||
var coreStyle = {
|
||||
name: "core",
|
||||
html: "<div class=\"" + pluginClassName + "-wrapper\">\n <div class=\"" + pluginClassName + "-arrow\"></div>\n <div class=\"" + pluginClassName + "-container\"></div>\n</div>",
|
||||
css: "." + pluginClassName + "-corner {\n position: fixed;\n margin: 5px;\n z-index: 1050;\n}\n\n." + pluginClassName + "-corner ." + pluginClassName + "-wrapper,\n." + pluginClassName + "-corner ." + pluginClassName + "-container {\n position: relative;\n display: block;\n height: inherit;\n width: inherit;\n margin: 3px;\n}\n\n." + pluginClassName + "-wrapper {\n z-index: 1;\n position: absolute;\n display: inline-block;\n height: 0;\n width: 0;\n}\n\n." + pluginClassName + "-container {\n display: none;\n z-index: 1;\n position: absolute;\n}\n\n." + pluginClassName + "-hidable {\n cursor: pointer;\n}\n\n[data-notify-text],[data-notify-html] {\n position: relative;\n}\n\n." + pluginClassName + "-arrow {\n position: absolute;\n z-index: 2;\n width: 0;\n height: 0;\n}"
|
||||
};
|
||||
|
||||
var stylePrefixes = {
|
||||
"border-radius": ["-webkit-", "-moz-"]
|
||||
};
|
||||
|
||||
var getStyle = function(name) {
|
||||
return styles[name];
|
||||
};
|
||||
|
||||
var removeStyle = function(name) {
|
||||
if (!name) {
|
||||
throw "Missing Style name";
|
||||
}
|
||||
if (styles[name]) {
|
||||
delete styles[name];
|
||||
}
|
||||
};
|
||||
|
||||
var addStyle = function(name, def) {
|
||||
if (!name) {
|
||||
throw "Missing Style name";
|
||||
}
|
||||
if (!def) {
|
||||
throw "Missing Style definition";
|
||||
}
|
||||
if (!def.html) {
|
||||
throw "Missing Style HTML";
|
||||
}
|
||||
//remove existing style
|
||||
var existing = styles[name];
|
||||
if (existing && existing.cssElem) {
|
||||
if (window.console) {
|
||||
console.warn(pluginName + ": overwriting style '" + name + "'");
|
||||
}
|
||||
styles[name].cssElem.remove();
|
||||
}
|
||||
def.name = name;
|
||||
styles[name] = def;
|
||||
var cssText = "";
|
||||
if (def.classes) {
|
||||
$.each(def.classes, function(className, props) {
|
||||
cssText += "." + pluginClassName + "-" + def.name + "-" + className + " {\n";
|
||||
$.each(props, function(name, val) {
|
||||
if (stylePrefixes[name]) {
|
||||
$.each(stylePrefixes[name], function(i, prefix) {
|
||||
return cssText += " " + prefix + name + ": " + val + ";\n";
|
||||
});
|
||||
}
|
||||
return cssText += " " + name + ": " + val + ";\n";
|
||||
});
|
||||
return cssText += "}\n";
|
||||
});
|
||||
}
|
||||
if (def.css) {
|
||||
cssText += "/* styles for " + def.name + " */\n" + def.css;
|
||||
}
|
||||
if (cssText) {
|
||||
def.cssElem = insertCSS(cssText);
|
||||
def.cssElem.attr("id", "notify-" + def.name);
|
||||
}
|
||||
var fields = {};
|
||||
var elem = $(def.html);
|
||||
findFields("html", elem, fields);
|
||||
findFields("text", elem, fields);
|
||||
def.fields = fields;
|
||||
};
|
||||
|
||||
var insertCSS = function(cssText) {
|
||||
var e, elem, error;
|
||||
elem = createElem("style");
|
||||
elem.attr("type", 'text/css');
|
||||
$("head").append(elem);
|
||||
try {
|
||||
elem.html(cssText);
|
||||
} catch (_) {
|
||||
elem[0].styleSheet.cssText = cssText;
|
||||
}
|
||||
return elem;
|
||||
};
|
||||
|
||||
var findFields = function(type, elem, fields) {
|
||||
var attr;
|
||||
if (type !== "html") {
|
||||
type = "text";
|
||||
}
|
||||
attr = "data-notify-" + type;
|
||||
return find(elem, "[" + attr + "]").each(function() {
|
||||
var name;
|
||||
name = $(this).attr(attr);
|
||||
if (!name) {
|
||||
name = blankFieldName;
|
||||
}
|
||||
fields[name] = type;
|
||||
});
|
||||
};
|
||||
|
||||
var find = function(elem, selector) {
|
||||
if (elem.is(selector)) {
|
||||
return elem;
|
||||
} else {
|
||||
return elem.find(selector);
|
||||
}
|
||||
};
|
||||
|
||||
var pluginOptions = {
|
||||
clickToHide: true,
|
||||
autoHide: true,
|
||||
autoHideDelay: 5000,
|
||||
arrowShow: true,
|
||||
arrowSize: 5,
|
||||
breakNewLines: true,
|
||||
elementPosition: "bottom",
|
||||
globalPosition: "top right",
|
||||
style: "bootstrap",
|
||||
className: "error",
|
||||
showAnimation: "slideDown",
|
||||
showDuration: 400,
|
||||
hideAnimation: "slideUp",
|
||||
hideDuration: 200,
|
||||
gap: 5
|
||||
};
|
||||
|
||||
var inherit = function(a, b) {
|
||||
var F;
|
||||
F = function() {};
|
||||
F.prototype = a;
|
||||
return $.extend(true, new F(), b);
|
||||
};
|
||||
|
||||
var defaults = function(opts) {
|
||||
return $.extend(pluginOptions, opts);
|
||||
};
|
||||
|
||||
var createElem = function(tag) {
|
||||
return $("<" + tag + "></" + tag + ">");
|
||||
};
|
||||
|
||||
var globalAnchors = {};
|
||||
|
||||
var getAnchorElement = function(element) {
|
||||
var radios;
|
||||
if (element.is('[type=radio]')) {
|
||||
radios = element.parents('form:first').find('[type=radio]').filter(function(i, e) {
|
||||
return $(e).attr("name") === element.attr("name");
|
||||
});
|
||||
element = radios.first();
|
||||
}
|
||||
return element;
|
||||
};
|
||||
|
||||
var incr = function(obj, pos, val) {
|
||||
var opp, temp;
|
||||
if (typeof val === "string") {
|
||||
val = parseInt(val, 10);
|
||||
} else if (typeof val !== "number") {
|
||||
return;
|
||||
}
|
||||
if (isNaN(val)) {
|
||||
return;
|
||||
}
|
||||
opp = positions[opposites[pos.charAt(0)]];
|
||||
temp = pos;
|
||||
if (obj[opp] !== undefined) {
|
||||
pos = positions[opp.charAt(0)];
|
||||
val = -val;
|
||||
}
|
||||
if (obj[pos] === undefined) {
|
||||
obj[pos] = val;
|
||||
} else {
|
||||
obj[pos] += val;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
var realign = function(alignment, inner, outer) {
|
||||
if (alignment === "l" || alignment === "t") {
|
||||
return 0;
|
||||
} else if (alignment === "c" || alignment === "m") {
|
||||
return outer / 2 - inner / 2;
|
||||
} else if (alignment === "r" || alignment === "b") {
|
||||
return outer - inner;
|
||||
}
|
||||
throw "Invalid alignment";
|
||||
};
|
||||
|
||||
var encode = function(text) {
|
||||
encode.e = encode.e || createElem("div");
|
||||
return encode.e.text(text).html();
|
||||
};
|
||||
|
||||
function Notification(elem, data, options) {
|
||||
if (typeof options === "string") {
|
||||
options = {
|
||||
className: options
|
||||
};
|
||||
}
|
||||
this.options = inherit(pluginOptions, $.isPlainObject(options) ? options : {});
|
||||
this.loadHTML();
|
||||
this.wrapper = $(coreStyle.html);
|
||||
if (this.options.clickToHide) {
|
||||
this.wrapper.addClass(pluginClassName + "-hidable");
|
||||
}
|
||||
this.wrapper.data(pluginClassName, this);
|
||||
this.arrow = this.wrapper.find("." + pluginClassName + "-arrow");
|
||||
this.container = this.wrapper.find("." + pluginClassName + "-container");
|
||||
this.container.append(this.userContainer);
|
||||
if (elem && elem.length) {
|
||||
this.elementType = elem.attr("type");
|
||||
this.originalElement = elem;
|
||||
this.elem = getAnchorElement(elem);
|
||||
this.elem.data(pluginClassName, this);
|
||||
this.elem.before(this.wrapper);
|
||||
}
|
||||
this.container.hide();
|
||||
this.run(data);
|
||||
}
|
||||
|
||||
Notification.prototype.loadHTML = function() {
|
||||
var style;
|
||||
style = this.getStyle();
|
||||
this.userContainer = $(style.html);
|
||||
this.userFields = style.fields;
|
||||
};
|
||||
|
||||
Notification.prototype.show = function(show, userCallback) {
|
||||
var args, callback, elems, fn, hidden;
|
||||
callback = (function(_this) {
|
||||
return function() {
|
||||
if (!show && !_this.elem) {
|
||||
_this.destroy();
|
||||
}
|
||||
if (userCallback) {
|
||||
return userCallback();
|
||||
}
|
||||
};
|
||||
})(this);
|
||||
hidden = this.container.parent().parents(':hidden').length > 0;
|
||||
elems = this.container.add(this.arrow);
|
||||
args = [];
|
||||
if (hidden && show) {
|
||||
fn = "show";
|
||||
} else if (hidden && !show) {
|
||||
fn = "hide";
|
||||
} else if (!hidden && show) {
|
||||
fn = this.options.showAnimation;
|
||||
args.push(this.options.showDuration);
|
||||
} else if (!hidden && !show) {
|
||||
fn = this.options.hideAnimation;
|
||||
args.push(this.options.hideDuration);
|
||||
} else {
|
||||
return callback();
|
||||
}
|
||||
args.push(callback);
|
||||
return elems[fn].apply(elems, args);
|
||||
};
|
||||
|
||||
Notification.prototype.setGlobalPosition = function() {
|
||||
var p = this.getPosition();
|
||||
var pMain = p[0];
|
||||
var pAlign = p[1];
|
||||
var main = positions[pMain];
|
||||
var align = positions[pAlign];
|
||||
var key = pMain + "|" + pAlign;
|
||||
var anchor = globalAnchors[key];
|
||||
if (!anchor || !document.body.contains(anchor[0])) {
|
||||
anchor = globalAnchors[key] = createElem("div");
|
||||
var css = {};
|
||||
css[main] = 0;
|
||||
if (align === "middle") {
|
||||
css.top = '45%';
|
||||
} else if (align === "center") {
|
||||
css.left = '45%';
|
||||
} else {
|
||||
css[align] = 0;
|
||||
}
|
||||
anchor.css(css).addClass(pluginClassName + "-corner");
|
||||
$("body").append(anchor);
|
||||
}
|
||||
return anchor.prepend(this.wrapper);
|
||||
};
|
||||
|
||||
Notification.prototype.setElementPosition = function() {
|
||||
var arrowColor, arrowCss, arrowSize, color, contH, contW, css, elemH, elemIH, elemIW, elemPos, elemW, gap, j, k, len, len1, mainFull, margin, opp, oppFull, pAlign, pArrow, pMain, pos, posFull, position, ref, wrapPos;
|
||||
position = this.getPosition();
|
||||
pMain = position[0];
|
||||
pAlign = position[1];
|
||||
pArrow = position[2];
|
||||
elemPos = this.elem.position();
|
||||
elemH = this.elem.outerHeight();
|
||||
elemW = this.elem.outerWidth();
|
||||
elemIH = this.elem.innerHeight();
|
||||
elemIW = this.elem.innerWidth();
|
||||
wrapPos = this.wrapper.position();
|
||||
contH = this.container.height();
|
||||
contW = this.container.width();
|
||||
mainFull = positions[pMain];
|
||||
opp = opposites[pMain];
|
||||
oppFull = positions[opp];
|
||||
css = {};
|
||||
css[oppFull] = pMain === "b" ? elemH : pMain === "r" ? elemW : 0;
|
||||
incr(css, "top", elemPos.top - wrapPos.top);
|
||||
incr(css, "left", elemPos.left - wrapPos.left);
|
||||
ref = ["top", "left"];
|
||||
for (j = 0, len = ref.length; j < len; j++) {
|
||||
pos = ref[j];
|
||||
margin = parseInt(this.elem.css("margin-" + pos), 10);
|
||||
if (margin) {
|
||||
incr(css, pos, margin);
|
||||
}
|
||||
}
|
||||
gap = Math.max(0, this.options.gap - (this.options.arrowShow ? arrowSize : 0));
|
||||
incr(css, oppFull, gap);
|
||||
if (!this.options.arrowShow) {
|
||||
this.arrow.hide();
|
||||
} else {
|
||||
arrowSize = this.options.arrowSize;
|
||||
arrowCss = $.extend({}, css);
|
||||
arrowColor = this.userContainer.css("border-color") || this.userContainer.css("border-top-color") || this.userContainer.css("background-color") || "white";
|
||||
for (k = 0, len1 = mainPositions.length; k < len1; k++) {
|
||||
pos = mainPositions[k];
|
||||
posFull = positions[pos];
|
||||
if (pos === opp) {
|
||||
continue;
|
||||
}
|
||||
color = posFull === mainFull ? arrowColor : "transparent";
|
||||
arrowCss["border-" + posFull] = arrowSize + "px solid " + color;
|
||||
}
|
||||
incr(css, positions[opp], arrowSize);
|
||||
if (indexOf.call(mainPositions, pAlign) >= 0) {
|
||||
incr(arrowCss, positions[pAlign], arrowSize * 2);
|
||||
}
|
||||
}
|
||||
if (indexOf.call(vAligns, pMain) >= 0) {
|
||||
incr(css, "left", realign(pAlign, contW, elemW));
|
||||
if (arrowCss) {
|
||||
incr(arrowCss, "left", realign(pAlign, arrowSize, elemIW));
|
||||
}
|
||||
} else if (indexOf.call(hAligns, pMain) >= 0) {
|
||||
incr(css, "top", realign(pAlign, contH, elemH));
|
||||
if (arrowCss) {
|
||||
incr(arrowCss, "top", realign(pAlign, arrowSize, elemIH));
|
||||
}
|
||||
}
|
||||
if (this.container.is(":visible")) {
|
||||
css.display = "block";
|
||||
}
|
||||
this.container.removeAttr("style").css(css);
|
||||
if (arrowCss) {
|
||||
return this.arrow.removeAttr("style").css(arrowCss);
|
||||
}
|
||||
};
|
||||
|
||||
Notification.prototype.getPosition = function() {
|
||||
var pos, ref, ref1, ref2, ref3, ref4, ref5, text;
|
||||
text = this.options.position || (this.elem ? this.options.elementPosition : this.options.globalPosition);
|
||||
pos = parsePosition(text);
|
||||
if (pos.length === 0) {
|
||||
pos[0] = "b";
|
||||
}
|
||||
if (ref = pos[0], indexOf.call(mainPositions, ref) < 0) {
|
||||
throw "Must be one of [" + mainPositions + "]";
|
||||
}
|
||||
if (pos.length === 1 || ((ref1 = pos[0], indexOf.call(vAligns, ref1) >= 0) && (ref2 = pos[1], indexOf.call(hAligns, ref2) < 0)) || ((ref3 = pos[0], indexOf.call(hAligns, ref3) >= 0) && (ref4 = pos[1], indexOf.call(vAligns, ref4) < 0))) {
|
||||
pos[1] = (ref5 = pos[0], indexOf.call(hAligns, ref5) >= 0) ? "m" : "l";
|
||||
}
|
||||
if (pos.length === 2) {
|
||||
pos[2] = pos[1];
|
||||
}
|
||||
return pos;
|
||||
};
|
||||
|
||||
Notification.prototype.getStyle = function(name) {
|
||||
var style;
|
||||
if (!name) {
|
||||
name = this.options.style;
|
||||
}
|
||||
if (!name) {
|
||||
name = "default";
|
||||
}
|
||||
style = styles[name];
|
||||
if (!style) {
|
||||
throw "Missing style: " + name;
|
||||
}
|
||||
return style;
|
||||
};
|
||||
|
||||
Notification.prototype.updateClasses = function() {
|
||||
var classes, style;
|
||||
classes = ["base"];
|
||||
if ($.isArray(this.options.className)) {
|
||||
classes = classes.concat(this.options.className);
|
||||
} else if (this.options.className) {
|
||||
classes.push(this.options.className);
|
||||
}
|
||||
style = this.getStyle();
|
||||
classes = $.map(classes, function(n) {
|
||||
return pluginClassName + "-" + style.name + "-" + n;
|
||||
}).join(" ");
|
||||
return this.userContainer.attr("class", classes);
|
||||
};
|
||||
|
||||
Notification.prototype.run = function(data, options) {
|
||||
var d, datas, name, type, value;
|
||||
if ($.isPlainObject(options)) {
|
||||
$.extend(this.options, options);
|
||||
} else if ($.type(options) === "string") {
|
||||
this.options.className = options;
|
||||
}
|
||||
if (this.container && !data) {
|
||||
this.show(false);
|
||||
return;
|
||||
} else if (!this.container && !data) {
|
||||
return;
|
||||
}
|
||||
datas = {};
|
||||
if ($.isPlainObject(data)) {
|
||||
datas = data;
|
||||
} else {
|
||||
datas[blankFieldName] = data;
|
||||
}
|
||||
for (name in datas) {
|
||||
d = datas[name];
|
||||
type = this.userFields[name];
|
||||
if (!type) {
|
||||
continue;
|
||||
}
|
||||
if (type === "text") {
|
||||
// d = encode(d);
|
||||
if (this.options.breakNewLines) {
|
||||
d = d.replace(/\n/g, '<br/>');
|
||||
}
|
||||
}
|
||||
value = name === blankFieldName ? '' : '=' + name;
|
||||
find(this.userContainer, "[data-notify-" + type + value + "]").html(d);
|
||||
}
|
||||
this.updateClasses();
|
||||
if (this.elem) {
|
||||
this.setElementPosition();
|
||||
} else {
|
||||
this.setGlobalPosition();
|
||||
}
|
||||
this.show(true);
|
||||
if (this.options.autoHide) {
|
||||
clearTimeout(this.autohideTimer);
|
||||
this.autohideTimer = setTimeout(this.show.bind(this, false), this.options.autoHideDelay);
|
||||
}
|
||||
};
|
||||
|
||||
Notification.prototype.destroy = function() {
|
||||
this.wrapper.data(pluginClassName, null);
|
||||
this.wrapper.remove();
|
||||
};
|
||||
|
||||
$[pluginName] = function(elem, data, options) {
|
||||
if ((elem && elem.nodeName) || elem.jquery) {
|
||||
$(elem)[pluginName](data, options);
|
||||
} else {
|
||||
options = data;
|
||||
data = elem;
|
||||
new Notification(null, data, options);
|
||||
}
|
||||
return elem;
|
||||
};
|
||||
|
||||
$.fn[pluginName] = function(data, options) {
|
||||
$(this).each(function() {
|
||||
var prev = getAnchorElement($(this)).data(pluginClassName);
|
||||
if (prev) {
|
||||
prev.destroy();
|
||||
}
|
||||
var curr = new Notification($(this), data, options);
|
||||
});
|
||||
return this;
|
||||
};
|
||||
|
||||
$.extend($[pluginName], {
|
||||
defaults: defaults,
|
||||
addStyle: addStyle,
|
||||
removeStyle: removeStyle,
|
||||
pluginOptions: pluginOptions,
|
||||
getStyle: getStyle,
|
||||
insertCSS: insertCSS
|
||||
});
|
||||
|
||||
//always include the default bootstrap style
|
||||
addStyle("bootstrap", {
|
||||
html: "<div>\n<span data-notify-text></span>\n</div>",
|
||||
classes: {
|
||||
base: {
|
||||
"font-weight": "bold",
|
||||
"padding": "8px 15px 8px 14px",
|
||||
"text-shadow": "0 1px 0 rgba(255, 255, 255, 0.5)",
|
||||
"background-color": "#fcf8e3",
|
||||
"border": "1px solid #fbeed5",
|
||||
"border-radius": "4px",
|
||||
"white-space": "nowrap",
|
||||
"padding-left": "25px",
|
||||
"background-repeat": "no-repeat",
|
||||
"background-position": "3px 7px"
|
||||
},
|
||||
error: {
|
||||
"color": "#B94A48",
|
||||
"background-color": "#F2DEDE",
|
||||
"border-color": "#EED3D7",
|
||||
"background-image": "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAtRJREFUeNqkVc1u00AQHq+dOD+0poIQfkIjalW0SEGqRMuRnHos3DjwAH0ArlyQeANOOSMeAA5VjyBxKBQhgSpVUKKQNGloFdw4cWw2jtfMOna6JOUArDTazXi/b3dm55socPqQhFka++aHBsI8GsopRJERNFlY88FCEk9Yiwf8RhgRyaHFQpPHCDmZG5oX2ui2yilkcTT1AcDsbYC1NMAyOi7zTX2Agx7A9luAl88BauiiQ/cJaZQfIpAlngDcvZZMrl8vFPK5+XktrWlx3/ehZ5r9+t6e+WVnp1pxnNIjgBe4/6dAysQc8dsmHwPcW9C0h3fW1hans1ltwJhy0GxK7XZbUlMp5Ww2eyan6+ft/f2FAqXGK4CvQk5HueFz7D6GOZtIrK+srupdx1GRBBqNBtzc2AiMr7nPplRdKhb1q6q6zjFhrklEFOUutoQ50xcX86ZlqaZpQrfbBdu2R6/G19zX6XSgh6RX5ubyHCM8nqSID6ICrGiZjGYYxojEsiw4PDwMSL5VKsC8Yf4VRYFzMzMaxwjlJSlCyAQ9l0CW44PBADzXhe7xMdi9HtTrdYjFYkDQL0cn4Xdq2/EAE+InCnvADTf2eah4Sx9vExQjkqXT6aAERICMewd/UAp/IeYANM2joxt+q5VI+ieq2i0Wg3l6DNzHwTERPgo1ko7XBXj3vdlsT2F+UuhIhYkp7u7CarkcrFOCtR3H5JiwbAIeImjT/YQKKBtGjRFCU5IUgFRe7fF4cCNVIPMYo3VKqxwjyNAXNepuopyqnld602qVsfRpEkkz+GFL1wPj6ySXBpJtWVa5xlhpcyhBNwpZHmtX8AGgfIExo0ZpzkWVTBGiXCSEaHh62/PoR0p/vHaczxXGnj4bSo+G78lELU80h1uogBwWLf5YlsPmgDEd4M236xjm+8nm4IuE/9u+/PH2JXZfbwz4zw1WbO+SQPpXfwG/BBgAhCNZiSb/pOQAAAAASUVORK5CYII=)"
|
||||
},
|
||||
success: {
|
||||
"color": "#468847",
|
||||
"background-color": "#DFF0D8",
|
||||
"border-color": "#D6E9C6",
|
||||
"background-image": "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAutJREFUeNq0lctPE0Ecx38zu/RFS1EryqtgJFA08YCiMZIAQQ4eRG8eDGdPJiYeTIwHTfwPiAcvXIwXLwoXPaDxkWgQ6islKlJLSQWLUraPLTv7Gme32zoF9KSTfLO7v53vZ3d/M7/fIth+IO6INt2jjoA7bjHCJoAlzCRw59YwHYjBnfMPqAKWQYKjGkfCJqAF0xwZjipQtA3MxeSG87VhOOYegVrUCy7UZM9S6TLIdAamySTclZdYhFhRHloGYg7mgZv1Zzztvgud7V1tbQ2twYA34LJmF4p5dXF1KTufnE+SxeJtuCZNsLDCQU0+RyKTF27Unw101l8e6hns3u0PBalORVVVkcaEKBJDgV3+cGM4tKKmI+ohlIGnygKX00rSBfszz/n2uXv81wd6+rt1orsZCHRdr1Imk2F2Kob3hutSxW8thsd8AXNaln9D7CTfA6O+0UgkMuwVvEFFUbbAcrkcTA8+AtOk8E6KiQiDmMFSDqZItAzEVQviRkdDdaFgPp8HSZKAEAL5Qh7Sq2lIJBJwv2scUqkUnKoZgNhcDKhKg5aH+1IkcouCAdFGAQsuWZYhOjwFHQ96oagWgRoUov1T9kRBEODAwxM2QtEUl+Wp+Ln9VRo6BcMw4ErHRYjH4/B26AlQoQQTRdHWwcd9AH57+UAXddvDD37DmrBBV34WfqiXPl61g+vr6xA9zsGeM9gOdsNXkgpEtTwVvwOklXLKm6+/p5ezwk4B+j6droBs2CsGa/gNs6RIxazl4Tc25mpTgw/apPR1LYlNRFAzgsOxkyXYLIM1V8NMwyAkJSctD1eGVKiq5wWjSPdjmeTkiKvVW4f2YPHWl3GAVq6ymcyCTgovM3FzyRiDe2TaKcEKsLpJvNHjZgPNqEtyi6mZIm4SRFyLMUsONSSdkPeFtY1n0mczoY3BHTLhwPRy9/lzcziCw9ACI+yql0VLzcGAZbYSM5CCSZg1/9oc/nn7+i8N9p/8An4JMADxhH+xHfuiKwAAAABJRU5ErkJggg==)"
|
||||
},
|
||||
info: {
|
||||
"color": "#3A87AD",
|
||||
"background-color": "#D9EDF7",
|
||||
"border-color": "#BCE8F1",
|
||||
"background-image": "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3QYFAhkSsdes/QAAA8dJREFUOMvVlGtMW2UYx//POaWHXg6lLaW0ypAtw1UCgbniNOLcVOLmAjHZolOYlxmTGXVZdAnRfXQm+7SoU4mXaOaiZsEpC9FkiQs6Z6bdCnNYruM6KNBw6YWewzl9z+sHImEWv+vz7XmT95f/+3/+7wP814v+efDOV3/SoX3lHAA+6ODeUFfMfjOWMADgdk+eEKz0pF7aQdMAcOKLLjrcVMVX3xdWN29/GhYP7SvnP0cWfS8caSkfHZsPE9Fgnt02JNutQ0QYHB2dDz9/pKX8QjjuO9xUxd/66HdxTeCHZ3rojQObGQBcuNjfplkD3b19Y/6MrimSaKgSMmpGU5WevmE/swa6Oy73tQHA0Rdr2Mmv/6A1n9w9suQ7097Z9lM4FlTgTDrzZTu4StXVfpiI48rVcUDM5cmEksrFnHxfpTtU/3BFQzCQF/2bYVoNbH7zmItbSoMj40JSzmMyX5qDvriA7QdrIIpA+3cdsMpu0nXI8cV0MtKXCPZev+gCEM1S2NHPvWfP/hL+7FSr3+0p5RBEyhEN5JCKYr8XnASMT0xBNyzQGQeI8fjsGD39RMPk7se2bd5ZtTyoFYXftF6y37gx7NeUtJJOTFlAHDZLDuILU3j3+H5oOrD3yWbIztugaAzgnBKJuBLpGfQrS8wO4FZgV+c1IxaLgWVU0tMLEETCos4xMzEIv9cJXQcyagIwigDGwJgOAtHAwAhisQUjy0ORGERiELgG4iakkzo4MYAxcM5hAMi1WWG1yYCJIcMUaBkVRLdGeSU2995TLWzcUAzONJ7J6FBVBYIggMzmFbvdBV44Corg8vjhzC+EJEl8U1kJtgYrhCzgc/vvTwXKSib1paRFVRVORDAJAsw5FuTaJEhWM2SHB3mOAlhkNxwuLzeJsGwqWzf5TFNdKgtY5qHp6ZFf67Y/sAVadCaVY5YACDDb3Oi4NIjLnWMw2QthCBIsVhsUTU9tvXsjeq9+X1d75/KEs4LNOfcdf/+HthMnvwxOD0wmHaXr7ZItn2wuH2SnBzbZAbPJwpPx+VQuzcm7dgRCB57a1uBzUDRL4bfnI0RE0eaXd9W89mpjqHZnUI5Hh2l2dkZZUhOqpi2qSmpOmZ64Tuu9qlz/SEXo6MEHa3wOip46F1n7633eekV8ds8Wxjn37Wl63VVa+ej5oeEZ/82ZBETJjpJ1Rbij2D3Z/1trXUvLsblCK0XfOx0SX2kMsn9dX+d+7Kf6h8o4AIykuffjT8L20LU+w4AZd5VvEPY+XpWqLV327HR7DzXuDnD8r+ovkBehJ8i+y8YAAAAASUVORK5CYII=)"
|
||||
},
|
||||
warn: {
|
||||
"color": "#C09853",
|
||||
"background-color": "#FCF8E3",
|
||||
"border-color": "#FBEED5",
|
||||
"background-image": "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAMAAAC6V+0/AAABJlBMVEXr6eb/2oD/wi7/xjr/0mP/ykf/tQD/vBj/3o7/uQ//vyL/twebhgD/4pzX1K3z8e349vK6tHCilCWbiQymn0jGworr6dXQza3HxcKkn1vWvV/5uRfk4dXZ1bD18+/52YebiAmyr5S9mhCzrWq5t6ufjRH54aLs0oS+qD751XqPhAybhwXsujG3sm+Zk0PTwG6Shg+PhhObhwOPgQL4zV2nlyrf27uLfgCPhRHu7OmLgAafkyiWkD3l49ibiAfTs0C+lgCniwD4sgDJxqOilzDWowWFfAH08uebig6qpFHBvH/aw26FfQTQzsvy8OyEfz20r3jAvaKbhgG9q0nc2LbZxXanoUu/u5WSggCtp1anpJKdmFz/zlX/1nGJiYmuq5Dx7+sAAADoPUZSAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfdBgUBGhh4aah5AAAAlklEQVQY02NgoBIIE8EUcwn1FkIXM1Tj5dDUQhPU502Mi7XXQxGz5uVIjGOJUUUW81HnYEyMi2HVcUOICQZzMMYmxrEyMylJwgUt5BljWRLjmJm4pI1hYp5SQLGYxDgmLnZOVxuooClIDKgXKMbN5ggV1ACLJcaBxNgcoiGCBiZwdWxOETBDrTyEFey0jYJ4eHjMGWgEAIpRFRCUt08qAAAAAElFTkSuQmCC)"
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(function() {
|
||||
insertCSS(coreStyle.css).attr("id", "core-notify");
|
||||
$(document).on("click", "." + pluginClassName + "-hidable", function(e) {
|
||||
$(this).trigger("notify-hide");
|
||||
});
|
||||
$(document).on("notify-hide", "." + pluginClassName + "-wrapper", function(e) {
|
||||
var elem = $(this).data(pluginClassName);
|
||||
if(elem) {
|
||||
elem.show(false);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
}));
|
||||
@@ -0,0 +1 @@
|
||||
(function(e){typeof define=="function"&&define.amd?define(["jquery"],e):typeof module=="object"&&module.exports?module.exports=function(t,n){return n===undefined&&(typeof window!="undefined"?n=require("jquery"):n=require("jquery")(t)),e(n),n}:e(jQuery)})(function(e){function A(t,n,i){typeof i=="string"&&(i={className:i}),this.options=E(w,e.isPlainObject(i)?i:{}),this.loadHTML(),this.wrapper=e(h.html),this.options.clickToHide&&this.wrapper.addClass(r+"-hidable"),this.wrapper.data(r,this),this.arrow=this.wrapper.find("."+r+"-arrow"),this.container=this.wrapper.find("."+r+"-container"),this.container.append(this.userContainer),t&&t.length&&(this.elementType=t.attr("type"),this.originalElement=t,this.elem=N(t),this.elem.data(r,this),this.elem.before(this.wrapper)),this.container.hide(),this.run(n)}var t=[].indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(t in this&&this[t]===e)return t;return-1},n="notify",r=n+"js",i=n+"!blank",s={t:"top",m:"middle",b:"bottom",l:"left",c:"center",r:"right"},o=["l","c","r"],u=["t","m","b"],a=["t","b","l","r"],f={t:"b",m:null,b:"t",l:"r",c:null,r:"l"},l=function(t){var n;return n=[],e.each(t.split(/\W+/),function(e,t){var r;r=t.toLowerCase().charAt(0);if(s[r])return n.push(r)}),n},c={},h={name:"core",html:'<div class="'+r+'-wrapper">\n <div class="'+r+'-arrow"></div>\n <div class="'+r+'-container"></div>\n</div>',css:"."+r+"-corner {\n position: fixed;\n margin: 5px;\n z-index: 1050;\n}\n\n."+r+"-corner ."+r+"-wrapper,\n."+r+"-corner ."+r+"-container {\n position: relative;\n display: block;\n height: inherit;\n width: inherit;\n margin: 3px;\n}\n\n."+r+"-wrapper {\n z-index: 1;\n position: absolute;\n display: inline-block;\n height: 0;\n width: 0;\n}\n\n."+r+"-container {\n display: none;\n z-index: 1;\n position: absolute;\n}\n\n."+r+"-hidable {\n cursor: pointer;\n}\n\n[data-notify-text],[data-notify-html] {\n position: relative;\n}\n\n."+r+"-arrow {\n position: absolute;\n z-index: 2;\n width: 0;\n height: 0;\n}"},p={"border-radius":["-webkit-","-moz-"]},d=function(e){return c[e]},v=function(e){if(!e)throw"Missing Style name";c[e]&&delete c[e]},m=function(t,i){if(!t)throw"Missing Style name";if(!i)throw"Missing Style definition";if(!i.html)throw"Missing Style HTML";var s=c[t];s&&s.cssElem&&(window.console&&console.warn(n+": overwriting style '"+t+"'"),c[t].cssElem.remove()),i.name=t,c[t]=i;var o="";i.classes&&e.each(i.classes,function(t,n){return o+="."+r+"-"+i.name+"-"+t+" {\n",e.each(n,function(t,n){return p[t]&&e.each(p[t],function(e,r){return o+=" "+r+t+": "+n+";\n"}),o+=" "+t+": "+n+";\n"}),o+="}\n"}),i.css&&(o+="/* styles for "+i.name+" */\n"+i.css),o&&(i.cssElem=g(o),i.cssElem.attr("id","notify-"+i.name));var u={},a=e(i.html);y("html",a,u),y("text",a,u),i.fields=u},g=function(t){var n,r,i;r=x("style"),r.attr("type","text/css"),e("head").append(r);try{r.html(t)}catch(s){r[0].styleSheet.cssText=t}return r},y=function(t,n,r){var s;return t!=="html"&&(t="text"),s="data-notify-"+t,b(n,"["+s+"]").each(function(){var n;n=e(this).attr(s),n||(n=i),r[n]=t})},b=function(e,t){return e.is(t)?e:e.find(t)},w={clickToHide:!0,autoHide:!0,autoHideDelay:5e3,arrowShow:!0,arrowSize:5,breakNewLines:!0,elementPosition:"bottom",globalPosition:"top right",style:"bootstrap",className:"error",showAnimation:"slideDown",showDuration:400,hideAnimation:"slideUp",hideDuration:200,gap:5},E=function(t,n){var r;return r=function(){},r.prototype=t,e.extend(!0,new r,n)},S=function(t){return e.extend(w,t)},x=function(t){return e("<"+t+"></"+t+">")},T={},N=function(t){var n;return t.is("[type=radio]")&&(n=t.parents("form:first").find("[type=radio]").filter(function(n,r){return e(r).attr("name")===t.attr("name")}),t=n.first()),t},C=function(e,t,n){var r,i;if(typeof n=="string")n=parseInt(n,10);else if(typeof n!="number")return;if(isNaN(n))return;return r=s[f[t.charAt(0)]],i=t,e[r]!==undefined&&(t=s[r.charAt(0)],n=-n),e[t]===undefined?e[t]=n:e[t]+=n,null},k=function(e,t,n){if(e==="l"||e==="t")return 0;if(e==="c"||e==="m")return n/2-t/2;if(e==="r"||e==="b")return n-t;throw"Invalid alignment"},L=function(e){return L.e=L.e||x("div"),L.e.text(e).html()};A.prototype.loadHTML=function(){var t;t=this.getStyle(),this.userContainer=e(t.html),this.userFields=t.fields},A.prototype.show=function(e,t){var n,r,i,s,o;r=function(n){return function(){!e&&!n.elem&&n.destroy();if(t)return t()}}(this),o=this.container.parent().parents(":hidden").length>0,i=this.container.add(this.arrow),n=[];if(o&&e)s="show";else if(o&&!e)s="hide";else if(!o&&e)s=this.options.showAnimation,n.push(this.options.showDuration);else{if(!!o||!!e)return r();s=this.options.hideAnimation,n.push(this.options.hideDuration)}return n.push(r),i[s].apply(i,n)},A.prototype.setGlobalPosition=function(){var t=this.getPosition(),n=t[0],i=t[1],o=s[n],u=s[i],a=n+"|"+i,f=T[a];if(!f||!document.body.contains(f[0])){f=T[a]=x("div");var l={};l[o]=0,u==="middle"?l.top="45%":u==="center"?l.left="45%":l[u]=0,f.css(l).addClass(r+"-corner"),e("body").append(f)}return f.prepend(this.wrapper)},A.prototype.setElementPosition=function(){var n,r,i,l,c,h,p,d,v,m,g,y,b,w,E,S,x,T,N,L,A,O,M,_,D,P,H,B,j;H=this.getPosition(),_=H[0],O=H[1],M=H[2],g=this.elem.position(),d=this.elem.outerHeight(),y=this.elem.outerWidth(),v=this.elem.innerHeight(),m=this.elem.innerWidth(),j=this.wrapper.position(),c=this.container.height(),h=this.container.width(),T=s[_],L=f[_],A=s[L],p={},p[A]=_==="b"?d:_==="r"?y:0,C(p,"top",g.top-j.top),C(p,"left",g.left-j.left),B=["top","left"];for(w=0,S=B.length;w<S;w++)D=B[w],N=parseInt(this.elem.css("margin-"+D),10),N&&C(p,D,N);b=Math.max(0,this.options.gap-(this.options.arrowShow?i:0)),C(p,A,b);if(!this.options.arrowShow)this.arrow.hide();else{i=this.options.arrowSize,r=e.extend({},p),n=this.userContainer.css("border-color")||this.userContainer.css("border-top-color")||this.userContainer.css("background-color")||"white";for(E=0,x=a.length;E<x;E++){D=a[E],P=s[D];if(D===L)continue;l=P===T?n:"transparent",r["border-"+P]=i+"px solid "+l}C(p,s[L],i),t.call(a,O)>=0&&C(r,s[O],i*2)}t.call(u,_)>=0?(C(p,"left",k(O,h,y)),r&&C(r,"left",k(O,i,m))):t.call(o,_)>=0&&(C(p,"top",k(O,c,d)),r&&C(r,"top",k(O,i,v))),this.container.is(":visible")&&(p.display="block"),this.container.removeAttr("style").css(p);if(r)return this.arrow.removeAttr("style").css(r)},A.prototype.getPosition=function(){var e,n,r,i,s,f,c,h;h=this.options.position||(this.elem?this.options.elementPosition:this.options.globalPosition),e=l(h),e.length===0&&(e[0]="b");if(n=e[0],t.call(a,n)<0)throw"Must be one of ["+a+"]";if(e.length===1||(r=e[0],t.call(u,r)>=0)&&(i=e[1],t.call(o,i)<0)||(s=e[0],t.call(o,s)>=0)&&(f=e[1],t.call(u,f)<0))e[1]=(c=e[0],t.call(o,c)>=0)?"m":"l";return e.length===2&&(e[2]=e[1]),e},A.prototype.getStyle=function(e){var t;e||(e=this.options.style),e||(e="default"),t=c[e];if(!t)throw"Missing style: "+e;return t},A.prototype.updateClasses=function(){var t,n;return t=["base"],e.isArray(this.options.className)?t=t.concat(this.options.className):this.options.className&&t.push(this.options.className),n=this.getStyle(),t=e.map(t,function(e){return r+"-"+n.name+"-"+e}).join(" "),this.userContainer.attr("class",t)},A.prototype.run=function(t,n){var r,s,o,u,a;e.isPlainObject(n)?e.extend(this.options,n):e.type(n)==="string"&&(this.options.className=n);if(this.container&&!t){this.show(!1);return}if(!this.container&&!t)return;s={},e.isPlainObject(t)?s=t:s[i]=t;for(o in s){r=s[o],u=this.userFields[o];if(!u)continue;u==="text"&&(r=L(r),this.options.breakNewLines&&(r=r.replace(/\n/g,"<br/>"))),a=o===i?"":"="+o,b(this.userContainer,"[data-notify-"+u+a+"]").html(r)}this.updateClasses(),this.elem?this.setElementPosition():this.setGlobalPosition(),this.show(!0),this.options.autoHide&&(clearTimeout(this.autohideTimer),this.autohideTimer=setTimeout(this.show.bind(this,!1),this.options.autoHideDelay))},A.prototype.destroy=function(){this.wrapper.data(r,null),this.wrapper.remove()},e[n]=function(t,r,i){return t&&t.nodeName||t.jquery?e(t)[n](r,i):(i=r,r=t,new A(null,r,i)),t},e.fn[n]=function(t,n){return e(this).each(function(){var i=N(e(this)).data(r);i&&i.destroy();var s=new A(e(this),t,n)}),this},e.extend(e[n],{defaults:S,addStyle:m,removeStyle:v,pluginOptions:w,getStyle:d,insertCSS:g}),m("bootstrap",{html:"<div>\n<span data-notify-text></span>\n</div>",classes:{base:{"font-weight":"bold",padding:"8px 15px 8px 14px","text-shadow":"0 1px 0 rgba(255, 255, 255, 0.5)","background-color":"#fcf8e3",border:"1px solid #fbeed5","border-radius":"4px","white-space":"nowrap","padding-left":"25px","background-repeat":"no-repeat","background-position":"3px 7px"},error:{color:"#B94A48","background-color":"#F2DEDE","border-color":"#EED3D7","background-image":"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAtRJREFUeNqkVc1u00AQHq+dOD+0poIQfkIjalW0SEGqRMuRnHos3DjwAH0ArlyQeANOOSMeAA5VjyBxKBQhgSpVUKKQNGloFdw4cWw2jtfMOna6JOUArDTazXi/b3dm55socPqQhFka++aHBsI8GsopRJERNFlY88FCEk9Yiwf8RhgRyaHFQpPHCDmZG5oX2ui2yilkcTT1AcDsbYC1NMAyOi7zTX2Agx7A9luAl88BauiiQ/cJaZQfIpAlngDcvZZMrl8vFPK5+XktrWlx3/ehZ5r9+t6e+WVnp1pxnNIjgBe4/6dAysQc8dsmHwPcW9C0h3fW1hans1ltwJhy0GxK7XZbUlMp5Ww2eyan6+ft/f2FAqXGK4CvQk5HueFz7D6GOZtIrK+srupdx1GRBBqNBtzc2AiMr7nPplRdKhb1q6q6zjFhrklEFOUutoQ50xcX86ZlqaZpQrfbBdu2R6/G19zX6XSgh6RX5ubyHCM8nqSID6ICrGiZjGYYxojEsiw4PDwMSL5VKsC8Yf4VRYFzMzMaxwjlJSlCyAQ9l0CW44PBADzXhe7xMdi9HtTrdYjFYkDQL0cn4Xdq2/EAE+InCnvADTf2eah4Sx9vExQjkqXT6aAERICMewd/UAp/IeYANM2joxt+q5VI+ieq2i0Wg3l6DNzHwTERPgo1ko7XBXj3vdlsT2F+UuhIhYkp7u7CarkcrFOCtR3H5JiwbAIeImjT/YQKKBtGjRFCU5IUgFRe7fF4cCNVIPMYo3VKqxwjyNAXNepuopyqnld602qVsfRpEkkz+GFL1wPj6ySXBpJtWVa5xlhpcyhBNwpZHmtX8AGgfIExo0ZpzkWVTBGiXCSEaHh62/PoR0p/vHaczxXGnj4bSo+G78lELU80h1uogBwWLf5YlsPmgDEd4M236xjm+8nm4IuE/9u+/PH2JXZfbwz4zw1WbO+SQPpXfwG/BBgAhCNZiSb/pOQAAAAASUVORK5CYII=)"},success:{color:"#468847","background-color":"#DFF0D8","border-color":"#D6E9C6","background-image":"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAutJREFUeNq0lctPE0Ecx38zu/RFS1EryqtgJFA08YCiMZIAQQ4eRG8eDGdPJiYeTIwHTfwPiAcvXIwXLwoXPaDxkWgQ6islKlJLSQWLUraPLTv7Gme32zoF9KSTfLO7v53vZ3d/M7/fIth+IO6INt2jjoA7bjHCJoAlzCRw59YwHYjBnfMPqAKWQYKjGkfCJqAF0xwZjipQtA3MxeSG87VhOOYegVrUCy7UZM9S6TLIdAamySTclZdYhFhRHloGYg7mgZv1Zzztvgud7V1tbQ2twYA34LJmF4p5dXF1KTufnE+SxeJtuCZNsLDCQU0+RyKTF27Unw101l8e6hns3u0PBalORVVVkcaEKBJDgV3+cGM4tKKmI+ohlIGnygKX00rSBfszz/n2uXv81wd6+rt1orsZCHRdr1Imk2F2Kob3hutSxW8thsd8AXNaln9D7CTfA6O+0UgkMuwVvEFFUbbAcrkcTA8+AtOk8E6KiQiDmMFSDqZItAzEVQviRkdDdaFgPp8HSZKAEAL5Qh7Sq2lIJBJwv2scUqkUnKoZgNhcDKhKg5aH+1IkcouCAdFGAQsuWZYhOjwFHQ96oagWgRoUov1T9kRBEODAwxM2QtEUl+Wp+Ln9VRo6BcMw4ErHRYjH4/B26AlQoQQTRdHWwcd9AH57+UAXddvDD37DmrBBV34WfqiXPl61g+vr6xA9zsGeM9gOdsNXkgpEtTwVvwOklXLKm6+/p5ezwk4B+j6droBs2CsGa/gNs6RIxazl4Tc25mpTgw/apPR1LYlNRFAzgsOxkyXYLIM1V8NMwyAkJSctD1eGVKiq5wWjSPdjmeTkiKvVW4f2YPHWl3GAVq6ymcyCTgovM3FzyRiDe2TaKcEKsLpJvNHjZgPNqEtyi6mZIm4SRFyLMUsONSSdkPeFtY1n0mczoY3BHTLhwPRy9/lzcziCw9ACI+yql0VLzcGAZbYSM5CCSZg1/9oc/nn7+i8N9p/8An4JMADxhH+xHfuiKwAAAABJRU5ErkJggg==)"},info:{color:"#3A87AD","background-color":"#D9EDF7","border-color":"#BCE8F1","background-image":"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3QYFAhkSsdes/QAAA8dJREFUOMvVlGtMW2UYx//POaWHXg6lLaW0ypAtw1UCgbniNOLcVOLmAjHZolOYlxmTGXVZdAnRfXQm+7SoU4mXaOaiZsEpC9FkiQs6Z6bdCnNYruM6KNBw6YWewzl9z+sHImEWv+vz7XmT95f/+3/+7wP814v+efDOV3/SoX3lHAA+6ODeUFfMfjOWMADgdk+eEKz0pF7aQdMAcOKLLjrcVMVX3xdWN29/GhYP7SvnP0cWfS8caSkfHZsPE9Fgnt02JNutQ0QYHB2dDz9/pKX8QjjuO9xUxd/66HdxTeCHZ3rojQObGQBcuNjfplkD3b19Y/6MrimSaKgSMmpGU5WevmE/swa6Oy73tQHA0Rdr2Mmv/6A1n9w9suQ7097Z9lM4FlTgTDrzZTu4StXVfpiI48rVcUDM5cmEksrFnHxfpTtU/3BFQzCQF/2bYVoNbH7zmItbSoMj40JSzmMyX5qDvriA7QdrIIpA+3cdsMpu0nXI8cV0MtKXCPZev+gCEM1S2NHPvWfP/hL+7FSr3+0p5RBEyhEN5JCKYr8XnASMT0xBNyzQGQeI8fjsGD39RMPk7se2bd5ZtTyoFYXftF6y37gx7NeUtJJOTFlAHDZLDuILU3j3+H5oOrD3yWbIztugaAzgnBKJuBLpGfQrS8wO4FZgV+c1IxaLgWVU0tMLEETCos4xMzEIv9cJXQcyagIwigDGwJgOAtHAwAhisQUjy0ORGERiELgG4iakkzo4MYAxcM5hAMi1WWG1yYCJIcMUaBkVRLdGeSU2995TLWzcUAzONJ7J6FBVBYIggMzmFbvdBV44Corg8vjhzC+EJEl8U1kJtgYrhCzgc/vvTwXKSib1paRFVRVORDAJAsw5FuTaJEhWM2SHB3mOAlhkNxwuLzeJsGwqWzf5TFNdKgtY5qHp6ZFf67Y/sAVadCaVY5YACDDb3Oi4NIjLnWMw2QthCBIsVhsUTU9tvXsjeq9+X1d75/KEs4LNOfcdf/+HthMnvwxOD0wmHaXr7ZItn2wuH2SnBzbZAbPJwpPx+VQuzcm7dgRCB57a1uBzUDRL4bfnI0RE0eaXd9W89mpjqHZnUI5Hh2l2dkZZUhOqpi2qSmpOmZ64Tuu9qlz/SEXo6MEHa3wOip46F1n7633eekV8ds8Wxjn37Wl63VVa+ej5oeEZ/82ZBETJjpJ1Rbij2D3Z/1trXUvLsblCK0XfOx0SX2kMsn9dX+d+7Kf6h8o4AIykuffjT8L20LU+w4AZd5VvEPY+XpWqLV327HR7DzXuDnD8r+ovkBehJ8i+y8YAAAAASUVORK5CYII=)"},warn:{color:"#C09853","background-color":"#FCF8E3","border-color":"#FBEED5","background-image":"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAMAAAC6V+0/AAABJlBMVEXr6eb/2oD/wi7/xjr/0mP/ykf/tQD/vBj/3o7/uQ//vyL/twebhgD/4pzX1K3z8e349vK6tHCilCWbiQymn0jGworr6dXQza3HxcKkn1vWvV/5uRfk4dXZ1bD18+/52YebiAmyr5S9mhCzrWq5t6ufjRH54aLs0oS+qD751XqPhAybhwXsujG3sm+Zk0PTwG6Shg+PhhObhwOPgQL4zV2nlyrf27uLfgCPhRHu7OmLgAafkyiWkD3l49ibiAfTs0C+lgCniwD4sgDJxqOilzDWowWFfAH08uebig6qpFHBvH/aw26FfQTQzsvy8OyEfz20r3jAvaKbhgG9q0nc2LbZxXanoUu/u5WSggCtp1anpJKdmFz/zlX/1nGJiYmuq5Dx7+sAAADoPUZSAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfdBgUBGhh4aah5AAAAlklEQVQY02NgoBIIE8EUcwn1FkIXM1Tj5dDUQhPU502Mi7XXQxGz5uVIjGOJUUUW81HnYEyMi2HVcUOICQZzMMYmxrEyMylJwgUt5BljWRLjmJm4pI1hYp5SQLGYxDgmLnZOVxuooClIDKgXKMbN5ggV1ACLJcaBxNgcoiGCBiZwdWxOETBDrTyEFey0jYJ4eHjMGWgEAIpRFRCUt08qAAAAAElFTkSuQmCC)"}}}),e(function(){g(h.css).attr("id","core-notify"),e(document).on("click","."+r+"-hidable",function(t){e(this).trigger("notify-hide")}),e(document).on("notify-hide","."+r+"-wrapper",function(t){var n=e(this).data(r);n&&n.show(!1)})})})
|
||||
@@ -0,0 +1,932 @@
|
||||
body.stop-scrolling {
|
||||
height: 100%;
|
||||
overflow: hidden; }
|
||||
|
||||
.sweet-overlay {
|
||||
background-color: black;
|
||||
/* IE8 */
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=40)";
|
||||
/* IE8 */
|
||||
background-color: rgba(0, 0, 0, 0.4);
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
display: none;
|
||||
z-index: 10000; }
|
||||
|
||||
.sweet-alert {
|
||||
background-color: white;
|
||||
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
width: 478px;
|
||||
padding: 17px;
|
||||
border-radius: 5px;
|
||||
text-align: center;
|
||||
position: fixed;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
margin-left: -256px;
|
||||
margin-top: -200px;
|
||||
overflow: hidden;
|
||||
display: none;
|
||||
z-index: 99999; }
|
||||
@media all and (max-width: 540px) {
|
||||
.sweet-alert {
|
||||
width: auto;
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
left: 15px;
|
||||
right: 15px; } }
|
||||
.sweet-alert h2 {
|
||||
color: #575757;
|
||||
font-size: 30px;
|
||||
text-align: center;
|
||||
font-weight: 600;
|
||||
text-transform: none;
|
||||
position: relative;
|
||||
margin: 25px 0;
|
||||
padding: 0;
|
||||
line-height: 40px;
|
||||
display: block; }
|
||||
.sweet-alert p {
|
||||
color: #797979;
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
font-weight: 300;
|
||||
position: relative;
|
||||
text-align: inherit;
|
||||
float: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
line-height: normal; }
|
||||
.sweet-alert fieldset {
|
||||
border: none;
|
||||
position: relative; }
|
||||
.sweet-alert .sa-error-container {
|
||||
background-color: #f1f1f1;
|
||||
margin-left: -17px;
|
||||
margin-right: -17px;
|
||||
overflow: hidden;
|
||||
padding: 0 10px;
|
||||
max-height: 0;
|
||||
webkit-transition: padding 0.15s, max-height 0.15s;
|
||||
transition: padding 0.15s, max-height 0.15s; }
|
||||
.sweet-alert .sa-error-container.show {
|
||||
padding: 10px 0;
|
||||
max-height: 100px;
|
||||
webkit-transition: padding 0.2s, max-height 0.2s;
|
||||
transition: padding 0.25s, max-height 0.25s; }
|
||||
.sweet-alert .sa-error-container .icon {
|
||||
display: inline-block;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
border-radius: 50%;
|
||||
background-color: #ea7d7d;
|
||||
color: white;
|
||||
line-height: 24px;
|
||||
text-align: center;
|
||||
margin-right: 3px; }
|
||||
.sweet-alert .sa-error-container p {
|
||||
display: inline-block; }
|
||||
.sweet-alert .sa-input-error {
|
||||
position: absolute;
|
||||
top: 29px;
|
||||
right: 26px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
opacity: 0;
|
||||
-webkit-transform: scale(0.5);
|
||||
transform: scale(0.5);
|
||||
-webkit-transform-origin: 50% 50%;
|
||||
transform-origin: 50% 50%;
|
||||
-webkit-transition: all 0.1s;
|
||||
transition: all 0.1s; }
|
||||
.sweet-alert .sa-input-error::before, .sweet-alert .sa-input-error::after {
|
||||
content: "";
|
||||
width: 20px;
|
||||
height: 6px;
|
||||
background-color: #f06e57;
|
||||
border-radius: 3px;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
margin-top: -4px;
|
||||
left: 50%;
|
||||
margin-left: -9px; }
|
||||
.sweet-alert .sa-input-error::before {
|
||||
-webkit-transform: rotate(-45deg);
|
||||
transform: rotate(-45deg); }
|
||||
.sweet-alert .sa-input-error::after {
|
||||
-webkit-transform: rotate(45deg);
|
||||
transform: rotate(45deg); }
|
||||
.sweet-alert .sa-input-error.show {
|
||||
opacity: 1;
|
||||
-webkit-transform: scale(1);
|
||||
transform: scale(1); }
|
||||
.sweet-alert input {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
border-radius: 3px;
|
||||
border: 1px solid #d7d7d7;
|
||||
height: 43px;
|
||||
margin-top: 10px;
|
||||
margin-bottom: 17px;
|
||||
font-size: 18px;
|
||||
box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.06);
|
||||
padding: 0 12px;
|
||||
display: none;
|
||||
-webkit-transition: all 0.3s;
|
||||
transition: all 0.3s; }
|
||||
.sweet-alert input:focus {
|
||||
outline: none;
|
||||
box-shadow: 0px 0px 3px #c4e6f5;
|
||||
border: 1px solid #b4dbed; }
|
||||
.sweet-alert input:focus::-moz-placeholder {
|
||||
transition: opacity 0.3s 0.03s ease;
|
||||
opacity: 0.5; }
|
||||
.sweet-alert input:focus:-ms-input-placeholder {
|
||||
transition: opacity 0.3s 0.03s ease;
|
||||
opacity: 0.5; }
|
||||
.sweet-alert input:focus::-webkit-input-placeholder {
|
||||
transition: opacity 0.3s 0.03s ease;
|
||||
opacity: 0.5; }
|
||||
.sweet-alert input::-moz-placeholder {
|
||||
color: #bdbdbd; }
|
||||
.sweet-alert input:-ms-input-placeholder {
|
||||
color: #bdbdbd; }
|
||||
.sweet-alert input::-webkit-input-placeholder {
|
||||
color: #bdbdbd; }
|
||||
.sweet-alert.show-input input {
|
||||
display: block; }
|
||||
.sweet-alert .sa-confirm-button-container {
|
||||
display: inline-block;
|
||||
position: relative; }
|
||||
.sweet-alert .la-ball-fall {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
margin-left: -27px;
|
||||
margin-top: 4px;
|
||||
opacity: 0;
|
||||
visibility: hidden; }
|
||||
.sweet-alert button {
|
||||
background-color: #8CD4F5;
|
||||
color: white;
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
font-size: 17px;
|
||||
font-weight: 500;
|
||||
-webkit-border-radius: 4px;
|
||||
border-radius: 5px;
|
||||
padding: 10px 32px;
|
||||
margin: 26px 5px 0 5px;
|
||||
cursor: pointer; }
|
||||
.sweet-alert button:focus {
|
||||
outline: none;
|
||||
box-shadow: 0 0 2px rgba(128, 179, 235, 0.5), inset 0 0 0 1px rgba(0, 0, 0, 0.05); }
|
||||
.sweet-alert button:hover {
|
||||
background-color: #7ecff4; }
|
||||
.sweet-alert button:active {
|
||||
background-color: #5dc2f1; }
|
||||
.sweet-alert button.cancel {
|
||||
background-color: #C1C1C1; }
|
||||
.sweet-alert button.cancel:hover {
|
||||
background-color: #b9b9b9; }
|
||||
.sweet-alert button.cancel:active {
|
||||
background-color: #a8a8a8; }
|
||||
.sweet-alert button.cancel:focus {
|
||||
box-shadow: rgba(197, 205, 211, 0.8) 0px 0px 2px, rgba(0, 0, 0, 0.0470588) 0px 0px 0px 1px inset !important; }
|
||||
.sweet-alert button[disabled] {
|
||||
opacity: .6;
|
||||
cursor: default; }
|
||||
.sweet-alert button.confirm[disabled] {
|
||||
color: transparent; }
|
||||
.sweet-alert button.confirm[disabled] ~ .la-ball-fall {
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
transition-delay: 0s; }
|
||||
.sweet-alert button::-moz-focus-inner {
|
||||
border: 0; }
|
||||
.sweet-alert[data-has-cancel-button=false] button {
|
||||
box-shadow: none !important; }
|
||||
.sweet-alert[data-has-confirm-button=false][data-has-cancel-button=false] {
|
||||
padding-bottom: 40px; }
|
||||
.sweet-alert .sa-icon {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
border: 4px solid gray;
|
||||
-webkit-border-radius: 40px;
|
||||
border-radius: 40px;
|
||||
border-radius: 50%;
|
||||
margin: 20px auto;
|
||||
padding: 0;
|
||||
position: relative;
|
||||
box-sizing: content-box; }
|
||||
.sweet-alert .sa-icon.sa-error {
|
||||
border-color: #F27474; }
|
||||
.sweet-alert .sa-icon.sa-error .sa-x-mark {
|
||||
position: relative;
|
||||
display: block; }
|
||||
.sweet-alert .sa-icon.sa-error .sa-line {
|
||||
position: absolute;
|
||||
height: 5px;
|
||||
width: 47px;
|
||||
background-color: #F27474;
|
||||
display: block;
|
||||
top: 37px;
|
||||
border-radius: 2px; }
|
||||
.sweet-alert .sa-icon.sa-error .sa-line.sa-left {
|
||||
-webkit-transform: rotate(45deg);
|
||||
transform: rotate(45deg);
|
||||
left: 17px; }
|
||||
.sweet-alert .sa-icon.sa-error .sa-line.sa-right {
|
||||
-webkit-transform: rotate(-45deg);
|
||||
transform: rotate(-45deg);
|
||||
right: 16px; }
|
||||
.sweet-alert .sa-icon.sa-warning {
|
||||
border-color: #F8BB86; }
|
||||
.sweet-alert .sa-icon.sa-warning .sa-body {
|
||||
position: absolute;
|
||||
width: 5px;
|
||||
height: 47px;
|
||||
left: 50%;
|
||||
top: 10px;
|
||||
-webkit-border-radius: 2px;
|
||||
border-radius: 2px;
|
||||
margin-left: -2px;
|
||||
background-color: #F8BB86; }
|
||||
.sweet-alert .sa-icon.sa-warning .sa-dot {
|
||||
position: absolute;
|
||||
width: 7px;
|
||||
height: 7px;
|
||||
-webkit-border-radius: 50%;
|
||||
border-radius: 50%;
|
||||
margin-left: -3px;
|
||||
left: 50%;
|
||||
bottom: 10px;
|
||||
background-color: #F8BB86; }
|
||||
.sweet-alert .sa-icon.sa-info {
|
||||
border-color: #C9DAE1; }
|
||||
.sweet-alert .sa-icon.sa-info::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
width: 5px;
|
||||
height: 29px;
|
||||
left: 50%;
|
||||
bottom: 17px;
|
||||
border-radius: 2px;
|
||||
margin-left: -2px;
|
||||
background-color: #C9DAE1; }
|
||||
.sweet-alert .sa-icon.sa-info::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
width: 7px;
|
||||
height: 7px;
|
||||
border-radius: 50%;
|
||||
margin-left: -3px;
|
||||
top: 19px;
|
||||
background-color: #C9DAE1; }
|
||||
.sweet-alert .sa-icon.sa-success {
|
||||
border-color: #A5DC86; }
|
||||
.sweet-alert .sa-icon.sa-success::before, .sweet-alert .sa-icon.sa-success::after {
|
||||
content: '';
|
||||
-webkit-border-radius: 40px;
|
||||
border-radius: 40px;
|
||||
border-radius: 50%;
|
||||
position: absolute;
|
||||
width: 60px;
|
||||
height: 120px;
|
||||
background: white;
|
||||
-webkit-transform: rotate(45deg);
|
||||
transform: rotate(45deg); }
|
||||
.sweet-alert .sa-icon.sa-success::before {
|
||||
-webkit-border-radius: 120px 0 0 120px;
|
||||
border-radius: 120px 0 0 120px;
|
||||
top: -7px;
|
||||
left: -33px;
|
||||
-webkit-transform: rotate(-45deg);
|
||||
transform: rotate(-45deg);
|
||||
-webkit-transform-origin: 60px 60px;
|
||||
transform-origin: 60px 60px; }
|
||||
.sweet-alert .sa-icon.sa-success::after {
|
||||
-webkit-border-radius: 0 120px 120px 0;
|
||||
border-radius: 0 120px 120px 0;
|
||||
top: -11px;
|
||||
left: 30px;
|
||||
-webkit-transform: rotate(-45deg);
|
||||
transform: rotate(-45deg);
|
||||
-webkit-transform-origin: 0px 60px;
|
||||
transform-origin: 0px 60px; }
|
||||
.sweet-alert .sa-icon.sa-success .sa-placeholder {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
border: 4px solid rgba(165, 220, 134, 0.2);
|
||||
-webkit-border-radius: 40px;
|
||||
border-radius: 40px;
|
||||
border-radius: 50%;
|
||||
box-sizing: content-box;
|
||||
position: absolute;
|
||||
left: -4px;
|
||||
top: -4px;
|
||||
z-index: 2; }
|
||||
.sweet-alert .sa-icon.sa-success .sa-fix {
|
||||
width: 5px;
|
||||
height: 90px;
|
||||
background-color: white;
|
||||
position: absolute;
|
||||
left: 28px;
|
||||
top: 8px;
|
||||
z-index: 1;
|
||||
-webkit-transform: rotate(-45deg);
|
||||
transform: rotate(-45deg); }
|
||||
.sweet-alert .sa-icon.sa-success .sa-line {
|
||||
height: 5px;
|
||||
background-color: #A5DC86;
|
||||
display: block;
|
||||
border-radius: 2px;
|
||||
position: absolute;
|
||||
z-index: 2; }
|
||||
.sweet-alert .sa-icon.sa-success .sa-line.sa-tip {
|
||||
width: 25px;
|
||||
left: 14px;
|
||||
top: 46px;
|
||||
-webkit-transform: rotate(45deg);
|
||||
transform: rotate(45deg); }
|
||||
.sweet-alert .sa-icon.sa-success .sa-line.sa-long {
|
||||
width: 47px;
|
||||
right: 8px;
|
||||
top: 38px;
|
||||
-webkit-transform: rotate(-45deg);
|
||||
transform: rotate(-45deg); }
|
||||
.sweet-alert .sa-icon.sa-custom {
|
||||
background-size: contain;
|
||||
border-radius: 0;
|
||||
border: none;
|
||||
background-position: center center;
|
||||
background-repeat: no-repeat; }
|
||||
|
||||
/*
|
||||
* Animations
|
||||
*/
|
||||
@-webkit-keyframes showSweetAlert {
|
||||
0% {
|
||||
transform: scale(0.7);
|
||||
-webkit-transform: scale(0.7); }
|
||||
45% {
|
||||
transform: scale(1.05);
|
||||
-webkit-transform: scale(1.05); }
|
||||
80% {
|
||||
transform: scale(0.95);
|
||||
-webkit-transform: scale(0.95); }
|
||||
100% {
|
||||
transform: scale(1);
|
||||
-webkit-transform: scale(1); } }
|
||||
|
||||
@keyframes showSweetAlert {
|
||||
0% {
|
||||
transform: scale(0.7);
|
||||
-webkit-transform: scale(0.7); }
|
||||
45% {
|
||||
transform: scale(1.05);
|
||||
-webkit-transform: scale(1.05); }
|
||||
80% {
|
||||
transform: scale(0.95);
|
||||
-webkit-transform: scale(0.95); }
|
||||
100% {
|
||||
transform: scale(1);
|
||||
-webkit-transform: scale(1); } }
|
||||
|
||||
@-webkit-keyframes hideSweetAlert {
|
||||
0% {
|
||||
transform: scale(1);
|
||||
-webkit-transform: scale(1); }
|
||||
100% {
|
||||
transform: scale(0.5);
|
||||
-webkit-transform: scale(0.5); } }
|
||||
|
||||
@keyframes hideSweetAlert {
|
||||
0% {
|
||||
transform: scale(1);
|
||||
-webkit-transform: scale(1); }
|
||||
100% {
|
||||
transform: scale(0.5);
|
||||
-webkit-transform: scale(0.5); } }
|
||||
|
||||
@-webkit-keyframes slideFromTop {
|
||||
0% {
|
||||
top: 0%; }
|
||||
100% {
|
||||
top: 50%; } }
|
||||
|
||||
@keyframes slideFromTop {
|
||||
0% {
|
||||
top: 0%; }
|
||||
100% {
|
||||
top: 50%; } }
|
||||
|
||||
@-webkit-keyframes slideToTop {
|
||||
0% {
|
||||
top: 50%; }
|
||||
100% {
|
||||
top: 0%; } }
|
||||
|
||||
@keyframes slideToTop {
|
||||
0% {
|
||||
top: 50%; }
|
||||
100% {
|
||||
top: 0%; } }
|
||||
|
||||
@-webkit-keyframes slideFromBottom {
|
||||
0% {
|
||||
top: 70%; }
|
||||
100% {
|
||||
top: 50%; } }
|
||||
|
||||
@keyframes slideFromBottom {
|
||||
0% {
|
||||
top: 70%; }
|
||||
100% {
|
||||
top: 50%; } }
|
||||
|
||||
@-webkit-keyframes slideToBottom {
|
||||
0% {
|
||||
top: 50%; }
|
||||
100% {
|
||||
top: 70%; } }
|
||||
|
||||
@keyframes slideToBottom {
|
||||
0% {
|
||||
top: 50%; }
|
||||
100% {
|
||||
top: 70%; } }
|
||||
|
||||
.showSweetAlert[data-animation=pop] {
|
||||
-webkit-animation: showSweetAlert 0.3s;
|
||||
animation: showSweetAlert 0.3s; }
|
||||
|
||||
.showSweetAlert[data-animation=none] {
|
||||
-webkit-animation: none;
|
||||
animation: none; }
|
||||
|
||||
.showSweetAlert[data-animation=slide-from-top] {
|
||||
-webkit-animation: slideFromTop 0.3s;
|
||||
animation: slideFromTop 0.3s; }
|
||||
|
||||
.showSweetAlert[data-animation=slide-from-bottom] {
|
||||
-webkit-animation: slideFromBottom 0.3s;
|
||||
animation: slideFromBottom 0.3s; }
|
||||
|
||||
.hideSweetAlert[data-animation=pop] {
|
||||
-webkit-animation: hideSweetAlert 0.2s;
|
||||
animation: hideSweetAlert 0.2s; }
|
||||
|
||||
.hideSweetAlert[data-animation=none] {
|
||||
-webkit-animation: none;
|
||||
animation: none; }
|
||||
|
||||
.hideSweetAlert[data-animation=slide-from-top] {
|
||||
-webkit-animation: slideToTop 0.4s;
|
||||
animation: slideToTop 0.4s; }
|
||||
|
||||
.hideSweetAlert[data-animation=slide-from-bottom] {
|
||||
-webkit-animation: slideToBottom 0.3s;
|
||||
animation: slideToBottom 0.3s; }
|
||||
|
||||
@-webkit-keyframes animateSuccessTip {
|
||||
0% {
|
||||
width: 0;
|
||||
left: 1px;
|
||||
top: 19px; }
|
||||
54% {
|
||||
width: 0;
|
||||
left: 1px;
|
||||
top: 19px; }
|
||||
70% {
|
||||
width: 50px;
|
||||
left: -8px;
|
||||
top: 37px; }
|
||||
84% {
|
||||
width: 17px;
|
||||
left: 21px;
|
||||
top: 48px; }
|
||||
100% {
|
||||
width: 25px;
|
||||
left: 14px;
|
||||
top: 45px; } }
|
||||
|
||||
@keyframes animateSuccessTip {
|
||||
0% {
|
||||
width: 0;
|
||||
left: 1px;
|
||||
top: 19px; }
|
||||
54% {
|
||||
width: 0;
|
||||
left: 1px;
|
||||
top: 19px; }
|
||||
70% {
|
||||
width: 50px;
|
||||
left: -8px;
|
||||
top: 37px; }
|
||||
84% {
|
||||
width: 17px;
|
||||
left: 21px;
|
||||
top: 48px; }
|
||||
100% {
|
||||
width: 25px;
|
||||
left: 14px;
|
||||
top: 45px; } }
|
||||
|
||||
@-webkit-keyframes animateSuccessLong {
|
||||
0% {
|
||||
width: 0;
|
||||
right: 46px;
|
||||
top: 54px; }
|
||||
65% {
|
||||
width: 0;
|
||||
right: 46px;
|
||||
top: 54px; }
|
||||
84% {
|
||||
width: 55px;
|
||||
right: 0px;
|
||||
top: 35px; }
|
||||
100% {
|
||||
width: 47px;
|
||||
right: 8px;
|
||||
top: 38px; } }
|
||||
|
||||
@keyframes animateSuccessLong {
|
||||
0% {
|
||||
width: 0;
|
||||
right: 46px;
|
||||
top: 54px; }
|
||||
65% {
|
||||
width: 0;
|
||||
right: 46px;
|
||||
top: 54px; }
|
||||
84% {
|
||||
width: 55px;
|
||||
right: 0px;
|
||||
top: 35px; }
|
||||
100% {
|
||||
width: 47px;
|
||||
right: 8px;
|
||||
top: 38px; } }
|
||||
|
||||
@-webkit-keyframes rotatePlaceholder {
|
||||
0% {
|
||||
transform: rotate(-45deg);
|
||||
-webkit-transform: rotate(-45deg); }
|
||||
5% {
|
||||
transform: rotate(-45deg);
|
||||
-webkit-transform: rotate(-45deg); }
|
||||
12% {
|
||||
transform: rotate(-405deg);
|
||||
-webkit-transform: rotate(-405deg); }
|
||||
100% {
|
||||
transform: rotate(-405deg);
|
||||
-webkit-transform: rotate(-405deg); } }
|
||||
|
||||
@keyframes rotatePlaceholder {
|
||||
0% {
|
||||
transform: rotate(-45deg);
|
||||
-webkit-transform: rotate(-45deg); }
|
||||
5% {
|
||||
transform: rotate(-45deg);
|
||||
-webkit-transform: rotate(-45deg); }
|
||||
12% {
|
||||
transform: rotate(-405deg);
|
||||
-webkit-transform: rotate(-405deg); }
|
||||
100% {
|
||||
transform: rotate(-405deg);
|
||||
-webkit-transform: rotate(-405deg); } }
|
||||
|
||||
.animateSuccessTip {
|
||||
-webkit-animation: animateSuccessTip 0.75s;
|
||||
animation: animateSuccessTip 0.75s; }
|
||||
|
||||
.animateSuccessLong {
|
||||
-webkit-animation: animateSuccessLong 0.75s;
|
||||
animation: animateSuccessLong 0.75s; }
|
||||
|
||||
.sa-icon.sa-success.animate::after {
|
||||
-webkit-animation: rotatePlaceholder 4.25s ease-in;
|
||||
animation: rotatePlaceholder 4.25s ease-in; }
|
||||
|
||||
@-webkit-keyframes animateErrorIcon {
|
||||
0% {
|
||||
transform: rotateX(100deg);
|
||||
-webkit-transform: rotateX(100deg);
|
||||
opacity: 0; }
|
||||
100% {
|
||||
transform: rotateX(0deg);
|
||||
-webkit-transform: rotateX(0deg);
|
||||
opacity: 1; } }
|
||||
|
||||
@keyframes animateErrorIcon {
|
||||
0% {
|
||||
transform: rotateX(100deg);
|
||||
-webkit-transform: rotateX(100deg);
|
||||
opacity: 0; }
|
||||
100% {
|
||||
transform: rotateX(0deg);
|
||||
-webkit-transform: rotateX(0deg);
|
||||
opacity: 1; } }
|
||||
|
||||
.animateErrorIcon {
|
||||
-webkit-animation: animateErrorIcon 0.5s;
|
||||
animation: animateErrorIcon 0.5s; }
|
||||
|
||||
@-webkit-keyframes animateXMark {
|
||||
0% {
|
||||
transform: scale(0.4);
|
||||
-webkit-transform: scale(0.4);
|
||||
margin-top: 26px;
|
||||
opacity: 0; }
|
||||
50% {
|
||||
transform: scale(0.4);
|
||||
-webkit-transform: scale(0.4);
|
||||
margin-top: 26px;
|
||||
opacity: 0; }
|
||||
80% {
|
||||
transform: scale(1.15);
|
||||
-webkit-transform: scale(1.15);
|
||||
margin-top: -6px; }
|
||||
100% {
|
||||
transform: scale(1);
|
||||
-webkit-transform: scale(1);
|
||||
margin-top: 0;
|
||||
opacity: 1; } }
|
||||
|
||||
@keyframes animateXMark {
|
||||
0% {
|
||||
transform: scale(0.4);
|
||||
-webkit-transform: scale(0.4);
|
||||
margin-top: 26px;
|
||||
opacity: 0; }
|
||||
50% {
|
||||
transform: scale(0.4);
|
||||
-webkit-transform: scale(0.4);
|
||||
margin-top: 26px;
|
||||
opacity: 0; }
|
||||
80% {
|
||||
transform: scale(1.15);
|
||||
-webkit-transform: scale(1.15);
|
||||
margin-top: -6px; }
|
||||
100% {
|
||||
transform: scale(1);
|
||||
-webkit-transform: scale(1);
|
||||
margin-top: 0;
|
||||
opacity: 1; } }
|
||||
|
||||
.animateXMark {
|
||||
-webkit-animation: animateXMark 0.5s;
|
||||
animation: animateXMark 0.5s; }
|
||||
|
||||
@-webkit-keyframes pulseWarning {
|
||||
0% {
|
||||
border-color: #F8D486; }
|
||||
100% {
|
||||
border-color: #F8BB86; } }
|
||||
|
||||
@keyframes pulseWarning {
|
||||
0% {
|
||||
border-color: #F8D486; }
|
||||
100% {
|
||||
border-color: #F8BB86; } }
|
||||
|
||||
.pulseWarning {
|
||||
-webkit-animation: pulseWarning 0.75s infinite alternate;
|
||||
animation: pulseWarning 0.75s infinite alternate; }
|
||||
|
||||
@-webkit-keyframes pulseWarningIns {
|
||||
0% {
|
||||
background-color: #F8D486; }
|
||||
100% {
|
||||
background-color: #F8BB86; } }
|
||||
|
||||
@keyframes pulseWarningIns {
|
||||
0% {
|
||||
background-color: #F8D486; }
|
||||
100% {
|
||||
background-color: #F8BB86; } }
|
||||
|
||||
.pulseWarningIns {
|
||||
-webkit-animation: pulseWarningIns 0.75s infinite alternate;
|
||||
animation: pulseWarningIns 0.75s infinite alternate; }
|
||||
|
||||
@-webkit-keyframes rotate-loading {
|
||||
0% {
|
||||
transform: rotate(0deg); }
|
||||
100% {
|
||||
transform: rotate(360deg); } }
|
||||
|
||||
@keyframes rotate-loading {
|
||||
0% {
|
||||
transform: rotate(0deg); }
|
||||
100% {
|
||||
transform: rotate(360deg); } }
|
||||
|
||||
/* Internet Explorer 9 has some special quirks that are fixed here */
|
||||
/* The icons are not animated. */
|
||||
/* This file is automatically merged into sweet-alert.min.js through Gulp */
|
||||
/* Error icon */
|
||||
.sweet-alert .sa-icon.sa-error .sa-line.sa-left {
|
||||
-ms-transform: rotate(45deg) \9; }
|
||||
|
||||
.sweet-alert .sa-icon.sa-error .sa-line.sa-right {
|
||||
-ms-transform: rotate(-45deg) \9; }
|
||||
|
||||
/* Success icon */
|
||||
.sweet-alert .sa-icon.sa-success {
|
||||
border-color: transparent\9; }
|
||||
|
||||
.sweet-alert .sa-icon.sa-success .sa-line.sa-tip {
|
||||
-ms-transform: rotate(45deg) \9; }
|
||||
|
||||
.sweet-alert .sa-icon.sa-success .sa-line.sa-long {
|
||||
-ms-transform: rotate(-45deg) \9; }
|
||||
|
||||
/*!
|
||||
* Load Awesome v1.1.0 (http://github.danielcardoso.net/load-awesome/)
|
||||
* Copyright 2015 Daniel Cardoso <@DanielCardoso>
|
||||
* Licensed under MIT
|
||||
*/
|
||||
.la-ball-fall,
|
||||
.la-ball-fall > div {
|
||||
position: relative;
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box; }
|
||||
|
||||
.la-ball-fall {
|
||||
display: block;
|
||||
font-size: 0;
|
||||
color: #fff; }
|
||||
|
||||
.la-ball-fall.la-dark {
|
||||
color: #333; }
|
||||
|
||||
.la-ball-fall > div {
|
||||
display: inline-block;
|
||||
float: none;
|
||||
background-color: currentColor;
|
||||
border: 0 solid currentColor; }
|
||||
|
||||
.la-ball-fall {
|
||||
width: 54px;
|
||||
height: 18px; }
|
||||
|
||||
.la-ball-fall > div {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
margin: 4px;
|
||||
border-radius: 100%;
|
||||
opacity: 0;
|
||||
-webkit-animation: ball-fall 1s ease-in-out infinite;
|
||||
-moz-animation: ball-fall 1s ease-in-out infinite;
|
||||
-o-animation: ball-fall 1s ease-in-out infinite;
|
||||
animation: ball-fall 1s ease-in-out infinite; }
|
||||
|
||||
.la-ball-fall > div:nth-child(1) {
|
||||
-webkit-animation-delay: -200ms;
|
||||
-moz-animation-delay: -200ms;
|
||||
-o-animation-delay: -200ms;
|
||||
animation-delay: -200ms; }
|
||||
|
||||
.la-ball-fall > div:nth-child(2) {
|
||||
-webkit-animation-delay: -100ms;
|
||||
-moz-animation-delay: -100ms;
|
||||
-o-animation-delay: -100ms;
|
||||
animation-delay: -100ms; }
|
||||
|
||||
.la-ball-fall > div:nth-child(3) {
|
||||
-webkit-animation-delay: 0ms;
|
||||
-moz-animation-delay: 0ms;
|
||||
-o-animation-delay: 0ms;
|
||||
animation-delay: 0ms; }
|
||||
|
||||
.la-ball-fall.la-sm {
|
||||
width: 26px;
|
||||
height: 8px; }
|
||||
|
||||
.la-ball-fall.la-sm > div {
|
||||
width: 4px;
|
||||
height: 4px;
|
||||
margin: 2px; }
|
||||
|
||||
.la-ball-fall.la-2x {
|
||||
width: 108px;
|
||||
height: 36px; }
|
||||
|
||||
.la-ball-fall.la-2x > div {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
margin: 8px; }
|
||||
|
||||
.la-ball-fall.la-3x {
|
||||
width: 162px;
|
||||
height: 54px; }
|
||||
|
||||
.la-ball-fall.la-3x > div {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
margin: 12px; }
|
||||
|
||||
/*
|
||||
* Animation
|
||||
*/
|
||||
@-webkit-keyframes ball-fall {
|
||||
0% {
|
||||
opacity: 0;
|
||||
-webkit-transform: translateY(-145%);
|
||||
transform: translateY(-145%); }
|
||||
10% {
|
||||
opacity: .5; }
|
||||
20% {
|
||||
opacity: 1;
|
||||
-webkit-transform: translateY(0);
|
||||
transform: translateY(0); }
|
||||
80% {
|
||||
opacity: 1;
|
||||
-webkit-transform: translateY(0);
|
||||
transform: translateY(0); }
|
||||
90% {
|
||||
opacity: .5; }
|
||||
100% {
|
||||
opacity: 0;
|
||||
-webkit-transform: translateY(145%);
|
||||
transform: translateY(145%); } }
|
||||
|
||||
@-moz-keyframes ball-fall {
|
||||
0% {
|
||||
opacity: 0;
|
||||
-moz-transform: translateY(-145%);
|
||||
transform: translateY(-145%); }
|
||||
10% {
|
||||
opacity: .5; }
|
||||
20% {
|
||||
opacity: 1;
|
||||
-moz-transform: translateY(0);
|
||||
transform: translateY(0); }
|
||||
80% {
|
||||
opacity: 1;
|
||||
-moz-transform: translateY(0);
|
||||
transform: translateY(0); }
|
||||
90% {
|
||||
opacity: .5; }
|
||||
100% {
|
||||
opacity: 0;
|
||||
-moz-transform: translateY(145%);
|
||||
transform: translateY(145%); } }
|
||||
|
||||
@-o-keyframes ball-fall {
|
||||
0% {
|
||||
opacity: 0;
|
||||
-o-transform: translateY(-145%);
|
||||
transform: translateY(-145%); }
|
||||
10% {
|
||||
opacity: .5; }
|
||||
20% {
|
||||
opacity: 1;
|
||||
-o-transform: translateY(0);
|
||||
transform: translateY(0); }
|
||||
80% {
|
||||
opacity: 1;
|
||||
-o-transform: translateY(0);
|
||||
transform: translateY(0); }
|
||||
90% {
|
||||
opacity: .5; }
|
||||
100% {
|
||||
opacity: 0;
|
||||
-o-transform: translateY(145%);
|
||||
transform: translateY(145%); } }
|
||||
|
||||
@keyframes ball-fall {
|
||||
0% {
|
||||
opacity: 0;
|
||||
-webkit-transform: translateY(-145%);
|
||||
-moz-transform: translateY(-145%);
|
||||
-o-transform: translateY(-145%);
|
||||
transform: translateY(-145%); }
|
||||
10% {
|
||||
opacity: .5; }
|
||||
20% {
|
||||
opacity: 1;
|
||||
-webkit-transform: translateY(0);
|
||||
-moz-transform: translateY(0);
|
||||
-o-transform: translateY(0);
|
||||
transform: translateY(0); }
|
||||
80% {
|
||||
opacity: 1;
|
||||
-webkit-transform: translateY(0);
|
||||
-moz-transform: translateY(0);
|
||||
-o-transform: translateY(0);
|
||||
transform: translateY(0); }
|
||||
90% {
|
||||
opacity: .5; }
|
||||
100% {
|
||||
opacity: 0;
|
||||
-webkit-transform: translateY(145%);
|
||||
-moz-transform: translateY(145%);
|
||||
-o-transform: translateY(145%);
|
||||
transform: translateY(145%); } }
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
!function(e,t,n){"use strict";!function o(e,t,n){function a(s,l){if(!t[s]){if(!e[s]){var i="function"==typeof require&&require;if(!l&&i)return i(s,!0);if(r)return r(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var c=t[s]={exports:{}};e[s][0].call(c.exports,function(t){var n=e[s][1][t];return a(n?n:t)},c,c.exports,o,e,t,n)}return t[s].exports}for(var r="function"==typeof require&&require,s=0;s<n.length;s++)a(n[s]);return a}({1:[function(o){var a,r,s,l,i=function(e){return e&&e.__esModule?e:{"default":e}},u=o("./modules/handle-dom"),c=o("./modules/utils"),d=o("./modules/handle-swal-dom"),f=o("./modules/handle-click"),p=o("./modules/handle-key"),m=i(p),v=o("./modules/default-params"),y=i(v),h=o("./modules/set-params"),g=i(h);s=l=function(){function o(e){var t=s;return t[e]===n?y["default"][e]:t[e]}var s=arguments[0];if(u.addClass(t.body,"stop-scrolling"),d.resetInput(),s===n)return c.logStr("SweetAlert expects at least 1 attribute!"),!1;var i=c.extend({},y["default"]);switch(typeof s){case"string":i.title=s,i.text=arguments[1]||"",i.type=arguments[2]||"";break;case"object":if(s.title===n)return c.logStr('Missing "title" argument!'),!1;i.title=s.title;for(var p in y["default"])i[p]=o(p);i.confirmButtonText=i.showCancelButton?"Confirm":y["default"].confirmButtonText,i.confirmButtonText=o("confirmButtonText"),i.doneFunction=arguments[1]||null;break;default:return c.logStr('Unexpected type of argument! Expected "string" or "object", got '+typeof s),!1}g["default"](i),d.fixVerticalPosition(),d.openModal(arguments[1]);for(var v=d.getModal(),h=v.querySelectorAll("button"),b=["onclick","onmouseover","onmouseout","onmousedown","onmouseup","onfocus"],w=function(e){return f.handleButton(e,i,v)},C=0;C<h.length;C++)for(var S=0;S<b.length;S++){var x=b[S];h[C][x]=w}d.getOverlay().onclick=w,a=e.onkeydown;var k=function(e){return m["default"](e,i,v)};e.onkeydown=k,e.onfocus=function(){setTimeout(function(){r!==n&&(r.focus(),r=n)},0)},l.enableButtons()},s.setDefaults=l.setDefaults=function(e){if(!e)throw new Error("userParams is required");if("object"!=typeof e)throw new Error("userParams has to be a object");c.extend(y["default"],e)},s.close=l.close=function(){var o=d.getModal();u.fadeOut(d.getOverlay(),5),u.fadeOut(o,5),u.removeClass(o,"showSweetAlert"),u.addClass(o,"hideSweetAlert"),u.removeClass(o,"visible");var s=o.querySelector(".sa-icon.sa-success");u.removeClass(s,"animate"),u.removeClass(s.querySelector(".sa-tip"),"animateSuccessTip"),u.removeClass(s.querySelector(".sa-long"),"animateSuccessLong");var l=o.querySelector(".sa-icon.sa-error");u.removeClass(l,"animateErrorIcon"),u.removeClass(l.querySelector(".sa-x-mark"),"animateXMark");var i=o.querySelector(".sa-icon.sa-warning");return u.removeClass(i,"pulseWarning"),u.removeClass(i.querySelector(".sa-body"),"pulseWarningIns"),u.removeClass(i.querySelector(".sa-dot"),"pulseWarningIns"),setTimeout(function(){var e=o.getAttribute("data-custom-class");u.removeClass(o,e)},300),u.removeClass(t.body,"stop-scrolling"),e.onkeydown=a,e.previousActiveElement&&e.previousActiveElement.focus(),r=n,clearTimeout(o.timeout),!0},s.showInputError=l.showInputError=function(e){var t=d.getModal(),n=t.querySelector(".sa-input-error");u.addClass(n,"show");var o=t.querySelector(".sa-error-container");u.addClass(o,"show"),o.querySelector("p").innerHTML=e,setTimeout(function(){s.enableButtons()},1),t.querySelector("input").focus()},s.resetInputError=l.resetInputError=function(e){if(e&&13===e.keyCode)return!1;var t=d.getModal(),n=t.querySelector(".sa-input-error");u.removeClass(n,"show");var o=t.querySelector(".sa-error-container");u.removeClass(o,"show")},s.disableButtons=l.disableButtons=function(){var e=d.getModal(),t=e.querySelector("button.confirm"),n=e.querySelector("button.cancel");t.disabled=!0,n.disabled=!0},s.enableButtons=l.enableButtons=function(){var e=d.getModal(),t=e.querySelector("button.confirm"),n=e.querySelector("button.cancel");t.disabled=!1,n.disabled=!1},"undefined"!=typeof e?e.sweetAlert=e.swal=s:c.logStr("SweetAlert is a frontend module!")},{"./modules/default-params":2,"./modules/handle-click":3,"./modules/handle-dom":4,"./modules/handle-key":5,"./modules/handle-swal-dom":6,"./modules/set-params":8,"./modules/utils":9}],2:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0});var o={title:"",text:"",type:null,allowOutsideClick:!1,showConfirmButton:!0,showCancelButton:!1,closeOnConfirm:!0,closeOnCancel:!0,confirmButtonText:"OK",confirmButtonColor:"#8CD4F5",cancelButtonText:"Cancel",imageUrl:null,imageSize:null,timer:null,customClass:"",html:!1,animation:!0,allowEscapeKey:!0,inputType:"text",inputPlaceholder:"",inputValue:"",showLoaderOnConfirm:!1};n["default"]=o,t.exports=n["default"]},{}],3:[function(t,n,o){Object.defineProperty(o,"__esModule",{value:!0});var a=t("./utils"),r=(t("./handle-swal-dom"),t("./handle-dom")),s=function(t,n,o){function s(e){m&&n.confirmButtonColor&&(p.style.backgroundColor=e)}var u,c,d,f=t||e.event,p=f.target||f.srcElement,m=-1!==p.className.indexOf("confirm"),v=-1!==p.className.indexOf("sweet-overlay"),y=r.hasClass(o,"visible"),h=n.doneFunction&&"true"===o.getAttribute("data-has-done-function");switch(m&&n.confirmButtonColor&&(u=n.confirmButtonColor,c=a.colorLuminance(u,-.04),d=a.colorLuminance(u,-.14)),f.type){case"mouseover":s(c);break;case"mouseout":s(u);break;case"mousedown":s(d);break;case"mouseup":s(c);break;case"focus":var g=o.querySelector("button.confirm"),b=o.querySelector("button.cancel");m?b.style.boxShadow="none":g.style.boxShadow="none";break;case"click":var w=o===p,C=r.isDescendant(o,p);if(!w&&!C&&y&&!n.allowOutsideClick)break;m&&h&&y?l(o,n):h&&y||v?i(o,n):r.isDescendant(o,p)&&"BUTTON"===p.tagName&&sweetAlert.close()}},l=function(e,t){var n=!0;r.hasClass(e,"show-input")&&(n=e.querySelector("input").value,n||(n="")),t.doneFunction(n),t.closeOnConfirm&&sweetAlert.close(),t.showLoaderOnConfirm&&sweetAlert.disableButtons()},i=function(e,t){var n=String(t.doneFunction).replace(/\s/g,""),o="function("===n.substring(0,9)&&")"!==n.substring(9,10);o&&t.doneFunction(!1),t.closeOnCancel&&sweetAlert.close()};o["default"]={handleButton:s,handleConfirm:l,handleCancel:i},n.exports=o["default"]},{"./handle-dom":4,"./handle-swal-dom":6,"./utils":9}],4:[function(n,o,a){Object.defineProperty(a,"__esModule",{value:!0});var r=function(e,t){return new RegExp(" "+t+" ").test(" "+e.className+" ")},s=function(e,t){r(e,t)||(e.className+=" "+t)},l=function(e,t){var n=" "+e.className.replace(/[\t\r\n]/g," ")+" ";if(r(e,t)){for(;n.indexOf(" "+t+" ")>=0;)n=n.replace(" "+t+" "," ");e.className=n.replace(/^\s+|\s+$/g,"")}},i=function(e){var n=t.createElement("div");return n.appendChild(t.createTextNode(e)),n.innerHTML},u=function(e){e.style.opacity="",e.style.display="block"},c=function(e){if(e&&!e.length)return u(e);for(var t=0;t<e.length;++t)u(e[t])},d=function(e){e.style.opacity="",e.style.display="none"},f=function(e){if(e&&!e.length)return d(e);for(var t=0;t<e.length;++t)d(e[t])},p=function(e,t){for(var n=t.parentNode;null!==n;){if(n===e)return!0;n=n.parentNode}return!1},m=function(e){e.style.left="-9999px",e.style.display="block";var t,n=e.clientHeight;return t="undefined"!=typeof getComputedStyle?parseInt(getComputedStyle(e).getPropertyValue("padding-top"),10):parseInt(e.currentStyle.padding),e.style.left="",e.style.display="none","-"+parseInt((n+t)/2)+"px"},v=function(e,t){if(+e.style.opacity<1){t=t||16,e.style.opacity=0,e.style.display="block";var n=+new Date,o=function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(){e.style.opacity=+e.style.opacity+(new Date-n)/100,n=+new Date,+e.style.opacity<1&&setTimeout(o,t)});o()}e.style.display="block"},y=function(e,t){t=t||16,e.style.opacity=1;var n=+new Date,o=function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(){e.style.opacity=+e.style.opacity-(new Date-n)/100,n=+new Date,+e.style.opacity>0?setTimeout(o,t):e.style.display="none"});o()},h=function(n){if("function"==typeof MouseEvent){var o=new MouseEvent("click",{view:e,bubbles:!1,cancelable:!0});n.dispatchEvent(o)}else if(t.createEvent){var a=t.createEvent("MouseEvents");a.initEvent("click",!1,!1),n.dispatchEvent(a)}else t.createEventObject?n.fireEvent("onclick"):"function"==typeof n.onclick&&n.onclick()},g=function(t){"function"==typeof t.stopPropagation?(t.stopPropagation(),t.preventDefault()):e.event&&e.event.hasOwnProperty("cancelBubble")&&(e.event.cancelBubble=!0)};a.hasClass=r,a.addClass=s,a.removeClass=l,a.escapeHtml=i,a._show=u,a.show=c,a._hide=d,a.hide=f,a.isDescendant=p,a.getTopMargin=m,a.fadeIn=v,a.fadeOut=y,a.fireClick=h,a.stopEventPropagation=g},{}],5:[function(t,o,a){Object.defineProperty(a,"__esModule",{value:!0});var r=t("./handle-dom"),s=t("./handle-swal-dom"),l=function(t,o,a){var l=t||e.event,i=l.keyCode||l.which,u=a.querySelector("button.confirm"),c=a.querySelector("button.cancel"),d=a.querySelectorAll("button[tabindex]");if(-1!==[9,13,32,27].indexOf(i)){for(var f=l.target||l.srcElement,p=-1,m=0;m<d.length;m++)if(f===d[m]){p=m;break}9===i?(f=-1===p?u:p===d.length-1?d[0]:d[p+1],r.stopEventPropagation(l),f.focus(),o.confirmButtonColor&&s.setFocusStyle(f,o.confirmButtonColor)):13===i?("INPUT"===f.tagName&&(f=u,u.focus()),f=-1===p?u:n):27===i&&o.allowEscapeKey===!0?(f=c,r.fireClick(f,l)):f=n}};a["default"]=l,o.exports=a["default"]},{"./handle-dom":4,"./handle-swal-dom":6}],6:[function(n,o,a){var r=function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(a,"__esModule",{value:!0});var s=n("./utils"),l=n("./handle-dom"),i=n("./default-params"),u=r(i),c=n("./injected-html"),d=r(c),f=".sweet-alert",p=".sweet-overlay",m=function(){var e=t.createElement("div");for(e.innerHTML=d["default"];e.firstChild;)t.body.appendChild(e.firstChild)},v=function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(){var e=t.querySelector(f);return e||(m(),e=v()),e}),y=function(){var e=v();return e?e.querySelector("input"):void 0},h=function(){return t.querySelector(p)},g=function(e,t){var n=s.hexToRgb(t);e.style.boxShadow="0 0 2px rgba("+n+", 0.8), inset 0 0 0 1px rgba(0, 0, 0, 0.05)"},b=function(n){var o=v();l.fadeIn(h(),10),l.show(o),l.addClass(o,"showSweetAlert"),l.removeClass(o,"hideSweetAlert"),e.previousActiveElement=t.activeElement;var a=o.querySelector("button.confirm");a.focus(),setTimeout(function(){l.addClass(o,"visible")},500);var r=o.getAttribute("data-timer");if("null"!==r&&""!==r){var s=n;o.timeout=setTimeout(function(){var e=(s||null)&&"true"===o.getAttribute("data-has-done-function");e?s(null):sweetAlert.close()},r)}},w=function(){var e=v(),t=y();l.removeClass(e,"show-input"),t.value=u["default"].inputValue,t.setAttribute("type",u["default"].inputType),t.setAttribute("placeholder",u["default"].inputPlaceholder),C()},C=function(e){if(e&&13===e.keyCode)return!1;var t=v(),n=t.querySelector(".sa-input-error");l.removeClass(n,"show");var o=t.querySelector(".sa-error-container");l.removeClass(o,"show")},S=function(){var e=v();e.style.marginTop=l.getTopMargin(v())};a.sweetAlertInitialize=m,a.getModal=v,a.getOverlay=h,a.getInput=y,a.setFocusStyle=g,a.openModal=b,a.resetInput=w,a.resetInputError=C,a.fixVerticalPosition=S},{"./default-params":2,"./handle-dom":4,"./injected-html":7,"./utils":9}],7:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0});var o='<div class="sweet-overlay" tabIndex="-1"></div><div class="sweet-alert"><div class="sa-icon sa-error">\n <span class="sa-x-mark">\n <span class="sa-line sa-left"></span>\n <span class="sa-line sa-right"></span>\n </span>\n </div><div class="sa-icon sa-warning">\n <span class="sa-body"></span>\n <span class="sa-dot"></span>\n </div><div class="sa-icon sa-info"></div><div class="sa-icon sa-success">\n <span class="sa-line sa-tip"></span>\n <span class="sa-line sa-long"></span>\n\n <div class="sa-placeholder"></div>\n <div class="sa-fix"></div>\n </div><div class="sa-icon sa-custom"></div><h2>Title</h2>\n <p>Text</p>\n <fieldset>\n <input type="text" tabIndex="3" />\n <div class="sa-input-error"></div>\n </fieldset><div class="sa-error-container">\n <div class="icon">!</div>\n <p>Not valid!</p>\n </div><div class="sa-button-container">\n <button class="cancel" tabIndex="2">Cancel</button>\n <div class="sa-confirm-button-container">\n <button class="confirm" tabIndex="1">OK</button><div class="la-ball-fall">\n <div></div>\n <div></div>\n <div></div>\n </div>\n </div>\n </div></div>';n["default"]=o,t.exports=n["default"]},{}],8:[function(e,t,o){Object.defineProperty(o,"__esModule",{value:!0});var a=e("./utils"),r=e("./handle-swal-dom"),s=e("./handle-dom"),l=["error","warning","info","success","input","prompt"],i=function(e){var t=r.getModal(),o=t.querySelector("h2"),i=t.querySelector("p"),u=t.querySelector("button.cancel"),c=t.querySelector("button.confirm");if(o.innerHTML=e.html?e.title:s.escapeHtml(e.title).split("\n").join("<br>"),i.innerHTML=e.html?e.text:s.escapeHtml(e.text||"").split("\n").join("<br>"),e.text&&s.show(i),e.customClass)s.addClass(t,e.customClass),t.setAttribute("data-custom-class",e.customClass);else{var d=t.getAttribute("data-custom-class");s.removeClass(t,d),t.setAttribute("data-custom-class","")}if(s.hide(t.querySelectorAll(".sa-icon")),e.type&&!a.isIE8()){var f=function(){for(var o=!1,a=0;a<l.length;a++)if(e.type===l[a]){o=!0;break}if(!o)return logStr("Unknown alert type: "+e.type),{v:!1};var i=["success","error","warning","info"],u=n;-1!==i.indexOf(e.type)&&(u=t.querySelector(".sa-icon.sa-"+e.type),s.show(u));var c=r.getInput();switch(e.type){case"success":s.addClass(u,"animate"),s.addClass(u.querySelector(".sa-tip"),"animateSuccessTip"),s.addClass(u.querySelector(".sa-long"),"animateSuccessLong");break;case"error":s.addClass(u,"animateErrorIcon"),s.addClass(u.querySelector(".sa-x-mark"),"animateXMark");break;case"warning":s.addClass(u,"pulseWarning"),s.addClass(u.querySelector(".sa-body"),"pulseWarningIns"),s.addClass(u.querySelector(".sa-dot"),"pulseWarningIns");break;case"input":case"prompt":c.setAttribute("type",e.inputType),c.value=e.inputValue,c.setAttribute("placeholder",e.inputPlaceholder),s.addClass(t,"show-input"),setTimeout(function(){c.focus(),c.addEventListener("keyup",swal.resetInputError)},400)}}();if("object"==typeof f)return f.v}if(e.imageUrl){var p=t.querySelector(".sa-icon.sa-custom");p.style.backgroundImage="url("+e.imageUrl+")",s.show(p);var m=80,v=80;if(e.imageSize){var y=e.imageSize.toString().split("x"),h=y[0],g=y[1];h&&g?(m=h,v=g):logStr("Parameter imageSize expects value with format WIDTHxHEIGHT, got "+e.imageSize)}p.setAttribute("style",p.getAttribute("style")+"width:"+m+"px; height:"+v+"px")}t.setAttribute("data-has-cancel-button",e.showCancelButton),e.showCancelButton?u.style.display="inline-block":s.hide(u),t.setAttribute("data-has-confirm-button",e.showConfirmButton),e.showConfirmButton?c.style.display="inline-block":s.hide(c),e.cancelButtonText&&(u.innerHTML=s.escapeHtml(e.cancelButtonText)),e.confirmButtonText&&(c.innerHTML=s.escapeHtml(e.confirmButtonText)),e.confirmButtonColor&&(c.style.backgroundColor=e.confirmButtonColor,c.style.borderLeftColor=e.confirmLoadingButtonColor,c.style.borderRightColor=e.confirmLoadingButtonColor,r.setFocusStyle(c,e.confirmButtonColor)),t.setAttribute("data-allow-outside-click",e.allowOutsideClick);var b=e.doneFunction?!0:!1;t.setAttribute("data-has-done-function",b),e.animation?"string"==typeof e.animation?t.setAttribute("data-animation",e.animation):t.setAttribute("data-animation","pop"):t.setAttribute("data-animation","none"),t.setAttribute("data-timer",e.timer)};o["default"]=i,t.exports=o["default"]},{"./handle-dom":4,"./handle-swal-dom":6,"./utils":9}],9:[function(t,n,o){Object.defineProperty(o,"__esModule",{value:!0});var a=function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},r=function(e){var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?parseInt(t[1],16)+", "+parseInt(t[2],16)+", "+parseInt(t[3],16):null},s=function(){return e.attachEvent&&!e.addEventListener},l=function(t){e.console&&e.console.log("SweetAlert: "+t)},i=function(e,t){e=String(e).replace(/[^0-9a-f]/gi,""),e.length<6&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),t=t||0;var n,o,a="#";for(o=0;3>o;o++)n=parseInt(e.substr(2*o,2),16),n=Math.round(Math.min(Math.max(0,n+n*t),255)).toString(16),a+=("00"+n).substr(n.length);return a};o.extend=a,o.hexToRgb=r,o.isIE8=s,o.logStr=l,o.colorLuminance=i},{}]},{},[1]),"function"==typeof define&&define.amd?define(function(){return sweetAlert}):"undefined"!=typeof module&&module.exports&&(module.exports=sweetAlert)}(window,document);
|
||||
Reference in New Issue
Block a user