www-thermferm/jqwidgets/jqxnotification.js

changeset 511
2d1d43c3a2c2
parent 373
f6850e0b5d35
child 617
b216f9d4b917
--- a/www-thermferm/jqwidgets/jqxnotification.js	Fri May 19 16:34:21 2017 +0200
+++ b/www-thermferm/jqwidgets/jqxnotification.js	Sun May 28 14:19:57 2017 +0200
@@ -1,7 +1,7 @@
 /*
-jQWidgets v3.8.0 (2015-Apr)
-Copyright (c) 2011-2015 jQWidgets.
+jQWidgets v4.5.2 (2017-May)
+Copyright (c) 2011-2017 jQWidgets.
 License: http://jqwidgets.com/license/
-*/
-
-(function(a){a.jqx.jqxWidget("jqxNotification","",{});a.extend(a.jqx._jqxNotification.prototype,{defineInstance:function(){var b={width:"auto",height:"auto",appendContainer:null,position:"top-right",zIndex:99999,browserBoundsOffset:5,notificationOffset:5,opacity:0.9,hoverOpacity:1,autoOpen:false,animationOpenDelay:400,animationCloseDelay:800,closeOnClick:true,autoClose:true,autoCloseDelay:3000,showCloseButton:true,template:"info",icon:null,blink:false,disabled:false,rtl:false,events:["open","close","click"]};a.extend(true,this,b);return b},createInstance:function(b){var c=this;c.render();if(c.autoOpen==true){c.open()}},render:function(){var c=this;if(c.host.hasClass("jqx-notification")==false){c.host.addClass(c.toThemeProperty("jqx-rc-all"));c.host.addClass(c.toThemeProperty("jqx-notification"));c.host.css({zIndex:c.zIndex,display:"none",opacity:c.opacity});c._container=c._notificationContainer();c._appendContent();c._setHoverFunctions();c._instances=new Array();c._instanceKey=0;var b=a.data(document.body,"jqxNotifications");if(b==undefined){b=0}a.data(document.body,"jqxNotifications",(b+1))}else{c.refresh()}},refresh:function(b){if(!b){this._appendContent(true)}},open:function(){var c=this;if(c.disabled==false){var b=c.host.clone();b.removeAttr("id");b.width(c.width);b.height(c.height);if(this.width!=null&&this.width.toString().indexOf("%")!=-1){b.css("width",this.width)}if(this.height!=null&&this.height.toString().indexOf("%")!=-1){b.css("height",this.height)}if(!c.appendContainer&&(c.position=="bottom-left"||c.position=="bottom-right")){b.css("margin-top",c.notificationOffset);c._container.prepend(b)}else{b.css("margin-bottom",c.notificationOffset);c._container.append(b)}c._addHandlers(b);b.fadeIn(c.animationOpenDelay,function(){c._raiseEvent("0")});if(c.blink==true){b._blinkInterval=setInterval(function(){b.fadeTo(400,c.opacity/1.5,function(){b.fadeTo(400,c.opacity)})},850)}if(c.autoClose==true){b._autoCloseTimeout=setTimeout(function(){c._close(b)},c.autoCloseDelay)}b._key=c._instanceKey;c._instances[c._instanceKey]=b;c._instanceKey++}},closeAll:function(){var c=this;for(var b=0;b<c._instances.length;b++){if(c._instances[b]){c._close(c._instances[b])}}},closeLast:function(){var c=this;for(var b=c._instances.length;b>=0;b--){if(c._instances[b]){c._close(c._instances[b]);break}}},destroy:function(){var c=this;c.closeAll();c.host.remove();var b=a.data(document.body,"jqxNotifications");a.data(document.body,"jqxNotifications",(b-1));c._destroyContainers(b-1)},propertyChangedHandler:function(c,d,h,f){var e=this;if(f!=h){switch(d){case"width":case"height":var b=h.indexOf&&h.indexOf("%")!=-1;b==undefined?b=false:b=b;var g=f.indexOf&&f.indexOf("%")!=-1;g==undefined?g=false:g=g;if(g!=b){e[d]=h}break;case"appendContainer":case"position":e._container=e._notificationContainer();break;case"browserBoundsOffset":if(!e.appendContainer){e._position(e._container)}break;case"opacity":e.host.css("opacity",f);break;case"showCloseButton":case"template":case"icon":case"rtl":e._appendContent(true);break}}},_raiseEvent:function(h,e){var g=this;var c=g.events[h];var f=new a.Event(c);f.owner=g;f.args=e;try{var b=g.host.trigger(f)}catch(d){}return b},_close:function(b){var c=this;if(c._instances[b._key]){c._instances[b._key]=false;clearInterval(b._blinkInterval);clearTimeout(b._autoCloseTimeout);b.fadeOut(c.animationCloseDelay,function(){c._removeHandlers(b);b.remove();c._raiseEvent("1")})}},_addHandlers:function(b){var d=this;d.addHandler(b,"click.notification"+d.element.id,function(e){d._raiseEvent("2");if(d.closeOnClick==true){d._close(b)}});d.addHandler(b,"mouseenter.notification"+d.element.id,function(e){if(!b._blinkInterval){d.mouseenterFunction(b)}});d.addHandler(b,"mouseleave.notification"+d.element.id,function(e){if(!b._blinkInterval&&b.css("display")!="none"){d.mouseleaveFunction(b)}});if(d.showCloseButton==true){var c=b.find(".jqx-notification-close-button");d.addHandler(c,"click.notification"+d.element.id,function(e){e.stopPropagation();d._close(b)})}},_removeHandlers:function(b){var d=this;d.removeHandler(b,"click.notification"+d.element.id);d.removeHandler(b,"click.mouseenter"+d.element.id);d.removeHandler(b,"click.mouseleave"+d.element.id);var c=b.find(".jqx-notification-close-button");if(c.length>0){d.removeHandler(c,"click.notification"+d.element.id)}},_appendContent:function(g){var j=this;var e;var b=j.host.html();if(!g){e=j.host.children().detach()}if(g){j.host.removeAttr("class");j.host.addClass(j.toThemeProperty("jqx-rc-all"));j.host.addClass(j.toThemeProperty("jqx-notification"))}var m=a("<table class='"+j.toThemeProperty("jqx-notification-table")+"'></table>");var d=a("<tr></tr>");m.append(d);var h=j.rtl?"jqx-notification-content-rtl":"";if(!g){var i=a("<td class='"+j.toThemeProperty("jqx-notification-content")+" "+h+"'></td>")}else{var i=j.host.find(".jqx-notification-content");b=i.html();e=i.detach();if(j.rtl){i.addClass("jqx-notification-content-rtl")}else{i.removeClass("jqx-notification-content-rtl")}}d.html(i);var f=function(){if(j.rtl==false){k.addClass("jqx-notification-icon-ltr");i.before(k)}else{k.addClass("jqx-notification-icon-rtl");i.after(k)}};var k;if(j.template){j.host.addClass("jqx-widget");j.host.addClass("jqx-popup");j.host.addClass("jqx-notification-"+j.template);k=a("<td class='"+j.toThemeProperty("jqx-notification-icon")+" jqx-notification-icon-"+j.template+"'></td>");f()}else{j.host.addClass(j.toThemeProperty("jqx-widget"));j.host.addClass(j.toThemeProperty("jqx-popup"));j.host.addClass(j.toThemeProperty("jqx-fill-state-normal"));if(j.icon){k=a("<td class='"+j.toThemeProperty("jqx-notification-icon")+"'></td>");j.icon.padding=j.icon.padding?parseInt(j.icon.padding):5;k.css({width:(parseInt(j.icon.width)+j.icon.padding),height:j.icon.height,"background-image":"url('"+j.icon.url+"')"});f()}}if(j.showCloseButton==true){var l;if(j.template){l="jqx-notification-close-button jqx-notification-close-button-"+j.template}else{l=j.toThemeProperty("jqx-icon-close")+" "+j.toThemeProperty("jqx-notification-close-button")}var c=a("<td class='"+j.toThemeProperty("jqx-notification-close-button-container")+"'><div class='"+l+" "+j.element.id+"CloseButton' title='Close'></div></td>");if(j.rtl==false){c.find("div").addClass("jqx-notification-close-button-ltr");i.after(c)}else{c.find("div").addClass("jqx-notification-close-button-rtl");i.before(c)}}j.host[0].innerHTML="";j.host.append(m);if(e.length>0){j.host.find(".jqx-notification-content").append(e)}else{j.host.find(".jqx-notification-content").html(b)}},_position:function(b){var e=this;var g;var d;var f;var c;switch(e.position){case"top-right":g="";d=e.browserBoundsOffset;f=e.browserBoundsOffset;c="";break;case"top-left":g=e.browserBoundsOffset;d="";f=e.browserBoundsOffset;c="";break;case"bottom-left":g=e.browserBoundsOffset;d="";f="";c=e.browserBoundsOffset;break;case"bottom-right":g="";d=e.browserBoundsOffset;f="";c=e.browserBoundsOffset;break}b.css({left:g,right:d,top:f,bottom:c})},_notificationContainer:function(){var c=this;var b;if(!c.appendContainer){b=a("#jqxNotificationDefaultContainer-"+c.position);if(b.length==0){a("body").append("<div id='jqxNotificationDefaultContainer-"+c.position+"' class='jqx-notification-container'></div>");b=a("#jqxNotificationDefaultContainer-"+c.position);if(c.width.indexOf&&c.width.indexOf("%")!=-1){b.addClass(c.toThemeProperty("jqx-notification-container-full-width"))}if(c.height.indexOf&&c.height.indexOf("%")!=-1){b.addClass(c.toThemeProperty("jqx-notification-container-full-height"))}c._position(b)}}else{b=a(c.appendContainer);if(b.length==0){throw new Error("jqxNotification: Invalid appendContainer jQuery Selector - "+c.appendContainer+"! Please, check whether the used ID or CSS Class name is correct.")}}return b},_destroyContainers:function(b){if(b==0){a(".jqx-notification-container").remove()}},_setHoverFunctions:function(){var b=this;var c=false;if(a.jqx.browser.browser=="msie"&&a.jqx.browser.version=="9.0"){c=true}if(c==false){b.mouseenterFunction=function(d){d.fadeTo("fast",b.hoverOpacity)};b.mouseleaveFunction=function(d){d.fadeTo("fast",b.opacity)}}else{b.mouseenterFunction=function(d){d.css("filter","alpha(opacity = "+(b.hoverOpacity*100)+")")};b.mouseleaveFunction=function(d){d.css("filter","alpha(opacity = "+(b.opacity*100)+")")}}}})})(jqxBaseFramework);
\ No newline at end of file
+*/
+!function(a){a.jqx.jqxWidget("jqxNotification","",{}),a.extend(a.jqx._jqxNotification.prototype,{defineInstance:function(){var b={width:"auto",height:"auto",appendContainer:null,position:"top-right",zIndex:99999,browserBoundsOffset:5,notificationOffset:5,opacity:.9,hoverOpacity:1,autoOpen:!1,animationOpenDelay:400,animationCloseDelay:800,closeOnClick:!0,autoClose:!0,autoCloseDelay:3e3,showCloseButton:!0,template:"info",icon:null,blink:!1,disabled:!1,rtl:!1,events:["open","close","click"]};return this===a.jqx._jqxNotification.prototype?b:(a.extend(!0,this,b),b)},createInstance:function(a){var b=this;b.render(),1==b.autoOpen&&b.open()},render:function(){var b=this;if(0==b.host.hasClass("jqx-notification")){b.host.addClass(b.toThemeProperty("jqx-rc-all")),b.host.addClass(b.toThemeProperty("jqx-notification")),b.host.css({zIndex:b.zIndex,display:"none",opacity:b.opacity}),b._container=b._notificationContainer(),b._appendContent(),b._setHoverFunctions(),b._instances=new Array,b._instanceKey=0;var c=a.data(document.body,"jqxNotifications");void 0==c&&(c=0),a.data(document.body,"jqxNotifications",c+1)}else b.refresh()},refresh:function(a){a||this._appendContent(!0)},open:function(){var a=this;if(0==a.disabled){var b=a.host.clone();b.removeAttr("id"),b.width(a.width),b.height(a.height),null!=this.width&&this.width.toString().indexOf("%")!=-1&&b.css("width",this.width),null!=this.height&&this.height.toString().indexOf("%")!=-1&&b.css("height",this.height),a.appendContainer||"bottom-left"!=a.position&&"bottom-right"!=a.position?(b.css("margin-bottom",a.notificationOffset),a._container.append(b)):(b.css("margin-top",a.notificationOffset),a._container.prepend(b)),a._addHandlers(b),b.fadeIn(a.animationOpenDelay,function(){a._raiseEvent("0",{element:b})}),1==a.blink&&(b._blinkInterval=setInterval(function(){b.fadeTo(400,a.opacity/1.5,function(){b.fadeTo(400,a.opacity)})},850)),1==a.autoClose&&(b._autoCloseTimeout=setTimeout(function(){a._close(b)},a.autoCloseDelay)),b._key=a._instanceKey,a._instances[a._instanceKey]=b,a._instanceKey++}},closeAll:function(){for(var a=this,b=0;b<a._instances.length;b++)a._instances[b]&&a._close(a._instances[b])},closeLast:function(){for(var a=this,b=a._instances.length;b>=0;b--)if(a._instances[b]){a._close(a._instances[b]);break}},destroy:function(){var b=this;b.closeAll(),b.host.remove();var c=a.data(document.body,"jqxNotifications");a.data(document.body,"jqxNotifications",c-1),b._destroyContainers(c-1)},propertyChangedHandler:function(a,b,c,d){var e=this;if(d!=c)switch(b){case"width":case"height":var f=c.indexOf&&c.indexOf("%")!=-1;f=void 0!=f&&f;var g=d.indexOf&&d.indexOf("%")!=-1;g=void 0!=g&&g,g!=f&&(e[b]=c);break;case"appendContainer":case"position":e._container=e._notificationContainer();break;case"browserBoundsOffset":e.appendContainer||e._position(e._container);break;case"opacity":e.host.css("opacity",d);break;case"showCloseButton":case"template":case"icon":case"rtl":e._appendContent(!0)}},_raiseEvent:function(b,c){var d=this,e=d.events[b],f=new a.Event(e);f.owner=d,f.args=c;try{var g=d.host.trigger(f)}catch(a){}return g},_close:function(a){var b=this;b._instances[a._key]&&(b._instances[a._key]=!1,clearInterval(a._blinkInterval),clearTimeout(a._autoCloseTimeout),a.fadeOut(b.animationCloseDelay,function(){b._removeHandlers(a),a.remove(),b._raiseEvent("1")}))},_addHandlers:function(a){var b=this;if(b.addHandler(a,"click.notification"+b.element.id,function(c){b._raiseEvent("2"),1==b.closeOnClick&&b._close(a)}),b.addHandler(a,"mouseenter.notification"+b.element.id,function(c){a._blinkInterval||b.mouseenterFunction(a)}),b.addHandler(a,"mouseleave.notification"+b.element.id,function(c){a._blinkInterval||"none"==a.css("display")||b.mouseleaveFunction(a)}),1==b.showCloseButton){var c=a.find(".jqx-notification-close-button");b.addHandler(c,"click.notification"+b.element.id,function(c){c.stopPropagation(),b._close(a)})}},_removeHandlers:function(a){var b=this;b.removeHandler(a,"click.notification"+b.element.id),b.removeHandler(a,"click.mouseenter"+b.element.id),b.removeHandler(a,"click.mouseleave"+b.element.id);var c=a.find(".jqx-notification-close-button");c.length>0&&b.removeHandler(c,"click.notification"+b.element.id)},_appendContent:function(b){var c,d=this,e=d.host.html();b||(c=d.host.children().detach()),b&&(d.host.removeAttr("class"),d.host.addClass(d.toThemeProperty("jqx-rc-all")),d.host.addClass(d.toThemeProperty("jqx-notification")));var f=a("<table class='"+d.toThemeProperty("jqx-notification-table")+"'></table>"),g=a("<tr></tr>");f.append(g);var h=d.rtl?"jqx-notification-content-rtl":"";if(b){var i=d.host.find(".jqx-notification-content");e=i.html(),c=i.detach(),d.rtl?i.addClass("jqx-notification-content-rtl"):i.removeClass("jqx-notification-content-rtl")}else var i=a("<td class='"+d.toThemeProperty("jqx-notification-content")+" "+h+"'></td>");g.html(i);var j,k=function(){0==d.rtl?(j.addClass("jqx-notification-icon-ltr"),i.before(j)):(j.addClass("jqx-notification-icon-rtl"),i.after(j))};if(d.template?(d.host.addClass("jqx-widget"),d.host.addClass("jqx-popup"),d.host.addClass("jqx-notification-"+d.template),j=a("<td class='"+d.toThemeProperty("jqx-notification-icon")+" jqx-notification-icon-"+d.template+"'></td>"),k()):(d.host.addClass(d.toThemeProperty("jqx-widget")),d.host.addClass(d.toThemeProperty("jqx-popup")),d.host.addClass(d.toThemeProperty("jqx-fill-state-normal")),d.icon&&(j=a("<td class='"+d.toThemeProperty("jqx-notification-icon")+"'></td>"),d.icon.padding=d.icon.padding?parseInt(d.icon.padding):5,j.css({width:parseInt(d.icon.width)+d.icon.padding,height:d.icon.height,"background-image":"url('"+d.icon.url+"')"}),k())),1==d.showCloseButton){var l;l=d.template?"jqx-notification-close-button jqx-notification-close-button-"+d.template:d.toThemeProperty("jqx-icon-close")+" "+d.toThemeProperty("jqx-notification-close-button");var m=a("<td class='"+d.toThemeProperty("jqx-notification-close-button-container")+"'><div class='"+l+" "+d.element.id+"CloseButton' title='Close'></div></td>");0==d.rtl?(m.find("div").addClass("jqx-notification-close-button-ltr"),i.after(m)):(m.find("div").addClass("jqx-notification-close-button-rtl"),i.before(m))}d.host[0].innerHTML="",d.host.append(f),c.length>0?d.host.find(".jqx-notification-content").append(c):d.host.find(".jqx-notification-content").html(e)},_position:function(a){var b,c,d,e,f=this;switch(f.position){case"top-right":b="",c=f.browserBoundsOffset,d=f.browserBoundsOffset,e="";break;case"top-left":b=f.browserBoundsOffset,c="",d=f.browserBoundsOffset,e="";break;case"bottom-left":b=f.browserBoundsOffset,c="",d="",e=f.browserBoundsOffset;break;case"bottom-right":b="",c=f.browserBoundsOffset,d="",e=f.browserBoundsOffset}a.css({left:b,right:c,top:d,bottom:e})},_notificationContainer:function(){var b,c=this;if(c.appendContainer){if(b=a(c.appendContainer),0==b.length)throw new Error("jqxNotification: Invalid appendContainer jQuery Selector - "+c.appendContainer+"! Please, check whether the used ID or CSS Class name is correct.")}else b=a("#jqxNotificationDefaultContainer-"+c.position),0==b.length&&(a("body").append("<div id='jqxNotificationDefaultContainer-"+c.position+"' class='jqx-notification-container'></div>"),b=a("#jqxNotificationDefaultContainer-"+c.position),c.width.indexOf&&c.width.indexOf("%")!=-1&&b.addClass(c.toThemeProperty("jqx-notification-container-full-width")),c.height.indexOf&&c.height.indexOf("%")!=-1&&b.addClass(c.toThemeProperty("jqx-notification-container-full-height")),c._position(b));return b},_destroyContainers:function(b){0==b&&a(".jqx-notification-container").remove()},_setHoverFunctions:function(){var b=this,c=!1;"msie"==a.jqx.browser.browser&&"9.0"==a.jqx.browser.version&&(c=!0),0==c?(b.mouseenterFunction=function(a){a.fadeTo("fast",b.hoverOpacity)},b.mouseleaveFunction=function(a){a.fadeTo("fast",b.opacity)}):(b.mouseenterFunction=function(a){a.css("filter","alpha(opacity = "+100*b.hoverOpacity+")")},b.mouseleaveFunction=function(a){a.css("filter","alpha(opacity = "+100*b.opacity+")")})}})}(jqxBaseFramework);
+

mercurial