readded UMD stuff, and package.json tests
This commit is contained in:
+2
-5
@@ -1,7 +1,4 @@
|
|||||||
2015-10-20 v0.3.3
|
2015-10-20 v0.4
|
||||||
|
|
||||||
@EvanCarroll - Updated to remove Grunt, and coffeescript stuff.
|
|
||||||
|
|
||||||
2015-11-01 v0.3.4
|
|
||||||
|
|
||||||
|
@EvanCarroll - Updated to remove Grunt, and coffeescript stuff, changed to use UMD.
|
||||||
@jpillora - Remove deprecated grunt file, there is now a single `notify.js` file
|
@jpillora - Remove deprecated grunt file, there is now a single `notify.js` file
|
||||||
|
|||||||
Vendored
+50
-30
@@ -1,28 +1,50 @@
|
|||||||
/* Notify.js - http://notifyjs.com/ Copyright (c) 2015 MIT */
|
// UMD start
|
||||||
(function(window, document, $, undefined) {
|
// https://github.com/umdjs/umd/blob/master/jqueryPluginCommonjs.js
|
||||||
"use strict";
|
(function (factory) {
|
||||||
//IE8 indexOf polyfill
|
if (typeof define === 'function' && define.amd) {
|
||||||
var indexOf = [].indexOf || function(item) {
|
// AMD. Register as an anonymous module.
|
||||||
for (var i = 0, l = this.length; i < l; i++) {
|
define(['jquery'], factory);
|
||||||
if (i in this && this[i] === item) {
|
} else if (typeof module === 'object' && module.exports) {
|
||||||
return i;
|
// 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 ( window ) {
|
||||||
|
jQuery = require('jquery');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
jQuery = require('jquery')(root);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return -1;
|
factory(jQuery);
|
||||||
|
return jQuery;
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
// Browser globals
|
||||||
|
factory(jQuery);
|
||||||
|
}
|
||||||
|
}(function ($) {
|
||||||
|
var Notification, addStyle, blankFieldName, coreStyle, createElem, defaults, encode, find, findFields, getAnchorElement, getStyle, globalAnchors, hAligns, incr, inherit, insertCSS, mainPositions, opposites, parsePosition, pluginClassName, pluginName, pluginOptions, positions, realign, stylePrefixes, styles, vAligns,
|
||||||
|
__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; };
|
||||||
|
|
||||||
|
pluginName = 'notify';
|
||||||
|
|
||||||
|
pluginClassName = pluginName + 'js';
|
||||||
|
|
||||||
|
blankFieldName = pluginName + "!blank";
|
||||||
|
|
||||||
|
positions = {
|
||||||
|
t: 'top',
|
||||||
|
m: 'middle',
|
||||||
|
b: 'bottom',
|
||||||
|
l: 'left',
|
||||||
|
c: 'center',
|
||||||
|
r: 'right'
|
||||||
};
|
};
|
||||||
|
|
||||||
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 hAligns = ["l", "c", "r"];
|
||||||
var vAligns = ["t", "m", "b"];
|
var vAligns = ["t", "m", "b"];
|
||||||
var mainPositions = ["t", "b", "l", "r"];
|
var mainPositions = ["t", "b", "l", "r"];
|
||||||
@@ -571,16 +593,14 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
insertCSS(coreStyle.css).attr("id", "core-notify");
|
insertCSS(coreStyle.css).attr('id', 'core-notify');
|
||||||
$(document).on("click", "." + pluginClassName + "-hidable", function(e) {
|
$(document).on('click', "." + pluginClassName + "-hidable", function(e) {
|
||||||
return $(this).trigger("notify-hide");
|
return $(this).trigger('notify-hide');
|
||||||
});
|
});
|
||||||
return $(document).on("notify-hide", "." + pluginClassName + "-wrapper", function(e) {
|
return $(document).on('notify-hide', "." + pluginClassName + "-wrapper", function(e) {
|
||||||
var elem = $(this).data(pluginClassName);
|
var _ref;
|
||||||
if(elem) {
|
return (_ref = $(this).data(pluginClassName)) != null ? _ref.show(false) : void 0;
|
||||||
elem.show(false);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
}).call(this, window, document, jQuery);
|
}));
|
||||||
|
|||||||
+9
-2
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"title": "Notify.js",
|
"title": "Notify.js",
|
||||||
"name": "notify",
|
"name": "notify",
|
||||||
"version": "0.3.4",
|
"version": "0.4.0",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Jaime Pillora"
|
"name": "Jaime Pillora"
|
||||||
},
|
},
|
||||||
@@ -14,5 +14,12 @@
|
|||||||
],
|
],
|
||||||
"homepage": "http://notifyjs.com/",
|
"homepage": "http://notifyjs.com/",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"main": "dist/notify.js"
|
"main": "dist/notify.js",
|
||||||
|
"scripts": {
|
||||||
|
"test": "npm run lint",
|
||||||
|
"lint": "jshint ./dist/*.js"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"jquery": "^2.1.4"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user