aboutsummaryrefslogtreecommitdiff
path: root/simpleSigning/src/main/resources/js/jquery.modalDialogContent.js
diff options
context:
space:
mode:
Diffstat (limited to 'simpleSigning/src/main/resources/js/jquery.modalDialogContent.js')
-rw-r--r--simpleSigning/src/main/resources/js/jquery.modalDialogContent.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/simpleSigning/src/main/resources/js/jquery.modalDialogContent.js b/simpleSigning/src/main/resources/js/jquery.modalDialogContent.js
new file mode 100644
index 0000000..faa8167
--- /dev/null
+++ b/simpleSigning/src/main/resources/js/jquery.modalDialogContent.js
@@ -0,0 +1,4 @@
+/*! skinny.js v0.1.0 | Copyright 2013 Vistaprint | vistaprint.github.io/SkinnyJS/LICENSE
+http://vistaprint.github.io/SkinnyJS/download-builder.html?modules=jquery.modalDialogContent*/
+
+!function(a){a.modalDialog=a.modalDialog||{};var b,c=a.modalDialog._ua=function(){var a=navigator.userAgent;return a.indexOf("MSIE 7.0")>0?{ie:!0,ie7:!0,version:7,compat:a.indexOf("compatible")>0}:a.indexOf("MSIE 8.0")>0?{ie:!0,ie8:!0,version:8,compat:a.indexOf("compatible")>0}:{}}();a.modalDialog.setSmallScreen=function(a){b=a},a.modalDialog.isSmallScreen=function(){if("undefined"!=typeof b)return b;if(c.ie7||c.ie8)return!1;var d=a(window).width();return("number"==typeof window.orientation?Math.min(d,a(window).height()):d)<=480}}(jQuery),function(a){var b="data-dialog-",c=function(a){if(Object.keys)return Object.keys(a);var b=[];for(var c in a)a.hasOwnProperty(c)&&(b[b.length]=c);return b},d=function(a){return""===a?a:a||null},e=function(a){if(a)switch(a=a.toString().toLowerCase()){case"true":case"yes":case"1":return!0}return!1},f=function(a){return a?new Function("event",a):null},g={title:d,onopen:f,onbeforeopen:f,onclose:f,onbeforeclose:f,maxWidth:parseInt,initialHeight:parseInt,ajax:e,onajaxerror:f,destroyOnClose:e,skin:d,enableHistory:e,zIndex:parseInt};a.modalDialog=a.modalDialog||{},a.modalDialog.getSettings=function(d){var e={};return a.each(c(g),function(a,c){var f=d.attr(b+c);if("undefined"!=typeof f){var h=g[c];e[c]=h(f)}}),e}}(jQuery),function(a){if(a.modalDialog&&a.modalDialog._isHost)throw new Error("Attempt to load jquery.modalDialogContent.js in the same window as jquery.modalDialog.js.");var b=-1,c="dialog",d=function(){return b++,c+b},e=function(b){this.eventType=b,this.callbacks=new a.Callbacks;for(var c=1;c<arguments.length;c++)this.callbacks.add(arguments[c])};e.prototype={fire:function(b){var c=new a.Event(this.eventType);return a.extend(c,b),this.callbacks.fire(c),c},add:function(a){a&&this.callbacks.add(a)}};var f=function(a,b){var c="on"+b;a[c]=new e(b,a.settings[c]),delete a.settings[c]},g=function(a){if(this.settings=a,f(this,"open"),f(this,"close"),f(this,"beforeclose"),this.settings._window){this._window=a._window,delete a._window,this.settings._fullId=this._window.name;var b=this.settings._fullId.split("_");b.pop(),b.length>0&&(this.settings.parentId=b.join("_"),this._parentWindow=parent.frames[this.settings.parentId])}else this.settings._parentWindow&&(this.settings.parentId=a._parentWindow.name,this._parentWindow=a._parentWindow,delete a._parentWindow,this.settings._fullId=this.settings.parentId+"_"+d(),this._postCommandToParent("create",this.settings))};g.prototype={dialogType:"iframe",open:function(){this._postCommandToParent("open")},close:function(){this._postCommandToParent("close")},getParent:function(){return"undefined"==typeof this._parentDialog&&(this._parentDialog=null,this.settings.parentId&&(this._parentDialog=new g({_window:parent.frames[this.settings.parentId]}))),this._parentDialog},getWindow:function(){return this._window||(this._window=this._window||parent.frames[this.settings._fullId]),this._window},setHeight:function(b,c,d){if(a.modalDialog.autoSizing&&!this._internalCall)throw new Error("Auto sizing is enabled, so manual size setting is disallowed.");b=Math.round(b),this._currentFrameHeight&&this._currentFrameHeight==b||(this._currentFrameHeight=b,this._postCommandToParent("setHeight",{height:b,center:!!c,skipAnimation:!!d}))},setHeightFromContent:function(b,c){var d;if(a.modalDialog.sizeElement){var e=a.modalDialog.sizeElement.clientRect();d=e.top+e.height}else d=a(window).contentSize().height;this.setHeight(d,b,c)},_setHeightFromContentInternal:function(){this._internalCall=!0,this.setHeightFromContent.apply(this,arguments),this._internalCall=!1},center:function(){this._postCommandToParent("center")},setTitle:function(a){this._postCommandToParent("setTitle",{title:a})},setTitleFromContent:function(){this.setTitle(document.title)},notifyReady:function(){a.modalDialog.sizeElement&&(a.modalDialog.sizeElement instanceof jQuery||(a.modalDialog.sizeElement=a(a.modalDialog.sizeElement)),0===a.modalDialog.sizeElement.length&&(a.modalDialog.sizeElement=null)),a.modalDialog.useTitleTag&&this.setTitleFromContent(),this._setHeightFromContentInternal(!1,!0);var b=document.location.protocol+"//"+document.location.hostname;document.location.port&&(b+=":"+document.location.port),this._postCommandToParent("notifyReady",{hostname:b}),a.modalDialog.autoSizing&&this.enableAutoSizing()},enableAutoSizing:function(b){"undefined"==typeof b&&(b=!0),b?this._autoSizeInterval=setInterval(a.proxy(function(){this._setHeightFromContentInternal(!1,!0)},this),100):this._autoSizeInterval&&window.clearInterval(this._autoSizeInterval)},postMessageToParent:function(b){if("undefined"==typeof this._postMessageDirect)try{this._postMessageDirect=parent._dialogReceiveMessageManual,this._postMessageDirect||(this._postMessageDirect=null)}catch(c){this._postMessageDirect=null}if(this._postMessageDirect)this._postMessageDirect(b,document.location.protocol+"//"+document.location.host);else{if(!a.modalDialog.parentHostName)throw new Error("Must specify $.modalDialog.parentHostName because the parent is in a different domain");a.postMessage?a.postMessage(b,a.modalDialog.parentHostName,parent):parent.postMessage(b,a.modalDialog.parentHostName)}},_postCommandToParent:function(b,c){var d={dialogCmd:b,_fullId:this.settings._fullId};c&&a.extend(d,c);var e=a.param(d);this.postMessageToParent(e)},_trigger:function(a,b){var c=this["on"+a];c&&c.fire(b)}};var h={};a.modalDialog=a.modalDialog||{},a.modalDialog._isContent=!0,a.modalDialog.manualNotifyReady=!1,a.modalDialog.sizeElement=".dialog-content-size",a.modalDialog.autoSizing=!0,a.modalDialog.parentHostName=null,a.modalDialog.useTitleTag=!0,a.modalDialog.create=function(b){b=a.extend({},b),b._parentWindow=window;var c=new g(b);return h[c.settings._fullId]=c,c},a.modalDialog.getCurrent=function(){if(0!==window.name.indexOf("dialog"))return null;var a=i(window.name);return a||(a=new g({_window:window}),h[window.name]=a),a};var i=function(a){return h[a]},j={setHeightFromContent:function(a,b){a.setHeightFromContent("true"===b.center,"true"===b.skipAnimation)},setTitleFromContent:function(a){a.setTitleFromContent()},eventclose:function(a,b){a._trigger("close",b)},eventbeforeclose:function(a,b){a._trigger("beforeclose",b)}},k=function(b){var c;try{c=a.deparam(b.originalEvent?b.originalEvent.data:b.data)}catch(d){}if(c.dialogCmd){var e=j[c.dialogCmd];if(e){var f=null;c._eventDialogId?(f=i(c._eventDialogId),delete c._eventDialogId):f=a.modalDialog.getCurrent(window),f&&e(f,c)}}};a.receiveMessage?a.receiveMessage(k,"*"):a(window).on("message",k),a.mobile&&a.mobile.resetActivePageHeight&&(a.mobile.document.off("pageshow",a.mobile.resetActivePageHeight),a.mobile.window.off("throttledresize",a.mobile.resetActivePageHeight),a(".ui-page").css("min-height",0),a.mobile.resetActivePageHeight=a.noop,a.mobile.focusPage=a.noop),a(window).load(function(){var b=a.modalDialog.getCurrent();b&&(a.modalDialog.manualNotifyReady||b.notifyReady())})}(jQuery),function(a){var b="[data-dialog-main-panel='true']",c="[data-dialog-hide-onopen='true']",d=function(b,c){"iframe"==b.dialogType&&a([window,document]).enableEvent("touchmove touchstart touchend",!c)},e=function(){return window.innerHeight||a(window).height()},f=function(){var d=a(b);0===d.length&&(d=a(c));var f=0,g=0;a.modalDialog.onbeforeopen.add(function(){0===this.level&&(f=a(document).scrollTop(),g=document.body.style.height,d.each(function(b,c){a(c).data("dialog-parent",c.parentNode)}).detach(),document.body.style.height=e()+50+"px",window.scrollTo(0,1))}),a.modalDialog.onopen.add(function(){if(0===this.level){var b=Math.max(this.$container.height(),e())+20;document.body.style.height=b+"px",a(".dialog-background").css({height:b}),window.scrollTo(0,1)}}),a.modalDialog.onclose.add(function(){0===this.level&&(document.body.style.height=g,d.each(function(b,c){a(a(c).data("dialog-parent")).append(c)}),window.scrollTo(0,f))})};a(function(){if(a.modalDialog.isSmallScreen())if(a.modalDialog.veilClass="dialog-veil-opaque",a.modalDialog&&a.modalDialog._isContent){var b=a.modalDialog.getCurrent();b&&a(window).on("load",function(){d(b,!0)})}else a.modalDialog.onopen.add(function(){d(this,!0)}),a.modalDialog.onbeforeclose.add(function(){d(this,!1)}),f()})}(jQuery),function(a){var b="modalDialogUnobtrusive",c=function(c){c.preventDefault();var d=a(c.currentTarget),e=d.attr("data-dialog-url")||d.attr("href");if(!e)throw new Error("no href specified with data-rel='modalDialog'");var f={contentOrUrl:e},g=a.modalDialog.getSettings(d);a.extend(f,g);var h=new a.Event("dialogsettingscreate");if(h.dialogSettings=f,d.trigger(h),!h.isDefaultPrevented()){var i=d.data(b);if(i){var j=a.modalDialog._ensureSettings(f);a.modalDialog._areSettingsEqual(i.settings,j)||(i._destroy(),i=null)}if(!i){if(i=a.modalDialog.create(f),h=new a.Event("dialogcreate"),h.dialogSettings=f,h.dialog=i,d.trigger(h),h.isDefaultPrevented())return;f.destroyOnClose||d.data(b,i)}i.open()}};a(document).on("click","[data-rel='modalDialog']",c),a(document).on("click",".close-dialog",function(b){b.preventDefault(),setTimeout(function(){var b=a.modalDialog.getCurrent();b&&b.close()},0)})}(jQuery);