Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e3da96e3a1 | ||
|
|
0e258e80ec | ||
|
|
7191c17e26 | ||
|
|
d27d96fc24 | ||
|
|
d5ddfb7bd1 | ||
|
|
64dda76979 | ||
|
|
8ba7204c0d | ||
|
|
6a2024b997 | ||
|
|
119d4b2f44 | ||
|
|
dd5adda0bd | ||
|
|
9e61e5418d | ||
|
|
67dda7928d | ||
|
|
f1e11bcf21 | ||
|
|
4bc2d70f4c | ||
|
|
ac9bb74367 | ||
|
|
b99c2ae69c | ||
|
|
7b0164fc63 | ||
|
|
e621c2643d | ||
|
|
a4d7da2ee2 | ||
|
|
a721573076 |
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2022 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.
|
||||
@@ -5,28 +5,10 @@ Notify.js
|
||||
|
||||
See demos and full documentation at:
|
||||
|
||||
## http://notifyjs.com/
|
||||
## https://notifyjs.jpillora.com/
|
||||
|
||||
SYNOPSIS
|
||||
====
|
||||
|
||||
Global Notifications
|
||||
----
|
||||
|
||||
$.notify("Hello World");
|
||||
|
||||
Element Notifications
|
||||
----
|
||||
|
||||
$(".elem-demo").notify("Hello World");
|
||||
|
||||
// where x is one letter: [t]op [m]iddle [b]ottom
|
||||
// where y is one letter: [l]eft [c]enter [r]ight
|
||||
$(".elem-demo").notify("Hello World", {position: "x y"});
|
||||
|
||||
COPYRIGHT
|
||||
====
|
||||
|
||||
Notify.js is released under the [MIT License](https://opensource.org/licenses/MIT).
|
||||
|
||||
Copyright © Jaime Pillora <dev@jpillora.com>
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "notifyjs",
|
||||
"version": "0.3.4",
|
||||
"version": "0.4.1",
|
||||
"homepage": "http://notifyjs.com/",
|
||||
"authors": [
|
||||
"Jaime Pillora <dev@jpillora.com>"
|
||||
|
||||
Vendored
+20
-11
@@ -91,6 +91,15 @@
|
||||
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";
|
||||
@@ -337,7 +346,7 @@
|
||||
var align = positions[pAlign];
|
||||
var key = pMain + "|" + pAlign;
|
||||
var anchor = globalAnchors[key];
|
||||
if (!anchor) {
|
||||
if (!anchor || !document.body.contains(anchor[0])) {
|
||||
anchor = globalAnchors[key] = createElem("div");
|
||||
var css = {};
|
||||
css[main] = 0;
|
||||
@@ -390,7 +399,7 @@
|
||||
} else {
|
||||
arrowSize = this.options.arrowSize;
|
||||
arrowCss = $.extend({}, css);
|
||||
arrowColor = this.userContainer.css("border-color") || this.userContainer.css("background-color") || "white";
|
||||
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];
|
||||
@@ -522,7 +531,8 @@
|
||||
};
|
||||
|
||||
Notification.prototype.destroy = function() {
|
||||
return this.wrapper.remove();
|
||||
this.wrapper.data(pluginClassName, null);
|
||||
this.wrapper.remove();
|
||||
};
|
||||
|
||||
$[pluginName] = function(elem, data, options) {
|
||||
@@ -538,13 +548,11 @@
|
||||
|
||||
$.fn[pluginName] = function(data, options) {
|
||||
$(this).each(function() {
|
||||
var inst;
|
||||
inst = getAnchorElement($(this)).data(pluginClassName);
|
||||
if (inst) {
|
||||
return inst.run(data, options);
|
||||
} else {
|
||||
return new Notification($(this), data, options);
|
||||
var prev = getAnchorElement($(this)).data(pluginClassName);
|
||||
if (prev) {
|
||||
prev.destroy();
|
||||
}
|
||||
var curr = new Notification($(this), data, options);
|
||||
});
|
||||
return this;
|
||||
};
|
||||
@@ -552,6 +560,7 @@
|
||||
$.extend($[pluginName], {
|
||||
defaults: defaults,
|
||||
addStyle: addStyle,
|
||||
removeStyle: removeStyle,
|
||||
pluginOptions: pluginOptions,
|
||||
getStyle: getStyle,
|
||||
insertCSS: insertCSS
|
||||
@@ -603,9 +612,9 @@
|
||||
$(function() {
|
||||
insertCSS(coreStyle.css).attr("id", "core-notify");
|
||||
$(document).on("click", "." + pluginClassName + "-hidable", function(e) {
|
||||
return $(this).trigger("notify-hide");
|
||||
$(this).trigger("notify-hide");
|
||||
});
|
||||
return $(document).on("notify-hide", "." + pluginClassName + "-wrapper", function(e) {
|
||||
$(document).on("notify-hide", "." + pluginClassName + "-wrapper", function(e) {
|
||||
var elem = $(this).data(pluginClassName);
|
||||
if(elem) {
|
||||
elem.show(false);
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "notify",
|
||||
"version": "0.3.4",
|
||||
"version": "0.4.1",
|
||||
"title": "notify",
|
||||
"description": "A robust, customizable notification library",
|
||||
"bugs": "https://github.com/jpillora/notifyjs/issues",
|
||||
|
||||
+4
-4
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"title": "Notify.js",
|
||||
"name": "notify",
|
||||
"version": "0.4.0",
|
||||
"name": "notifyjs-browser",
|
||||
"version": "0.4.2",
|
||||
"author": {
|
||||
"name": "Jaime Pillora"
|
||||
},
|
||||
@@ -19,8 +19,8 @@
|
||||
"test": "npm run lint",
|
||||
"lint": "jshint ./dist/*.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"jquery": "^2.1.4"
|
||||
"peerDependencies": {
|
||||
"jquery": ">=1.11.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"jshint": "^2.8.0"
|
||||
|
||||
Reference in New Issue
Block a user