From b51248624c951727ba5713de5da4b49858f6a99b Mon Sep 17 00:00:00 2001 From: JT Smith Date: Sat, 11 Jan 2003 20:07:46 +0000 Subject: [PATCH] Added popup toggle for rich edit. --- lib/WebGUI/Form.pm | 31 ++++++++++++---- lib/WebGUI/HTMLForm.pm | 15 +++++--- lib/WebGUI/Wobject.pm | 6 +++- www/extras/htmlArea/editor.html | 63 +++++++++++++++++++++++++++++++++ www/extras/htmlArea/editor.js | 2 +- 5 files changed, 105 insertions(+), 12 deletions(-) create mode 100644 www/extras/htmlArea/editor.html diff --git a/lib/WebGUI/Form.pm b/lib/WebGUI/Form.pm index 89327e3ec..6f3b17ff0 100644 --- a/lib/WebGUI/Form.pm +++ b/lib/WebGUI/Form.pm @@ -633,6 +633,12 @@ The number of characters tall this form element should be. There should be no re The number of characters wide this form element should be. There should be no reason for anyone to specify this. +=item popupToggle + +Defaults to "0". If set to "1" the rich editor will be a pop-up editor. If set to "0" the rich editor will be inline. + +NOTE: WebGUI uses a great variety of rich editors. Not all of them are capable of inline mode, so even if you leave this set to "0" the editor may be a pop-up anyway. + =back =cut @@ -653,12 +659,25 @@ sub HTMLArea { } else { my $browser = HTTP::BrowserDetect->new($session{env}{HTTP_USER_AGENT}); if ($browser->ie && $browser->version >= 5.5) { - $output .= ''."\n"; - $output .= ''."\n"; - $htmlArea = 1; + if ($_[0]->{popupToggle}) { + $output .= ''; + $output .= $button; + } else { + $output .= ''."\n"; + $output .= ''."\n"; + $htmlArea = 1; + } } elsif ($browser->ie && $browser->version >= 5) { $output .= ' + + + + + + + + +
+
Click here when FINISHED EDITING.
+ + + + + + +
+ +setHTML + + + + +
+ diff --git a/www/extras/htmlArea/editor.js b/www/extras/htmlArea/editor.js index 15b7b86bf..c049f7feb 100644 --- a/www/extras/htmlArea/editor.js +++ b/www/extras/htmlArea/editor.js @@ -51,7 +51,7 @@ this.toolbar = [ ['Macros','separator'], // ['custom1','custom2','custom3','separator'], - ['popupeditor','about']]; + ['popupeditor']]; //,'about']]; this.fontnames = { "Arial": "arial, helvetica, sans-serif",