assets/javascripts/semantic_ui/definitions/modules/nag.js in less-rails-semantic_ui-2.1.8.2 vs assets/javascripts/semantic_ui/definitions/modules/nag.js in less-rails-semantic_ui-2.2.1.0
- old
+ new
@@ -1,20 +1,26 @@
/*!
* # Semantic UI - Nag
* http://github.com/semantic-org/semantic-ui/
*
*
- * Copyright 2015 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
;(function ($, window, document, undefined) {
"use strict";
+window = (typeof window != 'undefined' && window.Math == Math)
+ ? window
+ : (typeof self != 'undefined' && self.Math == Math)
+ ? self
+ : Function('return this')()
+;
+
$.fn.nag = function(parameters) {
var
$allModules = $(this),
moduleSelector = $allModules.selector || '',
@@ -253,11 +259,16 @@
module.debug('Changing setting', name, value);
if( $.isPlainObject(name) ) {
$.extend(true, settings, name);
}
else if(value !== undefined) {
- settings[name] = value;
+ if($.isPlainObject(settings[name])) {
+ $.extend(true, settings[name], value);
+ }
+ else {
+ settings[name] = value;
+ }
}
else {
return settings[name];
}
},
@@ -271,34 +282,36 @@
else {
return module[name];
}
},
debug: function() {
- if(settings.debug) {
+ if(!settings.silent && settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.debug.apply(console, arguments);
}
}
},
verbose: function() {
- if(settings.verbose && settings.debug) {
+ if(!settings.silent && settings.verbose && settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.verbose.apply(console, arguments);
}
}
},
error: function() {
- module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
- module.error.apply(console, arguments);
+ if(!settings.silent) {
+ module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
+ module.error.apply(console, arguments);
+ }
},
performance: {
log: function(message) {
var
currentTime,
@@ -428,17 +441,18 @@
$.fn.nag.settings = {
name : 'Nag',
+ silent : false,
debug : false,
verbose : false,
performance : true,
namespace : 'Nag',
- // allows cookie to be overriden
+ // allows cookie to be overridden
persist : false,
// set to zero to require manually dismissal, otherwise hides on its own
displayTime : 0,
@@ -480,7 +494,14 @@
easing : 'easeOutQuad',
onHide: function() {}
};
+
+// Adds easing
+$.extend( $.easing, {
+ easeOutQuad: function (x, t, b, c, d) {
+ return -c *(t/=d)*(t-2) + b;
+ }
+});
})( jQuery, window, document );