minor fixes, doc updates
This commit is contained in:
@@ -3,8 +3,29 @@ Notify.js
|
||||
|
||||
> A simple, versatile notification library
|
||||
|
||||
|
||||
|
||||
See demos and full documentation at:
|
||||
|
||||
## http://notifyjs.com/
|
||||
|
||||
#### MIT License
|
||||
|
||||
Copyright © 2013 Jaime Pillora <dev@jpillora.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
'Software'), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
Vendored
+8
-10
@@ -1,4 +1,4 @@
|
||||
/** Notify.js - v0.0.1 - 2013/06/11
|
||||
/** Notify.js - v0.0.1 - 2013/06/12
|
||||
* http://notifyjs.com/
|
||||
* Copyright (c) 2013 Jaime Pillora - MIT
|
||||
*/
|
||||
@@ -109,6 +109,7 @@ addStyle = function(name, def) {
|
||||
insertCSS = function(cssText) {
|
||||
var elem;
|
||||
elem = createElem("style");
|
||||
elem.attr('type', 'text/css');
|
||||
$("head").append(elem);
|
||||
try {
|
||||
elem.html(cssText);
|
||||
@@ -119,6 +120,7 @@ insertCSS = function(cssText) {
|
||||
};
|
||||
|
||||
pluginOptions = {
|
||||
clickToHide: true,
|
||||
autoHide: true,
|
||||
autoHideDelay: 5000,
|
||||
arrowShow: true,
|
||||
@@ -477,21 +479,17 @@ $.extend($[pluginName], {
|
||||
defaults: defaults,
|
||||
addStyle: addStyle,
|
||||
pluginOptions: pluginOptions,
|
||||
getStyle: getStyle
|
||||
getStyle: getStyle,
|
||||
insertCSS: insertCSS
|
||||
});
|
||||
|
||||
$(function() {
|
||||
insertCSS(coreStyle.css).attr('data-notify-style', 'core');
|
||||
return $(document).on('click', "." + pluginClassName + "-wrapper", function() {
|
||||
insertCSS(coreStyle.css).attr('id', 'core-notify');
|
||||
return $(document).on('click notify-hide', "." + pluginClassName + "-wrapper", function(e) {
|
||||
var inst;
|
||||
inst = $(this).data(pluginClassName);
|
||||
if (!inst) {
|
||||
return;
|
||||
}
|
||||
if (inst.elem) {
|
||||
if (inst && (inst.options.clickToHide || e.type === 'notify-hide')) {
|
||||
return inst.show(false);
|
||||
} else {
|
||||
return inst.destroy();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Vendored
+2
-2
File diff suppressed because one or more lines are too long
Vendored
+8
-10
@@ -1,4 +1,4 @@
|
||||
/** Notify.js - v0.0.1 - 2013/06/11
|
||||
/** Notify.js - v0.0.1 - 2013/06/12
|
||||
* http://notifyjs.com/
|
||||
* Copyright (c) 2013 Jaime Pillora - MIT
|
||||
*/
|
||||
@@ -109,6 +109,7 @@ addStyle = function(name, def) {
|
||||
insertCSS = function(cssText) {
|
||||
var elem;
|
||||
elem = createElem("style");
|
||||
elem.attr('type', 'text/css');
|
||||
$("head").append(elem);
|
||||
try {
|
||||
elem.html(cssText);
|
||||
@@ -119,6 +120,7 @@ insertCSS = function(cssText) {
|
||||
};
|
||||
|
||||
pluginOptions = {
|
||||
clickToHide: true,
|
||||
autoHide: true,
|
||||
autoHideDelay: 5000,
|
||||
arrowShow: true,
|
||||
@@ -477,21 +479,17 @@ $.extend($[pluginName], {
|
||||
defaults: defaults,
|
||||
addStyle: addStyle,
|
||||
pluginOptions: pluginOptions,
|
||||
getStyle: getStyle
|
||||
getStyle: getStyle,
|
||||
insertCSS: insertCSS
|
||||
});
|
||||
|
||||
$(function() {
|
||||
insertCSS(coreStyle.css).attr('data-notify-style', 'core');
|
||||
return $(document).on('click', "." + pluginClassName + "-wrapper", function() {
|
||||
insertCSS(coreStyle.css).attr('id', 'core-notify');
|
||||
return $(document).on('click notify-hide', "." + pluginClassName + "-wrapper", function(e) {
|
||||
var inst;
|
||||
inst = $(this).data(pluginClassName);
|
||||
if (!inst) {
|
||||
return;
|
||||
}
|
||||
if (inst.elem) {
|
||||
if (inst && (inst.options.clickToHide || e.type === 'notify-hide')) {
|
||||
return inst.show(false);
|
||||
} else {
|
||||
return inst.destroy();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Vendored
+2
-2
File diff suppressed because one or more lines are too long
+6
-7
@@ -144,6 +144,7 @@ addStyle = (name, def) ->
|
||||
insertCSS = (cssText) ->
|
||||
|
||||
elem = createElem("style")
|
||||
elem.attr 'type', 'text/css'
|
||||
$("head").append elem
|
||||
try
|
||||
elem.html cssText
|
||||
@@ -158,6 +159,7 @@ insertCSS = (cssText) ->
|
||||
|
||||
#overridable options
|
||||
pluginOptions =
|
||||
clickToHide: true
|
||||
autoHide: true
|
||||
autoHideDelay: 5000
|
||||
arrowShow: true
|
||||
@@ -519,19 +521,16 @@ $.fn[pluginName] = (data, options) ->
|
||||
@
|
||||
|
||||
#extra methods
|
||||
$.extend $[pluginName], { defaults, addStyle, pluginOptions, getStyle }
|
||||
$.extend $[pluginName], { defaults, addStyle, pluginOptions, getStyle, insertCSS }
|
||||
|
||||
#when ready
|
||||
$ ->
|
||||
#insert default style
|
||||
insertCSS(coreStyle.css).attr('data-notify-style', 'core')
|
||||
insertCSS(coreStyle.css).attr('id', 'core-notify')
|
||||
|
||||
#watch all notifications clicks
|
||||
$(document).on 'click', ".#{pluginClassName}-wrapper", ->
|
||||
$(document).on 'click notify-hide', ".#{pluginClassName}-wrapper", (e) ->
|
||||
inst = $(@).data pluginClassName
|
||||
return unless inst
|
||||
if inst.elem
|
||||
if inst and (inst.options.clickToHide or e.type is 'notify-hide')
|
||||
inst.show false
|
||||
else
|
||||
inst.destroy()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user