upgraded docs, fixed cursor show when clickToHide:false, bumped to 0.3.2

This commit is contained in:
Jaime Pillora
2014-06-29 01:02:42 +10:00
parent d5a49073ec
commit 4534e2caa6
16 changed files with 296 additions and 127 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "notifyjs",
"version": "0.3.1",
"version": "0.3.2",
"homepage": "http://notifyjs.com/",
"authors": [
"Jaime Pillora <dev@jpillora.com>"
+11 -8
View File
@@ -1,4 +1,4 @@
/** Notify.js - v0.3.1 - 2014/02/06
/** Notify.js - v0.3.1 - 2014/06/29
* http://notifyjs.com/
* Copyright (c) 2014 Jaime Pillora - MIT
*/
@@ -56,7 +56,7 @@ styles = {};
coreStyle = {
name: 'core',
html: "<div class=\"" + pluginClassName + "-wrapper\">\n <div class=\"" + pluginClassName + "-arrow\"></div>\n <div class=\"" + pluginClassName + "-container\"></div>\n</div>",
css: "." + pluginClassName + "-corner {\n position: fixed;\n margin: 5px;\n z-index: 1050;\n}\n\n." + pluginClassName + "-corner ." + pluginClassName + "-wrapper,\n." + pluginClassName + "-corner ." + pluginClassName + "-container {\n position: relative;\n display: block;\n height: inherit;\n width: inherit;\n margin: 3px;\n}\n\n." + pluginClassName + "-wrapper {\n z-index: 1;\n position: absolute;\n display: inline-block;\n height: 0;\n width: 0;\n}\n\n." + pluginClassName + "-container {\n display: none;\n z-index: 1;\n position: absolute;\n cursor: pointer;\n}\n\n[data-notify-text],[data-notify-html] {\n position: relative;\n}\n\n." + pluginClassName + "-arrow {\n position: absolute;\n z-index: 2;\n width: 0;\n height: 0;\n}"
css: "." + pluginClassName + "-corner {\n position: fixed;\n margin: 5px;\n z-index: 1050;\n}\n\n." + pluginClassName + "-corner ." + pluginClassName + "-wrapper,\n." + pluginClassName + "-corner ." + pluginClassName + "-container {\n position: relative;\n display: block;\n height: inherit;\n width: inherit;\n margin: 3px;\n}\n\n." + pluginClassName + "-wrapper {\n z-index: 1;\n position: absolute;\n display: inline-block;\n height: 0;\n width: 0;\n}\n\n." + pluginClassName + "-container {\n display: none;\n z-index: 1;\n position: absolute;\n}\n\n." + pluginClassName + "-hidable {\n cursor: pointer;\n}\n\n[data-notify-text],[data-notify-html] {\n position: relative;\n}\n\n." + pluginClassName + "-arrow {\n position: absolute;\n z-index: 2;\n width: 0;\n height: 0;\n}"
};
stylePrefixes = {
@@ -249,6 +249,9 @@ Notification = (function() {
this.options = inherit(pluginOptions, $.isPlainObject(options) ? options : {});
this.loadHTML();
this.wrapper = $(coreStyle.html);
if (this.options.clickToHide) {
this.wrapper.addClass("" + pluginClassName + "-hidable");
}
this.wrapper.data(pluginClassName, this);
this.arrow = this.wrapper.find("." + pluginClassName + "-arrow");
this.container = this.wrapper.find("." + pluginClassName + "-container");
@@ -536,12 +539,12 @@ $.extend($[pluginName], {
$(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 && (inst.options.clickToHide || e.type === 'notify-hide')) {
return inst.show(false);
}
$(document).on('click', "." + pluginClassName + "-hidable", function(e) {
return $(this).trigger('notify-hide');
});
return $(document).on('notify-hide', "." + pluginClassName + "-wrapper", function(e) {
var _ref;
return (_ref = $(this).data(pluginClassName)) != null ? _ref.show(false) : void 0;
});
});
+2 -2
View File
File diff suppressed because one or more lines are too long
+11 -8
View File
@@ -1,4 +1,4 @@
/** Notify.js - v0.3.1 - 2014/02/06
/** Notify.js - v0.3.1 - 2014/06/29
* http://notifyjs.com/
* Copyright (c) 2014 Jaime Pillora - MIT
*/
@@ -56,7 +56,7 @@ styles = {};
coreStyle = {
name: 'core',
html: "<div class=\"" + pluginClassName + "-wrapper\">\n <div class=\"" + pluginClassName + "-arrow\"></div>\n <div class=\"" + pluginClassName + "-container\"></div>\n</div>",
css: "." + pluginClassName + "-corner {\n position: fixed;\n margin: 5px;\n z-index: 1050;\n}\n\n." + pluginClassName + "-corner ." + pluginClassName + "-wrapper,\n." + pluginClassName + "-corner ." + pluginClassName + "-container {\n position: relative;\n display: block;\n height: inherit;\n width: inherit;\n margin: 3px;\n}\n\n." + pluginClassName + "-wrapper {\n z-index: 1;\n position: absolute;\n display: inline-block;\n height: 0;\n width: 0;\n}\n\n." + pluginClassName + "-container {\n display: none;\n z-index: 1;\n position: absolute;\n cursor: pointer;\n}\n\n[data-notify-text],[data-notify-html] {\n position: relative;\n}\n\n." + pluginClassName + "-arrow {\n position: absolute;\n z-index: 2;\n width: 0;\n height: 0;\n}"
css: "." + pluginClassName + "-corner {\n position: fixed;\n margin: 5px;\n z-index: 1050;\n}\n\n." + pluginClassName + "-corner ." + pluginClassName + "-wrapper,\n." + pluginClassName + "-corner ." + pluginClassName + "-container {\n position: relative;\n display: block;\n height: inherit;\n width: inherit;\n margin: 3px;\n}\n\n." + pluginClassName + "-wrapper {\n z-index: 1;\n position: absolute;\n display: inline-block;\n height: 0;\n width: 0;\n}\n\n." + pluginClassName + "-container {\n display: none;\n z-index: 1;\n position: absolute;\n}\n\n." + pluginClassName + "-hidable {\n cursor: pointer;\n}\n\n[data-notify-text],[data-notify-html] {\n position: relative;\n}\n\n." + pluginClassName + "-arrow {\n position: absolute;\n z-index: 2;\n width: 0;\n height: 0;\n}"
};
stylePrefixes = {
@@ -249,6 +249,9 @@ Notification = (function() {
this.options = inherit(pluginOptions, $.isPlainObject(options) ? options : {});
this.loadHTML();
this.wrapper = $(coreStyle.html);
if (this.options.clickToHide) {
this.wrapper.addClass("" + pluginClassName + "-hidable");
}
this.wrapper.data(pluginClassName, this);
this.arrow = this.wrapper.find("." + pluginClassName + "-arrow");
this.container = this.wrapper.find("." + pluginClassName + "-container");
@@ -536,12 +539,12 @@ $.extend($[pluginName], {
$(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 && (inst.options.clickToHide || e.type === 'notify-hide')) {
return inst.show(false);
}
$(document).on('click', "." + pluginClassName + "-hidable", function(e) {
return $(this).trigger('notify-hide');
});
return $(document).on('notify-hide', "." + pluginClassName + "-wrapper", function(e) {
var _ref;
return (_ref = $(this).data(pluginClassName)) != null ? _ref.show(false) : void 0;
});
});
+2 -2
View File
File diff suppressed because one or more lines are too long
+3 -2
View File
@@ -1,7 +1,8 @@
{
"source": "~/.grunt-sources/web",
"repo": "https://github.com/jpillora/grunt-source-web",
"repo": "https://github.com/jpillora/grunt-source-web.git",
"output": {
"html": "../index.html"
}
},
"angular":true
}
+151 -58
View File
@@ -569,49 +569,91 @@
}
/* line 190 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 1 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/stylus/lib/functions/index.styl */
/* line 293 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/stylus/lib/functions/index.styl */
/* line 14 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib/index.styl */
/* line 14 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib/index.styl */
/* line 2 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib/border.styl */
/* line 2 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib/clearfix.styl */
/* line 12 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib/border.styl */
/* line 3 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib/clearfix.styl */
/* line 31 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib/clearfix.styl */
/* line 2 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib/color-image.styl */
/* line 6 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib/color-image.styl */
/* line 6 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib/flex.styl */
/* line 154 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib/gradients.styl */
/* line 197 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib/flex.styl */
/* line 154 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib/config.styl */
/* line 94 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib/gradients.styl */
/* line 94 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib/gradients.styl */
/* line 94 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib/config.styl */
/* line 12 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib/config.styl */
/* line 2 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib/iconic.styl */
/* line 9 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib/iconic.styl */
/* line 2 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib/image.styl */
/* line 25 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib/overflow.styl */
/* line 27 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib/image.styl */
/* line 3 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib/positions.styl */
/* line 27 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib/overflow.styl */
/* line 3 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib/reset.styl */
/* line 23 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib/overflow.styl */
/* line 9 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib/positions.styl */
/* line 73 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib/positions.styl */
/* line 15 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib/reset.styl */
/* line 79 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib/reset.styl */
/* line 5 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib/text/index.styl */
/* line 5 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib/text/index.styl */
/* line 2 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib/text/aliases.styl */
/* line 14 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib/text/aliases.styl */
/* line 2 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib/text/ellipsis.styl */
/* line 11 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib/text/ellipsis.styl */
/* line 11 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib/text/hide-text.styl */
/* line 9 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib/text/hide-text.styl */
/* line 9 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib/text/replace-text.styl */
/* line 557 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib/vendor.styl */
/* line 10 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib/text/replace-text.styl */
/* line 557 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib/config.styl */
/* line undefined : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib/vendor.styl */
/* line 576 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib/vendor.styl */
/* line 576 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib/config.styl */
/* line 12 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib/config.styl */
/* line 12 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib/size.styl */
/* line 29 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/vendor/base.css */
/* line 33 : /Users/jpillora/.grunt-sources/web/node_modules/grunt-contrib-stylus/node_modules/nib/lib/nib/size.styl */
/*
* Skeleton V1.2
* Copyright 2011, Dave Gamache
@@ -878,7 +920,7 @@
.half-bottom { margin-bottom: 10px !important; }
.add-bottom { margin-bottom: 20px !important; }
/* line 29 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/vendor/skeleton.css */
/* line 33 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/vendor/base.css */
/*
* Skeleton V1.2
* Copyright 2011, Dave Gamache
@@ -1122,7 +1164,7 @@
height: 0;
}
/* line 29 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/vendor/layout.css */
/* line 33 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/vendor/skeleton.css */
/*
* Skeleton V1.2
* Copyright 2011, Dave Gamache
@@ -1182,78 +1224,84 @@
font-style: normal; }
*/
/* line 29 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/vendor/prettify.css */
/* line 33 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/vendor/layout.css */
.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}
/* line 12 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 14 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
h3 {
text-decoration: underline;
}
/* line 14 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 16 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
b {
font-weight: bold;
}
/* line 16 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 18 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
i {
font-style: italic !important;
}
/* line 18 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 21 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
input:focus,
button {
outline: none;
}
/* line 23 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
input[type="radio"],
label[for] {
cursor: pointer;
}
/* line 20 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 25 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
.main {
position: relative;
margin-top: 100px;
margin-bottom: 100px;
}
/* line 24 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 29 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
.center {
text-align: center;
}
/* line 26 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 31 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
.left {
text-align: left;
}
/* line 28 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 33 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
.right {
text-align: right;
}
/* line 30 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 35 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
.italic {
font-style: italic;
}
/* line 32 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 37 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
.bold {
font-weight: bold;
}
/* line 34 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 39 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
.inline {
display: inline;
}
/* line 36 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 41 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
.sixteen.columns {
margin-bottom: 50px;
}
/* line 38 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 43 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
.section {
margin-top: 20px;
}
/* line 42 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 47 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
a,
a:visited {
color: #080;
@@ -1261,41 +1309,41 @@ a:visited {
text-decoration: none;
}
/* line 46 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 51 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 47 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 52 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
a:hover,
a:focus {
color: #040;
}
/* line 49 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 54 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
p a,
p a:visited {
line-height: inherit;
}
/* line 53 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 58 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
.indent1 {
margin-left: 10px;
}
/* line 55 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 60 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
.indent2 {
margin-left: 20px;
}
/* line 59 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 64 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
code {
color: #080;
}
/* line 61 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 66 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
code.black {
color: #181818;
}
/* line 64 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 83 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
pre.prettyprint {
word-wrap: break-word;
font-family: 'Droid Sans Mono', Courier;
@@ -1309,45 +1357,45 @@ pre.prettyprint {
margin-bottom: 10px;
}
/* line 71 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 90 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
pre.prettyprint.runnable {
border-left: #080 1px solid;
cursor: pointer;
}
/* line 74 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 93 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
pre.prettyprint:hover {
background: whiteSmoke;
}
/* line 76 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 95 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
pre.prettyprint.running {
background: #d3f3d3;
}
/* line 80 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 98 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
.pos-chooser-dial {
cursor: pointer;
}
/* line 83 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 100 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
.box.pos-chooser-demo {
color: #000;
padding: 20px;
}
/* line 88 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 104 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
.entry {
margin-left: 10px;
padding: 10px;
}
/* line 91 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 107 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
.entry:hover {
background: whiteSmoke;
}
/* line 95 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 110 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
.demo-mouse {
position: relative;
left: 250px;
@@ -1359,13 +1407,13 @@ pre.prettyprint.running {
transition: all 1s ease-out;
}
/* line 98 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 113 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
.demo-mouse.over {
top: -30px;
left: 125px;
}
/* line 102 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 116 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
.box {
color: #080;
font-weight: bold;
@@ -1375,7 +1423,7 @@ pre.prettyprint.running {
border-radius: 5px;
}
/* line 110 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 123 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
.build-tool-toggle {
margin: 20px;
display: none;
@@ -1383,14 +1431,14 @@ pre.prettyprint.running {
box-shadow: 1px 1px 30px 1px #080;
}
/* line 115 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 127 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
.columns.build-tool {
display: none;
background: whiteSmoke;
padding: 25px 25px 5px 25px;
}
/* line 120 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 131 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
.columns.build-tool input,
.columns.build-tool textarea,
.columns.build-tool button,
@@ -1398,18 +1446,18 @@ pre.prettyprint.running {
margin-bottom: 5px;
}
/* line 122 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 133 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
.columns.build-tool hr {
margin-bottom: 15px;
}
/* line 125 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 135 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
.columns.build-tool select {
display: inline;
height: 32px;
}
/* line 129 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 138 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
.columns.build-tool .build-tool-style {
padding: 3px;
margin: 5px 0;
@@ -1418,12 +1466,12 @@ pre.prettyprint.running {
border-radius: 3px;
}
/* line 135 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 143 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
.columns.build-tool .build-tool-style .name {
display: inline;
}
/* line 137 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 145 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
.columns.build-tool .build-tool-style .name,
.columns.build-tool .build-tool-style .code {
width: 100%;
@@ -1432,13 +1480,58 @@ pre.prettyprint.running {
box-sizing: border-box;
}
/* line 140 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 148 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
.columns.build-tool .build-tool-style .code {
font-family: 'Droid Sans Mono', Courier;
height: 215px;
}
/* line 147 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 151 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
.notifyjs-gswg-base {
font-family: Helvetica, Arial;
opacity: 0.85;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=85)";
filter: alpha(opacity=85);
width: 325px;
background: #e48632;
padding: 15px;
-webkit-border-radius: 10px;
border-radius: 10px;
}
/* line 158 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 159 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
.notifyjs-gswg-base .content .cover {
float: left;
background: url("http://gswg.io/img/cover2.jpg");
-webkit-background-size: cover;
-moz-background-size: cover;
background-size: cover;
width: 105px;
height: 130px;
}
/* line 165 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
.notifyjs-gswg-base .content .text {
float: left;
width: 200px;
padding-left: 15px;
padding-top: 10px;
color: #fff;
}
/* line 171 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
.notifyjs-gswg-base .content .text .title {
font-weight: bold;
}
/* line 173 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
.notifyjs-gswg-base .content .text button {
margin-bottom: 2px;
}
/* line 176 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
.clearfix:after {
visibility: hidden;
display: block;
@@ -1448,20 +1541,20 @@ pre.prettyprint.running {
height: 0;
}
/* line 155 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 183 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
.clearfix {
display: inline-block;
}
/* line 157 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 69 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* start commented backslash hack \*/
/* line 158 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 186 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
* html .clearfix {
height: 1%;
}
/* line 160 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
/* line 188 : /Users/jpillora/Code/JavaScript/notifyjs/docs/src/styles/app.styl */
.clearfix {
display: block;
}
+27 -7
View File
@@ -758,17 +758,22 @@ PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\
$(".build-tool-loading").hide();
$(".build-tool-toggle").show();
App.buildTool = $scope;
$scope.settings = {
minify: false,
"default": null
};
$scope.styles = [];
$scope.addStyle = function(code, premade) {
return $scope.styles.push({
var style;
style = {
active: true,
code: code,
premade: premade
});
};
$scope.settings = {
minify: false,
"default": $scope.styles[0]
$scope.styles.push(style);
if (!$scope.settings["default"]) {
return $scope.settings["default"] = style;
}
};
$scope.loadStyle = function() {
var baseUrl, style;
@@ -800,7 +805,7 @@ PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\
});
};
$scope.premadeStyle = $scope.premadeStyles[0];
$scope.loadStyle;
$scope.loadStyle();
$scope.toggle = function() {
$(".build-tool-toggle").toggleClass('active');
return $(".build-tool").toggle(400);
@@ -817,6 +822,9 @@ PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\
};
getStyleName = function(style) {
var m;
if (!(style != null ? style.code : void 0)) {
return null;
}
m = style.code.match(/\$\.notify\.addStyle\('(["\w-]+)'/);
if (!m) {
m = style.code.match(/\$\.notify\.addStyle\("(['\w-]+)"/);
@@ -959,7 +967,19 @@ PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\
}, 30 * 1000);
$(document).on('click', '.prettyprint.runnable', runSnippet);
$(".prettyprint.auto-run").each(runSnippet);
return $(".prettyprint.auto-add").each(addCSS);
$(".prettyprint.auto-add").each(addCSS);
$.notify.addStyle('gswg', {
html: "<div>\n <div class=\"content clearfix\">\n <div class=\"cover\"></div>\n <div class=\"text\">\n <div>Read my book:</div>\n <div class=\"title\">Getting Started with Grunt: The JavaScript Task Runner</div>\n <div>Get the first chapter for free!</div>\n <div>\n <a target=\"_blank\" href=\"http://gswg.io\">\n <button data-notify-text></button>\n </a>\n <button>No thanks</button>\n </div>\n </div>\n </div>\n</div>"
});
$(document).on('click', '.notifyjs-gswg-base button', function() {
return $(this).trigger('notify-hide');
});
return $.notify("http://gswg.io", {
position: 'b r',
style: 'gswg',
autoHide: false,
clickToHide: false
});
};
App = App || {};
+10 -7
View File
@@ -19,21 +19,22 @@ window.BuildController = ($scope,$timeout) ->
}
]
$(".build-tool-loading").hide()
$(".build-tool-toggle").show()
App.buildTool = $scope
$scope.styles = []
$scope.addStyle = (code, premade) ->
$scope.styles.push { active: true, code, premade:premade }
$scope.settings = {
minify: false
default: $scope.styles[0]
default: null
}
$scope.styles = []
$scope.addStyle = (code, premade) ->
style = { active: true, code, premade:premade }
$scope.styles.push style
$scope.settings.default = style unless $scope.settings.default
$scope.loadStyle = ->
style = $scope.premadeStyle
return unless style
@@ -59,7 +60,7 @@ window.BuildController = ($scope,$timeout) ->
#load bootstrap
$scope.premadeStyle = $scope.premadeStyles[0]
$scope.loadStyle
$scope.loadStyle()
#angular has loaded
$scope.toggle = ->
@@ -79,6 +80,8 @@ window.BuildController = ($scope,$timeout) ->
$scope.styles.splice i,1
getStyleName = (style) ->
unless style?.code
return null
m = style.code.match /\$\.notify\.addStyle\('(["\w-]+)'/
unless m
m = style.code.match /\$\.notify\.addStyle\("(['\w-]+)"/
+28
View File
@@ -35,3 +35,31 @@ App.codeRunner = ->
$(".prettyprint.auto-run").each(runSnippet)
$(".prettyprint.auto-add").each(addCSS)
#show gswg ad
$.notify.addStyle 'gswg',
html: """<div>
<div class="content clearfix">
<div class="cover"></div>
<div class="text">
<div>Read my book:</div>
<div class="title">Getting Started with Grunt: The JavaScript Task Runner</div>
<div>Get the first chapter for free!</div>
<div>
<a target="_blank" href="http://gswg.io">
<button data-notify-text></button>
</a>
<button>No thanks</button>
</div>
</div>
</div>
</div>
"""
$(document).on 'click', '.notifyjs-gswg-base button', ->
$(this).trigger('notify-hide')
$.notify("http://gswg.io", {position:'b r', style: 'gswg', autoHide: false, clickToHide: false})
+27 -1
View File
@@ -15,6 +15,9 @@ b
font-weight: bold
i
font-style: italic !important
input:focus, button
outline none
input[type="radio"],
label[for]
cursor: pointer
@@ -143,7 +146,30 @@ pre.prettyprint
font-family: 'Droid Sans Mono', Courier
height: 215px
.notifyjs-gswg-base
font-family Helvetica, Arial
opacity 0.85
width 325px
background #e48632
padding 15px
border-radius 10px
.content
.cover
float left
background url('http://gswg.io/img/cover2.jpg')
background-size cover
width 105px
height 130px
.text
float left
width 200px
padding-left 15px
padding-top 10px
color white
.title
font-weight bold
button
margin-bottom 2px
//chris coyers clearfix
.clearfix:after
+1 -4
View File
@@ -1,9 +1,6 @@
!!! 5
doctype html
html(lang='en')
dev = env == 'dev'
min = dev ? '' : '.min'
head
meta(charset='utf-8')
title Notify.js
+9 -19
View File
@@ -7,8 +7,11 @@
<meta name="author" content="Jaime Pillora &lt;dev@jpillora.com&gt;">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="docs/css/app.css">
<link href="http://fonts.googleapis.com/css?family=Merriweather+Sans:400,300,700,800" rel="stylesheet" type="text/css"><!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
<link href="http://fonts.googleapis.com/css?family=Merriweather+Sans:400,300,700,800" rel="stylesheet" type="text/css">
<!--if lt IE 9
script(src='http://html5shim.googlecode.com/svn/trunk/html5.js')
-->
</head>
<body><a href="https://github.com/jpillora/notifyjs"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_green_007200.png" alt="Fork me on GitHub"></a>
<div class="main container">
@@ -90,7 +93,6 @@
<div class="eight columns">
<h4>Global Notifications</h4>
<p>
If you don't specify an element, notification
will appear in the top left (unless you specify a
different position - See <a data-highlight>Positioning</a>)
@@ -166,7 +168,6 @@
<div class="sixteen columns">
<h3>Options</h3>
<p>
The options object listed above are in the form below.
This object below is the actual used to check option
validity and set defaults.
@@ -247,10 +248,7 @@
apply the class:
</p>
<p><code>notifyjs-&lt;style name&gt;-base</code></p>
<p>
When you use the class name option (<code>className</code>) the class:
</p>
<p>When you use the class name option (<code>className</code>) the class:</p>
<p><code>notifyjs-&lt;style name&gt;-&lt;class name&gt;</code></p>
<p>
will be applied. So if you define your styles in an external CSS file or in the style's css
@@ -292,10 +290,7 @@
style: 'happyblue'
});
</pre>
<p>
and you can use the <code>superblue</code> class with:
</p>
<p>and you can use the <code>superblue</code> class with:</p>
<pre class="prettyprint runnable">$.notify('HELLO !!!!', {
style: 'happyblue',
className: 'superblue'
@@ -331,10 +326,7 @@ $(document).on('click', '.notifyjs-foo-base .yes', function() {
$(this).trigger('notify-hide');
});
</pre>
<p>
Notice there is no <code>classes</code> property defined above. Since the CSS in this example is non-trivial, we'll use an exteral CSS file instead:
</p>
<p>Notice there is no <code>classes</code> property defined above. Since the CSS in this example is non-trivial, we'll use an exteral CSS file instead:</p>
<p class="italic">Note: you could also convert this CSS code to a JavaScript string and use it with the <code>css</code> property. It's not very readable though it's better for distribution.</p>
<pre class="prettyprint auto-add foo-css-example lang-css">.notifyjs-foo-base {
opacity: 0.85;
@@ -412,9 +404,7 @@ $.notify({
</div>
<div class="sixteen columns">
<h3>Contributing More Styles </h3>
<p>
Contributing more styles is easy!
<p>Contributing more styles is easy!
<ol>
<li>Click <a href="https://github.com/jpillora/notifyjs/new/gh-pages/src/styles" target="_blank">this</a> link</li>
<li>Sign into GitHub (if you're not already)</li>
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "notify",
"version": "0.3.1",
"version": "0.3.2",
"title": "notify",
"description": "A robust, customizable notification library",
"bugs": "https://github.com/jpillora/notifyjs/issues",
+1 -1
View File
@@ -1,7 +1,7 @@
{
"title": "Notify.js",
"name": "notify",
"version": "0.3.1",
"version": "0.3.2",
"author": {
"name": "Jaime Pillora"
},
+9 -4
View File
@@ -84,6 +84,9 @@ coreStyle =
display: none;
z-index: 1;
position: absolute;
}
.#{pluginClassName}-hidable {
cursor: pointer;
}
@@ -278,6 +281,7 @@ class Notification
@loadHTML()
@wrapper = $(coreStyle.html)
@wrapper.addClass "#{pluginClassName}-hidable" if @options.clickToHide
@wrapper.data pluginClassName, @
@arrow = @wrapper.find ".#{pluginClassName}-arrow"
@container = @wrapper.find ".#{pluginClassName}-container"
@@ -559,8 +563,9 @@ $ ->
insertCSS(coreStyle.css).attr('id', 'core-notify')
#watch all notifications clicks
$(document).on 'click notify-hide', ".#{pluginClassName}-wrapper", (e) ->
inst = $(@).data pluginClassName
if inst and (inst.options.clickToHide or e.type is 'notify-hide')
inst.show false
$(document).on 'click', ".#{pluginClassName}-hidable", (e) ->
$(@).trigger 'notify-hide'
$(document).on 'notify-hide', ".#{pluginClassName}-wrapper", (e) ->
$(@).data(pluginClassName)?.show false