From 2f88823b00125a6d60b9b596fe2ae1afb42b43ba Mon Sep 17 00:00:00 2001 From: Jaime Pillora Date: Sun, 29 Jun 2014 01:02:42 +1000 Subject: [PATCH] upgraded docs, fixed cursor show when clickToHide:false, bumped to 0.3.2 --- bower.json | 2 +- dist/notify-combined.js | 19 +-- dist/notify-combined.min.js | 4 +- dist/notify.js | 19 +-- dist/notify.min.js | 4 +- docs/Gruntsource.json | 5 +- docs/css/app.css | 209 ++++++++++++++++++++-------- docs/js/app.js | 36 +++-- docs/src/scripts/build-tool.coffee | 17 ++- docs/src/scripts/code-runner.coffee | 30 +++- docs/src/styles/app.styl | 28 +++- docs/src/views/index.jade | 5 +- index.html | 28 ++-- notify.jquery.json | 2 +- package.json | 2 +- src/notify.coffee | 13 +- 16 files changed, 296 insertions(+), 127 deletions(-) diff --git a/bower.json b/bower.json index 7ba01a4..df7b05f 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "notifyjs", - "version": "0.3.1", + "version": "0.3.2", "homepage": "http://notifyjs.com/", "authors": [ "Jaime Pillora " diff --git a/dist/notify-combined.js b/dist/notify-combined.js index e548c43..8d9405a 100644 --- a/dist/notify-combined.js +++ b/dist/notify-combined.js @@ -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: "
\n
\n
\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 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; }); }); diff --git a/dist/notify-combined.min.js b/dist/notify-combined.min.js index bafa7af..9ac165e 100644 --- a/dist/notify-combined.min.js +++ b/dist/notify-combined.min.js @@ -1,5 +1,5 @@ -/** 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 */ -(function(t,i,n,e){"use strict";var o,r,s,a,l,h,c,p,u,d,f,A,m,w,g,y,b,v,x,C,S,E,M,k,H,D,F,T=[].indexOf||function(t){for(var i=0,n=this.length;n>i;i++)if(i in this&&this[i]===t)return i;return-1};S="notify",C=S+"js",s=S+"!blank",M={t:"top",m:"middle",b:"bottom",l:"left",c:"center",r:"right"},m=["l","c","r"],F=["t","m","b"],b=["t","b","l","r"],v={t:"b",m:null,b:"t",l:"r",c:null,r:"l"},x=function(t){var i;return i=[],n.each(t.split(/\W+/),function(t,n){var o;return o=n.toLowerCase().charAt(0),M[o]?i.push(o):e}),i},D={},a={name:"core",html:'
\n
\n
\n
',css:"."+C+"-corner {\n position: fixed;\n margin: 5px;\n z-index: 1050;\n}\n\n."+C+"-corner ."+C+"-wrapper,\n."+C+"-corner ."+C+"-container {\n position: relative;\n display: block;\n height: inherit;\n width: inherit;\n margin: 3px;\n}\n\n."+C+"-wrapper {\n z-index: 1;\n position: absolute;\n display: inline-block;\n height: 0;\n width: 0;\n}\n\n."+C+"-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."+C+"-arrow {\n position: absolute;\n z-index: 2;\n width: 0;\n height: 0;\n}"},H={"border-radius":["-webkit-","-moz-"]},f=function(t){return D[t]},r=function(i,e){var o,r,s,a;if(!i)throw"Missing Style name";if(!e)throw"Missing Style definition";if(!e.html)throw"Missing Style HTML";return(null!=(a=D[i])?a.cssElem:void 0)&&(t.console&&console.warn(""+S+": overwriting style '"+i+"'"),D[i].cssElem.remove()),e.name=i,D[i]=e,o="",e.classes&&n.each(e.classes,function(t,i){return o+="."+C+"-"+e.name+"-"+t+" {\n",n.each(i,function(t,i){return H[t]&&n.each(H[t],function(n,e){return o+=" "+e+t+": "+i+";\n"}),o+=" "+t+": "+i+";\n"}),o+="}\n"}),e.css&&(o+="/* styles for "+e.name+" */\n"+e.css),o&&(e.cssElem=y(o),e.cssElem.attr("id","notify-"+e.name)),s={},r=n(e.html),u("html",r,s),u("text",r,s),e.fields=s},y=function(t){var i;i=l("style"),i.attr("type","text/css"),n("head").append(i);try{i.html(t)}catch(e){i[0].styleSheet.cssText=t}return i},u=function(t,i,e){var o;return"html"!==t&&(t="text"),o="data-notify-"+t,p(i,"["+o+"]").each(function(){var i;return i=n(this).attr(o),i||(i=s),e[i]=t})},p=function(t,i){return t.is(i)?t:t.find(i)},E={clickToHide:!0,autoHide:!0,autoHideDelay:5e3,arrowShow:!0,arrowSize:5,breakNewLines:!0,elementPosition:"bottom",globalPosition:"top right",style:"bootstrap",className:"error",showAnimation:"slideDown",showDuration:400,hideAnimation:"slideUp",hideDuration:200,gap:5},g=function(t,i){var e;return e=function(){},e.prototype=t,n.extend(!0,new e,i)},h=function(t){return n.extend(E,t)},l=function(t){return n("<"+t+">")},A={},d=function(t){var i;return t.is("[type=radio]")&&(i=t.parents("form:first").find("[type=radio]").filter(function(i,e){return n(e).attr("name")===t.attr("name")}),t=i.first()),t},w=function(t,i,n){var o,r;if("string"==typeof n)n=parseInt(n,10);else if("number"!=typeof n)return;if(!isNaN(n))return o=M[v[i.charAt(0)]],r=i,t[o]!==e&&(i=M[o.charAt(0)],n=-n),t[i]===e?t[i]=n:t[i]+=n,null},k=function(t,i,n){if("l"===t||"t"===t)return 0;if("c"===t||"m"===t)return n/2-i/2;if("r"===t||"b"===t)return n-i;throw"Invalid alignment"},c=function(t){return c.e=c.e||l("div"),c.e.text(t).html()},o=function(){function t(t,i,e){"string"==typeof e&&(e={className:e}),this.options=g(E,n.isPlainObject(e)?e:{}),this.loadHTML(),this.wrapper=n(a.html),this.wrapper.data(C,this),this.arrow=this.wrapper.find("."+C+"-arrow"),this.container=this.wrapper.find("."+C+"-container"),this.container.append(this.userContainer),t&&t.length&&(this.elementType=t.attr("type"),this.originalElement=t,this.elem=d(t),this.elem.data(C,this),this.elem.before(this.wrapper)),this.container.hide(),this.run(i)}return t.prototype.loadHTML=function(){var t;return t=this.getStyle(),this.userContainer=n(t.html),this.userFields=t.fields},t.prototype.show=function(t,i){var n,o,r,s,a,l=this;if(o=function(){return t||l.elem||l.destroy(),i?i():e},a=this.container.parent().parents(":hidden").length>0,r=this.container.add(this.arrow),n=[],a&&t)s="show";else if(a&&!t)s="hide";else if(!a&&t)s=this.options.showAnimation,n.push(this.options.showDuration);else{if(a||t)return o();s=this.options.hideAnimation,n.push(this.options.hideDuration)}return n.push(o),r[s].apply(r,n)},t.prototype.setGlobalPosition=function(){var t,i,e,o,r,s,a,h;return h=this.getPosition(),a=h[0],s=h[1],r=M[a],t=M[s],o=a+"|"+s,i=A[o],i||(i=A[o]=l("div"),e={},e[r]=0,"middle"===t?e.top="45%":"center"===t?e.left="45%":e[t]=0,i.css(e).addClass(""+C+"-corner"),n("body").append(i)),i.prepend(this.wrapper)},t.prototype.setElementPosition=function(){var t,i,o,r,s,a,l,h,c,p,u,d,f,A,g,y,x,C,S,E,H,D,z,Q,B,R,N,P,U;for(z=this.getPosition(),E=z[0],C=z[1],S=z[2],u=this.elem.position(),h=this.elem.outerHeight(),d=this.elem.outerWidth(),c=this.elem.innerHeight(),p=this.elem.innerWidth(),Q=this.wrapper.position(),s=this.container.height(),a=this.container.width(),A=M[E],y=v[E],x=M[y],l={},l[x]="b"===E?h:"r"===E?d:0,w(l,"top",u.top-Q.top),w(l,"left",u.left-Q.left),U=["top","left"],B=0,N=U.length;N>B;B++)H=U[B],g=parseInt(this.elem.css("margin-"+H),10),g&&w(l,H,g);if(f=Math.max(0,this.options.gap-(this.options.arrowShow?o:0)),w(l,x,f),this.options.arrowShow){for(o=this.options.arrowSize,i=n.extend({},l),t=this.userContainer.css("border-color")||this.userContainer.css("background-color")||"white",R=0,P=b.length;P>R;R++)H=b[R],D=M[H],H!==y&&(r=D===A?t:"transparent",i["border-"+D]=""+o+"px solid "+r);w(l,M[y],o),T.call(b,C)>=0&&w(i,M[C],2*o)}else this.arrow.hide();return T.call(F,E)>=0?(w(l,"left",k(C,a,d)),i&&w(i,"left",k(C,o,p))):T.call(m,E)>=0&&(w(l,"top",k(C,s,h)),i&&w(i,"top",k(C,o,c))),this.container.is(":visible")&&(l.display="block"),this.container.removeAttr("style").css(l),i?this.arrow.removeAttr("style").css(i):e},t.prototype.getPosition=function(){var t,i,n,e,o,r,s,a;if(i=this.options.position||(this.elem?this.options.elementPosition:this.options.globalPosition),t=x(i),0===t.length&&(t[0]="b"),n=t[0],0>T.call(b,n))throw"Must be one of ["+b+"]";return(1===t.length||(e=t[0],T.call(F,e)>=0&&(o=t[1],0>T.call(m,o)))||(r=t[0],T.call(m,r)>=0&&(s=t[1],0>T.call(F,s))))&&(t[1]=(a=t[0],T.call(m,a)>=0?"m":"l")),2===t.length&&(t[2]=t[1]),t},t.prototype.getStyle=function(t){var i;if(t||(t=this.options.style),t||(t="default"),i=D[t],!i)throw"Missing style: "+t;return i},t.prototype.updateClasses=function(){var t,i;return t=["base"],n.isArray(this.options.className)?t=t.concat(this.options.className):this.options.className&&t.push(this.options.className),i=this.getStyle(),t=n.map(t,function(t){return""+C+"-"+i.name+"-"+t}).join(" "),this.userContainer.attr("class",t)},t.prototype.run=function(t,i){var o,r,a,l,h,u=this;if(n.isPlainObject(i)?n.extend(this.options,i):"string"===n.type(i)&&(this.options.className=i),this.container&&!t)return this.show(!1),e;if(this.container||t){r={},n.isPlainObject(t)?r=t:r[s]=t;for(a in r)o=r[a],l=this.userFields[a],l&&("text"===l&&(o=c(o),this.options.breakNewLines&&(o=o.replace(/\n/g,"
"))),h=a===s?"":"="+a,p(this.userContainer,"[data-notify-"+l+h+"]").html(o));return this.updateClasses(),this.elem?this.setElementPosition():this.setGlobalPosition(),this.show(!0),this.options.autoHide?(clearTimeout(this.autohideTimer),this.autohideTimer=setTimeout(function(){return u.show(!1)},this.options.autoHideDelay)):e}},t.prototype.destroy=function(){return this.wrapper.remove()},t}(),n[S]=function(t,i,e){return t&&t.nodeName||t.jquery?n(t)[S](i,e):(e=i,i=t,new o(null,i,e)),t},n.fn[S]=function(t,i){return n(this).each(function(){var e;return e=d(n(this)).data(C),e?e.run(t,i):new o(n(this),t,i)}),this},n.extend(n[S],{defaults:h,addStyle:r,pluginOptions:E,getStyle:f,insertCSS:y}),n(function(){return y(a.css).attr("id","core-notify"),n(i).on("click notify-hide","."+C+"-wrapper",function(t){var i;return i=n(this).data(C),i&&(i.options.clickToHide||"notify-hide"===t.type)?i.show(!1):e})})})(window,document,jQuery),$.notify.addStyle("bootstrap",{html:"
\n\n
",classes:{base:{"font-weight":"bold",padding:"8px 15px 8px 14px","text-shadow":"0 1px 0 rgba(255, 255, 255, 0.5)","background-color":"#fcf8e3",border:"1px solid #fbeed5","border-radius":"4px","white-space":"nowrap","padding-left":"25px","background-repeat":"no-repeat","background-position":"3px 7px"},error:{color:"#B94A48","background-color":"#F2DEDE","border-color":"#EED3D7","background-image":"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAtRJREFUeNqkVc1u00AQHq+dOD+0poIQfkIjalW0SEGqRMuRnHos3DjwAH0ArlyQeANOOSMeAA5VjyBxKBQhgSpVUKKQNGloFdw4cWw2jtfMOna6JOUArDTazXi/b3dm55socPqQhFka++aHBsI8GsopRJERNFlY88FCEk9Yiwf8RhgRyaHFQpPHCDmZG5oX2ui2yilkcTT1AcDsbYC1NMAyOi7zTX2Agx7A9luAl88BauiiQ/cJaZQfIpAlngDcvZZMrl8vFPK5+XktrWlx3/ehZ5r9+t6e+WVnp1pxnNIjgBe4/6dAysQc8dsmHwPcW9C0h3fW1hans1ltwJhy0GxK7XZbUlMp5Ww2eyan6+ft/f2FAqXGK4CvQk5HueFz7D6GOZtIrK+srupdx1GRBBqNBtzc2AiMr7nPplRdKhb1q6q6zjFhrklEFOUutoQ50xcX86ZlqaZpQrfbBdu2R6/G19zX6XSgh6RX5ubyHCM8nqSID6ICrGiZjGYYxojEsiw4PDwMSL5VKsC8Yf4VRYFzMzMaxwjlJSlCyAQ9l0CW44PBADzXhe7xMdi9HtTrdYjFYkDQL0cn4Xdq2/EAE+InCnvADTf2eah4Sx9vExQjkqXT6aAERICMewd/UAp/IeYANM2joxt+q5VI+ieq2i0Wg3l6DNzHwTERPgo1ko7XBXj3vdlsT2F+UuhIhYkp7u7CarkcrFOCtR3H5JiwbAIeImjT/YQKKBtGjRFCU5IUgFRe7fF4cCNVIPMYo3VKqxwjyNAXNepuopyqnld602qVsfRpEkkz+GFL1wPj6ySXBpJtWVa5xlhpcyhBNwpZHmtX8AGgfIExo0ZpzkWVTBGiXCSEaHh62/PoR0p/vHaczxXGnj4bSo+G78lELU80h1uogBwWLf5YlsPmgDEd4M236xjm+8nm4IuE/9u+/PH2JXZfbwz4zw1WbO+SQPpXfwG/BBgAhCNZiSb/pOQAAAAASUVORK5CYII=)"},success:{color:"#468847","background-color":"#DFF0D8","border-color":"#D6E9C6","background-image":"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAutJREFUeNq0lctPE0Ecx38zu/RFS1EryqtgJFA08YCiMZIAQQ4eRG8eDGdPJiYeTIwHTfwPiAcvXIwXLwoXPaDxkWgQ6islKlJLSQWLUraPLTv7Gme32zoF9KSTfLO7v53vZ3d/M7/fIth+IO6INt2jjoA7bjHCJoAlzCRw59YwHYjBnfMPqAKWQYKjGkfCJqAF0xwZjipQtA3MxeSG87VhOOYegVrUCy7UZM9S6TLIdAamySTclZdYhFhRHloGYg7mgZv1Zzztvgud7V1tbQ2twYA34LJmF4p5dXF1KTufnE+SxeJtuCZNsLDCQU0+RyKTF27Unw101l8e6hns3u0PBalORVVVkcaEKBJDgV3+cGM4tKKmI+ohlIGnygKX00rSBfszz/n2uXv81wd6+rt1orsZCHRdr1Imk2F2Kob3hutSxW8thsd8AXNaln9D7CTfA6O+0UgkMuwVvEFFUbbAcrkcTA8+AtOk8E6KiQiDmMFSDqZItAzEVQviRkdDdaFgPp8HSZKAEAL5Qh7Sq2lIJBJwv2scUqkUnKoZgNhcDKhKg5aH+1IkcouCAdFGAQsuWZYhOjwFHQ96oagWgRoUov1T9kRBEODAwxM2QtEUl+Wp+Ln9VRo6BcMw4ErHRYjH4/B26AlQoQQTRdHWwcd9AH57+UAXddvDD37DmrBBV34WfqiXPl61g+vr6xA9zsGeM9gOdsNXkgpEtTwVvwOklXLKm6+/p5ezwk4B+j6droBs2CsGa/gNs6RIxazl4Tc25mpTgw/apPR1LYlNRFAzgsOxkyXYLIM1V8NMwyAkJSctD1eGVKiq5wWjSPdjmeTkiKvVW4f2YPHWl3GAVq6ymcyCTgovM3FzyRiDe2TaKcEKsLpJvNHjZgPNqEtyi6mZIm4SRFyLMUsONSSdkPeFtY1n0mczoY3BHTLhwPRy9/lzcziCw9ACI+yql0VLzcGAZbYSM5CCSZg1/9oc/nn7+i8N9p/8An4JMADxhH+xHfuiKwAAAABJRU5ErkJggg==)"},info:{color:"#3A87AD","background-color":"#D9EDF7","border-color":"#BCE8F1","background-image":"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3QYFAhkSsdes/QAAA8dJREFUOMvVlGtMW2UYx//POaWHXg6lLaW0ypAtw1UCgbniNOLcVOLmAjHZolOYlxmTGXVZdAnRfXQm+7SoU4mXaOaiZsEpC9FkiQs6Z6bdCnNYruM6KNBw6YWewzl9z+sHImEWv+vz7XmT95f/+3/+7wP814v+efDOV3/SoX3lHAA+6ODeUFfMfjOWMADgdk+eEKz0pF7aQdMAcOKLLjrcVMVX3xdWN29/GhYP7SvnP0cWfS8caSkfHZsPE9Fgnt02JNutQ0QYHB2dDz9/pKX8QjjuO9xUxd/66HdxTeCHZ3rojQObGQBcuNjfplkD3b19Y/6MrimSaKgSMmpGU5WevmE/swa6Oy73tQHA0Rdr2Mmv/6A1n9w9suQ7097Z9lM4FlTgTDrzZTu4StXVfpiI48rVcUDM5cmEksrFnHxfpTtU/3BFQzCQF/2bYVoNbH7zmItbSoMj40JSzmMyX5qDvriA7QdrIIpA+3cdsMpu0nXI8cV0MtKXCPZev+gCEM1S2NHPvWfP/hL+7FSr3+0p5RBEyhEN5JCKYr8XnASMT0xBNyzQGQeI8fjsGD39RMPk7se2bd5ZtTyoFYXftF6y37gx7NeUtJJOTFlAHDZLDuILU3j3+H5oOrD3yWbIztugaAzgnBKJuBLpGfQrS8wO4FZgV+c1IxaLgWVU0tMLEETCos4xMzEIv9cJXQcyagIwigDGwJgOAtHAwAhisQUjy0ORGERiELgG4iakkzo4MYAxcM5hAMi1WWG1yYCJIcMUaBkVRLdGeSU2995TLWzcUAzONJ7J6FBVBYIggMzmFbvdBV44Corg8vjhzC+EJEl8U1kJtgYrhCzgc/vvTwXKSib1paRFVRVORDAJAsw5FuTaJEhWM2SHB3mOAlhkNxwuLzeJsGwqWzf5TFNdKgtY5qHp6ZFf67Y/sAVadCaVY5YACDDb3Oi4NIjLnWMw2QthCBIsVhsUTU9tvXsjeq9+X1d75/KEs4LNOfcdf/+HthMnvwxOD0wmHaXr7ZItn2wuH2SnBzbZAbPJwpPx+VQuzcm7dgRCB57a1uBzUDRL4bfnI0RE0eaXd9W89mpjqHZnUI5Hh2l2dkZZUhOqpi2qSmpOmZ64Tuu9qlz/SEXo6MEHa3wOip46F1n7633eekV8ds8Wxjn37Wl63VVa+ej5oeEZ/82ZBETJjpJ1Rbij2D3Z/1trXUvLsblCK0XfOx0SX2kMsn9dX+d+7Kf6h8o4AIykuffjT8L20LU+w4AZd5VvEPY+XpWqLV327HR7DzXuDnD8r+ovkBehJ8i+y8YAAAAASUVORK5CYII=)"},warn:{color:"#C09853","background-color":"#FCF8E3","border-color":"#FBEED5","background-image":"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAMAAAC6V+0/AAABJlBMVEXr6eb/2oD/wi7/xjr/0mP/ykf/tQD/vBj/3o7/uQ//vyL/twebhgD/4pzX1K3z8e349vK6tHCilCWbiQymn0jGworr6dXQza3HxcKkn1vWvV/5uRfk4dXZ1bD18+/52YebiAmyr5S9mhCzrWq5t6ufjRH54aLs0oS+qD751XqPhAybhwXsujG3sm+Zk0PTwG6Shg+PhhObhwOPgQL4zV2nlyrf27uLfgCPhRHu7OmLgAafkyiWkD3l49ibiAfTs0C+lgCniwD4sgDJxqOilzDWowWFfAH08uebig6qpFHBvH/aw26FfQTQzsvy8OyEfz20r3jAvaKbhgG9q0nc2LbZxXanoUu/u5WSggCtp1anpJKdmFz/zlX/1nGJiYmuq5Dx7+sAAADoPUZSAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfdBgUBGhh4aah5AAAAlklEQVQY02NgoBIIE8EUcwn1FkIXM1Tj5dDUQhPU502Mi7XXQxGz5uVIjGOJUUUW81HnYEyMi2HVcUOICQZzMMYmxrEyMylJwgUt5BljWRLjmJm4pI1hYp5SQLGYxDgmLnZOVxuooClIDKgXKMbN5ggV1ACLJcaBxNgcoiGCBiZwdWxOETBDrTyEFey0jYJ4eHjMGWgEAIpRFRCUt08qAAAAAElFTkSuQmCC)"}}}); \ No newline at end of file +(function(t,i,n,e){"use strict";var r,o,s,a,l,h,c,p,u,d,f,A,m,w,g,y,b,v,x,C,S,E,M,k,H,D,F,T=[].indexOf||function(t){for(var i=0,n=this.length;n>i;i++)if(i in this&&this[i]===t)return i;return-1};S="notify",C=S+"js",s=S+"!blank",M={t:"top",m:"middle",b:"bottom",l:"left",c:"center",r:"right"},m=["l","c","r"],F=["t","m","b"],b=["t","b","l","r"],v={t:"b",m:null,b:"t",l:"r",c:null,r:"l"},x=function(t){var i;return i=[],n.each(t.split(/\W+/),function(t,n){var r;return r=n.toLowerCase().charAt(0),M[r]?i.push(r):e}),i},D={},a={name:"core",html:'
\n
\n
\n
',css:"."+C+"-corner {\n position: fixed;\n margin: 5px;\n z-index: 1050;\n}\n\n."+C+"-corner ."+C+"-wrapper,\n."+C+"-corner ."+C+"-container {\n position: relative;\n display: block;\n height: inherit;\n width: inherit;\n margin: 3px;\n}\n\n."+C+"-wrapper {\n z-index: 1;\n position: absolute;\n display: inline-block;\n height: 0;\n width: 0;\n}\n\n."+C+"-container {\n display: none;\n z-index: 1;\n position: absolute;\n}\n\n."+C+"-hidable {\n cursor: pointer;\n}\n\n[data-notify-text],[data-notify-html] {\n position: relative;\n}\n\n."+C+"-arrow {\n position: absolute;\n z-index: 2;\n width: 0;\n height: 0;\n}"},H={"border-radius":["-webkit-","-moz-"]},f=function(t){return D[t]},o=function(i,e){var r,o,s,a;if(!i)throw"Missing Style name";if(!e)throw"Missing Style definition";if(!e.html)throw"Missing Style HTML";return(null!=(a=D[i])?a.cssElem:void 0)&&(t.console&&console.warn(""+S+": overwriting style '"+i+"'"),D[i].cssElem.remove()),e.name=i,D[i]=e,r="",e.classes&&n.each(e.classes,function(t,i){return r+="."+C+"-"+e.name+"-"+t+" {\n",n.each(i,function(t,i){return H[t]&&n.each(H[t],function(n,e){return r+=" "+e+t+": "+i+";\n"}),r+=" "+t+": "+i+";\n"}),r+="}\n"}),e.css&&(r+="/* styles for "+e.name+" */\n"+e.css),r&&(e.cssElem=y(r),e.cssElem.attr("id","notify-"+e.name)),s={},o=n(e.html),u("html",o,s),u("text",o,s),e.fields=s},y=function(t){var i;i=l("style"),i.attr("type","text/css"),n("head").append(i);try{i.html(t)}catch(e){i[0].styleSheet.cssText=t}return i},u=function(t,i,e){var r;return"html"!==t&&(t="text"),r="data-notify-"+t,p(i,"["+r+"]").each(function(){var i;return i=n(this).attr(r),i||(i=s),e[i]=t})},p=function(t,i){return t.is(i)?t:t.find(i)},E={clickToHide:!0,autoHide:!0,autoHideDelay:5e3,arrowShow:!0,arrowSize:5,breakNewLines:!0,elementPosition:"bottom",globalPosition:"top right",style:"bootstrap",className:"error",showAnimation:"slideDown",showDuration:400,hideAnimation:"slideUp",hideDuration:200,gap:5},g=function(t,i){var e;return e=function(){},e.prototype=t,n.extend(!0,new e,i)},h=function(t){return n.extend(E,t)},l=function(t){return n("<"+t+">")},A={},d=function(t){var i;return t.is("[type=radio]")&&(i=t.parents("form:first").find("[type=radio]").filter(function(i,e){return n(e).attr("name")===t.attr("name")}),t=i.first()),t},w=function(t,i,n){var r,o;if("string"==typeof n)n=parseInt(n,10);else if("number"!=typeof n)return;if(!isNaN(n))return r=M[v[i.charAt(0)]],o=i,t[r]!==e&&(i=M[r.charAt(0)],n=-n),t[i]===e?t[i]=n:t[i]+=n,null},k=function(t,i,n){if("l"===t||"t"===t)return 0;if("c"===t||"m"===t)return n/2-i/2;if("r"===t||"b"===t)return n-i;throw"Invalid alignment"},c=function(t){return c.e=c.e||l("div"),c.e.text(t).html()},r=function(){function t(t,i,e){"string"==typeof e&&(e={className:e}),this.options=g(E,n.isPlainObject(e)?e:{}),this.loadHTML(),this.wrapper=n(a.html),this.options.clickToHide&&this.wrapper.addClass(""+C+"-hidable"),this.wrapper.data(C,this),this.arrow=this.wrapper.find("."+C+"-arrow"),this.container=this.wrapper.find("."+C+"-container"),this.container.append(this.userContainer),t&&t.length&&(this.elementType=t.attr("type"),this.originalElement=t,this.elem=d(t),this.elem.data(C,this),this.elem.before(this.wrapper)),this.container.hide(),this.run(i)}return t.prototype.loadHTML=function(){var t;return t=this.getStyle(),this.userContainer=n(t.html),this.userFields=t.fields},t.prototype.show=function(t,i){var n,r,o,s,a,l=this;if(r=function(){return t||l.elem||l.destroy(),i?i():e},a=this.container.parent().parents(":hidden").length>0,o=this.container.add(this.arrow),n=[],a&&t)s="show";else if(a&&!t)s="hide";else if(!a&&t)s=this.options.showAnimation,n.push(this.options.showDuration);else{if(a||t)return r();s=this.options.hideAnimation,n.push(this.options.hideDuration)}return n.push(r),o[s].apply(o,n)},t.prototype.setGlobalPosition=function(){var t,i,e,r,o,s,a,h;return h=this.getPosition(),a=h[0],s=h[1],o=M[a],t=M[s],r=a+"|"+s,i=A[r],i||(i=A[r]=l("div"),e={},e[o]=0,"middle"===t?e.top="45%":"center"===t?e.left="45%":e[t]=0,i.css(e).addClass(""+C+"-corner"),n("body").append(i)),i.prepend(this.wrapper)},t.prototype.setElementPosition=function(){var t,i,r,o,s,a,l,h,c,p,u,d,f,A,g,y,x,C,S,E,H,D,z,Q,B,R,N,P,U;for(z=this.getPosition(),E=z[0],C=z[1],S=z[2],u=this.elem.position(),h=this.elem.outerHeight(),d=this.elem.outerWidth(),c=this.elem.innerHeight(),p=this.elem.innerWidth(),Q=this.wrapper.position(),s=this.container.height(),a=this.container.width(),A=M[E],y=v[E],x=M[y],l={},l[x]="b"===E?h:"r"===E?d:0,w(l,"top",u.top-Q.top),w(l,"left",u.left-Q.left),U=["top","left"],B=0,N=U.length;N>B;B++)H=U[B],g=parseInt(this.elem.css("margin-"+H),10),g&&w(l,H,g);if(f=Math.max(0,this.options.gap-(this.options.arrowShow?r:0)),w(l,x,f),this.options.arrowShow){for(r=this.options.arrowSize,i=n.extend({},l),t=this.userContainer.css("border-color")||this.userContainer.css("background-color")||"white",R=0,P=b.length;P>R;R++)H=b[R],D=M[H],H!==y&&(o=D===A?t:"transparent",i["border-"+D]=""+r+"px solid "+o);w(l,M[y],r),T.call(b,C)>=0&&w(i,M[C],2*r)}else this.arrow.hide();return T.call(F,E)>=0?(w(l,"left",k(C,a,d)),i&&w(i,"left",k(C,r,p))):T.call(m,E)>=0&&(w(l,"top",k(C,s,h)),i&&w(i,"top",k(C,r,c))),this.container.is(":visible")&&(l.display="block"),this.container.removeAttr("style").css(l),i?this.arrow.removeAttr("style").css(i):e},t.prototype.getPosition=function(){var t,i,n,e,r,o,s,a;if(i=this.options.position||(this.elem?this.options.elementPosition:this.options.globalPosition),t=x(i),0===t.length&&(t[0]="b"),n=t[0],0>T.call(b,n))throw"Must be one of ["+b+"]";return(1===t.length||(e=t[0],T.call(F,e)>=0&&(r=t[1],0>T.call(m,r)))||(o=t[0],T.call(m,o)>=0&&(s=t[1],0>T.call(F,s))))&&(t[1]=(a=t[0],T.call(m,a)>=0?"m":"l")),2===t.length&&(t[2]=t[1]),t},t.prototype.getStyle=function(t){var i;if(t||(t=this.options.style),t||(t="default"),i=D[t],!i)throw"Missing style: "+t;return i},t.prototype.updateClasses=function(){var t,i;return t=["base"],n.isArray(this.options.className)?t=t.concat(this.options.className):this.options.className&&t.push(this.options.className),i=this.getStyle(),t=n.map(t,function(t){return""+C+"-"+i.name+"-"+t}).join(" "),this.userContainer.attr("class",t)},t.prototype.run=function(t,i){var r,o,a,l,h,u=this;if(n.isPlainObject(i)?n.extend(this.options,i):"string"===n.type(i)&&(this.options.className=i),this.container&&!t)return this.show(!1),e;if(this.container||t){o={},n.isPlainObject(t)?o=t:o[s]=t;for(a in o)r=o[a],l=this.userFields[a],l&&("text"===l&&(r=c(r),this.options.breakNewLines&&(r=r.replace(/\n/g,"
"))),h=a===s?"":"="+a,p(this.userContainer,"[data-notify-"+l+h+"]").html(r));return this.updateClasses(),this.elem?this.setElementPosition():this.setGlobalPosition(),this.show(!0),this.options.autoHide?(clearTimeout(this.autohideTimer),this.autohideTimer=setTimeout(function(){return u.show(!1)},this.options.autoHideDelay)):e}},t.prototype.destroy=function(){return this.wrapper.remove()},t}(),n[S]=function(t,i,e){return t&&t.nodeName||t.jquery?n(t)[S](i,e):(e=i,i=t,new r(null,i,e)),t},n.fn[S]=function(t,i){return n(this).each(function(){var e;return e=d(n(this)).data(C),e?e.run(t,i):new r(n(this),t,i)}),this},n.extend(n[S],{defaults:h,addStyle:o,pluginOptions:E,getStyle:f,insertCSS:y}),n(function(){return y(a.css).attr("id","core-notify"),n(i).on("click","."+C+"-hidable",function(){return n(this).trigger("notify-hide")}),n(i).on("notify-hide","."+C+"-wrapper",function(){var t;return null!=(t=n(this).data(C))?t.show(!1):void 0})})})(window,document,jQuery),$.notify.addStyle("bootstrap",{html:"
\n\n
",classes:{base:{"font-weight":"bold",padding:"8px 15px 8px 14px","text-shadow":"0 1px 0 rgba(255, 255, 255, 0.5)","background-color":"#fcf8e3",border:"1px solid #fbeed5","border-radius":"4px","white-space":"nowrap","padding-left":"25px","background-repeat":"no-repeat","background-position":"3px 7px"},error:{color:"#B94A48","background-color":"#F2DEDE","border-color":"#EED3D7","background-image":"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAtRJREFUeNqkVc1u00AQHq+dOD+0poIQfkIjalW0SEGqRMuRnHos3DjwAH0ArlyQeANOOSMeAA5VjyBxKBQhgSpVUKKQNGloFdw4cWw2jtfMOna6JOUArDTazXi/b3dm55socPqQhFka++aHBsI8GsopRJERNFlY88FCEk9Yiwf8RhgRyaHFQpPHCDmZG5oX2ui2yilkcTT1AcDsbYC1NMAyOi7zTX2Agx7A9luAl88BauiiQ/cJaZQfIpAlngDcvZZMrl8vFPK5+XktrWlx3/ehZ5r9+t6e+WVnp1pxnNIjgBe4/6dAysQc8dsmHwPcW9C0h3fW1hans1ltwJhy0GxK7XZbUlMp5Ww2eyan6+ft/f2FAqXGK4CvQk5HueFz7D6GOZtIrK+srupdx1GRBBqNBtzc2AiMr7nPplRdKhb1q6q6zjFhrklEFOUutoQ50xcX86ZlqaZpQrfbBdu2R6/G19zX6XSgh6RX5ubyHCM8nqSID6ICrGiZjGYYxojEsiw4PDwMSL5VKsC8Yf4VRYFzMzMaxwjlJSlCyAQ9l0CW44PBADzXhe7xMdi9HtTrdYjFYkDQL0cn4Xdq2/EAE+InCnvADTf2eah4Sx9vExQjkqXT6aAERICMewd/UAp/IeYANM2joxt+q5VI+ieq2i0Wg3l6DNzHwTERPgo1ko7XBXj3vdlsT2F+UuhIhYkp7u7CarkcrFOCtR3H5JiwbAIeImjT/YQKKBtGjRFCU5IUgFRe7fF4cCNVIPMYo3VKqxwjyNAXNepuopyqnld602qVsfRpEkkz+GFL1wPj6ySXBpJtWVa5xlhpcyhBNwpZHmtX8AGgfIExo0ZpzkWVTBGiXCSEaHh62/PoR0p/vHaczxXGnj4bSo+G78lELU80h1uogBwWLf5YlsPmgDEd4M236xjm+8nm4IuE/9u+/PH2JXZfbwz4zw1WbO+SQPpXfwG/BBgAhCNZiSb/pOQAAAAASUVORK5CYII=)"},success:{color:"#468847","background-color":"#DFF0D8","border-color":"#D6E9C6","background-image":"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAutJREFUeNq0lctPE0Ecx38zu/RFS1EryqtgJFA08YCiMZIAQQ4eRG8eDGdPJiYeTIwHTfwPiAcvXIwXLwoXPaDxkWgQ6islKlJLSQWLUraPLTv7Gme32zoF9KSTfLO7v53vZ3d/M7/fIth+IO6INt2jjoA7bjHCJoAlzCRw59YwHYjBnfMPqAKWQYKjGkfCJqAF0xwZjipQtA3MxeSG87VhOOYegVrUCy7UZM9S6TLIdAamySTclZdYhFhRHloGYg7mgZv1Zzztvgud7V1tbQ2twYA34LJmF4p5dXF1KTufnE+SxeJtuCZNsLDCQU0+RyKTF27Unw101l8e6hns3u0PBalORVVVkcaEKBJDgV3+cGM4tKKmI+ohlIGnygKX00rSBfszz/n2uXv81wd6+rt1orsZCHRdr1Imk2F2Kob3hutSxW8thsd8AXNaln9D7CTfA6O+0UgkMuwVvEFFUbbAcrkcTA8+AtOk8E6KiQiDmMFSDqZItAzEVQviRkdDdaFgPp8HSZKAEAL5Qh7Sq2lIJBJwv2scUqkUnKoZgNhcDKhKg5aH+1IkcouCAdFGAQsuWZYhOjwFHQ96oagWgRoUov1T9kRBEODAwxM2QtEUl+Wp+Ln9VRo6BcMw4ErHRYjH4/B26AlQoQQTRdHWwcd9AH57+UAXddvDD37DmrBBV34WfqiXPl61g+vr6xA9zsGeM9gOdsNXkgpEtTwVvwOklXLKm6+/p5ezwk4B+j6droBs2CsGa/gNs6RIxazl4Tc25mpTgw/apPR1LYlNRFAzgsOxkyXYLIM1V8NMwyAkJSctD1eGVKiq5wWjSPdjmeTkiKvVW4f2YPHWl3GAVq6ymcyCTgovM3FzyRiDe2TaKcEKsLpJvNHjZgPNqEtyi6mZIm4SRFyLMUsONSSdkPeFtY1n0mczoY3BHTLhwPRy9/lzcziCw9ACI+yql0VLzcGAZbYSM5CCSZg1/9oc/nn7+i8N9p/8An4JMADxhH+xHfuiKwAAAABJRU5ErkJggg==)"},info:{color:"#3A87AD","background-color":"#D9EDF7","border-color":"#BCE8F1","background-image":"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3QYFAhkSsdes/QAAA8dJREFUOMvVlGtMW2UYx//POaWHXg6lLaW0ypAtw1UCgbniNOLcVOLmAjHZolOYlxmTGXVZdAnRfXQm+7SoU4mXaOaiZsEpC9FkiQs6Z6bdCnNYruM6KNBw6YWewzl9z+sHImEWv+vz7XmT95f/+3/+7wP814v+efDOV3/SoX3lHAA+6ODeUFfMfjOWMADgdk+eEKz0pF7aQdMAcOKLLjrcVMVX3xdWN29/GhYP7SvnP0cWfS8caSkfHZsPE9Fgnt02JNutQ0QYHB2dDz9/pKX8QjjuO9xUxd/66HdxTeCHZ3rojQObGQBcuNjfplkD3b19Y/6MrimSaKgSMmpGU5WevmE/swa6Oy73tQHA0Rdr2Mmv/6A1n9w9suQ7097Z9lM4FlTgTDrzZTu4StXVfpiI48rVcUDM5cmEksrFnHxfpTtU/3BFQzCQF/2bYVoNbH7zmItbSoMj40JSzmMyX5qDvriA7QdrIIpA+3cdsMpu0nXI8cV0MtKXCPZev+gCEM1S2NHPvWfP/hL+7FSr3+0p5RBEyhEN5JCKYr8XnASMT0xBNyzQGQeI8fjsGD39RMPk7se2bd5ZtTyoFYXftF6y37gx7NeUtJJOTFlAHDZLDuILU3j3+H5oOrD3yWbIztugaAzgnBKJuBLpGfQrS8wO4FZgV+c1IxaLgWVU0tMLEETCos4xMzEIv9cJXQcyagIwigDGwJgOAtHAwAhisQUjy0ORGERiELgG4iakkzo4MYAxcM5hAMi1WWG1yYCJIcMUaBkVRLdGeSU2995TLWzcUAzONJ7J6FBVBYIggMzmFbvdBV44Corg8vjhzC+EJEl8U1kJtgYrhCzgc/vvTwXKSib1paRFVRVORDAJAsw5FuTaJEhWM2SHB3mOAlhkNxwuLzeJsGwqWzf5TFNdKgtY5qHp6ZFf67Y/sAVadCaVY5YACDDb3Oi4NIjLnWMw2QthCBIsVhsUTU9tvXsjeq9+X1d75/KEs4LNOfcdf/+HthMnvwxOD0wmHaXr7ZItn2wuH2SnBzbZAbPJwpPx+VQuzcm7dgRCB57a1uBzUDRL4bfnI0RE0eaXd9W89mpjqHZnUI5Hh2l2dkZZUhOqpi2qSmpOmZ64Tuu9qlz/SEXo6MEHa3wOip46F1n7633eekV8ds8Wxjn37Wl63VVa+ej5oeEZ/82ZBETJjpJ1Rbij2D3Z/1trXUvLsblCK0XfOx0SX2kMsn9dX+d+7Kf6h8o4AIykuffjT8L20LU+w4AZd5VvEPY+XpWqLV327HR7DzXuDnD8r+ovkBehJ8i+y8YAAAAASUVORK5CYII=)"},warn:{color:"#C09853","background-color":"#FCF8E3","border-color":"#FBEED5","background-image":"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAMAAAC6V+0/AAABJlBMVEXr6eb/2oD/wi7/xjr/0mP/ykf/tQD/vBj/3o7/uQ//vyL/twebhgD/4pzX1K3z8e349vK6tHCilCWbiQymn0jGworr6dXQza3HxcKkn1vWvV/5uRfk4dXZ1bD18+/52YebiAmyr5S9mhCzrWq5t6ufjRH54aLs0oS+qD751XqPhAybhwXsujG3sm+Zk0PTwG6Shg+PhhObhwOPgQL4zV2nlyrf27uLfgCPhRHu7OmLgAafkyiWkD3l49ibiAfTs0C+lgCniwD4sgDJxqOilzDWowWFfAH08uebig6qpFHBvH/aw26FfQTQzsvy8OyEfz20r3jAvaKbhgG9q0nc2LbZxXanoUu/u5WSggCtp1anpJKdmFz/zlX/1nGJiYmuq5Dx7+sAAADoPUZSAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfdBgUBGhh4aah5AAAAlklEQVQY02NgoBIIE8EUcwn1FkIXM1Tj5dDUQhPU502Mi7XXQxGz5uVIjGOJUUUW81HnYEyMi2HVcUOICQZzMMYmxrEyMylJwgUt5BljWRLjmJm4pI1hYp5SQLGYxDgmLnZOVxuooClIDKgXKMbN5ggV1ACLJcaBxNgcoiGCBiZwdWxOETBDrTyEFey0jYJ4eHjMGWgEAIpRFRCUt08qAAAAAElFTkSuQmCC)"}}}); \ No newline at end of file diff --git a/dist/notify.js b/dist/notify.js index 6213547..8e726ea 100644 --- a/dist/notify.js +++ b/dist/notify.js @@ -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: "
\n
\n
\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 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; }); }); diff --git a/dist/notify.min.js b/dist/notify.min.js index 93f232d..2026c68 100644 --- a/dist/notify.min.js +++ b/dist/notify.min.js @@ -1,5 +1,5 @@ -/** 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 */ -(function(t,n,i,e){"use strict";var r,o,s,a,h,l,c,u,p,d,f,m,w,y,g,b,v,x,S,P,N,k,C,H,T,A,M,j=[].indexOf||function(t){for(var n=0,i=this.length;i>n;n++)if(n in this&&this[n]===t)return n;return-1};N="notify",P=N+"js",s=N+"!blank",C={t:"top",m:"middle",b:"bottom",l:"left",c:"center",r:"right"},w=["l","c","r"],M=["t","m","b"],v=["t","b","l","r"],x={t:"b",m:null,b:"t",l:"r",c:null,r:"l"},S=function(t){var n;return n=[],i.each(t.split(/\W+/),function(t,i){var r;return r=i.toLowerCase().charAt(0),C[r]?n.push(r):e}),n},A={},a={name:"core",html:'
\n
\n
\n
',css:"."+P+"-corner {\n position: fixed;\n margin: 5px;\n z-index: 1050;\n}\n\n."+P+"-corner ."+P+"-wrapper,\n."+P+"-corner ."+P+"-container {\n position: relative;\n display: block;\n height: inherit;\n width: inherit;\n margin: 3px;\n}\n\n."+P+"-wrapper {\n z-index: 1;\n position: absolute;\n display: inline-block;\n height: 0;\n width: 0;\n}\n\n."+P+"-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."+P+"-arrow {\n position: absolute;\n z-index: 2;\n width: 0;\n height: 0;\n}"},T={"border-radius":["-webkit-","-moz-"]},f=function(t){return A[t]},o=function(n,e){var r,o,s,a;if(!n)throw"Missing Style name";if(!e)throw"Missing Style definition";if(!e.html)throw"Missing Style HTML";return(null!=(a=A[n])?a.cssElem:void 0)&&(t.console&&console.warn(""+N+": overwriting style '"+n+"'"),A[n].cssElem.remove()),e.name=n,A[n]=e,r="",e.classes&&i.each(e.classes,function(t,n){return r+="."+P+"-"+e.name+"-"+t+" {\n",i.each(n,function(t,n){return T[t]&&i.each(T[t],function(i,e){return r+=" "+e+t+": "+n+";\n"}),r+=" "+t+": "+n+";\n"}),r+="}\n"}),e.css&&(r+="/* styles for "+e.name+" */\n"+e.css),r&&(e.cssElem=b(r),e.cssElem.attr("id","notify-"+e.name)),s={},o=i(e.html),p("html",o,s),p("text",o,s),e.fields=s},b=function(t){var n;n=h("style"),n.attr("type","text/css"),i("head").append(n);try{n.html(t)}catch(e){n[0].styleSheet.cssText=t}return n},p=function(t,n,e){var r;return"html"!==t&&(t="text"),r="data-notify-"+t,u(n,"["+r+"]").each(function(){var n;return n=i(this).attr(r),n||(n=s),e[n]=t})},u=function(t,n){return t.is(n)?t:t.find(n)},k={clickToHide:!0,autoHide:!0,autoHideDelay:5e3,arrowShow:!0,arrowSize:5,breakNewLines:!0,elementPosition:"bottom",globalPosition:"top right",style:"bootstrap",className:"error",showAnimation:"slideDown",showDuration:400,hideAnimation:"slideUp",hideDuration:200,gap:5},g=function(t,n){var e;return e=function(){},e.prototype=t,i.extend(!0,new e,n)},l=function(t){return i.extend(k,t)},h=function(t){return i("<"+t+">")},m={},d=function(t){var n;return t.is("[type=radio]")&&(n=t.parents("form:first").find("[type=radio]").filter(function(n,e){return i(e).attr("name")===t.attr("name")}),t=n.first()),t},y=function(t,n,i){var r,o;if("string"==typeof i)i=parseInt(i,10);else if("number"!=typeof i)return;if(!isNaN(i))return r=C[x[n.charAt(0)]],o=n,t[r]!==e&&(n=C[r.charAt(0)],i=-i),t[n]===e?t[n]=i:t[n]+=i,null},H=function(t,n,i){if("l"===t||"t"===t)return 0;if("c"===t||"m"===t)return i/2-n/2;if("r"===t||"b"===t)return i-n;throw"Invalid alignment"},c=function(t){return c.e=c.e||h("div"),c.e.text(t).html()},r=function(){function t(t,n,e){"string"==typeof e&&(e={className:e}),this.options=g(k,i.isPlainObject(e)?e:{}),this.loadHTML(),this.wrapper=i(a.html),this.wrapper.data(P,this),this.arrow=this.wrapper.find("."+P+"-arrow"),this.container=this.wrapper.find("."+P+"-container"),this.container.append(this.userContainer),t&&t.length&&(this.elementType=t.attr("type"),this.originalElement=t,this.elem=d(t),this.elem.data(P,this),this.elem.before(this.wrapper)),this.container.hide(),this.run(n)}return t.prototype.loadHTML=function(){var t;return t=this.getStyle(),this.userContainer=i(t.html),this.userFields=t.fields},t.prototype.show=function(t,n){var i,r,o,s,a,h=this;if(r=function(){return t||h.elem||h.destroy(),n?n():e},a=this.container.parent().parents(":hidden").length>0,o=this.container.add(this.arrow),i=[],a&&t)s="show";else if(a&&!t)s="hide";else if(!a&&t)s=this.options.showAnimation,i.push(this.options.showDuration);else{if(a||t)return r();s=this.options.hideAnimation,i.push(this.options.hideDuration)}return i.push(r),o[s].apply(o,i)},t.prototype.setGlobalPosition=function(){var t,n,e,r,o,s,a,l;return l=this.getPosition(),a=l[0],s=l[1],o=C[a],t=C[s],r=a+"|"+s,n=m[r],n||(n=m[r]=h("div"),e={},e[o]=0,"middle"===t?e.top="45%":"center"===t?e.left="45%":e[t]=0,n.css(e).addClass(""+P+"-corner"),i("body").append(n)),n.prepend(this.wrapper)},t.prototype.setElementPosition=function(){var t,n,r,o,s,a,h,l,c,u,p,d,f,m,g,b,S,P,N,k,T,A,z,D,E,L,O,I,W;for(z=this.getPosition(),k=z[0],P=z[1],N=z[2],p=this.elem.position(),l=this.elem.outerHeight(),d=this.elem.outerWidth(),c=this.elem.innerHeight(),u=this.elem.innerWidth(),D=this.wrapper.position(),s=this.container.height(),a=this.container.width(),m=C[k],b=x[k],S=C[b],h={},h[S]="b"===k?l:"r"===k?d:0,y(h,"top",p.top-D.top),y(h,"left",p.left-D.left),W=["top","left"],E=0,O=W.length;O>E;E++)T=W[E],g=parseInt(this.elem.css("margin-"+T),10),g&&y(h,T,g);if(f=Math.max(0,this.options.gap-(this.options.arrowShow?r:0)),y(h,S,f),this.options.arrowShow){for(r=this.options.arrowSize,n=i.extend({},h),t=this.userContainer.css("border-color")||this.userContainer.css("background-color")||"white",L=0,I=v.length;I>L;L++)T=v[L],A=C[T],T!==b&&(o=A===m?t:"transparent",n["border-"+A]=""+r+"px solid "+o);y(h,C[b],r),j.call(v,P)>=0&&y(n,C[P],2*r)}else this.arrow.hide();return j.call(M,k)>=0?(y(h,"left",H(P,a,d)),n&&y(n,"left",H(P,r,u))):j.call(w,k)>=0&&(y(h,"top",H(P,s,l)),n&&y(n,"top",H(P,r,c))),this.container.is(":visible")&&(h.display="block"),this.container.removeAttr("style").css(h),n?this.arrow.removeAttr("style").css(n):e},t.prototype.getPosition=function(){var t,n,i,e,r,o,s,a;if(n=this.options.position||(this.elem?this.options.elementPosition:this.options.globalPosition),t=S(n),0===t.length&&(t[0]="b"),i=t[0],0>j.call(v,i))throw"Must be one of ["+v+"]";return(1===t.length||(e=t[0],j.call(M,e)>=0&&(r=t[1],0>j.call(w,r)))||(o=t[0],j.call(w,o)>=0&&(s=t[1],0>j.call(M,s))))&&(t[1]=(a=t[0],j.call(w,a)>=0?"m":"l")),2===t.length&&(t[2]=t[1]),t},t.prototype.getStyle=function(t){var n;if(t||(t=this.options.style),t||(t="default"),n=A[t],!n)throw"Missing style: "+t;return n},t.prototype.updateClasses=function(){var t,n;return t=["base"],i.isArray(this.options.className)?t=t.concat(this.options.className):this.options.className&&t.push(this.options.className),n=this.getStyle(),t=i.map(t,function(t){return""+P+"-"+n.name+"-"+t}).join(" "),this.userContainer.attr("class",t)},t.prototype.run=function(t,n){var r,o,a,h,l,p=this;if(i.isPlainObject(n)?i.extend(this.options,n):"string"===i.type(n)&&(this.options.className=n),this.container&&!t)return this.show(!1),e;if(this.container||t){o={},i.isPlainObject(t)?o=t:o[s]=t;for(a in o)r=o[a],h=this.userFields[a],h&&("text"===h&&(r=c(r),this.options.breakNewLines&&(r=r.replace(/\n/g,"
"))),l=a===s?"":"="+a,u(this.userContainer,"[data-notify-"+h+l+"]").html(r));return this.updateClasses(),this.elem?this.setElementPosition():this.setGlobalPosition(),this.show(!0),this.options.autoHide?(clearTimeout(this.autohideTimer),this.autohideTimer=setTimeout(function(){return p.show(!1)},this.options.autoHideDelay)):e}},t.prototype.destroy=function(){return this.wrapper.remove()},t}(),i[N]=function(t,n,e){return t&&t.nodeName||t.jquery?i(t)[N](n,e):(e=n,n=t,new r(null,n,e)),t},i.fn[N]=function(t,n){return i(this).each(function(){var e;return e=d(i(this)).data(P),e?e.run(t,n):new r(i(this),t,n)}),this},i.extend(i[N],{defaults:l,addStyle:o,pluginOptions:k,getStyle:f,insertCSS:b}),i(function(){return b(a.css).attr("id","core-notify"),i(n).on("click notify-hide","."+P+"-wrapper",function(t){var n;return n=i(this).data(P),n&&(n.options.clickToHide||"notify-hide"===t.type)?n.show(!1):e})})})(window,document,jQuery); \ No newline at end of file +(function(t,i,n,e){"use strict";var r,o,s,a,h,l,c,u,p,d,f,m,w,y,g,b,v,x,S,P,C,N,k,H,T,A,M,j=[].indexOf||function(t){for(var i=0,n=this.length;n>i;i++)if(i in this&&this[i]===t)return i;return-1};C="notify",P=C+"js",s=C+"!blank",k={t:"top",m:"middle",b:"bottom",l:"left",c:"center",r:"right"},w=["l","c","r"],M=["t","m","b"],v=["t","b","l","r"],x={t:"b",m:null,b:"t",l:"r",c:null,r:"l"},S=function(t){var i;return i=[],n.each(t.split(/\W+/),function(t,n){var r;return r=n.toLowerCase().charAt(0),k[r]?i.push(r):e}),i},A={},a={name:"core",html:'
\n
\n
\n
',css:"."+P+"-corner {\n position: fixed;\n margin: 5px;\n z-index: 1050;\n}\n\n."+P+"-corner ."+P+"-wrapper,\n."+P+"-corner ."+P+"-container {\n position: relative;\n display: block;\n height: inherit;\n width: inherit;\n margin: 3px;\n}\n\n."+P+"-wrapper {\n z-index: 1;\n position: absolute;\n display: inline-block;\n height: 0;\n width: 0;\n}\n\n."+P+"-container {\n display: none;\n z-index: 1;\n position: absolute;\n}\n\n."+P+"-hidable {\n cursor: pointer;\n}\n\n[data-notify-text],[data-notify-html] {\n position: relative;\n}\n\n."+P+"-arrow {\n position: absolute;\n z-index: 2;\n width: 0;\n height: 0;\n}"},T={"border-radius":["-webkit-","-moz-"]},f=function(t){return A[t]},o=function(i,e){var r,o,s,a;if(!i)throw"Missing Style name";if(!e)throw"Missing Style definition";if(!e.html)throw"Missing Style HTML";return(null!=(a=A[i])?a.cssElem:void 0)&&(t.console&&console.warn(""+C+": overwriting style '"+i+"'"),A[i].cssElem.remove()),e.name=i,A[i]=e,r="",e.classes&&n.each(e.classes,function(t,i){return r+="."+P+"-"+e.name+"-"+t+" {\n",n.each(i,function(t,i){return T[t]&&n.each(T[t],function(n,e){return r+=" "+e+t+": "+i+";\n"}),r+=" "+t+": "+i+";\n"}),r+="}\n"}),e.css&&(r+="/* styles for "+e.name+" */\n"+e.css),r&&(e.cssElem=b(r),e.cssElem.attr("id","notify-"+e.name)),s={},o=n(e.html),p("html",o,s),p("text",o,s),e.fields=s},b=function(t){var i;i=h("style"),i.attr("type","text/css"),n("head").append(i);try{i.html(t)}catch(e){i[0].styleSheet.cssText=t}return i},p=function(t,i,e){var r;return"html"!==t&&(t="text"),r="data-notify-"+t,u(i,"["+r+"]").each(function(){var i;return i=n(this).attr(r),i||(i=s),e[i]=t})},u=function(t,i){return t.is(i)?t:t.find(i)},N={clickToHide:!0,autoHide:!0,autoHideDelay:5e3,arrowShow:!0,arrowSize:5,breakNewLines:!0,elementPosition:"bottom",globalPosition:"top right",style:"bootstrap",className:"error",showAnimation:"slideDown",showDuration:400,hideAnimation:"slideUp",hideDuration:200,gap:5},g=function(t,i){var e;return e=function(){},e.prototype=t,n.extend(!0,new e,i)},l=function(t){return n.extend(N,t)},h=function(t){return n("<"+t+">")},m={},d=function(t){var i;return t.is("[type=radio]")&&(i=t.parents("form:first").find("[type=radio]").filter(function(i,e){return n(e).attr("name")===t.attr("name")}),t=i.first()),t},y=function(t,i,n){var r,o;if("string"==typeof n)n=parseInt(n,10);else if("number"!=typeof n)return;if(!isNaN(n))return r=k[x[i.charAt(0)]],o=i,t[r]!==e&&(i=k[r.charAt(0)],n=-n),t[i]===e?t[i]=n:t[i]+=n,null},H=function(t,i,n){if("l"===t||"t"===t)return 0;if("c"===t||"m"===t)return n/2-i/2;if("r"===t||"b"===t)return n-i;throw"Invalid alignment"},c=function(t){return c.e=c.e||h("div"),c.e.text(t).html()},r=function(){function t(t,i,e){"string"==typeof e&&(e={className:e}),this.options=g(N,n.isPlainObject(e)?e:{}),this.loadHTML(),this.wrapper=n(a.html),this.options.clickToHide&&this.wrapper.addClass(""+P+"-hidable"),this.wrapper.data(P,this),this.arrow=this.wrapper.find("."+P+"-arrow"),this.container=this.wrapper.find("."+P+"-container"),this.container.append(this.userContainer),t&&t.length&&(this.elementType=t.attr("type"),this.originalElement=t,this.elem=d(t),this.elem.data(P,this),this.elem.before(this.wrapper)),this.container.hide(),this.run(i)}return t.prototype.loadHTML=function(){var t;return t=this.getStyle(),this.userContainer=n(t.html),this.userFields=t.fields},t.prototype.show=function(t,i){var n,r,o,s,a,h=this;if(r=function(){return t||h.elem||h.destroy(),i?i():e},a=this.container.parent().parents(":hidden").length>0,o=this.container.add(this.arrow),n=[],a&&t)s="show";else if(a&&!t)s="hide";else if(!a&&t)s=this.options.showAnimation,n.push(this.options.showDuration);else{if(a||t)return r();s=this.options.hideAnimation,n.push(this.options.hideDuration)}return n.push(r),o[s].apply(o,n)},t.prototype.setGlobalPosition=function(){var t,i,e,r,o,s,a,l;return l=this.getPosition(),a=l[0],s=l[1],o=k[a],t=k[s],r=a+"|"+s,i=m[r],i||(i=m[r]=h("div"),e={},e[o]=0,"middle"===t?e.top="45%":"center"===t?e.left="45%":e[t]=0,i.css(e).addClass(""+P+"-corner"),n("body").append(i)),i.prepend(this.wrapper)},t.prototype.setElementPosition=function(){var t,i,r,o,s,a,h,l,c,u,p,d,f,m,g,b,S,P,C,N,T,A,z,D,E,L,O,I,W;for(z=this.getPosition(),N=z[0],P=z[1],C=z[2],p=this.elem.position(),l=this.elem.outerHeight(),d=this.elem.outerWidth(),c=this.elem.innerHeight(),u=this.elem.innerWidth(),D=this.wrapper.position(),s=this.container.height(),a=this.container.width(),m=k[N],b=x[N],S=k[b],h={},h[S]="b"===N?l:"r"===N?d:0,y(h,"top",p.top-D.top),y(h,"left",p.left-D.left),W=["top","left"],E=0,O=W.length;O>E;E++)T=W[E],g=parseInt(this.elem.css("margin-"+T),10),g&&y(h,T,g);if(f=Math.max(0,this.options.gap-(this.options.arrowShow?r:0)),y(h,S,f),this.options.arrowShow){for(r=this.options.arrowSize,i=n.extend({},h),t=this.userContainer.css("border-color")||this.userContainer.css("background-color")||"white",L=0,I=v.length;I>L;L++)T=v[L],A=k[T],T!==b&&(o=A===m?t:"transparent",i["border-"+A]=""+r+"px solid "+o);y(h,k[b],r),j.call(v,P)>=0&&y(i,k[P],2*r)}else this.arrow.hide();return j.call(M,N)>=0?(y(h,"left",H(P,a,d)),i&&y(i,"left",H(P,r,u))):j.call(w,N)>=0&&(y(h,"top",H(P,s,l)),i&&y(i,"top",H(P,r,c))),this.container.is(":visible")&&(h.display="block"),this.container.removeAttr("style").css(h),i?this.arrow.removeAttr("style").css(i):e},t.prototype.getPosition=function(){var t,i,n,e,r,o,s,a;if(i=this.options.position||(this.elem?this.options.elementPosition:this.options.globalPosition),t=S(i),0===t.length&&(t[0]="b"),n=t[0],0>j.call(v,n))throw"Must be one of ["+v+"]";return(1===t.length||(e=t[0],j.call(M,e)>=0&&(r=t[1],0>j.call(w,r)))||(o=t[0],j.call(w,o)>=0&&(s=t[1],0>j.call(M,s))))&&(t[1]=(a=t[0],j.call(w,a)>=0?"m":"l")),2===t.length&&(t[2]=t[1]),t},t.prototype.getStyle=function(t){var i;if(t||(t=this.options.style),t||(t="default"),i=A[t],!i)throw"Missing style: "+t;return i},t.prototype.updateClasses=function(){var t,i;return t=["base"],n.isArray(this.options.className)?t=t.concat(this.options.className):this.options.className&&t.push(this.options.className),i=this.getStyle(),t=n.map(t,function(t){return""+P+"-"+i.name+"-"+t}).join(" "),this.userContainer.attr("class",t)},t.prototype.run=function(t,i){var r,o,a,h,l,p=this;if(n.isPlainObject(i)?n.extend(this.options,i):"string"===n.type(i)&&(this.options.className=i),this.container&&!t)return this.show(!1),e;if(this.container||t){o={},n.isPlainObject(t)?o=t:o[s]=t;for(a in o)r=o[a],h=this.userFields[a],h&&("text"===h&&(r=c(r),this.options.breakNewLines&&(r=r.replace(/\n/g,"
"))),l=a===s?"":"="+a,u(this.userContainer,"[data-notify-"+h+l+"]").html(r));return this.updateClasses(),this.elem?this.setElementPosition():this.setGlobalPosition(),this.show(!0),this.options.autoHide?(clearTimeout(this.autohideTimer),this.autohideTimer=setTimeout(function(){return p.show(!1)},this.options.autoHideDelay)):e}},t.prototype.destroy=function(){return this.wrapper.remove()},t}(),n[C]=function(t,i,e){return t&&t.nodeName||t.jquery?n(t)[C](i,e):(e=i,i=t,new r(null,i,e)),t},n.fn[C]=function(t,i){return n(this).each(function(){var e;return e=d(n(this)).data(P),e?e.run(t,i):new r(n(this),t,i)}),this},n.extend(n[C],{defaults:l,addStyle:o,pluginOptions:N,getStyle:f,insertCSS:b}),n(function(){return b(a.css).attr("id","core-notify"),n(i).on("click","."+P+"-hidable",function(){return n(this).trigger("notify-hide")}),n(i).on("notify-hide","."+P+"-wrapper",function(){var t;return null!=(t=n(this).data(P))?t.show(!1):void 0})})})(window,document,jQuery); \ No newline at end of file diff --git a/docs/Gruntsource.json b/docs/Gruntsource.json index 54660ce..ed68eae 100644 --- a/docs/Gruntsource.json +++ b/docs/Gruntsource.json @@ -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 } \ No newline at end of file diff --git a/docs/css/app.css b/docs/css/app.css index 6e93057..567b9d9 100644 --- a/docs/css/app.css +++ b/docs/css/app.css @@ -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; } diff --git a/docs/js/app.js b/docs/js/app.js index a5d1a7d..ffc54b2 100644 --- a/docs/js/app.js +++ b/docs/js/app.js @@ -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: "
\n
\n
\n
\n
Read my book:
\n
Getting Started with Grunt: The JavaScript Task Runner
\n
Get the first chapter for free!
\n
\n \n \n \n \n
\n
\n
\n
" + }); + $(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 || {}; diff --git a/docs/src/scripts/build-tool.coffee b/docs/src/scripts/build-tool.coffee index 6ee4d0a..2fc32c2 100644 --- a/docs/src/scripts/build-tool.coffee +++ b/docs/src/scripts/build-tool.coffee @@ -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-]+)"/ diff --git a/docs/src/scripts/code-runner.coffee b/docs/src/scripts/code-runner.coffee index bb21a34..f1e94df 100644 --- a/docs/src/scripts/code-runner.coffee +++ b/docs/src/scripts/code-runner.coffee @@ -34,4 +34,32 @@ App.codeRunner = -> $(document).on('click', '.prettyprint.runnable', runSnippet) $(".prettyprint.auto-run").each(runSnippet) - $(".prettyprint.auto-add").each(addCSS) \ No newline at end of file + $(".prettyprint.auto-add").each(addCSS) + + #show gswg ad + $.notify.addStyle 'gswg', + html: """
+
+
+
+
Read my book:
+
Getting Started with Grunt: The JavaScript Task Runner
+
Get the first chapter for free!
+
+ + + + +
+
+
+
+ """ + + $(document).on 'click', '.notifyjs-gswg-base button', -> + $(this).trigger('notify-hide') + + $.notify("http://gswg.io", {position:'b r', style: 'gswg', autoHide: false, clickToHide: false}) + + + diff --git a/docs/src/styles/app.styl b/docs/src/styles/app.styl index c507974..d896470 100644 --- a/docs/src/styles/app.styl +++ b/docs/src/styles/app.styl @@ -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 diff --git a/docs/src/views/index.jade b/docs/src/views/index.jade index 1c0c199..d0f5d26 100644 --- a/docs/src/views/index.jade +++ b/docs/src/views/index.jade @@ -1,9 +1,6 @@ -!!! 5 +doctype html html(lang='en') - dev = env == 'dev' - min = dev ? '' : '.min' - head meta(charset='utf-8') title Notify.js diff --git a/index.html b/index.html index 79e771e..1cf92c9 100644 --- a/index.html +++ b/index.html @@ -7,8 +7,11 @@ - + + Fork me on GitHub
@@ -90,7 +93,6 @@

Global Notifications

- If you don't specify an element, notification will appear in the top left (unless you specify a different position - See Positioning) @@ -166,7 +168,6 @@

Options

- 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:

notifyjs-<style name>-base

-

- - When you use the class name option (className) the class: -

+

When you use the class name option (className) the class:

notifyjs-<style name>-<class name>

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' }); -

- - and you can use the superblue class with: -

+

and you can use the superblue class with:

$.notify('HELLO !!!!', {
   style: 'happyblue',
   className: 'superblue'
@@ -331,10 +326,7 @@ $(document).on('click', '.notifyjs-foo-base .yes', function() {
   $(this).trigger('notify-hide');
 });
 
-

- - Notice there is no classes property defined above. Since the CSS in this example is non-trivial, we'll use an exteral CSS file instead: -

+

Notice there is no classes property defined above. Since the CSS in this example is non-trivial, we'll use an exteral CSS file instead:

Note: you could also convert this CSS code to a JavaScript string and use it with the css property. It's not very readable though it's better for distribution.

.notifyjs-foo-base {
   opacity: 0.85;
@@ -412,9 +404,7 @@ $.notify({
       

Contributing More Styles

-

- - Contributing more styles is easy! +

Contributing more styles is easy!

  1. Click this link
  2. Sign into GitHub (if you're not already)
  3. diff --git a/notify.jquery.json b/notify.jquery.json index 9058edd..f60b4f4 100644 --- a/notify.jquery.json +++ b/notify.jquery.json @@ -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", diff --git a/package.json b/package.json index 15edb84..fd9b8af 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "title": "Notify.js", "name": "notify", - "version": "0.3.1", + "version": "0.3.2", "author": { "name": "Jaime Pillora" }, diff --git a/src/notify.coffee b/src/notify.coffee index 4c21074..65bd52e 100644 --- a/src/notify.coffee +++ b/src/notify.coffee @@ -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