diff --git a/docs/credits.txt b/docs/credits.txt index 8a5732cd0..06727796d 100644 --- a/docs/credits.txt +++ b/docs/credits.txt @@ -20,6 +20,7 @@ Contributing Developers..............Peter Beardsley / Appropriate Solutions, In Andy Grundman Koen de Jonge / ProcoliX Martin Kamerbeek / ProcoliX + Len Kranendonk Christophe Marcant Tavis Parker / ParkerOne Consulting Daniel Quinlan @@ -45,7 +46,7 @@ to WebGUI, but who's work has made WebGUI possible: Perl.................................Larry Wall / O'Reilly -IE Rich Edit.........................Brattli +Rich Edit............................interactivetools.com Data::Config.........................Sébastien Aperghis-Tramoni diff --git a/docs/upgrades/upgrade_4.8.0-4.9.0.sql b/docs/upgrades/upgrade_4.8.0-4.9.0.sql index a44662add..fb1218b3b 100644 --- a/docs/upgrades/upgrade_4.8.0-4.9.0.sql +++ b/docs/upgrades/upgrade_4.8.0-4.9.0.sql @@ -25,10 +25,9 @@ alter table discussion add column userDefined2 varchar(255); alter table discussion add column userDefined3 varchar(255); alter table discussion add column userDefined4 varchar(255); alter table discussion add column userDefined5 varchar(255); - ---- SMB authentication module ---------------------------------------------- +delete from international where languageId=1 and namespace='WebGUI' and internationalId=495; +insert into international (internationalId,languageId,namespace,message,lastUpdated) values (495,1,'WebGUI','htmlArea (default)', 1038159820); insert into settings (name,value) values ('smbPDC','your PDC'); insert into settings (name,value) values ('smbBDC','your BDC'); insert into settings (name,value) values ('smbDomain','your NT Domain'); ----------------------------------------------------------------------------- diff --git a/lib/WebGUI/Form.pm b/lib/WebGUI/Form.pm index 53de0fb65..96500b58a 100644 --- a/lib/WebGUI/Form.pm +++ b/lib/WebGUI/Form.pm @@ -638,7 +638,7 @@ sub hiddenList { =cut sub HTMLArea { - my ($output, $value); + my ($output, $rows, $columns); $output = ''; if ($session{setting}{richEditor} eq "edit-on-pro") { $output .= ''; } else { - $output .= ''; - } - $output .= ''."
\n"; - $output .= textarea({ - name=>$_[0]->{name}, - value=>$_[0]->{value}, - wrap=>$_[0]->{wrap}, - columns=>$_[0]->{columns}, - rows=>$_[0]->{rows}, - extras=>$_[0]->{extras}.' onBlur="fixChars(this.form.'.$_[0]->{name}.')"' - }); + $output .= ''."\n"; + $output .= ''."\n"; + } + if ($session{setting}{richEditor} ne "built-in") { + $output .= '
'; + } + $rows = $_[0]->{rows} || ($session{setting}{textAreaRows}+7); + $columns = $_[0]->{rows} || ($session{setting}{textAreaCols}+5); + $output .= textarea({ + name=>$_[0]->{name}, + value=>$_[0]->{value}, + wrap=>$_[0]->{wrap}, + columns=>$columns, + rows=>$rows, + extras=>$_[0]->{extras}.' onBlur="fixChars(this.form.'.$_[0]->{name}.')"' + }); + if ($session{setting}{richEditor} eq "built-in") { + $output .= ''."\n"; + } return $output; } diff --git a/lib/WebGUI/Session.pm b/lib/WebGUI/Session.pm index ee42f6ffb..1990a9dcf 100644 --- a/lib/WebGUI/Session.pm +++ b/lib/WebGUI/Session.pm @@ -355,7 +355,8 @@ sub refreshUserInfo { #------------------------------------------------------------------- sub setCookie { my $ttl = $_[2] || '+10y'; - my $domain = $session{env}{SERVER_NAME} if ($session{env}{HTTP_USER_AGENT} =~ m/MSIE/i); + #my $domain = $session{env}{SERVER_NAME} if ($session{env}{HTTP_USER_AGENT} =~ m/MSIE/i); + my $domain; push @{$session{header}{cookie}}, $session{cgi}->cookie( -name=>$_[0], -value=>$_[1], diff --git a/www/extras/colorPicker.gif b/www/extras/colorPicker.gif deleted file mode 100644 index a36307109..000000000 Binary files a/www/extras/colorPicker.gif and /dev/null differ diff --git a/www/extras/colorPicker.html b/www/extras/colorPicker.html deleted file mode 100644 index 18829c301..000000000 --- a/www/extras/colorPicker.html +++ /dev/null @@ -1,364 +0,0 @@ - - -Color Picker - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - diff --git a/www/extras/htmlArea/editor.js b/www/extras/htmlArea/editor.js new file mode 100644 index 000000000..3eb90be25 --- /dev/null +++ b/www/extras/htmlArea/editor.js @@ -0,0 +1,1009 @@ +// +// htmlArea v2.00 - Copyright (c) 2002 interactivetools.com, inc. +// A free WYSIWYG editor replacement for '; + + // add context menu + editor += ''; + + // hide original textarea and insert htmlarea after it + if (!config.debug) { document.all[objname].style.display = "none"; } + document.all[objname].insertAdjacentHTML('afterEnd', editor) + + // convert htmlarea from textarea to wysiwyg editor + editor_setmode(objname, 'init'); + + // call filterOutput when user submits form + for (var idx=0; idx < document.forms.length; idx++) { + var r = document.forms[idx].attachEvent('onsubmit', function() { editor_filterOutput(objname); }); + if (!r) { alert("Error attaching event to form!"); } + } + +} + +/* ---------------------------------------------------------------------- *\ + Function : editor_action + Description : perform an editor command on selected editor content + Usage : + Arguments : button_id - button id string with editor and action name +\* ---------------------------------------------------------------------- */ + +function editor_action(button_id) { + + // split up button name into "editorID" and "cmdID" + var BtnParts = Array(); + BtnParts = button_id.split("_"); + var objname = button_id.replace(/^_(.*)_[^_]*$/, '$1'); + var cmdID = BtnParts[ BtnParts.length-1 ]; + var button_obj = document.all[button_id]; + var editor_obj = document.all["_" +objname + "_editor"]; + var config = document.all[objname].config; + + // help popup + if (cmdID == 'showhelp') { + window.open(_editor_url + "popups/editor_help.html", 'EditorHelp'); + return; + } + + // check editor mode (don't perform actions in textedit mode) + if (editor_obj.tagName.toLowerCase() == 'textarea') { return; } + + var editdoc = editor_obj.contentWindow.document; + editor_focus(editor_obj); + + // get index and value for pulldowns + var idx = button_obj.selectedIndex; + var val = (idx != null) ? button_obj[ idx ].value : null; + + if (0) {} // use else if for easy cutting and pasting + + // + // CUSTOM BUTTONS START HERE + // + + // Custom1 + else if (cmdID == 'custom1') { + alert("Hello, I am custom button 1!"); + } + + // Custom2 + else if (cmdID == 'Macros') { // insert some text from a popup window + var myTitle = "Insert WebGUI macro"; + var myText = showModalDialog(_editor_url + "popups/macros.html", + myTitle, // str or obj specified here can be read from dialog as "window.dialogArguments" + "resizable: yes; help: no; status: no; scroll: no; "); + if (myText) { editor_insertHTML(objname, myText); } + } + + // Custom3 + else if (cmdID == 'custom3') { // insert some text + editor_insertHTML(objname, "It's easy to add buttons that insert text!"); + } + + // + // END OF CUSTOM BUTTONS + // + + // popup editor + else if (cmdID == 'popupeditor') { + showModalDialog(_editor_url + "popups/fullscreen.html?"+objname, window, "resizable: yes; help: no; status: no; scroll: no; "); + } + + // FontName + else if (cmdID == 'FontName' && val) { + editdoc.execCommand(cmdID,0,val); + } + + // FontSize + else if (cmdID == 'FontSize' && val) { + editdoc.execCommand(cmdID,0,val); + } + + // FontStyle (change CSS className) + else if (cmdID == 'FontStyle' && val) { + editdoc.execCommand('RemoveFormat'); + editdoc.execCommand('FontName',0,'636c6173734e616d6520706c616365686f6c646572'); + var fontArray = editdoc.all.tags("FONT"); + for (i=0; i 0) { return setTimeout(function(){ editor_event(objname); }, runDelay); } + + // don't execute more than 3 times a second (eg: too soon after last execution) + if (this.tooSoon == 1 && runDelay >= 0) { this.queue = 1; return; } // queue all but urgent events + this.tooSoon = 1; + setTimeout(function(){ + this.tooSoon = 0; + if (this.queue) { editor_event(objname,-1); }; + this.queue = 0; + }, 333); // 1/3 second + + + editor_updateOutput(objname); + editor_updateToolbar(objname); + +} + +/* ---------------------------------------------------------------------- *\ + Function : editor_updateToolbar + Description : update toolbar state + Usage : + Arguments : objname - ID of textarea to replace + action - enable, disable, or update (default action) +\* ---------------------------------------------------------------------- */ + +function editor_updateToolbar(objname,action) { + var config = document.all[objname].config; + var editor_obj = document.all["_" +objname+ "_editor"]; + + // disable or enable toolbar + + if (action == "enable" || action == "disable") { + var tbItems = new Array('FontName','FontSize','FontStyle'); // add pulldowns + for (var btnName in config.btnList) { tbItems.push(config.btnList[btnName][0]); } // add buttons + + for (var idxN in tbItems) { + var cmdID = tbItems[idxN].toLowerCase(); + var tbObj = document.all["_" +objname+ "_" +tbItems[idxN]]; + if (cmdID == "htmlmode" || cmdID == "about" || cmdID == "showhelp") { continue; } // don't change these buttons + if (tbObj == null) { continue; } + var isBtn = (tbObj.tagName.toLowerCase() == "button") ? true : false; + + if (action == "enable") { tbObj.disabled = false; if (isBtn) { tbObj.className = 'btn' }} + if (action == "disable") { tbObj.disabled = true; if (isBtn) { tbObj.className = 'btnNA' }} + } + return; + } + + // update toolbar state + + if (editor_obj.tagName.toLowerCase() == 'textarea') { return; } // don't update state in textedit mode + var editdoc = editor_obj.contentWindow.document; + + // Set FontName pulldown + var fontname_obj = document.all["_" +objname+ "_FontName"]; + if (fontname_obj) { + var fontname = editdoc.queryCommandValue('FontName'); + if (fontname == null) { fontname_obj.value = null; } + else { + var found = 0; + for (i=0; i