From 98b682b1f8a27d6de2ec98b0a652836b7ace6006 Mon Sep 17 00:00:00 2001 From: vargenau Date: Mon, 13 Sep 2010 12:41:32 +0000 Subject: [PATCH] Center pop-up windows git-svn-id: svn://svn.code.sf.net/p/phpwiki/code/trunk@7686 96ab9672-09ca-45d6-a79d-3d69d39ca109 --- themes/default/toolbar.css | 26 ++++++++++++++++++++++++++ themes/default/toolbar.js | 33 ++++++++++++++++++++++++++------- 2 files changed, 52 insertions(+), 7 deletions(-) create mode 100644 themes/default/toolbar.css diff --git a/themes/default/toolbar.css b/themes/default/toolbar.css new file mode 100644 index 000000000..e31dfb8b6 --- /dev/null +++ b/themes/default/toolbar.css @@ -0,0 +1,26 @@ +/* + * $Id$ + * + */ + +body { + font-family: Tahoma,Arial,Helvetica,sans-serif; + font-size: 10pt; + background-color: #dddddd; +} + +input { + font-weight: bold; + margin-left: 2px; + margin-right: 2px; +} + +option, td { + font-size: 9pt +} + +#buttons { + background-color: #dddddd; + padding-right: 10px; + width: 180px; +} diff --git a/themes/default/toolbar.js b/themes/default/toolbar.js index a0918a207..7e62c658d 100644 --- a/themes/default/toolbar.js +++ b/themes/default/toolbar.js @@ -1,6 +1,10 @@ // Toolbar JavaScript support functions. Taken from mediawiki // $Id$ +// Some "constants" +var doctype = '\n'; +var cssfile = '' + // Un-trap us from framesets if( window.top != window ) window.top.location = window.location; var pullwin; @@ -36,17 +40,24 @@ function addTagButton(imageFile, speedTip, tagOpen, tagClose, sampleText) { //} // pages is either an array of strings or an array of array(name,value) function showPulldown(title, pages, okbutton, closebutton, fromid) { - height = new String(Math.min(315, 80 + (pages.length * 12))); // 270 or smaller - pullwin = window.open('','','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,height='+height+',width=200'); - pullwin.window.document.write(''+escapeQuotes(title)+''); - pullwin.window.document.write('\n
\n\n
\n'); + pullwin.window.document.writeln('\n
\n\n\n'); pullwin.window.document.close(); return false; } @@ -183,8 +194,16 @@ function undo_enable(bool) { } } function replace() { - replacewin = window.open('','','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,height=90,width=450'); - replacewin.window.document.write(''+msg_repl_title+"
"+msg_repl_search+":
"+msg_repl_replace_with+":
   
"); + var height = 120; + var width = 600; + var h = (screen.height-height)/2; + var w = (screen.width-width)/2; + replacewin = window.open('','','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,top='+h+',left='+w+',height='+height+',width='+width); + replacewin.window.document.writeln(doctype); + replacewin.window.document.writeln('\n\n'+msg_repl_title+''); + replacewin.window.document.writeln(cssfile); + replacewin.window.document.writeln(''); + replacewin.window.document.writeln("\n
\n
\n\n\n\n\n\n\n\n\n\n\n\n\n
"+msg_repl_search+":\n\n\n
"+msg_repl_replace_with+":\n\n\n
\n   \n
\n
\n
\n\n"); replacewin.window.document.close(); return false; } -- 2.45.0