diff --git a/Jinn.OS.js b/Jinn.OS.js index afac1be..aed6f0d 100644 --- a/Jinn.OS.js +++ b/Jinn.OS.js @@ -12,6 +12,8 @@ var api = Jinn['API']['ext']({ '_tpl': '#JinnOSTpl', + '_opt': { 'title': '', 'text': '' }, + 'tpl': function (tpl){ this['_tpl'] = tpl; return this; diff --git a/Jinn.min.js b/Jinn.min.js index dcdc571..6e65cfc 100644 --- a/Jinn.min.js +++ b/Jinn.min.js @@ -9,9 +9,9 @@ NOT_ALLOWED:1,DENIED:2,a:{},_check:function(){return this.i},_request:function(a arguments)},unsay:function(){return this.remove.apply(this,arguments)},bubble:function(){}};var f={API:h,opt:function(a,b){if(b===i)return e[a];e[a]=b;return f},on:function(a,b){j[a]||(j[a]=[]);j[a].push(b);return f},off:function(a,b){if(a in j)for(var c=j[a],d=c.length;d--;)if(c[d]===b){c.splice(d,1);break}return f},emit:function(a,b){f.store("__event."+a,b);r()},scope:function(a,b){var c=f;if(a==i)c=f.scope(e.scope);else if(b!==i)s[a]=b;else if(a in s)c=s[a];else throw'Jinn: scope "'+a+'" is undefined'; return c},e:function(a,b,c){if(a){var d=a.addEventListener?"":"on";a[d?"attachEvent":"addEventListener"](d+b,c,!1)}return f}},l="bubble,access,add,remove,say,unsay".split(","),q=l.length;for(;q--;)(function(a){f[a]=function(){var b=f.scope();return b[a].apply(b,arguments)}})(l[q]);f.store=function(a,b){var c=f,d=f.scope("__store");b===u?d.remove("__jinn."+a):b===i?c=d.get("__jinn."+a):d.set("__jinn."+a,b);return c};(function(a,b){f.scope("__store",{get:function(c){return a?a.getItem(c):b[c]},set:function(c, d){a?a.setItem(c,d):b[c]=d},remove:function(c){delete b[c];a&&a.removeItem(c)}})})(m.localStorage,{});f[(g.match(/webkit/i)||g.match(/opera/i)||g.match(/msie/i)||0>g.indexOf("compatible")&&g.match(/mozilla/i)||[])[0]]=p;f.h&&(f[(g.match(/chrome/i)||g.match(/safari/i)||[])[0]]=p);f.e(m,"storage",r);m.Jinn=f})(window,document); -(function(m,g,i,n){m=i.API.ext({_tpl:"#JinnOSTpl",tpl:function(e){this._tpl=e;return this},add:function(e){this._ext(e);this.access(function(){var g=this._create(e);g.show();e.delay&&setTimeout(function(){g.cancel()},1E3*e.delay);return g})}});if(n)m.methods({_check:function(){return n.checkPermission()},_request:function(e){n.requestPermission(e)},_create:function(e){return n.createNotification(e.icon,e.title,e.text)}});else{var r=/\{\{(.*?)\}\}/g,h=[],k=function(e,h){this.b=g.createElement("div"); -this.b.innerHTML=("#"==e.charAt(0)?g.getElementById(e.substr(1)).innerHTML:e).replace(r,function(e,g){return(new Function("notify,v,u","try{v="+g+'}catch(e){} return v===u?"":v'))(h)});g.body.appendChild(this.b)};k.g=function(){for(var e=5,g=0,i=h.length;g