From ec53149cb0c73674e6599ad626e3c6a8f5e1a279 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Mon, 9 Feb 2009 21:39:39 -0700 Subject: [PATCH] redbox.js is in horde --- imp/js/redbox.js | 1 - imp/js/src/redbox.js | 128 --------------------------------------------------- imp/lib/IMP.php | 4 +- 3 files changed, 2 insertions(+), 131 deletions(-) delete mode 100644 imp/js/redbox.js delete mode 100644 imp/js/src/redbox.js diff --git a/imp/js/redbox.js b/imp/js/redbox.js deleted file mode 100644 index 32e500f52..000000000 --- a/imp/js/redbox.js +++ /dev/null @@ -1 +0,0 @@ -var RedBox={overlay:true,onDisplay:null,showInline:function(a){this.appearWindow();this.cloneWindowContents(a)},showHtml:function(a){this.appearWindow();this.htmlWindowContents(a)},appearWindow:function(){var c=$("RB_loading");if(c&&c.visible()){c.hide()}else{this.showOverlay()}var b={duration:0.4,queue:"end"},a=$("RB_window");if(this.onDisplay){b.afterFinish=this.onDisplay}new Effect.Appear(a,b);a.scrollTo()},loading:function(){this.showOverlay();var a=$("RB_loading");if(a){a.show()}this.setWindowPosition()},close:function(){new Effect.Fade("RB_window",{duration:0.4});if(this.overlay){new Effect.Fade("RB_overlay",{duration:0.4})}},showOverlay:function(){var b=$("RB_redbox");if(!b){b=new Element("DIV",{id:"RB_redbox",align:"center"});$(document.body).insert(b);var a=new Element("DIV",{id:"RB_overlay"}).hide();b.insert({top:new Element("DIV",{id:"RB_window"}).hide()}).insert({top:a});if(this.overlay){a.insert({top:new Element("DIV",{id:"RB_loading"}).hide()})}}if(this.overlay){this.setOverlaySize();new Effect.Appear("RB_overlay",{duration:0.4,to:0.6,queue:"end"})}},setOverlaySize:function(){if(window.innerHeight&&window.scrollMaxY){yScroll=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){yScroll=document.body.scrollHeight}else{yScroll=document.body.offsetHeight}}Element.setStyle("RB_overlay",{height:yScroll+"px"})},setWindowPosition:function(){var b=$("RB_window");var c=b.getDimensions(),a=document.viewport.getDimensions();b.setStyle({width:"auto",height:"auto",left:((a.width-c.width)/2)+"px",top:((a.height-c.height)/2)+"px"})},cloneWindowContents:function(a){$("RB_window").appendChild($($(a).cloneNode(true)).setStyle({display:"block"}));this.setWindowPosition()},htmlWindowContents:function(a){$("RB_window").update(a);this.setWindowPosition()},getWindowContents:function(){var a=$("RB_window");return a.visible()?a.down():null},overlayVisible:function(){var a=$("RB_overlay");return a&&a.visible()}}; \ No newline at end of file diff --git a/imp/js/src/redbox.js b/imp/js/src/redbox.js deleted file mode 100644 index 291b8cead..000000000 --- a/imp/js/src/redbox.js +++ /dev/null @@ -1,128 +0,0 @@ -/** - * Redbox.js - * - * See the enclosed file COPYING for license information (GPL). If you - * did not receive this file, see http://www.fsf.org/copyleft/gpl.html. - */ - -var RedBox = { - - overlay: true, - onDisplay: null, - - showInline: function(id) - { - this.appearWindow(); - this.cloneWindowContents(id); - }, - - showHtml: function(html) - { - this.appearWindow(); - this.htmlWindowContents(html); - }, - - appearWindow: function() - { - var loading = $('RB_loading'); - if (loading && loading.visible()) { - loading.hide(); - } else { - this.showOverlay(); - } - var opts = { duration: 0.4, queue: 'end' }, - w = $('RB_window'); - if (this.onDisplay) { - opts.afterFinish = this.onDisplay; - } - new Effect.Appear(w, opts); - w.scrollTo(); - }, - - loading: function() - { - this.showOverlay(); - var rl = $('RB_loading'); - if (rl) { - rl.show(); - } - this.setWindowPosition(); - }, - - close: function() - { - new Effect.Fade('RB_window', { duration: 0.4 }); - if (this.overlay) { - new Effect.Fade('RB_overlay', { duration: 0.4 }); - } - }, - - showOverlay: function() - { - var rb = $('RB_redbox'); - if (!rb) { - rb = new Element('DIV', { id: 'RB_redbox', align: 'center' }); - $(document.body).insert(rb); - - var ov = new Element('DIV', { id: 'RB_overlay' }).hide(); - rb.insert({ top: new Element('DIV', { id: 'RB_window' }).hide() }).insert({ top: ov }); - - if (this.overlay) { - ov.insert({ top: new Element('DIV', { id: 'RB_loading' }).hide() }); - } - } - - if (this.overlay) { - this.setOverlaySize(); - new Effect.Appear('RB_overlay', { duration: 0.4, to: 0.6, queue: 'end' }); - } - }, - - setOverlaySize: function() - { - if (window.innerHeight && window.scrollMaxY) { - yScroll = window.innerHeight + window.scrollMaxY; - } else if (document.body.scrollHeight > document.body.offsetHeight) { - // all but Explorer Mac - yScroll = document.body.scrollHeight; - } else { - // Explorer Mac...would also work in Explorer 6 Strict, Mozilla - // and Safari - yScroll = document.body.offsetHeight; - } - Element.setStyle('RB_overlay', { height: yScroll + 'px' }); - }, - - setWindowPosition: function() - { - var win = $('RB_window'); - var d = win.getDimensions(), - v = document.viewport.getDimensions(); - win.setStyle({ width: 'auto', height: 'auto', left: ((v.width - d.width) / 2) + 'px', top: ((v.height - d.height) / 2) + 'px' }); - }, - - cloneWindowContents: function(id) - { - $('RB_window').appendChild($($(id).cloneNode(true)).setStyle({ display: 'block' })); - this.setWindowPosition(); - }, - - htmlWindowContents: function(html) - { - $('RB_window').update(html); - this.setWindowPosition(); - }, - - getWindowContents: function() - { - var w = $('RB_window'); - return w.visible() ? w.down() : null; - }, - - overlayVisible: function() - { - var ov = $('RB_overlay'); - return ov && ov.visible(); - } - -} diff --git a/imp/lib/IMP.php b/imp/lib/IMP.php index 4094b71d6..e2378eee1 100644 --- a/imp/lib/IMP.php +++ b/imp/lib/IMP.php @@ -643,8 +643,8 @@ class IMP $prefs->getValue('fetchmail_menu')) { Horde::addScriptFile('prototype.js', 'horde', true); Horde::addScriptFile('effects.js', 'horde', true); + Horde::addScriptFile('redbox.js', 'horde', true); Horde::addScriptFile('dialog.js', 'imp', true); - Horde::addScriptFile('redbox.js', 'imp', true); $js_params = array( 'dialog_load' => Horde::applicationUrl('ajax.php', true, -1) . '/FetchmailDialog' @@ -2058,8 +2058,8 @@ class IMP { Horde::addScriptFile('prototype.js', 'horde', true); Horde::addScriptFile('effects.js', 'horde', true); + Horde::addScriptFile('redbox.js', 'horde', true); Horde::addScriptFile('dialog.js', 'imp', true); - Horde::addScriptFile('redbox.js', 'imp', true); switch ($type) { case 'PGPPersonal': -- 2.11.0