mirror of
https://github.com/rembo10/headphones.git
synced 2026-07-20 16:03:59 +01:00
Updated notifications
This commit is contained in:
@@ -1,30 +0,0 @@
|
||||
$(document).ready(function() {
|
||||
$("img.getImgLink").each(function(){
|
||||
var artistId = $(this).attr('for');
|
||||
var image = $(this).attr('src');
|
||||
alert(artistId);
|
||||
|
||||
$.ajax({
|
||||
url: "getImageLinks?ArtistID=" + artistId,
|
||||
success: function(data){
|
||||
var artistImg = data;
|
||||
$(image).attr("src",artistImg);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
$("img.getThumb").each(function(){
|
||||
var artistId = $(this).attr('for');
|
||||
var image = $(this).attr('src');
|
||||
alert(artistId);
|
||||
|
||||
$.ajax({
|
||||
url: "getImageLinks?ArtistID=" + artistId,
|
||||
success: function(data){
|
||||
var artistImg = data;
|
||||
$(image).attr("src",artistImg);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
})
|
||||
@@ -0,0 +1,174 @@
|
||||
|
||||
$(document).ready(function() {
|
||||
// Ajax Config Form
|
||||
$('.ajax').ajaxForm({
|
||||
success: function() {
|
||||
var noty_id = noty({
|
||||
text:'<span class="wsr Approved"></span> Settings Saved!',
|
||||
layout: 'bottomRight',
|
||||
type:'success'
|
||||
});
|
||||
/*
|
||||
var noty_id = noty({
|
||||
text:'<span class="wsr Alert"></span>Carefull!',
|
||||
layout: 'bottomRight',
|
||||
type:'warning'
|
||||
});
|
||||
var noty_id = noty({
|
||||
text:'<span class="wsr Alert"></span> Something went wrong!',
|
||||
layout: 'bottomRight',
|
||||
type:'error'
|
||||
});
|
||||
var noty_id = noty({
|
||||
text:'<span class="wsr"></span> Settings has been saved successfully!',
|
||||
layout: 'bottomRight',
|
||||
type:'information'
|
||||
});
|
||||
var noty_id = noty({
|
||||
text:'<span class="wsr Approved"></span> Settings has been saved successfully!',
|
||||
layout: 'bottomRight',
|
||||
type:'success'
|
||||
});
|
||||
var noty_id = noty({
|
||||
text:'<span class="wsr Chat"></span> Settings has been saved successfully!',
|
||||
layout: 'bottomRight',
|
||||
});
|
||||
*/
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Enabled/disabled label
|
||||
$(document).ready(function(){
|
||||
$( '.switch' ).each(function(){
|
||||
//set Label name to current active state
|
||||
var labelName = 'label[for="' + $( this ).attr( "name" ) + '"]';
|
||||
var switchId = $( this ).attr( "name" );
|
||||
if ( $( this ).is(':checked') ){
|
||||
$( labelName ).text( 'Enabled' );
|
||||
$("#" + switchId ).show();
|
||||
enit();
|
||||
}
|
||||
else {
|
||||
$( labelName ).text( 'Disabled' );
|
||||
$("#" + switchId ).hide();
|
||||
enit();
|
||||
}
|
||||
//Change label
|
||||
$( this ).change(function(){
|
||||
if ( $( this ).is( ':checked' ) ){
|
||||
|
||||
$( labelName ).text( 'Enabled' );
|
||||
$("#" + switchId ).show();
|
||||
enit();
|
||||
}
|
||||
else{
|
||||
$( labelName ).text( 'Disabled' );
|
||||
$("#" + switchId ).hide();
|
||||
enit();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
//Slider for interval
|
||||
$(function(){
|
||||
$( '.sliderInterval' ).each(function(){
|
||||
var sliderName = $(this).attr("for");
|
||||
var a = $('input[name="' + sliderName + '"]').val();
|
||||
var b = 60;
|
||||
var c = a % b;
|
||||
if (a == 60){
|
||||
$('#' + sliderName ).text( (a-c)/b + " hour" );
|
||||
}
|
||||
else if (c <= 0){
|
||||
$('#' + sliderName ).text( (a-c)/b + " hours" );
|
||||
} else if ( a >= b ){
|
||||
$('#' + sliderName ).text( (a-c)/b + " hours " + c + " minutes" );
|
||||
} else {
|
||||
$('#' + sliderName ).text( a + " minutes" );
|
||||
}
|
||||
// Slider Function
|
||||
$( this ).slider({
|
||||
range: "max",
|
||||
min: 30,
|
||||
max: 1440,
|
||||
step: 10,
|
||||
value: a,
|
||||
slide: function( event, ui ) {
|
||||
a = ui.value;
|
||||
c = a % b;
|
||||
if (a == 60){
|
||||
$('input[name="' + sliderName + '"]').val( ui.value );
|
||||
$('#' + sliderName ).text( (a-c)/b + " hour" );
|
||||
}
|
||||
else if (c <= 0){
|
||||
$('input[name="' + sliderName + '"]').val( ui.value );
|
||||
$('#' + sliderName ).text( (a-c)/b + " hours" );
|
||||
} else if ( a >= b ){
|
||||
$('input[name="' + sliderName + '"]').val( ui.value );
|
||||
$('#' + sliderName ).text( (a-c)/b + " hours " + c + " minutes" );
|
||||
} else {
|
||||
$('input[name="' + sliderName + '"]').val( ui.value );
|
||||
$('#' + sliderName ).text( a + " minutes" );
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// Sliders
|
||||
$(document).ready(function() {
|
||||
var amountDwnld = $( "#amount-download-scan" ).val();
|
||||
$( "#slider-download-scan" ).slider({
|
||||
value: amountDwnld,
|
||||
min: 1,
|
||||
max: 120,
|
||||
slide: function( event, ui ) {
|
||||
$( "#amount-download-scan" ).val(ui.value);
|
||||
}
|
||||
});
|
||||
});
|
||||
$(function() {
|
||||
var amountSearch = $( "#amount-nbz-search" ).val();
|
||||
$( "#slider-nbz-search" ).slider({
|
||||
value: amountSearch,
|
||||
min: 1,
|
||||
max: 120,
|
||||
slide: function( event, ui ) {
|
||||
$( "#amount-nbz-search" ).val(ui.value);
|
||||
}
|
||||
});
|
||||
});
|
||||
$(function() {
|
||||
var amountLib = $( "#amount-lib-scan" ).val();
|
||||
$( "#slider-lib-scan" ).slider({
|
||||
value: amountLib,
|
||||
min: 1,
|
||||
max: 120,
|
||||
slide: function( event, ui ) {
|
||||
$( "#amount-lib-scan" ).val( ui.value );
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
hideServerDivs = function () {
|
||||
$("#customoptions").hide("fast");
|
||||
$("#hpserveroptions").hide("fast");
|
||||
};
|
||||
// end sliders
|
||||
|
||||
handleNewSelection = function () {
|
||||
|
||||
hideServerDivs();
|
||||
|
||||
switch ($(this).val()) {
|
||||
case 'custom':
|
||||
$("#customoptions").show("fast");
|
||||
break;
|
||||
case 'headphones':
|
||||
$("#hpserveroptions").show("fast");
|
||||
break;
|
||||
}
|
||||
};
|
||||
Vendored
File diff suppressed because one or more lines are too long
+31
-31
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* jQuery Form Plugin
|
||||
* version: 3.09 (16-APR-2012)
|
||||
* version: 3.14 (30-JUL-2012)
|
||||
* @requires jQuery v1.3.2 or later
|
||||
*
|
||||
* Examples and documentation at: http://malsup.com/jquery/form/
|
||||
@@ -165,7 +165,7 @@ $.fn.ajaxSubmit = function(options) {
|
||||
}
|
||||
|
||||
options.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg
|
||||
var context = options.context || options; // jQuery 1.4+ supports scope context
|
||||
var context = options.context || this ; // jQuery 1.4+ supports scope context
|
||||
for (var i=0, max=callbacks.length; i < max; i++) {
|
||||
callbacks[i].apply(context, [data, status, xhr || $form, $form]);
|
||||
}
|
||||
@@ -253,11 +253,11 @@ $.fn.ajaxSubmit = function(options) {
|
||||
}
|
||||
|
||||
s.data = null;
|
||||
var beforeSend = s.beforeSend;
|
||||
s.beforeSend = function(xhr, o) {
|
||||
o.data = formdata;
|
||||
if(beforeSend)
|
||||
beforeSend.call(o, xhr, options);
|
||||
var beforeSend = s.beforeSend;
|
||||
s.beforeSend = function(xhr, o) {
|
||||
o.data = formdata;
|
||||
if(beforeSend)
|
||||
beforeSend.call(this, xhr, o);
|
||||
};
|
||||
$.ajax(s);
|
||||
}
|
||||
@@ -316,6 +316,12 @@ $.fn.ajaxSubmit = function(options) {
|
||||
var e = (status === 'timeout' ? 'timeout' : 'aborted');
|
||||
log('aborting upload... ' + e);
|
||||
this.aborted = 1;
|
||||
// #214
|
||||
if (io.contentWindow.document.execCommand) {
|
||||
try { // #214
|
||||
io.contentWindow.document.execCommand('Stop');
|
||||
} catch(ignore) {}
|
||||
}
|
||||
$io.attr('src', s.iframeSrc); // abort op in progress
|
||||
xhr.error = e;
|
||||
if (s.error)
|
||||
@@ -426,9 +432,16 @@ $.fn.ajaxSubmit = function(options) {
|
||||
if (s.extraData) {
|
||||
for (var n in s.extraData) {
|
||||
if (s.extraData.hasOwnProperty(n)) {
|
||||
extraInputs.push(
|
||||
$('<input type="hidden" name="'+n+'">').attr('value',s.extraData[n])
|
||||
.appendTo(form)[0]);
|
||||
// if using the $.param format that allows for multiple values with the same name
|
||||
if($.isPlainObject(s.extraData[n]) && s.extraData[n].hasOwnProperty('name') && s.extraData[n].hasOwnProperty('value')) {
|
||||
extraInputs.push(
|
||||
$('<input type="hidden" name="'+s.extraData[n].name+'">').attr('value',s.extraData[n].value)
|
||||
.appendTo(form)[0]);
|
||||
} else {
|
||||
extraInputs.push(
|
||||
$('<input type="hidden" name="'+n+'">').attr('value',s.extraData[n])
|
||||
.appendTo(form)[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -997,7 +1010,7 @@ $.fn.clearFields = $.fn.clearInputs = function(includeHidden) {
|
||||
this.selectedIndex = -1;
|
||||
}
|
||||
else if (includeHidden) {
|
||||
// includeHidden can be the valud true, or it can be a selector string
|
||||
// includeHidden can be the value true, or it can be a selector string
|
||||
// indicating a special test; for example:
|
||||
// $('#myForm').clearForm('.special:hidden')
|
||||
// the above would clean hidden inputs that have the class of 'special'
|
||||
|
||||
@@ -1,265 +0,0 @@
|
||||
/**
|
||||
* noty - jQuery Notification Plugin v1.2.1
|
||||
* Contributors: https://github.com/needim/noty/graphs/contributors
|
||||
*
|
||||
* Examples and Documentation - http://needim.github.com/noty/
|
||||
*
|
||||
* Licensed under the MIT licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
*
|
||||
**/
|
||||
(function($) {
|
||||
$.noty = function(options, customContainer) {
|
||||
|
||||
var base = {};
|
||||
var $noty = null;
|
||||
var isCustom = false;
|
||||
|
||||
base.init = function(options) {
|
||||
base.options = $.extend({}, $.noty.defaultOptions, options);
|
||||
base.options.type = base.options.cssPrefix+base.options.type;
|
||||
base.options.id = base.options.type+'_'+new Date().getTime();
|
||||
base.options.layout = base.options.cssPrefix+'layout_'+base.options.layout;
|
||||
|
||||
if (base.options.custom.container) customContainer = base.options.custom.container;
|
||||
isCustom = ($.type(customContainer) === 'object') ? true : false;
|
||||
|
||||
return base.addQueue();
|
||||
};
|
||||
|
||||
// Push notification to queue
|
||||
base.addQueue = function() {
|
||||
var isGrowl = ($.inArray(base.options.layout, $.noty.growls) == -1) ? false : true;
|
||||
if (!isGrowl) (base.options.force) ? $.noty.queue.unshift({options: base.options}) : $.noty.queue.push({options: base.options});
|
||||
return base.render(isGrowl);
|
||||
};
|
||||
|
||||
// Render the noty
|
||||
base.render = function(isGrowl) {
|
||||
|
||||
// Layout spesific container settings
|
||||
var container = (isCustom) ? customContainer.addClass(base.options.theme+' '+base.options.layout+' noty_custom_container') : $('body');
|
||||
if (isGrowl) {
|
||||
if ($('ul.noty_cont.' + base.options.layout).length == 0)
|
||||
container.prepend($('<ul/>').addClass('noty_cont ' + base.options.layout));
|
||||
container = $('ul.noty_cont.' + base.options.layout);
|
||||
} else {
|
||||
if ($.noty.available) {
|
||||
var fromQueue = $.noty.queue.shift(); // Get noty from queue
|
||||
if ($.type(fromQueue) === 'object') {
|
||||
$.noty.available = false;
|
||||
base.options = fromQueue.options;
|
||||
} else {
|
||||
$.noty.available = true; // Queue is over
|
||||
return base.options.id;
|
||||
}
|
||||
} else {
|
||||
return base.options.id;
|
||||
}
|
||||
}
|
||||
base.container = container;
|
||||
|
||||
// Generating noty bar
|
||||
base.bar = $('<div class="noty_bar"/>').attr('id', base.options.id).addClass(base.options.theme+' '+base.options.layout+' '+base.options.type);
|
||||
$noty = base.bar;
|
||||
$noty.append(base.options.template).find('.noty_text').html(base.options.text);
|
||||
$noty.data('noty_options', base.options);
|
||||
|
||||
// Close button display
|
||||
(base.options.closeButton) ? $noty.addClass('noty_closable').find('.noty_close').show() : $noty.find('.noty_close').remove();
|
||||
|
||||
// Bind close event to button
|
||||
$noty.find('.noty_close').bind('click', function() { $noty.trigger('noty.close'); });
|
||||
|
||||
// If we have a button we must disable closeOnSelfClick and closeOnSelfOver option
|
||||
if (base.options.buttons) base.options.closeOnSelfClick = base.options.closeOnSelfOver = false;
|
||||
// Close on self click
|
||||
if (base.options.closeOnSelfClick) $noty.bind('click', function() { $noty.trigger('noty.close'); }).css('cursor', 'pointer');
|
||||
// Close on self mouseover
|
||||
if (base.options.closeOnSelfOver) $noty.bind('mouseover', function() { $noty.trigger('noty.close'); }).css('cursor', 'pointer');
|
||||
|
||||
// Set buttons if available
|
||||
if (base.options.buttons) {
|
||||
$buttons = $('<div/>').addClass('noty_buttons');
|
||||
$noty.find('.noty_message').append($buttons);
|
||||
$.each(base.options.buttons, function(i, button) {
|
||||
bclass = (button.type) ? button.type : 'gray';
|
||||
$button = $('<button/>').addClass(bclass).html(button.text).appendTo($noty.find('.noty_buttons'))
|
||||
.bind('click', function() {
|
||||
if ($.isFunction(button.click)) {
|
||||
button.click.call($button, $noty);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
return base.show(isGrowl);
|
||||
};
|
||||
|
||||
base.show = function(isGrowl) {
|
||||
|
||||
// is Modal?
|
||||
if (base.options.modal) $('<div/>').addClass('noty_modal').addClass(base.options.theme).prependTo($('body')).fadeIn('fast');
|
||||
|
||||
$noty.close = function() { return this.trigger('noty.close'); };
|
||||
|
||||
// Prepend noty to container
|
||||
(isGrowl) ? base.container.prepend($('<li/>').append($noty)) : base.container.prepend($noty);
|
||||
|
||||
// topCenter and center specific options
|
||||
if (base.options.layout == 'noty_layout_topCenter' || base.options.layout == 'noty_layout_center') {
|
||||
$.noty.reCenter($noty);
|
||||
}
|
||||
|
||||
$noty.bind('noty.setText', function(event, text) {
|
||||
$noty.find('.noty_text').html(text);
|
||||
|
||||
if (base.options.layout == 'noty_layout_topCenter' || base.options.layout == 'noty_layout_center') {
|
||||
$.noty.reCenter($noty);
|
||||
}
|
||||
});
|
||||
|
||||
$noty.bind('noty.setType', function(event, type) {
|
||||
$noty.removeClass($noty.data('noty_options').type);
|
||||
|
||||
type = $noty.data('noty_options').cssPrefix+type;
|
||||
|
||||
$noty.data('noty_options').type = type;
|
||||
|
||||
$noty.addClass(type);
|
||||
|
||||
if (base.options.layout == 'noty_layout_topCenter' || base.options.layout == 'noty_layout_center') {
|
||||
$.noty.reCenter($noty);
|
||||
}
|
||||
});
|
||||
|
||||
$noty.bind('noty.getId', function(event) {
|
||||
return $noty.data('noty_options').id;
|
||||
});
|
||||
|
||||
// Bind close event
|
||||
$noty.one('noty.close', function(event) {
|
||||
var options = $noty.data('noty_options');
|
||||
if(options.onClose){options.onClose();}
|
||||
|
||||
// Modal Cleaning
|
||||
if (options.modal) $('.noty_modal').fadeOut('fast', function() { $(this).remove(); });
|
||||
|
||||
$noty.clearQueue().stop().animate(
|
||||
$noty.data('noty_options').animateClose,
|
||||
$noty.data('noty_options').speed,
|
||||
$noty.data('noty_options').easing,
|
||||
$noty.data('noty_options').onClosed)
|
||||
.promise().done(function() {
|
||||
|
||||
// Layout spesific cleaning
|
||||
if ($.inArray($noty.data('noty_options').layout, $.noty.growls) > -1) {
|
||||
$noty.parent().remove();
|
||||
} else {
|
||||
$noty.remove();
|
||||
|
||||
// queue render
|
||||
$.noty.available = true;
|
||||
base.render(false);
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
// Start the show
|
||||
if(base.options.onShow){base.options.onShow();}
|
||||
$noty.animate(base.options.animateOpen, base.options.speed, base.options.easing, base.options.onShown);
|
||||
|
||||
// If noty is have a timeout option
|
||||
if (base.options.timeout) $noty.delay(base.options.timeout).promise().done(function() { $noty.trigger('noty.close'); });
|
||||
return base.options.id;
|
||||
};
|
||||
|
||||
// Run initializer
|
||||
return base.init(options);
|
||||
};
|
||||
|
||||
// API
|
||||
$.noty.get = function(id) { return $('#'+id); };
|
||||
$.noty.close = function(id) {
|
||||
//remove from queue if not already visible
|
||||
for(var i=0;i<$.noty.queue.length;) {
|
||||
if($.noty.queue[i].options.id==id)
|
||||
$.noty.queue.splice(id,1);
|
||||
else
|
||||
i++;
|
||||
}
|
||||
//close if already visible
|
||||
$.noty.get(id).trigger('noty.close');
|
||||
};
|
||||
$.noty.setText = function(id, text) {
|
||||
$.noty.get(id).trigger('noty.setText', text);
|
||||
};
|
||||
$.noty.setType = function(id, type) {
|
||||
$.noty.get(id).trigger('noty.setType', type);
|
||||
};
|
||||
$.noty.closeAll = function() {
|
||||
$.noty.clearQueue();
|
||||
$('.noty_bar').trigger('noty.close');
|
||||
};
|
||||
$.noty.reCenter = function(noty) {
|
||||
noty.css({'left': ($(window).width() - noty.outerWidth()) / 2 + 'px'});
|
||||
};
|
||||
$.noty.clearQueue = function() {
|
||||
$.noty.queue = [];
|
||||
};
|
||||
|
||||
var windowAlert = window.alert;
|
||||
$.noty.consumeAlert = function(options){
|
||||
window.alert = function(text){
|
||||
if(options){options.text = text;}
|
||||
else{options = {text:text};}
|
||||
$.noty(options);
|
||||
};
|
||||
}
|
||||
$.noty.stopConsumeAlert = function(){
|
||||
window.alert = windowAlert;
|
||||
}
|
||||
|
||||
$.noty.queue = [];
|
||||
$.noty.growls = ['noty_layout_topLeft', 'noty_layout_topRight', 'noty_layout_bottomLeft', 'noty_layout_bottomRight'];
|
||||
$.noty.available = true;
|
||||
$.noty.defaultOptions = {
|
||||
layout: 'bottomRight',
|
||||
theme: 'noty_theme_default',
|
||||
animateOpen: {height: 'toggle'},
|
||||
animateClose: {height: 'toggle'},
|
||||
easing: 'swing',
|
||||
text: '',
|
||||
type: 'alert',
|
||||
speed: 500,
|
||||
timeout: 5000,
|
||||
closeButton: false,
|
||||
closeOnSelfClick: true,
|
||||
closeOnSelfOver: false,
|
||||
force: false,
|
||||
onShow: false,
|
||||
onShown: false,
|
||||
onClose: false,
|
||||
onClosed: false,
|
||||
buttons: false,
|
||||
modal: false,
|
||||
template: '<div class="noty_message"><span class="noty_text"></span><div class="noty_close"></div></div>',
|
||||
cssPrefix: 'noty_',
|
||||
custom: {
|
||||
container: null
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.noty = function(options) {
|
||||
return this.each(function() {
|
||||
(new $.noty(options, $(this)));
|
||||
});
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
|
||||
//Helper
|
||||
function noty(options) {
|
||||
return jQuery.noty(options); // returns an id
|
||||
}
|
||||
@@ -0,0 +1,471 @@
|
||||
/**
|
||||
* noty - jQuery Notification Plugin v2.0.3
|
||||
* Contributors: https://github.com/needim/noty/graphs/contributors
|
||||
*
|
||||
* Examples and Documentation - http://needim.github.com/noty/
|
||||
*
|
||||
* Licensed under the MIT licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
*
|
||||
**/
|
||||
|
||||
if (typeof Object.create !== 'function') {
|
||||
Object.create = function (o) {
|
||||
function F() {};
|
||||
F.prototype = o;
|
||||
return new F();
|
||||
};
|
||||
};
|
||||
|
||||
;(function($) {
|
||||
|
||||
var NotyObject = {
|
||||
|
||||
init: function(options) {
|
||||
|
||||
// Mix in the passed in options with the default options
|
||||
this.options = $.extend({}, $.noty.defaults, options);
|
||||
|
||||
this.options.layout = (this.options.custom) ? $.noty.layouts['inline'] : $.noty.layouts[this.options.layout];
|
||||
this.options.theme = $.noty.themes[this.options.theme];
|
||||
|
||||
delete options.layout, delete options.theme;
|
||||
|
||||
this.options = $.extend({}, this.options, this.options.layout.options);
|
||||
this.options.id = 'noty_' + (new Date().getTime() * Math.floor(Math.random()* 1000000));
|
||||
|
||||
this.options = $.extend({}, this.options, options);
|
||||
|
||||
// Build the noty dom initial structure
|
||||
this._build();
|
||||
|
||||
// return this so we can chain/use the bridge with less code.
|
||||
return this;
|
||||
}, // end init
|
||||
|
||||
_build: function() {
|
||||
|
||||
// Generating noty bar
|
||||
var $bar = $('<div class="noty_bar"/>').attr('id', this.options.id);
|
||||
$bar.append(this.options.template).find('.noty_text').html(this.options.text);
|
||||
|
||||
this.$bar = (this.options.layout.parent.object !== null) ? $(this.options.layout.parent.object).css(this.options.layout.parent.css).append($bar) : $bar;
|
||||
|
||||
// Set buttons if available
|
||||
if (this.options.buttons) {
|
||||
|
||||
// If we have button disable closeWith & timeout options
|
||||
this.options.closeWith = [], this.options.timeout = false;
|
||||
|
||||
var $buttons = $('<div/>').addClass('noty_buttons');
|
||||
|
||||
(this.options.layout.parent.object !== null) ? this.$bar.find('.noty_bar').append($buttons) : this.$bar.append($buttons);
|
||||
|
||||
var self = this;
|
||||
|
||||
$.each(this.options.buttons, function(i, button) {
|
||||
var $button = $('<button/>').addClass((button.addClass) ? button.addClass : 'gray').html(button.text)
|
||||
.appendTo(self.$bar.find('.noty_buttons'))
|
||||
.bind('click', function(e) { if ($.isFunction(button.onClick)) { button.onClick.call($button, self); } });
|
||||
});
|
||||
}
|
||||
|
||||
// For easy access
|
||||
this.$message = this.$bar.find('.noty_message');
|
||||
this.$closeButton = this.$bar.find('.noty_close');
|
||||
this.$buttons = this.$bar.find('.noty_buttons');
|
||||
|
||||
$.noty.store[this.options.id] = this; // store noty for api
|
||||
|
||||
}, // end _build
|
||||
|
||||
show: function() {
|
||||
|
||||
var self = this;
|
||||
|
||||
$(self.options.layout.container.selector).append(self.$bar);
|
||||
|
||||
self.options.theme.style.apply(self);
|
||||
|
||||
($.type(self.options.layout.css) === 'function') ? this.options.layout.css.apply(self.$bar) : self.$bar.css(this.options.layout.css || {});
|
||||
|
||||
self.$bar.addClass(self.options.layout.addClass);
|
||||
|
||||
self.options.layout.container.style.apply($(self.options.layout.container.selector));
|
||||
|
||||
self.options.theme.callback.onShow.apply(this);
|
||||
|
||||
if ($.inArray('click', self.options.closeWith) > -1)
|
||||
self.$bar.css('cursor', 'pointer').one('click', function() { self.close(); });
|
||||
|
||||
if ($.inArray('hover', self.options.closeWith) > -1)
|
||||
self.$bar.one('mouseenter', function() { self.close(); });
|
||||
|
||||
if ($.inArray('button', self.options.closeWith) > -1)
|
||||
self.$closeButton.one('click', function() { self.close(); });
|
||||
|
||||
if ($.inArray('button', self.options.closeWith) == -1)
|
||||
self.$closeButton.remove();
|
||||
|
||||
if (self.options.callback.onShow)
|
||||
self.options.callback.onShow.apply(self);
|
||||
|
||||
self.$bar.animate(
|
||||
self.options.animation.open,
|
||||
self.options.animation.speed,
|
||||
self.options.animation.easing,
|
||||
function() {
|
||||
if (self.options.callback.afterShow) self.options.callback.afterShow.apply(self);
|
||||
self.shown = true;
|
||||
});
|
||||
|
||||
// If noty is have a timeout option
|
||||
if (self.options.timeout)
|
||||
self.$bar.delay(self.options.timeout).promise().done(function() { self.close(); });
|
||||
|
||||
return this;
|
||||
|
||||
}, // end show
|
||||
|
||||
close: function() {
|
||||
|
||||
if (this.closed) return;
|
||||
|
||||
var self = this;
|
||||
|
||||
if (!this.shown) { // If we are still waiting in the queue just delete from queue
|
||||
$.each($.noty.queue, function(i, n) {
|
||||
if (n.options.id == self.options.id) {
|
||||
$.noty.queue.splice(i, 1);
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
self.$bar.addClass('i-am-closing-now');
|
||||
|
||||
if (self.options.callback.onClose) { self.options.callback.onClose.apply(self); }
|
||||
|
||||
self.$bar.clearQueue().stop().animate(
|
||||
self.options.animation.close,
|
||||
self.options.animation.speed,
|
||||
self.options.animation.easing,
|
||||
function() { if (self.options.callback.afterClose) self.options.callback.afterClose.apply(self); })
|
||||
.promise().done(function() {
|
||||
|
||||
// Modal Cleaning
|
||||
if (self.options.modal) {
|
||||
$.notyRenderer.setModalCount(-1);
|
||||
if ($.notyRenderer.getModalCount() == 0) $('.noty_modal').fadeOut('fast', function() { $(this).remove(); });
|
||||
}
|
||||
|
||||
// Layout Cleaning
|
||||
$.notyRenderer.setLayoutCountFor(self, -1);
|
||||
if ($.notyRenderer.getLayoutCountFor(self) == 0) $(self.options.layout.container.selector).remove();
|
||||
|
||||
self.$bar.remove();
|
||||
self.$bar = null;
|
||||
self.closed = true;
|
||||
|
||||
delete $.noty.store[self.options.id]; // deleting noty from store
|
||||
|
||||
if (!self.options.dismissQueue) {
|
||||
// Queue render
|
||||
$.noty.ontap = true;
|
||||
|
||||
$.notyRenderer.render();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}, // end close
|
||||
|
||||
setText: function(text) {
|
||||
if (!this.closed) {
|
||||
this.options.text = text;
|
||||
this.$bar.find('.noty_text').html(text);
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
setType: function(type) {
|
||||
if (!this.closed) {
|
||||
this.options.type = type;
|
||||
this.options.theme.style.apply(this);
|
||||
this.options.theme.callback.onShow.apply(this);
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
closed: false,
|
||||
shown: false
|
||||
|
||||
}; // end NotyObject
|
||||
|
||||
$.notyRenderer = {};
|
||||
|
||||
$.notyRenderer.init = function(options) {
|
||||
|
||||
// Renderer creates a new noty
|
||||
var notification = Object.create(NotyObject).init(options);
|
||||
|
||||
(notification.options.force) ? $.noty.queue.unshift(notification) : $.noty.queue.push(notification);
|
||||
|
||||
$.notyRenderer.render();
|
||||
|
||||
return ($.noty.returns == 'object') ? notification : notification.options.id;
|
||||
};
|
||||
|
||||
$.notyRenderer.render = function() {
|
||||
|
||||
var instance = $.noty.queue[0];
|
||||
|
||||
if ($.type(instance) === 'object') {
|
||||
if (instance.options.dismissQueue) {
|
||||
$.notyRenderer.show($.noty.queue.shift());
|
||||
} else {
|
||||
if ($.noty.ontap) {
|
||||
$.notyRenderer.show($.noty.queue.shift());
|
||||
$.noty.ontap = false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$.noty.ontap = true; // Queue is over
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
$.notyRenderer.show = function(notification) {
|
||||
|
||||
if (notification.options.modal) {
|
||||
$.notyRenderer.createModalFor(notification);
|
||||
$.notyRenderer.setModalCount(+1);
|
||||
}
|
||||
|
||||
// Where is the container?
|
||||
if ($(notification.options.layout.container.selector).length == 0) {
|
||||
if (notification.options.custom) {
|
||||
notification.options.custom.append($(notification.options.layout.container.object).addClass('i-am-new'));
|
||||
} else {
|
||||
$('body').append($(notification.options.layout.container.object).addClass('i-am-new'));
|
||||
}
|
||||
} else {
|
||||
$(notification.options.layout.container.selector).removeClass('i-am-new');
|
||||
}
|
||||
|
||||
$.notyRenderer.setLayoutCountFor(notification, +1);
|
||||
|
||||
notification.show();
|
||||
};
|
||||
|
||||
$.notyRenderer.createModalFor = function(notification) {
|
||||
if ($('.noty_modal').length == 0)
|
||||
$('<div/>').addClass('noty_modal').data('noty_modal_count', 0).css(notification.options.theme.modal.css).prependTo($('body')).fadeIn('fast');
|
||||
};
|
||||
|
||||
$.notyRenderer.getLayoutCountFor = function(notification) {
|
||||
return $(notification.options.layout.container.selector).data('noty_layout_count') || 0;
|
||||
};
|
||||
|
||||
$.notyRenderer.setLayoutCountFor = function(notification, arg) {
|
||||
return $(notification.options.layout.container.selector).data('noty_layout_count', $.notyRenderer.getLayoutCountFor(notification) + arg);
|
||||
};
|
||||
|
||||
$.notyRenderer.getModalCount = function() {
|
||||
return $('.noty_modal').data('noty_modal_count') || 0;
|
||||
};
|
||||
|
||||
$.notyRenderer.setModalCount = function(arg) {
|
||||
return $('.noty_modal').data('noty_modal_count', $.notyRenderer.getModalCount() + arg);
|
||||
};
|
||||
|
||||
// This is for custom container
|
||||
$.fn.noty = function(options) {
|
||||
options.custom = $(this);
|
||||
return $.notyRenderer.init(options);
|
||||
};
|
||||
|
||||
$.noty = {};
|
||||
$.noty.queue = [];
|
||||
$.noty.ontap = true;
|
||||
$.noty.layouts = {};
|
||||
$.noty.themes = {};
|
||||
$.noty.returns = 'object';
|
||||
$.noty.store = {};
|
||||
|
||||
$.noty.get = function(id) {
|
||||
return $.noty.store.hasOwnProperty(id) ? $.noty.store[id] : false;
|
||||
};
|
||||
|
||||
$.noty.close = function(id) {
|
||||
return $.noty.get(id) ? $.noty.get(id).close() : false;
|
||||
};
|
||||
|
||||
$.noty.setText = function(id, text) {
|
||||
return $.noty.get(id) ? $.noty.get(id).setText(text) : false;
|
||||
};
|
||||
|
||||
$.noty.setType = function(id, type) {
|
||||
return $.noty.get(id) ? $.noty.get(id).setType(type) : false;
|
||||
};
|
||||
|
||||
$.noty.clearQueue = function() {
|
||||
$.noty.queue = [];
|
||||
};
|
||||
|
||||
$.noty.closeAll = function() {
|
||||
$.noty.clearQueue();
|
||||
$.each($.noty.store, function(id, noty) {
|
||||
noty.close();
|
||||
});
|
||||
};
|
||||
|
||||
var windowAlert = window.alert;
|
||||
|
||||
$.noty.consumeAlert = function(options) {
|
||||
window.alert = function(text) {
|
||||
if (options)
|
||||
options.text = text;
|
||||
else
|
||||
options = {text:text};
|
||||
|
||||
$.notyRenderer.init(options);
|
||||
};
|
||||
};
|
||||
|
||||
$.noty.stopConsumeAlert = function(){
|
||||
window.alert = windowAlert;
|
||||
};
|
||||
|
||||
$.noty.defaults = {
|
||||
layout: 'top',
|
||||
theme: 'default',
|
||||
type: 'alert',
|
||||
text: '',
|
||||
dismissQueue: true,
|
||||
template: '<div class="noty_message"><span class="noty_text"></span><div class="noty_close"></div></div>',
|
||||
animation: {
|
||||
open: {height: 'toggle'},
|
||||
close: {height: 'toggle'},
|
||||
easing: 'swing',
|
||||
speed: 500
|
||||
},
|
||||
timeout: false,
|
||||
force: false,
|
||||
modal: false,
|
||||
closeWith: ['click'],
|
||||
callback: {
|
||||
onShow: function() {},
|
||||
afterShow: function() {},
|
||||
onClose: function() {},
|
||||
afterClose: function() {}
|
||||
},
|
||||
buttons: false
|
||||
};
|
||||
|
||||
$(window).resize(function() {
|
||||
$.each($.noty.layouts, function(index, layout) {
|
||||
layout.container.style.apply($(layout.container.selector));
|
||||
});
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
|
||||
// Helpers
|
||||
function noty(options) {
|
||||
|
||||
// This is for BC - Will be deleted on v2.2.0
|
||||
var using_old = 0
|
||||
, old_to_new = {
|
||||
'animateOpen': 'animation.open',
|
||||
'animateClose': 'animation.close',
|
||||
'easing': 'animation.easing',
|
||||
'speed': 'animation.speed',
|
||||
'onShow': 'callback.onShow',
|
||||
'onShown': 'callback.afterShow',
|
||||
'onClose': 'callback.onClose',
|
||||
'onClosed': 'callback.afterClose'
|
||||
}
|
||||
|
||||
jQuery.each(options, function(key, value) {
|
||||
if (old_to_new[key]) {
|
||||
using_old++;
|
||||
var _new = old_to_new[key].split('.');
|
||||
|
||||
if (!options[_new[0]]) options[_new[0]] = {};
|
||||
|
||||
options[_new[0]][_new[1]] = (value) ? value : function() {};
|
||||
delete options[key];
|
||||
}
|
||||
});
|
||||
|
||||
if (!options.closeWith) {
|
||||
options.closeWith = jQuery.noty.defaults.closeWith;
|
||||
}
|
||||
|
||||
if (options.hasOwnProperty('closeButton')) {
|
||||
using_old++;
|
||||
if (options.closeButton) options.closeWith.push('button');
|
||||
delete options.closeButton;
|
||||
}
|
||||
|
||||
if (options.hasOwnProperty('closeOnSelfClick')) {
|
||||
using_old++;
|
||||
if (options.closeOnSelfClick) options.closeWith.push('click');
|
||||
delete options.closeOnSelfClick;
|
||||
}
|
||||
|
||||
if (options.hasOwnProperty('closeOnSelfOver')) {
|
||||
using_old++;
|
||||
if (options.closeOnSelfOver) options.closeWith.push('hover');
|
||||
delete options.closeOnSelfOver;
|
||||
}
|
||||
|
||||
if (options.hasOwnProperty('custom')) {
|
||||
using_old++;
|
||||
if (options.custom.container != 'null') options.custom = options.custom.container;
|
||||
}
|
||||
|
||||
if (options.hasOwnProperty('cssPrefix')) {
|
||||
using_old++;
|
||||
delete options.cssPrefix;
|
||||
}
|
||||
|
||||
if (options.theme == 'noty_theme_default') {
|
||||
using_old++;
|
||||
options.theme = 'default';
|
||||
}
|
||||
|
||||
if (!options.hasOwnProperty('dismissQueue')) {
|
||||
if (options.layout == 'topLeft'
|
||||
|| options.layout == 'topRight'
|
||||
|| options.layout == 'bottomLeft'
|
||||
|| options.layout == 'bottomRight') {
|
||||
options.dismissQueue = true;
|
||||
} else {
|
||||
options.dismissQueue = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (options.buttons) {
|
||||
jQuery.each(options.buttons, function(i, button) {
|
||||
if (button.click) {
|
||||
using_old++;
|
||||
button.onClick = button.click;
|
||||
delete button.click;
|
||||
}
|
||||
if (button.type) {
|
||||
using_old++;
|
||||
button.addClass = button.type;
|
||||
delete button.type;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (using_old) console.warn('You are using noty v2 with v1.x.x options. @deprecated until v2.2.0 - Please update your options.');
|
||||
|
||||
// console.log(options);
|
||||
// End of the BC
|
||||
|
||||
return jQuery.notyRenderer.init(options);
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
;(function($) {
|
||||
|
||||
$.noty.layouts.bottom = {
|
||||
name: 'bottom',
|
||||
options: {},
|
||||
container: {
|
||||
object: '<ul id="noty_bottom_layout_container" />',
|
||||
selector: 'ul#noty_bottom_layout_container',
|
||||
style: function() {
|
||||
$(this).css({
|
||||
bottom: 0,
|
||||
left: '5%',
|
||||
position: 'fixed',
|
||||
width: '90%',
|
||||
height: 'auto',
|
||||
margin: 0,
|
||||
padding: 0,
|
||||
listStyleType: 'none',
|
||||
zIndex: 9999999
|
||||
});
|
||||
}
|
||||
},
|
||||
parent: {
|
||||
object: '<li />',
|
||||
selector: 'li',
|
||||
css: {}
|
||||
},
|
||||
css: {
|
||||
display: 'none'
|
||||
},
|
||||
addClass: ''
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,41 @@
|
||||
;(function($) {
|
||||
|
||||
$.noty.layouts.bottomCenter = {
|
||||
name: 'bottomCenter',
|
||||
options: { // overrides options
|
||||
|
||||
},
|
||||
container: {
|
||||
object: '<ul id="noty_bottomCenter_layout_container" />',
|
||||
selector: 'ul#noty_bottomCenter_layout_container',
|
||||
style: function() {
|
||||
$(this).css({
|
||||
bottom: 20,
|
||||
left: 0,
|
||||
position: 'fixed',
|
||||
width: '310px',
|
||||
height: 'auto',
|
||||
margin: 0,
|
||||
padding: 0,
|
||||
listStyleType: 'none',
|
||||
zIndex: 10000000
|
||||
});
|
||||
|
||||
$(this).css({
|
||||
left: ($(window).width() - $(this).outerWidth()) / 2 + 'px',
|
||||
});
|
||||
}
|
||||
},
|
||||
parent: {
|
||||
object: '<li />',
|
||||
selector: 'li',
|
||||
css: {}
|
||||
},
|
||||
css: {
|
||||
display: 'none',
|
||||
width: '310px'
|
||||
},
|
||||
addClass: ''
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,43 @@
|
||||
;(function($) {
|
||||
|
||||
$.noty.layouts.bottomLeft = {
|
||||
name: 'bottomLeft',
|
||||
options: { // overrides options
|
||||
|
||||
},
|
||||
container: {
|
||||
object: '<ul id="noty_bottomLeft_layout_container" />',
|
||||
selector: 'ul#noty_bottomLeft_layout_container',
|
||||
style: function() {
|
||||
$(this).css({
|
||||
bottom: 20,
|
||||
left: 20,
|
||||
position: 'fixed',
|
||||
width: '310px',
|
||||
height: 'auto',
|
||||
margin: 0,
|
||||
padding: 0,
|
||||
listStyleType: 'none',
|
||||
zIndex: 10000000
|
||||
});
|
||||
|
||||
if (window.innerWidth < 600) {
|
||||
$(this).css({
|
||||
left: 5
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
parent: {
|
||||
object: '<li />',
|
||||
selector: 'li',
|
||||
css: {}
|
||||
},
|
||||
css: {
|
||||
display: 'none',
|
||||
width: '310px'
|
||||
},
|
||||
addClass: ''
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,43 @@
|
||||
;(function($) {
|
||||
|
||||
$.noty.layouts.bottomRight = {
|
||||
name: 'bottomRight',
|
||||
options: { // overrides options
|
||||
|
||||
},
|
||||
container: {
|
||||
object: '<ul id="noty_bottomRight_layout_container" />',
|
||||
selector: 'ul#noty_bottomRight_layout_container',
|
||||
style: function() {
|
||||
$(this).css({
|
||||
bottom: 50,
|
||||
right: 20,
|
||||
position: 'fixed',
|
||||
width: '310px',
|
||||
height: 'auto',
|
||||
margin: 0,
|
||||
padding: 0,
|
||||
listStyleType: 'none',
|
||||
zIndex: 10000000
|
||||
});
|
||||
|
||||
if (window.innerWidth < 600) {
|
||||
$(this).css({
|
||||
right: 5
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
parent: {
|
||||
object: '<li />',
|
||||
selector: 'li',
|
||||
css: {}
|
||||
},
|
||||
css: {
|
||||
display: 'none',
|
||||
width: '310px'
|
||||
},
|
||||
addClass: ''
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,56 @@
|
||||
;(function($) {
|
||||
|
||||
$.noty.layouts.center = {
|
||||
name: 'center',
|
||||
options: { // overrides options
|
||||
|
||||
},
|
||||
container: {
|
||||
object: '<ul id="noty_center_layout_container" />',
|
||||
selector: 'ul#noty_center_layout_container',
|
||||
style: function() {
|
||||
$(this).css({
|
||||
position: 'fixed',
|
||||
width: '310px',
|
||||
height: 'auto',
|
||||
margin: 0,
|
||||
padding: 0,
|
||||
listStyleType: 'none',
|
||||
zIndex: 10000000
|
||||
});
|
||||
|
||||
// getting hidden height
|
||||
var dupe = $(this).clone().css({visibility:"hidden", display:"block", position:"absolute", top: 0, left: 0}).attr('id', 'dupe');
|
||||
$("body").append(dupe);
|
||||
dupe.find('.i-am-closing-now').remove();
|
||||
dupe.find('li').css('display', 'block');
|
||||
var actual_height = dupe.height();
|
||||
dupe.remove();
|
||||
|
||||
if ($(this).hasClass('i-am-new')) {
|
||||
$(this).css({
|
||||
left: ($(window).width() - $(this).outerWidth()) / 2 + 'px',
|
||||
top: ($(window).height() - actual_height) / 2 + 'px'
|
||||
});
|
||||
} else {
|
||||
$(this).animate({
|
||||
left: ($(window).width() - $(this).outerWidth()) / 2 + 'px',
|
||||
top: ($(window).height() - actual_height) / 2 + 'px'
|
||||
}, 500);
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
parent: {
|
||||
object: '<li />',
|
||||
selector: 'li',
|
||||
css: {}
|
||||
},
|
||||
css: {
|
||||
display: 'none',
|
||||
width: '310px'
|
||||
},
|
||||
addClass: ''
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,61 @@
|
||||
;(function($) {
|
||||
|
||||
$.noty.layouts.centerLeft = {
|
||||
name: 'centerLeft',
|
||||
options: { // overrides options
|
||||
|
||||
},
|
||||
container: {
|
||||
object: '<ul id="noty_centerLeft_layout_container" />',
|
||||
selector: 'ul#noty_centerLeft_layout_container',
|
||||
style: function() {
|
||||
$(this).css({
|
||||
left: 20,
|
||||
position: 'fixed',
|
||||
width: '310px',
|
||||
height: 'auto',
|
||||
margin: 0,
|
||||
padding: 0,
|
||||
listStyleType: 'none',
|
||||
zIndex: 10000000
|
||||
});
|
||||
|
||||
// getting hidden height
|
||||
var dupe = $(this).clone().css({visibility:"hidden", display:"block", position:"absolute", top: 0, left: 0}).attr('id', 'dupe');
|
||||
$("body").append(dupe);
|
||||
dupe.find('.i-am-closing-now').remove();
|
||||
dupe.find('li').css('display', 'block');
|
||||
var actual_height = dupe.height();
|
||||
dupe.remove();
|
||||
|
||||
if ($(this).hasClass('i-am-new')) {
|
||||
$(this).css({
|
||||
top: ($(window).height() - actual_height) / 2 + 'px',
|
||||
});
|
||||
} else {
|
||||
$(this).animate({
|
||||
top: ($(window).height() - actual_height) / 2 + 'px'
|
||||
}, 500);
|
||||
}
|
||||
|
||||
if (window.innerWidth < 600) {
|
||||
$(this).css({
|
||||
left: 5
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
parent: {
|
||||
object: '<li />',
|
||||
selector: 'li',
|
||||
css: {}
|
||||
},
|
||||
css: {
|
||||
display: 'none',
|
||||
width: '310px'
|
||||
},
|
||||
addClass: ''
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,61 @@
|
||||
;(function($) {
|
||||
|
||||
$.noty.layouts.centerRight = {
|
||||
name: 'centerRight',
|
||||
options: { // overrides options
|
||||
|
||||
},
|
||||
container: {
|
||||
object: '<ul id="noty_centerRight_layout_container" />',
|
||||
selector: 'ul#noty_centerRight_layout_container',
|
||||
style: function() {
|
||||
$(this).css({
|
||||
right: 20,
|
||||
position: 'fixed',
|
||||
width: '310px',
|
||||
height: 'auto',
|
||||
margin: 0,
|
||||
padding: 0,
|
||||
listStyleType: 'none',
|
||||
zIndex: 10000000
|
||||
});
|
||||
|
||||
// getting hidden height
|
||||
var dupe = $(this).clone().css({visibility:"hidden", display:"block", position:"absolute", top: 0, left: 0}).attr('id', 'dupe');
|
||||
$("body").append(dupe);
|
||||
dupe.find('.i-am-closing-now').remove();
|
||||
dupe.find('li').css('display', 'block');
|
||||
var actual_height = dupe.height();
|
||||
dupe.remove();
|
||||
|
||||
if ($(this).hasClass('i-am-new')) {
|
||||
$(this).css({
|
||||
top: ($(window).height() - actual_height) / 2 + 'px',
|
||||
});
|
||||
} else {
|
||||
$(this).animate({
|
||||
top: ($(window).height() - actual_height) / 2 + 'px'
|
||||
}, 500);
|
||||
}
|
||||
|
||||
if (window.innerWidth < 600) {
|
||||
$(this).css({
|
||||
right: 5
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
parent: {
|
||||
object: '<li />',
|
||||
selector: 'li',
|
||||
css: {}
|
||||
},
|
||||
css: {
|
||||
display: 'none',
|
||||
width: '310px'
|
||||
},
|
||||
addClass: ''
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,31 @@
|
||||
;(function($) {
|
||||
|
||||
$.noty.layouts.inline = {
|
||||
name: 'inline',
|
||||
options: {},
|
||||
container: {
|
||||
object: '<ul id="noty_inline_layout_container" />',
|
||||
selector: 'ul#noty_inline_layout_container',
|
||||
style: function() {
|
||||
$(this).css({
|
||||
width: '100%',
|
||||
height: 'auto',
|
||||
margin: 0,
|
||||
padding: 0,
|
||||
listStyleType: 'none',
|
||||
zIndex: 9999999
|
||||
});
|
||||
}
|
||||
},
|
||||
parent: {
|
||||
object: '<li />',
|
||||
selector: 'li',
|
||||
css: {}
|
||||
},
|
||||
css: {
|
||||
display: 'none'
|
||||
},
|
||||
addClass: ''
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,34 @@
|
||||
;(function($) {
|
||||
|
||||
$.noty.layouts.top = {
|
||||
name: 'top',
|
||||
options: {},
|
||||
container: {
|
||||
object: '<ul id="noty_top_layout_container" />',
|
||||
selector: 'ul#noty_top_layout_container',
|
||||
style: function() {
|
||||
$(this).css({
|
||||
top: 0,
|
||||
left: '5%',
|
||||
position: 'fixed',
|
||||
width: '90%',
|
||||
height: 'auto',
|
||||
margin: 0,
|
||||
padding: 0,
|
||||
listStyleType: 'none',
|
||||
zIndex: 9999999
|
||||
});
|
||||
}
|
||||
},
|
||||
parent: {
|
||||
object: '<li />',
|
||||
selector: 'li',
|
||||
css: {}
|
||||
},
|
||||
css: {
|
||||
display: 'none'
|
||||
},
|
||||
addClass: ''
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,41 @@
|
||||
;(function($) {
|
||||
|
||||
$.noty.layouts.topCenter = {
|
||||
name: 'topCenter',
|
||||
options: { // overrides options
|
||||
|
||||
},
|
||||
container: {
|
||||
object: '<ul id="noty_topCenter_layout_container" />',
|
||||
selector: 'ul#noty_topCenter_layout_container',
|
||||
style: function() {
|
||||
$(this).css({
|
||||
top: 20,
|
||||
left: 0,
|
||||
position: 'fixed',
|
||||
width: '310px',
|
||||
height: 'auto',
|
||||
margin: 0,
|
||||
padding: 0,
|
||||
listStyleType: 'none',
|
||||
zIndex: 10000000
|
||||
});
|
||||
|
||||
$(this).css({
|
||||
left: ($(window).width() - $(this).outerWidth()) / 2 + 'px',
|
||||
});
|
||||
}
|
||||
},
|
||||
parent: {
|
||||
object: '<li />',
|
||||
selector: 'li',
|
||||
css: {}
|
||||
},
|
||||
css: {
|
||||
display: 'none',
|
||||
width: '310px'
|
||||
},
|
||||
addClass: ''
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,43 @@
|
||||
;(function($) {
|
||||
|
||||
$.noty.layouts.topLeft = {
|
||||
name: 'topLeft',
|
||||
options: { // overrides options
|
||||
|
||||
},
|
||||
container: {
|
||||
object: '<ul id="noty_topLeft_layout_container" />',
|
||||
selector: 'ul#noty_topLeft_layout_container',
|
||||
style: function() {
|
||||
$(this).css({
|
||||
top: 20,
|
||||
left: 20,
|
||||
position: 'fixed',
|
||||
width: '310px',
|
||||
height: 'auto',
|
||||
margin: 0,
|
||||
padding: 0,
|
||||
listStyleType: 'none',
|
||||
zIndex: 10000000
|
||||
});
|
||||
|
||||
if (window.innerWidth < 600) {
|
||||
$(this).css({
|
||||
left: 5
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
parent: {
|
||||
object: '<li />',
|
||||
selector: 'li',
|
||||
css: {}
|
||||
},
|
||||
css: {
|
||||
display: 'none',
|
||||
width: '310px'
|
||||
},
|
||||
addClass: ''
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,43 @@
|
||||
;(function($) {
|
||||
|
||||
$.noty.layouts.topRight = {
|
||||
name: 'topRight',
|
||||
options: { // overrides options
|
||||
|
||||
},
|
||||
container: {
|
||||
object: '<ul id="noty_topRight_layout_container" />',
|
||||
selector: 'ul#noty_topRight_layout_container',
|
||||
style: function() {
|
||||
$(this).css({
|
||||
top: 20,
|
||||
right: 20,
|
||||
position: 'fixed',
|
||||
width: '310px',
|
||||
height: 'auto',
|
||||
margin: 0,
|
||||
padding: 0,
|
||||
listStyleType: 'none',
|
||||
zIndex: 10000000
|
||||
});
|
||||
|
||||
if (window.innerWidth < 600) {
|
||||
$(this).css({
|
||||
right: 5
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
parent: {
|
||||
object: '<li />',
|
||||
selector: 'li',
|
||||
css: {}
|
||||
},
|
||||
css: {
|
||||
display: 'none',
|
||||
width: '310px'
|
||||
},
|
||||
addClass: ''
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,155 @@
|
||||
;(function($) {
|
||||
|
||||
$.noty.themes.default = {
|
||||
name: 'brink',
|
||||
helpers: {
|
||||
borderFix: function() {
|
||||
if (this.options.dismissQueue) {
|
||||
var selector = this.options.layout.container.selector + ' ' + this.options.layout.parent.selector;
|
||||
switch (this.options.layout.name) {
|
||||
case 'top':
|
||||
$(selector).css({borderRadius: '0px 0px 0px 0px'});
|
||||
$(selector).last().css({borderRadius: '0px 0px 0px 0px'}); break;
|
||||
case 'topCenter': case 'topLeft': case 'topRight':
|
||||
case 'bottomCenter': case 'bottomLeft': case 'bottomRight':
|
||||
case 'center': case 'centerLeft': case 'centerRight': case 'inline':
|
||||
$(selector).css({borderRadius: '0px 0px 0px 0px'});
|
||||
$(selector).first().css({'border-top-left-radius': '0px', 'border-top-right-radius': '0px'});
|
||||
$(selector).last().css({'border-bottom-left-radius': '0px', 'border-bottom-right-radius': '0px'}); break;
|
||||
case 'bottom':
|
||||
$(selector).css({borderRadius: '0px 0px 0px 0px'});
|
||||
$(selector).first().css({borderRadius: '0px 0px 0px 0px'}); break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
modal: {
|
||||
css: {
|
||||
position: 'fixed',
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
backgroundColor: '#000',
|
||||
zIndex: 10000,
|
||||
opacity: 0.6,
|
||||
display: 'none',
|
||||
left: 0,
|
||||
top: 0,
|
||||
}
|
||||
},
|
||||
style: function() {
|
||||
|
||||
this.$bar.css({
|
||||
overflow: 'hidden',
|
||||
background: "url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABsAAAAoCAYAAAAPOoFWAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAPZJREFUeNq81tsOgjAMANB2ov7/7ypaN7IlIwi9rGuT8QSc9EIDAsAznxvY4pXPKr05RUE5MEVB+TyWfCEl9LZApYopCmo9C4FKSMtYoI8Bwv79aQJU4l6hXXCZrQbokJEksxHo9KMOgc6w1atHXM8K9DVC7FQnJ0i8iK3QooGgbnyKgMDygBWyYFZoqx4qS27KqLZJjA1D0jK6QJcYEQEiWv9PGkTsbqxQ8oT+ZtZB6AkdsJnQDnMoHXHLGKOgDYuCWmYhEERCI5gaamW0bnHdA3k2ltlIN+2qKRyCND0bhqSYCyTB3CAOc4WusBEIpkeBuPgJMAAX8Hs1NfqHRgAAAABJRU5ErkJggg==') repeat-x scroll left top #fff"
|
||||
});
|
||||
|
||||
this.$message.css({
|
||||
fontSize: '.8em',
|
||||
lineHeight: '1em',
|
||||
textAlign: 'left',
|
||||
padding: '8px 10px 9px',
|
||||
width: 'auto',
|
||||
position: 'relative'
|
||||
});
|
||||
|
||||
this.$closeButton.css({
|
||||
position: 'absolute',
|
||||
top: 4, right: 4,
|
||||
width: 10, height: 10,
|
||||
background: "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugd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0+kpyRoRGyRBcpPkDsn1iEBr7drdP2VJZyQXERGSPpiZAViTBACXKaV9kqd5uVzCzO5KKb/d/UZSDwD/eyxqree1VqSu6zKAF2Z2RPJJaw0rAkjOJT0m+SuT/AbgDcmnkmBmfwAsJL1dXQ8lWY6IGwB1ZbrOOb8zs8thGP4COFwx/mE8Ho9Go9ErMzvJOW/1fY/JZIJSypqZfXX3L13X9fcDAKJct1sx3OiuAAAAAElFTkSuQmCC)",
|
||||
display: 'none',
|
||||
cursor: 'pointer',
|
||||
});
|
||||
|
||||
this.$buttons.css({
|
||||
padding: 5,
|
||||
textAlign: 'right',
|
||||
borderTop: '1px solid #ccc',
|
||||
backgroundColor: '#fff',
|
||||
});
|
||||
|
||||
this.$buttons.find('button').css({
|
||||
marginLeft: 5
|
||||
});
|
||||
|
||||
this.$buttons.find('button:first').css({
|
||||
marginLeft: 0
|
||||
});
|
||||
|
||||
this.$bar.bind({
|
||||
mouseenter: function() { $(this).find('.noty_close').fadeIn(); },
|
||||
mouseleave: function() { $(this).find('.noty_close').fadeOut(); }
|
||||
});
|
||||
|
||||
switch (this.options.layout.name) {
|
||||
case 'top':
|
||||
this.$bar.css({
|
||||
borderRadius: '0px 0px 0px 0px',
|
||||
borderBottom: '1px solid #eee',
|
||||
borderLeft: '1px solid #eee',
|
||||
borderRight: '1px solid #eee',
|
||||
boxShadow: "0 5px 4px rgba(0, 0, 0, 0.1)"
|
||||
});
|
||||
break;
|
||||
case 'topCenter': case 'center': case 'bottomCenter': case 'inline':
|
||||
this.$bar.css({
|
||||
borderRadius: '0px',
|
||||
border: '1px solid #eee',
|
||||
boxShadow: "0 2px 4px rgba(0, 0, 0, 0.1)"
|
||||
});
|
||||
this.$message.css({fontSize: '13px', textAlign: 'center'});
|
||||
break;
|
||||
case 'topLeft': case 'topRight':
|
||||
case 'bottomLeft': case 'bottomRight':
|
||||
case 'centerLeft': case 'centerRight':
|
||||
this.$bar.css({
|
||||
borderRadius: '0px',
|
||||
border: '1px solid #eee',
|
||||
boxShadow: "0 2px 4px rgba(0, 0, 0, 0.1)"
|
||||
});
|
||||
this.$message.css({fontSize: '13px', textAlign: 'left'});
|
||||
break;
|
||||
case 'bottom':
|
||||
this.$bar.css({
|
||||
borderRadius: '0x 0px 0px 0px',
|
||||
borderTop: '1px solid #eee',
|
||||
borderLeft: '1px solid #eee',
|
||||
borderRight: '1px solid #eee',
|
||||
boxShadow: "0 -2px 4px rgba(0, 0, 0, 0.1)"
|
||||
});
|
||||
break;
|
||||
default:
|
||||
this.$bar.css({
|
||||
border: '2px solid #eee',
|
||||
boxShadow: "0 2px 4px rgba(0, 0, 0, 0.1)"
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
||||
switch (this.options.type) {
|
||||
case 'alert': case 'notification':
|
||||
this.$bar.css({backgroundColor: '#FFF', borderColor: '#353535', color: '#444'}); break;
|
||||
case 'warning':
|
||||
this.$bar.css({backgroundColor: '#FFEAA8', borderColor: '#353535', color: '#826200'});
|
||||
this.$buttons.css({borderTop: '1px solid #FFC237'}); break;
|
||||
case 'error':
|
||||
this.$bar.css({backgroundColor: 'red', borderColor: '#353535', color: '#FFF'});
|
||||
this.$buttons.css({borderTop: '1px solid darkred'}); break;
|
||||
case 'information':
|
||||
this.$bar.css({backgroundColor: '#57B7E2', borderColor: '#353535', color: '#FFF'});
|
||||
this.$buttons.css({borderTop: '1px solid #0B90C4'}); break;
|
||||
case 'success':
|
||||
this.$bar.css({backgroundColor: 'lightgreen', borderColor: '#353535', color: '#000'});
|
||||
this.$buttons.css({borderTop: '1px solid #50C24E'});break;
|
||||
default:
|
||||
this.$bar.css({backgroundColor: '#FFF', borderColor: '#353535', color: '#444'}); break;
|
||||
}
|
||||
},
|
||||
callback: {
|
||||
onShow: function() { $.noty.themes.default.helpers.borderFix.apply(this); },
|
||||
onClose: function() { $.noty.themes.default.helpers.borderFix.apply(this); }
|
||||
}
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,156 @@
|
||||
;(function($) {
|
||||
|
||||
$.noty.themes.default = {
|
||||
name: 'default',
|
||||
helpers: {
|
||||
borderFix: function() {
|
||||
if (this.options.dismissQueue) {
|
||||
var selector = this.options.layout.container.selector + ' ' + this.options.layout.parent.selector;
|
||||
switch (this.options.layout.name) {
|
||||
case 'top':
|
||||
$(selector).css({borderRadius: '0px 0px 0px 0px'});
|
||||
$(selector).last().css({borderRadius: '0px 0px 5px 5px'}); break;
|
||||
case 'topCenter': case 'topLeft': case 'topRight':
|
||||
case 'bottomCenter': case 'bottomLeft': case 'bottomRight':
|
||||
case 'center': case 'centerLeft': case 'centerRight': case 'inline':
|
||||
$(selector).css({borderRadius: '0px 0px 0px 0px'});
|
||||
$(selector).first().css({'border-top-left-radius': '5px', 'border-top-right-radius': '5px'});
|
||||
$(selector).last().css({'border-bottom-left-radius': '5px', 'border-bottom-right-radius': '5px'}); break;
|
||||
case 'bottom':
|
||||
$(selector).css({borderRadius: '0px 0px 0px 0px'});
|
||||
$(selector).first().css({borderRadius: '5px 5px 0px 0px'}); break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
modal: {
|
||||
css: {
|
||||
position: 'fixed',
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
backgroundColor: '#000',
|
||||
zIndex: 10000,
|
||||
opacity: 0.6,
|
||||
display: 'none',
|
||||
left: 0,
|
||||
top: 0,
|
||||
}
|
||||
},
|
||||
style: function() {
|
||||
|
||||
this.$bar.css({
|
||||
overflow: 'hidden',
|
||||
background: "url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABsAAAAoCAYAAAAPOoFWAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAPZJREFUeNq81tsOgjAMANB2ov7/7ypaN7IlIwi9rGuT8QSc9EIDAsAznxvY4pXPKr05RUE5MEVB+TyWfCEl9LZApYopCmo9C4FKSMtYoI8Bwv79aQJU4l6hXXCZrQbokJEksxHo9KMOgc6w1atHXM8K9DVC7FQnJ0i8iK3QooGgbnyKgMDygBWyYFZoqx4qS27KqLZJjA1D0jK6QJcYEQEiWv9PGkTsbqxQ8oT+ZtZB6AkdsJnQDnMoHXHLGKOgDYuCWmYhEERCI5gaamW0bnHdA3k2ltlIN+2qKRyCND0bhqSYCyTB3CAOc4WusBEIpkeBuPgJMAAX8Hs1NfqHRgAAAABJRU5ErkJggg==') repeat-x scroll left top #fff"
|
||||
});
|
||||
|
||||
this.$message.css({
|
||||
fontSize: '13px',
|
||||
lineHeight: '16px',
|
||||
textAlign: 'center',
|
||||
padding: '8px 10px 9px',
|
||||
width: 'auto',
|
||||
position: 'relative'
|
||||
});
|
||||
|
||||
this.$closeButton.css({
|
||||
position: 'absolute',
|
||||
top: 4, right: 4,
|
||||
width: 10, height: 10,
|
||||
background: "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+z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Eh6SGAR5K+k3zWWptKepCm0+kpyRoRGyRBcpPkDsn1iEBr7drdP2VJZyQXERGSPpiZAViTBACXKaV9kqd5uVzCzO5KKb/d/UZSDwD/eyxqree1VqSu6zKAF2Z2RPJJaw0rAkjOJT0m+SuT/AbgDcmnkmBmfwAsJL1dXQ8lWY6IGwB1ZbrOOb8zs8thGP4COFwx/mE8Ho9Go9ErMzvJOW/1fY/JZIJSypqZfXX3L13X9fcDAKJct1sx3OiuAAAAAElFTkSuQmCC)",
|
||||
display: 'none',
|
||||
cursor: 'pointer',
|
||||
});
|
||||
|
||||
this.$buttons.css({
|
||||
padding: 5,
|
||||
textAlign: 'right',
|
||||
borderTop: '1px solid #ccc',
|
||||
backgroundColor: '#fff',
|
||||
});
|
||||
|
||||
this.$buttons.find('button').css({
|
||||
marginLeft: 5
|
||||
});
|
||||
|
||||
this.$buttons.find('button:first').css({
|
||||
marginLeft: 0
|
||||
});
|
||||
|
||||
this.$bar.bind({
|
||||
mouseenter: function() { $(this).find('.noty_close').fadeIn(); },
|
||||
mouseleave: function() { $(this).find('.noty_close').fadeOut(); }
|
||||
});
|
||||
|
||||
switch (this.options.layout.name) {
|
||||
case 'top':
|
||||
this.$bar.css({
|
||||
borderRadius: '0px 0px 5px 5px',
|
||||
borderBottom: '2px solid #eee',
|
||||
borderLeft: '2px solid #eee',
|
||||
borderRight: '2px solid #eee',
|
||||
boxShadow: "0 2px 4px rgba(0, 0, 0, 0.1)"
|
||||
});
|
||||
break;
|
||||
case 'topCenter': case 'center': case 'bottomCenter': case 'inline':
|
||||
this.$bar.css({
|
||||
borderRadius: '5px',
|
||||
border: '1px solid #eee',
|
||||
boxShadow: "0 2px 4px rgba(0, 0, 0, 0.1)"
|
||||
});
|
||||
this.$message.css({fontSize: '13px', textAlign: 'center'});
|
||||
break;
|
||||
case 'topLeft': case 'topRight':
|
||||
case 'bottomLeft': case 'bottomRight':
|
||||
case 'centerLeft': case 'centerRight':
|
||||
this.$bar.css({
|
||||
borderRadius: '5px',
|
||||
border: '1px solid #eee',
|
||||
boxShadow: "0 2px 4px rgba(0, 0, 0, 0.1)"
|
||||
});
|
||||
this.$message.css({fontSize: '13px', textAlign: 'left'});
|
||||
break;
|
||||
case 'bottom':
|
||||
this.$bar.css({
|
||||
borderRadius: '5px 5px 0px 0px',
|
||||
borderTop: '2px solid #eee',
|
||||
borderLeft: '2px solid #eee',
|
||||
borderRight: '2px solid #eee',
|
||||
boxShadow: "0 -2px 4px rgba(0, 0, 0, 0.1)"
|
||||
});
|
||||
break;
|
||||
default:
|
||||
this.$bar.css({
|
||||
border: '2px solid #eee',
|
||||
boxShadow: "0 2px 4px rgba(0, 0, 0, 0.1)"
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
||||
switch (this.options.type) {
|
||||
case 'alert': case 'notification':
|
||||
this.$bar.css({backgroundColor: '#FFF', borderColor: '#CCC', color: '#444'}); break;
|
||||
case 'warning':
|
||||
this.$bar.css({backgroundColor: '#FFEAA8', borderColor: '#FFC237', color: '#826200'});
|
||||
this.$buttons.css({borderTop: '1px solid #FFC237'}); break;
|
||||
case 'error':
|
||||
this.$bar.css({backgroundColor: 'red', borderColor: 'darkred', color: '#FFF'});
|
||||
this.$message.css({fontWeight: 'bold'});
|
||||
this.$buttons.css({borderTop: '1px solid darkred'}); break;
|
||||
case 'information':
|
||||
this.$bar.css({backgroundColor: '#57B7E2', borderColor: '#0B90C4', color: '#FFF'});
|
||||
this.$buttons.css({borderTop: '1px solid #0B90C4'}); break;
|
||||
case 'success':
|
||||
this.$bar.css({backgroundColor: 'lightgreen', borderColor: '#50C24E', color: 'darkgreen'});
|
||||
this.$buttons.css({borderTop: '1px solid #50C24E'});break;
|
||||
default:
|
||||
this.$bar.css({backgroundColor: '#FFF', borderColor: '#CCC', color: '#444'}); break;
|
||||
}
|
||||
},
|
||||
callback: {
|
||||
onShow: function() { $.noty.themes.default.helpers.borderFix.apply(this); },
|
||||
onClose: function() { $.noty.themes.default.helpers.borderFix.apply(this); }
|
||||
}
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
@@ -38,4 +38,4 @@ function toggle(source) {
|
||||
checkboxes = document.getElementsByClassName('checkbox');
|
||||
for(var i in checkboxes)
|
||||
checkboxes[i].checked = source.checked;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,195 @@
|
||||
function getArtistInfo(name,imgElem,size,artistID) {
|
||||
var apikey = "690e1ed3bc00bc91804cd8f7fe5ed6d4";
|
||||
|
||||
// Get Data by Artist ID
|
||||
$.ajax({
|
||||
url: "http://ws.audioscrobbler.com/2.0/?method=artist.getInfo&mbid="+ artistID +"&api_key="+ apikey+"&format=json",
|
||||
dataType: "jsonp",
|
||||
cache: true,
|
||||
success: function(data){
|
||||
if ( data.artist !== undefined ) {
|
||||
var imageUrl = data.artist.image[size]['#text'];
|
||||
}
|
||||
if (data.error) {
|
||||
getArtistName();
|
||||
} else {
|
||||
if ( data.artist === undefined || imageUrl == "" || imageUrl == undefined ) {
|
||||
var imageLarge = "#";
|
||||
var imageUrl = "interfaces/brink/images/no-cover-artist.png";
|
||||
} else {
|
||||
var artist = data.artist.mbid;
|
||||
var artistBio = data.artist.bio.summary;
|
||||
var imageLarge = data.artist.image[4]['#text'];
|
||||
var imageUrl = data.artist.image[size]['#text'];
|
||||
}
|
||||
var artistBio = artistBio;
|
||||
var image = imgElem;
|
||||
var bio = $('.artist-bio-container .artist-bio');
|
||||
$(image).attr("src",imageUrl).removeAttr("width").removeAttr("height").hide().fadeIn();
|
||||
if ( bio.length > 0 ) $(bio).append(artistBio);
|
||||
$(image).wrap('<a href="artistPage?ArtistID='+ artistID +'"></a>');
|
||||
}
|
||||
}
|
||||
});
|
||||
// If not found get by Name
|
||||
function getArtistName() {
|
||||
$.ajax({
|
||||
url: "http://ws.audioscrobbler.com/2.0/?method=artist.getInfo&artist="+ name +"&api_key="+ apikey+"&format=json",
|
||||
dataType: "jsonp",
|
||||
success: function(data){
|
||||
if ( data.artist !== undefined ) {
|
||||
var imageUrl = data.artist.image[size]['#text'];
|
||||
}
|
||||
if ( data.artist === undefined || imageUrl == "" ) {
|
||||
var imageLarge = "#";
|
||||
var imageUrl = "interfaces/brink/images/no-cover-artist.png";
|
||||
} else {
|
||||
var artist = data.artist.name;
|
||||
var artistBio = data.artist.bio.summary;
|
||||
var imageLarge = data.artist.image[4]['#text'];
|
||||
var imageUrl = data.artist.image[size]['#text'];
|
||||
}
|
||||
var artistBio = artistBio;
|
||||
var image = imgElem;
|
||||
var bio = $('.artist-bio-container .artist-bio');
|
||||
$(image).attr("src",imageUrl).removeAttr("width").removeAttr("height").hide().fadeIn();
|
||||
if ( bio.length > 0 ) $(bio).append(artistBio);
|
||||
$(image).wrap('<a href="artistPage?ArtistID=' + artistID + '" rel="dialog" title="' + artist + '"></a>');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function getAlbumInfo(name, album, elem,size) {
|
||||
var apikey = "690e1ed3bc00bc91804cd8f7fe5ed6d4";
|
||||
var dimensions = getOriginalWidthOfImg(this);
|
||||
var cover = $(elem);
|
||||
|
||||
if ( dimensions <= 1) {
|
||||
// Get Data
|
||||
$.ajax({
|
||||
url: "http://ws.audioscrobbler.com/2.0/?method=album.getinfo&api_key=" + apikey + "&artist="+ name +"&album="+ album +"&format=json&callback=?",
|
||||
dataType: "jsonp",
|
||||
success: function(data){
|
||||
if ( data.artist !== undefined ) {
|
||||
var imageUrl = data.artist.image[size]['#text'];
|
||||
}
|
||||
if (data.album === undefined || imageUrl == "") {
|
||||
if ( elem.width() == 50 ) {
|
||||
var imageUrl = "interfaces/brink/images/no-cover-artist.png";
|
||||
} else {
|
||||
var imageUrl = "interfaces/brink/images/no-cover-art.png";
|
||||
}
|
||||
} else {
|
||||
var imageUrl = data.album.image[size]['#text'];
|
||||
var imageLarge = data.album.image[3]['#text'];
|
||||
}
|
||||
$(cover).error(function(){
|
||||
if ( elem.width() == 50 ) {
|
||||
var imageUrl = "interfaces/brink/images/no-cover-artist.png";
|
||||
} else {
|
||||
var imageUrl = "interfaces/brink/images/no-cover-art.png";
|
||||
}
|
||||
$(elem).css("background", "url("+ imageUrl+") center top no-repeat");
|
||||
});
|
||||
if ( imageUrl == "") {
|
||||
if ( elem.width() == 50 ) {
|
||||
var imageUrl = "interfaces/brink/images/no-cover-artist.png";
|
||||
} else {
|
||||
var imageUrl = "interfaces/brink/images/no-cover-art.png";
|
||||
}
|
||||
$(elem).css("background", "url("+ imageUrl+")");
|
||||
}
|
||||
$(elem).css("background", "url("+ imageUrl+") center top no-repeat");
|
||||
$(elem).wrap('<a href="'+ imageLarge +'" rel="dialog" title="' + name + '"></a>');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function getOriginalWidthOfImg(img_element) {
|
||||
var t = new Image();
|
||||
t.src = (img_element.getAttribute ? img_element.getAttribute("src") : false) || img_element.src;
|
||||
return t.width;
|
||||
}
|
||||
|
||||
function replaceEmptyAlbum(elem,name,album) {
|
||||
var album = $(elem);
|
||||
var artist = name;
|
||||
var albumname = album;
|
||||
var apikey = "690e1ed3bc00bc91804cd8f7fe5ed6d4";
|
||||
var dimensions = getOriginalWidthOfImg(this);
|
||||
var cover = $(this);
|
||||
var url;
|
||||
if ( dimensions <= 1) {
|
||||
url = "http://ws.audioscrobbler.com/2.0/?method=album.getinfo&api_key=" + apikey + "&artist="+ artist +"&album="+ albumname +"&format=json&callback=?";
|
||||
var imageUrl;
|
||||
$.getJSON(url, function(data, response) {
|
||||
if (data.album === undefined) {
|
||||
imageUrl = "interfaces/brink/images/no-cover-art.png";
|
||||
} else {
|
||||
imageUrl = data.album.image[3]['#text'];
|
||||
imageLarge = data.album.image[4]['#text'];
|
||||
// If Last.fm don't provide a cover then use standard
|
||||
}
|
||||
$(cover).error(function(){
|
||||
imageUrl = "interfaces/brink/images/no-cover-art.png";
|
||||
$(this).hide().attr("src", imageUrl).show();
|
||||
})
|
||||
if ( imageUrl == "") {
|
||||
imageUrl = "interfaces/brink/images/no-cover-art.png";
|
||||
$(this).hide().attr("src", imageUrl).show();
|
||||
}
|
||||
$(cover).hide().attr("src", imageUrl).show();
|
||||
$(cover).wrap('<a href="'+ imageLarge +'" rel="dialog" title="' + artist + " - " + albumname + '"></a>');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//Mark current active link
|
||||
$(document).ready(function() {
|
||||
enit();
|
||||
$("#nav li a").each(function () {
|
||||
var hreflink = $(this).attr("href");
|
||||
var locationHref = location.href.split("/").pop();
|
||||
if (hreflink == locationHref) {
|
||||
$(this).parent().addClass("selected");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Loader
|
||||
var loaderSymbols = ['0', '1', '2', '3', '4', '5', '6', '7'],
|
||||
loaderRate = 100,
|
||||
loaderIndex = 0,
|
||||
loader = function() {
|
||||
$('.loader').text( loaderSymbols[loaderIndex] );
|
||||
loaderIndex = loaderIndex < loaderSymbols.length - 1 ? loaderIndex + 1 : 0;
|
||||
setTimeout(loader, loaderRate);
|
||||
};
|
||||
loader();
|
||||
|
||||
function enit()
|
||||
{
|
||||
var mainWindow = $("#main");
|
||||
var totalHeight = $(window).height() - ($("#header").outerHeight() + $("#footer").outerHeight()) - 3;
|
||||
$(mainWindow).height(totalHeight);
|
||||
$(mainWindow).jScrollPane({ showArrows: true, animateScroll: true, hijackInternalLinks: true });
|
||||
}
|
||||
$(document).ready(function(){
|
||||
$("ul#nav-view li").toggle(function() {
|
||||
$(this).children("span").removeClass("Icon");
|
||||
$(this).children("span").addClass("List");
|
||||
$("#gridView").hide();
|
||||
$("#listView").show();
|
||||
enit();
|
||||
}, function() {
|
||||
$(this).children("span").removeClass("List");
|
||||
$(this).children("span").addClass("Icon");
|
||||
$("#gridView").show();
|
||||
$("#listView").hide();
|
||||
enit();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user