* Fixes and features to htmlArea RTE extension (see details in local ChangeLog)
authorStanislas Rolland <typo3@sjbr.ca>
Fri, 5 May 2006 20:35:09 +0000 (20:35 +0000)
committerStanislas Rolland <typo3@sjbr.ca>
Fri, 5 May 2006 20:35:09 +0000 (20:35 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@1462 709f56b5-9817-0410-a4d7-c38de5d9e867

52 files changed:
ChangeLog
typo3/sysext/rtehtmlarea/ChangeLog
typo3/sysext/rtehtmlarea/class.tx_rtehtmlarea_base.php
typo3/sysext/rtehtmlarea/doc/manual.sxw
typo3/sysext/rtehtmlarea/ext_conf_template.txt
typo3/sysext/rtehtmlarea/ext_emconf.php
typo3/sysext/rtehtmlarea/ext_localconf.php
typo3/sysext/rtehtmlarea/ext_tables.php
typo3/sysext/rtehtmlarea/htmlarea/htmlarea-compressed.js
typo3/sysext/rtehtmlarea/htmlarea/htmlarea-gecko-compressed.js
typo3/sysext/rtehtmlarea/htmlarea/htmlarea-gecko.js
typo3/sysext/rtehtmlarea/htmlarea/htmlarea-ie-compressed.js
typo3/sysext/rtehtmlarea/htmlarea/htmlarea-ie.js
typo3/sysext/rtehtmlarea/htmlarea/htmlarea.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/Acronym/acronym-compressed.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/Acronym/acronym.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/QuickTag/popups/quicktag.html
typo3/sysext/rtehtmlarea/htmlarea/plugins/QuickTag/quick-tag-compressed.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/QuickTag/quick-tag.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/QuickTag/tag-lib.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/SpellChecker/popups/spell-check-ui-iso-8859-1.html
typo3/sysext/rtehtmlarea/htmlarea/plugins/SpellChecker/popups/spell-check-ui.html
typo3/sysext/rtehtmlarea/htmlarea/plugins/SpellChecker/spell-check-ui.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3Browsers/typo3browsers-compressed.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3Browsers/typo3browsers.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3HtmlParser/typo3html-parser-compressed.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3HtmlParser/typo3html-parser.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/TableOperations/table-operations-compressed.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/TableOperations/table-operations.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/UserElements/user-elements-compressed.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/UserElements/user-elements.js
typo3/sysext/rtehtmlarea/htmlarea/popups/popup.js
typo3/sysext/rtehtmlarea/htmlarea/popupwin-compressed.js
typo3/sysext/rtehtmlarea/htmlarea/popupwin.js
typo3/sysext/rtehtmlarea/mod2/acronym.php
typo3/sysext/rtehtmlarea/mod2/class.tx_rtehtmlarea_acronym.php [new file with mode: 0644]
typo3/sysext/rtehtmlarea/mod3/browse_links.php
typo3/sysext/rtehtmlarea/mod3/class.tx_rtehtmlarea_browse_links.php [new file with mode: 0644]
typo3/sysext/rtehtmlarea/mod4/class.tx_rtehtmlarea_dam_browse_media.php [new file with mode: 0644]
typo3/sysext/rtehtmlarea/mod4/class.tx_rtehtmlarea_select_image.php [new file with mode: 0644]
typo3/sysext/rtehtmlarea/mod4/locallang.xml
typo3/sysext/rtehtmlarea/mod4/select_image.php
typo3/sysext/rtehtmlarea/mod5/class.tx_rtehtmlarea_user.php [new file with mode: 0644]
typo3/sysext/rtehtmlarea/mod5/user.php
typo3/sysext/rtehtmlarea/pi1/class.tx_rtehtmlarea_pi1.php
typo3/sysext/rtehtmlarea/pi2/class.tx_rtehtmlarea_pi2.php
typo3/sysext/rtehtmlarea/pi3/class.tx_rtehtmlarea_pi3.php [new file with mode: 0644]
typo3/sysext/rtehtmlarea/res/accessibilityicons/pageTSConfig.txt [new file with mode: 0644]
typo3/sysext/rtehtmlarea/res/clickenlarge/pageTSConfig.txt [new file with mode: 0644]
typo3/sysext/rtehtmlarea/res/demo/pageTSConfig.txt
typo3/sysext/rtehtmlarea/res/image/pageTSConfig.txt
typo3/sysext/rtehtmlarea/static/clickenlarge/setup.txt [new file with mode: 0644]

index d82adc4..b8f1f4b 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2006-05-05  Stanislas Rolland  <stanislas.rolland@fructifor.ca>
+
+       * Fixes and features to htmlArea RTE extension (see details in local ChangeLog)
 
 2006-04-29  Martin Kutschker  <martin.t.kutschker@blackbox.net>
 
index 39026a8..2610728 100644 (file)
@@ -1,3 +1,23 @@
+2006-05-05 Stanislas Rolland  <stanislas.rolland(arobas)fructifor.ca>
+       * Version 1.4.0
+       * Adapt popup windows resizing for Opera 9.
+       * Fix to spell checker for Opera 9.
+       * Add error text to troubleshooting log when attempt to load stylesheets fails.
+       * Improved integration of TYPO3Browsers plugin with TYPO3 core element browser.
+       * Move up attributes setting form in link and image insertion dialogs.
+       * Add support for User TSConfig properties options.createFoldersInEB and options.noThumbsInRTEimageSelect.
+       * Add new Page TSConfig properties disableLinkTagetSelector and disableLinkPopupSelector.
+       * Add new Page TSConfig property toggleBordersOnTableCreation.
+       * Fix bugtracker issue 2026: The editor gets the focus on page load in IE.
+       * Allow to enable the use of images in the Minimal default configuration.
+       * Fix issue 3296: RTEarea frontend usage with no-javascript fallback solution.
+       * Add new Page TSConfig properties buttons.inserttag.denyTags, TSConfig properties buttons.inserttag.allowedAttribs and buttons.inserttag.tags.[tagname].allowedAttribs
+       * Add new Page TSConfig properties buttons.image.options.removeItems, buttons.image.options.magic.maxWidth and buttons.image.options.magic.maxHeight
+       * Add extension configuration variable "Enable links accessibility icons"
+       * Fix bugtraker issue 3410: Updating image in IE doesn't work.
+       * Add extension configuration variable "Enable the DAM media browser" and Page TSConfig property buttons.image.title.useDAMColumn.
+       * Fix bugtracker issue 3006: in IE, link properties were not updated when the link was not completely selected.
+
 2006-04-06 Stanislas Rolland  <stanislas.rolland(arobas)fructifor.ca>
        * Version 1.3.7
        * Fix bugtracker issue 3120: transforming text in link in Firefox may take excessive time.
index ee5b33f..85895f5 100644 (file)
@@ -402,6 +402,13 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
                                // Special configuration and default extras:
                        $this->specConf = $specConf;
                        
+                       if ($this->thisConfig['forceHTTPS']) {
+                               $this->httpTypo3Path = preg_replace('/^(http|https)/', 'https', $this->httpTypo3Path);
+                               $this->extHttpPath = preg_replace('/^(http|https)/', 'https', $this->extHttpPath);
+                               $this->siteURL = preg_replace('/^(http|https)/', 'https', $this->siteURL);
+                               $this->hostURL = preg_replace('/^(http|https)/', 'https', $this->hostURL);
+                       }
+                       
                        /* =======================================
                         * LANGUAGES & CHARACTER SETS
                         * =======================================
@@ -503,10 +510,6 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
                                }
                        }
 
-                       if ($this->isPluginEnable('QuickTag') && trim($this->thisConfig['hideTags'])) {
-                               $this->quickTagHideTags = implode(',', t3lib_div::trimExplode(',', $this->thisConfig['hideTags'], 1));
-                       }
-
                        /* =======================================
                         * SET STYLES
                         * =======================================
@@ -607,8 +610,8 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
                                // Draw the textarea
                        $visibility = 'hidden';
                        $item = $this->triggerField($PA['itemFormElName']).'
-                               <div id="pleasewait' . $pObj->RTEcounter . '" class="pleasewait">' . $LANG->getLL('Please wait') . '</div>
-                               <div id="editorWrap' . $pObj->RTEcounter . '" class="editorWrap" style="visibility:' . $visibility . '; width:' . $editorWrapWidth . '; height:' . $editorWrapHeight . ';">
+                               <div id="pleasewait' . $pObj->RTEcounter . '" class="pleasewait" style="display: none;" >' . $LANG->getLL('Please wait') . '</div>
+                               <div id="editorWrap' . $pObj->RTEcounter . '" class="editorWrap" style="width:' . $editorWrapWidth . '; height:' . $editorWrapHeight . ';">
                                <textarea id="RTEarea'.$pObj->RTEcounter.'" name="'.htmlspecialchars($PA['itemFormElName']).'" style="'.t3lib_div::deHSCentities(htmlspecialchars($this->RTEdivStyle)).'">'.t3lib_div::formatForTextarea($value).'</textarea>
                                </div>' . ($TYPO3_CONF_VARS['EXTCONF'][$this->ID]['enableDebugMode'] ? '<div id="HTMLAreaLog"></div>' : '') . '
                                ';
@@ -631,9 +634,9 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
                        bar, bold, italic, underline, strikethrough, subscript, superscript,
                        bar, lefttoright, righttoleft, bar, left, center, right, justifyfull,
                        bar, orderedlist, unorderedlist, outdent, indent, bar, textcolor, bgcolor, textindicator,
-                       bar, emoticon, insertcharacter, line, link, image, table,' . (trim($this->thisConfig['hideTableOperationsInToolbar'] && trim($this->thisConfig['keepToggleBordersInToolbar'])) ? ' toggleborders,': '') . ' user, acronym, bar, findreplace, spellcheck,
+                       bar, emoticon, insertcharacter, line, link, image, table,' . (($this->thisConfig['hideTableOperationsInToolbar'] && is_array($this->thisConfig['buttons.']) && is_array($this->thisConfig['buttons.']['toggleborders.']) && $this->thisConfig['buttons.']['toggleborders.']['keepInToolbar']) ? ' toggleborders,': '') . ' user, acronym, bar, findreplace, spellcheck,
                        bar, chMode, inserttag, removeformat, bar, copy, cut, paste, bar, undo, redo, bar, showhelp, about, linebreak, 
-                       ' . (trim($this->thisConfig['hideTableOperationsInToolbar']) ? '': 'bar, toggleborders,') . ' bar, tableproperties, bar, rowproperties, rowinsertabove, rowinsertunder, rowdelete, rowsplit, bar,
+                       ' . ($this->thisConfig['hideTableOperationsInToolbar'] ? '': 'bar, toggleborders,') . ' bar, tableproperties, bar, rowproperties, rowinsertabove, rowinsertunder, rowdelete, rowsplit, bar,
                        columninsertbefore, columninsertafter, columndelete, columnsplit, bar,
                        cellproperties, cellinsertbefore, cellinsertafter, celldelete, cellsplit, cellmerge';
                
@@ -824,6 +827,12 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
                return '
                <script type="text/javascript">
                /*<![CDATA[*/
+                       var i=1;
+                       while (document.getElementById("pleasewait" + i)) {
+                               document.getElementById("pleasewait" + i).style.display = "block";
+                               document.getElementById("editorWrap" + i).style.visibility = "hidden";
+                               i++;
+                       };
                        var RTEarea = new Array();
                        RTEarea[0] = new Array();
                        RTEarea[0]["version"] = "' . $TYPO3_CONF_VARS['EXTCONF'][$this->ID]['version'] . '";
@@ -842,7 +851,6 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
                        var _spellChecker_lang = "' . $this->spellCheckerLanguage . '";
                        var _spellChecker_charset = "' . $this->spellCheckerCharset . '";
                        var _spellChecker_mode = "' . $this->spellCheckerMode . '";
-                       var _quickTag_hideTags = "' . $this->quickTagHideTags . '";
                /*]]>*/
                </script>
                <script type="text/javascript" src="' . $this->buildJSMainLangFile($number) . '"></script>
@@ -868,19 +876,19 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
                        }
                }
                return (!is_object($TSFE) ? '' : '
-               ' . '/*<![CDATA[*/') . '
-                       var conf_RTEtsConfigParams = "&RTEtsConfigParams=' . rawurlencode($this->RTEtsConfigParams()) . '";
-                       var rtePathImageFile = "../mod4/select_image.php";
-                       var rtePathLinkFile = "../mod3/browse_links.php";
-                       var rtePathUserFile = "../mod5/user.php";
-                       var rtePathAcronymFile = "../mod2/acronym.php";
-                       var rtePathParseHtmlFile = "' . $this->extHttpPath . 'mod6/parse_html.php";'
+               ' . '/*<![CDATA[*/') . (is_object($TSFE) ? '' : '
+                       RTEarea[0]["RTEtsConfigParams"] = "&RTEtsConfigParams=' . rawurlencode($this->RTEtsConfigParams()) . '";
+                       RTEarea[0]["pathAcronymModule"] = "../../mod2/acronym.php";
+                       RTEarea[0]["pathLinkModule"] = "../../mod3/browse_links.php";
+                       RTEarea[0]["pathImageModule"] = "../../mod4/select_image.php";
+                       RTEarea[0]["pathUserModule"] = "../../mod5/user.php";
+                       RTEarea[0]["pathParseHtmlModule"] = "' . $this->extHttpPath . 'mod6/parse_html.php";')
                        . $loadPluginCode .  '
                        HTMLArea.init();' . (!is_object($TSFE) ? '' : '
                /*]]>*/
                ');
        }
-
+       
        /**
         * Return the JS-Code for Register the RTE in JS
         *
@@ -904,12 +912,13 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
                        RTEarea['.$number.']["disablePCexamples"] = ' . (trim($this->thisConfig['disablePCexamples'])?'true':'false') . ';
                        RTEarea['.$number.']["statusBar"] = ' . (trim($this->thisConfig['showStatusBar'])?'true':'false') . ';
                        RTEarea['.$number.']["showTagFreeClasses"] = ' . (trim($this->thisConfig['showTagFreeClasses'])?'true':'false') . ';
-                       RTEarea['.$number.']["useHTTPS"] = ' . (trim(stristr($this->siteURL, 'https'))?'true':'false') . ';
+                       RTEarea['.$number.']["useHTTPS"] = ' . ((trim(stristr($this->siteURL, 'https')) || $this->thisConfig['forceHTTPS'])?'true':'false') . ';
                        RTEarea['.$number.']["enableMozillaExtension"] = ' . (($this->client['BROWSER'] == 'gecko' && $TYPO3_CONF_VARS['EXTCONF'][$this->ID]['enableMozillaExtension'])?'true':'false') . ';';
                
                        // The following properties apply only to the backend
                if (!is_object($TSFE)) {
                        $registerRTEinJSString .= '
+                       RTEarea['.$number.']["sys_language_content"] = "' . $this->contentLanguageUid . '";
                        RTEarea['.$number.']["typo3ContentLanguage"] = "' . $this->contentTypo3Language . '";
                        RTEarea['.$number.']["typo3ContentCharset"] = "' . $this->contentCharset . '";
                        RTEarea['.$number.']["enablePersonalDicts"] = ' . ($this->spellCheckerPersonalDicts ? 'true' : 'false') . ';
@@ -921,19 +930,109 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
                        RTEarea['.$number.']["plugin"] = new Array();';
                
                $pluginArray = t3lib_div::trimExplode(',', $this->pluginList , 1);
+               reset($pluginArray);
                while( list(,$plugin) = each($pluginArray) ) {
                        if ($this->isPluginEnable($plugin)) {
                                $registerRTEinJSString .= '
                        RTEarea['.$number.']["plugin"]["'.$plugin.'"] = true;';
                        }
                }
-
+               
+                       // Setting the buttons configuration
+               $registerRTEinJSString .= '
+                       RTEarea['.$number.']["buttons"] = new Array();';
+               if (is_array($this->thisConfig['buttons.'])) {
+                       reset($this->thisConfig['buttons.']);
+                       while( list($buttonIndex,$conf) = each($this->thisConfig['buttons.']) ) {
+                               $button = substr($buttonIndex, 0, -1);
+                               if (in_array($button,$this->toolBar)) {
+                                       $indexButton = 0;
+                                       $registerRTEinJSString .= '
+                       RTEarea['.$number.']["buttons"]["'.$button.'"] = {';
+                                       if (is_array($conf)) {
+                                               reset($conf);
+                                               while (list($propertyName,$conf1) = each($conf)) {
+                                                       $property = $propertyName;
+                                                       if ($indexButton) {
+                                                               $registerRTEinJSString .= ', ';
+                                                       }
+                                                       if (is_array($conf1)) {
+                                                               $property = substr($property, 0, -1);
+                                                               $indexProperty = 0;
+                                                               $registerRTEinJSString .= '"'.$property.'" : {';
+                                                               reset($conf1);
+                                                               while (list($property1Name,$conf2) = each($conf1)) {
+                                                                       $property1 = $property1Name;
+                                                                       if ($indexProperty) {
+                                                                               $registerRTEinJSString .= ', ';
+                                                                       }
+                                                                       if (is_array($conf2)) {
+                                                                               $property1 = substr($property1, 0, -1);
+                                                                               $indexProperty1 = 0;
+                                                                               $registerRTEinJSString .= '"'.$property1.'" : {';
+                                                                               reset($conf2);
+                                                                               while (list($property2Name,$conf3) = each($conf2)) {
+                                                                                       $property2 = $property2Name;
+                                                                                       if ($indexProperty1) {
+                                                                                               $registerRTEinJSString .= ', ';
+                                                                                       }
+                                                                                       if (is_array($conf3)) {
+                                                                                               $property2 = substr($property2, 0, -1);
+                                                                                               $indexProperty2 = 0;
+                                                                                               $registerRTEinJSString .= '"'.$property2.'" : {';
+                                                                                               reset($conf3);
+                                                                                               while (list($property3Name,$conf4) = each($conf3)) {
+                                                                                                       $property3 = $property3Name;
+                                                                                                       if ($indexProperty2) {
+                                                                                                               $registerRTEinJSString .= ', ';
+                                                                                                       }
+                                                                                                       if (!is_array($conf4)) {
+                                                                                                               $registerRTEinJSString .= '"'.$property3.'" : '.($conf4?'"'.$conf4.'"':'false');
+                                                                                                       }
+                                                                                                       $indexProperty2++;
+                                                                                               }
+                                                                                               $registerRTEinJSString .= '}';
+                                                                                       } else {
+                                                                                               $registerRTEinJSString .= '"'.$property2.'" : '.($conf3?'"'.$conf3.'"':'false');                                                                                                
+                                                                                       }
+                                                                                       $indexProperty1++;
+                                                                               }
+                                                                               $registerRTEinJSString .= '}';
+                                                                       } else {
+                                                                               $registerRTEinJSString .= '"'.$property1.'" : '.($conf2?'"'.$conf2.'"':'false');
+                                                                       }
+                                                                       $indexProperty++;
+                                                               }
+                                                               $registerRTEinJSString .= '}';
+                                                       } else {
+                                                               $registerRTEinJSString .= '"'.$property.'" : '.($conf1?'"'.$conf1.'"':'false');
+                                                       }
+                                                       $indexButton++;
+                                               }
+                                       }
+                                       $registerRTEinJSString .= '};';
+                               }
+                       }
+               }
+               
+                       // Deprecated inserttag button configuration
+               if (in_array('inserttag', $this->toolBar) && trim($this->thisConfig['hideTags'])) {
+                       if (!is_array($this->thisConfig['buttons.']['inserttag.'])) {
+                               $registerRTEinJSString .= '
+                       RTEarea['.$number.']["buttons"]["inserttag"] = new Array();
+                       RTEarea['.$number.']["buttons"]["inserttag"]["denyTags"] = "'.implode(',', t3lib_div::trimExplode(',', $this->thisConfig['hideTags'], 1)).'";';
+                       } elseif (!$this->thisConfig['buttons.']['inserttag.']['denyTags']) {
+                               $registerRTEinJSString .= '
+                       RTEarea['.$number.']["buttons"]["inserttag"]["denyTags"] = "'.implode(',', t3lib_div::trimExplode(',', $this->thisConfig['hideTags'], 1)).'";';
+                       }
+               }
+               
                        // Setting the list of tags to be removed if specified in the RTE config
                if (trim($this->thisConfig['removeTags']))  {
                        $registerRTEinJSString .= '
                        RTEarea['.$number.']["htmlRemoveTags"] = /^(' . implode('|', t3lib_div::trimExplode(',', $this->thisConfig['removeTags'], 1)) . ')$/i;';
                }
-
+               
                        // Setting the list of tags to be removed with their contents if specified in the RTE config
                if (trim($this->thisConfig['removeTagsAndContents']))  {
                        $registerRTEinJSString .= '
@@ -971,12 +1070,22 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
                if ($this->isPluginEnable('TableOperations')) {
                        $registerRTEinJSString .= '
                        RTEarea['.$number.']["hideTableOperationsInToolbar"] = ' . (trim($this->thisConfig['hideTableOperationsInToolbar']) ? 'true' : 'false') . ';
-                       RTEarea['.$number.']["keepToggleBordersInToolbar"] = ' . (trim($this->thisConfig['keepToggleBordersInToolbar'])?'true':'false') . ';
                        RTEarea['.$number.']["disableLayoutFieldsetInTableOperations"] = ' . (trim($this->thisConfig['disableLayoutFieldsetInTableOperations'])?'true':'false') . ';
                        RTEarea['.$number.']["disableAlignmentFieldsetInTableOperations"] = ' . (trim($this->thisConfig['disableAlignmentFieldsetInTableOperations'])?'true':'false') . ';
                        RTEarea['.$number.']["disableSpacingFieldsetInTableOperations"] = ' . (trim($this->thisConfig['disableSpacingFieldsetInTableOperations'])?'true':'false') . ';
                        RTEarea['.$number.']["disableBordersFieldsetInTableOperations"] = ' . (trim($this->thisConfig['disableBordersFieldsetInTableOperations'])?'true':'false') . ';
                        RTEarea['.$number.']["disableColorFieldsetInTableOperations"] = ' . (trim($this->thisConfig['disableColorFieldsetInTableOperations'])?'true':'false') . ';';
+                               // // Deprecated toggleborders button configuration
+                       if (in_array('toggleborders',$this->toolBar) && $this->thisConfig['keepToggleBordersInToolbar']) {
+                               if (!is_array($this->thisConfig['buttons.']['toggleborders.'])) {
+                                       $registerRTEinJSString .= '
+                       RTEarea['.$number.']["buttons"]["toggleborders"] = new Array();
+                       RTEarea['.$number.']["buttons"]["toggleborders"]["keepInToolbar"] = true;';
+                               } elseif (!$this->thisConfig['buttons.']['toggleborders.']['keepInToolbar']) {
+                                       $registerRTEinJSString .= '
+                       RTEarea['.$number.']["buttons"]["toggleborders"]["keepInToolbar"] = true;';
+                               }
+                       }
                }
                
                if ($this->isPluginEnable('Acronym')) {
index b62156c..67db86f 100644 (file)
Binary files a/typo3/sysext/rtehtmlarea/doc/manual.sxw and b/typo3/sysext/rtehtmlarea/doc/manual.sxw differ
index 420f982..e821f64 100644 (file)
@@ -22,9 +22,18 @@ HTMLAreaPluginList = TableOperations, SpellChecker, ContextMenu, SelectColor, TY
   # cat=basic/enable; type=options[Minimal (Most features disabled. Administrator needs to enable them using TypoScript. For advanced administrators only.),Typical (Most commonly used features are enabled. Select this option if you are unsure which one to use.),Demo (Show-off configuration. Includes pre-configured styles. Not for production environments.)]; label=Default configuration settings
 defaultConfiguration = Typical (Most commonly used features are enabled. Select this option if you are unsure which one to use.)
 
-  # cat=basic/enable; type=boolean; label=Enable images in the RTE: If set, the use of images in the "Typical" default configuration of the RTE will be enabled.
+  # cat=basic/enable; type=boolean; label=Enable images in the RTE: If set, the use of images will be enabled in the Minimal or the Typical default configuration of the RTE.
 enableImages = 0
 
+  # cat=basic/enable; type=boolean; label=Enable links accessibility icons: If set, accessibility icons will be added in front of links.
+enableAccessibilityIcons = 0
+
+  # cat=basic/enable; type=boolean; label=Enable the DAM media browser: If set and if the DAM extension is installed, the DAM media browser will be used by the Insert image dialog.
+enableDAMBrowser = 0
+
+##  # cat=basic/enable; type=boolean; label=EXPERIMENTAL! Enable click-enlarge on images: This feature is EXPERIMENTAL. If set, a click-enlarge property may be set on images inserted in the RTE.
+##enableClickEnlarge = 0
+
   # cat=basic/enable; type=boolean; label=Enable Mozilla/Firefox extension: If set, enables the triggering of installation of a Mozilla/Firefox extension to allow the RTE to access the clipboard.
 enableMozillaExtension = 0
 
@@ -40,8 +49,8 @@ enableCompressedScripts = 1
   # cat=basic; type=string; label=Url of AllowClipboard Helper: Full absolute Url of the AllowClipboard Helper extension for Mozilla and Firefox.
 mozAllowClipboardUrl = http://releases.mozilla.org/pub/mozilla.org/extensions/allowclipboard_helper/allowclipboard_helper-0.5.3-fx+mz.xpi
 
-  # cat=basic; type=int+; label=Maximum width of plain images: Maximum width in pixels of plain images inserted with the TYPO3 image browser
-plainImageMaxWidth = 640
+  # cat=basic; type=int+; label=Maximum width of plain images: Maximum width in pixels of plain images inserted with the TYPO3 image browser. This variable is DEPRECATED! Use Page TSConfig property buttons.image.options.plain.maxWidth.
+plainImageMaxWidth =
 
-  # cat=basic; type=int+; label=Maximum height of plain images: Maximum height in pixels of plain images inserted with the TYPO3 image browser
-plainImageMaxHeight = 680
\ No newline at end of file
+  # cat=basic; type=int+; label=Maximum height of plain images: Maximum height in pixels of plain images inserted with the TYPO3 image browser. This variable is DEPRECATED! Use Page TSConfig property buttons.image.options.plain.maxHeight.
+plainImageMaxHeight =
\ No newline at end of file
index 14b0676..1dbfe6a 100644 (file)
@@ -3,7 +3,7 @@
 ########################################################################
 # Extension Manager/Repository config file for ext: "rtehtmlarea"
 #
-# Auto generated 06-04-2006 13:46
+# Auto generated 05-05-2006 16:30
 #
 # Manual updates:
 # Only the data in the array - anything else is removed by next write.
@@ -19,7 +19,7 @@ $EM_CONF[$_EXTKEY] = array(
        'conflicts' => 'rte_conf',
        'priority' => '',
        'loadOrder' => '',
-       'module' => 'mod1,mod2,mod3,mod4,mod5,mod6',
+       'module' => 'mod2,mod3,mod4,mod5,mod6',
        'state' => 'stable',
        'internal' => 0,
        'uploadfolder' => 1,
@@ -32,8 +32,8 @@ $EM_CONF[$_EXTKEY] = array(
        'author_company' => 'Fructifor Inc.',
        'CGLcompliance' => '',
        'CGLcompliance_note' => '',
-       'version' => '1.3.7',
-       '_md5_values_when_last_written' => 'a:222:{s:9:"ChangeLog";s:4:"241b";s:29:"class.tx_rtehtmlarea_base.php";s:4:"15ba";s:21:"ext_conf_template.txt";s:4:"5006";s:12:"ext_icon.gif";s:4:"2f41";s:17:"ext_localconf.php";s:4:"bc2b";s:14:"ext_tables.php";s:4:"3d3e";s:14:"ext_tables.sql";s:4:"cc72";s:13:"locallang.xml";s:4:"e79e";s:16:"locallang_db.xml";s:4:"a2a2";s:7:"tca.php";s:4:"3756";s:14:"doc/manual.sxw";s:4:"2037";s:32:"pi1/class.tx_rtehtmlarea_pi1.php";s:4:"9829";s:17:"pi1/locallang.xml";s:4:"2e58";s:13:"mod1/conf.php";s:4:"14fe";s:14:"mod1/popup.php";s:4:"3fd5";s:16:"mod2/acronym.php";s:4:"e6f9";s:14:"mod2/clear.gif";s:4:"cc11";s:13:"mod2/conf.php";s:4:"f442";s:18:"mod2/locallang.xml";s:4:"7dee";s:21:"mod3/browse_links.php";s:4:"524f";s:14:"mod3/clear.gif";s:4:"cc11";s:13:"mod3/conf.php";s:4:"2f07";s:18:"mod3/locallang.xml";s:4:"4393";s:14:"mod4/clear.gif";s:4:"cc11";s:13:"mod4/conf.php";s:4:"0c60";s:18:"mod4/locallang.xml";s:4:"8b55";s:21:"mod4/select_image.php";s:4:"bc2f";s:14:"mod5/clear.gif";s:4:"cc11";s:13:"mod5/conf.php";s:4:"b639";s:18:"mod5/locallang.xml";s:4:"7a78";s:13:"mod5/user.php";s:4:"4939";s:40:"mod6/class.tx_rtehtmlarea_parse_html.php";s:4:"26d1";s:13:"mod6/conf.php";s:4:"2b05";s:19:"mod6/parse_html.php";s:4:"5ded";s:29:"res/advanced/pageTSConfig.txt";s:4:"eb53";s:29:"res/advanced/userTSConfig.txt";s:4:"a72e";s:25:"res/demo/pageTSConfig.txt";s:4:"52d3";s:25:"res/demo/userTSConfig.txt";s:4:"54a0";s:26:"res/image/pageTSConfig.txt";s:4:"624e";s:25:"res/proc/pageTSConfig.txt";s:4:"6802";s:28:"res/typical/pageTSConfig.txt";s:4:"4a27";s:28:"res/typical/userTSConfig.txt";s:4:"6015";s:29:"htmlarea/HTMLAREA_LICENSE.txt";s:4:"a10f";s:31:"htmlarea/htmlarea-compressed.js";s:4:"c96e";s:37:"htmlarea/htmlarea-gecko-compressed.js";s:4:"a49a";s:26:"htmlarea/htmlarea-gecko.js";s:4:"918c";s:34:"htmlarea/htmlarea-ie-compressed.js";s:4:"b901";s:23:"htmlarea/htmlarea-ie.js";s:4:"c469";s:20:"htmlarea/htmlarea.js";s:4:"c22e";s:30:"htmlarea/locallang_dialogs.xml";s:4:"51f8";s:26:"htmlarea/locallang_msg.xml";s:4:"7b6f";s:31:"htmlarea/locallang_tooltips.xml";s:4:"ffff";s:31:"htmlarea/popupwin-compressed.js";s:4:"0b83";s:20:"htmlarea/popupwin.js";s:4:"9bd8";s:46:"htmlarea/plugins/Acronym/acronym-compressed.js";s:4:"1aa1";s:35:"htmlarea/plugins/Acronym/acronym.js";s:4:"507d";s:38:"htmlarea/plugins/Acronym/locallang.xml";s:4:"7221";s:57:"htmlarea/plugins/CharacterMap/character-map-compressed.js";s:4:"3a05";s:46:"htmlarea/plugins/CharacterMap/character-map.js";s:4:"7f00";s:43:"htmlarea/plugins/CharacterMap/locallang.xml";s:4:"8d28";s:58:"htmlarea/plugins/CharacterMap/popups/select_character.html";s:4:"2cd1";s:55:"htmlarea/plugins/ContextMenu/context-menu-compressed.js";s:4:"64ac";s:44:"htmlarea/plugins/ContextMenu/context-menu.js";s:4:"4ab0";s:42:"htmlarea/plugins/ContextMenu/locallang.xml";s:4:"59f5";s:52:"htmlarea/plugins/DynamicCSS/dynamiccss-compressed.js";s:4:"647f";s:42:"htmlarea/plugins/DynamicCSS/dynamiccss.css";s:4:"cbce";s:41:"htmlarea/plugins/DynamicCSS/dynamiccss.js";s:4:"ad38";s:41:"htmlarea/plugins/DynamicCSS/locallang.xml";s:4:"b6bf";s:52:"htmlarea/plugins/DynamicCSS/img/red_arrow_bullet.gif";s:4:"82d6";s:55:"htmlarea/plugins/FindReplace/find-replace-compressed.js";s:4:"6a25";s:44:"htmlarea/plugins/FindReplace/find-replace.js";s:4:"d5ac";s:41:"htmlarea/plugins/FindReplace/fr_engine.js";s:4:"3482";s:42:"htmlarea/plugins/FindReplace/locallang.xml";s:4:"f836";s:53:"htmlarea/plugins/FindReplace/popups/find_replace.html";s:4:"48ca";s:50:"htmlarea/plugins/InlineCSS/inlinecss-compressed.js";s:4:"39ed";s:39:"htmlarea/plugins/InlineCSS/inlinecss.js";s:4:"0d6a";s:40:"htmlarea/plugins/InlineCSS/locallang.xml";s:4:"60a1";s:57:"htmlarea/plugins/InsertSmiley/insert-smiley-compressed.js";s:4:"c300";s:46:"htmlarea/plugins/InsertSmiley/insert-smiley.js";s:4:"a667";s:43:"htmlarea/plugins/InsertSmiley/locallang.xml";s:4:"ed64";s:54:"htmlarea/plugins/InsertSmiley/popups/insertsmiley.html";s:4:"2a95";s:46:"htmlarea/plugins/InsertSmiley/smileys/0001.gif";s:4:"4aff";s:46:"htmlarea/plugins/InsertSmiley/smileys/0002.gif";s:4:"02c4";s:46:"htmlarea/plugins/InsertSmiley/smileys/0003.gif";s:4:"834f";s:46:"htmlarea/plugins/InsertSmiley/smileys/0004.gif";s:4:"fb6a";s:46:"htmlarea/plugins/InsertSmiley/smileys/0005.gif";s:4:"2a48";s:46:"htmlarea/plugins/InsertSmiley/smileys/0006.gif";s:4:"f970";s:46:"htmlarea/plugins/InsertSmiley/smileys/0007.gif";s:4:"97ee";s:46:"htmlarea/plugins/InsertSmiley/smileys/0008.gif";s:4:"10a6";s:46:"htmlarea/plugins/InsertSmiley/smileys/0009.gif";s:4:"1907";s:46:"htmlarea/plugins/InsertSmiley/smileys/0010.gif";s:4:"9ee6";s:46:"htmlarea/plugins/InsertSmiley/smileys/0011.gif";s:4:"ae73";s:46:"htmlarea/plugins/InsertSmiley/smileys/0012.gif";s:4:"f058";s:46:"htmlarea/plugins/InsertSmiley/smileys/0013.gif";s:4:"3ed8";s:46:"htmlarea/plugins/InsertSmiley/smileys/0014.gif";s:4:"a948";s:46:"htmlarea/plugins/InsertSmiley/smileys/0015.gif";s:4:"218d";s:46:"htmlarea/plugins/InsertSmiley/smileys/0016.gif";s:4:"3539";s:46:"htmlarea/plugins/InsertSmiley/smileys/0017.gif";s:4:"ee2e";s:46:"htmlarea/plugins/InsertSmiley/smileys/0018.gif";s:4:"8c66";s:46:"htmlarea/plugins/InsertSmiley/smileys/0019.gif";s:4:"ac36";s:46:"htmlarea/plugins/InsertSmiley/smileys/0020.gif";s:4:"71ef";s:39:"htmlarea/plugins/QuickTag/locallang.xml";s:4:"2f53";s:49:"htmlarea/plugins/QuickTag/quick-tag-compressed.js";s:4:"d8e3";s:38:"htmlarea/plugins/QuickTag/quick-tag.js";s:4:"d0a4";s:36:"htmlarea/plugins/QuickTag/tag-lib.js";s:4:"4b7d";s:46:"htmlarea/plugins/QuickTag/popups/quicktag.html";s:4:"297f";s:43:"htmlarea/plugins/RemoveFormat/locallang.xml";s:4:"aa85";s:57:"htmlarea/plugins/RemoveFormat/remove-format-compressed.js";s:4:"7282";s:46:"htmlarea/plugins/RemoveFormat/remove-format.js";s:4:"1703";s:54:"htmlarea/plugins/RemoveFormat/popups/removeformat.html";s:4:"6421";s:42:"htmlarea/plugins/SelectColor/locallang.xml";s:4:"9f9e";s:55:"htmlarea/plugins/SelectColor/select-color-compressed.js";s:4:"79a3";s:44:"htmlarea/plugins/SelectColor/select-color.js";s:4:"a3ac";s:43:"htmlarea/plugins/SpellChecker/locallang.xml";s:4:"20d8";s:51:"htmlarea/plugins/SpellChecker/spell-check-logic.php";s:4:"b044";s:51:"htmlarea/plugins/SpellChecker/spell-check-style.css";s:4:"82bd";s:49:"htmlarea/plugins/SpellChecker/spell-check-ui.html";s:4:"18b2";s:47:"htmlarea/plugins/SpellChecker/spell-check-ui.js";s:4:"0ca3";s:57:"htmlarea/plugins/SpellChecker/spell-checker-compressed.js";s:4:"223f";s:46:"htmlarea/plugins/SpellChecker/spell-checker.js";s:4:"816b";s:67:"htmlarea/plugins/SpellChecker/popups/spell-check-ui-iso-8859-1.html";s:4:"3927";s:56:"htmlarea/plugins/SpellChecker/popups/spell-check-ui.html";s:4:"d31e";s:44:"htmlarea/plugins/TYPO3Browsers/locallang.xml";s:4:"89b8";s:58:"htmlarea/plugins/TYPO3Browsers/typo3browsers-compressed.js";s:4:"afcd";s:47:"htmlarea/plugins/TYPO3Browsers/typo3browsers.js";s:4:"fbd4";s:47:"htmlarea/plugins/TYPO3Browsers/img/download.gif";s:4:"f6d9";s:52:"htmlarea/plugins/TYPO3Browsers/img/external_link.gif";s:4:"9e48";s:63:"htmlarea/plugins/TYPO3Browsers/img/external_link_new_window.gif";s:4:"6e8d";s:52:"htmlarea/plugins/TYPO3Browsers/img/internal_link.gif";s:4:"12b9";s:63:"htmlarea/plugins/TYPO3Browsers/img/internal_link_new_window.gif";s:4:"402a";s:43:"htmlarea/plugins/TYPO3Browsers/img/mail.gif";s:4:"d5a2";s:46:"htmlarea/plugins/TYPO3HtmlParser/locallang.xml";s:4:"e98e";s:63:"htmlarea/plugins/TYPO3HtmlParser/typo3html-parser-compressed.js";s:4:"e421";s:52:"htmlarea/plugins/TYPO3HtmlParser/typo3html-parser.js";s:4:"1432";s:46:"htmlarea/plugins/TableOperations/locallang.xml";s:4:"8377";s:63:"htmlarea/plugins/TableOperations/table-operations-compressed.js";s:4:"d835";s:52:"htmlarea/plugins/TableOperations/table-operations.js";s:4:"8ba3";s:43:"htmlarea/plugins/UserElements/locallang.xml";s:4:"33f9";s:57:"htmlarea/plugins/UserElements/user-elements-compressed.js";s:4:"dd4d";s:46:"htmlarea/plugins/UserElements/user-elements.js";s:4:"d394";s:26:"htmlarea/popups/about.html";s:4:"936e";s:26:"htmlarea/popups/blank.html";s:4:"e697";s:32:"htmlarea/popups/editor_help.html";s:4:"398a";s:33:"htmlarea/popups/insert_image.html";s:4:"9719";s:33:"htmlarea/popups/insert_table.html";s:4:"8111";s:25:"htmlarea/popups/link.html";s:4:"72e2";s:24:"htmlarea/popups/popup.js";s:4:"cc37";s:33:"htmlarea/popups/select_color.html";s:4:"d387";s:50:"htmlarea/skins/default/htmlarea-edited-content.css";s:4:"6bd1";s:35:"htmlarea/skins/default/htmlarea.css";s:4:"e082";s:42:"htmlarea/skins/default/images/ed_about.gif";s:4:"2763";s:49:"htmlarea/skins/default/images/ed_align_center.gif";s:4:"419a";s:50:"htmlarea/skins/default/images/ed_align_justify.gif";s:4:"9c31";s:47:"htmlarea/skins/default/images/ed_align_left.gif";s:4:"9c22";s:48:"htmlarea/skins/default/images/ed_align_right.gif";s:4:"9386";s:42:"htmlarea/skins/default/images/ed_blank.gif";s:4:"0208";s:45:"htmlarea/skins/default/images/ed_color_bg.gif";s:4:"c6e2";s:45:"htmlarea/skins/default/images/ed_color_fg.gif";s:4:"5d7f";s:41:"htmlarea/skins/default/images/ed_copy.gif";s:4:"4f55";s:43:"htmlarea/skins/default/images/ed_custom.gif";s:4:"e7b2";s:40:"htmlarea/skins/default/images/ed_cut.gif";s:4:"1b00";s:43:"htmlarea/skins/default/images/ed_delete.gif";s:4:"926b";s:48:"htmlarea/skins/default/images/ed_format_bold.gif";s:4:"f4f6";s:50:"htmlarea/skins/default/images/ed_format_italic.gif";s:4:"a800";s:50:"htmlarea/skins/default/images/ed_format_strike.gif";s:4:"3aa0";s:47:"htmlarea/skins/default/images/ed_format_sub.gif";s:4:"a840";s:47:"htmlarea/skins/default/images/ed_format_sup.gif";s:4:"cad7";s:53:"htmlarea/skins/default/images/ed_format_underline.gif";s:4:"505a";s:41:"htmlarea/skins/default/images/ed_help.gif";s:4:"e7fc";s:39:"htmlarea/skins/default/images/ed_hr.gif";s:4:"ff70";s:41:"htmlarea/skins/default/images/ed_html.gif";s:4:"fa6e";s:42:"htmlarea/skins/default/images/ed_image.gif";s:4:"f91c";s:48:"htmlarea/skins/default/images/ed_indent_less.gif";s:4:"8503";s:48:"htmlarea/skins/default/images/ed_indent_more.gif";s:4:"3835";s:50:"htmlarea/skins/default/images/ed_left_to_right.gif";s:4:"a0f9";s:41:"htmlarea/skins/default/images/ed_link.gif";s:4:"44fe";s:48:"htmlarea/skins/default/images/ed_list_bullet.gif";s:4:"236b";s:45:"htmlarea/skins/default/images/ed_list_num.gif";s:4:"48d3";s:42:"htmlarea/skins/default/images/ed_paste.gif";s:4:"fbd2";s:41:"htmlarea/skins/default/images/ed_redo.gif";s:4:"e9e8";s:50:"htmlarea/skins/default/images/ed_right_to_left.gif";s:4:"5149";s:41:"htmlarea/skins/default/images/ed_save.gif";s:4:"07ad";s:47:"htmlarea/skins/default/images/ed_splitblock.gif";s:4:"503e";s:45:"htmlarea/skins/default/images/ed_splitcel.gif";s:4:"2c04";s:41:"htmlarea/skins/default/images/ed_undo.gif";s:4:"b9ba";s:43:"htmlarea/skins/default/images/ed_unlink.gif";s:4:"a416";s:53:"htmlarea/skins/default/images/fullscreen_maximize.gif";s:4:"2118";s:53:"htmlarea/skins/default/images/fullscreen_minimize.gif";s:4:"91d6";s:46:"htmlarea/skins/default/images/insert_table.gif";s:4:"bf88";s:52:"htmlarea/skins/default/images/Acronym/ed_acronym.gif";s:4:"a2c5";s:57:"htmlarea/skins/default/images/CharacterMap/ed_charmap.gif";s:4:"5aa6";s:53:"htmlarea/skins/default/images/FindReplace/ed_find.gif";s:4:"d01c";s:56:"htmlarea/skins/default/images/InsertSmiley/ed_smiley.gif";s:4:"810e";s:54:"htmlarea/skins/default/images/QuickTag/ed_quicktag.gif";s:4:"b783";s:55:"htmlarea/skins/default/images/RemoveFormat/ed_clean.gif";s:4:"c936";s:58:"htmlarea/skins/default/images/SelectColor/CO-forecolor.gif";s:4:"5d7f";s:60:"htmlarea/skins/default/images/SelectColor/CO-hilitecolor.gif";s:4:"c6e2";s:58:"htmlarea/skins/default/images/SpellChecker/spell-check.gif";s:4:"15cf";s:56:"htmlarea/skins/default/images/TYPO3Browsers/ed_image.gif";s:4:"f91c";s:55:"htmlarea/skins/default/images/TYPO3Browsers/ed_link.gif";s:4:"9a55";s:61:"htmlarea/skins/default/images/TableOperations/cell-delete.gif";s:4:"031c";s:67:"htmlarea/skins/default/images/TableOperations/cell-insert-after.gif";s:4:"4d36";s:68:"htmlarea/skins/default/images/TableOperations/cell-insert-before.gif";s:4:"9ead";s:60:"htmlarea/skins/default/images/TableOperations/cell-merge.gif";s:4:"a2d2";s:59:"htmlarea/skins/default/images/TableOperations/cell-prop.gif";s:4:"bf67";s:60:"htmlarea/skins/default/images/TableOperations/cell-split.gif";s:4:"d87c";s:60:"htmlarea/skins/default/images/TableOperations/col-delete.gif";s:4:"b0f6";s:66:"htmlarea/skins/default/images/TableOperations/col-insert-after.gif";s:4:"f5f7";s:67:"htmlarea/skins/default/images/TableOperations/col-insert-before.gif";s:4:"5711";s:59:"htmlarea/skins/default/images/TableOperations/col-split.gif";s:4:"eacc";s:62:"htmlarea/skins/default/images/TableOperations/insert_table.gif";s:4:"c1db";s:60:"htmlarea/skins/default/images/TableOperations/row-delete.gif";s:4:"7cdb";s:66:"htmlarea/skins/default/images/TableOperations/row-insert-above.gif";s:4:"d034";s:66:"htmlarea/skins/default/images/TableOperations/row-insert-under.gif";s:4:"59f9";s:58:"htmlarea/skins/default/images/TableOperations/row-prop.gif";s:4:"b11e";s:59:"htmlarea/skins/default/images/TableOperations/row-split.gif";s:4:"a712";s:60:"htmlarea/skins/default/images/TableOperations/table-prop.gif";s:4:"2a21";s:64:"htmlarea/skins/default/images/TableOperations/toggle-borders.gif";s:4:"ae22";s:54:"htmlarea/skins/default/images/UserElements/ed_user.gif";s:4:"a294";s:59:"htmlarea/skins/default/images/TYPO3ViewHelp/module_help.gif";s:4:"a500";s:32:"pi2/class.tx_rtehtmlarea_pi2.php";s:4:"361f";s:17:"pi2/locallang.xml";s:4:"a0a7";}',
+       'version' => '1.4.0',
+       '_md5_values_when_last_written' => 'a:229:{s:9:"ChangeLog";s:4:"b48b";s:29:"class.tx_rtehtmlarea_base.php";s:4:"a862";s:21:"ext_conf_template.txt";s:4:"3506";s:12:"ext_icon.gif";s:4:"2f41";s:17:"ext_localconf.php";s:4:"d938";s:14:"ext_tables.php";s:4:"c11b";s:14:"ext_tables.sql";s:4:"cc72";s:13:"locallang.xml";s:4:"e79e";s:16:"locallang_db.xml";s:4:"a2a2";s:7:"tca.php";s:4:"3756";s:14:"doc/manual.sxw";s:4:"6dcf";s:32:"pi1/class.tx_rtehtmlarea_pi1.php";s:4:"ab0b";s:17:"pi1/locallang.xml";s:4:"2e58";s:32:"pi3/class.tx_rtehtmlarea_pi3.php";s:4:"b117";s:16:"mod2/acronym.php";s:4:"6e6b";s:37:"mod2/class.tx_rtehtmlarea_acronym.php";s:4:"79a4";s:14:"mod2/clear.gif";s:4:"cc11";s:13:"mod2/conf.php";s:4:"f442";s:18:"mod2/locallang.xml";s:4:"7dee";s:21:"mod3/browse_links.php";s:4:"4136";s:42:"mod3/class.tx_rtehtmlarea_browse_links.php";s:4:"5e6b";s:14:"mod3/clear.gif";s:4:"cc11";s:13:"mod3/conf.php";s:4:"2f07";s:18:"mod3/locallang.xml";s:4:"4393";s:46:"mod4/class.tx_rtehtmlarea_dam_browse_media.php";s:4:"8cd0";s:42:"mod4/class.tx_rtehtmlarea_select_image.php";s:4:"694d";s:14:"mod4/clear.gif";s:4:"cc11";s:13:"mod4/conf.php";s:4:"0c60";s:18:"mod4/locallang.xml";s:4:"3a28";s:21:"mod4/select_image.php";s:4:"81e8";s:34:"mod5/class.tx_rtehtmlarea_user.php";s:4:"0d71";s:14:"mod5/clear.gif";s:4:"cc11";s:13:"mod5/conf.php";s:4:"b639";s:18:"mod5/locallang.xml";s:4:"7a78";s:13:"mod5/user.php";s:4:"e5a3";s:40:"mod6/class.tx_rtehtmlarea_parse_html.php";s:4:"26d1";s:13:"mod6/conf.php";s:4:"2b05";s:19:"mod6/parse_html.php";s:4:"5ded";s:29:"res/advanced/pageTSConfig.txt";s:4:"eb53";s:29:"res/advanced/userTSConfig.txt";s:4:"a72e";s:25:"res/demo/pageTSConfig.txt";s:4:"5c3d";s:25:"res/demo/userTSConfig.txt";s:4:"54a0";s:26:"res/image/pageTSConfig.txt";s:4:"29eb";s:25:"res/proc/pageTSConfig.txt";s:4:"6802";s:28:"res/typical/pageTSConfig.txt";s:4:"4a27";s:28:"res/typical/userTSConfig.txt";s:4:"6015";s:33:"res/clickenlarge/pageTSConfig.txt";s:4:"922b";s:39:"res/accessibilityicons/pageTSConfig.txt";s:4:"ccfa";s:29:"htmlarea/HTMLAREA_LICENSE.txt";s:4:"a10f";s:31:"htmlarea/htmlarea-compressed.js";s:4:"94f8";s:37:"htmlarea/htmlarea-gecko-compressed.js";s:4:"f186";s:26:"htmlarea/htmlarea-gecko.js";s:4:"05e9";s:34:"htmlarea/htmlarea-ie-compressed.js";s:4:"8cc3";s:23:"htmlarea/htmlarea-ie.js";s:4:"6b47";s:20:"htmlarea/htmlarea.js";s:4:"6eed";s:30:"htmlarea/locallang_dialogs.xml";s:4:"51f8";s:26:"htmlarea/locallang_msg.xml";s:4:"7b6f";s:31:"htmlarea/locallang_tooltips.xml";s:4:"ffff";s:31:"htmlarea/popupwin-compressed.js";s:4:"a1d4";s:20:"htmlarea/popupwin.js";s:4:"252e";s:46:"htmlarea/plugins/Acronym/acronym-compressed.js";s:4:"a1a0";s:35:"htmlarea/plugins/Acronym/acronym.js";s:4:"c2a3";s:38:"htmlarea/plugins/Acronym/locallang.xml";s:4:"7221";s:57:"htmlarea/plugins/CharacterMap/character-map-compressed.js";s:4:"3a05";s:46:"htmlarea/plugins/CharacterMap/character-map.js";s:4:"7f00";s:43:"htmlarea/plugins/CharacterMap/locallang.xml";s:4:"8d28";s:58:"htmlarea/plugins/CharacterMap/popups/select_character.html";s:4:"2cd1";s:55:"htmlarea/plugins/ContextMenu/context-menu-compressed.js";s:4:"64ac";s:44:"htmlarea/plugins/ContextMenu/context-menu.js";s:4:"4ab0";s:42:"htmlarea/plugins/ContextMenu/locallang.xml";s:4:"59f5";s:52:"htmlarea/plugins/DynamicCSS/dynamiccss-compressed.js";s:4:"647f";s:42:"htmlarea/plugins/DynamicCSS/dynamiccss.css";s:4:"cbce";s:41:"htmlarea/plugins/DynamicCSS/dynamiccss.js";s:4:"ad38";s:41:"htmlarea/plugins/DynamicCSS/locallang.xml";s:4:"b6bf";s:52:"htmlarea/plugins/DynamicCSS/img/red_arrow_bullet.gif";s:4:"82d6";s:55:"htmlarea/plugins/FindReplace/find-replace-compressed.js";s:4:"6a25";s:44:"htmlarea/plugins/FindReplace/find-replace.js";s:4:"d5ac";s:41:"htmlarea/plugins/FindReplace/fr_engine.js";s:4:"3482";s:42:"htmlarea/plugins/FindReplace/locallang.xml";s:4:"f836";s:53:"htmlarea/plugins/FindReplace/popups/find_replace.html";s:4:"48ca";s:50:"htmlarea/plugins/InlineCSS/inlinecss-compressed.js";s:4:"39ed";s:39:"htmlarea/plugins/InlineCSS/inlinecss.js";s:4:"0d6a";s:40:"htmlarea/plugins/InlineCSS/locallang.xml";s:4:"60a1";s:57:"htmlarea/plugins/InsertSmiley/insert-smiley-compressed.js";s:4:"c300";s:46:"htmlarea/plugins/InsertSmiley/insert-smiley.js";s:4:"a667";s:43:"htmlarea/plugins/InsertSmiley/locallang.xml";s:4:"ed64";s:54:"htmlarea/plugins/InsertSmiley/popups/insertsmiley.html";s:4:"2a95";s:46:"htmlarea/plugins/InsertSmiley/smileys/0001.gif";s:4:"4aff";s:46:"htmlarea/plugins/InsertSmiley/smileys/0002.gif";s:4:"02c4";s:46:"htmlarea/plugins/InsertSmiley/smileys/0003.gif";s:4:"834f";s:46:"htmlarea/plugins/InsertSmiley/smileys/0004.gif";s:4:"fb6a";s:46:"htmlarea/plugins/InsertSmiley/smileys/0005.gif";s:4:"2a48";s:46:"htmlarea/plugins/InsertSmiley/smileys/0006.gif";s:4:"f970";s:46:"htmlarea/plugins/InsertSmiley/smileys/0007.gif";s:4:"97ee";s:46:"htmlarea/plugins/InsertSmiley/smileys/0008.gif";s:4:"10a6";s:46:"htmlarea/plugins/InsertSmiley/smileys/0009.gif";s:4:"1907";s:46:"htmlarea/plugins/InsertSmiley/smileys/0010.gif";s:4:"9ee6";s:46:"htmlarea/plugins/InsertSmiley/smileys/0011.gif";s:4:"ae73";s:46:"htmlarea/plugins/InsertSmiley/smileys/0012.gif";s:4:"f058";s:46:"htmlarea/plugins/InsertSmiley/smileys/0013.gif";s:4:"3ed8";s:46:"htmlarea/plugins/InsertSmiley/smileys/0014.gif";s:4:"a948";s:46:"htmlarea/plugins/InsertSmiley/smileys/0015.gif";s:4:"218d";s:46:"htmlarea/plugins/InsertSmiley/smileys/0016.gif";s:4:"3539";s:46:"htmlarea/plugins/InsertSmiley/smileys/0017.gif";s:4:"ee2e";s:46:"htmlarea/plugins/InsertSmiley/smileys/0018.gif";s:4:"8c66";s:46:"htmlarea/plugins/InsertSmiley/smileys/0019.gif";s:4:"ac36";s:46:"htmlarea/plugins/InsertSmiley/smileys/0020.gif";s:4:"71ef";s:39:"htmlarea/plugins/QuickTag/locallang.xml";s:4:"2f53";s:49:"htmlarea/plugins/QuickTag/quick-tag-compressed.js";s:4:"f0ca";s:38:"htmlarea/plugins/QuickTag/quick-tag.js";s:4:"f343";s:36:"htmlarea/plugins/QuickTag/tag-lib.js";s:4:"ba71";s:46:"htmlarea/plugins/QuickTag/popups/quicktag.html";s:4:"37d6";s:43:"htmlarea/plugins/RemoveFormat/locallang.xml";s:4:"aa85";s:57:"htmlarea/plugins/RemoveFormat/remove-format-compressed.js";s:4:"7282";s:46:"htmlarea/plugins/RemoveFormat/remove-format.js";s:4:"1703";s:54:"htmlarea/plugins/RemoveFormat/popups/removeformat.html";s:4:"6421";s:42:"htmlarea/plugins/SelectColor/locallang.xml";s:4:"9f9e";s:55:"htmlarea/plugins/SelectColor/select-color-compressed.js";s:4:"79a3";s:44:"htmlarea/plugins/SelectColor/select-color.js";s:4:"a3ac";s:43:"htmlarea/plugins/SpellChecker/locallang.xml";s:4:"20d8";s:51:"htmlarea/plugins/SpellChecker/spell-check-logic.php";s:4:"b044";s:51:"htmlarea/plugins/SpellChecker/spell-check-style.css";s:4:"82bd";s:49:"htmlarea/plugins/SpellChecker/spell-check-ui.html";s:4:"18b2";s:47:"htmlarea/plugins/SpellChecker/spell-check-ui.js";s:4:"cc7e";s:57:"htmlarea/plugins/SpellChecker/spell-checker-compressed.js";s:4:"223f";s:46:"htmlarea/plugins/SpellChecker/spell-checker.js";s:4:"816b";s:67:"htmlarea/plugins/SpellChecker/popups/spell-check-ui-iso-8859-1.html";s:4:"8426";s:56:"htmlarea/plugins/SpellChecker/popups/spell-check-ui.html";s:4:"6f38";s:44:"htmlarea/plugins/TYPO3Browsers/locallang.xml";s:4:"89b8";s:58:"htmlarea/plugins/TYPO3Browsers/typo3browsers-compressed.js";s:4:"d696";s:47:"htmlarea/plugins/TYPO3Browsers/typo3browsers.js";s:4:"26aa";s:47:"htmlarea/plugins/TYPO3Browsers/img/download.gif";s:4:"f6d9";s:52:"htmlarea/plugins/TYPO3Browsers/img/external_link.gif";s:4:"9e48";s:63:"htmlarea/plugins/TYPO3Browsers/img/external_link_new_window.gif";s:4:"6e8d";s:52:"htmlarea/plugins/TYPO3Browsers/img/internal_link.gif";s:4:"12b9";s:63:"htmlarea/plugins/TYPO3Browsers/img/internal_link_new_window.gif";s:4:"402a";s:43:"htmlarea/plugins/TYPO3Browsers/img/mail.gif";s:4:"d5a2";s:46:"htmlarea/plugins/TYPO3HtmlParser/locallang.xml";s:4:"e98e";s:63:"htmlarea/plugins/TYPO3HtmlParser/typo3html-parser-compressed.js";s:4:"805d";s:52:"htmlarea/plugins/TYPO3HtmlParser/typo3html-parser.js";s:4:"55a4";s:46:"htmlarea/plugins/TableOperations/locallang.xml";s:4:"8377";s:63:"htmlarea/plugins/TableOperations/table-operations-compressed.js";s:4:"0b09";s:52:"htmlarea/plugins/TableOperations/table-operations.js";s:4:"5046";s:43:"htmlarea/plugins/UserElements/locallang.xml";s:4:"33f9";s:57:"htmlarea/plugins/UserElements/user-elements-compressed.js";s:4:"4d77";s:46:"htmlarea/plugins/UserElements/user-elements.js";s:4:"ee8d";s:26:"htmlarea/popups/about.html";s:4:"936e";s:26:"htmlarea/popups/blank.html";s:4:"e697";s:32:"htmlarea/popups/editor_help.html";s:4:"398a";s:33:"htmlarea/popups/insert_image.html";s:4:"9719";s:33:"htmlarea/popups/insert_table.html";s:4:"8111";s:25:"htmlarea/popups/link.html";s:4:"72e2";s:24:"htmlarea/popups/popup.js";s:4:"7f6c";s:33:"htmlarea/popups/select_color.html";s:4:"d387";s:50:"htmlarea/skins/default/htmlarea-edited-content.css";s:4:"6bd1";s:35:"htmlarea/skins/default/htmlarea.css";s:4:"e082";s:42:"htmlarea/skins/default/images/ed_about.gif";s:4:"2763";s:49:"htmlarea/skins/default/images/ed_align_center.gif";s:4:"419a";s:50:"htmlarea/skins/default/images/ed_align_justify.gif";s:4:"9c31";s:47:"htmlarea/skins/default/images/ed_align_left.gif";s:4:"9c22";s:48:"htmlarea/skins/default/images/ed_align_right.gif";s:4:"9386";s:42:"htmlarea/skins/default/images/ed_blank.gif";s:4:"0208";s:45:"htmlarea/skins/default/images/ed_color_bg.gif";s:4:"c6e2";s:45:"htmlarea/skins/default/images/ed_color_fg.gif";s:4:"5d7f";s:41:"htmlarea/skins/default/images/ed_copy.gif";s:4:"4f55";s:43:"htmlarea/skins/default/images/ed_custom.gif";s:4:"e7b2";s:40:"htmlarea/skins/default/images/ed_cut.gif";s:4:"1b00";s:43:"htmlarea/skins/default/images/ed_delete.gif";s:4:"926b";s:48:"htmlarea/skins/default/images/ed_format_bold.gif";s:4:"f4f6";s:50:"htmlarea/skins/default/images/ed_format_italic.gif";s:4:"a800";s:50:"htmlarea/skins/default/images/ed_format_strike.gif";s:4:"3aa0";s:47:"htmlarea/skins/default/images/ed_format_sub.gif";s:4:"a840";s:47:"htmlarea/skins/default/images/ed_format_sup.gif";s:4:"cad7";s:53:"htmlarea/skins/default/images/ed_format_underline.gif";s:4:"505a";s:41:"htmlarea/skins/default/images/ed_help.gif";s:4:"e7fc";s:39:"htmlarea/skins/default/images/ed_hr.gif";s:4:"ff70";s:41:"htmlarea/skins/default/images/ed_html.gif";s:4:"fa6e";s:42:"htmlarea/skins/default/images/ed_image.gif";s:4:"f91c";s:48:"htmlarea/skins/default/images/ed_indent_less.gif";s:4:"8503";s:48:"htmlarea/skins/default/images/ed_indent_more.gif";s:4:"3835";s:50:"htmlarea/skins/default/images/ed_left_to_right.gif";s:4:"a0f9";s:41:"htmlarea/skins/default/images/ed_link.gif";s:4:"44fe";s:48:"htmlarea/skins/default/images/ed_list_bullet.gif";s:4:"236b";s:45:"htmlarea/skins/default/images/ed_list_num.gif";s:4:"48d3";s:42:"htmlarea/skins/default/images/ed_paste.gif";s:4:"fbd2";s:41:"htmlarea/skins/default/images/ed_redo.gif";s:4:"e9e8";s:50:"htmlarea/skins/default/images/ed_right_to_left.gif";s:4:"5149";s:41:"htmlarea/skins/default/images/ed_save.gif";s:4:"07ad";s:47:"htmlarea/skins/default/images/ed_splitblock.gif";s:4:"503e";s:45:"htmlarea/skins/default/images/ed_splitcel.gif";s:4:"2c04";s:41:"htmlarea/skins/default/images/ed_undo.gif";s:4:"b9ba";s:43:"htmlarea/skins/default/images/ed_unlink.gif";s:4:"a416";s:53:"htmlarea/skins/default/images/fullscreen_maximize.gif";s:4:"2118";s:53:"htmlarea/skins/default/images/fullscreen_minimize.gif";s:4:"91d6";s:46:"htmlarea/skins/default/images/insert_table.gif";s:4:"bf88";s:52:"htmlarea/skins/default/images/Acronym/ed_acronym.gif";s:4:"a2c5";s:57:"htmlarea/skins/default/images/CharacterMap/ed_charmap.gif";s:4:"5aa6";s:53:"htmlarea/skins/default/images/FindReplace/ed_find.gif";s:4:"d01c";s:56:"htmlarea/skins/default/images/InsertSmiley/ed_smiley.gif";s:4:"810e";s:54:"htmlarea/skins/default/images/QuickTag/ed_quicktag.gif";s:4:"b783";s:55:"htmlarea/skins/default/images/RemoveFormat/ed_clean.gif";s:4:"c936";s:58:"htmlarea/skins/default/images/SelectColor/CO-forecolor.gif";s:4:"5d7f";s:60:"htmlarea/skins/default/images/SelectColor/CO-hilitecolor.gif";s:4:"c6e2";s:58:"htmlarea/skins/default/images/SpellChecker/spell-check.gif";s:4:"15cf";s:56:"htmlarea/skins/default/images/TYPO3Browsers/ed_image.gif";s:4:"f91c";s:55:"htmlarea/skins/default/images/TYPO3Browsers/ed_link.gif";s:4:"9a55";s:61:"htmlarea/skins/default/images/TableOperations/cell-delete.gif";s:4:"031c";s:67:"htmlarea/skins/default/images/TableOperations/cell-insert-after.gif";s:4:"4d36";s:68:"htmlarea/skins/default/images/TableOperations/cell-insert-before.gif";s:4:"9ead";s:60:"htmlarea/skins/default/images/TableOperations/cell-merge.gif";s:4:"a2d2";s:59:"htmlarea/skins/default/images/TableOperations/cell-prop.gif";s:4:"bf67";s:60:"htmlarea/skins/default/images/TableOperations/cell-split.gif";s:4:"d87c";s:60:"htmlarea/skins/default/images/TableOperations/col-delete.gif";s:4:"b0f6";s:66:"htmlarea/skins/default/images/TableOperations/col-insert-after.gif";s:4:"f5f7";s:67:"htmlarea/skins/default/images/TableOperations/col-insert-before.gif";s:4:"5711";s:59:"htmlarea/skins/default/images/TableOperations/col-split.gif";s:4:"eacc";s:62:"htmlarea/skins/default/images/TableOperations/insert_table.gif";s:4:"c1db";s:60:"htmlarea/skins/default/images/TableOperations/row-delete.gif";s:4:"7cdb";s:66:"htmlarea/skins/default/images/TableOperations/row-insert-above.gif";s:4:"d034";s:66:"htmlarea/skins/default/images/TableOperations/row-insert-under.gif";s:4:"59f9";s:58:"htmlarea/skins/default/images/TableOperations/row-prop.gif";s:4:"b11e";s:59:"htmlarea/skins/default/images/TableOperations/row-split.gif";s:4:"a712";s:60:"htmlarea/skins/default/images/TableOperations/table-prop.gif";s:4:"2a21";s:64:"htmlarea/skins/default/images/TableOperations/toggle-borders.gif";s:4:"ae22";s:54:"htmlarea/skins/default/images/UserElements/ed_user.gif";s:4:"a294";s:59:"htmlarea/skins/default/images/TYPO3ViewHelp/module_help.gif";s:4:"a500";s:32:"pi2/class.tx_rtehtmlarea_pi2.php";s:4:"c84d";s:17:"pi2/locallang.xml";s:4:"a0a7";s:29:"static/clickenlarge/setup.txt";s:4:"5681";}',
        'constraints' => array(
                'depends' => array(
                        'cms' => '',
index 95f450d..dc730a0 100644 (file)
@@ -53,6 +53,8 @@ if (strstr($_EXTCONF['defaultConfiguration'],'Minimal')) {
        $TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['defaultConfiguration'] = 'Typical';
 }
 $TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['enableImages'] = $_EXTCONF['enableImages'] ? $_EXTCONF['enableImages'] : 0;
+$TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['enableDAMBrowser'] = $_EXTCONF['enableDAMBrowser'] ? $_EXTCONF['enableDAMBrowser'] : 0;
+$TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['enableClickEnlarge'] = $_EXTCONF['enableClickEnlarge'] ? $_EXTCONF['enableClickEnlarge'] : 0;
 $TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['enableMozillaExtension'] = $_EXTCONF['enableMozillaExtension'] ? $_EXTCONF['enableMozillaExtension'] : 0;
 $TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['mozAllowClipboardUrl'] = $_EXTCONF['mozAllowClipboardUrl'] ? $_EXTCONF['mozAllowClipboardUrl'] : 'http://releases.mozilla.org/pub/mozilla.org/extensions/allowclipboard_helper/allowclipboard_helper-0.5.3-fx+mz.xpi';
 $TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['forceCommandMode'] = $_EXTCONF["forceCommandMode"] ? $_EXTCONF["forceCommandMode"] : 0;
@@ -63,8 +65,8 @@ $TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['defaultDictionary'] = $_EXTCONF["defaultD
 $TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['AspellDirectory'] = $_EXTCONF["AspellDirectory"] ? $_EXTCONF["AspellDirectory"] : '/usr/bin/aspell';
 $TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['noSpellCheckLanguages'] = $_EXTCONF["noSpellCheckLanguages"] ? $_EXTCONF["noSpellCheckLanguages"] : 'ja,km,ko,lo,th,zh,b5,gb';
 $TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['HTMLAreaPluginList'] = $_EXTCONF["HTMLAreaPluginList"] ? $_EXTCONF["HTMLAreaPluginList"] : 'TableOperations,SpellChecker,ContextMenu,SelectColor,TYPO3Browsers,InsertSmiley,FindReplace,RemoveFormat,CharacterMap,QuickTag,InlineCSS,DynamicCSS,UserElements,TYPO3HtmlParser';
-$TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['plainImageMaxWidth'] = $_EXTCONF['plainImageMaxWidth'] ? $_EXTCONF['plainImageMaxWidth'] : 640;
-$TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['plainImageMaxHeight'] = $_EXTCONF['plainImageMaxHeight'] ? $_EXTCONF['plainImageMaxHeight'] : 680;
+if ($_EXTCONF['plainImageMaxWidth']) $TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['plainImageMaxWidth'] = intval($_EXTCONF['plainImageMaxWidth']);
+if ($_EXTCONF['plainImageMaxHeight']) $TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['plainImageMaxHeight'] = intval($_EXTCONF['plainImageMaxHeight']);
 
 //$TYPO3_CONF_VARS['EXTCONF']['rtehtmlarea']['safari_test'] = 0;
 //$TYPO3_CONF_VARS['EXTCONF']['rtehtmlarea']['opera_test'] = 0;
@@ -75,11 +77,26 @@ t3lib_extMgm::addPageTSConfig('<INCLUDE_TYPOSCRIPT: source="FILE:EXT:' . $_EXTKE
        // Add default Page TSonfig RTE configuration
 t3lib_extMgm::addPageTSConfig('<INCLUDE_TYPOSCRIPT: source="FILE:EXT:' . $_EXTKEY . '/res/' . strtolower($TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['defaultConfiguration']) . '/pageTSConfig.txt">');
 
-       // Add default Page TSonfig RTE configuration for enabling images with the Typical default configuration
-if (($TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['defaultConfiguration'] == 'Typical') && $TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['enableImages']) {
+       // Add default Page TSonfig RTE configuration for enabling images with the Minimal and Typical default configuration
+if (($TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['defaultConfiguration'] != 'Demo') && $TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['enableImages']) {
        t3lib_extMgm::addPageTSConfig('<INCLUDE_TYPOSCRIPT: source="FILE:EXT:' . $_EXTKEY . '/res/image/pageTSConfig.txt">');
 }
 
+       // Add default Page TSonfig RTE configuration for enabling links accessibility icons
+if ($TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['enableAccessibilityIcons']) {
+       t3lib_extMgm::addPageTSConfig('<INCLUDE_TYPOSCRIPT: source="FILE:EXT:' . $_EXTKEY . '/res/accessibilityicons/pageTSConfig.txt">');
+}
+
+       // Register DAM element browser rendering
+if (t3lib_extMgm::isLoaded('dam') && $TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['enableDAMBrowser']) {
+       $TYPO3_CONF_VARS['SC_OPTIONS']['typo3/browse_links.php']['browserRendering'][] = 'EXT:'.$_EXTKEY.'/mod4/class.tx_rtehtmlarea_dam_browse_media.php:&tx_rtehtmlarea_dam_browse_media';
+}
+
+       // Add default Page TSonfig RTE configuration for enabling the Click-enlarge feature
+if ($TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['enableClickEnlarge']) {
+       t3lib_extMgm::addPageTSConfig('<INCLUDE_TYPOSCRIPT: source="FILE:EXT:' . $_EXTKEY . '/res/clickenlarge/pageTSConfig.txt">');
+}
+
        // Add default User TSonfig RTE configuration
 t3lib_extMgm::addUserTSConfig('<INCLUDE_TYPOSCRIPT: source="FILE:EXT:' . $_EXTKEY . '/res/' . strtolower($TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['defaultConfiguration']) . 'userTSConfig.txt">');
 
index 4262385..0fa0a39 100644 (file)
@@ -1,5 +1,11 @@
 <?php
 if (!defined ('TYPO3_MODE'))   die ('Access denied.');
+
+       // Add static template for enabling the Click-enlarge feature
+if ($TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['enableClickEnlarge']) {
+       t3lib_extMgm::addStaticFile($_EXTKEY,'static/clickenlarge/','Clickenlarge Rendering');
+}
+
        $TCA['tx_rtehtmlarea_acronym'] = Array (
        'ctrl' => Array (
                'title' => 'LLL:EXT:rtehtmlarea/locallang_db.xml:tx_rtehtmlarea_acronym',
index 505486e..a510b12 100644 (file)
@@ -1,2 +1,2 @@
-if(typeof(_editor_url)=="string"){_editor_url=_editor_url.replace(/\x2f*$/,'/');}else{alert("WARNING: _editor_url is not set!");var _editor_url='';};if(typeof(_editor_skin)=="string")_editor_skin=_editor_skin.replace(/\x2f*$/,'/');else var _editor_skin=_editor_url+"skins/default/";if(typeof(_editor_CSS)!="string")var _editor_CSS=_editor_url+"skins/default/htmlarea.css";if(typeof(_editor_edited_content_CSS)!="string")var _editor_edited_content_CSS=_editor_skin+"htmlarea-edited-content.css";if(typeof(_editor_lang)=="string")_editor_lang=_editor_lang?_editor_lang.toLowerCase():"en";var HTMLArea=function(textarea,config){if(HTMLArea.checkSupportedBrowser()){if(typeof(config)=="undefined")this.config=new HTMLArea.Config();else this.config=config;this._htmlArea=null;this._textArea=textarea;this._editMode="wysiwyg";this.plugins={};this._timerToolbar=null;this._undoQueue=new Array();this._undoPos=-1;this._customUndo=true;this.doctype='';this.eventHandlers={};}};HTMLArea.agt=navigator.userAgent.toLowerCase();HTMLArea.is_opera=(HTMLArea.agt.indexOf("opera")!=-1);HTMLArea.is_ie=(HTMLArea.agt.indexOf("msie")!=-1)&&!HTMLArea.is_opera;HTMLArea.is_safari=(HTMLArea.agt.indexOf("webkit")!=-1);HTMLArea.is_gecko=(navigator.product=="Gecko")||HTMLArea.is_opera;HTMLArea.is_wamcom=(HTMLArea.agt.indexOf("wamcom")!=-1)||(HTMLArea.is_gecko&&(HTMLArea.agt.indexOf("1.3")!=-1));HTMLArea._debugMode=false;if(typeof(_editor_debug_mode)!="undefined")HTMLArea._debugMode=_editor_debug_mode;HTMLArea._appendToLog=function(str){if(HTMLArea._debugMode){var log=document.getElementById("HTMLAreaLog");if(log){log.appendChild(document.createTextNode(str));log.appendChild(document.createElement("br"));}}};HTMLArea._compressedScripts=false;if(typeof(_editor_compressed_scripts)!="undefined")HTMLArea._compressedScripts=_editor_compressed_scripts;HTMLArea.I18N=HTMLArea_langArray;HTMLArea.is_loaded=false;HTMLArea.onload=function(){HTMLArea.is_loaded=true;HTMLArea._appendToLog("All scripts successfully loaded.");};HTMLArea.loadTimer;HTMLArea._scripts=[];HTMLArea._scriptLoaded=[];HTMLArea._request=[];HTMLArea.loadScript=function(url,plugin){if(plugin)url=_editor_url+"/plugins/"+plugin+'/'+url;if(HTMLArea.is_opera)url=_typo3_host_url+url;if(HTMLArea._compressedScripts&&url.indexOf("compressed")==-1)url=url.replace(/\.js$/gi,"-compressed.js");HTMLArea._scripts.push(url);};HTMLArea.loadScript(RTEarea[0]["popupwin"]?RTEarea[0]["popupwin"]:_editor_url+"popupwin.js");if(HTMLArea.is_gecko)HTMLArea.loadScript(RTEarea[0]["htmlarea-gecko"]?RTEarea[0]["htmlarea-gecko"]:_editor_url+"htmlarea-gecko.js");if(HTMLArea.is_ie)HTMLArea.loadScript(RTEarea[0]["htmlarea-ie"]?RTEarea[0]["htmlarea-ie"]:_editor_url+"htmlarea-ie.js");HTMLArea.MSXML_XMLHTTP_PROGIDS=new Array("Msxml2.XMLHTTP.5.0","Msxml2.XMLHTTP.4.0","Msxml2.XMLHTTP.3.0","Msxml2.XMLHTTP","Microsoft.XMLHTTP");HTMLArea.XMLHTTPResponseHandler=function(i){return(function(){var url=HTMLArea._scripts[i];if(HTMLArea._request[i].readyState!=4)return;if(HTMLArea._request[i].status==200){try{eval(HTMLArea._request[i].responseText);HTMLArea._scriptLoaded[i]=true;i=null;}catch(e){HTMLArea._appendToLog("ERROR [HTMLArea::getScript]: Unable to get script "+url+": "+e);}}else{HTMLArea._appendToLog("ERROR [HTMLArea::getScript]: Unable to get "+url+" . Server reported "+HTMLArea._request[i].status);}});};HTMLArea._getScript=function(i,asynchronous,url){if(typeof(url)=="undefined")var url=HTMLArea._scripts[i];if(typeof(asynchronous)=="undefined")var asynchronous=true;if(window.XMLHttpRequest)HTMLArea._request[i]=new XMLHttpRequest();else if(window.ActiveXObject){var success=false;for(var k=0;k<HTMLArea.MSXML_XMLHTTP_PROGIDS.length&&!success;k++){try{HTMLArea._request[i]=new ActiveXObject(HTMLArea.MSXML_XMLHTTP_PROGIDS[k]);success=true;}catch(e){}};if(!success)return false;};var request=HTMLArea._request[i];if(request){request.open("GET",url,asynchronous);if(asynchronous)request.onreadystatechange=HTMLArea.XMLHTTPResponseHandler(i);if(window.XMLHttpRequest)request.send(null);else if(window.ActiveXObject)request.send();if(!asynchronous){if(request.status==200)return request.responseText;else return '';};return true;}else{return false;}};HTMLArea.checkInitialLoad=function(){var scriptsLoaded=true;for(var i=HTMLArea._scripts.length;--i>=0;){scriptsLoaded=scriptsLoaded&&HTMLArea._scriptLoaded[i];};if(HTMLArea.loadTimer)window.clearTimeout(HTMLArea.loadTimer);if(scriptsLoaded){HTMLArea.is_loaded=true;HTMLArea._appendToLog("[HTMLArea::init]: All scripts successfully loaded.");HTMLArea._appendToLog("[HTMLArea::init]: Editor url set to: "+_editor_url);HTMLArea._appendToLog("[HTMLArea::init]: Editor skin CSS set to: "+_editor_CSS);HTMLArea._appendToLog("[HTMLArea::init]: Editor content skin CSS set to: "+_editor_edited_content_CSS);if(window.ActiveXObject){for(var i=HTMLArea._scripts.length;--i>=0;){HTMLArea._request[i].onreadystatechange=new Function();HTMLArea._request[i]=null;}}}else{HTMLArea.loadTimer=window.setTimeout("HTMLArea.checkInitialLoad();",200);return false;}};HTMLArea.init=function(){HTMLArea._eventCache=HTMLArea._eventCacheConstructor();if(window.XMLHttpRequest||window.ActiveXObject){try{var success=true;for(var i=HTMLArea._scripts.length;--i>=0&&success;)success=success&&HTMLArea._getScript(i);}catch(e){HTMLArea._appendToLog("ERROR [HTMLArea::init]: Unable to use XMLHttpRequest: "+e);};if(success){HTMLArea.checkInitialLoad();}else{if(HTMLArea.is_ie)window.setTimeout('if (window.document.getElementById("pleasewait1")) { window.document.getElementById("pleasewait1").innerHTML = HTMLArea.I18N.msg["ActiveX-required"]; } else { alert(HTMLArea.I18N.msg["ActiveX-required"]); };',200);}}else{if(HTMLArea.is_ie)alert(HTMLArea.I18N.msg["ActiveX-required"]);}};HTMLArea.RE_tagName=/(<\/|<)\s*([^\t\n>]+)/ig;HTMLArea.RE_doctype=/(<!doctype((.|\n)*?)>)\n?/i;HTMLArea.RE_head=/<head>((.|\n)*?)<\/head>/i;HTMLArea.RE_body=/<body>((.|\n)*?)<\/body>/i;HTMLArea.Reg_body=new RegExp("<\/?(body)[^>]*>","gi");HTMLArea.Reg_entities=new RegExp("&amp;([0-9]+);","gi");HTMLArea.reservedClassNames=/htmlarea/;HTMLArea.RE_email=/([0-9a-z]+([a-z0-9_-]*[0-9a-z])*){1}(\.[0-9a-z]+([a-z0-9_-]*[0-9a-z])*)*@([0-9a-z]+([a-z0-9_-]*[0-9a-z])*\.)+[a-z]{2,9}/i;HTMLArea.RE_url=/(https?:\/\/)?(([a-z0-9_]+:[a-z0-9_]+@)?[a-z0-9_-]{2,}(\.[a-z0-9_-]{2,})+\.[a-z]{2,5}(:[0-9]+)?(\/\S+)*)/i;HTMLArea.Config=function(){this.version="3.0";this.width="auto";this.height="auto";this.statusBar=true;this.undoSteps=20;this.undoTimeout=500;this.sizeIncludesToolbar=true;this.fullPage=false;this.useHTTPS=false;this.useCSS=false;this.styleWithCSS=false;if(HTMLArea.is_gecko&&!HTMLArea.is_safari&&!HTMLArea.is_opera&&navigator.productSub>=20051107)this.styleWithCSS=true;this.enableMozillaExtension=true;this.disableEnterParagraphs=false;this.removeTrailingBR=false;this.editedContentStyle=_editor_edited_content_CSS;this.pageStyle="";this.cleanWordOnPaste=true;this.makeLinkShowsTarget=true;this.htmlRemoveTags=null;this.htmlRemoveTagsAndContents=null;this.htmlRemoveComments=false;this.customTags=null;this.baseURL=document.baseURI||document.URL;if(this.baseURL&&this.baseURL.match(/(.*)\/([^\/]+)/))this.baseURL=RegExp.$1+"/";this.imgURL="images/";this.popupURL="popups/";this.btnList={Bold:["Bold","ed_format_bold",false,function(editor){editor.execCommand("Bold");}],Italic:["Italic","ed_format_italic",false,function(editor){editor.execCommand("Italic");}],Underline:["Underline","ed_format_underline",false,function(editor){editor.execCommand("Underline");}],StrikeThrough:["Strikethrough","ed_format_strike",false,function(editor){editor.execCommand("StrikeThrough");}],Subscript:["Subscript","ed_format_sub",false,function(editor){editor.execCommand("Subscript");}],Superscript:["Superscript","ed_format_sup",false,function(editor){editor.execCommand("Superscript");}],JustifyLeft:["Justify Left","ed_align_left.gif",false,function(editor){editor.execCommand("JustifyLeft");}],JustifyCenter:["Justify Center","ed_align_center.gif",false,function(editor){editor.execCommand("JustifyCenter");}],JustifyRight:["Justify Right","ed_align_right.gif",false,function(editor){editor.execCommand("JustifyRight");}],JustifyFull:["Justify Full","ed_align_justify.gif",false,function(editor){editor.execCommand("JustifyFull");}],InsertOrderedList:["Ordered List","ed_list_num.gif",false,function(editor){editor.execCommand("InsertOrderedList");}],InsertUnorderedList:["Bulleted List","ed_list_bullet",false,function(editor){editor.execCommand("InsertUnorderedList");}],Outdent:["Decrease Indent","ed_indent_less.gif",false,function(editor){editor.execCommand("Outdent");}],Indent:["Increase Indent","ed_indent_more.gif",false,function(editor){editor.execCommand("Indent");}],ForeColor:["Font Color","ed_color_fg.gif",false,function(editor){editor.execCommand("ForeColor");}],HiliteColor:["Background Color","ed_color_bg.gif",false,function(editor){editor.execCommand("HiliteColor");}],InsertHorizontalRule:["Horizontal Rule","ed_hr.gif",false,function(editor){editor.execCommand("InsertHorizontalRule");}],CreateLink:["Insert Web Link","ed_link.gif",false,function(editor){editor.execCommand("CreateLink",true);},"a",false,true],InsertImage:["Insert/Modify Image","ed_image.gif",false,function(editor){editor.execCommand("InsertImage");}],InsertTable:["Insert Table","insert_table.gif",false,function(editor){editor.execCommand("InsertTable");}],HtmlMode:["Toggle HTML Source","ed_html.gif",true,function(editor){editor.execCommand("HtmlMode");}],SelectAll:["SelectAll","",true,function(editor){editor.execCommand("SelectAll");},null,true,false],SplitBlock:["Toggle Container Block","ed_splitblock.gif",false,function(editor){editor.execCommand("SplitBlock");}],About:["About this editor","ed_about.gif",true,function(editor){editor.execCommand("About");}],Undo:["Undoes your last action","ed_undo.gif",false,function(editor){editor.execCommand("Undo");}],Redo:["Redoes your last action","ed_redo.gif",false,function(editor){editor.execCommand("Redo");}],Cut:["Cut selection","ed_cut.gif",false,function(editor,command,obj){editor.execCommand("Cut");}],Copy:["Copy selection","ed_copy.gif",false,function(editor,command,obj){editor.execCommand("Copy");}],Paste:["Paste from clipboard","ed_paste.gif",false,function(editor,command,obj){editor.execCommand("Paste");}],SelectAll:["SelectAll","",true,function(editor){editor.execCommand("SelectAll");},null,true,false],LeftToRight:["Direction left to right","ed_left_to_right.gif",false,function(editor){editor.execCommand("LeftToRight");}],RightToLeft:["Direction right to left","ed_right_to_left.gif",false,function(editor){editor.execCommand("RightToLeft");}]};this.hotKeyList={a:"SelectAll",b:"Bold",i:"Italic",u:"Underline",s:"StrikeThrough",l:"JustifyLeft",e:"JustifyCenter",r:"JustifyRight",j:"JustifyFull",n:"FormatBlock",v:"Paste",0:"CleanWord",z:"Undo",y:"Redo"};for(var i in this.btnList){var btn=this.btnList[i];if(typeof(HTMLArea.I18N.tooltips[i.toLowerCase()])!="undefined")btn[0]=HTMLArea.I18N.tooltips[i.toLowerCase()];if(typeof(btn[1])=="string")btn[1]=_editor_skin+this.imgURL+btn[1];else btn[1][0]=_editor_skin+this.imgURL+btn[1][0];}this.customSelects={};};HTMLArea.Config.prototype.registerButton=function(id,tooltip,image,textMode,action,context,hide,selection){var the_id;switch(typeof(id)){case "string":the_id=id;break;case "object":the_id=id.id;break;default:HTMLArea._appendToLog("ERROR [HTMLArea.Config::registerButton]: invalid arguments");return false;}if(typeof(this.customSelects[the_id])!="undefined")HTMLArea._appendToLog("WARNING [HTMLArea.Config::registerButton]: A dropdown with the same ID "+id+" already exists.");if(typeof(this.btnList[the_id])!="undefined")HTMLArea._appendToLog("WARNING [HTMLArea.Config::registerButton]: A button with the same ID "+id+" already exists.");switch(typeof(id)){case "string":if(typeof(hide)=="undefined")var hide=false;if(typeof(selection)=="undefined")var selection=false;this.btnList[id]=[tooltip,image,textMode,action,context,hide,selection];break;case "object":if(typeof(id.hide)=="undefined")id.hide=false;if(typeof(id.selection)=="undefined")id.selection=false;this.btnList[id.id]=[id.tooltip,id.image,id.textMode,id.action,id.context,id.hide,id.selection];break;}};HTMLArea.Config.prototype.registerDropdown=function(object){if(typeof(this.customSelects[object.id])!="undefined")HTMLArea._appendToLog("WARNING [HTMLArea.Config::registerDropdown]: A dropdown with the same ID "+object.id+" already exists.");if(typeof(this.btnList[object.id])!="undefined")HTMLArea._appendToLog("WARNING [HTMLArea.Config::registerDropdown]: A button with the same ID "+object.id+" already exists.");this.customSelects[object.id]=object;};HTMLArea.setButtonStatus=function(id,newval){var oldval=this[id];var el=document.getElementById(this.elementId);if(oldval!=newval){switch(id){case "enabled":if(newval){if(!HTMLArea.is_wamcom){HTMLArea._removeClass(el,"buttonDisabled");HTMLArea._removeClass(el.parentNode,"buttonDisabled");}el.disabled=false;}else{if(!HTMLArea.is_wamcom){HTMLArea._addClass(el,"buttonDisabled");HTMLArea._addClass(el.parentNode,"buttonDisabled");}el.disabled=true;}break;case "active":if(newval){HTMLArea._addClass(el,"buttonPressed");HTMLArea._addClass(el.parentNode,"buttonPressed");}else{HTMLArea._removeClass(el,"buttonPressed");HTMLArea._removeClass(el.parentNode,"buttonPressed");}break;}this[id]=newval;}};HTMLArea.newLine=function(toolbar){tb_line=document.createElement("ul");tb_line.className="tb-line";toolbar.appendChild(tb_line);return tb_line;};HTMLArea.addTbElement=function(element,tb_line,first_cell_on_line){var tb_cell=document.createElement("li");if(first_cell_on_line)tb_cell.className="tb-first-cell";else tb_cell.className="tb-cell";HTMLArea._addClass(tb_cell,element.className);tb_line.appendChild(tb_cell);tb_cell.appendChild(element);if(element.style.display=="none"){tb_cell.style.display="none";if(HTMLArea._hasClass(tb_line,"tb-group"))tb_line.style.display="none";if(HTMLArea._hasClass(tb_cell.previousSibling,"separator"))tb_cell.previousSibling.style.display="none";}return false;};HTMLArea.addTbGroup=function(tb_line,first_cell_on_line){var tb_group=document.createElement("ul");tb_group.className="tb-group";HTMLArea.addTbElement(tb_group,tb_line,first_cell_on_line);return tb_group;};HTMLArea.prototype.createSelect=function(txt,tb_line,first_cell_on_line,labelObj){var options=null,cmd=null,context=null,tooltip="",newObj={created:false,el:null,first:first_cell_on_line,labelUsed:false};switch(txt){case "FontSize":case "FontName":case "FormatBlock":options=this.config[txt];tooltip=HTMLArea.I18N.tooltips[txt.toLowerCase()];cmd=txt;break;default:cmd=txt;var dropdown=this.config.customSelects[cmd];if(typeof(dropdown)!="undefined"){options=dropdown.options;context=dropdown.context;if(typeof(dropdown.tooltip)!="undefined")tooltip=dropdown.tooltip;}break;}if(options){newObj["el"]=document.createElement("select");newObj["el"].className="select";newObj["el"].title=tooltip;newObj["el"].id=this._editorNumber+"-"+txt;newObj["first"]=HTMLArea.addTbElement(newObj["el"],tb_line,first_cell_on_line);var obj={name:txt,elementId:newObj["el"].id,enabled:true,text:false,cmd:cmd,state:HTMLArea.setButtonStatus,context:context,editorNumber:this._editorNumber};this._toolbarObjects[txt]=obj;newObj["el"]._obj=obj;if(labelObj["labelRef"]){labelObj["el"].htmlFor=newObj["el"].id;newObj["labelUsed"]=true;}HTMLArea._addEvent(newObj["el"],"change",HTMLArea.toolBarButtonHandler);for(var i in options){var op=document.createElement("option");op.innerHTML=i;op.value=options[i];if(txt=="FontName"&&!this.config.disablePCexamples){if(HTMLArea.is_gecko)op.setAttribute("style","font-family:"+op.value+";");else op.style.cssText="font-family:"+op.value+";";}newObj["el"].appendChild(op);}newObj["created"]=true;}return newObj;};HTMLArea.prototype.createButton=function(txt,tb_line,first_cell_on_line,labelObj){var btn=null,btnImg=null,newObj={created:false,el:null,first:first_cell_on_line,labelUsed:false};switch(txt){case "separator":newObj["el"]=document.createElement("div");newObj["el"].className="separator";newObj["first"]=HTMLArea.addTbElement(newObj["el"],tb_line,first_cell_on_line);newObj["created"]=true;break;case "space":newObj["el"]=document.createElement("div");newObj["el"].className="space";newObj["el"].innerHTML="&nbsp;";newObj["first"]=HTMLArea.addTbElement(newObj["el"],tb_line,first_cell_on_line);newObj["created"]=true;break;case "TextIndicator":newObj["el"]=document.createElement("div");newObj["el"].appendChild(document.createTextNode("A"));newObj["el"].className="indicator";newObj["el"].title=HTMLArea.I18N.tooltips.textindicator;newObj["el"].id=this._editorNumber+"-"+txt;newObj["first"]=HTMLArea.addTbElement(newObj["el"],tb_line,first_cell_on_line);var obj={name:txt,elementId:newObj["el"].id,enabled:true,active:false,text:false,cmd:"TextIndicator",state:HTMLArea.setButtonStatus};this._toolbarObjects[txt]=obj;newObj["created"]=true;break;default:btn=this.config.btnList[txt];}if(!newObj["created"]&&btn){newObj["el"]=document.createElement("button");if(HTMLArea.is_opera)newObj["el"].outerHTML='<button type="button"></button>';newObj["el"].title=btn[0];newObj["el"].className="button";newObj["el"].id=this._editorNumber+"-"+txt;if(btn[5])newObj["el"].style.display="none";newObj["first"]=HTMLArea.addTbElement(newObj["el"],tb_line,first_cell_on_line);var obj={name:txt,elementId:newObj["el"].id,enabled:true,active:false,text:btn[2],cmd:btn[3],state:HTMLArea.setButtonStatus,context:btn[4]||null,selection:btn[6],editorNumber:this._editorNumber};this._toolbarObjects[txt]=obj;newObj["el"]._obj=obj;if(labelObj["labelRef"]){labelObj["el"].htmlFor=newObj["el"].id;newObj["labelUsed"]=true;}HTMLArea._addEvents(newObj["el"],["mouseover","mouseout","mousedown","click"],HTMLArea.toolBarButtonHandler);if(typeof(btn[1])!="string"&&HTMLArea.is_ie){var btnImgContainer=document.createElement("div");btnImgContainer.className="buttonImgContainer";btnImgContainer.innerHTML='<img src="'+btn[1][0]+'" style="position: relative; top: -'+(18*(btn[1][1]+1))+'px; left: -'+(18*(btn[1][2]+1))+'px;" alt="'+btn[0]+'" />';newObj["el"].appendChild(btnImgContainer);}else{newObj["el"].className+=" "+txt;if(this.plugins["TYPO3Browsers"]&&(txt=="CreateLink"||txt=="InsertImage"))newObj["el"].className+="-TYPO3Browsers";}newObj["created"]=true;}return newObj;};HTMLArea.createLabel=function(txt,tb_line,first_cell_on_line){var newObj={created:false,el:null,labelRef:false,first:first_cell_on_line};if(/^([IT])\[(.*?)\]/.test(txt)){var l7ed=RegExp.$1=="I";var label=RegExp.$2;if(l7ed)label=HTMLArea.I18N.dialogs[label];newObj["el"]=document.createElement("label");newObj["el"].className="label";newObj["el"].innerHTML=label;newObj["labelRef"]=true;newObj["created"]=true;newObj["first"]=HTMLArea.addTbElement(newObj["el"],tb_line,first_cell_on_line);}return newObj;};HTMLArea.prototype._createToolbar=function(){var j,k,code,n=this.config.toolbar.length,m,tb_line=null,tb_group=null,first_cell_on_line=true,labelObj=new Object(),tbObj=new Object();var toolbar=document.createElement("div");this._toolbar=toolbar;toolbar.className="toolbar";toolbar.unselectable="1";this._toolbarObjects=new Object();for(j=0;j<n;++j){tb_line=HTMLArea.newLine(toolbar);if(!this.config.keepButtonGroupTogether)HTMLArea._addClass(tb_line,"free-float");first_cell_on_line=true;tb_group=null;var group=this.config.toolbar[j];m=group.length;for(k=0;k<m;++k){code=group[k];if(code=="linebreak"){tb_line=HTMLArea.newLine(toolbar);if(!this.config.keepButtonGroupTogether)HTMLArea._addClass(tb_line,"free-float");first_cell_on_line=true;tb_group=null;}else{if((code=="separator"||first_cell_on_line)&&this.config.keepButtonGroupTogether){tb_group=HTMLArea.addTbGroup(tb_line,first_cell_on_line);first_cell_on_line=false;}created=false;if(/^([IT])\[(.*?)\]/.test(code)){labelObj=HTMLArea.createLabel(code,(tb_group?tb_group:tb_line),first_cell_on_line);created=labelObj["created"];first_cell_on_line=labelObj["first"];}if(!created){tbObj=this.createButton(code,(tb_group?tb_group:tb_line),first_cell_on_line,labelObj);created=tbObj["created"];first_cell_on_line=tbObj["first"];if(tbObj["labelUsed"])labelObj["labelRef"]=false;}if(!created){tbObj=this.createSelect(code,(tb_group?tb_group:tb_line),first_cell_on_line,labelObj);created=tbObj["created"];first_cell_on_line=tbObj["first"];if(tbObj["labelUsed"])labelObj["labelRef"]=false;}if(!created)HTMLArea._appendToLog("ERROR [HTMLArea::createToolbar]: Unknown toolbar item: "+code);}}}tb_line=HTMLArea.newLine(toolbar);this._htmlArea.appendChild(toolbar);};HTMLArea.toolBarButtonHandler=function(ev){if(!ev)var ev=window.event;var target=(ev.target)?ev.target:ev.srcElement;while(target.tagName.toLowerCase()=="img"||target.tagName.toLowerCase()=="div")target=target.parentNode;var obj=target._obj;var editorNumber=obj["editorNumber"];var editor=RTEarea[editorNumber]["editor"];if(obj.enabled){switch(ev.type){case "mouseover":HTMLArea._addClass(target,"buttonHover");HTMLArea._addClass(target.parentNode,"buttonHover");break;case "mouseout":HTMLArea._removeClass(target,"buttonHover");HTMLArea._removeClass(target.parentNode,"buttonHover");HTMLArea._removeClass(target,"buttonActive");HTMLArea._removeClass(target.parentNode,"buttonActive");if(obj.active){HTMLArea._addClass(target,"buttonPressed");HTMLArea._addClass(target.parentNode,"buttonPressed");}break;case "mousedown":if(!HTMLArea.is_opera){HTMLArea._addClass(target,"buttonActive");HTMLArea._addClass(target.parentNode,"buttonActive");HTMLArea._removeClass(target,"buttonPressed");HTMLArea._removeClass(target.parentNode,"buttonPressed");}HTMLArea._stopEvent(ev);break;case "click":HTMLArea._removeClass(target,"buttonActive");HTMLArea._removeClass(target.parentNode,"buttonActive");HTMLArea._removeClass(target,"buttonHover");HTMLArea._removeClass(target.parentNode,"buttonHover");obj.cmd(editor,obj.name,obj);HTMLArea._stopEvent(ev);break;case "change":editor.focusEditor();var value=target.options[target.selectedIndex].value;switch(obj.name){case "FontName":case "FontSize":editor.execCommand(obj.name,false,value);break;case "FormatBlock":(HTMLArea.is_ie||HTMLArea.is_safari)&&(value="<"+value+">");editor.execCommand(obj.name,false,value);break;default:var dropdown=editor.config.customSelects[obj.name];if(typeof(dropdown)!="undefined")dropdown.action(editor);else HTMLArea._appendToLog("ERROR [HTMLArea::toolBarButtonHandler]: Combo box "+obj.name+" not registered.");}}}};HTMLArea.prototype._createStatusBar=function(){var statusBar=document.createElement("div");this._statusBar=statusBar;statusBar.className="statusBar";if(!this.config.statusBar)statusBar.style.display="none";var statusBarTree=document.createElement("span");this._statusBarTree=statusBarTree;statusBarTree.className="statusBarTree";statusBar.appendChild(statusBarTree);statusBarTree.appendChild(document.createTextNode(HTMLArea.I18N.msg["Path"]+": "));this._htmlArea.appendChild(statusBar);};HTMLArea.prototype.generate=function(){var textarea=this._textArea;if(typeof(textarea)=="string"){textarea=HTMLArea.getElementById("textarea",textarea);this._textArea=textarea;}textarea.style.display="none";var htmlarea=document.createElement("div");htmlarea.className="htmlarea";htmlarea.style.width=textarea.style.width;this._htmlArea=htmlarea;textarea.parentNode.insertBefore(htmlarea,textarea);if(textarea.form){var f=textarea.form;if(typeof(f.onreset)=="function"){var funcref=f.onreset;if(typeof(f.__msh_prevOnReset)=="undefined")f.__msh_prevOnReset=[];f.__msh_prevOnReset.push(funcref);}f._editorNumber=this._editorNumber;HTMLArea._addEvent(f,"reset",HTMLArea.resetHandler);}this._createToolbar();HTMLArea._appendToLog("[HTMLArea::generate]: Toolbar successfully created.");var iframe=document.createElement("iframe");if(HTMLArea.is_ie||HTMLArea.is_safari||HTMLArea.is_wamcom){iframe.setAttribute("src",_editor_url+"popups/blank.html");}else if(HTMLArea.is_opera){iframe.setAttribute("src",_typo3_host_url+_editor_url+"popups/blank.html");}else{iframe.setAttribute("src","javascript:void(0);");}iframe.className="editorIframe";if(!this.config.statusBar)iframe.className+=" noStatusBar";htmlarea.appendChild(iframe);this._iframe=iframe;this._createStatusBar();this.sizeIframe(2);HTMLArea._appendToLog("[HTMLArea::generate]: Editor iframe successfully created.");this.initIframe();return this;};HTMLArea.prototype.sizeIframe=function(diff){var height=(this.config.height=="auto"?(this._textArea.style.height):this.config.height);var textareaHeight=height;if(height.indexOf("%")==-1){height=parseInt(height)-diff;if(this.config.sizeIncludesToolbar){this._initialToolbarOffsetHeight=this._toolbar.offsetHeight;height-=this._toolbar.offsetHeight;height-=this._statusBar.offsetHeight;}if(height<0)height=0;textareaHeight=(height-4);if(textareaHeight<0)textareaHeight=0;height+="px";textareaHeight+="px";}this._iframe.style.height=height;this._textArea.style.height=textareaHeight;var textareaWidth=(this.config.width=="auto"?this._textArea.style.width:this.config.width);var iframeWidth=textareaWidth;if(textareaWidth.indexOf("%")==-1){iframeWidth=parseInt(textareaWidth)+"px";textareaWidth=parseInt(textareaWidth)-diff;if(textareaWidth<0)textareaWidth=0;textareaWidth+="px";}this._iframe.style.width="100%";if(HTMLArea.is_opera)this._iframe.style.width=iframeWidth;this._textArea.style.width=textareaWidth;};HTMLArea.initIframe=function(editorNumber){var editor=RTEarea[editorNumber]["editor"];editor.initIframe();};HTMLArea.prototype.initIframe=function(){if(this._initIframeTimer)window.clearTimeout(this._initIframeTimer);if(!this._iframe||(!this._iframe.contentWindow&&!this._iframe.contentDocument)){this._initIframeTimer=window.setTimeout("HTMLArea.initIframe("+this._editorNumber+");",50);return false;}else if(this._iframe.contentWindow){if(!this._iframe.contentWindow.document||!this._iframe.contentWindow.document.documentElement){this._initIframeTimer=window.setTimeout("HTMLArea.initIframe("+this._editorNumber+");",50);return false;}}else if(!this._iframe.contentDocument.documentElement){this._initIframeTimer=window.setTimeout("HTMLArea.initIframe("+this._editorNumber+");",50);return false;}var doc=this._iframe.contentWindow?this._iframe.contentWindow.document:this._iframe.contentDocument;this._doc=doc;if(!this.config.fullPage){var head=doc.getElementsByTagName("head")[0];if(!head){head=doc.createElement("head");doc.documentElement.appendChild(head);}if(this.config.baseURL&&!HTMLArea.is_opera){var base=doc.getElementsByTagName("base")[0];if(!base){base=doc.createElement("base");base.href=this.config.baseURL;head.appendChild(base);}HTMLArea._appendToLog("[HTMLArea::initIframe]: Iframe baseURL set to: "+this.config.baseURL);}var link0=doc.getElementsByTagName("link")[0];if(!link0){link0=doc.createElement("link");link0.rel="stylesheet";link0.href=this.config.editedContentStyle;head.appendChild(link0);HTMLArea._appendToLog("[HTMLArea::initIframe]: Skin CSS set to: "+this.config.editedContentStyle);}if(this.config.defaultPageStyle){var link=doc.getElementsByTagName("link")[1];if(!link){link=doc.createElement("link");link.rel="stylesheet";link.href=this.config.defaultPageStyle;head.appendChild(link);}HTMLArea._appendToLog("[HTMLArea::initIframe]: Override CSS set to: "+this.config.defaultPageStyle);}if(this.config.pageStyle){var link=doc.getElementsByTagName("link")[2];if(!link){link=doc.createElement("link");link.rel="stylesheet";link.href=this.config.pageStyle;head.appendChild(link);}HTMLArea._appendToLog("[HTMLArea::initIframe]: Content CSS set to: "+this.config.pageStyle);}}else{var html=this._textArea.value;this.setFullHTML(html);}HTMLArea._appendToLog("[HTMLArea::initIframe]: Editor iframe head successfully initialized.");this.stylesLoaded();};HTMLArea.stylesLoaded=function(editorNumber){var editor=RTEarea[editorNumber]["editor"];editor.stylesLoaded();};HTMLArea.prototype.stylesLoaded=function(){var doc=this._doc;var docWellFormed=true;if(!HTMLArea.is_opera){if(this._stylesLoadedTimer)window.clearTimeout(this._stylesLoadedTimer);var stylesAreLoaded=true;var rules;for(var rule=0;rule<doc.styleSheets.length;rule++){if(HTMLArea.is_gecko)try{rules=doc.styleSheets[rule].cssRules;}catch(e){stylesAreLoaded=false;}if(HTMLArea.is_ie)try{rules=doc.styleSheets[rule].rules;}catch(e){stylesAreLoaded=false;}if(HTMLArea.is_ie)try{rules=doc.styleSheets[rule].imports;}catch(e){stylesAreLoaded=false;}}if(!stylesAreLoaded&&!HTMLArea.is_wamcom){this._stylesLoadedTimer=window.setTimeout("HTMLArea.stylesLoaded("+this._editorNumber+");",100);return false;}HTMLArea._appendToLog("[HTMLArea::initIframe]: Stylesheets successfully loaded.");}if(!this.config.fullPage){doc.body.style.borderWidth="0px";doc.body.className="htmlarea-content-body";try{doc.body.innerHTML=this._textArea.value;}catch(e){HTMLArea._appendToLog("[HTMLArea::initIframe]: The HTML document is not well-formed.");alert(HTMLArea.I18N.msg["HTML-document-not-well-formed"]);docWellFormed=false;}}if(this._customUndo)this._timerUndo=window.setInterval("HTMLArea.undoTakeSnapshot("+this._editorNumber+");",this.config.undoTimeout);if(docWellFormed){if(HTMLArea.is_gecko&&!HTMLArea.is_safari&&!HTMLArea.is_opera&&!this._initEditMode())return false;if(HTMLArea.is_opera)doc.designMode="on";if(HTMLArea.is_ie||HTMLArea.is_safari)doc.body.contentEditable=true;this._editMode="wysiwyg";if(doc.body.contentEditable||doc.designMode=="on")HTMLArea._appendToLog("[HTMLArea::initIframe]: Design mode successfully set.");}else{this._editMode="textmode";this.setMode("docnotwellformedmode");HTMLArea._appendToLog("[HTMLArea::initIframe]: Design mode could not be set.");}doc._editorNo=this._editorNumber;if(HTMLArea.is_ie)doc.documentElement._editorNo=this._editorNumber;HTMLArea._addEvents((HTMLArea.is_ie?doc.body:doc),["keydown","keypress","mousedown","mouseup","drag"],HTMLArea._editorEvent,true);HTMLArea._addEvent((this._iframe.contentWindow?this._iframe.contentWindow:this._iframe.contentDocument),"unload",HTMLArea.removeEditorEvents);if(this.config.cleanWordOnPaste)HTMLArea._addEvents((HTMLArea.is_ie?doc.body:doc),["paste","dragdrop","drop"],HTMLArea.cleanWordOnPaste,true);window.setTimeout("HTMLArea.generatePlugins("+this._editorNumber+");",100);};HTMLArea.generatePlugins=function(editorNumber){var editor=RTEarea[editorNumber]["editor"];editor._hasPluginWithOnKeyPressHandler=false;for(var i in editor.plugins){var plugin=editor.plugins[i].instance;if(typeof(plugin.onGenerate)=="function")plugin.onGenerate();if(typeof(plugin.onGenerateOnce)=="function"){plugin.onGenerateOnce();plugin.onGenerateOnce=null;}if(typeof(plugin.onKeyPress)=="function"){editor._hasPluginWithOnKeyPressHandler=true;}}if(typeof(editor.onGenerate)=="function"){editor.onGenerate();editor.onGenerate=null;}HTMLArea._appendToLog("[HTMLArea::initIframe]: All plugins successfully generated.");editor.updateToolbar();};HTMLArea.resetHandler=function(ev){if(!ev)var ev=window.event;var form=(ev.target)?ev.target:ev.srcElement;var editor=RTEarea[form._editorNumber]["editor"];editor.setHTML(editor._textArea.value);editor.updateToolbar();var a=form.__msh_prevOnReset;if(typeof(a)!="undefined"){for(var i=a.length;--i>=0;){a[i]();}}};HTMLArea.removeEditorEvents=function(ev){if(!ev)var ev=window.event;HTMLArea._stopEvent(ev);if(Dialog._modal){Dialog._modal.close();Dialog._modal=null;}for(var ed=RTEarea.length;--ed>0;){var editor=RTEarea[ed]["editor"];if(editor){RTEarea[ed]["editor"]=null;editor._textArea.value=editor.getHTML();window.clearInterval(editor._timerUndo);editor._undoQueue=null;if(HTMLArea._eventCache&&!HTMLArea.is_opera)HTMLArea._eventCache.flush();if(HTMLArea.is_ie)HTMLArea._cleanup(editor);}}};HTMLArea.prototype.setMode=function(mode){if(typeof(mode)=="undefined")var mode=(this._editMode=="textmode")?"wysiwyg":"textmode";switch(mode){case "textmode":case "docnotwellformedmode":this._textArea.value=this.getHTML();this._iframe.style.display="none";this._textArea.style.display="block";if(this.config.statusBar){var statusBarTextMode=document.createElement("span");statusBarTextMode.className="statusBarTextMode";statusBarTextMode.appendChild(document.createTextNode(HTMLArea.I18N.msg["TEXT_MODE"]));this._statusBar.innerHTML='';this._statusBar.appendChild(statusBarTextMode);}this._editMode="textmode";break;case "wysiwyg":if(HTMLArea.is_gecko&&!HTMLArea.is_safari)this._doc.designMode="off";try{if(!this.config.fullPage)this._doc.body.innerHTML=this.getHTML();else this.setFullHTML(this.getHTML());}catch(e){alert(HTMLArea.I18N.msg["HTML-document-not-well-formed"]);break;}this._textArea.style.display="none";this._iframe.style.display="block";if(HTMLArea.is_gecko&&!HTMLArea.is_safari)this._doc.designMode="on";if(this.config.statusBar){this._statusBar.innerHTML="";this._statusBar.appendChild(this._statusBarTree);}this._editMode="wysiwyg";break;default:return false;}if(!(mode=="docnotwellformedmode"))this.focusEditor();for(var i in this.plugins){var plugin=this.plugins[i].instance;if(typeof(plugin.onMode)=="function"){plugin.onMode(mode);}}};HTMLArea.prototype.setFullHTML=function(html){var save_multiline=RegExp.multiline;RegExp.multiline=true;if(html.match(HTMLArea.RE_doctype)){this.setDoctype(RegExp.$1);html=html.replace(HTMLArea.RE_doctype,"");};RegExp.multiline=save_multiline;if(!HTMLArea.is_ie){if(html.match(HTMLArea.RE_head))this._doc.getElementsByTagName("head")[0].innerHTML=RegExp.$1;if(html.match(HTMLArea.RE_body))this._doc.getElementsByTagName("body")[0].innerHTML=RegExp.$1;}else{var html_re=/<html>((.|\n)*?)<\/html>/i;html=html.replace(html_re,"$1");this._doc.open();this._doc.write(html);this._doc.close();this._doc.body.contentEditable=true;return true;};};HTMLArea.prototype.registerPlugin=function(){var plugin=arguments[0];var args=[];for(var i=1;i<arguments.length;++i){args.push(arguments[i]);}this.registerPlugin2(plugin,args);};HTMLArea.prototype.registerPlugin2=function(plugin,args){if(typeof(plugin)=="string"){var plugin=eval(plugin);};if(typeof(plugin)=="undefined"){HTMLArea._appendToLog("ERROR [HTMLArea::registerPlugin]: Can't register undefined plugin.");return false;};var obj=new plugin(this,args);if(obj){var clone={};var info=plugin._pluginInfo;for(var i in info){clone[i]=info[i];}clone.instance=obj;clone.args=args;this.plugins[plugin._pluginInfo.name]=clone;}else{HTMLArea._appendToLog("ERROR [HTMLArea::registerPlugin]: Can't register plugin "+plugin.toString()+".");};};HTMLArea.loadPlugin=function(pluginName,noLangFile,url){if(typeof(url)=="undefined"){var dir=_editor_url+"plugins/"+pluginName;var plugin=pluginName.replace(/([a-z])([A-Z])([a-z])/g,"$1"+"-"+"$2"+"$3").toLowerCase()+".js";var plugin_file=dir+"/"+plugin;HTMLArea.loadScript(plugin_file);if(typeof(noLangFile)=="undefined"||!noLangFile){var plugin_lang=dir+"/lang/"+_editor_lang+".js";HTMLArea._scripts.push(plugin_lang);}}else{HTMLArea.loadScript(url);}};HTMLArea.loadStyle=function(style,plugin,url){if(typeof(url)=="undefined"){var url=_editor_url||'';if(typeof(plugin)!="undefined"){url+="plugins/"+plugin+"/";}url+=style;if(/^\//.test(style)){url=style;}}var head=document.getElementsByTagName("head")[0];var link=document.createElement("link");link.rel="stylesheet";link.href=url;head.appendChild(link);};HTMLArea.loadStyle('','',_editor_CSS);HTMLArea.prototype.imgURL=function(file,plugin){if(typeof(plugin)=="undefined")return _editor_skin+this.config.imgURL+file;else return _editor_skin+this.config.imgURL+plugin+"/"+file;};HTMLArea.prototype.popupURL=function(file){var url="";if(file.match(/^plugin:\/\/(.*?)\/(.*)/)){var plugin=RegExp.$1;var popup=RegExp.$2;if(!/\.html$/.test(popup))popup+=".html";url=_editor_url+"plugins/"+plugin+"/popups/"+popup;}else{url=_typo3_host_url+_editor_url+this.config.popupURL+file;};return url;};HTMLArea.getInnerText=function(el){var txt='',i;for(i=el.firstChild;i;i=i.nextSibling){if(i.nodeType==3)txt+=i.data;else if(i.nodeType==1)txt+=HTMLArea.getInnerText(i);};return txt;};HTMLArea._wordClean=function(editor,html){function clearClass(node){var newc=node.className.replace(/(^|\s)mso.*?(\s|$)/ig,' ');if(newc!=node.className){node.className=newc;if(!/\S/.test(node.className))node.removeAttribute("className");}};function clearStyle(node){if(HTMLArea.is_ie)var style=node.style.cssText;else var style=node.getAttribute("style");if(style){var declarations=style.split(/\s*;\s*/);for(var i=declarations.length;--i>=0;){if(/^mso|^tab-stops/i.test(declarations[i])||/^margin\s*:\s*0..\s+0..\s+0../i.test(declarations[i]))declarations.splice(i,1);};node.setAttribute("style",declarations.join("; "));}};function stripTag(el){if(HTMLArea.is_ie){el.outerHTML=HTMLArea.htmlEncode(el.innerText);}else{var txt=document.createTextNode(HTMLArea.getInnerText(el));el.parentNode.insertBefore(txt,el);el.parentNode.removeChild(el);}};function checkEmpty(el){if(/^(span|b|strong|i|em|font)$/i.test(el.tagName)&&!el.firstChild)el.parentNode.removeChild(el);};function parseTree(root){var tag=root.tagName.toLowerCase(),i,next;if((HTMLArea.is_ie&&root.scopeName!='HTML')||(!HTMLArea.is_ie&&/:/.test(tag))||/o:p/.test(tag)){stripTag(root);return false;}else{clearClass(root);clearStyle(root);for(i=root.firstChild;i;i=next){next=i.nextSibling;if(i.nodeType==1&&parseTree(i)){checkEmpty(i);}}};return true;};parseTree(html);};HTMLArea.wordCleanLater=function(editorNumber,doUpdateToolbar){var editor=RTEarea[editorNumber]["editor"];HTMLArea._wordClean(editor,editor._doc.body);if(doUpdateToolbar)editor.updateToolbar();};HTMLArea.cleanWordOnPaste=function(ev){if(!ev)var ev=window.event;var target=(ev.target)?ev.target:ev.srcElement;var owner=(target.ownerDocument)?target.ownerDocument:target;while(HTMLArea.is_ie&&owner.parentElement){owner=owner.parentElement;};if(typeof(browserWin)!="undefined")browserWin.close();window.setTimeout("HTMLArea.wordCleanLater("+owner._editorNo+", true);",250);};HTMLArea.prototype.forceRedraw=function(){this._doc.body.style.visibility="hidden";this._doc.body.style.visibility="visible";};HTMLArea.prototype.focusEditor=function(){switch(this._editMode){case "wysiwyg":try{if(HTMLArea.is_safari)this._doc.focus();else this._iframe.contentWindow.focus();}catch(e){};break;case "textmode":this._textArea.focus();break;};return this._doc;};HTMLArea.undoTakeSnapshot=function(editorNumber){var editor=RTEarea[editorNumber]["editor"];if(editor._doc)editor._undoTakeSnapshot();};HTMLArea.prototype._undoTakeSnapshot=function(){var curTime=(new Date()).getTime();var newOne=true;if(this._undoPos>=this.config.undoSteps){this._undoQueue.shift();--this._undoPos;};if(this._undoPos<0||this._undoQueue[this._undoPos].time<curTime-this.config.undoTimeout){++this._undoPos;}else{newOne=false;};var txt=this.getInnerHTML();if(newOne){if(this._undoPos==0||this._undoQueue[this._undoPos-1].text!=txt){this._undoQueue[this._undoPos]={text:txt,time:curTime};this._undoQueue.length=this._undoPos+1;}else{this._undoPos--;}}else{if(this._undoQueue[this._undoPos].text!=txt){this._undoQueue[this._undoPos].text=txt;this._undoQueue.length=this._undoPos+1;}}};HTMLArea.setUndoQueueLater=function(editorNumber,op){var editor=RTEarea[editorNumber]["editor"];if(op=="undo"){editor.setHTML(editor._undoQueue[--editor._undoPos].text);}else if(op=="redo"){if(editor._undoPos<editor._undoQueue.length-1)editor.setHTML(editor._undoQueue[++editor._undoPos].text);}};HTMLArea.prototype.undo=function(){if(this._undoPos>0){this._undoTakeSnapshot();if(!HTMLArea.is_opera)this.setHTML(this._undoQueue[--this._undoPos].text);else window.setTimeout("HTMLArea.setUndoQueueLater("+this._editorNumber+", 'undo');",10);}};HTMLArea.prototype.redo=function(){if(this._undoPos<this._undoQueue.length-1){this._undoTakeSnapshot();if(!HTMLArea.is_opera){if(this._undoPos<this._undoQueue.length-1)this.setHTML(this._undoQueue[++this._undoPos].text);}else{window.setTimeout("HTMLArea.setUndoQueueLater("+this._editorNumber+", 'redo');",10);}}};HTMLArea.updateToolbar=function(editorNumber){var editor=RTEarea[editorNumber]["editor"];editor.updateToolbar();editor._timerToolbar=null;};HTMLArea.prototype.updateToolbar=function(noStatus){var doc=this._doc,text=(this._editMode=="textmode"),selection=this.hasSelectedText(),ancestors=null,cls=new Array(),txt,txtClass,i,cmd,inContext,match,matchAny,k,j,n,commandState;if(!text){ancestors=this.getAllAncestors();if(this.config.statusBar&&!noStatus){if(this._statusBarTree.hasChildNodes()){for(i=this._statusBarTree.firstChild;i;i=i.nextSibling){if(i.nodeName.toLowerCase()=="a"){HTMLArea._removeEvents(i,["click","contextmenu, mousedown"],HTMLArea.statusBarHandler);i.el=null;i.editor=null;}}};this._statusBarTree.innerHTML='';this._statusBarTree.appendChild(document.createTextNode(HTMLArea.I18N.msg["Path"]+": "));for(i=ancestors.length;--i>=0;){var el=ancestors[i];if(!el)continue;var a=document.createElement("a");a.href="#";a.el=el;a.editor=this;if(!HTMLArea.is_opera){HTMLArea._addEvents(a,["click","contextmenu"],HTMLArea.statusBarHandler);}else{HTMLArea._addEvents(a,["mousedown","click"],HTMLArea.statusBarHandler);};txt=el.tagName.toLowerCase();if(!HTMLArea.is_opera)a.title=el.style.cssText;a.title=el.style.cssText;if(el.id){txt+="#"+el.id;};if(el.className){txtClass="";cls=el.className.trim().split(" ");for(j=cls.length;j>0;){if(!HTMLArea.reservedClassNames.test(cls[--j])){txtClass="."+cls[j];}};txt+=txtClass;};a.appendChild(document.createTextNode(txt));this._statusBarTree.appendChild(a);if(i!=0)this._statusBarTree.appendChild(document.createTextNode(String.fromCharCode(0xbb)));}}};for(i in this._toolbarObjects){var btn=this._toolbarObjects[i];cmd=i;inContext=true;if(btn.context&&!text){inContext=false;var attrs=[];var contexts=[];if(/(.*)\[(.*?)\]/.test(btn.context)){contexts=RegExp.$1.split(",");attrs=RegExp.$2.split(",");}else{contexts=btn.context.split(",");};for(j=contexts.length;--j>=0;)contexts[j]=contexts[j].toLowerCase();matchAny=(contexts[0]=="*");for(k=0;k<ancestors.length;++k){if(!ancestors[k])continue;match=false;for(j=contexts.length;--j>=0;)match=match||(ancestors[k].tagName.toLowerCase()==contexts[j]);if(matchAny||match){inContext=true;for(j=attrs.length;--j>=0;){if(!eval("ancestors[k]."+attrs[j])){inContext=false;break;}};if(inContext)break;}}};if(cmd=="CreateLink")btn.state("enabled",(!text||btn.text)&&(inContext||selection));else btn.state("enabled",(!text||btn.text)&&inContext&&(selection||!btn.selection));if(typeof(cmd)=="function"){continue;};var dropdown=this.config.customSelects[cmd];if((!text||btn.text)&&(typeof(dropdown)!="undefined")){dropdown.refresh(this);continue;};switch(cmd){case "FontName":case "FontSize":if(!text)try{var value=(""+doc.queryCommandValue(cmd)).toLowerCase();if(!value){document.getElementById(btn.elementId).selectedIndex=0;break;};var options=this.config[cmd];k=0;for(j in options){if((j.toLowerCase()==value)||(options[j].substr(0,value.length).toLowerCase()==value)){document.getElementById(btn.elementId).selectedIndex=k;throw "ok";};++k;};document.getElementById(btn.elementId).selectedIndex=0;}catch(e){};break;case "FormatBlock":var blocks=[];for(var i in this.config['FormatBlock']){blocks[blocks.length]=this.config['FormatBlock'][i];};var deepestAncestor=this._getFirstAncestor(this._getSelection(),blocks);if(deepestAncestor){for(var x=0;x<blocks.length;x++){if(blocks[x].toLowerCase()==deepestAncestor.tagName.toLowerCase())document.getElementById(btn.elementId).selectedIndex=x;}}else{document.getElementById(btn.elementId).selectedIndex=0;};break;case "TextIndicator":if(!text){try{with(document.getElementById(btn.elementId).style){backgroundColor=HTMLArea._makeColor(doc.queryCommandValue((HTMLArea.is_ie||HTMLArea.is_safari)?"BackColor":"HiliteColor"));if(/transparent/i.test(backgroundColor)){backgroundColor=HTMLArea._makeColor(doc.queryCommandValue("BackColor"));}color=HTMLArea._makeColor(doc.queryCommandValue("ForeColor"));fontFamily=doc.queryCommandValue("FontName");fontWeight="normal";fontStyle="normal";try{fontWeight=doc.queryCommandState("Bold")?"bold":"normal";}catch(ex){fontWeight="normal";};try{fontStyle=doc.queryCommandState("Italic")?"italic":"normal";}catch(ex){fontStyle="normal";};}}catch(e){}};break;case "HtmlMode":btn.state("active",text);break;case "LeftToRight":case "RightToLeft":var el=this.getParentElement();while(el&&!HTMLArea.isBlockElement(el)){el=el.parentNode;};if(el)btn.state("active",(el.style.direction==((cmd=="RightToLeft")?"rtl":"ltr")));break;case "Bold":case "Italic":case "StrikeThrough":case "Underline":case "Subscript":case "Superscript":case "JustifyLeft":case "JustifyCenter":case "JustifyRight":case "JustifyFull":case "Indent":case "Outdent":case "InsertOrderedList":case "InsertUnorderedList":commandState=false;if(!text)try{commandState=doc.queryCommandState(cmd);}catch(e){commandState=false;};btn.state("active",commandState);break;default:break;}};if(this._customUndo)this._undoTakeSnapshot();for(i in this.plugins){var plugin=this.plugins[i].instance;if(typeof(plugin.onUpdateToolbar)=="function")plugin.onUpdateToolbar();}};HTMLArea.prototype.surroundHTML=function(startTag,endTag){this.insertHTML(startTag+this.getSelectedHTML().replace(HTMLArea.Reg_body,"")+endTag);};HTMLArea.prototype.convertNode=function(el,newTagName){var newel=this._doc.createElement(newTagName),p=el.parentNode;while(el.firstChild)newel.appendChild(el.firstChild);p.insertBefore(newel,el);p.removeChild(el);return newel;};HTMLArea.getElementObject=function(el,tagName){var oEl=el;while(oEl!=null&&oEl.nodeName.toLowerCase()!=tagName)oEl=oEl.parentNode;return oEl;};HTMLArea.prototype.makeNestedList=function(el){var previous,clone;for(var i=el.firstChild;i;i=i.nextSibling){if(/^li$/i.test(i.tagName)){for(var j=i.firstChild;j;j=j.nextSibling){if(/^(ol|ul)$/i.test(j.tagName))this.makeNestedList(j);}}else if(/^(ol|ul)$/i.test(i.tagName)){previous=i.previousSibling;var clone=i.cloneNode(true);if(!previous){previous=el.insertBefore(this._doc.createElement("li"),i);previous.appendChild(clone);}else{previous.appendChild(clone);};HTMLArea.removeFromParent(i);this.makeNestedList(el);break;}}};HTMLArea.prototype.hasSelectedText=function(){return this.getSelectedHTML()!="";};HTMLArea.prototype.getAllAncestors=function(){var p=this.getParentElement();var a=[];while(p&&(p.nodeType==1)&&(p.tagName.toLowerCase()!='body')){a.push(p);p=p.parentNode;};a.push(this._doc.body);return a;};HTMLArea.prototype._getFirstAncestor=function(sel,types){var prnt=this._activeElement(sel);if(prnt==null){try{prnt=(HTMLArea.is_ie?this._createRange(sel).parentElement():this._createRange(sel).commonAncestorContainer);}catch(e){return null;}};if(typeof(types)=='string')types=[types];while(prnt){if(prnt.nodeType==1){if(types==null)return prnt;for(var i=0;i<types.length;i++){if(prnt.tagName.toLowerCase()==types[i])return prnt;};if(prnt.tagName.toLowerCase()=='body')break;if(prnt.tagName.toLowerCase()=='table')break;};prnt=prnt.parentNode;};return null;};HTMLArea.createLinkDialog=function(editor,link){return(function(param){if(!param||typeof(param.f_href)=="undefined")return false;var a=link;if(!a)try{editor._doc.execCommand("CreateLink",false,param.f_href);a=editor.getParentElement();var sel=editor._getSelection();var range=editor._createRange(sel);if(!HTMLArea.is_ie){a=range.startContainer;if(!/^a$/i.test(a.tagName)){a=a.nextSibling;if(a==null)a=range.startContainer.parentNode;}}}catch(e){}else{var href=param.f_href.trim();editor.selectNodeContents(a);if(href==""){editor._doc.execCommand("Unlink",false,null);editor.updateToolbar();return false;}else{a.href=href;}};if(!(a&&/^a$/i.test(a.tagName)))return false;if(typeof(param.f_target)!="undefined")a.target=param.f_target.trim();if(typeof(param.f_title)!="undefined")a.title=param.f_title.trim();editor.selectNodeContents(a);editor.updateToolbar();editor=null;link=null;});};HTMLArea.prototype._createLink=function(link){var outparam=null;this.focusEditor();if(typeof(link)=="undefined"){link=this.getParentElement();if(link){if(/^img$/i.test(link.tagName))link=link.parentNode;if(!/^a$/i.test(link.tagName))link=null;}};if(!link){var sel=this._getSelection();if(this._selectionEmpty(sel)){alert("You need to select some text before creating a link");return;};outparam={f_href:'',f_title:'',f_target:'',f_usetarget:this.config.makeLinkShowsTarget};}else{outparam={f_href:HTMLArea.is_ie?this.stripBaseURL(link.href):link.getAttribute("href"),f_title:link.title,f_target:link.target,f_usetarget:this.config.makeLinkShowsTarget};};var createLinkDialogFunctRef=HTMLArea.createLinkDialog(this,link);this._popupDialog("link.html",createLinkDialogFunctRef,outparam,450,145);};HTMLArea.insertImageDialog=function(editor,image){return(function(param){if(!param||typeof(param.f_url)=="undefined")return false;var img=image;if(!img){var sel=editor._getSelection();var range=editor._createRange(sel);editor._doc.execCommand("InsertImage",false,param.f_url);if(HTMLArea.is_ie){img=range.parentElement();if(img.tagName.toLowerCase()!="img")img=img.previousSibling;}else{var sel=editor._getSelection();var range=editor._createRange(sel);img=range.startContainer;if(HTMLArea.is_opera)img=img.parentNode;img=img.lastChild;while(img&&img.nodeName.toLowerCase()!="img")img=img.previousSibling;}}else{img.src=param.f_url;};for(var field in param){var value=param[field];switch(field){case "f_alt":img.alt=value;break;case "f_border":if(parseInt(value)){img.style.borderWidth=parseInt(value)+"px";img.style.borderStyle="solid";}else{img.style.borderWidth="";img.style.borderStyle="none";};break;case "f_align":img.style.verticalAlign=value;break;case "f_vert":if(parseInt(value)){img.style.marginTop=parseInt(value)+"px";img.style.marginBottom=parseInt(value)+"px";}else{img.style.marginTop="";img.style.marginBottom="";};break;case "f_horiz":if(parseInt(value)){img.style.marginLeft=parseInt(value)+"px";img.style.marginRight=parseInt(value)+"px";}else{img.style.marginLeft="";img.style.marginRight="";};break;case "f_float":if(HTMLArea.is_ie)img.style.styleFloat=value;else img.style.cssFloat=value;break;}}editor=null;image=null;});};HTMLArea.prototype._insertImage=function(image){var outparam=null;this.focusEditor();if(typeof(image)=="undefined"){var image=this.getParentElement();if(image&&!/^img$/i.test(image.tagName))image=null;};if(image)outparam={f_base:this.config.baseURL,f_url:image.getAttribute("src"),f_alt:image.alt,f_border:isNaN(parseInt(image.style.borderWidth))?"":parseInt(image.style.borderWidth),f_align:image.style.verticalAlign,f_vert:isNaN(parseInt(image.style.marginTop))?"":parseInt(image.style.marginTop),f_horiz:isNaN(parseInt(image.style.marginLeft))?"":parseInt(image.style.marginLeft),f_float:HTMLArea.is_ie?image.style.styleFloat:image.style.cssFloat};var insertImageDialogFunctRef=HTMLArea.insertImageDialog(this,image);this._popupDialog("insert_image.html",insertImageDialogFunctRef,outparam,580,460);};HTMLArea.insertTableDialog=function(editor,sel,range){return(function(param){if(!param)return false;var doc=editor._doc;var table=doc.createElement("table");for(var field in param){var value=param[field];if(!value)continue;switch(field){case "f_width":if(value!="")table.style.width=parseInt(value)+param["f_unit"];break;case "f_align":table.style.textAlign=value;break;case "f_border":if(value!=""){table.style.borderWidth=parseInt(value)+"px";table.style.borderStyle="solid";};break;case "f_spacing":if(value!="")table.cellSpacing=parseInt(value);break;case "f_padding":if(value!="")table.cellPadding=parseInt(value);break;case "f_float":if(HTMLArea.is_ie)table.style.styleFloat=((value!="not set")?value:"");else table.style.cssFloat=((value!="not set")?value:"");break;}};var cellwidth=0;if(param.f_fixed)cellwidth=Math.floor(100/parseInt(param.f_cols));var tbody=doc.createElement("tbody");table.appendChild(tbody);for(var i=param["f_rows"];i>0;i--){var tr=doc.createElement("tr");tbody.appendChild(tr);for(var j=param["f_cols"];j>0;j--){var td=doc.createElement("td");if(cellwidth)td.style.width=cellwidth+"%";tr.appendChild(td);}}editor.focusEditor();if(HTMLArea.is_ie)range.pasteHTML(table.outerHTML);else editor.insertNodeAtSelection(table);editor.forceRedraw();if(HTMLArea.is_gecko&&!HTMLArea.is_safari)editor.setMode("wysiwyg");editor.updateToolbar();editor=null;sel=null;range=null;return true;});};HTMLArea.prototype._insertTable=function(){var sel=this._getSelection();var range=this._createRange(sel);this.focusEditor();var insertTableDialogFunctRef=HTMLArea.insertTableDialog(this,sel,range);this._popupDialog("insert_table.html",insertTableDialogFunctRef,this,520,230);};HTMLArea.selectColorDialog=function(editor,cmdID){return(function(color){if(color)editor._doc.execCommand(cmdID,false,"#"+color);});};HTMLArea.prototype.execCommand=function(cmdID,UI,param){this.focusEditor();if(HTMLArea.is_gecko&&!this.config.useCSS&&!HTMLArea.is_safari&&!HTMLArea.is_opera){try{this._doc.execCommand((this.config.styleWithCSS?"styleWithCSS":"useCSS"),false,(this.config.styleWithCSS?false:true));}catch(e){};}switch(cmdID){case "HtmlMode":this.setMode();break;case "SplitBlock":this._doc.execCommand('FormatBlock',false,((HTMLArea.is_ie||HTMLArea.is_safari)?"<div>":"div"));break;case "HiliteColor":(HTMLArea.is_ie||HTMLArea.is_safari)&&(cmdID="BackColor");case "ForeColor":var colorDialogFunctRef=HTMLArea.selectColorDialog(this,cmdID);this._popupDialog("select_color.html",colorDialogFunctRef,HTMLArea._colorToRgb(this._doc.queryCommandValue(cmdID)),200,182);break;case "CreateLink":this._createLink();break;case "Undo":case "Redo":if(this._customUndo)this[cmdID.toLowerCase()]();else this._doc.execCommand(cmdID,UI,param);break;case "InsertTable":this._insertTable();break;case "InsertImage":this._insertImage();break;case "About":this._popupDialog("about.html",null,this,475,350);break;case "CleanWord":HTMLArea._wordClean(this,this._doc.body);break;case "Cut":case "Copy":case "Paste":try{this._doc.execCommand(cmdID,false,null);if(cmdID=="Paste"&&this.config.cleanWordOnPaste)HTMLArea._wordClean(this,this._doc.body);}catch(e){if(HTMLArea.is_gecko&&!HTMLArea.is_safari&&!HTMLArea.is_opera)this._mozillaPasteException(cmdID,UI,param);}break;case "LeftToRight":case "RightToLeft":var dir=(cmdID=="RightToLeft")?"rtl":"ltr";var el=this.getParentElement();while(el&&!HTMLArea.isBlockElement(el))el=el.parentNode;if(el){if(el.style.direction==dir)el.style.direction="";else el.style.direction=dir;}break;case "Indent":var el=this.getParentElement();while(el&&(!HTMLArea.isBlockElement(el)||/^li$/i.test(el.nodeName)))el=el.parentNode;try{this._doc.execCommand(cmdID,UI,param);}catch(e){if(this.config.debug)alert(e+"\n\nby execCommand("+cmdID+");");}if(/^(ol|ul)$/i.test(el.nodeName)){this.makeNestedList(el);this.selectNodeContents(el);}break;case "FontSize":case "FontName":if(param){this._doc.execCommand(cmdID,UI,param);break;}else{var sel=this._getSelection();if(HTMLArea.is_gecko&&sel.isCollapsed){var fontNode=this._getFirstAncestor(sel,"font");if(fontNode!=null)this.selectNode(fontNode);}this._doc.execCommand("RemoveFormat",UI,null);if(HTMLArea.is_gecko&&fontNode!=null){sel=this._getSelection();var r=this._createRange(sel).cloneRange();r.collapse(false);if(HTMLArea.is_safari){sel.empty();sel.setBaseAndExtent(r.startContainer,r.startOffset,r.endContainer,r.endOffset);}else{sel.removeAllRanges();sel.addRange(r);}}}break;default:try{this._doc.execCommand(cmdID,UI,param);}catch(e){if(this.config.debug)alert(e+"\n\nby execCommand("+cmdID+");");}}this.updateToolbar();return false;};HTMLArea._editorEvent=function(ev){if(!ev)var ev=window.event;var target=(ev.target)?ev.target:ev.srcElement;var owner=(target.ownerDocument)?target.ownerDocument:target;if(HTMLArea.is_ie){while(owner.parentElement){owner=owner.parentElement;}}var editor=RTEarea[owner._editorNo]["editor"];var keyEvent=((HTMLArea.is_ie||HTMLArea.is_safari)&&ev.type=="keydown")||(!HTMLArea.is_ie&&ev.type=="keypress");editor.focusEditor();if(keyEvent){if(editor._hasPluginWithOnKeyPressHandler){for(var i in editor.plugins){var plugin=editor.plugins[i].instance;if(typeof(plugin.onKeyPress)=="function"){if(plugin.onKeyPress(ev))return false;}}}if(ev.ctrlKey){if(!ev.altKey){var key=String.fromCharCode((HTMLArea.is_ie||HTMLArea.is_safari||HTMLArea.is_opera)?ev.keyCode:ev.charCode).toLowerCase();if(HTMLArea.is_gecko&&ev.keyCode==32)key=String.fromCharCode(ev.keyCode).toLowerCase();var cmd=null;var value=null;switch(key){case '1':case '2':case '3':case '4':case '5':case '6':if(editor._toolbarObjects["FormatBlock"]){cmd="FormatBlock";value="h"+key;if(HTMLArea.is_ie||HTMLArea.is_safari)value="<"+value+">";}break;case ' ':editor.insertHTML("&nbsp;");editor.updateToolbar();HTMLArea._stopEvent(ev);return false;default:if(editor.config.hotKeyList[key]){switch(editor.config.hotKeyList[key]){case "SelectAll":case "CleanWord":cmd=editor.config.hotKeyList[key];break;case "Paste":if(HTMLArea.is_ie||HTMLArea.is_safari){cmd=editor.config.hotKeyList[key];}else if(editor.config.cleanWordOnPaste){window.setTimeout("HTMLArea.wordCleanLater("+owner._editorNo+", false);",50);}break;default:if(editor._toolbarObjects[editor.config.hotKeyList[key]]){cmd=editor.config.hotKeyList[key];if(cmd=="FormatBlock")value=(HTMLArea.is_ie||HTMLArea.is_safari)?"<p>":"p";}}}}if(cmd){editor.execCommand(cmd,false,value);HTMLArea._stopEvent(ev);return false;}else{editor.updateToolbar();}}}else if(ev.altKey){if(editor.plugins['ContextMenu']&&editor.plugins['ContextMenu'].instance){var keys=editor.plugins['ContextMenu'].instance.keys;if(keys.length>0){var k;for(var i=keys.length;--i>=0;){k=keys[i];if(k[0].toLowerCase()==key){HTMLArea._stopEvent(ev);return false;}}}}}else if(keyEvent){if(HTMLArea.is_gecko)editor._detectURL(ev);switch(ev.keyCode){case 13:if(HTMLArea.is_gecko&&!ev.shiftKey&&!editor.config.disableEnterParagraphs){editor._checkInsertP();HTMLArea._stopEvent(ev);editor.updateToolbar();}break;case 8:case 46:if((HTMLArea.is_gecko&&!ev.shiftKey)||HTMLArea.is_ie){if(editor._checkBackspace())HTMLArea._stopEvent(ev);}if(editor._timerToolbar)window.clearTimeout(editor._timerToolbar);editor._timerToolbar=window.setTimeout("HTMLArea.updateToolbar("+editor._editorNumber+");",50);break;case 9:if(HTMLArea.is_gecko){editor.execCommand((ev.shiftKey?"Outdent":"Indent"),false,null);HTMLArea._stopEvent(ev);return false;}break;case 37:case 39:if(HTMLArea.is_ie){editor._timerToolbar=window.setTimeout("HTMLArea.updateToolbar("+editor._editorNumber+");",10);break;}}}}else{if(editor._timerToolbar)window.clearTimeout(editor._timerToolbar);if(ev.type=="mouseup")editor.updateToolbar();else editor._timerToolbar=window.setTimeout("HTMLArea.updateToolbar("+editor._editorNumber+");",50);}};HTMLArea.prototype.scrollToCaret=function(){var e=this.getParentElement(),w=this._iframe.contentWindow?this._iframe.contentWindow:window,h=w.innerHeight||w.height,d=this._doc,t=d.documentElement.scrollTop||d.body.scrollTop;if(typeof(h)=="undefined")return false;if(e.offsetTop>h+t)w.scrollTo(e.offsetLeft,e.offsetTop-h+e.offsetHeight);};HTMLArea.prototype.getHTML=function(){switch(this._editMode){case "wysiwyg":if(!this.config.fullPage){return HTMLArea.getHTML(this._doc.body,false,this);}else{return this.doctype+"\n"+HTMLArea.getHTML(this._doc.documentElement,true,this);}case "textmode":return this._textArea.value;}return false;};HTMLArea.prototype.getInnerHTML=function(){switch(this._editMode){case "wysiwyg":if(!this.config.fullPage)return this._doc.body.innerHTML;else return this.doctype+"\n"+this._doc.documentElement.innerHTML;case "textmode":return this._textArea.value;}return false;};HTMLArea.prototype.setHTML=function(html){switch(this._editMode){case "wysiwyg":if(!this.config.fullPage)this._doc.body.innerHTML=html;else this._doc.body.innerHTML=html;break;case "textmode":this._textArea.value=html;break;}return false;};HTMLArea.prototype.setDoctype=function(doctype){this.doctype=doctype;};HTMLArea._object=null;HTMLArea.checkSupportedBrowser=function(){if(HTMLArea.is_gecko&&!HTMLArea.is_safari&&!HTMLArea.is_opera){if(navigator.productSub<20030210)return false;}return HTMLArea.is_gecko||HTMLArea.is_ie;};HTMLArea._eventCacheConstructor=function(){var listEvents=[];return({listEvents:listEvents,add:function(node,sEventName,fHandler){listEvents.push(arguments);},flush:function(){var item;for(var i=listEvents.length;--i>=0;){item=listEvents[i];try{HTMLArea._removeEvent(item[0],item[1],item[2]);item[0][item[1]]=null;item[0]=null;item[2]=null;}catch(e){}}}});};HTMLArea._addEvent=function(el,evname,func,useCapture){if(typeof(useCapture)=="undefined")var useCapture=false;if(HTMLArea.is_gecko){el.addEventListener(evname,func,!HTMLArea.is_opera||useCapture);}else{el.attachEvent("on"+evname,func);}HTMLArea._eventCache.add(el,evname,func);};HTMLArea._addEvents=function(el,evs,func,useCapture){if(typeof(useCapture)=="undefined")var useCapture=false;for(var i=evs.length;--i>=0;){HTMLArea._addEvent(el,evs[i],func,useCapture);}};HTMLArea._removeEvent=function(el,evname,func){if(HTMLArea.is_gecko){try{el.removeEventListener(evname,func,true);el.removeEventListener(evname,func,false);}catch(e){}}else{try{el.detachEvent("on"+evname,func);}catch(e){}}};HTMLArea._removeEvents=function(el,evs,func){for(var i=evs.length;--i>=0;){HTMLArea._removeEvent(el,evs[i],func);}};HTMLArea._stopEvent=function(ev){if(HTMLArea.is_gecko){ev.stopPropagation();ev.preventDefault();}else{ev.cancelBubble=true;ev.returnValue=false;}};HTMLArea._removeClass=function(el,removeClassName){if(!(el&&el.className))return;var cls=el.className.trim().split(" ");var ar=new Array();for(var i=cls.length;i>0;){if(cls[--i]!=removeClassName)ar[ar.length]=cls[i];}if(ar.length==0){if(!HTMLArea.is_opera)el.removeAttribute(HTMLArea.is_gecko?"class":"className");else el.className='';}else el.className=ar.join(" ");};HTMLArea._addClass=function(el,addClassName){HTMLArea._removeClass(el,addClassName);if(el.className)el.className+=" "+addClassName;else el.className=addClassName;};HTMLArea._hasClass=function(el,className){if(!el||!el.className)return false;var cls=el.className.split(" ");for(var i=cls.length;i>0;){if(cls[--i]==className)return true;}return false;};HTMLArea.RE_blockTags=/^(body|p|h1|h2|h3|h4|h5|h6|ul|ol|pre|dl|div|noscript|blockquote|form|hr|table|fieldset|address|td|tr|th|li|tbody|thead|tfoot|iframe|object)$/;HTMLArea.isBlockElement=function(el){return el&&el.nodeType==1&&HTMLArea.RE_blockTags.test(el.nodeName.toLowerCase());};HTMLArea.RE_closingTags=/^(p|span|a|li|ol|ul|dl|dt|td|th|tr|tbody|thead|tfoot|caption|table|div|em|i|strong|b|code|cite|blockquote|q|dfn|abbr|acronym|font|center|object|embed|tt|style|script|title|head)$/;HTMLArea.RE_noClosingTag=/^(img|br|hr|input|area|base|link|meta|param)$/;HTMLArea.needsClosingTag=function(el){return el&&el.nodeType==1&&!HTMLArea.RE_noClosingTag.test(el.tagName.toLowerCase());};HTMLArea.htmlDecode=function(str){str=str.replace(/&lt;/g,"<").replace(/&gt;/g,">");str=str.replace(/&nbsp;/g,"\xA0");str=str.replace(/&quot;/g,"\x22");str=str.replace(/&#39;/g,"'");str=str.replace(/&amp;/g,"&");return str;};HTMLArea.htmlEncode=function(str){if(typeof(str)!='string')str=str.toString();str=HTMLArea.htmlDecode(str);str=str.replace(/&/g,"&amp;");str=str.replace(/</g,"&lt;").replace(/>/g,"&gt;");str=str.replace(/\xA0/g,"&nbsp;");str=str.replace(/\x22/g,"&quot;");str=str.replace(HTMLArea.Reg_entities,"&$1;");return str;};HTMLArea.getHTML=function(root,outputRoot,editor){try{return HTMLArea.getHTMLWrapper(root,outputRoot,editor);}catch(e){HTMLArea._appendToLog("The HTML document is not well-formed.");if(!HTMLArea._debugMode)alert(HTMLArea.I18N.msg["HTML-document-not-well-formed"]);else return HTMLArea.getHTMLWrapper(root,outputRoot,editor);return editor._doc.body.innerHTML;}};HTMLArea.getHTMLWrapper=function(root,outputRoot,editor){var html="";if(!root)return html;switch(root.nodeType){case 1:case 11:case 9:var closed,i,config=editor.config;var root_tag=(root.nodeType==1)?root.tagName.toLowerCase():'';if(root_tag=='br'&&config.removeTrailingBR&&!root.nextSibling&&HTMLArea.isBlockElement(root.parentNode)&&(!root.previousSibling||root.previousSibling.nodeName.toLowerCase()!='br'))break;if(config.htmlRemoveTagsAndContents&&config.htmlRemoveTagsAndContents.test(root_tag))break;var custom_tag=(config.customTags&&config.customTags.test(root_tag));if(outputRoot)outputRoot=!(config.htmlRemoveTags&&config.htmlRemoveTags.test(root_tag));if((HTMLArea.is_ie||HTMLArea.is_safari)&&root_tag=="head"){if(outputRoot)html+="<head>";var save_multiline=RegExp.multiline;RegExp.multiline=true;var txt=root.innerHTML.replace(HTMLArea.RE_tagName,function(str,p1,p2){return p1+p2.toLowerCase();});RegExp.multiline=save_multiline;html+=txt;if(outputRoot)html+="</head>";break;}else if(outputRoot){if(HTMLArea.is_gecko&&root.hasAttribute('_moz_editor_bogus_node'))break;closed=(!(root.hasChildNodes()||HTMLArea.needsClosingTag(root)||custom_tag));html="<"+root_tag;var a,name,value,attrs=root.attributes;var n=attrs.length;for(i=attrs.length;--i>=0;){a=attrs.item(i);name=a.nodeName.toLowerCase();if((!a.specified&&name!='value')||/_moz|contenteditable|_msh/.test(name))continue;if(!HTMLArea.is_ie||name!="style"){if(typeof(root[a.nodeName])!="undefined"&&name!="href"&&name!="src"&&name!="style"&&!/^on/.test(name)){value=root[a.nodeName];}else{value=a.nodeValue;if(HTMLArea.is_ie&&(name=="href"||name=="src"))value=editor.stripBaseURL(value);}}else{value=root.style.cssText;}if(/(_moz|^$)/.test(value))continue;if(HTMLArea.is_ie&&root_tag=="li"&&name=="value"&&a.nodeValue==0)continue;html+=" "+name+'="'+HTMLArea.htmlEncode(value)+'"';}if(html!="")html+=closed?" />":">";}for(i=root.firstChild;i;i=i.nextSibling){if(/^li$/i.test(i.tagName)&&!/^[ou]l$/i.test(root.tagName))html +="<ul>" +HTMLArea.getHTMLWrapper(i,true,editor)+"</ul>";else html+=HTMLArea.getHTMLWrapper(i,true,editor);}if(outputRoot&&!closed)html+="</"+root_tag+">";break;case 3:html=/^(script|style)$/i.test(root.parentNode.tagName)?root.data:HTMLArea.htmlEncode(root.data);break;case 8:if(!editor.config.htmlRemoveComments)html="<!--"+root.data+"-->";break;case 4:html+='<![CDATA['+root.data+']]>';break;case 5:html+='&'+root.nodeValue+';';break;case 7:html+='<?'+root.target+' '+root.data+' ?>';break;default:break;}return html;};HTMLArea.getPrevNode=function(node){if(!node)return null;if(node.previousSibling)return node.previousSibling;if(node.parentNode)return node.parentNode;return null;};HTMLArea.getNextNode=function(node){if(!node)return null;if(node.nextSibling)return node.nextSibling;if(node.parentNode)return node.parentNode;return null;};HTMLArea.removeFromParent=function(el){if(!el.parentNode)return;var pN=el.parentNode;pN.removeChild(el);return el;};HTMLArea.prototype.stripBaseURL=function(string){var baseurl=this.config.baseURL;baseurl=baseurl.replace(/[^\/]+$/,'');var basere=new RegExp(baseurl);string=string.replace(basere,"");baseurl=baseurl.replace(/^(https?:\/\/[^\/]+)(.*)$/,'$1');basere=new RegExp(baseurl);return string.replace(basere,"");};String.prototype.trim=function(){return this.replace(/^\s+/,'').replace(/\s+$/,'');};HTMLArea._makeColor=function(v){if(typeof(v)!="number"){return v;}var r=v&0xFF;var g=(v>>8)&0xFF;var b=(v>>16)&0xFF;return "rgb("+r+","+g+","+b+")";};HTMLArea._colorToRgb=function(v){if(!v)return '';function hex(d){return(d<16)?("0"+d.toString(16)):d.toString(16);};if(typeof(v)=="number"){var r=v&0xFF;var g=(v>>8)&0xFF;var b=(v>>16)&0xFF;return "#"+hex(r)+hex(g)+hex(b);}if(v.substr(0,3)=="rgb"){var re=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/;if(v.match(re)){var r=parseInt(RegExp.$1);var g=parseInt(RegExp.$2);var b=parseInt(RegExp.$3);return "#"+hex(r)+hex(g)+hex(b);}return null;}if(v.substr(0,1)=="#"){return v;}return null;};HTMLArea._postback=function(url,data,handler,addParams,charset){if(typeof(charset)=="undefined")var charset="utf-8";var req=null;if(window.XMLHttpRequest)req=new XMLHttpRequest();else if(window.ActiveXObject){var success=false;for(var k=0;k<HTMLArea.MSXML_XMLHTTP_PROGIDS.length&&!success;k++){try{req=new ActiveXObject(HTMLArea.MSXML_XMLHTTP_PROGIDS[k]);success=true;}catch(e){}}}if(req){var content='';for(var i in data)content+=(content.length?'&':'')+i+'='+encodeURIComponent(data[i]);content+=(content.length?'&':'')+'charset='+charset;if(typeof(addParams)!="undefined")content+=addParams;if(url.substring(0,1)=='/'){var postUrl=_typo3_host_url+url;}else{var postUrl=_typo3_host_url+_editor_url+url;}function callBack(){if(req.readyState==4){if(req.status==200){if(typeof(handler)=='function')handler(req.responseText,req);HTMLArea._appendToLog("[HTMLArea::_postback]: Server response: "+req.responseText);}else{HTMLArea._appendToLog("ERROR [HTMLArea::_postback]: Unable to post "+postUrl+" . Server reported "+req.statusText);}}}req.onreadystatechange=callBack;function sendRequest(){HTMLArea._appendToLog("[HTMLArea::_postback]: Request: "+content);req.send(content);}req.open('POST',postUrl,true);req.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');window.setTimeout(sendRequest,500);}};Dialog=function(url,action,init,width,height,opener,editor){Dialog._open(url,action,init,(width?width:100),(height?height:100),opener,editor);};Dialog._open=function(url,action,init,width,height,_opener,editor){if(typeof(Dialog._modal)=="object"&&typeof(Dialog._modal.close)=="function"){Dialog._modal.close();Dialog._modal=null;}var dlg=window.open(url,'hadialog',"toolbar=no,location=no,directories=no,menubar=no,width="+width+",height="+height+",scrollbars=no,resizable=yes,modal=yes,dependent=yes,top=100,left=100");var obj=new Object();obj.dialogWindow=dlg;Dialog._dialog=obj;Dialog._modal=dlg;Dialog._arguments=null;if(typeof(init)!="undefined"){Dialog._arguments=init;}function capwin(w){if(HTMLArea.is_gecko){w.addEventListener("focus",function(ev){Dialog._parentEvent(ev);},false);}else{HTMLArea._addEvent(w,"focus",function(ev){Dialog._parentEvent(ev);});}for(var i=0;i<w.frames.length;i++){capwin(w.frames[i]);}}capwin(window);function closeDialog(){if(Dialog._dialog&&Dialog._dialog.dialogWindow){Dialog._dialog.dialogWindow.close();Dialog._dialog=null;}if(dlg&&!dlg.closed){dlg.close();dlg=null;}return false;}Dialog._return=function(val){if(val&&action){action(val);}function relwin(w){HTMLArea._removeEvent(w,"focus",function(ev){Dialog._parentEvent(ev);});try{for(var i=0;i<w.frames.length;i++){relwin(w.frames[i]);}}catch(e){}}relwin(window);HTMLArea._removeEvent(window,"unload",closeDialog);Dialog._dialog=null;};HTMLArea._addEvent(dlg,"unload",function(){if(typeof(Dialog)!="undefined")Dialog._return(null);return false;});HTMLArea._addEvent(window,"unload",closeDialog);};Dialog._parentEvent=function(ev){if(Dialog._modal&&!Dialog._modal.closed){if(!ev)var ev=window.event;var target=(ev.target)?ev.target:ev.srcElement;Dialog._modal.focus();HTMLArea._stopEvent(ev);}return false;};HTMLArea.prototype._popupDialog=function(url,action,init,width,height,_opener){if(typeof(_opener)=="undefined"||!_opener)var _opener=(this._iframe.contentWindow?this._iframe.contentWindow:window);Dialog(this.popupURL(url),action,init,width,height,_opener,this);};HTMLArea.getElementById=function(tag,id){var el,i,objs=document.getElementsByTagName(tag);for(i=objs.length;--i>=0&&(el=objs[i]);){if(el.id==id)return el;}return null;};HTMLArea.edHidePopup=function(){Dialog._modal.close();setTimeout("if (typeof(browserWin) != 'undefined' && typeof(browserWin.focus) == 'function') browserWin.focus();",200);};var setRTEsizeByJS=function(divId,height,width){if(HTMLArea.is_gecko)height=height-25;else height=height-60;if(height>0)document.getElementById(divId).style.height=height+"px";if(HTMLArea.is_gecko)width="99%";else width="97%";document.getElementById(divId).style.width=width;};var lorem_ipsum=function(element,text){if(element.tagName.toLowerCase()=="textarea"&&element.id&&element.id.substr(0,7)=="RTEarea"){var editor=RTEarea[element.id.substr(7,8)]["editor"];editor.insertHTML(text);editor.updateToolbar();}};HTMLArea.initTimer=[];HTMLArea.onGenerateHandler=function(editorNumber){return(function(){document.getElementById('pleasewait'+editorNumber).style.display='none';document.getElementById('editorWrap'+editorNumber).style.visibility='visible';editorNumber=null;});};HTMLArea.initEditor=function(editorNumber){if(HTMLArea.checkSupportedBrowser()){if(HTMLArea.initTimer[editorNumber])window.clearTimeout(HTMLArea.initTimer[editorNumber]);if(!HTMLArea.is_loaded){HTMLArea.initTimer[editorNumber]=window.setTimeout("HTMLArea.initEditor("+editorNumber+");",150);}else{var RTE=RTEarea[editorNumber];var config=new HTMLArea.Config();config.toolbar=RTE["toolbar"];RTE["editor"]=new HTMLArea(RTE["id"],config);var editor=RTE["editor"];editor._typo3EditerNumber=editorNumber;editor._editorNumber=editorNumber;config=editor.config;config.hideTableOperationsInToolbar=RTE["hideTableOperationsInToolbar"]?RTE["hideTableOperationsInToolbar"]:false;config.keepToggleBordersInToolbar=RTE["keepToggleBordersInToolbar"]?RTE["keepToggleBordersInToolbar"]:false;config.disableLayoutFieldsetInTableOperations=RTE["disableLayoutFieldsetInTableOperations"]?RTE["disableLayoutFieldsetInTableOperations"]:false;config.disableAlignmentFieldsetInTableOperations=RTE["disableAlignmentFieldsetInTableOperations"]?RTE["disableAlignmentFieldsetInTableOperations"]:false;config.disableSpacingFieldsetInTableOperations=RTE["disableSpacingFieldsetInTableOperations"]?RTE["disableSpacingFieldsetInTableOperations"]:false;config.disableBordersFieldsetInTableOperations=RTE["disableBordersFieldsetInTableOperations"]?RTE["disableBordersFieldsetInTableOperations"]:false;config.disableColorFieldsetInTableOperations=RTE["disableColorFieldsetInTableOperations"]?RTE["disableColorFieldsetInTableOperations"]:false;config.disablePCexamples=RTE["disablePCexamples"]?RTE["disablePCexamples"]:false;for(var plugin in RTE["plugin"]){if(RTE["plugin"][plugin]){editor.registerPlugin(plugin);}}if(RTE["defaultPageStyle"])config.defaultPageStyle=RTE["defaultPageStyle"];if(RTE["pageStyle"])config.pageStyle=RTE["pageStyle"];if(RTE["fontname"])config.FontName=RTE["fontname"];if(RTE["fontsize"])config.FontSize=RTE["fontsize"];if(RTE["colors"])config.colors=RTE["colors"];if(RTE["disableColorPicker"])config.disableColorPicker=RTE["disableColorPicker"];if(RTE["paragraphs"])config.FormatBlock=RTE["paragraphs"];config.width="auto";config.height="auto";config.sizeIncludesToolbar=true;config.fullPage=false;config.useHTTPS=RTE["useHTTPS"]?RTE["useHTTPS"]:false;config.disableEnterParagraphs=RTE["disableEnterParagraphs"]?RTE["disableEnterParagraphs"]:false;config.removeTrailingBR=RTE["removeTrailingBR"]?RTE["removeTrailingBR"]:false;config.keepButtonGroupTogether=(RTE["keepButtonGroupTogether"]&&HTMLArea.is_gecko&&!HTMLArea.is_wamcom&&!HTMLArea.is_opera)?RTE["keepButtonGroupTogether"]:false;config.useCSS=RTE["useCSS"]?RTE["useCSS"]:false;config.enableMozillaExtension=RTE["enableMozillaExtension"]?RTE["enableMozillaExtension"]:false;config.statusBar=RTE["statusBar"]?RTE["statusBar"]:false;config.cleanWordOnPaste=RTE["enableWordClean"]?true:false;config.htmlRemoveTags=RTE["htmlRemoveTags"]?RTE["htmlRemoveTags"]:null;config.htmlRemoveTagsAndContents=RTE["htmlRemoveTagsAndContents"]?RTE["htmlRemoveTagsAndContents"]:null;config.htmlRemoveComments=RTE["htmlRemoveComments"]?true:false;editor.onGenerate=HTMLArea.onGenerateHandler(editorNumber);editor.generate();return false;}}else{document.getElementById('pleasewait'+editorNumber).style.display='none';document.getElementById('editorWrap'+editorNumber).style.visibility='visible';}};
+if(typeof(_editor_url)=="string"){_editor_url=_editor_url.replace(/\x2f*$/,'/');}else{alert("WARNING: _editor_url is not set!");var _editor_url='';};if(typeof(_editor_skin)=="string")_editor_skin=_editor_skin.replace(/\x2f*$/,'/');else var _editor_skin=_editor_url+"skins/default/";if(typeof(_editor_CSS)!="string")var _editor_CSS=_editor_url+"skins/default/htmlarea.css";if(typeof(_editor_edited_content_CSS)!="string")var _editor_edited_content_CSS=_editor_skin+"htmlarea-edited-content.css";if(typeof(_editor_lang)=="string")_editor_lang=_editor_lang?_editor_lang.toLowerCase():"en";var HTMLArea=function(textarea,config){if(HTMLArea.checkSupportedBrowser()){if(typeof(config)=="undefined")this.config=new HTMLArea.Config();else this.config=config;this._htmlArea=null;this._textArea=textarea;this._editMode="wysiwyg";this.plugins={};this._timerToolbar=null;this._undoQueue=new Array();this._undoPos=-1;this._customUndo=true;this.doctype='';this.eventHandlers={};}};HTMLArea.agt=navigator.userAgent.toLowerCase();HTMLArea.is_opera=(HTMLArea.agt.indexOf("opera")!=-1);HTMLArea.is_ie=(HTMLArea.agt.indexOf("msie")!=-1)&&!HTMLArea.is_opera;HTMLArea.is_safari=(HTMLArea.agt.indexOf("webkit")!=-1);HTMLArea.is_gecko=(navigator.product=="Gecko")||HTMLArea.is_opera;HTMLArea.is_wamcom=(HTMLArea.agt.indexOf("wamcom")!=-1)||(HTMLArea.is_gecko&&(HTMLArea.agt.indexOf("1.3")!=-1));HTMLArea._debugMode=false;if(typeof(_editor_debug_mode)!="undefined")HTMLArea._debugMode=_editor_debug_mode;HTMLArea._appendToLog=function(str){if(HTMLArea._debugMode){var log=document.getElementById("HTMLAreaLog");if(log){log.appendChild(document.createTextNode(str));log.appendChild(document.createElement("br"));}}};HTMLArea._compressedScripts=false;if(typeof(_editor_compressed_scripts)!="undefined")HTMLArea._compressedScripts=_editor_compressed_scripts;HTMLArea.I18N=HTMLArea_langArray;HTMLArea.is_loaded=false;HTMLArea.onload=function(){HTMLArea.is_loaded=true;HTMLArea._appendToLog("All scripts successfully loaded.");};HTMLArea.loadTimer;HTMLArea._scripts=[];HTMLArea._scriptLoaded=[];HTMLArea._request=[];HTMLArea.loadScript=function(url,plugin){if(plugin)url=_editor_url+"/plugins/"+plugin+'/'+url;if(HTMLArea.is_opera)url=_typo3_host_url+url;if(HTMLArea._compressedScripts&&url.indexOf("compressed")==-1)url=url.replace(/\.js$/gi,"-compressed.js");HTMLArea._scripts.push(url);};HTMLArea.loadScript(RTEarea[0]["popupwin"]?RTEarea[0]["popupwin"]:_editor_url+"popupwin.js");if(HTMLArea.is_gecko)HTMLArea.loadScript(RTEarea[0]["htmlarea-gecko"]?RTEarea[0]["htmlarea-gecko"]:_editor_url+"htmlarea-gecko.js");if(HTMLArea.is_ie)HTMLArea.loadScript(RTEarea[0]["htmlarea-ie"]?RTEarea[0]["htmlarea-ie"]:_editor_url+"htmlarea-ie.js");HTMLArea.MSXML_XMLHTTP_PROGIDS=new Array("Msxml2.XMLHTTP.5.0","Msxml2.XMLHTTP.4.0","Msxml2.XMLHTTP.3.0","Msxml2.XMLHTTP","Microsoft.XMLHTTP");HTMLArea.XMLHTTPResponseHandler=function(i){return(function(){var url=HTMLArea._scripts[i];if(HTMLArea._request[i].readyState!=4)return;if(HTMLArea._request[i].status==200){try{eval(HTMLArea._request[i].responseText);HTMLArea._scriptLoaded[i]=true;i=null;}catch(e){HTMLArea._appendToLog("ERROR [HTMLArea::getScript]: Unable to get script "+url+": "+e);}}else{HTMLArea._appendToLog("ERROR [HTMLArea::getScript]: Unable to get "+url+" . Server reported "+HTMLArea._request[i].status);}});};HTMLArea._getScript=function(i,asynchronous,url){if(typeof(url)=="undefined")var url=HTMLArea._scripts[i];if(typeof(asynchronous)=="undefined")var asynchronous=true;if(window.XMLHttpRequest)HTMLArea._request[i]=new XMLHttpRequest();else if(window.ActiveXObject){var success=false;for(var k=0;k<HTMLArea.MSXML_XMLHTTP_PROGIDS.length&&!success;k++){try{HTMLArea._request[i]=new ActiveXObject(HTMLArea.MSXML_XMLHTTP_PROGIDS[k]);success=true;}catch(e){}};if(!success)return false;};var request=HTMLArea._request[i];if(request){request.open("GET",url,asynchronous);if(asynchronous)request.onreadystatechange=HTMLArea.XMLHTTPResponseHandler(i);if(window.XMLHttpRequest)request.send(null);else if(window.ActiveXObject)request.send();if(!asynchronous){if(request.status==200)return request.responseText;else return '';};return true;}else{return false;}};HTMLArea.checkInitialLoad=function(){var scriptsLoaded=true;for(var i=HTMLArea._scripts.length;--i>=0;){scriptsLoaded=scriptsLoaded&&HTMLArea._scriptLoaded[i];};if(HTMLArea.loadTimer)window.clearTimeout(HTMLArea.loadTimer);if(scriptsLoaded){HTMLArea.is_loaded=true;HTMLArea._appendToLog("[HTMLArea::init]: All scripts successfully loaded.");HTMLArea._appendToLog("[HTMLArea::init]: Editor url set to: "+_editor_url);HTMLArea._appendToLog("[HTMLArea::init]: Editor skin CSS set to: "+_editor_CSS);HTMLArea._appendToLog("[HTMLArea::init]: Editor content skin CSS set to: "+_editor_edited_content_CSS);if(window.ActiveXObject){for(var i=HTMLArea._scripts.length;--i>=0;){HTMLArea._request[i].onreadystatechange=new Function();HTMLArea._request[i]=null;}}}else{HTMLArea.loadTimer=window.setTimeout("HTMLArea.checkInitialLoad();",200);return false;}};HTMLArea.init=function(){HTMLArea._eventCache=HTMLArea._eventCacheConstructor();if(window.XMLHttpRequest||window.ActiveXObject){try{var success=true;for(var i=HTMLArea._scripts.length;--i>=0&&success;)success=success&&HTMLArea._getScript(i);}catch(e){HTMLArea._appendToLog("ERROR [HTMLArea::init]: Unable to use XMLHttpRequest: "+e);};if(success){HTMLArea.checkInitialLoad();}else{if(HTMLArea.is_ie)window.setTimeout('if (window.document.getElementById("pleasewait1")) { window.document.getElementById("pleasewait1").innerHTML = HTMLArea.I18N.msg["ActiveX-required"]; } else { alert(HTMLArea.I18N.msg["ActiveX-required"]); };',200);}}else{if(HTMLArea.is_ie)alert(HTMLArea.I18N.msg["ActiveX-required"]);}};HTMLArea.RE_tagName=/(<\/|<)\s*([^\t\n>]+)/ig;HTMLArea.RE_doctype=/(<!doctype((.|\n)*?)>)\n?/i;HTMLArea.RE_head=/<head>((.|\n)*?)<\/head>/i;HTMLArea.RE_body=/<body>((.|\n)*?)<\/body>/i;HTMLArea.Reg_body=new RegExp("<\/?(body)[^>]*>","gi");HTMLArea.Reg_entities=new RegExp("&amp;([0-9]+);","gi");HTMLArea.reservedClassNames=/htmlarea/;HTMLArea.RE_email=/([0-9a-z]+([a-z0-9_-]*[0-9a-z])*){1}(\.[0-9a-z]+([a-z0-9_-]*[0-9a-z])*)*@([0-9a-z]+([a-z0-9_-]*[0-9a-z])*\.)+[a-z]{2,9}/i;HTMLArea.RE_url=/(https?:\/\/)?(([a-z0-9_]+:[a-z0-9_]+@)?[a-z0-9_-]{2,}(\.[a-z0-9_-]{2,})+\.[a-z]{2,5}(:[0-9]+)?(\/\S+)*)/i;HTMLArea.Config=function(){this.version="3.0";this.width="auto";this.height="auto";this.statusBar=true;this.undoSteps=20;this.undoTimeout=500;this.sizeIncludesToolbar=true;this.fullPage=false;this.useHTTPS=false;this.useCSS=false;this.styleWithCSS=false;if(HTMLArea.is_gecko&&!HTMLArea.is_safari&&!HTMLArea.is_opera&&navigator.productSub>=20051107)this.styleWithCSS=true;this.enableMozillaExtension=true;this.disableEnterParagraphs=false;this.removeTrailingBR=false;this.editedContentStyle=_editor_edited_content_CSS;this.pageStyle="";this.cleanWordOnPaste=true;this.makeLinkShowsTarget=true;this.htmlRemoveTags=null;this.htmlRemoveTagsAndContents=null;this.htmlRemoveComments=false;this.customTags=null;this.baseURL=document.baseURI||document.URL;if(this.baseURL&&this.baseURL.match(/(.*)\/([^\/]+)/))this.baseURL=RegExp.$1+"/";this.imgURL="images/";this.popupURL="popups/";this.btnList={Bold:["Bold","ed_format_bold",false,function(editor){editor.execCommand("Bold");}],Italic:["Italic","ed_format_italic",false,function(editor){editor.execCommand("Italic");}],Underline:["Underline","ed_format_underline",false,function(editor){editor.execCommand("Underline");}],StrikeThrough:["Strikethrough","ed_format_strike",false,function(editor){editor.execCommand("StrikeThrough");}],Subscript:["Subscript","ed_format_sub",false,function(editor){editor.execCommand("Subscript");}],Superscript:["Superscript","ed_format_sup",false,function(editor){editor.execCommand("Superscript");}],JustifyLeft:["Justify Left","ed_align_left.gif",false,function(editor){editor.execCommand("JustifyLeft");}],JustifyCenter:["Justify Center","ed_align_center.gif",false,function(editor){editor.execCommand("JustifyCenter");}],JustifyRight:["Justify Right","ed_align_right.gif",false,function(editor){editor.execCommand("JustifyRight");}],JustifyFull:["Justify Full","ed_align_justify.gif",false,function(editor){editor.execCommand("JustifyFull");}],InsertOrderedList:["Ordered List","ed_list_num.gif",false,function(editor){editor.execCommand("InsertOrderedList");}],InsertUnorderedList:["Bulleted List","ed_list_bullet",false,function(editor){editor.execCommand("InsertUnorderedList");}],Outdent:["Decrease Indent","ed_indent_less.gif",false,function(editor){editor.execCommand("Outdent");}],Indent:["Increase Indent","ed_indent_more.gif",false,function(editor){editor.execCommand("Indent");}],ForeColor:["Font Color","ed_color_fg.gif",false,function(editor){editor.execCommand("ForeColor");}],HiliteColor:["Background Color","ed_color_bg.gif",false,function(editor){editor.execCommand("HiliteColor");}],InsertHorizontalRule:["Horizontal Rule","ed_hr.gif",false,function(editor){editor.execCommand("InsertHorizontalRule");}],CreateLink:["Insert Web Link","ed_link.gif",false,function(editor){editor.execCommand("CreateLink",true);},"a",false,true],InsertImage:["Insert/Modify Image","ed_image.gif",false,function(editor){editor.execCommand("InsertImage");}],InsertTable:["Insert Table","insert_table.gif",false,function(editor){editor.execCommand("InsertTable");}],HtmlMode:["Toggle HTML Source","ed_html.gif",true,function(editor){editor.execCommand("HtmlMode");}],SelectAll:["SelectAll","",true,function(editor){editor.execCommand("SelectAll");},null,true,false],SplitBlock:["Toggle Container Block","ed_splitblock.gif",false,function(editor){editor.execCommand("SplitBlock");}],About:["About this editor","ed_about.gif",true,function(editor){editor.execCommand("About");}],Undo:["Undoes your last action","ed_undo.gif",false,function(editor){editor.execCommand("Undo");}],Redo:["Redoes your last action","ed_redo.gif",false,function(editor){editor.execCommand("Redo");}],Cut:["Cut selection","ed_cut.gif",false,function(editor,command,obj){editor.execCommand("Cut");}],Copy:["Copy selection","ed_copy.gif",false,function(editor,command,obj){editor.execCommand("Copy");}],Paste:["Paste from clipboard","ed_paste.gif",false,function(editor,command,obj){editor.execCommand("Paste");}],SelectAll:["SelectAll","",true,function(editor){editor.execCommand("SelectAll");},null,true,false],LeftToRight:["Direction left to right","ed_left_to_right.gif",false,function(editor){editor.execCommand("LeftToRight");}],RightToLeft:["Direction right to left","ed_right_to_left.gif",false,function(editor){editor.execCommand("RightToLeft");}]};this.hotKeyList={a:"SelectAll",b:"Bold",i:"Italic",u:"Underline",s:"StrikeThrough",l:"JustifyLeft",e:"JustifyCenter",r:"JustifyRight",j:"JustifyFull",n:"FormatBlock",v:"Paste",0:"CleanWord",z:"Undo",y:"Redo"};for(var i in this.btnList){var btn=this.btnList[i];if(typeof(HTMLArea.I18N.tooltips[i.toLowerCase()])!="undefined")btn[0]=HTMLArea.I18N.tooltips[i.toLowerCase()];if(typeof(btn[1])=="string")btn[1]=_editor_skin+this.imgURL+btn[1];else btn[1][0]=_editor_skin+this.imgURL+btn[1][0];}this.customSelects={};};HTMLArea.Config.prototype.registerButton=function(id,tooltip,image,textMode,action,context,hide,selection){var the_id;switch(typeof(id)){case "string":the_id=id;break;case "object":the_id=id.id;break;default:HTMLArea._appendToLog("ERROR [HTMLArea.Config::registerButton]: invalid arguments");return false;}if(typeof(this.customSelects[the_id])!="undefined")HTMLArea._appendToLog("WARNING [HTMLArea.Config::registerButton]: A dropdown with the same ID "+id+" already exists.");if(typeof(this.btnList[the_id])!="undefined")HTMLArea._appendToLog("WARNING [HTMLArea.Config::registerButton]: A button with the same ID "+id+" already exists.");switch(typeof(id)){case "string":if(typeof(hide)=="undefined")var hide=false;if(typeof(selection)=="undefined")var selection=false;this.btnList[id]=[tooltip,image,textMode,action,context,hide,selection];break;case "object":if(typeof(id.hide)=="undefined")id.hide=false;if(typeof(id.selection)=="undefined")id.selection=false;this.btnList[id.id]=[id.tooltip,id.image,id.textMode,id.action,id.context,id.hide,id.selection];break;}};HTMLArea.Config.prototype.registerDropdown=function(object){if(typeof(this.customSelects[object.id])!="undefined")HTMLArea._appendToLog("WARNING [HTMLArea.Config::registerDropdown]: A dropdown with the same ID "+object.id+" already exists.");if(typeof(this.btnList[object.id])!="undefined")HTMLArea._appendToLog("WARNING [HTMLArea.Config::registerDropdown]: A button with the same ID "+object.id+" already exists.");this.customSelects[object.id]=object;};HTMLArea.setButtonStatus=function(id,newval){var oldval=this[id];var el=document.getElementById(this.elementId);if(oldval!=newval){switch(id){case "enabled":if(newval){if(!HTMLArea.is_wamcom){HTMLArea._removeClass(el,"buttonDisabled");HTMLArea._removeClass(el.parentNode,"buttonDisabled");}el.disabled=false;}else{if(!HTMLArea.is_wamcom){HTMLArea._addClass(el,"buttonDisabled");HTMLArea._addClass(el.parentNode,"buttonDisabled");}el.disabled=true;}break;case "active":if(newval){HTMLArea._addClass(el,"buttonPressed");HTMLArea._addClass(el.parentNode,"buttonPressed");}else{HTMLArea._removeClass(el,"buttonPressed");HTMLArea._removeClass(el.parentNode,"buttonPressed");}break;}this[id]=newval;}};HTMLArea.newLine=function(toolbar){tb_line=document.createElement("ul");tb_line.className="tb-line";toolbar.appendChild(tb_line);return tb_line;};HTMLArea.addTbElement=function(element,tb_line,first_cell_on_line){var tb_cell=document.createElement("li");if(first_cell_on_line)tb_cell.className="tb-first-cell";else tb_cell.className="tb-cell";HTMLArea._addClass(tb_cell,element.className);tb_line.appendChild(tb_cell);tb_cell.appendChild(element);if(element.style.display=="none"){tb_cell.style.display="none";if(HTMLArea._hasClass(tb_line,"tb-group"))tb_line.style.display="none";if(HTMLArea._hasClass(tb_cell.previousSibling,"separator"))tb_cell.previousSibling.style.display="none";}return false;};HTMLArea.addTbGroup=function(tb_line,first_cell_on_line){var tb_group=document.createElement("ul");tb_group.className="tb-group";HTMLArea.addTbElement(tb_group,tb_line,first_cell_on_line);return tb_group;};HTMLArea.prototype.createSelect=function(txt,tb_line,first_cell_on_line,labelObj){var options=null,cmd=null,context=null,tooltip="",newObj={created:false,el:null,first:first_cell_on_line,labelUsed:false};switch(txt){case "FontSize":case "FontName":case "FormatBlock":options=this.config[txt];tooltip=HTMLArea.I18N.tooltips[txt.toLowerCase()];cmd=txt;break;default:cmd=txt;var dropdown=this.config.customSelects[cmd];if(typeof(dropdown)!="undefined"){options=dropdown.options;context=dropdown.context;if(typeof(dropdown.tooltip)!="undefined")tooltip=dropdown.tooltip;}break;}if(options){newObj["el"]=document.createElement("select");newObj["el"].className="select";newObj["el"].title=tooltip;newObj["el"].id=this._editorNumber+"-"+txt;newObj["first"]=HTMLArea.addTbElement(newObj["el"],tb_line,first_cell_on_line);var obj={name:txt,elementId:newObj["el"].id,enabled:true,text:false,cmd:cmd,state:HTMLArea.setButtonStatus,context:context,editorNumber:this._editorNumber};this._toolbarObjects[txt]=obj;newObj["el"]._obj=obj;if(labelObj["labelRef"]){labelObj["el"].htmlFor=newObj["el"].id;newObj["labelUsed"]=true;}HTMLArea._addEvent(newObj["el"],"change",HTMLArea.toolBarButtonHandler);for(var i in options){var op=document.createElement("option");op.innerHTML=i;op.value=options[i];if(txt=="FontName"&&!this.config.disablePCexamples){if(HTMLArea.is_gecko)op.setAttribute("style","font-family:"+op.value+";");else op.style.cssText="font-family:"+op.value+";";}newObj["el"].appendChild(op);}newObj["created"]=true;}return newObj;};HTMLArea.prototype.createButton=function(txt,tb_line,first_cell_on_line,labelObj){var btn=null,btnImg=null,newObj={created:false,el:null,first:first_cell_on_line,labelUsed:false};switch(txt){case "separator":newObj["el"]=document.createElement("div");newObj["el"].className="separator";newObj["first"]=HTMLArea.addTbElement(newObj["el"],tb_line,first_cell_on_line);newObj["created"]=true;break;case "space":newObj["el"]=document.createElement("div");newObj["el"].className="space";newObj["el"].innerHTML="&nbsp;";newObj["first"]=HTMLArea.addTbElement(newObj["el"],tb_line,first_cell_on_line);newObj["created"]=true;break;case "TextIndicator":newObj["el"]=document.createElement("div");newObj["el"].appendChild(document.createTextNode("A"));newObj["el"].className="indicator";newObj["el"].title=HTMLArea.I18N.tooltips.textindicator;newObj["el"].id=this._editorNumber+"-"+txt;newObj["first"]=HTMLArea.addTbElement(newObj["el"],tb_line,first_cell_on_line);var obj={name:txt,elementId:newObj["el"].id,enabled:true,active:false,text:false,cmd:"TextIndicator",state:HTMLArea.setButtonStatus};this._toolbarObjects[txt]=obj;newObj["created"]=true;break;default:btn=this.config.btnList[txt];}if(!newObj["created"]&&btn){newObj["el"]=document.createElement("button");if(HTMLArea.is_opera)newObj["el"].outerHTML='<button type="button"></button>';newObj["el"].title=btn[0];newObj["el"].className="button";newObj["el"].id=this._editorNumber+"-"+txt;if(btn[5])newObj["el"].style.display="none";newObj["first"]=HTMLArea.addTbElement(newObj["el"],tb_line,first_cell_on_line);var obj={name:txt,elementId:newObj["el"].id,enabled:true,active:false,text:btn[2],cmd:btn[3],state:HTMLArea.setButtonStatus,context:btn[4]||null,selection:btn[6],editorNumber:this._editorNumber};this._toolbarObjects[txt]=obj;newObj["el"]._obj=obj;if(labelObj["labelRef"]){labelObj["el"].htmlFor=newObj["el"].id;newObj["labelUsed"]=true;}HTMLArea._addEvents(newObj["el"],["mouseover","mouseout","mousedown","click"],HTMLArea.toolBarButtonHandler);if(typeof(btn[1])!="string"&&HTMLArea.is_ie){var btnImgContainer=document.createElement("div");btnImgContainer.className="buttonImgContainer";btnImgContainer.innerHTML='<img src="'+btn[1][0]+'" style="position: relative; top: -'+(18*(btn[1][1]+1))+'px; left: -'+(18*(btn[1][2]+1))+'px;" alt="'+btn[0]+'" />';newObj["el"].appendChild(btnImgContainer);}else{newObj["el"].className+=" "+txt;if(this.plugins["TYPO3Browsers"]&&(txt=="CreateLink"||txt=="InsertImage"))newObj["el"].className+="-TYPO3Browsers";}newObj["created"]=true;}return newObj;};HTMLArea.createLabel=function(txt,tb_line,first_cell_on_line){var newObj={created:false,el:null,labelRef:false,first:first_cell_on_line};if(/^([IT])\[(.*?)\]/.test(txt)){var l7ed=RegExp.$1=="I";var label=RegExp.$2;if(l7ed)label=HTMLArea.I18N.dialogs[label];newObj["el"]=document.createElement("label");newObj["el"].className="label";newObj["el"].innerHTML=label;newObj["labelRef"]=true;newObj["created"]=true;newObj["first"]=HTMLArea.addTbElement(newObj["el"],tb_line,first_cell_on_line);}return newObj;};HTMLArea.prototype._createToolbar=function(){var j,k,code,n=this.config.toolbar.length,m,tb_line=null,tb_group=null,first_cell_on_line=true,labelObj=new Object(),tbObj=new Object();var toolbar=document.createElement("div");this._toolbar=toolbar;toolbar.className="toolbar";toolbar.unselectable="1";this._toolbarObjects=new Object();for(j=0;j<n;++j){tb_line=HTMLArea.newLine(toolbar);if(!this.config.keepButtonGroupTogether)HTMLArea._addClass(tb_line,"free-float");first_cell_on_line=true;tb_group=null;var group=this.config.toolbar[j];m=group.length;for(k=0;k<m;++k){code=group[k];if(code=="linebreak"){tb_line=HTMLArea.newLine(toolbar);if(!this.config.keepButtonGroupTogether)HTMLArea._addClass(tb_line,"free-float");first_cell_on_line=true;tb_group=null;}else{if((code=="separator"||first_cell_on_line)&&this.config.keepButtonGroupTogether){tb_group=HTMLArea.addTbGroup(tb_line,first_cell_on_line);first_cell_on_line=false;}created=false;if(/^([IT])\[(.*?)\]/.test(code)){labelObj=HTMLArea.createLabel(code,(tb_group?tb_group:tb_line),first_cell_on_line);created=labelObj["created"];first_cell_on_line=labelObj["first"];}if(!created){tbObj=this.createButton(code,(tb_group?tb_group:tb_line),first_cell_on_line,labelObj);created=tbObj["created"];first_cell_on_line=tbObj["first"];if(tbObj["labelUsed"])labelObj["labelRef"]=false;}if(!created){tbObj=this.createSelect(code,(tb_group?tb_group:tb_line),first_cell_on_line,labelObj);created=tbObj["created"];first_cell_on_line=tbObj["first"];if(tbObj["labelUsed"])labelObj["labelRef"]=false;}if(!created)HTMLArea._appendToLog("ERROR [HTMLArea::createToolbar]: Unknown toolbar item: "+code);}}}tb_line=HTMLArea.newLine(toolbar);this._htmlArea.appendChild(toolbar);};HTMLArea.toolBarButtonHandler=function(ev){if(!ev)var ev=window.event;var target=(ev.target)?ev.target:ev.srcElement;while(target.tagName.toLowerCase()=="img"||target.tagName.toLowerCase()=="div")target=target.parentNode;var obj=target._obj;var editorNumber=obj["editorNumber"];var editor=RTEarea[editorNumber]["editor"];if(obj.enabled){switch(ev.type){case "mouseover":HTMLArea._addClass(target,"buttonHover");HTMLArea._addClass(target.parentNode,"buttonHover");break;case "mouseout":HTMLArea._removeClass(target,"buttonHover");HTMLArea._removeClass(target.parentNode,"buttonHover");HTMLArea._removeClass(target,"buttonActive");HTMLArea._removeClass(target.parentNode,"buttonActive");if(obj.active){HTMLArea._addClass(target,"buttonPressed");HTMLArea._addClass(target.parentNode,"buttonPressed");}break;case "mousedown":if(!HTMLArea.is_opera){HTMLArea._addClass(target,"buttonActive");HTMLArea._addClass(target.parentNode,"buttonActive");HTMLArea._removeClass(target,"buttonPressed");HTMLArea._removeClass(target.parentNode,"buttonPressed");}HTMLArea._stopEvent(ev);break;case "click":HTMLArea._removeClass(target,"buttonActive");HTMLArea._removeClass(target.parentNode,"buttonActive");HTMLArea._removeClass(target,"buttonHover");HTMLArea._removeClass(target.parentNode,"buttonHover");obj.cmd(editor,obj.name,obj);HTMLArea._stopEvent(ev);break;case "change":editor.focusEditor();var value=target.options[target.selectedIndex].value;switch(obj.name){case "FontName":case "FontSize":editor.execCommand(obj.name,false,value);break;case "FormatBlock":(HTMLArea.is_ie||HTMLArea.is_safari)&&(value="<"+value+">");editor.execCommand(obj.name,false,value);break;default:var dropdown=editor.config.customSelects[obj.name];if(typeof(dropdown)!="undefined")dropdown.action(editor);else HTMLArea._appendToLog("ERROR [HTMLArea::toolBarButtonHandler]: Combo box "+obj.name+" not registered.");}}}};HTMLArea.prototype._createStatusBar=function(){var statusBar=document.createElement("div");this._statusBar=statusBar;statusBar.className="statusBar";if(!this.config.statusBar)statusBar.style.display="none";var statusBarTree=document.createElement("span");this._statusBarTree=statusBarTree;statusBarTree.className="statusBarTree";statusBar.appendChild(statusBarTree);statusBarTree.appendChild(document.createTextNode(HTMLArea.I18N.msg["Path"]+": "));this._htmlArea.appendChild(statusBar);};HTMLArea.prototype.generate=function(){var textarea=this._textArea;if(typeof(textarea)=="string"){textarea=HTMLArea.getElementById("textarea",textarea);this._textArea=textarea;}textarea.style.display="none";var htmlarea=document.createElement("div");htmlarea.className="htmlarea";htmlarea.style.width=textarea.style.width;this._htmlArea=htmlarea;textarea.parentNode.insertBefore(htmlarea,textarea);if(textarea.form){var f=textarea.form;if(typeof(f.onreset)=="function"){var funcref=f.onreset;if(typeof(f.__msh_prevOnReset)=="undefined")f.__msh_prevOnReset=[];f.__msh_prevOnReset.push(funcref);}f._editorNumber=this._editorNumber;HTMLArea._addEvent(f,"reset",HTMLArea.resetHandler);}this._createToolbar();HTMLArea._appendToLog("[HTMLArea::generate]: Toolbar successfully created.");var iframe=document.createElement("iframe");if(HTMLArea.is_ie||HTMLArea.is_safari||HTMLArea.is_wamcom){iframe.setAttribute("src",_editor_url+"popups/blank.html");}else if(HTMLArea.is_opera){iframe.setAttribute("src",_typo3_host_url+_editor_url+"popups/blank.html");}else{iframe.setAttribute("src","javascript:void(0);");}iframe.className="editorIframe";if(!this.config.statusBar)iframe.className+=" noStatusBar";htmlarea.appendChild(iframe);this._iframe=iframe;this._createStatusBar();this.sizeIframe(2);HTMLArea._appendToLog("[HTMLArea::generate]: Editor iframe successfully created.");this.initIframe();return this;};HTMLArea.prototype.sizeIframe=function(diff){var height=(this.config.height=="auto"?(this._textArea.style.height):this.config.height);var textareaHeight=height;if(height.indexOf("%")==-1){height=parseInt(height)-diff;if(this.config.sizeIncludesToolbar){this._initialToolbarOffsetHeight=this._toolbar.offsetHeight;height-=this._toolbar.offsetHeight;height-=this._statusBar.offsetHeight;}if(height<0)height=0;textareaHeight=(height-4);if(textareaHeight<0)textareaHeight=0;height+="px";textareaHeight+="px";}this._iframe.style.height=height;this._textArea.style.height=textareaHeight;var textareaWidth=(this.config.width=="auto"?this._textArea.style.width:this.config.width);var iframeWidth=textareaWidth;if(textareaWidth.indexOf("%")==-1){iframeWidth=parseInt(textareaWidth)+"px";textareaWidth=parseInt(textareaWidth)-diff;if(textareaWidth<0)textareaWidth=0;textareaWidth+="px";}this._iframe.style.width="100%";if(HTMLArea.is_opera)this._iframe.style.width=iframeWidth;this._textArea.style.width=textareaWidth;};HTMLArea.initIframe=function(editorNumber){var editor=RTEarea[editorNumber]["editor"];editor.initIframe();};HTMLArea.prototype.initIframe=function(){if(this._initIframeTimer)window.clearTimeout(this._initIframeTimer);if(!this._iframe||(!this._iframe.contentWindow&&!this._iframe.contentDocument)){this._initIframeTimer=window.setTimeout("HTMLArea.initIframe("+this._editorNumber+");",50);return false;}else if(this._iframe.contentWindow){if(!this._iframe.contentWindow.document||!this._iframe.contentWindow.document.documentElement){this._initIframeTimer=window.setTimeout("HTMLArea.initIframe("+this._editorNumber+");",50);return false;}}else if(!this._iframe.contentDocument.documentElement){this._initIframeTimer=window.setTimeout("HTMLArea.initIframe("+this._editorNumber+");",50);return false;}var doc=this._iframe.contentWindow?this._iframe.contentWindow.document:this._iframe.contentDocument;this._doc=doc;if(!this.config.fullPage){var head=doc.getElementsByTagName("head")[0];if(!head){head=doc.createElement("head");doc.documentElement.appendChild(head);}if(this.config.baseURL&&!HTMLArea.is_opera){var base=doc.getElementsByTagName("base")[0];if(!base){base=doc.createElement("base");base.href=this.config.baseURL;head.appendChild(base);}HTMLArea._appendToLog("[HTMLArea::initIframe]: Iframe baseURL set to: "+this.config.baseURL);}var link0=doc.getElementsByTagName("link")[0];if(!link0){link0=doc.createElement("link");link0.rel="stylesheet";link0.href=this.config.editedContentStyle;head.appendChild(link0);HTMLArea._appendToLog("[HTMLArea::initIframe]: Skin CSS set to: "+this.config.editedContentStyle);}if(this.config.defaultPageStyle){var link=doc.getElementsByTagName("link")[1];if(!link){link=doc.createElement("link");link.rel="stylesheet";link.href=this.config.defaultPageStyle;head.appendChild(link);}HTMLArea._appendToLog("[HTMLArea::initIframe]: Override CSS set to: "+this.config.defaultPageStyle);}if(this.config.pageStyle){var link=doc.getElementsByTagName("link")[2];if(!link){link=doc.createElement("link");link.rel="stylesheet";link.href=this.config.pageStyle;head.appendChild(link);}HTMLArea._appendToLog("[HTMLArea::initIframe]: Content CSS set to: "+this.config.pageStyle);}}else{var html=this._textArea.value;this.setFullHTML(html);}HTMLArea._appendToLog("[HTMLArea::initIframe]: Editor iframe head successfully initialized.");this.stylesLoaded();};HTMLArea.stylesLoaded=function(editorNumber){var editor=RTEarea[editorNumber]["editor"];editor.stylesLoaded();};HTMLArea.prototype.stylesLoaded=function(){var doc=this._doc;var docWellFormed=true;if(!HTMLArea.is_opera){if(this._stylesLoadedTimer)window.clearTimeout(this._stylesLoadedTimer);var stylesAreLoaded=true;var errorText='';var rules;for(var rule=0;rule<doc.styleSheets.length;rule++){if(HTMLArea.is_gecko)try{rules=doc.styleSheets[rule].cssRules;}catch(e){stylesAreLoaded=false;errorText=e;}if(HTMLArea.is_ie)try{rules=doc.styleSheets[rule].rules;}catch(e){stylesAreLoaded=false;errorText=e;}if(HTMLArea.is_ie)try{rules=doc.styleSheets[rule].imports;}catch(e){stylesAreLoaded=false;errorText=e;}}if(!stylesAreLoaded&&!HTMLArea.is_wamcom){HTMLArea._appendToLog("[HTMLArea::initIframe]: Failed attempt at loading stylesheets: "+errorText+" Retrying...");this._stylesLoadedTimer=window.setTimeout("HTMLArea.stylesLoaded("+this._editorNumber+");",100);return false;}HTMLArea._appendToLog("[HTMLArea::initIframe]: Stylesheets successfully loaded.");}if(!this.config.fullPage){doc.body.style.borderWidth="0px";doc.body.className="htmlarea-content-body";try{doc.body.innerHTML=this._textArea.value;}catch(e){HTMLArea._appendToLog("[HTMLArea::initIframe]: The HTML document is not well-formed.");alert(HTMLArea.I18N.msg["HTML-document-not-well-formed"]);docWellFormed=false;}}if(this._customUndo)this._timerUndo=window.setInterval("HTMLArea.undoTakeSnapshot("+this._editorNumber+");",this.config.undoTimeout);if(docWellFormed){if(HTMLArea.is_gecko&&!HTMLArea.is_safari&&!HTMLArea.is_opera&&!this._initEditMode())return false;if(HTMLArea.is_opera)doc.designMode="on";if(HTMLArea.is_ie||HTMLArea.is_safari)doc.body.contentEditable=true;if(HTMLArea.is_ie)doc.selection.empty();this._editMode="wysiwyg";if(doc.body.contentEditable||doc.designMode=="on")HTMLArea._appendToLog("[HTMLArea::initIframe]: Design mode successfully set.");}else{this._editMode="textmode";this.setMode("docnotwellformedmode");HTMLArea._appendToLog("[HTMLArea::initIframe]: Design mode could not be set.");}doc._editorNo=this._editorNumber;if(HTMLArea.is_ie)doc.documentElement._editorNo=this._editorNumber;HTMLArea._addEvents((HTMLArea.is_ie?doc.body:doc),["keydown","keypress","mousedown","mouseup","drag"],HTMLArea._editorEvent,true);HTMLArea._addEvent((this._iframe.contentWindow?this._iframe.contentWindow:this._iframe.contentDocument),"unload",HTMLArea.removeEditorEvents);if(this.config.cleanWordOnPaste)HTMLArea._addEvents((HTMLArea.is_ie?doc.body:doc),["paste","dragdrop","drop"],HTMLArea.cleanWordOnPaste,true);window.setTimeout("HTMLArea.generatePlugins("+this._editorNumber+");",100);};HTMLArea.generatePlugins=function(editorNumber){var editor=RTEarea[editorNumber]["editor"];editor._hasPluginWithOnKeyPressHandler=false;for(var i in editor.plugins){var plugin=editor.plugins[i].instance;if(typeof(plugin.onGenerate)=="function")plugin.onGenerate();if(typeof(plugin.onGenerateOnce)=="function"){plugin.onGenerateOnce();plugin.onGenerateOnce=null;}if(typeof(plugin.onKeyPress)=="function"){editor._hasPluginWithOnKeyPressHandler=true;}}if(typeof(editor.onGenerate)=="function"){editor.onGenerate();editor.onGenerate=null;}HTMLArea._appendToLog("[HTMLArea::initIframe]: All plugins successfully generated.");editor.updateToolbar();};HTMLArea.resetHandler=function(ev){if(!ev)var ev=window.event;var form=(ev.target)?ev.target:ev.srcElement;var editor=RTEarea[form._editorNumber]["editor"];editor.setHTML(editor._textArea.value);editor.updateToolbar();var a=form.__msh_prevOnReset;if(typeof(a)!="undefined"){for(var i=a.length;--i>=0;){a[i]();}}};HTMLArea.removeEditorEvents=function(ev){if(!ev)var ev=window.event;HTMLArea._stopEvent(ev);if(Dialog._modal){Dialog._modal.close();Dialog._modal=null;}for(var ed=RTEarea.length;--ed>0;){var editor=RTEarea[ed]["editor"];if(editor){RTEarea[ed]["editor"]=null;editor._textArea.value=editor.getHTML();window.clearInterval(editor._timerUndo);editor._undoQueue=null;if(HTMLArea._eventCache&&!HTMLArea.is_opera)HTMLArea._eventCache.flush();if(HTMLArea.is_ie)HTMLArea._cleanup(editor);}}};HTMLArea.prototype.setMode=function(mode){if(typeof(mode)=="undefined")var mode=(this._editMode=="textmode")?"wysiwyg":"textmode";switch(mode){case "textmode":case "docnotwellformedmode":this._textArea.value=this.getHTML();this._iframe.style.display="none";this._textArea.style.display="block";if(this.config.statusBar){var statusBarTextMode=document.createElement("span");statusBarTextMode.className="statusBarTextMode";statusBarTextMode.appendChild(document.createTextNode(HTMLArea.I18N.msg["TEXT_MODE"]));this._statusBar.innerHTML='';this._statusBar.appendChild(statusBarTextMode);}this._editMode="textmode";break;case "wysiwyg":if(HTMLArea.is_gecko&&!HTMLArea.is_safari)this._doc.designMode="off";try{if(!this.config.fullPage)this._doc.body.innerHTML=this.getHTML();else this.setFullHTML(this.getHTML());}catch(e){alert(HTMLArea.I18N.msg["HTML-document-not-well-formed"]);break;}this._textArea.style.display="none";this._iframe.style.display="block";if(HTMLArea.is_gecko&&!HTMLArea.is_safari)this._doc.designMode="on";if(this.config.statusBar){this._statusBar.innerHTML="";this._statusBar.appendChild(this._statusBarTree);}this._editMode="wysiwyg";break;default:return false;}if(!(mode=="docnotwellformedmode"))this.focusEditor();for(var i in this.plugins){var plugin=this.plugins[i].instance;if(typeof(plugin.onMode)=="function"){plugin.onMode(mode);}}};HTMLArea.prototype.setFullHTML=function(html){var save_multiline=RegExp.multiline;RegExp.multiline=true;if(html.match(HTMLArea.RE_doctype)){this.setDoctype(RegExp.$1);html=html.replace(HTMLArea.RE_doctype,"");};RegExp.multiline=save_multiline;if(!HTMLArea.is_ie){if(html.match(HTMLArea.RE_head))this._doc.getElementsByTagName("head")[0].innerHTML=RegExp.$1;if(html.match(HTMLArea.RE_body))this._doc.getElementsByTagName("body")[0].innerHTML=RegExp.$1;}else{var html_re=/<html>((.|\n)*?)<\/html>/i;html=html.replace(html_re,"$1");this._doc.open();this._doc.write(html);this._doc.close();this._doc.body.contentEditable=true;return true;};};HTMLArea.prototype.registerPlugin=function(){var plugin=arguments[0];var args=[];for(var i=1;i<arguments.length;++i){args.push(arguments[i]);}this.registerPlugin2(plugin,args);};HTMLArea.prototype.registerPlugin2=function(plugin,args){if(typeof(plugin)=="string"){var plugin=eval(plugin);};if(typeof(plugin)=="undefined"){HTMLArea._appendToLog("ERROR [HTMLArea::registerPlugin]: Can't register undefined plugin.");return false;};var obj=new plugin(this,args);if(obj){var clone={};var info=plugin._pluginInfo;for(var i in info){clone[i]=info[i];}clone.instance=obj;clone.args=args;this.plugins[plugin._pluginInfo.name]=clone;}else{HTMLArea._appendToLog("ERROR [HTMLArea::registerPlugin]: Can't register plugin "+plugin.toString()+".");};};HTMLArea.loadPlugin=function(pluginName,noLangFile,url){if(typeof(url)=="undefined"){var dir=_editor_url+"plugins/"+pluginName;var plugin=pluginName.replace(/([a-z])([A-Z])([a-z])/g,"$1"+"-"+"$2"+"$3").toLowerCase()+".js";var plugin_file=dir+"/"+plugin;HTMLArea.loadScript(plugin_file);if(typeof(noLangFile)=="undefined"||!noLangFile){var plugin_lang=dir+"/lang/"+_editor_lang+".js";HTMLArea._scripts.push(plugin_lang);}}else{HTMLArea.loadScript(url);}};HTMLArea.loadStyle=function(style,plugin,url){if(typeof(url)=="undefined"){var url=_editor_url||'';if(typeof(plugin)!="undefined"){url+="plugins/"+plugin+"/";}url+=style;if(/^\//.test(style)){url=style;}}var head=document.getElementsByTagName("head")[0];var link=document.createElement("link");link.rel="stylesheet";link.href=url;head.appendChild(link);};HTMLArea.loadStyle('','',_editor_CSS);HTMLArea.prototype.imgURL=function(file,plugin){if(typeof(plugin)=="undefined")return _editor_skin+this.config.imgURL+file;else return _editor_skin+this.config.imgURL+plugin+"/"+file;};HTMLArea.prototype.popupURL=function(file){var url="";if(file.match(/^plugin:\/\/(.*?)\/(.*)/)){var plugin=RegExp.$1;var popup=RegExp.$2;if(!/\.html$/.test(popup))popup+=".html";url=_editor_url+"plugins/"+plugin+"/popups/"+popup;}else{url=_typo3_host_url+_editor_url+this.config.popupURL+file;};return url;};HTMLArea.getInnerText=function(el){var txt='',i;for(i=el.firstChild;i;i=i.nextSibling){if(i.nodeType==3)txt+=i.data;else if(i.nodeType==1)txt+=HTMLArea.getInnerText(i);};return txt;};HTMLArea._wordClean=function(editor,html){function clearClass(node){var newc=node.className.replace(/(^|\s)mso.*?(\s|$)/ig,' ');if(newc!=node.className){node.className=newc;if(!/\S/.test(node.className))node.removeAttribute("className");}};function clearStyle(node){if(HTMLArea.is_ie)var style=node.style.cssText;else var style=node.getAttribute("style");if(style){var declarations=style.split(/\s*;\s*/);for(var i=declarations.length;--i>=0;){if(/^mso|^tab-stops/i.test(declarations[i])||/^margin\s*:\s*0..\s+0..\s+0../i.test(declarations[i]))declarations.splice(i,1);};node.setAttribute("style",declarations.join("; "));}};function stripTag(el){if(HTMLArea.is_ie){el.outerHTML=HTMLArea.htmlEncode(el.innerText);}else{var txt=document.createTextNode(HTMLArea.getInnerText(el));el.parentNode.insertBefore(txt,el);el.parentNode.removeChild(el);}};function checkEmpty(el){if(/^(span|b|strong|i|em|font)$/i.test(el.tagName)&&!el.firstChild)el.parentNode.removeChild(el);};function parseTree(root){var tag=root.tagName.toLowerCase(),i,next;if((HTMLArea.is_ie&&root.scopeName!='HTML')||(!HTMLArea.is_ie&&/:/.test(tag))||/o:p/.test(tag)){stripTag(root);return false;}else{clearClass(root);clearStyle(root);for(i=root.firstChild;i;i=next){next=i.nextSibling;if(i.nodeType==1&&parseTree(i)){checkEmpty(i);}}};return true;};parseTree(html);};HTMLArea.wordCleanLater=function(editorNumber,doUpdateToolbar){var editor=RTEarea[editorNumber]["editor"];HTMLArea._wordClean(editor,editor._doc.body);if(doUpdateToolbar)editor.updateToolbar();};HTMLArea.cleanWordOnPaste=function(ev){if(!ev)var ev=window.event;var target=(ev.target)?ev.target:ev.srcElement;var owner=(target.ownerDocument)?target.ownerDocument:target;while(HTMLArea.is_ie&&owner.parentElement){owner=owner.parentElement;};if(typeof(browserWin)!="undefined")browserWin.close();window.setTimeout("HTMLArea.wordCleanLater("+owner._editorNo+", true);",250);};HTMLArea.prototype.forceRedraw=function(){this._doc.body.style.visibility="hidden";this._doc.body.style.visibility="visible";};HTMLArea.prototype.focusEditor=function(){switch(this._editMode){case "wysiwyg":try{if(HTMLArea.is_safari)this._doc.focus();else this._iframe.contentWindow.focus();}catch(e){};break;case "textmode":this._textArea.focus();break;};return this._doc;};HTMLArea.undoTakeSnapshot=function(editorNumber){var editor=RTEarea[editorNumber]["editor"];if(editor._doc)editor._undoTakeSnapshot();};HTMLArea.prototype._undoTakeSnapshot=function(){var curTime=(new Date()).getTime();var newOne=true;if(this._undoPos>=this.config.undoSteps){this._undoQueue.shift();--this._undoPos;};if(this._undoPos<0||this._undoQueue[this._undoPos].time<curTime-this.config.undoTimeout){++this._undoPos;}else{newOne=false;};var txt=this.getInnerHTML();if(newOne){if(this._undoPos==0||this._undoQueue[this._undoPos-1].text!=txt){this._undoQueue[this._undoPos]={text:txt,time:curTime};this._undoQueue.length=this._undoPos+1;}else{this._undoPos--;}}else{if(this._undoQueue[this._undoPos].text!=txt){this._undoQueue[this._undoPos].text=txt;this._undoQueue.length=this._undoPos+1;}}};HTMLArea.setUndoQueueLater=function(editorNumber,op){var editor=RTEarea[editorNumber]["editor"];if(op=="undo"){editor.setHTML(editor._undoQueue[--editor._undoPos].text);}else if(op=="redo"){if(editor._undoPos<editor._undoQueue.length-1)editor.setHTML(editor._undoQueue[++editor._undoPos].text);}};HTMLArea.prototype.undo=function(){if(this._undoPos>0){this._undoTakeSnapshot();if(!HTMLArea.is_opera)this.setHTML(this._undoQueue[--this._undoPos].text);else window.setTimeout("HTMLArea.setUndoQueueLater("+this._editorNumber+", 'undo');",10);}};HTMLArea.prototype.redo=function(){if(this._undoPos<this._undoQueue.length-1){this._undoTakeSnapshot();if(!HTMLArea.is_opera){if(this._undoPos<this._undoQueue.length-1)this.setHTML(this._undoQueue[++this._undoPos].text);}else{window.setTimeout("HTMLArea.setUndoQueueLater("+this._editorNumber+", 'redo');",10);}}};HTMLArea.updateToolbar=function(editorNumber){var editor=RTEarea[editorNumber]["editor"];editor.updateToolbar();editor._timerToolbar=null;};HTMLArea.prototype.updateToolbar=function(noStatus){var doc=this._doc,text=(this._editMode=="textmode"),selection=this.hasSelectedText(),ancestors=null,cls=new Array(),txt,txtClass,i,cmd,inContext,match,matchAny,k,j,n,commandState;if(!text){ancestors=this.getAllAncestors();if(this.config.statusBar&&!noStatus){if(this._statusBarTree.hasChildNodes()){for(i=this._statusBarTree.firstChild;i;i=i.nextSibling){if(i.nodeName.toLowerCase()=="a"){HTMLArea._removeEvents(i,["click","contextmenu, mousedown"],HTMLArea.statusBarHandler);i.el=null;i.editor=null;}}};this._statusBarTree.innerHTML='';this._statusBarTree.appendChild(document.createTextNode(HTMLArea.I18N.msg["Path"]+": "));for(i=ancestors.length;--i>=0;){var el=ancestors[i];if(!el)continue;var a=document.createElement("a");a.href="#";a.el=el;a.editor=this;if(!HTMLArea.is_opera){HTMLArea._addEvents(a,["click","contextmenu"],HTMLArea.statusBarHandler);}else{HTMLArea._addEvents(a,["mousedown","click"],HTMLArea.statusBarHandler);};txt=el.tagName.toLowerCase();if(!HTMLArea.is_opera)a.title=el.style.cssText;a.title=el.style.cssText;if(el.id){txt+="#"+el.id;};if(el.className){txtClass="";cls=el.className.trim().split(" ");for(j=cls.length;j>0;){if(!HTMLArea.reservedClassNames.test(cls[--j])){txtClass="."+cls[j];}};txt+=txtClass;};a.appendChild(document.createTextNode(txt));this._statusBarTree.appendChild(a);if(i!=0)this._statusBarTree.appendChild(document.createTextNode(String.fromCharCode(0xbb)));}}};for(i in this._toolbarObjects){var btn=this._toolbarObjects[i];cmd=i;inContext=true;if(btn.context&&!text){inContext=false;var attrs=[];var contexts=[];if(/(.*)\[(.*?)\]/.test(btn.context)){contexts=RegExp.$1.split(",");attrs=RegExp.$2.split(",");}else{contexts=btn.context.split(",");};for(j=contexts.length;--j>=0;)contexts[j]=contexts[j].toLowerCase();matchAny=(contexts[0]=="*");for(k=0;k<ancestors.length;++k){if(!ancestors[k])continue;match=false;for(j=contexts.length;--j>=0;)match=match||(ancestors[k].tagName.toLowerCase()==contexts[j]);if(matchAny||match){inContext=true;for(j=attrs.length;--j>=0;){if(!eval("ancestors[k]."+attrs[j])){inContext=false;break;}};if(inContext)break;}}};if(cmd=="CreateLink")btn.state("enabled",(!text||btn.text)&&(inContext||selection));else btn.state("enabled",(!text||btn.text)&&inContext&&(selection||!btn.selection));if(typeof(cmd)=="function"){continue;};var dropdown=this.config.customSelects[cmd];if((!text||btn.text)&&(typeof(dropdown)!="undefined")){dropdown.refresh(this);continue;};switch(cmd){case "FontName":case "FontSize":if(!text)try{var value=(""+doc.queryCommandValue(cmd)).toLowerCase();if(!value){document.getElementById(btn.elementId).selectedIndex=0;break;};var options=this.config[cmd];k=0;for(j in options){if((j.toLowerCase()==value)||(options[j].substr(0,value.length).toLowerCase()==value)){document.getElementById(btn.elementId).selectedIndex=k;throw "ok";};++k;};document.getElementById(btn.elementId).selectedIndex=0;}catch(e){};break;case "FormatBlock":var blocks=[];for(var i in this.config['FormatBlock']){blocks[blocks.length]=this.config['FormatBlock'][i];};var deepestAncestor=this._getFirstAncestor(this._getSelection(),blocks);if(deepestAncestor){for(var x=0;x<blocks.length;x++){if(blocks[x].toLowerCase()==deepestAncestor.tagName.toLowerCase())document.getElementById(btn.elementId).selectedIndex=x;}}else{document.getElementById(btn.elementId).selectedIndex=0;};break;case "TextIndicator":if(!text){try{with(document.getElementById(btn.elementId).style){backgroundColor=HTMLArea._makeColor(doc.queryCommandValue((HTMLArea.is_ie||HTMLArea.is_safari)?"BackColor":"HiliteColor"));if(/transparent/i.test(backgroundColor)){backgroundColor=HTMLArea._makeColor(doc.queryCommandValue("BackColor"));}color=HTMLArea._makeColor(doc.queryCommandValue("ForeColor"));fontFamily=doc.queryCommandValue("FontName");fontWeight="normal";fontStyle="normal";try{fontWeight=doc.queryCommandState("Bold")?"bold":"normal";}catch(ex){fontWeight="normal";};try{fontStyle=doc.queryCommandState("Italic")?"italic":"normal";}catch(ex){fontStyle="normal";};}}catch(e){}};break;case "HtmlMode":btn.state("active",text);break;case "LeftToRight":case "RightToLeft":var el=this.getParentElement();while(el&&!HTMLArea.isBlockElement(el)){el=el.parentNode;};if(el)btn.state("active",(el.style.direction==((cmd=="RightToLeft")?"rtl":"ltr")));break;case "Bold":case "Italic":case "StrikeThrough":case "Underline":case "Subscript":case "Superscript":case "JustifyLeft":case "JustifyCenter":case "JustifyRight":case "JustifyFull":case "Indent":case "Outdent":case "InsertOrderedList":case "InsertUnorderedList":commandState=false;if(!text)try{commandState=doc.queryCommandState(cmd);}catch(e){commandState=false;};btn.state("active",commandState);break;default:break;}};if(this._customUndo)this._undoTakeSnapshot();for(i in this.plugins){var plugin=this.plugins[i].instance;if(typeof(plugin.onUpdateToolbar)=="function")plugin.onUpdateToolbar();}};HTMLArea.prototype.surroundHTML=function(startTag,endTag){this.insertHTML(startTag+this.getSelectedHTML().replace(HTMLArea.Reg_body,"")+endTag);};HTMLArea.prototype.convertNode=function(el,newTagName){var newel=this._doc.createElement(newTagName),p=el.parentNode;while(el.firstChild)newel.appendChild(el.firstChild);p.insertBefore(newel,el);p.removeChild(el);return newel;};HTMLArea.getElementObject=function(el,tagName){var oEl=el;while(oEl!=null&&oEl.nodeName.toLowerCase()!=tagName)oEl=oEl.parentNode;return oEl;};HTMLArea.prototype.makeNestedList=function(el){var previous,clone;for(var i=el.firstChild;i;i=i.nextSibling){if(/^li$/i.test(i.tagName)){for(var j=i.firstChild;j;j=j.nextSibling){if(/^(ol|ul)$/i.test(j.tagName))this.makeNestedList(j);}}else if(/^(ol|ul)$/i.test(i.tagName)){previous=i.previousSibling;var clone=i.cloneNode(true);if(!previous){previous=el.insertBefore(this._doc.createElement("li"),i);previous.appendChild(clone);}else{previous.appendChild(clone);};HTMLArea.removeFromParent(i);this.makeNestedList(el);break;}}};HTMLArea.prototype.hasSelectedText=function(){return this.getSelectedHTML()!="";};HTMLArea.prototype.getAllAncestors=function(){var p=this.getParentElement();var a=[];while(p&&(p.nodeType==1)&&(p.tagName.toLowerCase()!='body')){a.push(p);p=p.parentNode;};a.push(this._doc.body);return a;};HTMLArea.prototype._getFirstAncestor=function(sel,types){var prnt=this._activeElement(sel);if(prnt==null){try{prnt=(HTMLArea.is_ie?this._createRange(sel).parentElement():this._createRange(sel).commonAncestorContainer);}catch(e){return null;}};if(typeof(types)=='string')types=[types];while(prnt){if(prnt.nodeType==1){if(types==null)return prnt;for(var i=0;i<types.length;i++){if(prnt.tagName.toLowerCase()==types[i])return prnt;};if(prnt.tagName.toLowerCase()=='body')break;if(prnt.tagName.toLowerCase()=='table')break;};prnt=prnt.parentNode;};return null;};HTMLArea.createLinkDialog=function(editor,link){return(function(param){if(!param||typeof(param.f_href)=="undefined")return false;var a=link;if(!a)try{editor._doc.execCommand("CreateLink",false,param.f_href);a=editor.getParentElement();var sel=editor._getSelection();var range=editor._createRange(sel);if(!HTMLArea.is_ie){a=range.startContainer;if(!/^a$/i.test(a.tagName)){a=a.nextSibling;if(a==null)a=range.startContainer.parentNode;}}}catch(e){}else{var href=param.f_href.trim();editor.selectNodeContents(a);if(href==""){editor._doc.execCommand("Unlink",false,null);editor.updateToolbar();return false;}else{a.href=href;}};if(!(a&&/^a$/i.test(a.tagName)))return false;if(typeof(param.f_target)!="undefined")a.target=param.f_target.trim();if(typeof(param.f_title)!="undefined")a.title=param.f_title.trim();editor.selectNodeContents(a);editor.updateToolbar();editor=null;link=null;});};HTMLArea.prototype._createLink=function(link){var outparam=null;this.focusEditor();if(typeof(link)=="undefined"){link=this.getParentElement();if(link){if(/^img$/i.test(link.tagName))link=link.parentNode;if(!/^a$/i.test(link.tagName))link=null;}};if(!link){var sel=this._getSelection();if(this._selectionEmpty(sel)){alert("You need to select some text before creating a link");return;};outparam={f_href:'',f_title:'',f_target:'',f_usetarget:this.config.makeLinkShowsTarget};}else{outparam={f_href:HTMLArea.is_ie?this.stripBaseURL(link.href):link.getAttribute("href"),f_title:link.title,f_target:link.target,f_usetarget:this.config.makeLinkShowsTarget};};var createLinkDialogFunctRef=HTMLArea.createLinkDialog(this,link);this._popupDialog("link.html",createLinkDialogFunctRef,outparam,450,145);};HTMLArea.insertImageDialog=function(editor,image){return(function(param){if(!param||typeof(param.f_url)=="undefined")return false;var img=image;if(!img){var sel=editor._getSelection();var range=editor._createRange(sel);editor._doc.execCommand("InsertImage",false,param.f_url);if(HTMLArea.is_ie){img=range.parentElement();if(img.tagName.toLowerCase()!="img")img=img.previousSibling;}else{var sel=editor._getSelection();var range=editor._createRange(sel);img=range.startContainer;if(HTMLArea.is_opera)img=img.parentNode;img=img.lastChild;while(img&&img.nodeName.toLowerCase()!="img")img=img.previousSibling;}}else{img.src=param.f_url;};for(var field in param){var value=param[field];switch(field){case "f_alt":img.alt=value;break;case "f_border":if(parseInt(value)){img.style.borderWidth=parseInt(value)+"px";img.style.borderStyle="solid";}else{img.style.borderWidth="";img.style.borderStyle="none";};break;case "f_align":img.style.verticalAlign=value;break;case "f_vert":if(parseInt(value)){img.style.marginTop=parseInt(value)+"px";img.style.marginBottom=parseInt(value)+"px";}else{img.style.marginTop="";img.style.marginBottom="";};break;case "f_horiz":if(parseInt(value)){img.style.marginLeft=parseInt(value)+"px";img.style.marginRight=parseInt(value)+"px";}else{img.style.marginLeft="";img.style.marginRight="";};break;case "f_float":if(HTMLArea.is_ie)img.style.styleFloat=value;else img.style.cssFloat=value;break;}}editor=null;image=null;});};HTMLArea.prototype._insertImage=function(image){var outparam=null;this.focusEditor();if(typeof(image)=="undefined"){var image=this.getParentElement();if(image&&!/^img$/i.test(image.tagName))image=null;};if(image)outparam={f_base:this.config.baseURL,f_url:image.getAttribute("src"),f_alt:image.alt,f_border:isNaN(parseInt(image.style.borderWidth))?"":parseInt(image.style.borderWidth),f_align:image.style.verticalAlign,f_vert:isNaN(parseInt(image.style.marginTop))?"":parseInt(image.style.marginTop),f_horiz:isNaN(parseInt(image.style.marginLeft))?"":parseInt(image.style.marginLeft),f_float:HTMLArea.is_ie?image.style.styleFloat:image.style.cssFloat};var insertImageDialogFunctRef=HTMLArea.insertImageDialog(this,image);this._popupDialog("insert_image.html",insertImageDialogFunctRef,outparam,580,460);};HTMLArea.insertTableDialog=function(editor,sel,range){return(function(param){if(!param)return false;var doc=editor._doc;var table=doc.createElement("table");for(var field in param){var value=param[field];if(!value)continue;switch(field){case "f_width":if(value!="")table.style.width=parseInt(value)+param["f_unit"];break;case "f_align":table.style.textAlign=value;break;case "f_border":if(value!=""){table.style.borderWidth=parseInt(value)+"px";table.style.borderStyle="solid";};break;case "f_spacing":if(value!="")table.cellSpacing=parseInt(value);break;case "f_padding":if(value!="")table.cellPadding=parseInt(value);break;case "f_float":if(HTMLArea.is_ie)table.style.styleFloat=((value!="not set")?value:"");else table.style.cssFloat=((value!="not set")?value:"");break;}};var cellwidth=0;if(param.f_fixed)cellwidth=Math.floor(100/parseInt(param.f_cols));var tbody=doc.createElement("tbody");table.appendChild(tbody);for(var i=param["f_rows"];i>0;i--){var tr=doc.createElement("tr");tbody.appendChild(tr);for(var j=param["f_cols"];j>0;j--){var td=doc.createElement("td");if(cellwidth)td.style.width=cellwidth+"%";tr.appendChild(td);}}editor.focusEditor();if(HTMLArea.is_ie)range.pasteHTML(table.outerHTML);else editor.insertNodeAtSelection(table);if(editor.config.buttons["toggleborders"]&&editor.config.buttons["toggleborders"]["setOnTableCreation"])editor.plugins["TableOperations"].instance.buttonPress(editor,"TO-toggle-borders");if(HTMLArea.is_gecko&&!HTMLArea.is_safari&&!HTMLArea.is_opera)editor.setMode("wysiwyg");editor.updateToolbar();editor=null;sel=null;range=null;return true;});};HTMLArea.prototype._insertTable=function(){var sel=this._getSelection();var range=this._createRange(sel);this.focusEditor();var insertTableDialogFunctRef=HTMLArea.insertTableDialog(this,sel,range);this._popupDialog("insert_table.html",insertTableDialogFunctRef,this,520,230);};HTMLArea.selectColorDialog=function(editor,cmdID){return(function(color){if(color)editor._doc.execCommand(cmdID,false,"#"+color);});};HTMLArea.prototype.execCommand=function(cmdID,UI,param){this.focusEditor();if(HTMLArea.is_gecko&&!this.config.useCSS&&!HTMLArea.is_safari&&!HTMLArea.is_opera){try{this._doc.execCommand((this.config.styleWithCSS?"styleWithCSS":"useCSS"),false,(this.config.styleWithCSS?false:true));}catch(e){};}switch(cmdID){case "HtmlMode":this.setMode();break;case "SplitBlock":this._doc.execCommand('FormatBlock',false,((HTMLArea.is_ie||HTMLArea.is_safari)?"<div>":"div"));break;case "HiliteColor":(HTMLArea.is_ie||HTMLArea.is_safari)&&(cmdID="BackColor");case "ForeColor":var colorDialogFunctRef=HTMLArea.selectColorDialog(this,cmdID);this._popupDialog("select_color.html",colorDialogFunctRef,HTMLArea._colorToRgb(this._doc.queryCommandValue(cmdID)),200,182);break;case "CreateLink":this._createLink();break;case "Undo":case "Redo":if(this._customUndo)this[cmdID.toLowerCase()]();else this._doc.execCommand(cmdID,UI,param);break;case "InsertTable":this._insertTable();break;case "InsertImage":this._insertImage();break;case "About":this._popupDialog("about.html",null,this,475,350);break;case "CleanWord":HTMLArea._wordClean(this,this._doc.body);break;case "Cut":case "Copy":case "Paste":try{this._doc.execCommand(cmdID,false,null);if(cmdID=="Paste"&&this.config.cleanWordOnPaste)HTMLArea._wordClean(this,this._doc.body);}catch(e){if(HTMLArea.is_gecko&&!HTMLArea.is_safari&&!HTMLArea.is_opera)this._mozillaPasteException(cmdID,UI,param);}break;case "LeftToRight":case "RightToLeft":var dir=(cmdID=="RightToLeft")?"rtl":"ltr";var el=this.getParentElement();while(el&&!HTMLArea.isBlockElement(el))el=el.parentNode;if(el){if(el.style.direction==dir)el.style.direction="";else el.style.direction=dir;}break;case "Indent":var el=this.getParentElement();while(el&&(!HTMLArea.isBlockElement(el)||/^li$/i.test(el.nodeName)))el=el.parentNode;try{this._doc.execCommand(cmdID,UI,param);}catch(e){if(this.config.debug)alert(e+"\n\nby execCommand("+cmdID+");");}if(/^(ol|ul)$/i.test(el.nodeName)){this.makeNestedList(el);this.selectNodeContents(el);}break;case "FontSize":case "FontName":if(param){this._doc.execCommand(cmdID,UI,param);break;}else{var sel=this._getSelection();if(HTMLArea.is_gecko&&sel.isCollapsed){var fontNode=this._getFirstAncestor(sel,"font");if(fontNode!=null)this.selectNode(fontNode);}this._doc.execCommand("RemoveFormat",UI,null);if(HTMLArea.is_gecko&&fontNode!=null){sel=this._getSelection();var r=this._createRange(sel).cloneRange();r.collapse(false);if(HTMLArea.is_safari){sel.empty();sel.setBaseAndExtent(r.startContainer,r.startOffset,r.endContainer,r.endOffset);}else{sel.removeAllRanges();sel.addRange(r);}}}break;default:try{this._doc.execCommand(cmdID,UI,param);}catch(e){if(this.config.debug)alert(e+"\n\nby execCommand("+cmdID+");");}}this.updateToolbar();return false;};HTMLArea._editorEvent=function(ev){if(!ev)var ev=window.event;var target=(ev.target)?ev.target:ev.srcElement;var owner=(target.ownerDocument)?target.ownerDocument:target;if(HTMLArea.is_ie){while(owner.parentElement){owner=owner.parentElement;}}var editor=RTEarea[owner._editorNo]["editor"];var keyEvent=((HTMLArea.is_ie||HTMLArea.is_safari)&&ev.type=="keydown")||(!HTMLArea.is_ie&&ev.type=="keypress");editor.focusEditor();if(keyEvent){if(editor._hasPluginWithOnKeyPressHandler){for(var i in editor.plugins){var plugin=editor.plugins[i].instance;if(typeof(plugin.onKeyPress)=="function"){if(plugin.onKeyPress(ev))return false;}}}if(ev.ctrlKey){if(!ev.altKey){var key=String.fromCharCode((HTMLArea.is_ie||HTMLArea.is_safari||HTMLArea.is_opera)?ev.keyCode:ev.charCode).toLowerCase();if(HTMLArea.is_gecko&&ev.keyCode==32)key=String.fromCharCode(ev.keyCode).toLowerCase();var cmd=null;var value=null;switch(key){case '1':case '2':case '3':case '4':case '5':case '6':if(editor._toolbarObjects["FormatBlock"]){cmd="FormatBlock";value="h"+key;if(HTMLArea.is_ie||HTMLArea.is_safari)value="<"+value+">";}break;case ' ':editor.insertHTML("&nbsp;");editor.updateToolbar();HTMLArea._stopEvent(ev);return false;default:if(editor.config.hotKeyList[key]){switch(editor.config.hotKeyList[key]){case "SelectAll":case "CleanWord":cmd=editor.config.hotKeyList[key];break;case "Paste":if(HTMLArea.is_ie||HTMLArea.is_safari){cmd=editor.config.hotKeyList[key];}else if(editor.config.cleanWordOnPaste){window.setTimeout("HTMLArea.wordCleanLater("+owner._editorNo+", false);",50);}break;default:if(editor._toolbarObjects[editor.config.hotKeyList[key]]){cmd=editor.config.hotKeyList[key];if(cmd=="FormatBlock")value=(HTMLArea.is_ie||HTMLArea.is_safari)?"<p>":"p";}}}}if(cmd){editor.execCommand(cmd,false,value);HTMLArea._stopEvent(ev);return false;}else{editor.updateToolbar();}}}else if(ev.altKey){if(editor.plugins['ContextMenu']&&editor.plugins['ContextMenu'].instance){var keys=editor.plugins['ContextMenu'].instance.keys;if(keys.length>0){var k;for(var i=keys.length;--i>=0;){k=keys[i];if(k[0].toLowerCase()==key){HTMLArea._stopEvent(ev);return false;}}}}}else if(keyEvent){if(HTMLArea.is_gecko)editor._detectURL(ev);switch(ev.keyCode){case 13:if(HTMLArea.is_gecko&&!ev.shiftKey&&!editor.config.disableEnterParagraphs){editor._checkInsertP();HTMLArea._stopEvent(ev);editor.updateToolbar();}break;case 8:case 46:if((HTMLArea.is_gecko&&!ev.shiftKey)||HTMLArea.is_ie){if(editor._checkBackspace())HTMLArea._stopEvent(ev);}if(editor._timerToolbar)window.clearTimeout(editor._timerToolbar);editor._timerToolbar=window.setTimeout("HTMLArea.updateToolbar("+editor._editorNumber+");",50);break;case 9:if(HTMLArea.is_gecko){editor.execCommand((ev.shiftKey?"Outdent":"Indent"),false,null);HTMLArea._stopEvent(ev);return false;}break;case 37:case 39:if(HTMLArea.is_ie){editor._timerToolbar=window.setTimeout("HTMLArea.updateToolbar("+editor._editorNumber+");",10);break;}}}}else{if(editor._timerToolbar)window.clearTimeout(editor._timerToolbar);if(ev.type=="mouseup")editor.updateToolbar();else editor._timerToolbar=window.setTimeout("HTMLArea.updateToolbar("+editor._editorNumber+");",50);}};HTMLArea.prototype.scrollToCaret=function(){var e=this.getParentElement(),w=this._iframe.contentWindow?this._iframe.contentWindow:window,h=w.innerHeight||w.height,d=this._doc,t=d.documentElement.scrollTop||d.body.scrollTop;if(typeof(h)=="undefined")return false;if(e.offsetTop>h+t)w.scrollTo(e.offsetLeft,e.offsetTop-h+e.offsetHeight);};HTMLArea.prototype.getHTML=function(){switch(this._editMode){case "wysiwyg":if(!this.config.fullPage){return HTMLArea.getHTML(this._doc.body,false,this);}else{return this.doctype+"\n"+HTMLArea.getHTML(this._doc.documentElement,true,this);}case "textmode":return this._textArea.value;}return false;};HTMLArea.prototype.getInnerHTML=function(){switch(this._editMode){case "wysiwyg":if(!this.config.fullPage)return this._doc.body.innerHTML;else return this.doctype+"\n"+this._doc.documentElement.innerHTML;case "textmode":return this._textArea.value;}return false;};HTMLArea.prototype.setHTML=function(html){switch(this._editMode){case "wysiwyg":if(!this.config.fullPage)this._doc.body.innerHTML=html;else this._doc.body.innerHTML=html;break;case "textmode":this._textArea.value=html;break;}return false;};HTMLArea.prototype.setDoctype=function(doctype){this.doctype=doctype;};HTMLArea._object=null;HTMLArea.checkSupportedBrowser=function(){if(HTMLArea.is_gecko&&!HTMLArea.is_safari&&!HTMLArea.is_opera){if(navigator.productSub<20030210)return false;}return HTMLArea.is_gecko||HTMLArea.is_ie;};HTMLArea._eventCacheConstructor=function(){var listEvents=[];return({listEvents:listEvents,add:function(node,sEventName,fHandler){listEvents.push(arguments);},flush:function(){var item;for(var i=listEvents.length;--i>=0;){item=listEvents[i];try{HTMLArea._removeEvent(item[0],item[1],item[2]);item[0][item[1]]=null;item[0]=null;item[2]=null;}catch(e){}}}});};HTMLArea._addEvent=function(el,evname,func,useCapture){if(typeof(useCapture)=="undefined")var useCapture=false;if(HTMLArea.is_gecko){el.addEventListener(evname,func,!HTMLArea.is_opera||useCapture);}else{el.attachEvent("on"+evname,func);}HTMLArea._eventCache.add(el,evname,func);};HTMLArea._addEvents=function(el,evs,func,useCapture){if(typeof(useCapture)=="undefined")var useCapture=false;for(var i=evs.length;--i>=0;){HTMLArea._addEvent(el,evs[i],func,useCapture);}};HTMLArea._removeEvent=function(el,evname,func){if(HTMLArea.is_gecko){try{el.removeEventListener(evname,func,true);el.removeEventListener(evname,func,false);}catch(e){}}else{try{el.detachEvent("on"+evname,func);}catch(e){}}};HTMLArea._removeEvents=function(el,evs,func){for(var i=evs.length;--i>=0;){HTMLArea._removeEvent(el,evs[i],func);}};HTMLArea._stopEvent=function(ev){if(HTMLArea.is_gecko){ev.stopPropagation();ev.preventDefault();}else{ev.cancelBubble=true;ev.returnValue=false;}};HTMLArea._removeClass=function(el,removeClassName){if(!(el&&el.className))return;var cls=el.className.trim().split(" ");var ar=new Array();for(var i=cls.length;i>0;){if(cls[--i]!=removeClassName)ar[ar.length]=cls[i];}if(ar.length==0){if(!HTMLArea.is_opera)el.removeAttribute(HTMLArea.is_gecko?"class":"className");else el.className='';}else el.className=ar.join(" ");};HTMLArea._addClass=function(el,addClassName){HTMLArea._removeClass(el,addClassName);if(el.className)el.className+=" "+addClassName;else el.className=addClassName;};HTMLArea._hasClass=function(el,className){if(!el||!el.className)return false;var cls=el.className.split(" ");for(var i=cls.length;i>0;){if(cls[--i]==className)return true;}return false;};HTMLArea.RE_blockTags=/^(body|p|h1|h2|h3|h4|h5|h6|ul|ol|pre|dl|div|noscript|blockquote|form|hr|table|fieldset|address|td|tr|th|li|tbody|thead|tfoot|iframe|object)$/;HTMLArea.isBlockElement=function(el){return el&&el.nodeType==1&&HTMLArea.RE_blockTags.test(el.nodeName.toLowerCase());};HTMLArea.RE_closingTags=/^(p|span|a|li|ol|ul|dl|dt|td|th|tr|tbody|thead|tfoot|caption|table|div|em|i|strong|b|code|cite|blockquote|q|dfn|abbr|acronym|font|center|object|embed|tt|style|script|title|head|clickenlarge)$/;HTMLArea.RE_noClosingTag=/^(img|br|hr|input|area|base|link|meta|param)$/;HTMLArea.needsClosingTag=function(el){return el&&el.nodeType==1&&!HTMLArea.RE_noClosingTag.test(el.tagName.toLowerCase());};HTMLArea.htmlDecode=function(str){str=str.replace(/&lt;/g,"<").replace(/&gt;/g,">");str=str.replace(/&nbsp;/g,"\xA0");str=str.replace(/&quot;/g,"\x22");str=str.replace(/&#39;/g,"'");str=str.replace(/&amp;/g,"&");return str;};HTMLArea.htmlEncode=function(str){if(typeof(str)!='string')str=str.toString();str=HTMLArea.htmlDecode(str);str=str.replace(/&/g,"&amp;");str=str.replace(/</g,"&lt;").replace(/>/g,"&gt;");str=str.replace(/\xA0/g,"&nbsp;");str=str.replace(/\x22/g,"&quot;");str=str.replace(HTMLArea.Reg_entities,"&$1;");return str;};HTMLArea.getHTML=function(root,outputRoot,editor){try{return HTMLArea.getHTMLWrapper(root,outputRoot,editor);}catch(e){HTMLArea._appendToLog("The HTML document is not well-formed.");if(!HTMLArea._debugMode)alert(HTMLArea.I18N.msg["HTML-document-not-well-formed"]);else return HTMLArea.getHTMLWrapper(root,outputRoot,editor);return editor._doc.body.innerHTML;}};HTMLArea.getHTMLWrapper=function(root,outputRoot,editor){var html="";if(!root)return html;switch(root.nodeType){case 1:case 11:case 9:var closed,i,config=editor.config;var root_tag=(root.nodeType==1)?root.tagName.toLowerCase():'';if(root_tag=='br'&&config.removeTrailingBR&&!root.nextSibling&&HTMLArea.isBlockElement(root.parentNode)&&(!root.previousSibling||root.previousSibling.nodeName.toLowerCase()!='br'))break;if(config.htmlRemoveTagsAndContents&&config.htmlRemoveTagsAndContents.test(root_tag))break;var custom_tag=(config.customTags&&config.customTags.test(root_tag));var empty_root=(root_tag=="clickenlarge"&&!(root.firstChild&&root.firstChild.nodeName.toLowerCase()=="img"));if(outputRoot)outputRoot=!(config.htmlRemoveTags&&config.htmlRemoveTags.test(root_tag))&&!empty_root;if((HTMLArea.is_ie||HTMLArea.is_safari)&&root_tag=="head"){if(outputRoot)html+="<head>";var save_multiline=RegExp.multiline;RegExp.multiline=true;var txt=root.innerHTML.replace(HTMLArea.RE_tagName,function(str,p1,p2){return p1+p2.toLowerCase();});RegExp.multiline=save_multiline;html+=txt;if(outputRoot)html+="</head>";break;}else if(outputRoot){if(HTMLArea.is_gecko&&root.hasAttribute('_moz_editor_bogus_node'))break;closed=(!(root.hasChildNodes()||HTMLArea.needsClosingTag(root)||custom_tag));html="<"+root_tag;var a,name,value,attrs=root.attributes;var n=attrs.length;for(i=attrs.length;--i>=0;){a=attrs.item(i);name=a.nodeName.toLowerCase();if((!a.specified&&name!='value')||/_moz|contenteditable|_msh/.test(name))continue;if(!HTMLArea.is_ie||name!="style"){if(typeof(root[a.nodeName])!="undefined"&&name!="href"&&name!="src"&&name!="style"&&!/^on/.test(name)){value=root[a.nodeName];}else{value=a.nodeValue;if(HTMLArea.is_ie&&(name=="href"||name=="src"))value=editor.stripBaseURL(value);}}else{value=root.style.cssText;}if(/(_moz|^$)/.test(value))continue;if(HTMLArea.is_ie&&root_tag=="li"&&name=="value"&&a.nodeValue==0)continue;html+=" "+name+'="'+HTMLArea.htmlEncode(value)+'"';}if(html!="")html+=closed?" />":">";}for(i=root.firstChild;i;i=i.nextSibling){if(/^li$/i.test(i.tagName)&&!/^[ou]l$/i.test(root.tagName))html +="<ul>" +HTMLArea.getHTMLWrapper(i,true,editor)+"</ul>";else html+=HTMLArea.getHTMLWrapper(i,true,editor);}if(outputRoot&&!closed)html+="</"+root_tag+">";break;case 3:html=/^(script|style)$/i.test(root.parentNode.tagName)?root.data:HTMLArea.htmlEncode(root.data);break;case 8:if(!editor.config.htmlRemoveComments)html="<!--"+root.data+"-->";break;case 4:html+='<![CDATA['+root.data+']]>';break;case 5:html+='&'+root.nodeValue+';';break;case 7:html+='<?'+root.target+' '+root.data+' ?>';break;default:break;}return html;};HTMLArea.getPrevNode=function(node){if(!node)return null;if(node.previousSibling)return node.previousSibling;if(node.parentNode)return node.parentNode;return null;};HTMLArea.getNextNode=function(node){if(!node)return null;if(node.nextSibling)return node.nextSibling;if(node.parentNode)return node.parentNode;return null;};HTMLArea.removeFromParent=function(el){if(!el.parentNode)return;var pN=el.parentNode;pN.removeChild(el);return el;};HTMLArea.prototype.stripBaseURL=function(string){var baseurl=this.config.baseURL;baseurl=baseurl.replace(/[^\/]+$/,'');var basere=new RegExp(baseurl);string=string.replace(basere,"");baseurl=baseurl.replace(/^(https?:\/\/[^\/]+)(.*)$/,'$1');basere=new RegExp(baseurl);return string.replace(basere,"");};String.prototype.trim=function(){return this.replace(/^\s+/,'').replace(/\s+$/,'');};HTMLArea._makeColor=function(v){if(typeof(v)!="number"){return v;}var r=v&0xFF;var g=(v>>8)&0xFF;var b=(v>>16)&0xFF;return "rgb("+r+","+g+","+b+")";};HTMLArea._colorToRgb=function(v){if(!v)return '';function hex(d){return(d<16)?("0"+d.toString(16)):d.toString(16);};if(typeof(v)=="number"){var r=v&0xFF;var g=(v>>8)&0xFF;var b=(v>>16)&0xFF;return "#"+hex(r)+hex(g)+hex(b);}if(v.substr(0,3)=="rgb"){var re=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/;if(v.match(re)){var r=parseInt(RegExp.$1);var g=parseInt(RegExp.$2);var b=parseInt(RegExp.$3);return "#"+hex(r)+hex(g)+hex(b);}return null;}if(v.substr(0,1)=="#"){return v;}return null;};HTMLArea._postback=function(url,data,handler,addParams,charset){if(typeof(charset)=="undefined")var charset="utf-8";var req=null;if(window.XMLHttpRequest)req=new XMLHttpRequest();else if(window.ActiveXObject){var success=false;for(var k=0;k<HTMLArea.MSXML_XMLHTTP_PROGIDS.length&&!success;k++){try{req=new ActiveXObject(HTMLArea.MSXML_XMLHTTP_PROGIDS[k]);success=true;}catch(e){}}}if(req){var content='';for(var i in data)content+=(content.length?'&':'')+i+'='+encodeURIComponent(data[i]);content+=(content.length?'&':'')+'charset='+charset;if(typeof(addParams)!="undefined")content+=addParams;if(url.substring(0,1)=='/'){var postUrl=_typo3_host_url+url;}else{var postUrl=_typo3_host_url+_editor_url+url;}function callBack(){if(req.readyState==4){if(req.status==200){if(typeof(handler)=='function')handler(req.responseText,req);HTMLArea._appendToLog("[HTMLArea::_postback]: Server response: "+req.responseText);}else{HTMLArea._appendToLog("ERROR [HTMLArea::_postback]: Unable to post "+postUrl+" . Server reported "+req.statusText);}}}req.onreadystatechange=callBack;function sendRequest(){HTMLArea._appendToLog("[HTMLArea::_postback]: Request: "+content);req.send(content);}req.open('POST',postUrl,true);req.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');window.setTimeout(sendRequest,500);}};Dialog=function(url,action,init,width,height,opener,editor,scrollbars){Dialog._open(url,action,init,(width?width:100),(height?height:100),opener,editor,scrollbars);};Dialog._open=function(url,action,init,width,height,_opener,editor,scrollbars){if(typeof(Dialog._modal)=="object"&&typeof(Dialog._modal.close)=="function"){Dialog._modal.close();Dialog._modal=null;}var dlg=window.open(url,'hadialog',"toolbar=no,location=no,directories=no,menubar=no,width="+width+",height="+height+",scrollbars="+scrollbars+",resizable=yes,modal=yes,dependent=yes,top=100,left=100");var obj=new Object();obj.dialogWindow=dlg;Dialog._dialog=obj;Dialog._modal=dlg;Dialog._arguments=null;if(typeof(init)!="undefined"){Dialog._arguments=init;}function capwin(w){if(HTMLArea.is_gecko){w.addEventListener("focus",function(ev){Dialog._parentEvent(ev);},false);}else{HTMLArea._addEvent(w,"focus",function(ev){Dialog._parentEvent(ev);});}for(var i=0;i<w.frames.length;i++){capwin(w.frames[i]);}}capwin(window);function closeDialog(){if(Dialog._dialog&&Dialog._dialog.dialogWindow){Dialog._dialog.dialogWindow.close();Dialog._dialog=null;}if(dlg&&!dlg.closed){dlg.close();dlg=null;}return false;}Dialog._return=function(val){if(val&&action){action(val);}function relwin(w){HTMLArea._removeEvent(w,"focus",function(ev){Dialog._parentEvent(ev);});try{for(var i=0;i<w.frames.length;i++){relwin(w.frames[i]);}}catch(e){}}relwin(window);HTMLArea._removeEvent(window,"unload",closeDialog);Dialog._dialog=null;};HTMLArea._addEvent(dlg,"unload",function(){if(typeof(Dialog)!="undefined")Dialog._return(null);return false;});HTMLArea._addEvent(window,"unload",closeDialog);};Dialog._parentEvent=function(ev){if(Dialog._modal&&!Dialog._modal.closed){if(!ev)var ev=window.event;var target=(ev.target)?ev.target:ev.srcElement;Dialog._modal.focus();HTMLArea._stopEvent(ev);}return false;};HTMLArea.prototype._popupDialog=function(url,action,init,width,height,_opener,scrollbars){if(typeof(_opener)=="undefined"||!_opener)var _opener=(this._iframe.contentWindow?this._iframe.contentWindow:window);if(typeof(scrollbars)=="undefined")var scrollbars="no";Dialog(this.popupURL(url),action,init,width,height,_opener,this,scrollbars);};HTMLArea.getElementById=function(tag,id){var el,i,objs=document.getElementsByTagName(tag);for(i=objs.length;--i>=0&&(el=objs[i]);){if(el.id==id)return el;}return null;};HTMLArea.edHidePopup=function(){Dialog._modal.close();setTimeout("if (typeof(browserWin) != 'undefined' && typeof(browserWin.focus) == 'function') browserWin.focus();",200);};var setRTEsizeByJS=function(divId,height,width){if(HTMLArea.is_gecko)height=height-25;else height=height-60;if(height>0)document.getElementById(divId).style.height=height+"px";if(HTMLArea.is_gecko)width="99%";else width="97%";document.getElementById(divId).style.width=width;};var lorem_ipsum=function(element,text){if(element.tagName.toLowerCase()=="textarea"&&element.id&&element.id.substr(0,7)=="RTEarea"){var editor=RTEarea[element.id.substr(7,8)]["editor"];editor.insertHTML(text);editor.updateToolbar();}};HTMLArea.initTimer=[];HTMLArea.onGenerateHandler=function(editorNumber){return(function(){document.getElementById('pleasewait'+editorNumber).style.display='none';document.getElementById('editorWrap'+editorNumber).style.visibility='visible';editorNumber=null;});};HTMLArea.initEditor=function(editorNumber){if(HTMLArea.checkSupportedBrowser()){document.getElementById('pleasewait'+editorNumber).style.display='block';document.getElementById('editorWrap'+editorNumber).style.visibility='hidden';if(HTMLArea.initTimer[editorNumber])window.clearTimeout(HTMLArea.initTimer[editorNumber]);if(!HTMLArea.is_loaded){HTMLArea.initTimer[editorNumber]=window.setTimeout("HTMLArea.initEditor("+editorNumber+");",150);}else{var RTE=RTEarea[editorNumber];var config=new HTMLArea.Config();config.toolbar=RTE["toolbar"];RTE["editor"]=new HTMLArea(RTE["id"],config);var editor=RTE["editor"];editor._typo3EditerNumber=editorNumber;editor._editorNumber=editorNumber;config=editor.config;config.buttons=RTE["buttons"];config.hideTableOperationsInToolbar=RTE["hideTableOperationsInToolbar"]?RTE["hideTableOperationsInToolbar"]:false;config.disableLayoutFieldsetInTableOperations=RTE["disableLayoutFieldsetInTableOperations"]?RTE["disableLayoutFieldsetInTableOperations"]:false;config.disableAlignmentFieldsetInTableOperations=RTE["disableAlignmentFieldsetInTableOperations"]?RTE["disableAlignmentFieldsetInTableOperations"]:false;config.disableSpacingFieldsetInTableOperations=RTE["disableSpacingFieldsetInTableOperations"]?RTE["disableSpacingFieldsetInTableOperations"]:false;config.disableBordersFieldsetInTableOperations=RTE["disableBordersFieldsetInTableOperations"]?RTE["disableBordersFieldsetInTableOperations"]:false;config.disableColorFieldsetInTableOperations=RTE["disableColorFieldsetInTableOperations"]?RTE["disableColorFieldsetInTableOperations"]:false;config.disablePCexamples=RTE["disablePCexamples"]?RTE["disablePCexamples"]:false;for(var plugin in RTE["plugin"]){if(RTE["plugin"][plugin]){editor.registerPlugin(plugin);}}if(RTE["defaultPageStyle"])config.defaultPageStyle=RTE["defaultPageStyle"];if(RTE["pageStyle"])config.pageStyle=RTE["pageStyle"];if(RTE["fontname"])config.FontName=RTE["fontname"];if(RTE["fontsize"])config.FontSize=RTE["fontsize"];if(RTE["colors"])config.colors=RTE["colors"];if(RTE["disableColorPicker"])config.disableColorPicker=RTE["disableColorPicker"];if(RTE["paragraphs"])config.FormatBlock=RTE["paragraphs"];config.width="auto";config.height="auto";config.sizeIncludesToolbar=true;config.fullPage=false;config.useHTTPS=RTE["useHTTPS"]?RTE["useHTTPS"]:false;config.disableEnterParagraphs=RTE["disableEnterParagraphs"]?RTE["disableEnterParagraphs"]:false;config.removeTrailingBR=RTE["removeTrailingBR"]?RTE["removeTrailingBR"]:false;config.keepButtonGroupTogether=(RTE["keepButtonGroupTogether"]&&HTMLArea.is_gecko&&!HTMLArea.is_wamcom&&!HTMLArea.is_opera)?RTE["keepButtonGroupTogether"]:false;config.useCSS=RTE["useCSS"]?RTE["useCSS"]:false;config.enableMozillaExtension=RTE["enableMozillaExtension"]?RTE["enableMozillaExtension"]:false;config.statusBar=RTE["statusBar"]?RTE["statusBar"]:false;config.cleanWordOnPaste=RTE["enableWordClean"]?true:false;config.htmlRemoveTags=RTE["htmlRemoveTags"]?RTE["htmlRemoveTags"]:null;config.htmlRemoveTagsAndContents=RTE["htmlRemoveTagsAndContents"]?RTE["htmlRemoveTagsAndContents"]:null;config.htmlRemoveComments=RTE["htmlRemoveComments"]?true:false;editor.onGenerate=HTMLArea.onGenerateHandler(editorNumber);editor.generate();return false;}}else{document.getElementById('pleasewait'+editorNumber).style.display='none';document.getElementById('editorWrap'+editorNumber).style.visibility='visible';}};
 
index e6377e8..2a332a6 100644 (file)
@@ -1,2 +1,2 @@
-HTMLArea.prototype._initEditMode=function(){var inTYPO3Tab=false;var DTMDiv=this._textArea;while(DTMDiv&&(DTMDiv.nodeType==1)&&(DTMDiv.tagName.toLowerCase()!="body")){if(DTMDiv.tagName.toLowerCase()=="div"&&DTMDiv.id.indexOf("DTM-")!=-1&&DTMDiv.id.indexOf("-DIV")!=-1&&DTMDiv.className=="c-tablayer"){inTYPO3Tab=true;break;}else{DTMDiv=DTMDiv.parentNode;}};if(!HTMLArea.is_wamcom){try{if(!(inTYPO3Tab&&DTMDiv.style.display=="none"))this._doc.designMode="on";}catch(e){}}else{try{this._doc.designMode="on";}catch(e){if(!(inTYPO3Tab&&DTMDiv.style.display=="none")){this._doc.open();this._doc.close();this._initIframeTimer=window.setTimeout("HTMLArea.initIframe("+this._editorNumber+");",500);return false;}}};if(inTYPO3Tab)HTMLArea._addEvent(DTMDiv,"DOMAttrModified",HTMLArea.DTMDivHandler(this,DTMDiv));return true;};HTMLArea.prototype._getSelection=function(){if(HTMLArea.is_safari)return window.getSelection();return this._iframe.contentWindow.getSelection();};HTMLArea.prototype._createRange=function(sel){if(HTMLArea.is_safari){var range=this._doc.createRange();if(typeof(sel)=="undefined")return range;switch(sel.type){case "Range":range.setStart(sel.baseNode,sel.baseOffset);range.setEnd(sel.extentNode,sel.extentOffset);break;case "Caret":range.setStart(sel.baseNode,sel.baseOffset);range.setEnd(sel.baseNode,sel.baseOffset);break;case "None":range.setStart(this._doc.body,0);range.setEnd(this._doc.body,0);};return range;};if(typeof(sel)=="undefined")return this._doc.createRange();try{return sel.getRangeAt(0);}catch(e){return this._doc.createRange();}};HTMLArea.prototype.selectNode=function(node,pos){this.focusEditor();var sel=this._getSelection();var range=this._doc.createRange();if(node.nodeType==1&&node.tagName.toLowerCase()=="body")range.selectNodeContents(node);else range.selectNode(node);if((typeof(pos)!="undefined"))range.collapse(pos);if(HTMLArea.is_safari){sel.empty();sel.setBaseAndExtent(range.startContainer,range.startOffset,range.endContainer,range.endOffset);}else{sel.removeAllRanges();sel.addRange(range);}};HTMLArea.prototype.selectNodeContents=function(node,pos){this.focusEditor();var sel=this._getSelection();var range=this._doc.createRange();range.selectNodeContents(node);if((typeof(pos)!="undefined"))range.collapse(pos);if(HTMLArea.is_safari){sel.empty();sel.setBaseAndExtent(range.startContainer,range.startOffset,range.endContainer,range.endOffset);}else{sel.removeAllRanges();sel.addRange(range);}};HTMLArea.prototype.getSelectedHTML=function(){var sel=this._getSelection();var range=this._createRange(sel);var cloneContents="";try{cloneContents=range.cloneContents();}catch(e){};return(cloneContents?HTMLArea.getHTML(cloneContents,false,this):"");};HTMLArea.prototype.getSelectedHTMLContents=function(){return this.getSelectedHTML();};HTMLArea.prototype.getParentElement=function(sel,range){if(!sel)var sel=this._getSelection();if(typeof(range)=="undefined")var range=this._createRange(sel);try{var p=range.commonAncestorContainer;if(!range.collapsed&&range.startContainer==range.endContainer&&range.startOffset-range.endOffset<=1&&range.startContainer.hasChildNodes())p=range.startContainer.childNodes[range.startOffset];while(p.nodeType==3){p=p.parentNode;};return p;}catch(e){return this._doc.body;}};HTMLArea.prototype._activeElement=function(sel){if(sel==null)return null;if(this._selectionEmpty(sel))return null;if(!sel.isCollapsed&&sel.anchorNode.nodeType==1)return sel.anchorNode;else return null;};HTMLArea.prototype._selectionEmpty=function(sel){if(!sel)return true;if(typeof(sel.isCollapsed)!='undefined'){return sel.isCollapsed;}else{return true;}};HTMLArea.prototype.insertNodeAtSelection=function(toBeInserted){this.focusEditor();var sel=this._getSelection(),range=this._createRange(sel),node=range.startContainer,pos=range.startOffset,selnode=toBeInserted;if(HTMLArea.is_safari)sel.empty();else sel.removeAllRanges();range.deleteContents();switch(node.nodeType){case 3:if(toBeInserted.nodeType==3){node.insertData(pos,toBeInserted.data);range=this._createRange();range.setEnd(node,pos+toBeInserted.length);range.setStart(node,pos+toBeInserted.length);if(HTMLArea.is_safari)sel.setBaseAndExtent(range.startContainer,range.startOffset,range.endContainer,range.endOffset);else sel.addRange(range);}else{node=node.splitText(pos);if(toBeInserted.nodeType==11)selnode=selnode.lastChild;node=node.parentNode.insertBefore(toBeInserted,node);this.selectNode(selnode,false);this.updateToolbar();};break;case 1:if(toBeInserted.nodeType==11)selnode=selnode.lastChild;node=node.insertBefore(toBeInserted,node.childNodes[pos]);this.selectNode(selnode,false);this.updateToolbar();break;}};HTMLArea.prototype.insertHTML=function(html){this.focusEditor();var fragment=this._doc.createDocumentFragment();var div=this._doc.createElement("div");div.innerHTML=html;while(div.firstChild){fragment.appendChild(div.firstChild);};this.insertNodeAtSelection(fragment);};HTMLArea.DTMDivHandler=function(editor,DTMDiv){return(function(ev){if(!ev)var ev=window.event;var target=(ev.target)?ev.target:ev.srcElement;if(target==DTMDiv&&editor._editMode=="wysiwyg"&&DTMDiv.style.display=="block"){window.setTimeout(function(){try{editor._doc.designMode="on";if(editor.config.sizeIncludesToolbar&&editor._initialToolbarOffsetHeight!=editor._toolbar.offsetHeight)editor.sizeIframe(-2);}catch(e){editor._doc.open();editor._doc.close();editor.initIframe();}},20);HTMLArea._stopEvent(ev);}});};HTMLArea.statusBarHandler=function(ev){if(!ev)var ev=window.event;var target=(ev.target)?ev.target:ev.srcElement;var editor=target.editor;target.blur();editor.selectNode(target.el);editor.updateToolbar(true);switch(ev.type){case "click":case "mousedown":HTMLArea._stopEvent(ev);return false;case "contextmenu":return editor.plugins["ContextMenu"]?editor.plugins["ContextMenu"].instance.popupMenu(ev,target.el):false;}};HTMLArea.prototype._mozillaPasteException=function(cmdID,UI,param){if(typeof(UI)!="undefined"){this._doc.execCommand(cmdID,UI,param);if(cmdID=="Paste"&&this.config.killWordOnPaste)HTMLArea._wordClean(this._doc.body);}else if(this.config.enableMozillaExtension){if(confirm(HTMLArea.I18N.msg["Allow-Clipboard-Helper-Extension"])){if(InstallTrigger.enabled()){HTMLArea._mozillaXpi=new Object();HTMLArea._mozillaXpi["AllowClipboard Helper"]=_editor_mozAllowClipboard_url;InstallTrigger.install(HTMLArea._mozillaXpi,HTMLArea._mozillaInstallCallback);}else{alert(HTMLArea.I18N.msg["Mozilla-Org-Install-Not-Enabled"]);HTMLArea._appendToLog("WARNING [HTMLArea::execCommand]: Mozilla install was not enabled.");return;}}}else if(confirm(HTMLArea.I18N.msg["Moz-Clipboard"])){window.open("http://mozilla.org/editor/midasdemo/securityprefs.html");}};HTMLArea._mozillaInstallCallback=function(url,returnCode){if(returnCode==0){if(HTMLArea._mozillaXpi["TYPO3 htmlArea RTE Preferences"])alert(HTMLArea.I18N.msg["Moz-Extension-Success"]);else alert(HTMLArea.I18N.msg["Allow-Clipboard-Helper-Extension-Success"]);return;}else{alert(HTMLArea.I18N.msg["Moz-Extension-Failure"]);HTMLArea._appendToLog("WARNING [HTMLArea::execCommand]: Mozilla install return code was: "+returnCode+".");return;}};HTMLArea.prototype._checkBackspace=function(){var self=this;self.focusEditor();var sel=self._getSelection();var range=self._createRange(sel);var SC=range.startContainer;var SO=range.startOffset;var EC=range.endContainer;var EO=range.endOffset;var newr=SC.nextSibling;while(SC.nodeType==3||/^a$/i.test(SC.tagName))SC=SC.parentNode;if(!self.config.disableEnterParagraphs&&/^td$/i.test(SC.parentNode.tagName)&&SC.parentNode.firstChild==SC&&SO==0&&range.collapsed)return true;window.setTimeout(function(){if(!self.config.disableEnterParagraphs&&(/^p$/i.test(SC.tagName)||!/\S/.test(SC.tagName))&&SO==0){if(SC.firstChild&&/^br$/i.test(SC.firstChild.tagName)){HTMLArea.removeFromParent(SC.firstChild);return true;}};if(!/\S/.test(SC.tagName)){var p=document.createElement("p");while(SC.firstChild)p.appendChild(SC.firstChild);SC.parentNode.insertBefore(p,SC);HTMLArea.removeFromParent(SC);var r=range.cloneRange();r.setStartBefore(newr);r.setEndAfter(newr);r.extractContents();if(HTMLArea.is_safari){sel.empty();sel.setBaseAndExtent(r.startContainer,r.startOffset,r.endContainer,r.endOffset);}else{sel.removeAllRanges();sel.addRange(r);};return true;}},10);return false;};HTMLArea.prototype._checkInsertP=function(){this.focusEditor();var i,SC,left,right,r2,sel=this._getSelection(),r=this._createRange(sel),p=this.getAllAncestors(),block=null,a=null,doc=this._doc,body=doc.body;for(i=0;i<p.length;++i){if(HTMLArea.isBlockElement(p[i])&&!/body|html|table|tbody|tr/i.test(p[i].tagName)){block=p[i];break;}};if(!r.collapsed)r.deleteContents();if(HTMLArea.is_safari)sel.empty();else sel.removeAllRanges();SC=r.startContainer;if(!block||/^(td|div)$/i.test(block.tagName)){left=SC;for(i=SC;i&&!HTMLArea.isBlockElement(i);i=HTMLArea.getPrevNode(i)){left=i;};right=SC;for(i=SC;i&&!HTMLArea.isBlockElement(i);i=HTMLArea.getNextNode(i)){right=i;};if(left!=body&&right!=body&&!(block&&left==block)&&!(block&&right==block)){r2=r.cloneRange();if(HTMLArea.is_opera)r2.setStart(left,0);else r2.setStartBefore(left);r2.surroundContents(block=doc.createElement('p'));if(!/\S/.test(HTMLArea.getInnerText(block))){a=block.lastChild;if(a&&/^a$/i.test(a.tagName)&&!/\S/.test(a.innerHTML))HTMLArea.removeFromParent(a);block.appendChild(doc.createElement('br'));};block.normalize();if(HTMLArea.is_opera){SC=HTMLArea.getNextNode(block);for(i=SC;i&&!HTMLArea.isBlockElement(i);i=HTMLArea.getNextNode(i)){right=i;};r.setStart(SC,0);r.setEnd(right,right.length);}else{r.setEndAfter(right);};r.surroundContents(block=doc.createElement('p'));a=block.previousSibling;if(a&&/^a$/i.test(a.tagName)&&!/\S/.test(a.innerHTML))HTMLArea.removeFromParent(a);if(!/\S/.test(HTMLArea.getInnerText(block))){a=block.lastChild;if(a&&/^a$/i.test(a.tagName)&&!/\S/.test(a.innerHTML))HTMLArea.removeFromParent(a);block.appendChild(doc.createElement('br'));};block.normalize();}else{if(!block){r=doc.createRange();r.setStart(body,0);r.setEnd(body,0);r.surroundContents(block=doc.createElement('p'));if(!/\S/.test(HTMLArea.getInnerText(block)))block.appendChild(this._doc.createElement('br'));}else{r=doc.createRange();r.setStart(block,0);r.setEnd(block,0);r.insertNode(block=doc.createElement('p'));block.appendChild(doc.createElement('br'));}};r.selectNodeContents(block);}else{r.setEndAfter(block);var df=r.extractContents(),left_empty=false;if(!/\S/.test(block.innerHTML)){block.innerHTML="<br />";left_empty=true;};p=df.firstChild;if(p){if(!/\S/.test(HTMLArea.getInnerText(p))){if(/^h[1-6]$/i.test(p.tagName))p=this.convertNode(p,"p");p.innerHTML="<br />";};if(/^li$/i.test(p.tagName)&&left_empty&&!block.nextSibling){left=block.parentNode;left.removeChild(block);r.setEndAfter(left);r.collapse(false);p=this.convertNode(p,/^li$/i.test(left.parentNode.tagName)?"br":"p");};r.insertNode(df);var a=p.previousSibling.lastChild;if(a&&/^a$/i.test(a.tagName)&&!/\S/.test(a.innerHTML))HTMLArea.removeFromParent(a);r.selectNodeContents(p);}};r.collapse(true);if(HTMLArea.is_safari)sel.setBaseAndExtent(r.startContainer,r.startOffset,r.endContainer,r.endOffset);else sel.addRange(r);this.scrollToCaret();};HTMLArea.prototype._detectURL=function(ev){var editor=this;var s=this._getSelection();var autoWrap=function(textNode,tag){var rightText=textNode.nextSibling;if(typeof(tag)=='string')tag=editor._doc.createElement(tag);var a=textNode.parentNode.insertBefore(tag,rightText);HTMLArea.removeFromParent(textNode);a.appendChild(textNode);rightText.data+=" ";s.collapse(rightText,rightText.data.length);HTMLArea._stopEvent(ev);editor._unLink=function(){var t=a.firstChild;a.removeChild(t);a.parentNode.insertBefore(t,a);HTMLArea.removeFromParent(a);t.parentNode.normalize();editor._unLink=null;editor._unlinkOnUndo=false;};editor._unlinkOnUndo=true;return a;};switch(ev.which){case 13:if(ev.shiftKey||editor.config.disableEnterParagraphs)break;case 32:if(s&&s.isCollapsed&&s.anchorNode.nodeType==3&&s.anchorNode.data.length>3&&s.anchorNode.data.indexOf('.')>=0){var midStart=s.anchorNode.data.substring(0,s.anchorOffset).search(/[a-zA-Z0-9]+\S{3,}$/);if(midStart==-1)break;if(this._getFirstAncestor(s,'a'))break;var matchData=s.anchorNode.data.substring(0,s.anchorOffset).replace(/^.*?(\S*)$/,'$1');if(matchData.indexOf('@')!=-1){var m=matchData.match(HTMLArea.RE_email);if(m){var leftText=s.anchorNode;var rightText=leftText.splitText(s.anchorOffset);var midText=leftText.splitText(midStart);var midEnd=midText.data.search(/[^a-zA-Z0-9\.@_\-]/);if(midEnd!=-1)var endText=midText.splitText(midEnd);autoWrap(midText,'a').href='mailto:'+m[0];break;}};var m=matchData.match(HTMLArea.RE_url);if(m){var leftText=s.anchorNode;var rightText=leftText.splitText(s.anchorOffset);var midText=leftText.splitText(midStart);var midEnd=midText.data.search(/[^a-zA-Z0-9\._\-\/\&\?=:@]/);if(midEnd!=-1)var endText=midText.splitText(midEnd);autoWrap(midText,'a').href=(m[1]?m[1]:'http://')+m[2];break;}}break;default:if(ev.keyCode==27||(editor._unlinkOnUndo&&ev.ctrlKey&&ev.which==122)){if(this._unLink){this._unLink();HTMLArea._stopEvent(ev);}break;}else if(ev.which||ev.keyCode==8||ev.keyCode==46){this._unlinkOnUndo=false;if(s.anchorNode&&s.anchorNode.nodeType==3){var a=this._getFirstAncestor(s,'a');if(!a)break;if(!a._updateAnchTimeout){if(s.anchorNode.data.match(HTMLArea.RE_email)&&(a.href.match('mailto:'+s.anchorNode.data.trim()))){var textNode=s.anchorNode;var fn=function(){a.href='mailto:'+textNode.data.trim();a._updateAnchTimeout=setTimeout(fn,250);};a._updateAnchTimeout=setTimeout(fn,250);break;}var m=s.anchorNode.data.match(HTMLArea.RE_url);if(m&&a.href.match(s.anchorNode.data.trim())){var textNode=s.anchorNode;var fn=function(){var m=textNode.data.match(HTMLArea.RE_url);a.href=(m[1]?m[1]:'http://')+m[2];a._updateAnchTimeout=setTimeout(fn,250);};a._updateAnchTimeout=setTimeout(fn,250);}}}};break;}};
+HTMLArea.prototype._initEditMode=function(){var inTYPO3Tab=false;var DTMDiv=this._textArea;while(DTMDiv&&(DTMDiv.nodeType==1)&&(DTMDiv.tagName.toLowerCase()!="body")){if(DTMDiv.tagName.toLowerCase()=="div"&&DTMDiv.id.indexOf("DTM-")!=-1&&DTMDiv.id.indexOf("-DIV")!=-1&&DTMDiv.className=="c-tablayer"){inTYPO3Tab=true;break;}else{DTMDiv=DTMDiv.parentNode;}};if(!HTMLArea.is_wamcom){try{if(!(inTYPO3Tab&&DTMDiv.style.display=="none"))this._doc.designMode="on";}catch(e){}}else{try{this._doc.designMode="on";}catch(e){if(!(inTYPO3Tab&&DTMDiv.style.display=="none")){this._doc.open();this._doc.close();this._initIframeTimer=window.setTimeout("HTMLArea.initIframe("+this._editorNumber+");",500);return false;}}};if(inTYPO3Tab)HTMLArea._addEvent(DTMDiv,"DOMAttrModified",HTMLArea.DTMDivHandler(this,DTMDiv));return true;};HTMLArea.prototype._getSelection=function(){if(HTMLArea.is_safari)return window.getSelection();return this._iframe.contentWindow.getSelection();};HTMLArea.prototype._createRange=function(sel){if(HTMLArea.is_safari){var range=this._doc.createRange();if(typeof(sel)=="undefined")return range;switch(sel.type){case "Range":range.setStart(sel.baseNode,sel.baseOffset);range.setEnd(sel.extentNode,sel.extentOffset);break;case "Caret":range.setStart(sel.baseNode,sel.baseOffset);range.setEnd(sel.baseNode,sel.baseOffset);break;case "None":range.setStart(this._doc.body,0);range.setEnd(this._doc.body,0);};return range;};if(typeof(sel)=="undefined")return this._doc.createRange();try{return sel.getRangeAt(0);}catch(e){return this._doc.createRange();}};HTMLArea.prototype.selectNode=function(node,pos){this.focusEditor();var sel=this._getSelection();var range=this._doc.createRange();if(node.nodeType==1&&node.tagName.toLowerCase()=="body")range.selectNodeContents(node);else range.selectNode(node);if((typeof(pos)!="undefined"))range.collapse(pos);if(HTMLArea.is_safari){sel.empty();sel.setBaseAndExtent(range.startContainer,range.startOffset,range.endContainer,range.endOffset);}else{sel.removeAllRanges();sel.addRange(range);}};HTMLArea.prototype.selectNodeContents=function(node,pos){this.focusEditor();var sel=this._getSelection();var range=this._doc.createRange();range.selectNodeContents(node);if((typeof(pos)!="undefined"))range.collapse(pos);if(HTMLArea.is_safari){sel.empty();sel.setBaseAndExtent(range.startContainer,range.startOffset,range.endContainer,range.endOffset);}else{sel.removeAllRanges();sel.addRange(range);}};HTMLArea.prototype.getSelectedHTML=function(){var sel=this._getSelection();var range=this._createRange(sel);var cloneContents="";try{cloneContents=range.cloneContents();}catch(e){};return(cloneContents?HTMLArea.getHTML(cloneContents,false,this):"");};HTMLArea.prototype.getSelectedHTMLContents=function(){return this.getSelectedHTML();};HTMLArea.prototype.getParentElement=function(sel,range){if(!sel)var sel=this._getSelection();if(typeof(range)=="undefined")var range=this._createRange(sel);try{var p=range.commonAncestorContainer;if(!range.collapsed&&range.startContainer==range.endContainer&&range.startOffset-range.endOffset<=1&&range.startContainer.hasChildNodes())p=range.startContainer.childNodes[range.startOffset];while(p.nodeType==3){p=p.parentNode;};return p;}catch(e){return this._doc.body;}};HTMLArea.prototype._activeElement=function(sel){if(sel==null)return null;if(this._selectionEmpty(sel))return null;if(!sel.isCollapsed&&sel.anchorNode.nodeType==1)return sel.anchorNode;else return null;};HTMLArea.prototype._selectionEmpty=function(sel){if(!sel)return true;if(typeof(sel.isCollapsed)!='undefined'){return sel.isCollapsed;}else{return true;}};HTMLArea.prototype.insertNodeAtSelection=function(toBeInserted){this.focusEditor();var sel=this._getSelection(),range=this._createRange(sel),node=range.startContainer,pos=range.startOffset,selnode=toBeInserted;if(HTMLArea.is_safari)sel.empty();else sel.removeAllRanges();range.deleteContents();switch(node.nodeType){case 3:if(toBeInserted.nodeType==3){node.insertData(pos,toBeInserted.data);range=this._createRange();range.setEnd(node,pos+toBeInserted.length);range.setStart(node,pos+toBeInserted.length);if(HTMLArea.is_safari)sel.setBaseAndExtent(range.startContainer,range.startOffset,range.endContainer,range.endOffset);else sel.addRange(range);}else{node=node.splitText(pos);if(toBeInserted.nodeType==11)selnode=selnode.lastChild;node=node.parentNode.insertBefore(toBeInserted,node);this.selectNode(selnode,false);this.updateToolbar();};break;case 1:if(toBeInserted.nodeType==11)selnode=selnode.lastChild;node=node.insertBefore(toBeInserted,node.childNodes[pos]);this.selectNode(selnode,false);this.updateToolbar();break;}};HTMLArea.prototype.insertHTML=function(html){this.focusEditor();var fragment=this._doc.createDocumentFragment();var div=this._doc.createElement("div");div.innerHTML=html;while(div.firstChild){fragment.appendChild(div.firstChild);};this.insertNodeAtSelection(fragment);};HTMLArea.DTMDivHandler=function(editor,DTMDiv){return(function(ev){if(!ev)var ev=window.event;var target=(ev.target)?ev.target:ev.srcElement;if(target==DTMDiv&&editor._editMode=="wysiwyg"&&DTMDiv.style.display=="block"){window.setTimeout(function(){try{editor._doc.designMode="on";if(editor.config.sizeIncludesToolbar&&editor._initialToolbarOffsetHeight!=editor._toolbar.offsetHeight)editor.sizeIframe(-2);}catch(e){editor._doc.open();editor._doc.close();editor.initIframe();}},20);HTMLArea._stopEvent(ev);}});};HTMLArea.statusBarHandler=function(ev){if(!ev)var ev=window.event;var target=(ev.target)?ev.target:ev.srcElement;var editor=target.editor;target.blur();editor.selectNode(target.el);editor.updateToolbar(true);switch(ev.type){case "click":case "mousedown":HTMLArea._stopEvent(ev);return false;case "contextmenu":return editor.plugins["ContextMenu"]?editor.plugins["ContextMenu"].instance.popupMenu(ev,target.el):false;}};HTMLArea.prototype._mozillaPasteException=function(cmdID,UI,param){if(typeof(UI)!="undefined"){this._doc.execCommand(cmdID,UI,param);if(cmdID=="Paste"&&this.config.killWordOnPaste)HTMLArea._wordClean(this._doc.body);}else if(this.config.enableMozillaExtension){if(confirm(HTMLArea.I18N.msg["Allow-Clipboard-Helper-Extension"])){if(InstallTrigger.enabled()){HTMLArea._mozillaXpi=new Object();HTMLArea._mozillaXpi["AllowClipboard Helper"]=_editor_mozAllowClipboard_url;InstallTrigger.install(HTMLArea._mozillaXpi,HTMLArea._mozillaInstallCallback);}else{alert(HTMLArea.I18N.msg["Mozilla-Org-Install-Not-Enabled"]);HTMLArea._appendToLog("WARNING [HTMLArea::execCommand]: Mozilla install was not enabled.");return;}}}else if(confirm(HTMLArea.I18N.msg["Moz-Clipboard"])){window.open("http://mozilla.org/editor/midasdemo/securityprefs.html");}};HTMLArea._mozillaInstallCallback=function(url,returnCode){if(returnCode==0){if(HTMLArea._mozillaXpi["TYPO3 htmlArea RTE Preferences"])alert(HTMLArea.I18N.msg["Moz-Extension-Success"]);else alert(HTMLArea.I18N.msg["Allow-Clipboard-Helper-Extension-Success"]);return;}else{alert(HTMLArea.I18N.msg["Moz-Extension-Failure"]);HTMLArea._appendToLog("WARNING [HTMLArea::execCommand]: Mozilla install return code was: "+returnCode+".");return;}};HTMLArea.prototype._checkBackspace=function(){var self=this;self.focusEditor();var sel=self._getSelection();var range=self._createRange(sel);var SC=range.startContainer;var SO=range.startOffset;var EC=range.endContainer;var EO=range.endOffset;var newr=SC.nextSibling;while(SC.nodeType==3||/^a$/i.test(SC.tagName))SC=SC.parentNode;if(!self.config.disableEnterParagraphs&&/^td$/i.test(SC.parentNode.tagName)&&SC.parentNode.firstChild==SC&&SO==0&&range.collapsed)return true;window.setTimeout(function(){if(!self.config.disableEnterParagraphs&&(/^p$/i.test(SC.tagName)||!/\S/.test(SC.tagName))&&SO==0){if(SC.firstChild&&/^br$/i.test(SC.firstChild.tagName)){HTMLArea.removeFromParent(SC.firstChild);return true;}};if(!/\S/.test(SC.tagName)){var p=document.createElement("p");while(SC.firstChild)p.appendChild(SC.firstChild);SC.parentNode.insertBefore(p,SC);HTMLArea.removeFromParent(SC);var r=range.cloneRange();r.setStartBefore(newr);r.setEndAfter(newr);r.extractContents();if(HTMLArea.is_safari){sel.empty();sel.setBaseAndExtent(r.startContainer,r.startOffset,r.endContainer,r.endOffset);}else{sel.removeAllRanges();sel.addRange(r);};return true;}},10);return false;};HTMLArea.prototype._checkInsertP=function(){this.focusEditor();var i,SC,left,right,r2,sel=this._getSelection(),r=this._createRange(sel),p=this.getAllAncestors(),block=null,a=null,doc=this._doc,body=doc.body;for(i=0;i<p.length;++i){if(HTMLArea.isBlockElement(p[i])&&!/body|html|table|tbody|tr/i.test(p[i].tagName)){block=p[i];break;}};if(!r.collapsed)r.deleteContents();if(HTMLArea.is_safari)sel.empty();else sel.removeAllRanges();SC=r.startContainer;if(HTMLArea.is_opera&&SC.nodeType==3&&SC.data.length==0)SC=HTMLArea.getPrevNode(SC);if(!block||/^(td|div)$/i.test(block.tagName)){left=SC;for(i=SC;i&&!HTMLArea.isBlockElement(i);i=HTMLArea.getPrevNode(i)){left=i;};right=SC;if(HTMLArea.is_opera&&right.nodeType==3&&right.data.length==0)right=HTMLArea.getNextNode(righgt);if(left!=body&&right!=body&&!(block&&left==block)&&!(block&&right==block)){r2=r.cloneRange();if(HTMLArea.is_opera)r2.setStart(left,0);else r2.setStartBefore(left);r2.surroundContents(block=doc.createElement('p'));if(!/\S/.test(HTMLArea.getInnerText(block))){a=block.lastChild;if(a&&/^a$/i.test(a.tagName)&&!/\S/.test(a.innerHTML))HTMLArea.removeFromParent(a);block.appendChild(doc.createElement('br'));};block.normalize();if(HTMLArea.is_opera){SC=HTMLArea.getNextNode(block);for(i=SC;i&&!HTMLArea.isBlockElement(i);i=HTMLArea.getNextNode(i)){right=i;};r.setStart(SC,0);r.setEnd(right,right.length);}else{r.setEndAfter(right);};r.surroundContents(block=doc.createElement('p'));a=block.previousSibling;if(a&&/^a$/i.test(a.tagName)&&!/\S/.test(a.innerHTML))HTMLArea.removeFromParent(a);if(!/\S/.test(HTMLArea.getInnerText(block))){a=block.lastChild;if(a&&/^a$/i.test(a.tagName)&&!/\S/.test(a.innerHTML))HTMLArea.removeFromParent(a);block.appendChild(doc.createElement('br'));};block.normalize();}else{if(!block)block=body;r=doc.createRange();r.setStart(block,0);r.setEnd(block,0);r.insertNode(block=doc.createElement('p'));block.appendChild(doc.createElement('br'));};if(HTMLArea.is_opera)r.selectNode(block);else r.selectNodeContents(block);}else{r.setEndAfter(block);var df=r.extractContents(),left_empty=false;if(!/\S/.test(block.innerHTML)){block.innerHTML="<br />";left_empty=true;};p=df.firstChild;if(p){if(!/\S/.test(HTMLArea.getInnerText(p))){if(/^h[1-6]$/i.test(p.tagName))p=this.convertNode(p,"p");p.innerHTML="<br />";};if(/^li$/i.test(p.tagName)&&left_empty&&!block.nextSibling){left=block.parentNode;left.removeChild(block);r.setEndAfter(left);r.collapse(false);p=this.convertNode(p,/^li$/i.test(left.parentNode.tagName)?"br":"p");};r.insertNode(df);var a=p.previousSibling.lastChild;if(a&&/^a$/i.test(a.tagName)&&!/\S/.test(a.innerHTML))HTMLArea.removeFromParent(a);if(HTMLArea.is_opera)r.selectNode(p);else r.selectNodeContents(p);}};r.collapse(true);if(HTMLArea.is_safari)sel.setBaseAndExtent(r.startContainer,r.startOffset,r.endContainer,r.endOffset);else sel.addRange(r);this.scrollToCaret();};HTMLArea.prototype._detectURL=function(ev){var editor=this;var s=this._getSelection();var autoWrap=function(textNode,tag){var rightText=textNode.nextSibling;if(typeof(tag)=='string')tag=editor._doc.createElement(tag);var a=textNode.parentNode.insertBefore(tag,rightText);HTMLArea.removeFromParent(textNode);a.appendChild(textNode);rightText.data+=" ";s.collapse(rightText,rightText.data.length);HTMLArea._stopEvent(ev);editor._unLink=function(){var t=a.firstChild;a.removeChild(t);a.parentNode.insertBefore(t,a);HTMLArea.removeFromParent(a);t.parentNode.normalize();editor._unLink=null;editor._unlinkOnUndo=false;};editor._unlinkOnUndo=true;return a;};switch(ev.which){case 13:if(ev.shiftKey||editor.config.disableEnterParagraphs)break;case 32:if(s&&s.isCollapsed&&s.anchorNode.nodeType==3&&s.anchorNode.data.length>3&&s.anchorNode.data.indexOf('.')>=0){var midStart=s.anchorNode.data.substring(0,s.anchorOffset).search(/[a-zA-Z0-9]+\S{3,}$/);if(midStart==-1)break;if(this._getFirstAncestor(s,'a'))break;var matchData=s.anchorNode.data.substring(0,s.anchorOffset).replace(/^.*?(\S*)$/,'$1');if(matchData.indexOf('@')!=-1){var m=matchData.match(HTMLArea.RE_email);if(m){var leftText=s.anchorNode;var rightText=leftText.splitText(s.anchorOffset);var midText=leftText.splitText(midStart);var midEnd=midText.data.search(/[^a-zA-Z0-9\.@_\-]/);if(midEnd!=-1)var endText=midText.splitText(midEnd);autoWrap(midText,'a').href='mailto:'+m[0];break;}};var m=matchData.match(HTMLArea.RE_url);if(m){var leftText=s.anchorNode;var rightText=leftText.splitText(s.anchorOffset);var midText=leftText.splitText(midStart);var midEnd=midText.data.search(/[^a-zA-Z0-9\._\-\/\&\?=:@]/);if(midEnd!=-1)var endText=midText.splitText(midEnd);autoWrap(midText,'a').href=(m[1]?m[1]:'http://')+m[2];break;}}break;default:if(ev.keyCode==27||(editor._unlinkOnUndo&&ev.ctrlKey&&ev.which==122)){if(this._unLink){this._unLink();HTMLArea._stopEvent(ev);}break;}else if(ev.which||ev.keyCode==8||ev.keyCode==46){this._unlinkOnUndo=false;if(s.anchorNode&&s.anchorNode.nodeType==3){var a=this._getFirstAncestor(s,'a');if(!a)break;if(!a._updateAnchTimeout){if(s.anchorNode.data.match(HTMLArea.RE_email)&&(a.href.match('mailto:'+s.anchorNode.data.trim()))){var textNode=s.anchorNode;var fn=function(){a.href='mailto:'+textNode.data.trim();a._updateAnchTimeout=setTimeout(fn,250);};a._updateAnchTimeout=setTimeout(fn,250);break;}var m=s.anchorNode.data.match(HTMLArea.RE_url);if(m&&a.href.match(s.anchorNode.data.trim())){var textNode=s.anchorNode;var fn=function(){var m=textNode.data.match(HTMLArea.RE_url);a.href=(m[1]?m[1]:'http://')+m[2];a._updateAnchTimeout=setTimeout(fn,250);};a._updateAnchTimeout=setTimeout(fn,250);}}}};break;}};
 
index 5b5db6b..8eaeb7e 100644 (file)
@@ -430,11 +430,12 @@ HTMLArea.prototype._checkInsertP = function() {
        if(HTMLArea.is_safari) sel.empty();
                else sel.removeAllRanges();
        SC = r.startContainer;
+       if (HTMLArea.is_opera && SC.nodeType == 3 && SC.data.length == 0) SC = HTMLArea.getPrevNode(SC);
        if(!block || /^(td|div)$/i.test(block.tagName)) {
                left = SC;
                for (i = SC; i && !HTMLArea.isBlockElement(i); i = HTMLArea.getPrevNode(i)) { left = i; }
                right = SC;
-               for (i = SC; i && !HTMLArea.isBlockElement(i); i = HTMLArea.getNextNode(i)) { right = i; }
+               if (HTMLArea.is_opera && right.nodeType == 3 && right.data.length == 0) right = HTMLArea.getNextNode(righgt);
                if(left != body && right != body && !(block && left == block ) && !(block && right == block )) {
                        r2 = r.cloneRange();
                        if (HTMLArea.is_opera) r2.setStart(left,0);
@@ -467,21 +468,15 @@ HTMLArea.prototype._checkInsertP = function() {
                        }
                        block.normalize();
                } else {
-                       if(!block) {
-                               r = doc.createRange();
-                               r.setStart(body, 0);
-                               r.setEnd(body, 0);
-                               r.surroundContents(block = doc.createElement('p'));
-                               if (!/\S/.test(HTMLArea.getInnerText(block))) block.appendChild(this._doc.createElement('br'));
-                       } else {
-                               r = doc.createRange();
-                               r.setStart(block, 0);
-                               r.setEnd(block, 0);
-                               r.insertNode(block = doc.createElement('p'));
-                               block.appendChild(doc.createElement('br'));
-                       }
+                       if (!block) block = body;
+                       r = doc.createRange();
+                       r.setStart(block, 0);
+                       r.setEnd(block, 0);
+                       r.insertNode(block = doc.createElement('p'));
+                       block.appendChild(doc.createElement('br'));
                }
-               r.selectNodeContents(block);
+               if (HTMLArea.is_opera) r.selectNode(block);
+                       else r.selectNodeContents(block);
        } else {
                r.setEndAfter(block);
                var df = r.extractContents(), left_empty = false;
@@ -506,7 +501,8 @@ HTMLArea.prototype._checkInsertP = function() {
                                // Remove any anchor created empty
                        var a = p.previousSibling.lastChild;
                        if (a && /^a$/i.test(a.tagName) && !/\S/.test(a.innerHTML)) HTMLArea.removeFromParent(a);
-                       r.selectNodeContents(p);
+                       if (HTMLArea.is_opera) r.selectNode(p);
+                               else r.selectNodeContents(p);
                }
        }
        r.collapse(true);
index e6ca5e6..cde4469 100644 (file)
@@ -1,2 +1,2 @@
-HTMLArea._cleanup=function(editor){for(var handler in editor.eventHandlers)editor.eventHandlers[handler]=null;for(var button in editor.btnList)editor.btnList[button][3]=null;for(var dropdown in editor.config.customSelects){dropdown.action=null;dropdown.refresh=null;}editor.onGenerate=null;HTMLArea._editorEvent=null;if(editor._textArea.form){editor._textArea.form.__msh_prevOnReset=null;editor._textArea.form._editorNumber=null;};HTMLArea.onload=null;if(HTMLArea._eventCache){HTMLArea._eventCache.listEvents=null;HTMLArea._eventCache.add=null;HTMLArea._eventCache.flush=null;HTMLArea._eventCache=null;};for(var i in editor.plugins){var plugin=editor.plugins[i].instance;plugin.onGenerate=null;plugin.onMode=null;plugin.onKeyPress=null;plugin.onSelect=null;plugin.onUpdateTolbar=null;};var obj;for(var txt in editor._toolbarObjects){obj=editor._toolbarObjects[txt];obj["state"]=null;document.getElementById(obj["elementId"])._obj=null;};if(editor._statusBarTree.hasChildNodes()){for(var i=editor._statusBarTree.firstChild;i;i=i.nextSibling){if(i.nodeName.toLowerCase()=="a"){HTMLArea._removeEvents(i,["click","contextmenu"],HTMLArea.statusBarHandler);i.el=null;i.editor=null;}}}};HTMLArea.prototype._getSelection=function(){return this._doc.selection;};HTMLArea.prototype._createRange=function(sel){if(typeof(sel)!="undefined")return sel.createRange();return this._doc.selection.createRange();};HTMLArea.prototype.selectNode=function(node){this.focusEditor();this.forceRedraw();var range=this._doc.body.createTextRange();range.moveToElementText(node);range.select();};HTMLArea.prototype.selectNodeContents=function(node,pos){this.focusEditor();this.forceRedraw();var collapsed=(typeof(pos)!="undefined");var range=this._doc.body.createTextRange();range.moveToElementText(node);(collapsed)&&range.collapse(pos);range.select();};HTMLArea.prototype.getSelectedHTML=function(){var sel=this._getSelection();var range=this._createRange(sel);if(sel.type.toLowerCase()=="control"){var r1=this._doc.body.createTextRange();r1.moveToElementText(range(0));return r1.htmlText;}else{return range.htmlText;}};HTMLArea.prototype.getSelectedHTMLContents=function(){var sel=this._getSelection();var range=this._createRange(sel);return range.htmlText;};HTMLArea.prototype.getParentElement=function(sel){if(!sel)var sel=this._getSelection();var range=this._createRange(sel);switch(sel.type){case "Text":case "None":var el=range.parentElement();if(el.nodeName.toLowerCase()=="li"&&range.htmlText.replace(/\s/g,"")==el.parentNode.outerHTML.replace(/\s/g,""))return el.parentNode;return el;case "Control":return range.item(0);default:return this._doc.body;}};HTMLArea.prototype._activeElement=function(sel){if(sel==null)return null;if(this._selectionEmpty(sel))return null;if(sel.type.toLowerCase()=="control"){return sel.createRange().item(0);}else{var range=sel.createRange();var p_elm=this.getParentElement(sel);if(p_elm.innerHTML==range.htmlText)return p_elm;return null;}};HTMLArea.prototype._selectionEmpty=function(sel){if(!sel)return true;return this._createRange(sel).htmlText=='';};HTMLArea.prototype.insertNodeAtSelection=function(toBeInserted){var sel=this._getSelection();var range=this._createRange(sel);range.pasteHTML(toBeInserted.outerHTML);};HTMLArea.prototype.insertHTML=function(html){this.focusEditor();var sel=this._getSelection();var range=this._createRange(sel);range.pasteHTML(html);};HTMLArea.statusBarHandler=function(ev){if(!ev)var ev=window.event;var target=(ev.target)?ev.target:ev.srcElement;var editor=target.editor;target.blur();var tagname=target.el.tagName.toLowerCase();if(tagname=="table"||tagname=="img"){var range=editor._doc.body.createControlRange();range.addElement(target.el);range.select();}else{editor.selectNode(target.el);}editor.updateToolbar(true);switch(ev.type){case "click":HTMLArea._stopEvent(ev);return false;case "contextmenu":return editor.plugins["ContextMenu"]?editor.plugins["ContextMenu"].instance.popupMenu(ev,target.el):false;}};HTMLArea.prototype._checkBackspace=function(){var sel=this._getSelection();var range=this._createRange(sel);if(sel.type=="Control"){var el=this.getParentElement();var p=el.parentNode;p.removeChild(el);return true;}else{var r2=range.duplicate();r2.moveStart("character",-1);var a=r2.parentElement();if(a!=range.parentElement()&&/^a$/i.test(a.tagName)){r2.collapse(true);r2.moveEnd("character",1);r2.pasteHTML('');r2.select();return true;};return false;}};
+HTMLArea._cleanup=function(editor){for(var handler in editor.eventHandlers)editor.eventHandlers[handler]=null;for(var button in editor.btnList)editor.btnList[button][3]=null;for(var dropdown in editor.config.customSelects){dropdown.action=null;dropdown.refresh=null;}editor.onGenerate=null;HTMLArea._editorEvent=null;if(editor._textArea.form){editor._textArea.form.__msh_prevOnReset=null;editor._textArea.form._editorNumber=null;};HTMLArea.onload=null;if(HTMLArea._eventCache){HTMLArea._eventCache.listEvents=null;HTMLArea._eventCache.add=null;HTMLArea._eventCache.flush=null;HTMLArea._eventCache=null;};for(var i in editor.plugins){var plugin=editor.plugins[i].instance;plugin.onGenerate=null;plugin.onMode=null;plugin.onKeyPress=null;plugin.onSelect=null;plugin.onUpdateTolbar=null;};var obj;for(var txt in editor._toolbarObjects){obj=editor._toolbarObjects[txt];obj["state"]=null;document.getElementById(obj["elementId"])._obj=null;};if(editor._statusBarTree.hasChildNodes()){for(var i=editor._statusBarTree.firstChild;i;i=i.nextSibling){if(i.nodeName.toLowerCase()=="a"){HTMLArea._removeEvents(i,["click","contextmenu"],HTMLArea.statusBarHandler);i.el=null;i.editor=null;}}}};HTMLArea.prototype._getSelection=function(){return this._doc.selection;};HTMLArea.prototype._createRange=function(sel){if(typeof(sel)!="undefined")return sel.createRange();return this._doc.selection.createRange();};HTMLArea.prototype.selectNode=function(node){this.focusEditor();this.forceRedraw();var range=this._doc.body.createTextRange();range.moveToElementText(node);range.select();};HTMLArea.prototype.selectNodeContents=function(node,pos){this.focusEditor();this.forceRedraw();var collapsed=(typeof(pos)!="undefined");var range=this._doc.body.createTextRange();range.moveToElementText(node);(collapsed)&&range.collapse(pos);range.select();};HTMLArea.prototype.getSelectedHTML=function(){var sel=this._getSelection();var range=this._createRange(sel);if(sel.type.toLowerCase()=="control"){var r1=this._doc.body.createTextRange();r1.moveToElementText(range(0));return r1.htmlText;}else{return range.htmlText;}};HTMLArea.prototype.getSelectedHTMLContents=function(){var sel=this._getSelection();var range=this._createRange(sel);return range.htmlText;};HTMLArea.prototype.getParentElement=function(sel){if(!sel)var sel=this._getSelection();var range=this._createRange(sel);switch(sel.type){case "Text":case "None":var el=range.parentElement();if(el.nodeName.toLowerCase()=="li"&&range.htmlText.replace(/\s/g,"")==el.parentNode.outerHTML.replace(/\s/g,""))return el.parentNode;return el;case "Control":return range.item(0);default:return this._doc.body;}};HTMLArea.prototype._activeElement=function(sel){if(sel==null)return null;if(this._selectionEmpty(sel))return null;if(sel.type.toLowerCase()=="control"){return sel.createRange().item(0);}else{var range=sel.createRange();var p_elm=this.getParentElement(sel);if(p_elm.innerHTML==range.htmlText)return p_elm;return null;}};HTMLArea.prototype._selectionEmpty=function(sel){if(!sel)return true;return this._createRange(sel).htmlText=='';};HTMLArea.prototype.insertNodeAtSelection=function(toBeInserted){var sel=this._getSelection();var range=this._createRange(sel);range.pasteHTML(toBeInserted.outerHTML);};HTMLArea.prototype.insertHTML=function(html){this.focusEditor();var sel=this._getSelection();if(sel.type.toLowerCase()=="control"){sel.clear();sel=this._getSelection();};var range=this._createRange(sel);range.pasteHTML(html);};HTMLArea.statusBarHandler=function(ev){if(!ev)var ev=window.event;var target=(ev.target)?ev.target:ev.srcElement;var editor=target.editor;target.blur();var tagname=target.el.tagName.toLowerCase();if(tagname=="table"||tagname=="img"){var range=editor._doc.body.createControlRange();range.addElement(target.el);range.select();}else{editor.selectNode(target.el);}editor.updateToolbar(true);switch(ev.type){case "click":HTMLArea._stopEvent(ev);return false;case "contextmenu":return editor.plugins["ContextMenu"]?editor.plugins["ContextMenu"].instance.popupMenu(ev,target.el):false;}};HTMLArea.prototype._checkBackspace=function(){var sel=this._getSelection();var range=this._createRange(sel);if(sel.type=="Control"){var el=this.getParentElement();var p=el.parentNode;p.removeChild(el);return true;}else{var r2=range.duplicate();r2.moveStart("character",-1);var a=r2.parentElement();if(a!=range.parentElement()&&/^a$/i.test(a.tagName)){r2.collapse(true);r2.moveEnd("character",1);r2.pasteHTML('');r2.select();return true;};return false;}};
 
index 6a4f7bf..5ae1bf7 100644 (file)
@@ -226,6 +226,10 @@ HTMLArea.prototype.insertNodeAtSelection = function(toBeInserted) {
 HTMLArea.prototype.insertHTML = function(html) {
        this.focusEditor();
        var sel = this._getSelection();
+       if (sel.type.toLowerCase() == "control") {
+               sel.clear();
+               sel = this._getSelection();
+       }
        var range = this._createRange(sel);
        range.pasteHTML(html);
 };
index f452743..0fb27e3 100644 (file)
@@ -37,7 +37,7 @@
 /***************************************************
  *  EDITOR INITIALIZATION AND CONFIGURATION
  ***************************************************/
-
 /*
  * Set some basic paths
  */
@@ -1004,24 +1004,26 @@ HTMLArea.stylesLoaded = function(editorNumber) {
 HTMLArea.prototype.stylesLoaded = function() {
        var doc = this._doc;
        var docWellFormed = true;
-
+       
                // check if the stylesheets have been loaded
        if (!HTMLArea.is_opera) {
                if (this._stylesLoadedTimer) window.clearTimeout(this._stylesLoadedTimer);
                var stylesAreLoaded = true;
+               var errorText = '';
                var rules;
                for (var rule = 0; rule < doc.styleSheets.length; rule++) {
-                       if (HTMLArea.is_gecko) try { rules = doc.styleSheets[rule].cssRules; } catch(e) { stylesAreLoaded = false; }
-                       if (HTMLArea.is_ie) try { rules = doc.styleSheets[rule].rules; } catch(e) { stylesAreLoaded = false; }
-                       if (HTMLArea.is_ie) try { rules = doc.styleSheets[rule].imports; } catch(e) { stylesAreLoaded = false; }
+                       if (HTMLArea.is_gecko) try { rules = doc.styleSheets[rule].cssRules; } catch(e) { stylesAreLoaded = false; errorText = e; }
+                       if (HTMLArea.is_ie) try { rules = doc.styleSheets[rule].rules; } catch(e) { stylesAreLoaded = false; errorText = e; }
+                       if (HTMLArea.is_ie) try { rules = doc.styleSheets[rule].imports; } catch(e) { stylesAreLoaded = false; errorText = e; }
                }
                if (!stylesAreLoaded && !HTMLArea.is_wamcom) {
+                       HTMLArea._appendToLog("[HTMLArea::initIframe]: Failed attempt at loading stylesheets: " + errorText + " Retrying...");
                        this._stylesLoadedTimer = window.setTimeout("HTMLArea.stylesLoaded(" + this._editorNumber + ");", 100);
                        return false;
                }
                HTMLArea._appendToLog("[HTMLArea::initIframe]: Stylesheets successfully loaded.");
        }
-
+       
        if (!this.config.fullPage) {
                doc.body.style.borderWidth = "0px";
                doc.body.className = "htmlarea-content-body";
@@ -1041,6 +1043,7 @@ HTMLArea.prototype.stylesLoaded = function() {
                if (HTMLArea.is_gecko && !HTMLArea.is_safari && !HTMLArea.is_opera && !this._initEditMode()) return false;
                if (HTMLArea.is_opera) doc.designMode = "on";
                if (HTMLArea.is_ie || HTMLArea.is_safari) doc.body.contentEditable = true;
+               if (HTMLArea.is_ie) doc.selection.empty();
                this._editMode = "wysiwyg";
                if (doc.body.contentEditable || doc.designMode == "on") HTMLArea._appendToLog("[HTMLArea::initIframe]: Design mode successfully set.");
        } else {
@@ -2015,8 +2018,8 @@ HTMLArea.insertTableDialog = function(editor, sel, range) {
                editor.focusEditor();
                if(HTMLArea.is_ie) range.pasteHTML(table.outerHTML);
                        else editor.insertNodeAtSelection(table);
-               editor.forceRedraw();
-               if (HTMLArea.is_gecko && !HTMLArea.is_safari) editor.setMode("wysiwyg");
+               if (editor.config.buttons["toggleborders"] && editor.config.buttons["toggleborders"]["setOnTableCreation"]) editor.plugins["TableOperations"].instance.buttonPress(editor,"TO-toggle-borders");
+               if (HTMLArea.is_gecko && !HTMLArea.is_safari && !HTMLArea.is_opera) editor.setMode("wysiwyg");
                editor.updateToolbar();
                editor = null;
                sel = null;
@@ -2477,7 +2480,7 @@ HTMLArea._hasClass = function(el, className) {
 
 HTMLArea.RE_blockTags = /^(body|p|h1|h2|h3|h4|h5|h6|ul|ol|pre|dl|div|noscript|blockquote|form|hr|table|fieldset|address|td|tr|th|li|tbody|thead|tfoot|iframe|object)$/;
 HTMLArea.isBlockElement = function(el) { return el && el.nodeType == 1 && HTMLArea.RE_blockTags.test(el.nodeName.toLowerCase()); };
-HTMLArea.RE_closingTags = /^(p|span|a|li|ol|ul|dl|dt|td|th|tr|tbody|thead|tfoot|caption|table|div|em|i|strong|b|code|cite|blockquote|q|dfn|abbr|acronym|font|center|object|embed|tt|style|script|title|head)$/;
+HTMLArea.RE_closingTags = /^(p|span|a|li|ol|ul|dl|dt|td|th|tr|tbody|thead|tfoot|caption|table|div|em|i|strong|b|code|cite|blockquote|q|dfn|abbr|acronym|font|center|object|embed|tt|style|script|title|head|clickenlarge)$/;
 HTMLArea.RE_noClosingTag = /^(img|br|hr|input|area|base|link|meta|param)$/;
 HTMLArea.needsClosingTag = function(el) { return el && el.nodeType == 1 && !HTMLArea.RE_noClosingTag.test(el.tagName.toLowerCase()); };
 
@@ -2533,7 +2536,8 @@ HTMLArea.getHTMLWrapper = function(root, outputRoot, editor) {
                if (root_tag == 'br' && config.removeTrailingBR && !root.nextSibling && HTMLArea.isBlockElement(root.parentNode) && (!root.previousSibling || root.previousSibling.nodeName.toLowerCase() != 'br')) break;
                if (config.htmlRemoveTagsAndContents && config.htmlRemoveTagsAndContents.test(root_tag)) break;
                var custom_tag = (config.customTags && config.customTags.test(root_tag));
-               if (outputRoot) outputRoot = !(config.htmlRemoveTags && config.htmlRemoveTags.test(root_tag));
+               var empty_root = (root_tag == "clickenlarge" && !(root.firstChild && root.firstChild.nodeName.toLowerCase() == "img"));
+               if (outputRoot) outputRoot = !(config.htmlRemoveTags && config.htmlRemoveTags.test(root_tag)) && !empty_root;
                if ((HTMLArea.is_ie || HTMLArea.is_safari) && root_tag == "head") {
                        if(outputRoot) html += "<head>";
                        var save_multiline = RegExp.multiline;
@@ -2753,21 +2757,21 @@ HTMLArea._postback = function(url, data, handler, addParams, charset) {
 /*
  * Modal dialog pseudo-object
  */
-Dialog = function(url, action, init, width, height, opener, editor) {
-       Dialog._open(url, action, init, (width?width:100), (height?height:100), opener, editor);
+Dialog = function(url, action, init, width, height, opener, editor, scrollbars) {
+       Dialog._open(url, action, init, (width?width:100), (height?height:100), opener, editor, scrollbars);
 };
 
 /*
  * Open modal popup window
  */
-Dialog._open = function(url, action, init, width, height, _opener, editor) {
+Dialog._open = function(url, action, init, width, height, _opener, editor, scrollbars) {
        
        if (typeof(Dialog._modal) == "object" && typeof(Dialog._modal.close) == "function") {
                Dialog._modal.close();
                Dialog._modal = null;
        }
        
-       var dlg = window.open(url, 'hadialog', "toolbar=no,location=no,directories=no,menubar=no,width=" + width + ",height=" + height + ",scrollbars=no,resizable=yes,modal=yes,dependent=yes,top=100,left=100");
+       var dlg = window.open(url, 'hadialog', "toolbar=no,location=no,directories=no,menubar=no,width=" + width + ",height=" + height + ",scrollbars=" + scrollbars + ",resizable=yes,modal=yes,dependent=yes,top=100,left=100");
        var obj = new Object();
        obj.dialogWindow = dlg;
        Dialog._dialog = obj;
@@ -2831,9 +2835,10 @@ Dialog._parentEvent = function(ev) {
  * Receives an URL to the popup dialog, an action function that receives one value and an initialization object.
  * The action function will get called after the dialog is closed, with the return value of the dialog.
  */
-HTMLArea.prototype._popupDialog = function(url, action, init, width, height, _opener) {
+HTMLArea.prototype._popupDialog = function(url, action, init, width, height, _opener, scrollbars) {
        if (typeof(_opener) == "undefined" || !_opener) var _opener = (this._iframe.contentWindow ? this._iframe.contentWindow : window);
-       Dialog(this.popupURL(url), action, init, width, height, _opener, this);
+       if (typeof(scrollbars) == "undefined") var scrollbars = "no";
+       Dialog(this.popupURL(url), action, init, width, height, _opener, this, scrollbars);
 };
 
 /**
@@ -2890,14 +2895,16 @@ HTMLArea.initTimer = [];
 
 HTMLArea.onGenerateHandler = function(editorNumber) {
        return (function() {
-               document.getElementById('pleasewait' + editorNumber).style.display='none';
-               document.getElementById('editorWrap' + editorNumber).style.visibility='visible';
+               document.getElementById('pleasewait' + editorNumber).style.display = 'none';
+               document.getElementById('editorWrap' + editorNumber).style.visibility = 'visible';
                editorNumber = null;
        });
 };
 
 HTMLArea.initEditor = function(editorNumber) {
        if(HTMLArea.checkSupportedBrowser()) {
+               document.getElementById('pleasewait' + editorNumber).style.display = 'block';
+               document.getElementById('editorWrap' + editorNumber).style.visibility = 'hidden';
                if(HTMLArea.initTimer[editorNumber]) window.clearTimeout(HTMLArea.initTimer[editorNumber]);
                if(!HTMLArea.is_loaded) {
                        HTMLArea.initTimer[editorNumber] = window.setTimeout( "HTMLArea.initEditor(" + editorNumber + ");", 150);
@@ -2917,8 +2924,9 @@ HTMLArea.initEditor = function(editorNumber) {
                        editor._editorNumber = editorNumber;
                        config = editor.config;
                        
+                       config.buttons = RTE["buttons"];
+                       
                        config.hideTableOperationsInToolbar = RTE["hideTableOperationsInToolbar"] ? RTE["hideTableOperationsInToolbar"] : false;
-                       config.keepToggleBordersInToolbar = RTE["keepToggleBordersInToolbar"] ? RTE["keepToggleBordersInToolbar"] : false;
                        config.disableLayoutFieldsetInTableOperations = RTE["disableLayoutFieldsetInTableOperations"] ? RTE["disableLayoutFieldsetInTableOperations"] : false;
                        config.disableAlignmentFieldsetInTableOperations = RTE["disableAlignmentFieldsetInTableOperations"] ? RTE["disableAlignmentFieldsetInTableOperations"] : false;
                        config.disableSpacingFieldsetInTableOperations = RTE["disableSpacingFieldsetInTableOperations"] ? RTE["disableSpacingFieldsetInTableOperations"] : false;
index cc524db..6e42c31 100644 (file)
@@ -1,2 +1,2 @@
-Acronym=function(editor){this.editor=editor;var cfg=editor.config;var actionHandlerFunctRef=Acronym.actionHandler(this);cfg.registerButton("Acronym",Acronym_langArray["Insert/Modify Acronym"],editor.imgURL("ed_acronym.gif","Acronym"),false,actionHandlerFunctRef);};Acronym.I18N=Acronym_langArray;Acronym._pluginInfo={name:"Acronym",version:"1.2",developer:"Stanislas Rolland",developer_url:"http://www.fructifor.ca/",c_owner:"Stanislas Rolland",sponsor:"Fructifor Inc.",sponsor_url:"http://www.fructifor.ca/",license:"GPL"};Acronym.actionHandler=function(instance){return(function(editor){instance.buttonPress(editor);});};Acronym.prototype.buttonPress=function(editor){var editorNo=editor._doc._editorNo;var backreturn;var addUrlParams="?"+conf_RTEtsConfigParams;editor._popupDialog("../../mod1/popup.php"+addUrlParams+"&editorNo="+editorNo+"&popupname=acronym&srcpath="+encodeURI(rtePathAcronymFile),null,null,570,280);return false;};
+Acronym=function(editor){this.editor=editor;var cfg=editor.config;var actionHandlerFunctRef=Acronym.actionHandler(this);cfg.registerButton("Acronym",Acronym_langArray["Insert/Modify Acronym"],editor.imgURL("ed_acronym.gif","Acronym"),false,actionHandlerFunctRef);};Acronym.I18N=Acronym_langArray;Acronym._pluginInfo={name:"Acronym",version:"1.4",developer:"Stanislas Rolland",developer_url:"http://www.fructifor.ca/",c_owner:"Stanislas Rolland",sponsor:"Fructifor Inc.",sponsor_url:"http://www.fructifor.ca/",license:"GPL"};Acronym.actionHandler=function(instance){return(function(editor){instance.buttonPress(editor);});};Acronym.prototype.buttonPress=function(editor){var editorNo=editor._doc._editorNo;var backreturn;var addUrlParams="?"+RTEarea[0]["RTEtsConfigParams"];editor._popupDialog(RTEarea[0]["pathAcronymModule"]+addUrlParams+"&editorNo="+editorNo,null,null,570,280);return false;};
 
index e5e113e..1304007 100644 (file)
@@ -45,7 +45,7 @@ Acronym.I18N = Acronym_langArray;
 
 Acronym._pluginInfo = {
        name            : "Acronym",
-       version         : "1.2",
+       version         : "1.4",
        developer       : "Stanislas Rolland",
        developer_url   : "http://www.fructifor.ca/",
        c_owner         : "Stanislas Rolland",
@@ -63,7 +63,7 @@ Acronym.actionHandler = function(instance) {
 Acronym.prototype.buttonPress = function(editor) {
        var editorNo = editor._doc._editorNo;
        var backreturn;
-       var addUrlParams = "?" + conf_RTEtsConfigParams;
-       editor._popupDialog("../../mod1/popup.php" + addUrlParams + "&editorNo=" + editorNo + "&popupname=acronym&srcpath=" + encodeURI(rtePathAcronymFile), null, null, 570, 280);
+       var addUrlParams = "?" + RTEarea[0]["RTEtsConfigParams"];
+       editor._popupDialog(RTEarea[0]["pathAcronymModule"] + addUrlParams + "&editorNo=" + editorNo, null, null, 570, 280);
        return false;
 };
index dcdd67d..bd8c19d 100644 (file)
@@ -1,3 +1,4 @@
+<html class="popupwin">
 <!-- 
 /***************************************************************
 *  Copyright notice
  * TYPO3 CVS ID: $Id$
  */
 -->
-<html class="popupwin">
 <head>
        <title>Quick Tag Editor</title>
        <meta http-equiv="Content-Style-Type" content="text/css" />
-       <!--<link rel="stylesheet" href="../../../htmlarea.css" />-->
        <script type="text/javascript" src="../tag-lib.js"></script>
        <script type="text/javascript" src="../../../popups/popup.js"></script>
        <script type="text/javascript">
                _editor_CSS = window.opener._editor_CSS;
                __dlg_loadStyle(_editor_CSS);
                var QuickTag = window.opener.QuickTag;
-               var _quickTag_hideTags = window.opener._quickTag_hideTags;
                var i18n = QuickTag.I18N;
                var curTag = 'none';
                var curTagOpt = false;
                var CSSEdit = false;
                var editor = null;
-
+               
                        // simulation of Dialog._return - select_color.html needs it.
                var Dialog = new Object();
                Dialog._return = function (val) {
                        var param = window.dialogArguments;
                        editor = param['editor'];
                        var selectext = param['selectedText']; // sem uso...
-
+                       
                        createDropdown("tags");
-  
+                       
                        var to = document.getElementById('tagopen');
                        HTMLArea._addEvent(to, "keypress", function(ev) { if(typeof choice_dropdown != "undefined") choice_dropdown(HTMLArea.is_ie ? window.event : ev); });
-
+                       
                        document.getElementById('bt_colors').style.display = 'none';
                        document.body.onkeypress = __dlg_key_press;
                        to.focus();
                };
 
                function quoteTest(val) {
-                       var er = /^\w+\s*(\w+=\"[^\"]*\"\s*|\w+=\'[^\']*\'\s*)*$/;
+                       var er = /^\w+\s*([a-zA-Z_0-9:;]+=\"[^\"]*\"\s*|[a-zA-Z_0-9:;]+=\'[^\']*\'\s*)*$/;
                        return er.test(val);
                };
 
                        }
                        return true;
                };
-
-function selchange() {
-var toadd = document.getElementById('selectag').value; 
-var oldval = document.getElementById('tagopen').value; 
-var text = (oldval+toadd).replace(/^\s*(.+)\s*$/,"$1");
-var atrib = /(\w+)=\"$/.test(toadd) ? toadd.replace(/(\w+)=\"$/, "$1") : null;
-var showcolors = (/color\: ?$/.test(toadd)) ? true : false;
-var noCSSclasses = false;
-var obj = null;
-curTag = text.replace(/(^\w+) ?.*$/, "$1");
-curTagOpt = (tagLib[curTag] == true);
-
-       if(atrib) {
-               var atrer = eval('/'+atrib+'=/ig');
-               if(atrer.test(oldval) && !(/[^=]\"$/.test(toadd))) {
-                       alert(i18n['This attribute already exists in the TAG']);
-                       return false;
-               }
-               switch(atrib) {
-                       case 'style':
-                               CSSEdit = true;
-                               break;
-                       case 'class':
-                               if(captureClasses() == 0) noCSSclasses = true;
-                               break;
-                       case 'color':
-                       case 'bgcolor':
-                       case 'bordercolor':
-                       case 'bordercolorlight':
-                       case 'bordercolordark':
-                               showcolors = true;
-                               break;
-               }
-
-               if(curTagOpt == true) {
-                       obj = eval('opAtt_'+curTag.replace(/^h[1-6]$/,"h")+'["'+atrib+'"]');
-               } else { 
-                       obj = opAtt_all[atrib];
-               } 
-       } else if(!CSSEdit && (/(^\w+$|\"$)/.test(toadd))) {
-               obj = 'all';
-               if(curTagOpt == true) obj = curTag;
-               toadd += ' ';
-       }
-  
-       if(CSSEdit && quoteTest(text)) CSSEdit = false;
-
-       if(showcolors) document.getElementById('bt_colors').style.display = '';
-
-       if(obj) {
-               createDropdown(obj);
-       } else if(!CSSEdit) {
-               document.getElementById('showselect').style.visibility = 'hidden';
-       }
-
-       if(noCSSclasses) {
-               document.getElementById('showselect').innerHTML = i18n['No CSS class avaiable'];
-               document.getElementById('showselect').style.visibility = 'visible';
-       }
-  
-       addchanges();
-
-       function addchanges() {
-               document.getElementById('tagopen').focus();
-               document.getElementById('tagopen').value += toadd;
-       };
-};
+               
+               function selchange() {
+                       var toadd = document.getElementById('selectag').value; 
+                       var oldval = document.getElementById('tagopen').value; 
+                       var text = (oldval+toadd).replace(/^\s*(.+)\s*$/,"$1");
+                       var atrib = /(\w+)=\"$/.test(toadd) ? toadd.replace(/(\w+)=\"$/, "$1") : null;
+                       var showcolors = (/color\: ?$/.test(toadd)) ? true : false;
+                       var noCSSclasses = false;
+                       var obj = null;
+                       curTag = text.replace(/(^\w+) ?.*$/, "$1");
+                       curTagOpt = (tagLib[curTag] == true);
+                       
+                       if (atrib) {
+                               var atrer = eval('/'+atrib+'=/ig');
+                               if(atrer.test(oldval) && !(/[^=]\"$/.test(toadd))) {
+                                       alert(i18n['This attribute already exists in the TAG']);
+                                       return false;
+                               }
+                               switch(atrib) {
+                                       case 'style':
+                                               CSSEdit = true;
+                                               break;
+                                       case 'class':
+                                               if(captureClasses() == 0) noCSSclasses = true;
+                                               break;
+                                       case 'color':
+                                       case 'bgcolor':
+                                       case 'bordercolor':
+                                       case 'bordercolorlight':
+                                       case 'bordercolordark':
+                                               showcolors = true;
+                                               break;
+                               }
+                               
+                               if(curTagOpt == true) {
+                                       obj = eval('opAtt_'+curTag.replace(/^h[1-6]$/,"h")+'["'+atrib+'"]');
+                               } else {
+                                       obj = opAtt_all[atrib];
+                               
+                       } else if (!CSSEdit && (/(^\w+$|\"$)/.test(toadd))) {
+                               obj = 'all';
+                               if (curTagOpt == true) obj = curTag;
+                               toadd += ' ';
+                       }
+                               
+                       if (CSSEdit && quoteTest(text)) CSSEdit = false;
+                               
+                       if (showcolors) document.getElementById('bt_colors').style.display = '';
+                               
+                       if(obj) {
+                               createDropdown(obj, curTag);
+                       } else if(!CSSEdit) {
+                               document.getElementById('showselect').style.visibility = 'hidden';
+                       }
+                       
+                       if(noCSSclasses) {
+                               document.getElementById('showselect').innerHTML = i18n['No CSS class avaiable'];
+                               document.getElementById('showselect').style.visibility = 'visible';
+                       }
+                       
+                       addchanges();
+                       
+                       function addchanges() {
+                               document.getElementById('tagopen').focus();
+                               document.getElementById('tagopen').value += toadd;
+                       };
+               };
 
                function captureClasses() {
                        var cont = 0;
@@ -240,7 +238,7 @@ curTagOpt = (tagLib[curTag] == true);
                                                }
                                        }
                                }
-                       return cont;
+                               return cont;
                        }
 
                        var styleSheet = null;
@@ -265,18 +263,15 @@ curTagOpt = (tagLib[curTag] == true);
                };
 
                function choice_dropdown(e) {
-                       if (document.all) {
-                               var Key = e.keyCode;
-                       } else { 
-                               var Key = e.charCode;
-                       }
-                       if(Key != 32) return;
+                       if (document.all) var Key = e.keyCode;
+                               else var Key = e.charCode;
+                       if (Key != 32) return;
 
                        var text = document.getElementById('tagopen').value.replace(/^\s*([^\s]+)\s*$/,"$1");
-                       if(CSSEdit && quoteTest(text)) CSSEdit = false;
-                       if(CSSEdit) return;
+                       if (CSSEdit && quoteTest(text)) CSSEdit = false;
+                       if (CSSEdit) return;
 
-                       if(curTag == 'none') {
+                       if (curTag == 'none') {
                                curTag = text.replace(/(^\w+) ?.*$/, "$1");
                                curTagOpt = tagLib[curTag];
                        }
@@ -288,37 +283,61 @@ curTagOpt = (tagLib[curTag] == true);
                        }
 
                        var att = 'all';
-                       if(curTagOpt == true) att = curTag;
-                       createDropdown(att);
+                       if (curTagOpt == true) att = curTag;
+                       createDropdown(att, curTag);
                };
-
-               function createDropdown(type) {
+               
+               function createDropdown(type,tag) {
                        var _div = document.getElementById('showselect');
                        while(_div.hasChildNodes()) _div.removeChild(_div.firstChild);
                        _div.style.visibility = 'visible';
-    
+                       
                        var _sel = document.createElement("select");
                        _sel.id = "selectag";
                        _sel.onchange = function() { selchange(); };
-  
-                       if(typeof type == 'object') {
+                       
+                       if (typeof(type) == 'object') {
                                var obj = type;
                                forObj(i18n["OPTIONS"],'options');
                                _div.appendChild(_sel);
                                return;
                        }
-
-                       if(type == 'tags') {
-                               var obj = allTags;
+                       
+                       if (type == 'tags') {
+                               var obj = new Object();
+                               if (editor.config.buttons["inserttag"] && editor.config.buttons["inserttag"]["denyTags"]) {
+                                       var denyTags = editor.config.buttons["inserttag"]["denyTags"].split(",").join("|").replace(/ /g, "");
+                                       var expr = new RegExp("^("+denyTags+")$");
+                                       for (var i in allTags) {
+                                               if (!expr.test(i)) obj[i] = allTags[i];
+                                       }
+                               } else {
+                                       obj = allTags;
+                               }
                                forObj(i18n["TAGs"],'tags');
                                _div.appendChild(_sel);
                                return;
                        }
-
-                       type = type.replace(/^h[1-6]$/,"h");
-                       var topt = eval('opTag_'+type);
-                       if(typeof topt == 'object') {
-                               var obj = topt;
+                       
+                       var topt = eval('opTag_'+type.replace(/^h[1-6]$/,"h"));
+                       if (typeof(topt) == 'object') {
+                               var obj = new Object();
+                               var allowedAttribs = "";
+                               if (typeof(tag) == 'string' && editor.config.buttons["inserttag"] && (editor.config.buttons["inserttag"]["allowedAttribs"] || (editor.config.buttons["inserttag"]["tags"] && editor.config.buttons["inserttag"]["tags"][tag] && editor.config.buttons["inserttag"]["tags"][tag]["allowedAttribs"]))) {
+                                       if (editor.config.buttons["inserttag"]["allowedAttribs"]) {
+                                               allowedAttribs = editor.config.buttons["inserttag"]["allowedAttribs"].split(",").join("|").replace(/ /g, "");
+                                       }
+                                       if (editor.config.buttons["inserttag"]["tags"] && editor.config.buttons["inserttag"]["tags"][tag] && editor.config.buttons["inserttag"]["tags"][tag]["allowedAttribs"]) {
+                                               if (allowedAttribs) allowedAttribs =  allowedAttribs + "|";
+                                               allowedAttribs += editor.config.buttons["inserttag"]["tags"][tag]["allowedAttribs"].split(",").join("|").replace(/ /g, "");
+                                       }
+                                       var expr = new RegExp("^("+allowedAttribs+")$");
+                                       for (var i in topt) {
+                                               if (expr.test(i)) obj[i] = topt[i];
+                                       }
+                               } else {
+                                       obj = topt;
+                               }
                        } else {
                                return;
                        }
@@ -326,18 +345,16 @@ curTagOpt = (tagLib[curTag] == true);
                        _div.appendChild(_sel);
 
                        function forObj(first,type) {
-                               if(first) {
-                                       var _op = document.createElement("option");
-                                       _op.appendChild(document.createTextNode(first));
-                                       _sel.appendChild(_op);
+                               if (first) {
+                                       var opt = document.createElement("option");
+                                       opt.appendChild(document.createTextNode(first));
+                                       _sel.appendChild(opt);
                                }
-                               for(var i in obj) {
-                                       if( type != 'tags' || _quickTag_hideTags.indexOf(i) == -1 ) {
-                                               var opt = document.createElement("option");
-                                               opt.appendChild(document.createTextNode(i));
-                                               opt.value = obj[i];
-                                               _sel.appendChild(opt);
-                                       }
+                               for (var i in obj) {
+                                       var opt = document.createElement("option");
+                                       opt.appendChild(document.createTextNode(i));
+                                       opt.value = obj[i];
+                                       _sel.appendChild(opt);
                                }
                        };
                };
index 716c054..61eb4b3 100644 (file)
@@ -1,2 +1,2 @@
-QuickTag=function(editor){this.editor=editor;var cfg=editor.config;var actionHandlerFunctRef=QuickTag.actionHandler(this);cfg.registerButton({id:"InsertTag",tooltip:QuickTag_langArray["Quick Tag Editor"],image:editor.imgURL("ed_quicktag.gif","QuickTag"),textMode:false,action:actionHandlerFunctRef,context:null,hide:false,selection:true});};QuickTag.I18N=QuickTag_langArray;QuickTag.actionHandler=function(instance){return(function(editor){instance.buttonPress(editor);});};QuickTag.prototype.buttonPress=function(editor){var sel=editor.getSelectedHTML().replace(/(<[^>]*>|&nbsp;|\n|\r)/g,"");var param=new Object();param.editor=editor;if(/\w/.test(sel)){var setTagHandlerFunctRef=QuickTag.setTagHandler(this);editor._popupDialog("plugin://QuickTag/quicktag",setTagHandlerFunctRef,param,450,108);}else{alert(QuickTag.I18N['You have to select some text']);}};QuickTag.setTagHandler=function(instance){return(function(param){if(param&&typeof(param.tagopen)!="undefined"){instance.editor.focusEditor();instance.editor.surroundHTML(param.tagopen,param.tagclose);}});};QuickTag._pluginInfo={name:"QuickTag",version:"1.1",developer:"Cau Guanabara & Stanislas Rolland",developer_url:"mailto:caugb@ibest.com.br",c_owner:"Cau Guanabara & Stanislas Rolland",sponsor:"Independent production & Fructifor Inc.",sponsor_url:"http://www.netflash.com.br/gb/HA3-rc1/examples/quick-tag.html",license:"GPL"};
+QuickTag=function(editor){this.editor=editor;var cfg=editor.config;var actionHandlerFunctRef=QuickTag.actionHandler(this);cfg.registerButton({id:"InsertTag",tooltip:QuickTag_langArray["Quick Tag Editor"],image:editor.imgURL("ed_quicktag.gif","QuickTag"),textMode:false,action:actionHandlerFunctRef,context:null,hide:false,selection:true});};QuickTag.I18N=QuickTag_langArray;QuickTag.actionHandler=function(instance){return(function(editor){instance.buttonPress(editor);});};QuickTag.prototype.buttonPress=function(editor){var sel=editor.getSelectedHTML().replace(/(<[^>]*>|&nbsp;|\n|\r)/g,"");var param=new Object();param.editor=editor;if(/\w/.test(sel)){var setTagHandlerFunctRef=QuickTag.setTagHandler(this);editor._popupDialog("plugin://QuickTag/quicktag",setTagHandlerFunctRef,param,450,108);}else{alert(QuickTag.I18N['You have to select some text']);}};QuickTag.setTagHandler=function(instance){return(function(param){if(param&&typeof(param.tagopen)!="undefined"){instance.editor.focusEditor();instance.editor.surroundHTML(param.tagopen,param.tagclose);}});};QuickTag._pluginInfo={name:"QuickTag",version:"1.2",developer:"Cau Guanabara & Stanislas Rolland",developer_url:"mailto:caugb@ibest.com.br",c_owner:"Cau Guanabara & Stanislas Rolland",sponsor:"Independent production & Fructifor Inc.",sponsor_url:"http://www.netflash.com.br/gb/HA3-rc1/examples/quick-tag.html",license:"GPL"};
 
index aa450c8..b193160 100644 (file)
@@ -39,11 +39,11 @@ QuickTag = function(editor) {
        var actionHandlerFunctRef = QuickTag.actionHandler(this);
        cfg.registerButton({
                id              : "InsertTag",
-               tooltip : QuickTag_langArray["Quick Tag Editor"],
+               tooltip         : QuickTag_langArray["Quick Tag Editor"],
                image           : editor.imgURL("ed_quicktag.gif", "QuickTag"),
                textMode        : false,
-               action  : actionHandlerFunctRef,
-               context : null,
+               action          : actionHandlerFunctRef,
+               context         : null,
                hide            : false,
                selection       : true
                });
@@ -81,7 +81,7 @@ QuickTag.setTagHandler = function(instance) {
 
 QuickTag._pluginInfo = {
        name          : "QuickTag",
-       version       : "1.1",
+       version       : "1.2",
        developer     : "Cau Guanabara & Stanislas Rolland",
        developer_url : "mailto:caugb@ibest.com.br",
        c_owner       : "Cau Guanabara & Stanislas Rolland",
index 9fb575d..4741656 100644 (file)
@@ -15,7 +15,6 @@
 
 var allTags = {
 'a': 'a',
-'a (full)': 'a href="" target=""',
 'abbr': 'abbr',
 'acronym': 'acronym',
 'address': 'address',
@@ -28,7 +27,6 @@ var allTags = {
 'em': 'em',
 'fieldset': 'fieldset',
 'font': 'font',
-'font (full)': 'font face="" size="" color=""',
 'h1': 'h1',
 'h2': 'h2',
 'h3': 'h3',
@@ -54,17 +52,17 @@ var allTags = {
 
 // tags with options
 var tagLib =  {
-'a': true, 
-'div': true, 
-'font': true, 
-'h1': true,
-'h2': true,
-'h3': true,
-'h4': true,
-'h5': true,
-'h6': true,
-'p': true,
-'table': true
+       'a': true,
+       'div': true,
+       'font': true,
+       'h1': true,
+       'h2': true,
+       'h3': true,
+       'h4': true,
+       'h5': true,
+       'h6': true,
+       'p': true,
+       'table': true
 };
 // tags that needs some complement
 var subTagLib = {'table': {'op': '<tbody><tr><td>',
@@ -155,24 +153,25 @@ var opAtt_table = {
 
 // for all tags 
 var opTag_all = {
-'class': 'class="',
-'dir': 'dir="',
-'id': 'id="',
-'lang': 'lang="',
-'onFocus': 'onFocus="',
-'onBlur': 'onBlur="',
-'onClick': 'onClick="',
-'onDblClick': 'onDblClick="',
-'onMouseDown': 'onMouseDown="',
-'onMouseUp': 'onMouseUp="',
-'onMouseOver': 'onMouseOver="',
-'onMouseMove': 'onMouseMove="',
-'onMouseOut': 'onMouseOut="',
-'onKeyPress': 'onKeyPress="',
-'onKeyDown': 'onKeyDown="',
-'onKeyUp': 'onKeyUp="',
-'style': 'style="',
-'title': 'title="'
+       'class': 'class="',
+       'dir': 'dir="',
+       'id': 'id="',
+       'lang': 'lang="',
+       'onFocus': 'onFocus="',
+       'onBlur': 'onBlur="',
+       'onClick': 'onClick="',
+       'onDblClick': 'onDblClick="',
+       'onMouseDown': 'onMouseDown="',
+       'onMouseUp': 'onMouseUp="',
+       'onMouseOver': 'onMouseOver="',
+       'onMouseMove': 'onMouseMove="',
+       'onMouseOut': 'onMouseOut="',
+       'onKeyPress': 'onKeyPress="',
+       'onKeyDown': 'onKeyDown="',
+       'onKeyUp': 'onKeyUp="',
+       'style': 'style="',
+       'title': 'title="',
+       'xml:lang' : 'xml:lang="'
 };
 var opAtt_all = {
 'class': {},
@@ -350,6 +349,7 @@ var opAtt_all = {
           'word-spacing': 'word-spacing: ',
           'z-index': 'z-index: ' }
 };
+opAtt_all["xml:lang"] = opAtt_all["lang"];
 
 // add the common items to all objects
 for(var i in tagLib) {
index 9b0bdf3..1fa0952 100644 (file)
@@ -1,3 +1,5 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<html class="popupwin" xmlns="http://www.w3.org/1999/xhtml">
 <!--
 /***************************************************************
 *  Copyright notice
  * TYPO3 CVS ID: $Id$
  */
 -->
-<?xml version="1.0" encoding="iso-8859-1"?>
-<html class="popupwin" xmlns="http://www.w3.org/1999/xhtml">
 <head>
        <title>Spell Checker</title>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <script type="text/javascript" src="../spell-check-ui.js"></script>
        <script type="text/javascript" src="../../../popups/popup.js"></script>
        <script type="text/javascript">
+               /*<![CDATA[*/
+               <!--
                HTMLArea = window.opener.HTMLArea;
                _editor_CSS = window.opener._editor_CSS;
                __dlg_loadStyle(_editor_CSS);
+               // -->
+               /*]]>*/
        </script>
        <style type="text/css">
+               /*<![CDATA[*/
+               <!--
                iframe { background-color: #fff; color: #000; height: 100%; width: 100%; }
                .controls { width: 14em; }
-               .controls .sectitle { /* background-color: #736c6c; color: #fff;
-               border-top: 1px solid #000; border-bottom: 1px solid #fff; */
-               text-align: center; font-weight: bold; padding: 2px 4px; }
+               .controls .sectitle { text-align: center; font-weight: bold; padding: 2px 4px; }
                .controls .secbody { margin-bottom: 10px; }
                #v_currentWord { color: #f00; font-weight: bold; }
                #statusbar { padding: 7px 0px 0px 5px; }
                #status { font-weight: bold; }
+               -->
+               /*]]>*/
        </style>
 </head>
 <body class="popupwin" onload="initDocument();">
index 759085f..cd813f3 100644 (file)
@@ -1,3 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html class="popupwin" xmlns="http://www.w3.org/1999/xhtml">
 <!--
 /***************************************************************
 *  Copyright notice
  * TYPO3 CVS ID: $Id$
  */
 -->
-<?xml version="1.0" encoding="utf-8"?>
-<html class="popupwin" xmlns="http://www.w3.org/1999/xhtml">
 <head>
        <title>Spell Checker</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <script type="text/javascript" src="../spell-check-ui.js"></script>
        <script type="text/javascript" src="../../../popups/popup.js"></script>
        <script type="text/javascript">
+               /*<![CDATA[*/
+               <!--
                HTMLArea = window.opener.HTMLArea;
                _editor_CSS = window.opener._editor_CSS;
                __dlg_loadStyle(_editor_CSS);
+               // -->
+               /*]]>*/
        </script>
        <style type="text/css">
+               /*<![CDATA[*/
+               <!--
                iframe { background-color: #fff; color: #000; height: 100%; width: 100%; }
                .controls { width: 14em; }
-               .controls .sectitle { /* background-color: #736c6c; color: #fff;
-               border-top: 1px solid #000; border-bottom: 1px solid #fff; */
-               text-align: center; font-weight: bold; padding: 2px 4px; }
+               .controls .sectitle { text-align: center; font-weight: bold; padding: 2px 4px; }
                .controls .secbody { margin-bottom: 10px; }
                #v_currentWord { color: #f00; font-weight: bold; }
                #statusbar { padding: 7px 0px 0px 5px; }
                #status { font-weight: bold; }
+               -->
+               /*]]>*/
        </style>
 </head>
 <body class="popupwin" onload="initDocument();">
index fd6d9ec..f682b87 100644 (file)
@@ -418,17 +418,20 @@ function finishedSpellChecking() {
                for (var i = select.length; --i >= 0;) {
                        select.remove(i);
                }
+               var selectedOptionIndex = 0;
                for (var i = 0; i < dicts.length; ++i) {
                        var txt = dicts[i];
                        var option = document.createElement("option");
                        if (/^@(.*)$/.test(txt)) {
                                txt = RegExp.$1;
-                               option.selected = true;
+                               selectedOptionIndex = i;
+                               if (HTMLArea.is_ie) option.selected = true;
                                document.getElementById("f_dictionary").value = txt;
                        }
                        option.value = txt;
                        option.appendChild(document.createTextNode(txt));
                        select.appendChild(option);
                }
+               select.selectedIndex = selectedOptionIndex;
        }
 };
index f7f12b9..42543b1 100644 (file)
@@ -1,2 +1,2 @@
-TYPO3Browsers=function(editor,args){this.editor=editor;var cfg=this.editor.config;cfg.btnList.InsertImage[1]=this.editor.imgURL("ed_image.gif","TYPO3Browsers");cfg.btnList.CreateLink[1]=this.editor.imgURL("ed_link.gif","TYPO3Browsers");};TYPO3Browsers.I18N=TYPO3Browsers_langArray;TYPO3Browsers._pluginInfo={name:"TYPO3Browsers",version:"1.6",developer:"Stanislas Rolland",developer_url:"http://www.fructifor.ca/",c_owner:"Stanislas Rolland",sponsor:"Fructifor Inc.",sponsor_url:"http://www.fructifor.ca/",license:"GPL"};HTMLArea.prototype.renderPopup_image=function(){var editorNumber=this._editorNumber,backreturn,addParams="?"+conf_RTEtsConfigParams,image=this.getParentElement();this._selectedImage=null;if(image&&image.tagName.toLowerCase()=="img"){addParams="?act=image"+conf_RTEtsConfigParams;this._selectedImage=image;};this._popupDialog("../../mod1/popup.php"+addParams+"&editorNo="+editorNumber+"&popupname=image&srcpath="+encodeURIComponent(rtePathImageFile),null,backreturn,550,350);return false;};HTMLArea.prototype.renderPopup_insertImage=function(image){this.focusEditor();this.insertHTML(image);this._selectedImage=null;Dialog._modal.close();this.updateToolbar();};HTMLArea.prototype.renderPopup_link=function(){var editorNumber=this._editorNumber,addUrlParams="?"+conf_RTEtsConfigParams,backreturn,sel=this.getParentElement();if(RTEarea[editorNumber]["classesAnchorUrl"]&&!this.classesAnchorSetup){var classesAnchorData=HTMLArea._getScript(0,false,RTEarea[editorNumber]["classesAnchorUrl"]);var editor=this;if(classesAnchorData)eval(classesAnchorData);editor=null;};var el=HTMLArea.getElementObject(sel,"a");if(el!=null&&el.tagName&&el.tagName.toLowerCase()=="a")sel=el;if(sel!=null&&sel.tagName&&sel.tagName.toLowerCase()=="a"){addUrlParams="?curUrl[href]="+encodeURIComponent(sel.getAttribute("href"));addUrlParams+="&curUrl[typo3ContentLanguage]="+RTEarea[editorNumber]["typo3ContentLanguage"];addUrlParams+="&curUrl[typo3ContentCharset]="+RTEarea[editorNumber]["typo3ContentCharset"];if(sel.target)addUrlParams+="&curUrl[target]="+encodeURIComponent(sel.target);if(sel.className)addUrlParams+="&curUrl[class]="+encodeURIComponent(sel.className);if(sel.title)addUrlParams+="&curUrl[title]="+encodeURIComponent(sel.title);addUrlParams+=conf_RTEtsConfigParams;}else if(this.hasSelectedText()){var text=this.getSelectedHTML();if(text&&text!=null){var offset=text.toLowerCase().indexOf("<a");if(offset!=-1){var ATagContent=text.substring(offset+2);offset=ATagContent.toUpperCase().indexOf(">");ATagContent=ATagContent.substring(0,offset);addUrlParams="?curUrl[all]="+encodeURIComponent(ATagContent);addUrlParams+=conf_RTEtsConfigParams;}}};this._popupDialog("../../mod1/popup.php"+addUrlParams+"&editorNo="+editorNumber+"&typo3ContentLanguage="+RTEarea[editorNumber]["typo3ContentLanguage"]+"&typo3ContentCharset="+encodeURIComponent(RTEarea[editorNumber]["typo3ContentCharset"])+"&popupname=link&srcpath="+encodeURIComponent(rtePathLinkFile),null,backreturn,550,350);return false;};HTMLArea.prototype.renderPopup_addLink=function(theLink,cur_target,cur_class,cur_title){var a,sel=null,range=null,node=null,imageNode=null;this.focusEditor();if(!HTMLArea.is_ie){node=this.getParentElement();var el=HTMLArea.getElementObject(node,"a");if(el!=null&&el.tagName&&el.tagName.toLowerCase()=="a")node=el;if(node!=null&&node.tagName&&node.tagName.toLowerCase()=="a")this.selectNode(node);};if(this.classesAnchorSetup){sel=this._getSelection();range=this._createRange(sel);node=this.getParentElement();this.cleanAllLinks(node,range,true);};this._doc.execCommand("CreateLink",false,theLink);sel=this._getSelection();range=this._createRange(sel);node=this.getParentElement();var el=HTMLArea.getElementObject(node,"a");if(el!=null&&el.tagName&&el.tagName.toLowerCase()=="a")node=el;if(node){if(this.classesAnchorSetup&&cur_class){for(var i=this.classesAnchorSetup.length;--i>=0;){var anchorClass=this.classesAnchorSetup[i];if(anchorClass['name']==cur_class&&anchorClass["image"]){imageNode=this._doc.createElement("img");imageNode.src=anchorClass["image"];imageNode.alt=anchorClass["altText"];break;}}};this.setLinkAttributes(node,range,cur_target,cur_class,cur_title,imageNode);};Dialog._modal.close();};HTMLArea.prototype.setLinkAttributes=function(node,range,cur_target,cur_class,cur_title,imageNode){if(node.tagName&&node.tagName.toLowerCase()=="a"){var nodeInRange=false;if(HTMLArea.is_gecko){if(!HTMLArea.is_safari)nodeInRange=range.intersectsNode(node);else nodeInRange=true;}else{var nodeRange=this._doc.body.createTextRange();nodeRange.moveToElementText(node);nodeInRange=range.inRange(nodeRange)||(range.compareEndPoints("StartToStart",nodeRange)==0)||(range.compareEndPoints("EndToEnd",nodeRange)==0);};if(nodeInRange){if(imageNode!=null)node.insertBefore(imageNode.cloneNode(false),node.firstChild);if(cur_target.trim())node.target=cur_target.trim();else node.removeAttribute("target");if(cur_class.trim()){node.className=cur_class.trim();}else{if(HTMLArea.is_gecko)node.removeAttribute('class');else node.removeAttribute('className');};if(cur_title.trim()){node.title=cur_title.trim();}else{node.removeAttribute("title");node.removeAttribute("rtekeep");}}}else{for(var i=node.firstChild;i;i=i.nextSibling){if(i.nodeType==1||i.nodeType==11)this.setLinkAttributes(i,range,cur_target,cur_class,cur_title,imageNode);}}};HTMLArea.prototype.cleanClassesAnchorImages=function(node){var nodeArray=[],splitArray1=[],splitArray2=[];for(var childNode=node.firstChild;childNode;childNode=childNode.nextSibling){if(childNode.tagName&&childNode.tagName.toLowerCase()=="img"){splitArray1=childNode.src.split("/");for(var i=this.classesAnchorSetup.length;--i>=0;){if(this.classesAnchorSetup[i]["image"]){splitArray2=this.classesAnchorSetup[i]["image"].split("/");if(splitArray1[splitArray1.length-1]==splitArray2[splitArray2.length-1]){nodeArray.push(childNode);break;}}}}};for(i=nodeArray.length;--i>=0;){node.removeChild(nodeArray[i]);}};HTMLArea.prototype.cleanAllLinks=function(node,range,keepLinks){if(node.tagName&&node.tagName.toLowerCase()=="a"){var intersection=false;if(HTMLArea.is_gecko){if(!HTMLArea.is_safari)intersection=range.intersectsNode(node);else intersection=true;}else{var nodeRange=this._doc.body.createTextRange();nodeRange.moveToElementText(node);intersection=range.inRange(nodeRange)||((range.compareEndPoints("StartToStart",nodeRange)>0)&&(range.compareEndPoints("StartToEnd",nodeRange)<0))||((range.compareEndPoints("EndToStart",nodeRange)>0)&&(range.compareEndPoints("EndToEnd",nodeRange)<0));};if(intersection){this.cleanClassesAnchorImages(node);if(!keepLinks){while(node.firstChild)node.parentNode.insertBefore(node.firstChild,node);node.parentNode.removeChild(node);}}}else{for(var i=node.firstChild;i;i=i.nextSibling){if(i.nodeType==1||i.nodeType==11)this.cleanAllLinks(i,range,keepLinks);}}};HTMLArea.prototype.renderPopup_unLink=function(){this.focusEditor();if(HTMLArea.is_gecko){sel=this.getParentElement();var el=HTMLArea.getElementObject(sel,"a");if(el!=null&&el.tagName&&el.tagName.toLowerCase()=="a")sel=el;if(sel!=null&&sel.tagName&&sel.tagName.toLowerCase()=="a")this.selectNode(sel);};if(this.classesAnchorSetup){var sel=this._getSelection();var range=this._createRange(sel);var node=this.getParentElement();this.cleanAllLinks(node,range,false);}else{this._doc.execCommand("Unlink",false,"");};if(Dialog._modal)Dialog._modal.close();};HTMLArea.prototype.nonStripBaseURL=function(url){return url;};TYPO3Browsers.prototype.onGenerate=function(){var editor=this.editor;editor._insertImage=editor.renderPopup_image;editor._createLink=editor.renderPopup_link;editor.stripBaseURL=editor.nonStripBaseURL;};
+TYPO3Browsers=function(editor,args){this.editor=editor;var cfg=this.editor.config;cfg.btnList.InsertImage[1]=this.editor.imgURL("ed_image.gif","TYPO3Browsers");cfg.btnList.CreateLink[1]=this.editor.imgURL("ed_link.gif","TYPO3Browsers");};TYPO3Browsers.I18N=TYPO3Browsers_langArray;TYPO3Browsers._pluginInfo={name:"TYPO3Browsers",version:"1.7",developer:"Stanislas Rolland",developer_url:"http://www.fructifor.ca/",c_owner:"Stanislas Rolland",sponsor:"Fructifor Inc.",sponsor_url:"http://www.fructifor.ca/",license:"GPL"};HTMLArea.prototype.renderPopup_image=function(){var editorNumber=this._editorNumber,backreturn,addParams="?"+RTEarea[0]["RTEtsConfigParams"],image=this.getParentElement();this._selectedImage=null;if(image&&image.tagName.toLowerCase()=="img"){addParams="?act=image"+RTEarea[0]["RTEtsConfigParams"];this._selectedImage=image;};this._popupDialog(RTEarea[0]["pathImageModule"]+addParams+"&editorNo="+editorNumber+"&sys_language_content="+RTEarea[editorNumber]["sys_language_content"],null,backreturn,550,350,null,"yes");return false;};HTMLArea.prototype.renderPopup_insertImage=function(image){this.focusEditor();this.insertHTML(image);this._selectedImage=null;Dialog._modal.close();this.updateToolbar();};HTMLArea.prototype.renderPopup_link=function(){var editorNumber=this._editorNumber,addUrlParams="?"+RTEarea[0]["RTEtsConfigParams"],backreturn,sel=this.getParentElement();if(RTEarea[editorNumber]["classesAnchorUrl"]&&!this.classesAnchorSetup){var classesAnchorData=HTMLArea._getScript(0,false,RTEarea[editorNumber]["classesAnchorUrl"]);var editor=this;if(classesAnchorData)eval(classesAnchorData);editor=null;};var el=HTMLArea.getElementObject(sel,"a");if(el!=null&&el.tagName&&el.tagName.toLowerCase()=="a")sel=el;if(sel!=null&&sel.tagName&&sel.tagName.toLowerCase()=="a"){addUrlParams="?curUrl[href]="+encodeURIComponent(sel.getAttribute("href"));addUrlParams+="&curUrl[typo3ContentLanguage]="+RTEarea[editorNumber]["typo3ContentLanguage"];addUrlParams+="&curUrl[typo3ContentCharset]="+RTEarea[editorNumber]["typo3ContentCharset"];if(sel.target)addUrlParams+="&curUrl[target]="+encodeURIComponent(sel.target);if(sel.className)addUrlParams+="&curUrl[class]="+encodeURIComponent(sel.className);if(sel.title)addUrlParams+="&curUrl[title]="+encodeURIComponent(sel.title);addUrlParams+=RTEarea[0]["RTEtsConfigParams"];}else if(this.hasSelectedText()){var text=this.getSelectedHTML();if(text&&text!=null){var offset=text.toLowerCase().indexOf("<a");if(offset!=-1){var ATagContent=text.substring(offset+2);offset=ATagContent.toUpperCase().indexOf(">");ATagContent=ATagContent.substring(0,offset);addUrlParams="?curUrl[all]="+encodeURIComponent(ATagContent);addUrlParams+=RTEarea[0]["RTEtsConfigParams"];}}};this._popupDialog(RTEarea[0]["pathLinkModule"]+addUrlParams+"&editorNo="+editorNumber+"&typo3ContentLanguage="+RTEarea[editorNumber]["typo3ContentLanguage"]+"&typo3ContentCharset="+encodeURIComponent(RTEarea[editorNumber]["typo3ContentCharset"]),null,backreturn,550,350,null,"yes");return false;};HTMLArea.prototype.renderPopup_addLink=function(theLink,cur_target,cur_class,cur_title){var a,sel=null,range=null,node=null,imageNode=null;this.focusEditor();node=this.getParentElement();var el=HTMLArea.getElementObject(node,"a");if(el!=null&&el.tagName&&el.tagName.toLowerCase()=="a")node=el;if(node!=null&&node.tagName&&node.tagName.toLowerCase()=="a")this.selectNode(node);if(this.classesAnchorSetup){sel=this._getSelection();range=this._createRange(sel);this.cleanAllLinks(node,range,true);};this._doc.execCommand("CreateLink",false,theLink);sel=this._getSelection();range=this._createRange(sel);node=this.getParentElement();var el=HTMLArea.getElementObject(node,"a");if(el!=null&&el.tagName&&el.tagName.toLowerCase()=="a")node=el;if(node){if(this.classesAnchorSetup&&cur_class){for(var i=this.classesAnchorSetup.length;--i>=0;){var anchorClass=this.classesAnchorSetup[i];if(anchorClass['name']==cur_class&&anchorClass["image"]){imageNode=this._doc.createElement("img");imageNode.src=anchorClass["image"];imageNode.alt=anchorClass["altText"];break;}}};this.setLinkAttributes(node,range,cur_target,cur_class,cur_title,imageNode);};Dialog._modal.close();this.updateToolbar();};HTMLArea.prototype.setLinkAttributes=function(node,range,cur_target,cur_class,cur_title,imageNode){if(node.tagName&&node.tagName.toLowerCase()=="a"){var nodeInRange=false;if(HTMLArea.is_gecko){if(!HTMLArea.is_safari&&!HTMLArea.is_opera)nodeInRange=range.intersectsNode(node);else nodeInRange=true;}else{if(this._getSelection().type.toLowerCase()=="control"){nodeInRange=true;}else{var nodeRange=this._doc.body.createTextRange();nodeRange.moveToElementText(node);nodeInRange=range.inRange(nodeRange)||(range.compareEndPoints("StartToStart",nodeRange)==0)||(range.compareEndPoints("EndToEnd",nodeRange)==0);}};if(nodeInRange){if(imageNode!=null)node.insertBefore(imageNode.cloneNode(false),node.firstChild);if(cur_target.trim())node.target=cur_target.trim();else node.removeAttribute("target");if(cur_class.trim()){node.className=cur_class.trim();}else{if(HTMLArea.is_gecko)node.removeAttribute('class');else node.removeAttribute('className');};if(cur_title.trim()){node.title=cur_title.trim();}else{node.removeAttribute("title");node.removeAttribute("rtekeep");}}}else{for(var i=node.firstChild;i;i=i.nextSibling){if(i.nodeType==1||i.nodeType==11)this.setLinkAttributes(i,range,cur_target,cur_class,cur_title,imageNode);}}};HTMLArea.prototype.cleanClassesAnchorImages=function(node){var nodeArray=[],splitArray1=[],splitArray2=[];for(var childNode=node.firstChild;childNode;childNode=childNode.nextSibling){if(childNode.tagName&&childNode.tagName.toLowerCase()=="img"){splitArray1=childNode.src.split("/");for(var i=this.classesAnchorSetup.length;--i>=0;){if(this.classesAnchorSetup[i]["image"]){splitArray2=this.classesAnchorSetup[i]["image"].split("/");if(splitArray1[splitArray1.length-1]==splitArray2[splitArray2.length-1]){nodeArray.push(childNode);break;}}}}};for(i=nodeArray.length;--i>=0;){node.removeChild(nodeArray[i]);}};HTMLArea.prototype.cleanAllLinks=function(node,range,keepLinks){if(node.tagName&&node.tagName.toLowerCase()=="a"){var intersection=false;if(HTMLArea.is_gecko){if(!HTMLArea.is_safari&&!HTMLArea.is_opera)intersection=range.intersectsNode(node);else intersection=true;}else{if(this._getSelection().type.toLowerCase()=="control"){intersection=true;}else{var nodeRange=this._doc.body.createTextRange();nodeRange.moveToElementText(node);intersection=range.inRange(nodeRange)||((range.compareEndPoints("StartToStart",nodeRange)>0)&&(range.compareEndPoints("StartToEnd",nodeRange)<0))||((range.compareEndPoints("EndToStart",nodeRange)>0)&&(range.compareEndPoints("EndToEnd",nodeRange)<0));}};if(intersection){this.cleanClassesAnchorImages(node);if(!keepLinks){while(node.firstChild)node.parentNode.insertBefore(node.firstChild,node);node.parentNode.removeChild(node);}}}else{for(var i=node.firstChild;i;i=i.nextSibling){if(i.nodeType==1||i.nodeType==11)this.cleanAllLinks(i,range,keepLinks);}}};HTMLArea.prototype.renderPopup_unLink=function(){this.focusEditor();var node=this.getParentElement();var el=HTMLArea.getElementObject(node,"a");if(el!=null&&el.tagName&&el.tagName.toLowerCase()=="a")node=el;if(node!=null&&node.tagName&&node.tagName.toLowerCase()=="a")this.selectNode(node);if(this.classesAnchorSetup){var sel=this._getSelection();var range=this._createRange(sel);if(HTMLArea.is_gecko){this.cleanAllLinks(node,range,false);}else{this.cleanAllLinks(node,range,true);this._doc.execCommand("Unlink",false,"");}}else{this._doc.execCommand("Unlink",false,"");};if(Dialog._modal)Dialog._modal.close();};HTMLArea.prototype.nonStripBaseURL=function(url){return url;};TYPO3Browsers.prototype.onGenerate=function(){var editor=this.editor;editor._insertImage=editor.renderPopup_image;editor._createLink=editor.renderPopup_link;editor.stripBaseURL=editor.nonStripBaseURL;};
 
index d853983..5d2fa9a 100644 (file)
@@ -40,7 +40,7 @@ TYPO3Browsers.I18N = TYPO3Browsers_langArray;
 
 TYPO3Browsers._pluginInfo = {
        name            : "TYPO3Browsers",
-       version         : "1.6",
+       version         : "1.7",
        developer       : "Stanislas Rolland",
        developer_url   : "http://www.fructifor.ca/",
        c_owner         : "Stanislas Rolland",
@@ -55,16 +55,16 @@ TYPO3Browsers._pluginInfo = {
 HTMLArea.prototype.renderPopup_image = function() {
        var editorNumber = this._editorNumber,
                backreturn,
-               addParams = "?" + conf_RTEtsConfigParams,
+               addParams = "?" + RTEarea[0]["RTEtsConfigParams"],
                image = this.getParentElement();
-
+               
        this._selectedImage = null;
        if (image && image.tagName.toLowerCase() == "img") {
-               addParams = "?act=image" + conf_RTEtsConfigParams;
+               addParams = "?act=image" + RTEarea[0]["RTEtsConfigParams"];
                this._selectedImage = image;
        }
-
-       this._popupDialog("../../mod1/popup.php" + addParams + "&editorNo=" + editorNumber + "&popupname=image&srcpath="+encodeURIComponent(rtePathImageFile), null, backreturn, 550, 350);     
+       
+       this._popupDialog(RTEarea[0]["pathImageModule"] + addParams + "&editorNo=" + editorNumber + "&sys_language_content=" + RTEarea[editorNumber]["sys_language_content"], null, backreturn, 550, 350, null, "yes");
        return false;
 };
 
@@ -85,7 +85,7 @@ HTMLArea.prototype.renderPopup_insertImage = function(image) {
  */
 HTMLArea.prototype.renderPopup_link = function() {
        var editorNumber = this._editorNumber,
-               addUrlParams = "?" + conf_RTEtsConfigParams,
+               addUrlParams = "?" + RTEarea[0]["RTEtsConfigParams"],
                backreturn,
                sel = this.getParentElement();
 
@@ -106,7 +106,7 @@ HTMLArea.prototype.renderPopup_link = function() {
                if (sel.target) addUrlParams += "&curUrl[target]=" + encodeURIComponent(sel.target);
                if (sel.className) addUrlParams += "&curUrl[class]=" + encodeURIComponent(sel.className);
                if (sel.title) addUrlParams += "&curUrl[title]=" + encodeURIComponent(sel.title);
-               addUrlParams += conf_RTEtsConfigParams;
+               addUrlParams += RTEarea[0]["RTEtsConfigParams"];
        } else if (this.hasSelectedText()) {
                var text = this.getSelectedHTML();
                if (text && text != null) {
@@ -116,11 +116,11 @@ HTMLArea.prototype.renderPopup_link = function() {
                                offset = ATagContent.toUpperCase().indexOf(">");
                                ATagContent = ATagContent.substring(0,offset);
                                addUrlParams = "?curUrl[all]=" + encodeURIComponent(ATagContent);
-                               addUrlParams +=  conf_RTEtsConfigParams;
+                               addUrlParams += RTEarea[0]["RTEtsConfigParams"];
                        }
                }
        }
-       this._popupDialog("../../mod1/popup.php" + addUrlParams + "&editorNo=" + editorNumber + "&typo3ContentLanguage=" + RTEarea[editorNumber]["typo3ContentLanguage"] + "&typo3ContentCharset=" + encodeURIComponent(RTEarea[editorNumber]["typo3ContentCharset"]) + "&popupname=link&srcpath=" + encodeURIComponent(rtePathLinkFile), null, backreturn, 550, 350);
+       this._popupDialog(RTEarea[0]["pathLinkModule"] + addUrlParams + "&editorNo=" + editorNumber + "&typo3ContentLanguage=" + RTEarea[editorNumber]["typo3ContentLanguage"] + "&typo3ContentCharset=" + encodeURIComponent(RTEarea[editorNumber]["typo3ContentCharset"]), null, backreturn, 550, 350, null, "yes");
        return false;
 };
 
@@ -131,18 +131,14 @@ HTMLArea.prototype.renderPopup_link = function() {
 HTMLArea.prototype.renderPopup_addLink = function(theLink,cur_target,cur_class,cur_title) {
        var a, sel = null, range = null, node = null, imageNode = null;
        this.focusEditor();
-       
-       if(!HTMLArea.is_ie) {
-               node = this.getParentElement();
-               var el = HTMLArea.getElementObject(node,"a");
-               if (el != null && el.tagName && el.tagName.toLowerCase() == "a") node = el;
-               if (node != null && node.tagName && node.tagName.toLowerCase() == "a") this.selectNode(node);
-       }
+       node = this.getParentElement();
+       var el = HTMLArea.getElementObject(node,"a");
+       if (el != null && el.tagName && el.tagName.toLowerCase() == "a") node = el;
+       if (node != null && node.tagName && node.tagName.toLowerCase() == "a") this.selectNode(node);
                // Clean images from existing anchors otherwise Mozilla may create nested anchors
        if (this.classesAnchorSetup) {
                sel = this._getSelection();
                range = this._createRange(sel);
-               node = this.getParentElement();
                this.cleanAllLinks(node, range, true);
        }
        
@@ -168,7 +164,9 @@ HTMLArea.prototype.renderPopup_addLink = function(theLink,cur_target,cur_class,c
                        // We may have created multiple links in as many blocks
                this.setLinkAttributes(node, range, cur_target, cur_class, cur_title, imageNode);
        }
+       
        Dialog._modal.close();
+       this.updateToolbar();
 };
 
 /*
@@ -177,13 +175,18 @@ HTMLArea.prototype.renderPopup_addLink = function(theLink,cur_target,cur_class,c
 HTMLArea.prototype.setLinkAttributes = function(node,range,cur_target,cur_class,cur_title,imageNode) {
        if (node.tagName && node.tagName.toLowerCase() == "a") {
                var nodeInRange = false;
-               if(HTMLArea.is_gecko) {
-                       if(!HTMLArea.is_safari) nodeInRange = range.intersectsNode(node);
+               if (HTMLArea.is_gecko) {
+                       if(!HTMLArea.is_safari && !HTMLArea.is_opera) nodeInRange = range.intersectsNode(node);
                                else nodeInRange = true;
                } else {
-                       var nodeRange = this._doc.body.createTextRange();
-                       nodeRange.moveToElementText(node);
-                       nodeInRange = range.inRange(nodeRange) || (range.compareEndPoints("StartToStart", nodeRange) == 0) || (range.compareEndPoints("EndToEnd", nodeRange) == 0);
+                       if (this._getSelection().type.toLowerCase() == "control") {
+                                       // we assume an image is selected
+                               nodeInRange = true;
+                       } else {
+                               var nodeRange = this._doc.body.createTextRange();
+                               nodeRange.moveToElementText(node);
+                               nodeInRange = range.inRange(nodeRange) || (range.compareEndPoints("StartToStart", nodeRange) == 0) || (range.compareEndPoints("EndToEnd", nodeRange) == 0);
+                       }
                }
                if (nodeInRange) {
                        if (imageNode != null) node.insertBefore(imageNode.cloneNode(false), node.firstChild);
@@ -239,21 +242,26 @@ HTMLArea.prototype.cleanClassesAnchorImages = function(node) {
  HTMLArea.prototype.cleanAllLinks = function(node,range,keepLinks) {
        if (node.tagName && node.tagName.toLowerCase() == "a") {
                var intersection = false;
-               if(HTMLArea.is_gecko) {
-                       if(!HTMLArea.is_safari) intersection = range.intersectsNode(node);
+               if (HTMLArea.is_gecko) {
+                       if (!HTMLArea.is_safari && !HTMLArea.is_opera) intersection = range.intersectsNode(node);
                                else intersection = true;
+               } else {
+                       if (this._getSelection().type.toLowerCase() == "control") {
+                                       // we assume an image is selected
+                               intersection = true;
                        } else {
                                var nodeRange = this._doc.body.createTextRange();
                                nodeRange.moveToElementText(node);
                                intersection = range.inRange(nodeRange) || ((range.compareEndPoints("StartToStart", nodeRange) > 0) && (range.compareEndPoints("StartToEnd", nodeRange) < 0)) || ((range.compareEndPoints("EndToStart", nodeRange) > 0) && (range.compareEndPoints("EndToEnd", nodeRange) < 0));
                        }
-                       if (intersection) {
-                               this.cleanClassesAnchorImages(node);
-                               if(!keepLinks) {
-                                       while(node.firstChild) node.parentNode.insertBefore(node.firstChild, node);
-                                       node.parentNode.removeChild(node);
-                               }
+               }
+               if (intersection) {
+                       this.cleanClassesAnchorImages(node);
+                       if (!keepLinks) {
+                               while(node.firstChild) node.parentNode.insertBefore(node.firstChild, node);
+                               node.parentNode.removeChild(node);
                        }
+               }
        } else {
                for (var i = node.firstChild;i;i = i.nextSibling) {
                        if (i.nodeType == 1 || i.nodeType == 11) this.cleanAllLinks(i, range, keepLinks);
@@ -267,17 +275,20 @@ HTMLArea.prototype.cleanClassesAnchorImages = function(node) {
  */
 HTMLArea.prototype.renderPopup_unLink = function() {
        this.focusEditor();
-       if(HTMLArea.is_gecko) {
-               sel = this.getParentElement();
-               var el = HTMLArea.getElementObject(sel,"a");
-               if (el != null && el.tagName && el.tagName.toLowerCase() == "a") sel = el;
-               if (sel != null && sel.tagName && sel.tagName.toLowerCase() == "a") this.selectNode(sel);
-       }
-       if(this.classesAnchorSetup) {
+       var node = this.getParentElement();
+       var el = HTMLArea.getElementObject(node,"a");
+       if (el != null && el.tagName && el.tagName.toLowerCase() == "a") node = el;
+       if (node != null && node.tagName && node.tagName.toLowerCase() == "a") this.selectNode(node);
+       if (this.classesAnchorSetup) {
                var sel = this._getSelection();
                var range = this._createRange(sel);
-               var node = this.getParentElement();
-               this.cleanAllLinks(node, range, false);
+               if (HTMLArea.is_gecko) {
+                       this.cleanAllLinks(node, range, false);
+               } else {
+                       this.cleanAllLinks(node, range, true);
+                       this._doc.execCommand("Unlink", false, "");
+               }
+                       
        } else {
                this._doc.execCommand("Unlink", false, "");
        }
index 5a985a9..f034dfa 100644 (file)
@@ -1,2 +1,2 @@
-TYPO3HtmlParser=function(editor){this.editor=editor;var cfg=editor.config;};TYPO3HtmlParser.I18N=TYPO3HtmlParser_langArray;TYPO3HtmlParser._pluginInfo={name:"TYPO3HtmlParser",version:"1.5",developer:"Stanislas Rolland",developer_url:"http://www.fructifor.ca/",c_owner:"Stanislas Rolland",sponsor:"Fructifor Inc.",sponsor_url:"http://www.fructifor.ca/",license:"GPL"};HTMLArea._wordClean=function(editor,body){var url=rtePathParseHtmlFile;var addParams=conf_RTEtsConfigParams;HTMLArea._postback(url,{'editorNo':editor._editorNumber,'content':body.innerHTML},function(javascriptResponse){editor.setHTML(javascriptResponse)},addParams,RTEarea[editor._editorNumber]["typo3ContentCharset"]);return true;};
+TYPO3HtmlParser=function(editor){this.editor=editor;var cfg=editor.config;};TYPO3HtmlParser.I18N=TYPO3HtmlParser_langArray;TYPO3HtmlParser._pluginInfo={name:"TYPO3HtmlParser",version:"1.6",developer:"Stanislas Rolland",developer_url:"http://www.fructifor.ca/",c_owner:"Stanislas Rolland",sponsor:"Fructifor Inc.",sponsor_url:"http://www.fructifor.ca/",license:"GPL"};HTMLArea._wordClean=function(editor,body){var url=RTEarea[0]["pathParseHtmlModule"];var addParams=RTEarea[0]["RTEtsConfigParams"];HTMLArea._postback(url,{'editorNo':editor._editorNumber,'content':body.innerHTML},function(javascriptResponse){editor.setHTML(javascriptResponse)},addParams,RTEarea[editor._editorNumber]["typo3ContentCharset"]);return true;};
 
index 3fc73bb..98451af 100644 (file)
@@ -38,7 +38,7 @@ TYPO3HtmlParser.I18N = TYPO3HtmlParser_langArray;
 
 TYPO3HtmlParser._pluginInfo = {
        name            : "TYPO3HtmlParser",
-       version         : "1.5",
+       version         : "1.6",
        developer       : "Stanislas Rolland",
        developer_url   : "http://www.fructifor.ca/",
        c_owner         : "Stanislas Rolland",
@@ -48,8 +48,8 @@ TYPO3HtmlParser._pluginInfo = {
 };
 
 HTMLArea._wordClean = function(editor, body) {
-       var url = rtePathParseHtmlFile;
-       var addParams = conf_RTEtsConfigParams;
+       var url = RTEarea[0]["pathParseHtmlModule"];
+       var addParams = RTEarea[0]["RTEtsConfigParams"];
        HTMLArea._postback(url, {'editorNo' : editor._editorNumber, 'content' : body.innerHTML },
                function(javascriptResponse) { editor.setHTML(javascriptResponse) }, addParams, RTEarea[editor._editorNumber]["typo3ContentCharset"]);
        return true;
index a232c58..31d31b5 100644 (file)
@@ -1,2 +1,2 @@
-TableOperations=function(editor){this.editor=editor;var cfg=editor.config;var bl=TableOperations.btnList;var actionHandlerFunctRef=TableOperations.actionHandler(this);var hideInToolbar=cfg.hideTableOperationsInToolbar;var hideToggleBorders=hideInToolbar&&!cfg.keepToggleBordersInToolbar;for(var i=0;i<bl.length;++i){var btn=bl[i];var id="TO-"+btn[0];cfg.registerButton(id,TableOperations_langArray[id],editor.imgURL(btn[0]+".gif","TableOperations"),false,actionHandlerFunctRef,btn[1],((id=="TO-toggle-borders")?hideToggleBorders:hideInToolbar));}};TableOperations.actionHandler=function(instance){return(function(editor,id){instance.buttonPress(editor,id);});};TableOperations.I18N=TableOperations_langArray;TableOperations._pluginInfo={name:"TableOperations",version:"3.6",developer:"Mihai Bazon & Stanislas Rolland",developer_url:"http://www.fructifor.ca/",c_owner:"Mihai Bazon & Stanislas Rolland",sponsor:"Zapatec Inc. & Fructifor Inc.",sponsor_url:"http://www.fructifor.ca/",license:"GPL"};TableOperations.btnList=[["toggle-borders",null],["table-prop","table"],["row-prop","tr"],["row-insert-above","tr"],["row-insert-under","tr"],["row-delete","tr"],["row-split","td,th[rowSpan!=1]"],["col-insert-before","td,th"],["col-insert-after","td,th"],["col-delete","td,th"],["col-split","td,th[colSpan!=1]"],["cell-prop","td,th"],["cell-insert-before","td,th"],["cell-insert-after","td,th"],["cell-delete","td,th"],["cell-merge","tr"],["cell-split","td,th[colSpan!=1,rowSpan!=1]"]];TableOperations.prototype.getClosest=function(tagName){var editor=this.editor;var ancestors=editor.getAllAncestors();var ret=null;tagName=(""+tagName).toLowerCase();for(var i=0;i<ancestors.length;++i){var el=ancestors[i];if(el.tagName.toLowerCase()==tagName){ret=el;break;}};return ret;};TableOperations.prototype.dialogTableProperties=function(){var table=this.getClosest("table");var tablePropertiesInitFunctRef=TableOperations.tablePropertiesInit(table);var tablePropertiesUpdateFunctRef=TableOperations.tablePropertiesUpdate(table);var dialog=new PopupWin(this.editor,TableOperations.I18N["Table Properties"],tablePropertiesUpdateFunctRef,tablePropertiesInitFunctRef,570,600);};TableOperations.tablePropertiesInit=function(table){return(function(dialog){var doc=dialog.doc;var content=dialog.content;var i18n=TableOperations.I18N;TableOperations.buildTitle(doc,i18n,content,"Table Properties");TableOperations.buildDescriptionFieldset(doc,table,i18n,content);var obj=dialog.editor.config.customSelects["DynamicCSS-class"];if(obj&&obj.loaded)TableOperations.buildStylingFieldset(doc,table,i18n,content,obj.cssArray);if(!dialog.editor.config.disableLayoutFieldsetInTableOperations)TableOperations.buildLayoutFieldset(doc,table,i18n,content);if(!dialog.editor.config.disableAlignmentFieldsetInTableOperations)TableOperations.buildAlignmentFieldset(doc,table,i18n,content,(HTMLArea.is_opera?"":"floating"));if(!dialog.editor.config.disableSpacingFieldsetInTableOperations)TableOperations.buildSpacingFieldset(doc,table,i18n,content);if(!dialog.editor.config.disableBordersFieldsetInTableOperations)TableOperations.buildBordersFieldset(dialog.dialogWindow,doc,dialog.editor,table,i18n,content);if(!dialog.editor.config.disableColorFieldsetInTableOperations)TableOperations.buildColorsFieldset(dialog.dialogWindow,doc,dialog.editor,table,i18n,content);dialog.modal=true;dialog.addButtons("ok","cancel");dialog.showAtElement();});};TableOperations.tablePropertiesUpdate=function(table){return(function(dialog,params){dialog.editor.focusEditor();TableOperations.processStyle(params,table);table.removeAttribute("border");for(var i in params){var val=params[i];switch(i){case "f_caption":if(/\S/.test(val)){var caption=table.getElementsByTagName("caption")[0];if(!caption){caption=dialog.editor._doc.createElement("caption");table.insertBefore(caption,table.firstChild);}caption.innerHTML=val;}else{var caption=table.getElementsByTagName("caption")[0];if(caption)caption.parentNode.removeChild(caption);};break;case "f_summary":table.summary=val;break;case "f_width":table.style.width=(""+val)+params.f_unit;break;case "f_align":table.align=val;break;case "f_spacing":table.cellSpacing=val;break;case "f_padding":table.cellPadding=val;break;case "f_frames":table.frame=(val!="not set")?val:"";break;case "f_rules":if(val!="not set")table.rules=val;else table.removeAttribute("rules");break;case "f_class":case "f_class_tbody":case "f_class_thead":case "f_class_tfoot":var tpart=table;if(i.length>7)tpart=table.getElementsByTagName(i.substring(8,13))[0];var cls=tpart.className.trim().split(" ");for(var j=cls.length;j>0;){if(!HTMLArea.reservedClassNames.test(cls[--j]))HTMLArea._removeClass(tpart,cls[j]);};if(val!='none')HTMLArea._addClass(tpart,val);break;}};dialog.editor.focusEditor();dialog.editor.updateToolbar();});};TableOperations.prototype.dialogRowCellProperties=function(cell){if(cell){var element=this.getClosest("td");if(!element)var element=this.getClosest("th");}else{var element=this.getClosest("tr");};if(element){var rowCellPropertiesInitFunctRef=TableOperations.rowCellPropertiesInit(element,cell);var rowCellPropertiesUpdateFunctRef=TableOperations.rowCellPropertiesUpdate(element);var dialog=new PopupWin(this.editor,TableOperations.I18N[cell?"Cell Properties":"Row Properties"],rowCellPropertiesUpdateFunctRef,rowCellPropertiesInitFunctRef,700,425);}};TableOperations.rowCellPropertiesInit=function(element,cell){return(function(dialog){var doc=dialog.doc;var content=dialog.content;var i18n=TableOperations.I18N;TableOperations.buildTitle(doc,i18n,content,(cell?"Cell Properties":"Row Properties"));if(cell)TableOperations.buildCellTypeFieldset(dialog.dialogWindow,doc,dialog.editor,element,i18n,content);else TableOperations.buildRowGroupFieldset(dialog.dialogWindow,doc,dialog.editor,element,i18n,content);var obj=dialog.editor.config.customSelects["DynamicCSS-class"];if(obj&&obj.loaded)TableOperations.buildStylingFieldset(doc,element,i18n,content,obj.cssArray);else TableOperations.insertSpace(doc,content);if(!dialog.editor.config.disableLayoutFieldsetInTableOperations)TableOperations.buildLayoutFieldset(doc,element,i18n,content,"floating");if(!dialog.editor.config.disableAlignmentFieldsetInTableOperations)TableOperations.buildAlignmentFieldset(doc,element,i18n,content);if(!dialog.editor.config.disableBordersFieldsetInTableOperations)TableOperations.buildBordersFieldset(dialog.dialogWindow,doc,dialog.editor,element,i18n,content);if(!dialog.editor.config.disableColorFieldsetInTableOperations)TableOperations.buildColorsFieldset(dialog.dialogWindow,doc,dialog.editor,element,i18n,content);dialog.modal=true;dialog.addButtons("ok","cancel");dialog.showAtElement();});};TableOperations.rowCellPropertiesUpdate=function(element){return(function(dialog,params){dialog.editor.focusEditor();TableOperations.processStyle(params,element);var convertCellType=false;for(var i in params){var val=params[i];switch(i){case "f_scope":if(val!="not set")element.scope=val;else element.removeAttribute('scope');break;case "f_cell_type":if(val!=element.tagName.toLowerCase()){var newCellType=val;convertCellType=true;};break;case "f_rowgroup":var section=element.parentNode;var tagName=section.tagName.toLowerCase();if(val!=tagName){var table=section.parentNode;var newSection=table.getElementsByTagName(val)[0];if(!newSection)var newSection=table.insertBefore(dialog.editor._doc.createElement(val),table.getElementsByTagName("tbody")[0]);if(tagName=="thead"&&val=="tbody")var newElement=newSection.insertBefore(element,newSection.firstChild);else var newElement=newSection.appendChild(element);if(!section.hasChildNodes())table.removeChild(section);};break;case "f_char":element.ch=val;break;case "f_class":var cls=element.className.trim().split(" ");for(var j=cls.length;j>0;){if(!HTMLArea.reservedClassNames.test(cls[--j]))HTMLArea._removeClass(element,cls[j]);};if(val!='none')HTMLArea._addClass(element,val);break;}};if(convertCellType){var newCell=dialog.editor._doc.createElement(newCellType),p=element.parentNode,a,attrName,name;var attrs=element.attributes;for(var i=attrs.length;--i>=0;){a=attrs.item(i);attrName=a.nodeName;name=attrName.toLowerCase();if(typeof(element[attrName])!="undefined"&&name!="style"&&!/^on/.test(name)){if(element[attrName])newCell.setAttribute(attrName,element[attrName]);}else{if(a.nodeValue)newCell.setAttribute(attrName,a.nodeValue);}};if(HTMLArea.is_ie){if(element.style.cssText)newCell.style.cssText=element.style.cssText;if(element.className){newCell.setAttribute("className",element.className);}else{newCell.className=element.className;newCell.removeAttribute("className");}};while(element.firstChild)newCell.appendChild(element.firstChild);p.insertBefore(newCell,element);p.removeChild(element);dialog.editor.selectNodeContents(newCell,false);};dialog.editor.updateToolbar();});};TableOperations.prototype.buttonPress=function(editor,button_id){this.editor=editor;var mozbr=HTMLArea.is_gecko?"<br />":"";var tableParts=["tfoot","thead","tbody"];var tablePartsIndex={tfoot:0,thead:1,tbody:2};function clearRow(tr){var tds=tr.getElementsByTagName("td");for(var i=tds.length;--i>=0;){var td=tds[i];td.rowSpan=1;td.innerHTML=mozbr;};var tds=tr.getElementsByTagName("th");for(var i=tds.length;--i>=0;){var td=tds[i];td.rowSpan=1;td.innerHTML=mozbr;}};function splitRow(td){var n=parseInt(""+td.rowSpan);var colSpan=td.colSpan;var tagName=td.tagName.toLowerCase();td.rowSpan=1;var tr=td.parentNode;var sectionRowIndex=tr.sectionRowIndex;var rows=tr.parentNode.rows;var index=td.cellIndex;while(--n>0){tr=rows[++sectionRowIndex];if(!tr)tr=td.parentNode.parentNode.appendChild(editor._doc.createElement("tr"));var otd=editor._doc.createElement(tagName);otd.colSpan=colSpan;otd.innerHTML=mozbr;tr.insertBefore(otd,tr.cells[index]);}};function splitCol(td){var nc=parseInt(""+td.colSpan);var tagName=td.tagName.toLowerCase();td.colSpan=1;var tr=td.parentNode;var ref=td.nextSibling;while(--nc>0){var otd=editor._doc.createElement(tagName);otd.rowSpan=td.rowSpan;otd.innerHTML=mozbr;tr.insertBefore(otd,ref);}};function splitCell(td){var nc=parseInt(""+td.colSpan);splitCol(td);var cells=td.parentNode.cells;var index=td.cellIndex;while(nc-->0){splitRow(cells[index++]);}};function selectNextNode(el){var node=el.nextSibling;while(node&&node.nodeType!=1){node=node.nextSibling;};if(!node){node=el.previousSibling;while(node&&node.nodeType!=1){node=node.previousSibling;}};if(!node)node=el.parentNode;editor.selectNodeContents(node);};function getSelectedCells(sel){var cell,range,i=0,cells=[];try{while(range=sel.getRangeAt(i++)){cell=range.startContainer.childNodes[range.startOffset];while(!/^(td|th|body)$/.test(cell.tagName.toLowerCase()))cell=cell.parentNode;if(/^(td|th)$/.test(cell.tagName.toLowerCase()))cells.push(cell);}}catch(e){};return cells;};function deleteEmptyTable(table){var lastPart=true;for(var j=tableParts.length;--j>=0;){var tablePart=table.getElementsByTagName(tableParts[j])[0];if(tablePart)lastPart=false;};if(lastPart){selectNextNode(table);table.parentNode.removeChild(table);}};switch(button_id){case "TO-row-insert-above":case "TO-row-insert-under":var tr=this.getClosest("tr");if(!tr)break;var otr=tr.cloneNode(true);clearRow(otr);tr.parentNode.insertBefore(otr,(/under/.test(button_id)?tr.nextSibling:tr));editor.forceRedraw();editor.focusEditor();break;case "TO-row-delete":var tr=this.getClosest("tr");if(!tr)break;var part=tr.parentNode;var table=part.parentNode;if(part.rows.length==1){selectNextNode(part);table.removeChild(part);deleteEmptyTable(table);}else{selectNextNode(tr);part.removeChild(tr);}editor.forceRedraw();editor.focusEditor();editor.updateToolbar();break;case "TO-row-split":var cell=this.getClosest("td");if(!cell)var cell=this.getClosest("th");if(!cell)break;var sel=editor._getSelection();if(HTMLArea.is_gecko&&!sel.isCollapsed&&!HTMLArea.is_safari&&!HTMLArea.is_opera){var cells=getSelectedCells(sel);for(i=0;i<cells.length;++i)splitRow(cells[i]);}else{splitRow(cell);}editor.forceRedraw();editor.updateToolbar();break;case "TO-col-insert-before":case "TO-col-insert-after":var cell=this.getClosest("td");if(!cell)var cell=this.getClosest("th");if(!cell)break;var index=cell.cellIndex;var table=cell.parentNode.parentNode.parentNode;for(var j=tableParts.length;--j>=0;){var tablePart=table.getElementsByTagName(tableParts[j])[0];if(tablePart){var rows=tablePart.rows;for(var i=rows.length;--i>=0;){var tr=rows[i];var ref=tr.cells[index+(/after/.test(button_id)?1:0)];if(!ref){var otd=editor._doc.createElement(tr.lastChild.tagName.toLowerCase());otd.innerHTML=mozbr;tr.appendChild(otd);}else{var otd=editor._doc.createElement(ref.tagName.toLowerCase());otd.innerHTML=mozbr;tr.insertBefore(otd,ref);}}}}editor.focusEditor();break;case "TO-col-split":var cell=this.getClosest("td");if(!cell)var cell=this.getClosest("th");if(!cell)break;var sel=editor._getSelection();if(HTMLArea.is_gecko&&!sel.isCollapsed&&!HTMLArea.is_safari&&!HTMLArea.is_opera){var cells=getSelectedCells(sel);for(i=0;i<cells.length;++i)splitCol(cells[i]);}else{splitCol(cell);}editor.forceRedraw();editor.updateToolbar();break;case "TO-col-delete":var cell=this.getClosest("td");if(!cell)var cell=this.getClosest("th");if(!cell)break;var index=cell.cellIndex;var part=cell.parentNode.parentNode;var table=part.parentNode;var lastPart=true;for(var j=tableParts.length;--j>=0;){var tablePart=table.getElementsByTagName(tableParts[j])[0];if(tablePart){var rows=tablePart.rows;var lastColumn=true;for(var i=rows.length;--i>=0;){if(rows[i].cells.length>1)lastColumn=false;};if(lastColumn){selectNextNode(tablePart);table.removeChild(tablePart);}else{if(part==tablePart)selectNextNode(cell);for(var i=rows.length;--i>=0;){if(rows[i].cells[index])rows[i].removeChild(rows[i].cells[index]);};lastPart=false;}}};if(lastPart){selectNextNode(table);table.parentNode.removeChild(table);}editor.forceRedraw();editor.focusEditor();editor.updateToolbar();break;case "TO-cell-split":var cell=this.getClosest("td");if(!cell)var cell=this.getClosest("th");if(!cell)break;var sel=editor._getSelection();if(HTMLArea.is_gecko&&!sel.isCollapsed&&!HTMLArea.is_safari&&!HTMLArea.is_opera){var cells=getSelectedCells(sel);for(i=0;i<cells.length;++i)splitCell(cells[i]);}else{splitCell(cell);}editor.forceRedraw();editor.updateToolbar();break;case "TO-cell-insert-before":case "TO-cell-insert-after":var cell=this.getClosest("td");if(!cell)var cell=this.getClosest("th");if(!cell)break;var tr=cell.parentNode;var otd=editor._doc.createElement(cell.tagName.toLowerCase());otd.innerHTML=mozbr;tr.insertBefore(otd,(/after/.test(button_id)?cell.nextSibling:cell));editor.forceRedraw();editor.focusEditor();break;case "TO-cell-delete":var cell=this.getClosest("td");if(!cell)var cell=this.getClosest("th");if(!cell)break;var row=cell.parentNode;if(row.cells.length==1){var part=row.parentNode;var table=part.parentNode;if(part.rows.length==1){selectNextNode(part);table.removeChild(part);deleteEmptyTable(table);}else{selectNextNode(row);part.removeChild(row);}}else{selectNextNode(cell);row.removeChild(cell);}editor.forceRedraw();editor.focusEditor();editor.updateToolbar();break;case "TO-cell-merge":var sel=editor._getSelection();var range,i=0;var rows=new Array();for(var k=tableParts.length;--k>=0;)rows[k]=[];var row=null;var cells=null;if(HTMLArea.is_gecko&&!HTMLArea.is_safari&&!HTMLArea.is_opera){try{while(range=sel.getRangeAt(i++)){var td=range.startContainer.childNodes[range.startOffset];if(td.parentNode!=row){(cells)&&rows[tablePartsIndex[row.parentNode.tagName.toLowerCase()]].push(cells);row=td.parentNode;cells=[];}cells.push(td);}}catch(e){};rows[tablePartsIndex[row.parentNode.tagName.toLowerCase()]].push(cells);}else{var cell=this.getClosest("td");if(!cell)var cell=this.getClosest("th");if(!cell){alert(TableOperations.I18N["Please click into some cell"]);break;};var tr=cell.parentElement;var no_cols=prompt(TableOperations.I18N["How many columns would you like to merge?"],2);if(!no_cols)break;var no_rows=prompt(TableOperations.I18N["How many rows would you like to merge?"],2);if(!no_rows)break;var cell_index=cell.cellIndex;while(no_rows-->0){td=tr.cells[cell_index];cells=[td];for(var i=1;i<no_cols;++i){td=td.nextSibling;if(!td)break;cells.push(td);};rows[tablePartsIndex[tr.parentNode.tagName.toLowerCase()]].push(cells);tr=tr.nextSibling;if(!tr)break;}};for(var k=tableParts.length;--k>=0;){var cellHTML="";for(var i=0;i<rows[k].length;++i){var cells=rows[k][i];if(!cells)continue;for(var j=0;j<cells.length;++j){var cell=cells[j];cellHTML+=cell.innerHTML;if(i||j){if(cell.parentNode.cells.length==1)cell.parentNode.parentNode.removeChild(cell.parentNode);else cell.parentNode.removeChild(cell);}}};try{var td=rows[k][0][0];td.innerHTML=cellHTML;td.rowSpan=rows[k].length;td.colSpan=rows[k][0].length;editor.selectNodeContents(td);}catch(e){}}editor.forceRedraw();editor.focusEditor();break;case "TO-table-prop":this.dialogTableProperties();break;case "TO-row-prop":this.dialogRowCellProperties(false);break;case "TO-cell-prop":this.dialogRowCellProperties(true);break;case "TO-toggle-borders":var tables=editor._doc.getElementsByTagName("table");if(tables.length!=0){editor.borders=false;for(var ix=0;ix<tables.length;ix++)editor.borders=editor.borders||/htmlarea-showtableborders/.test(tables[ix].className);for(ix=0;ix<tables.length;ix++){if(!editor.borders)HTMLArea._addClass(tables[ix],'htmlarea-showtableborders');else HTMLArea._removeClass(tables[ix],'htmlarea-showtableborders');}};break;default:alert("Button ["+button_id+"] not yet implemented");}};TableOperations.getLength=function(value){var len=parseInt(value);if(isNaN(len))len="";return len;};TableOperations.processStyle=function(params,element){var style=element.style;for(var i in params){var val=params[i];switch(i){case "f_st_backgroundColor":style.backgroundColor=val;break;case "f_st_color":style.color=val;break;case "f_st_backgroundImage":if(/\S/.test(val)){style.backgroundImage="url("+val+")";}else{style.backgroundImage="";};break;case "f_st_borderWidth":if(/\S/.test(val)){style.borderWidth=val+"px";}else{style.borderWidth="";};if(params["f_st_borderStyle"]=="none")style.borderWidth="0px";if(params["f_st_borderStyle"]=="not set")style.borderWidth="";break;case "f_st_borderStyle":style.borderStyle=(val!="not set")?val:"";break;case "f_st_borderColor":style.borderColor=val;break;case "f_st_borderCollapse":style.borderCollapse=val?"collapse":"";break;case "f_st_width":if(/\S/.test(val)){style.width=val+params["f_st_widthUnit"];}else{style.width="";};break;case "f_st_height":if(/\S/.test(val)){style.height=val+params["f_st_heightUnit"];}else{style.height="";};break;case "f_st_textAlign":if(val=="character"){var ch=params["f_st_textAlignChar"];if(ch=='"'){ch='\\"';};style.textAlign='"'+ch+'"';}else{style.textAlign=(val!="not set")?val:"";};break;case "f_st_vertAlign":style.verticalAlign=(val!="not set")?val:"";break;case "f_st_float":if(HTMLArea.is_ie){style.styleFloat=(val!="not set")?val:"";}else{style.cssFloat=(val!="not set")?val:"";};break;}}};TableOperations.createColorButton=function(w,doc,editor,color,name){if(!color){color="";}else if(!/#/.test(color)){color=HTMLArea._colorToRgb(color);};var df=doc.createElement("span");var field=doc.createElement("input");field.type="hidden";df.appendChild(field);field.name="f_st_"+name;field.id="f_st_"+name;field.value=color;var button=doc.createElement("span");button.className="buttonColor";df.appendChild(button);var span=doc.createElement("span");span.className="chooser";span.style.backgroundColor=color;button.appendChild(span);button.onmouseover=function(){if(!this.disabled)this.className+=" buttonColor-hilite";};button.onmouseout=function(){if(!this.disabled)this.className="buttonColor";};span.onclick=function(){if(this.parentNode.disabled)return false;var selectColorPlugin=editor.plugins.SelectColor;if(selectColorPlugin)selectColorPlugin=selectColorPlugin.instance;if(selectColorPlugin){selectColorPlugin.dialogSelectColor("color",span,field,w);}else{editor._popupDialog("select_color.html",function(color){if(color){span.style.backgroundColor="#"+color;field.value="#"+color;}},color,200,182,w);}};var span2=doc.createElement("span");span2.innerHTML="&#x00d7;";span2.className="nocolor";span2.title=TableOperations.I18N["Unset color"];button.appendChild(span2);span2.onmouseover=function(){if(!this.parentNode.disabled)this.className+=" nocolor-hilite";};span2.onmouseout=function(){if(!this.parentNode.disabled)this.className="nocolor";};span2.onclick=function(){span.style.backgroundColor="";field.value="";};return df;};TableOperations.buildTitle=function(doc,i18n,content,title){var div=doc.createElement("div");div.className="title";div.innerHTML=i18n[title];content.appendChild(div);doc.title=i18n[title];};TableOperations.buildDescriptionFieldset=function(doc,el,i18n,content){var fieldset=doc.createElement("fieldset");TableOperations.insertLegend(doc,i18n,fieldset,"Description");TableOperations.insertSpace(doc,fieldset);var f_caption="";var capel=el.getElementsByTagName("caption")[0];if(capel)f_caption=capel.innerHTML;TableOperations.buildInput(doc,el,i18n,fieldset,"f_caption","Caption:","Description of the nature of the table","","",f_caption,"fr","value","");TableOperations.insertSpace(doc,fieldset);TableOperations.buildInput(doc,el,i18n,fieldset,"f_summary","Summary:","Summary of the table purpose and structure","","",el.summary,"fr","value","");TableOperations.insertSpace(doc,fieldset);content.appendChild(fieldset);};TableOperations.buildRowGroupFieldset=function(w,doc,editor,el,i18n,content){var fieldset=doc.createElement("fieldset");TableOperations.insertLegend(doc,i18n,fieldset,"Row group");TableOperations.insertSpace(doc,fieldset);selected=el.parentNode.tagName.toLowerCase();var selectScope=TableOperations.buildSelectField(doc,el,i18n,fieldset,"f_rowgroup","Row group:","fr","","Table section",["Table body","Table header","Table footer"],["tbody","thead","tfoot"],new RegExp((selected?selected:"tbody"),"i"));TableOperations.insertSpace(doc,fieldset);content.appendChild(fieldset);};TableOperations.buildCellTypeFieldset=function(w,doc,editor,el,i18n,content){var fieldset=doc.createElement("fieldset");TableOperations.insertLegend(doc,i18n,fieldset,"Cell Type and Scope");TableOperations.insertSpace(doc,fieldset);var selectType=TableOperations.buildSelectField(doc,el,i18n,fieldset,"f_cell_type","Type of cell","fr","","Specifies the type of cell",["Normal","Header"],["td","th"],new RegExp(el.tagName.toLowerCase(),"i"));selectType.onchange=function(){TableOperations.setStyleOptions(doc,editor,el,i18n,this);};selected=el.scope.toLowerCase();(selected.match(/([^\s]*)\s/))&&(selected=RegExp.$1);var selectScope=TableOperations.buildSelectField(doc,el,i18n,fieldset,"f_scope","Scope","fr","","Scope of header cell",["Not set","scope_row","scope_column","scope_rowgroup"],["not set","row","col","rowgroup"],new RegExp((selected?selected:"not set"),"i"));TableOperations.insertSpace(doc,fieldset);content.appendChild(fieldset);};TableOperations.getCssLabelsClasses=function(cssArray,i18n,tagName,selectedIn){var cssLabels=new Array();var cssClasses=new Array();cssLabels[0]=i18n["Default"];cssClasses[0]="none";var selected=selectedIn;var cls=selected.split(" ");var nonReservedClassName=false;for(var ia=cls.length;ia>0;){if(!HTMLArea.reservedClassNames.test(cls[--ia])){selected=cls[ia];nonReservedClassName=true;break;}};var found=false,i=1,cssClass;if(cssArray[tagName]){for(cssClass in cssArray[tagName]){if(cssClass!="none"){cssLabels[i]=cssArray[tagName][cssClass];cssClasses[i]=cssClass;if(cssClass==selected)found=true;i++;}else{cssLabels[0]=cssArray[tagName][cssClass];}}};if(cssArray['all']){for(cssClass in cssArray['all']){cssLabels[i]=cssArray['all'][cssClass];cssClasses[i]=cssClass;if(cssClass==selected)found=true;i++;}};if(selected&&nonReservedClassName&&!found){cssLabels[i]=i18n["Undefined"];cssClasses[i]=selected;};return[cssLabels,cssClasses,selected];};TableOperations.setStyleOptions=function(doc,editor,el,i18n,typeSelect){var tagName=typeSelect.value;var select=doc.getElementById("f_class");if(!select)return false;var obj=editor.config.customSelects["DynamicCSS-class"];if(obj&&obj.loaded)var cssArray=obj.cssArray;else return false;var cssLabelsClasses=TableOperations.getCssLabelsClasses(cssArray,i18n,tagName,el.className);var options=cssLabelsClasses[0];var values=cssLabelsClasses[1];var selected=cssLabelsClasses[2];var selectedReg=new RegExp((selected?selected:"none"),"i");while(select.options.length>0)select.options[select.length-1]=null;select.selectedIndex=0;var option;for(var i=0;i<options.length;++i){option=doc.createElement("option");select.appendChild(option);option.value=values[i];option.appendChild(doc.createTextNode(options[i]));option.selected=selectedReg.test(values[i]);};if(select.options.length>1)select.disabled=false;else select.disabled=true;};TableOperations.buildStylingFieldset=function(doc,el,i18n,content,cssArray){var tagName=el.tagName.toLowerCase();var table=(tagName=="table");var cssLabelsClasses=TableOperations.getCssLabelsClasses(cssArray,i18n,tagName,el.className);var cssLabels=cssLabelsClasses[0];var cssClasses=cssLabelsClasses[1];var selected=cssLabelsClasses[2];var fieldset=doc.createElement("fieldset");TableOperations.insertLegend(doc,i18n,fieldset,"CSS Style");TableOperations.insertSpace(doc,fieldset);var ul=doc.createElement("ul");ul.className="floating";fieldset.appendChild(ul);var li=doc.createElement("li");ul.appendChild(li);TableOperations.buildSelectField(doc,el,i18n,li,"f_class",(table?"Table class:":"Class:"),"fr","",(table?"Table class selector":"Class selector"),cssLabels,cssClasses,new RegExp((selected?selected:"none"),"i"),"",false);if(table){var tbody=el.getElementsByTagName("tbody")[0];if(tbody){var li=doc.createElement("li");ul.appendChild(li);cssLabelsClasses=TableOperations.getCssLabelsClasses(cssArray,i18n,"tbody",tbody.className);cssLabels=cssLabelsClasses[0];cssClasses=cssLabelsClasses[1];selected=cssLabelsClasses[2];TableOperations.buildSelectField(doc,el,i18n,li,"f_class_tbody","Table body class:","fr","","Table body class selector",cssLabels,cssClasses,new RegExp((selected?selected:"none"),"i"),"",false);};ul=null;var thead=el.getElementsByTagName("thead")[0];if(thead){var ul=doc.createElement("ul");fieldset.appendChild(ul);var li=doc.createElement("li");ul.appendChild(li);cssLabelsClasses=TableOperations.getCssLabelsClasses(cssArray,i18n,"thead",thead.className);cssLabels=cssLabelsClasses[0];cssClasses=cssLabelsClasses[1];selected=cssLabelsClasses[2];TableOperations.buildSelectField(doc,el,i18n,li,"f_class_thead","Table header class:","fr","","Table header class selector",cssLabels,cssClasses,new RegExp((selected?selected:"none"),"i"),"",false);};var tfoot=el.getElementsByTagName("tfoot")[0];if(tfoot){if(!ul){var ul=doc.createElement("ul");fieldset.appendChild(ul);};var li=doc.createElement("li");ul.appendChild(li);cssLabelsClasses=TableOperations.getCssLabelsClasses(cssArray,i18n,"tfoot",tfoot.className);cssLabels=cssLabelsClasses[0];cssClasses=cssLabelsClasses[1];selected=cssLabelsClasses[2];TableOperations.buildSelectField(doc,el,i18n,li,"f_class_tfoot","Table footer class:","fr","","Table footer class selector",cssLabels,cssClasses,new RegExp((selected?selected:"none"),"i"),"",false);}};TableOperations.insertSpace(doc,fieldset);content.appendChild(fieldset);};TableOperations.buildLayoutFieldset=function(doc,el,i18n,content,fieldsetClass){var select,selected;var fieldset=doc.createElement("fieldset");if(fieldsetClass)fieldset.className=fieldsetClass;TableOperations.insertLegend(doc,i18n,fieldset,"Layout");var f_st_width=TableOperations.getLength(el.style.width);var f_st_height=TableOperations.getLength(el.style.height);var selectedWidthUnit=/%/.test(el.style.width)?'%':(/px/.test(el.style.width)?'px':'em');var selectedHeightUnit=/%/.test(el.style.height)?'%':(/px/.test(el.style.height)?'px':'em');var tag=el.tagName.toLowerCase();var ul=doc.createElement("ul");fieldset.appendChild(ul);switch(tag){case "table":var li=doc.createElement("li");ul.appendChild(li);TableOperations.buildInput(doc,el,i18n,li,"f_st_width","Width:","Table width","","5",f_st_width,"fr");select=TableOperations.buildSelectField(doc,el,i18n,li,"f_st_widthUnit","","","","Width unit",["percent","pixels","em"],["%","px","em"],new RegExp((f_st_width?selectedWidthUnit:"%"),"i"));var li=doc.createElement("li");ul.appendChild(li);TableOperations.buildInput(doc,el,i18n,li,"f_st_height","Height:","Table height","","5",f_st_height,"fr");select=TableOperations.buildSelectField(doc,el,i18n,li,"f_st_heightUnit","","","","Height unit",["percent","pixels","em"],["%","px","em"],new RegExp((f_st_height?selectedHeightUnit:"%"),"i"));selected=(HTMLArea._is_ie)?el.style.styleFloat:el.style.cssFloat;select=TableOperations.buildSelectField(doc,el,i18n,li,"f_st_float","Float:","","","Specifies where the table should float",["Not set","Non-floating","Left","Right"],["not set","none","left","right"],new RegExp((selected?selected:"not set"),"i"));break;case "tr":var li=doc.createElement("li");ul.appendChild(li);TableOperations.buildInput(doc,el,i18n,li,"f_st_width","Width:","Row width","","5",f_st_width,"fr");select=TableOperations.buildSelectField(doc,el,i18n,li,"f_st_widthUnit","","","","Width unit",["percent","pixels","em"],["%","px","em"],new RegExp((f_st_width?selectedWidthUnit:"%"),"i"));var li=doc.createElement("li");ul.appendChild(li);TableOperations.buildInput(doc,el,i18n,li,"f_st_height","Height:","Row height","","5",f_st_height,"fr");select=TableOperations.buildSelectField(doc,el,i18n,li,"f_st_heightUnit","","","","Height unit",["percent","pixels","em"],["%","px","em"],new RegExp((f_st_height?selectedHeightUnit:"%"),"i"));break;case "td":case "th":var li=doc.createElement("li");ul.appendChild(li);TableOperations.buildInput(doc,el,i18n,li,"f_st_width","Width:","Cell width","","5",f_st_width,"fr");select=TableOperations.buildSelectField(doc,el,i18n,li,"f_st_widthUnit","","","","Width unit",["percent","pixels","em"],["%","px","em"],new RegExp((f_st_width?selectedWidthUnit:"%"),"i"));var li=doc.createElement("li");ul.appendChild(li);TableOperations.buildInput(doc,el,i18n,li,"f_st_height","Height:","Cell height","","5",f_st_height,"fr");select=TableOperations.buildSelectField(doc,el,i18n,li,"f_st_heightUnit","","","","Height unit",["percent","pixels","em"],["%","px","em"],new RegExp((f_st_height?selectedHeightUnit:"%"),"i"));}content.appendChild(fieldset);};TableOperations.buildAlignmentFieldset=function(doc,el,i18n,content,fieldsetClass){var select;var tag=el.tagName.toLowerCase();var fieldset=doc.createElement("fieldset");if(fieldsetClass)fieldset.className=fieldsetClass;TableOperations.insertLegend(doc,i18n,fieldset,"Alignment");var options=["Not set","Left","Center","Right","Justify"];var values=["not set","left","center","right","justify"];var selected=el.style.textAlign;(selected.match(/([^\s]*)\s/))&&(selected=RegExp.$1);var ul=doc.createElement("ul");fieldset.appendChild(ul);var li=doc.createElement("li");ul.appendChild(li);select=TableOperations.buildSelectField(doc,el,i18n,li,"f_st_textAlign","Text alignment:","fl","","Horizontal alignment of text within cell",options,values,new RegExp((selected?selected:"not set"),"i"));var li=doc.createElement("li");ul.appendChild(li);selected=el.style.verticalAlign;(selected.match(/([^\s]*)\s/))&&(selected=RegExp.$1);select=TableOperations.buildSelectField(doc,el,i18n,li,"f_st_vertAlign","Vertical alignment:","fl","","Vertical alignment of content within cell",["Not set","Top","Middle","Bottom","Baseline"],["not set","top","middle","bottom","baseline"],new RegExp((selected?selected:"not set"),"i"));content.appendChild(fieldset);};TableOperations.buildSpacingFieldset=function(doc,el,i18n,content){var fieldset=doc.createElement("fieldset");TableOperations.insertLegend(doc,i18n,fieldset,"Spacing and padding");var ul=doc.createElement("ul");fieldset.appendChild(ul);var li=doc.createElement("li");ul.appendChild(li);TableOperations.buildInput(doc,el,i18n,li,"f_spacing","Cell spacing:","Space between adjacent cells","pixels","5",el.cellSpacing,"fr","","postlabel");var li=doc.createElement("li");ul.appendChild(li);TableOperations.buildInput(doc,el,i18n,li,"f_padding","Cell padding:","Space between content and border in cell","pixels","5",el.cellPadding,"fr","","postlabel");content.appendChild(fieldset);};TableOperations.buildBordersFieldset=function(w,doc,editor,el,i18n,content,fieldsetClass){var select;var selected;var borderFields=[];function setBorderFieldsVisibility(value){for(var i=0;i<borderFields.length;++i){var borderFieldElement=borderFields[i];borderFieldElement.style.visibility=value?"hidden":"visible";if(!value&&(borderFieldElement.tagName.toLowerCase()=="input")){borderFieldElement.focus();borderFieldElement.select();}}};var fieldset=doc.createElement("fieldset");fieldset.className=fieldsetClass;TableOperations.insertLegend(doc,i18n,fieldset,"Frame and borders");TableOperations.insertSpace(doc,fieldset);selected=el.style.borderStyle;(selected.match(/([^\s]*)\s/))&&(selected=RegExp.$1);selectBorderStyle=TableOperations.buildSelectField(doc,el,i18n,fieldset,"f_st_borderStyle","Border style:","fr","floating","Border style",["Not set","No border","Dotted","Dashed","Solid","Double","Groove","Ridge","Inset","Outset"],["not set","none","dotted","dashed","solid","double","groove","ridge","inset","outset"],new RegExp((selected?selected:"not set"),"i"));selectBorderStyle.onchange=function(){setBorderFieldsVisibility(this.value=="none");};TableOperations.buildInput(doc,el,i18n,fieldset,"f_st_borderWidth","Border width:","Border width","pixels","5",TableOperations.getLength(el.style.borderWidth),"fr","floating","postlabel",borderFields);TableOperations.insertSpace(doc,fieldset,borderFields);if(el.tagName.toLowerCase()=="table"){TableOperations.buildColorField(w,doc,editor,el,i18n,fieldset,"","Color:","fr","colorButton",el.style.borderColor,"borderColor",borderFields);var label=doc.createElement("label");label.className="fl-borderCollapse";label.htmlFor="f_st_borderCollapse";label.innerHTML=i18n["Collapsed borders"];fieldset.appendChild(label);borderFields.push(label);var input=doc.createElement("input");input.className="checkbox";input.type="checkbox";input.name="f_st_borderCollapse";input.id="f_st_borderCollapse";input.defaultChecked=/collapse/i.test(el.style.borderCollapse);input.checked=input.defaultChecked;fieldset.appendChild(input);borderFields.push(input);TableOperations.insertSpace(doc,fieldset,borderFields);select=TableOperations.buildSelectField(doc,el,i18n,fieldset,"f_frames","Frames:","fr","floating","Specifies which sides should have a border",["Not set","No sides","The top side only","The bottom side only","The top and bottom sides only","The right and left sides only","The left-hand side only","The right-hand side only","All four sides"],["not set","void","above","below","hsides","vsides","lhs","rhs","box"],new RegExp((el.frame?el.frame:"not set"),"i"),borderFields);TableOperations.insertSpace(doc,fieldset,borderFields);select=TableOperations.buildSelectField(doc,el,i18n,fieldset,"f_rules","Rules:","fr","floating","Specifies where rules should be displayed",["Not set","No rules","Rules will appear between rows only","Rules will appear between columns only","Rules will appear between all rows and columns"],["not set","none","rows","cols","all"],new RegExp((el.rules?el.rules:"not set"),"i"),borderFields);}else{TableOperations.insertSpace(doc,fieldset,borderFields);TableOperations.buildColorField(w,doc,editor,el,i18n,fieldset,"","Color:","fr","colorButton",el.style.borderColor,"borderColor",borderFields);};setBorderFieldsVisibility(selectBorderStyle.value=="none");TableOperations.insertSpace(doc,fieldset);content.appendChild(fieldset);};TableOperations.buildColorsFieldset=function(w,doc,editor,el,i18n,content){var fieldset=doc.createElement("fieldset");TableOperations.insertLegend(doc,i18n,fieldset,"Background and colors");var ul=doc.createElement("ul");fieldset.appendChild(ul);var li=doc.createElement("li");ul.appendChild(li);TableOperations.buildColorField(w,doc,editor,el,i18n,li,"","FG Color:","fr","colorButtonNoFloat",el.style.color,"color");var li=doc.createElement("li");ul.appendChild(li);TableOperations.buildColorField(w,doc,editor,el,i18n,li,"","Background:","fr","colorButtonNoFloat",el.style.backgroundColor,"backgroundColor");var url;if(el.style.backgroundImage.match(/url\(\s*(.*?)\s*\)/))url=RegExp.$1;TableOperations.buildInput(doc,el,i18n,li,"f_st_backgroundImage","Image URL:","URL of the background image","","",url,"","shorter-value");content.appendChild(fieldset);};TableOperations.insertLegend=function(doc,i18n,fieldset,legend){var legendNode=doc.createElement("legend");legendNode.innerHTML=i18n[legend];fieldset.appendChild(legendNode);};TableOperations.insertSpace=function(doc,fieldset,fields){var space=doc.createElement("div");space.className="space";fieldset.appendChild(space);if(fields)fields.push(space);};TableOperations.buildInput=function(doc,el,i18n,fieldset,fieldName,fieldLabel,fieldTitle,postLabel,fieldSize,fieldValue,labelClass,inputClass,postClass,fields){var label;if(fieldLabel){label=doc.createElement("label");if(labelClass)label.className=labelClass;label.innerHTML=i18n[fieldLabel];label.htmlFor=fieldName;fieldset.appendChild(label);if(fields)fields.push(label);};var input=doc.createElement("input");input.type="text";input.id=fieldName;input.name=fieldName;if(inputClass)input.className=inputClass;if(fieldTitle)input.title=i18n[fieldTitle];if(fieldSize)input.size=fieldSize;if(fieldValue)input.value=fieldValue;fieldset.appendChild(input);if(fields)fields.push(input);if(postLabel){label=doc.createElement("span");if(postClass)label.className=postClass;label.innerHTML=i18n[postLabel];fieldset.appendChild(label);if(fields)fields.push(label);}};TableOperations.buildSelectField=function(doc,el,i18n,fieldset,fieldName,fieldLabel,labelClass,selectClass,fieldTitle,options,values,selected,fields,translateOptions){if(typeof(translateOptions)=="undefined")var translateOptions=true;if(fieldLabel){var label=doc.createElement("label");if(labelClass)label.className=labelClass;label.innerHTML=i18n[fieldLabel];label.htmlFor=fieldName;fieldset.appendChild(label);if(fields)fields.push(label);};var select=doc.createElement("select");if(selectClass)select.className=selectClass;select.id=fieldName;select.name=fieldName;select.title=i18n[fieldTitle];select.selectedIndex=0;var option;for(var i=0;i<options.length;++i){option=doc.createElement("option");select.appendChild(option);option.value=values[i];if(translateOptions)option.appendChild(doc.createTextNode(i18n[options[i]]));else option.appendChild(doc.createTextNode(options[i]));option.selected=selected.test(option.value);};if(select.options.length>1)select.disabled=false;else select.disabled=true;fieldset.appendChild(select);if(fields)fields.push(select);return select;};TableOperations.buildColorField=function(w,doc,editor,el,i18n,fieldset,fieldName,fieldLabel,labelClass,buttonClass,fieldValue,fieldType,fields){if(fieldLabel){var label=doc.createElement("label");if(labelClass)label.className=labelClass;label.innerHTML=i18n[fieldLabel];fieldset.appendChild(label);if(fields)fields.push(label);};var colorButton=TableOperations.createColorButton(w,doc,editor,fieldValue,fieldType);colorButton.className=buttonClass;fieldset.appendChild(colorButton);if(fields)fields.push(colorButton);};
+TableOperations=function(editor){this.editor=editor;var cfg=editor.config;var bl=TableOperations.btnList;var actionHandlerFunctRef=TableOperations.actionHandler(this);var hideToggleBorders=cfg.hideTableOperationsInToolbar&&!(cfg.buttons["toggleborders"]&&cfg.buttons["toggleborders"]["keepInToolbar"]);for(var i=0;i<bl.length;++i){var btn=bl[i];var id="TO-"+btn[0];cfg.registerButton(id,TableOperations_langArray[id],editor.imgURL(btn[0]+".gif","TableOperations"),false,actionHandlerFunctRef,btn[1],((id=="TO-toggle-borders")?hideToggleBorders:cfg.hideTableOperationsInToolbar));}};TableOperations.actionHandler=function(instance){return(function(editor,id){instance.buttonPress(editor,id);});};TableOperations.I18N=TableOperations_langArray;TableOperations._pluginInfo={name:"TableOperations",version:"3.6",developer:"Mihai Bazon & Stanislas Rolland",developer_url:"http://www.fructifor.ca/",c_owner:"Mihai Bazon & Stanislas Rolland",sponsor:"Zapatec Inc. & Fructifor Inc.",sponsor_url:"http://www.fructifor.ca/",license:"GPL"};TableOperations.btnList=[["toggle-borders",null],["table-prop","table"],["row-prop","tr"],["row-insert-above","tr"],["row-insert-under","tr"],["row-delete","tr"],["row-split","td,th[rowSpan!=1]"],["col-insert-before","td,th"],["col-insert-after","td,th"],["col-delete","td,th"],["col-split","td,th[colSpan!=1]"],["cell-prop","td,th"],["cell-insert-before","td,th"],["cell-insert-after","td,th"],["cell-delete","td,th"],["cell-merge","tr"],["cell-split","td,th[colSpan!=1,rowSpan!=1]"]];TableOperations.prototype.getClosest=function(tagName){var editor=this.editor;var ancestors=editor.getAllAncestors();var ret=null;tagName=(""+tagName).toLowerCase();for(var i=0;i<ancestors.length;++i){var el=ancestors[i];if(el.tagName.toLowerCase()==tagName){ret=el;break;}};return ret;};TableOperations.prototype.dialogTableProperties=function(){var table=this.getClosest("table");var tablePropertiesInitFunctRef=TableOperations.tablePropertiesInit(table);var tablePropertiesUpdateFunctRef=TableOperations.tablePropertiesUpdate(table);var dialog=new PopupWin(this.editor,TableOperations.I18N["Table Properties"],tablePropertiesUpdateFunctRef,tablePropertiesInitFunctRef,570,600);};TableOperations.tablePropertiesInit=function(table){return(function(dialog){var doc=dialog.doc;var content=dialog.content;var i18n=TableOperations.I18N;TableOperations.buildTitle(doc,i18n,content,"Table Properties");TableOperations.buildDescriptionFieldset(doc,table,i18n,content);var obj=dialog.editor.config.customSelects["DynamicCSS-class"];if(obj&&obj.loaded)TableOperations.buildStylingFieldset(doc,table,i18n,content,obj.cssArray);if(!dialog.editor.config.disableLayoutFieldsetInTableOperations)TableOperations.buildLayoutFieldset(doc,table,i18n,content);if(!dialog.editor.config.disableAlignmentFieldsetInTableOperations)TableOperations.buildAlignmentFieldset(doc,table,i18n,content,(HTMLArea.is_opera?"":"floating"));if(!dialog.editor.config.disableSpacingFieldsetInTableOperations)TableOperations.buildSpacingFieldset(doc,table,i18n,content);if(!dialog.editor.config.disableBordersFieldsetInTableOperations)TableOperations.buildBordersFieldset(dialog.dialogWindow,doc,dialog.editor,table,i18n,content);if(!dialog.editor.config.disableColorFieldsetInTableOperations)TableOperations.buildColorsFieldset(dialog.dialogWindow,doc,dialog.editor,table,i18n,content);dialog.modal=true;dialog.addButtons("ok","cancel");dialog.showAtElement();});};TableOperations.tablePropertiesUpdate=function(table){return(function(dialog,params){dialog.editor.focusEditor();TableOperations.processStyle(params,table);table.removeAttribute("border");for(var i in params){var val=params[i];switch(i){case "f_caption":if(/\S/.test(val)){var caption=table.getElementsByTagName("caption")[0];if(!caption){caption=dialog.editor._doc.createElement("caption");table.insertBefore(caption,table.firstChild);}caption.innerHTML=val;}else{var caption=table.getElementsByTagName("caption")[0];if(caption)caption.parentNode.removeChild(caption);};break;case "f_summary":table.summary=val;break;case "f_width":table.style.width=(""+val)+params.f_unit;break;case "f_align":table.align=val;break;case "f_spacing":table.cellSpacing=val;break;case "f_padding":table.cellPadding=val;break;case "f_frames":table.frame=(val!="not set")?val:"";break;case "f_rules":if(val!="not set")table.rules=val;else table.removeAttribute("rules");break;case "f_class":case "f_class_tbody":case "f_class_thead":case "f_class_tfoot":var tpart=table;if(i.length>7)tpart=table.getElementsByTagName(i.substring(8,13))[0];var cls=tpart.className.trim().split(" ");for(var j=cls.length;j>0;){if(!HTMLArea.reservedClassNames.test(cls[--j]))HTMLArea._removeClass(tpart,cls[j]);};if(val!='none')HTMLArea._addClass(tpart,val);break;}};dialog.editor.focusEditor();dialog.editor.updateToolbar();});};TableOperations.prototype.dialogRowCellProperties=function(cell){if(cell){var element=this.getClosest("td");if(!element)var element=this.getClosest("th");}else{var element=this.getClosest("tr");};if(element){var rowCellPropertiesInitFunctRef=TableOperations.rowCellPropertiesInit(element,cell);var rowCellPropertiesUpdateFunctRef=TableOperations.rowCellPropertiesUpdate(element);var dialog=new PopupWin(this.editor,TableOperations.I18N[cell?"Cell Properties":"Row Properties"],rowCellPropertiesUpdateFunctRef,rowCellPropertiesInitFunctRef,700,425);}};TableOperations.rowCellPropertiesInit=function(element,cell){return(function(dialog){var doc=dialog.doc;var content=dialog.content;var i18n=TableOperations.I18N;TableOperations.buildTitle(doc,i18n,content,(cell?"Cell Properties":"Row Properties"));if(cell)TableOperations.buildCellTypeFieldset(dialog.dialogWindow,doc,dialog.editor,element,i18n,content);else TableOperations.buildRowGroupFieldset(dialog.dialogWindow,doc,dialog.editor,element,i18n,content);var obj=dialog.editor.config.customSelects["DynamicCSS-class"];if(obj&&obj.loaded)TableOperations.buildStylingFieldset(doc,element,i18n,content,obj.cssArray);else TableOperations.insertSpace(doc,content);if(!dialog.editor.config.disableLayoutFieldsetInTableOperations)TableOperations.buildLayoutFieldset(doc,element,i18n,content,"floating");if(!dialog.editor.config.disableAlignmentFieldsetInTableOperations)TableOperations.buildAlignmentFieldset(doc,element,i18n,content);if(!dialog.editor.config.disableBordersFieldsetInTableOperations)TableOperations.buildBordersFieldset(dialog.dialogWindow,doc,dialog.editor,element,i18n,content);if(!dialog.editor.config.disableColorFieldsetInTableOperations)TableOperations.buildColorsFieldset(dialog.dialogWindow,doc,dialog.editor,element,i18n,content);dialog.modal=true;dialog.addButtons("ok","cancel");dialog.showAtElement();});};TableOperations.rowCellPropertiesUpdate=function(element){return(function(dialog,params){dialog.editor.focusEditor();TableOperations.processStyle(params,element);var convertCellType=false;for(var i in params){var val=params[i];switch(i){case "f_scope":if(val!="not set")element.scope=val;else element.removeAttribute('scope');break;case "f_cell_type":if(val!=element.tagName.toLowerCase()){var newCellType=val;convertCellType=true;};break;case "f_rowgroup":var section=element.parentNode;var tagName=section.tagName.toLowerCase();if(val!=tagName){var table=section.parentNode;var newSection=table.getElementsByTagName(val)[0];if(!newSection)var newSection=table.insertBefore(dialog.editor._doc.createElement(val),table.getElementsByTagName("tbody")[0]);if(tagName=="thead"&&val=="tbody")var newElement=newSection.insertBefore(element,newSection.firstChild);else var newElement=newSection.appendChild(element);if(!section.hasChildNodes())table.removeChild(section);};break;case "f_char":element.ch=val;break;case "f_class":var cls=element.className.trim().split(" ");for(var j=cls.length;j>0;){if(!HTMLArea.reservedClassNames.test(cls[--j]))HTMLArea._removeClass(element,cls[j]);};if(val!='none')HTMLArea._addClass(element,val);break;}};if(convertCellType){var newCell=dialog.editor._doc.createElement(newCellType),p=element.parentNode,a,attrName,name;var attrs=element.attributes;for(var i=attrs.length;--i>=0;){a=attrs.item(i);attrName=a.nodeName;name=attrName.toLowerCase();if(typeof(element[attrName])!="undefined"&&name!="style"&&!/^on/.test(name)){if(element[attrName])newCell.setAttribute(attrName,element[attrName]);}else{if(a.nodeValue)newCell.setAttribute(attrName,a.nodeValue);}};if(HTMLArea.is_ie){if(element.style.cssText)newCell.style.cssText=element.style.cssText;if(element.className){newCell.setAttribute("className",element.className);}else{newCell.className=element.className;newCell.removeAttribute("className");}};while(element.firstChild)newCell.appendChild(element.firstChild);p.insertBefore(newCell,element);p.removeChild(element);dialog.editor.selectNodeContents(newCell,false);};dialog.editor.updateToolbar();});};TableOperations.prototype.buttonPress=function(editor,button_id){this.editor=editor;var mozbr=HTMLArea.is_gecko?"<br />":"";var tableParts=["tfoot","thead","tbody"];var tablePartsIndex={tfoot:0,thead:1,tbody:2};function clearRow(tr){var tds=tr.getElementsByTagName("td");for(var i=tds.length;--i>=0;){var td=tds[i];td.rowSpan=1;td.innerHTML=mozbr;};var tds=tr.getElementsByTagName("th");for(var i=tds.length;--i>=0;){var td=tds[i];td.rowSpan=1;td.innerHTML=mozbr;}};function splitRow(td){var n=parseInt(""+td.rowSpan);var colSpan=td.colSpan;var tagName=td.tagName.toLowerCase();td.rowSpan=1;var tr=td.parentNode;var sectionRowIndex=tr.sectionRowIndex;var rows=tr.parentNode.rows;var index=td.cellIndex;while(--n>0){tr=rows[++sectionRowIndex];if(!tr)tr=td.parentNode.parentNode.appendChild(editor._doc.createElement("tr"));var otd=editor._doc.createElement(tagName);otd.colSpan=colSpan;otd.innerHTML=mozbr;tr.insertBefore(otd,tr.cells[index]);}};function splitCol(td){var nc=parseInt(""+td.colSpan);var tagName=td.tagName.toLowerCase();td.colSpan=1;var tr=td.parentNode;var ref=td.nextSibling;while(--nc>0){var otd=editor._doc.createElement(tagName);otd.rowSpan=td.rowSpan;otd.innerHTML=mozbr;tr.insertBefore(otd,ref);}};function splitCell(td){var nc=parseInt(""+td.colSpan);splitCol(td);var cells=td.parentNode.cells;var index=td.cellIndex;while(nc-->0){splitRow(cells[index++]);}};function selectNextNode(el){var node=el.nextSibling;while(node&&node.nodeType!=1){node=node.nextSibling;};if(!node){node=el.previousSibling;while(node&&node.nodeType!=1){node=node.previousSibling;}};if(!node)node=el.parentNode;editor.selectNodeContents(node);};function getSelectedCells(sel){var cell,range,i=0,cells=[];try{while(range=sel.getRangeAt(i++)){cell=range.startContainer.childNodes[range.startOffset];while(!/^(td|th|body)$/.test(cell.tagName.toLowerCase()))cell=cell.parentNode;if(/^(td|th)$/.test(cell.tagName.toLowerCase()))cells.push(cell);}}catch(e){};return cells;};function deleteEmptyTable(table){var lastPart=true;for(var j=tableParts.length;--j>=0;){var tablePart=table.getElementsByTagName(tableParts[j])[0];if(tablePart)lastPart=false;};if(lastPart){selectNextNode(table);table.parentNode.removeChild(table);}};switch(button_id){case "TO-row-insert-above":case "TO-row-insert-under":var tr=this.getClosest("tr");if(!tr)break;var otr=tr.cloneNode(true);clearRow(otr);tr.parentNode.insertBefore(otr,(/under/.test(button_id)?tr.nextSibling:tr));editor.forceRedraw();editor.focusEditor();break;case "TO-row-delete":var tr=this.getClosest("tr");if(!tr)break;var part=tr.parentNode;var table=part.parentNode;if(part.rows.length==1){selectNextNode(part);table.removeChild(part);deleteEmptyTable(table);}else{selectNextNode(tr);part.removeChild(tr);}editor.forceRedraw();editor.focusEditor();editor.updateToolbar();break;case "TO-row-split":var cell=this.getClosest("td");if(!cell)var cell=this.getClosest("th");if(!cell)break;var sel=editor._getSelection();if(HTMLArea.is_gecko&&!sel.isCollapsed&&!HTMLArea.is_safari&&!HTMLArea.is_opera){var cells=getSelectedCells(sel);for(i=0;i<cells.length;++i)splitRow(cells[i]);}else{splitRow(cell);}editor.forceRedraw();editor.updateToolbar();break;case "TO-col-insert-before":case "TO-col-insert-after":var cell=this.getClosest("td");if(!cell)var cell=this.getClosest("th");if(!cell)break;var index=cell.cellIndex;var table=cell.parentNode.parentNode.parentNode;for(var j=tableParts.length;--j>=0;){var tablePart=table.getElementsByTagName(tableParts[j])[0];if(tablePart){var rows=tablePart.rows;for(var i=rows.length;--i>=0;){var tr=rows[i];var ref=tr.cells[index+(/after/.test(button_id)?1:0)];if(!ref){var otd=editor._doc.createElement(tr.lastChild.tagName.toLowerCase());otd.innerHTML=mozbr;tr.appendChild(otd);}else{var otd=editor._doc.createElement(ref.tagName.toLowerCase());otd.innerHTML=mozbr;tr.insertBefore(otd,ref);}}}}editor.focusEditor();break;case "TO-col-split":var cell=this.getClosest("td");if(!cell)var cell=this.getClosest("th");if(!cell)break;var sel=editor._getSelection();if(HTMLArea.is_gecko&&!sel.isCollapsed&&!HTMLArea.is_safari&&!HTMLArea.is_opera){var cells=getSelectedCells(sel);for(i=0;i<cells.length;++i)splitCol(cells[i]);}else{splitCol(cell);}editor.forceRedraw();editor.updateToolbar();break;case "TO-col-delete":var cell=this.getClosest("td");if(!cell)var cell=this.getClosest("th");if(!cell)break;var index=cell.cellIndex;var part=cell.parentNode.parentNode;var table=part.parentNode;var lastPart=true;for(var j=tableParts.length;--j>=0;){var tablePart=table.getElementsByTagName(tableParts[j])[0];if(tablePart){var rows=tablePart.rows;var lastColumn=true;for(var i=rows.length;--i>=0;){if(rows[i].cells.length>1)lastColumn=false;};if(lastColumn){selectNextNode(tablePart);table.removeChild(tablePart);}else{if(part==tablePart)selectNextNode(cell);for(var i=rows.length;--i>=0;){if(rows[i].cells[index])rows[i].removeChild(rows[i].cells[index]);};lastPart=false;}}};if(lastPart){selectNextNode(table);table.parentNode.removeChild(table);}editor.forceRedraw();editor.focusEditor();editor.updateToolbar();break;case "TO-cell-split":var cell=this.getClosest("td");if(!cell)var cell=this.getClosest("th");if(!cell)break;var sel=editor._getSelection();if(HTMLArea.is_gecko&&!sel.isCollapsed&&!HTMLArea.is_safari&&!HTMLArea.is_opera){var cells=getSelectedCells(sel);for(i=0;i<cells.length;++i)splitCell(cells[i]);}else{splitCell(cell);}editor.forceRedraw();editor.updateToolbar();break;case "TO-cell-insert-before":case "TO-cell-insert-after":var cell=this.getClosest("td");if(!cell)var cell=this.getClosest("th");if(!cell)break;var tr=cell.parentNode;var otd=editor._doc.createElement(cell.tagName.toLowerCase());otd.innerHTML=mozbr;tr.insertBefore(otd,(/after/.test(button_id)?cell.nextSibling:cell));editor.forceRedraw();editor.focusEditor();break;case "TO-cell-delete":var cell=this.getClosest("td");if(!cell)var cell=this.getClosest("th");if(!cell)break;var row=cell.parentNode;if(row.cells.length==1){var part=row.parentNode;var table=part.parentNode;if(part.rows.length==1){selectNextNode(part);table.removeChild(part);deleteEmptyTable(table);}else{selectNextNode(row);part.removeChild(row);}}else{selectNextNode(cell);row.removeChild(cell);}editor.forceRedraw();editor.focusEditor();editor.updateToolbar();break;case "TO-cell-merge":var sel=editor._getSelection();var range,i=0;var rows=new Array();for(var k=tableParts.length;--k>=0;)rows[k]=[];var row=null;var cells=null;if(HTMLArea.is_gecko&&!HTMLArea.is_safari&&!HTMLArea.is_opera){try{while(range=sel.getRangeAt(i++)){var td=range.startContainer.childNodes[range.startOffset];if(td.parentNode!=row){(cells)&&rows[tablePartsIndex[row.parentNode.tagName.toLowerCase()]].push(cells);row=td.parentNode;cells=[];}cells.push(td);}}catch(e){};rows[tablePartsIndex[row.parentNode.tagName.toLowerCase()]].push(cells);}else{var cell=this.getClosest("td");if(!cell)var cell=this.getClosest("th");if(!cell){alert(TableOperations.I18N["Please click into some cell"]);break;};var tr=cell.parentElement;var no_cols=prompt(TableOperations.I18N["How many columns would you like to merge?"],2);if(!no_cols)break;var no_rows=prompt(TableOperations.I18N["How many rows would you like to merge?"],2);if(!no_rows)break;var cell_index=cell.cellIndex;while(no_rows-->0){td=tr.cells[cell_index];cells=[td];for(var i=1;i<no_cols;++i){td=td.nextSibling;if(!td)break;cells.push(td);};rows[tablePartsIndex[tr.parentNode.tagName.toLowerCase()]].push(cells);tr=tr.nextSibling;if(!tr)break;}};for(var k=tableParts.length;--k>=0;){var cellHTML="";for(var i=0;i<rows[k].length;++i){var cells=rows[k][i];if(!cells)continue;for(var j=0;j<cells.length;++j){var cell=cells[j];cellHTML+=cell.innerHTML;if(i||j){if(cell.parentNode.cells.length==1)cell.parentNode.parentNode.removeChild(cell.parentNode);else cell.parentNode.removeChild(cell);}}};try{var td=rows[k][0][0];td.innerHTML=cellHTML;td.rowSpan=rows[k].length;td.colSpan=rows[k][0].length;editor.selectNodeContents(td);}catch(e){}}editor.forceRedraw();editor.focusEditor();break;case "TO-table-prop":this.dialogTableProperties();break;case "TO-row-prop":this.dialogRowCellProperties(false);break;case "TO-cell-prop":this.dialogRowCellProperties(true);break;case "TO-toggle-borders":var tables=editor._doc.getElementsByTagName("table");if(tables.length!=0){editor.borders=true;for(var ix=0;ix<tables.length;ix++)editor.borders=editor.borders&&/htmlarea-showtableborders/.test(tables[ix].className);for(ix=0;ix<tables.length;ix++){if(!editor.borders)HTMLArea._addClass(tables[ix],'htmlarea-showtableborders');else HTMLArea._removeClass(tables[ix],'htmlarea-showtableborders');}};break;default:alert("Button ["+button_id+"] not yet implemented");}};TableOperations.getLength=function(value){var len=parseInt(value);if(isNaN(len))len="";return len;};TableOperations.processStyle=function(params,element){var style=element.style;for(var i in params){var val=params[i];switch(i){case "f_st_backgroundColor":style.backgroundColor=val;break;case "f_st_color":style.color=val;break;case "f_st_backgroundImage":if(/\S/.test(val)){style.backgroundImage="url("+val+")";}else{style.backgroundImage="";};break;case "f_st_borderWidth":if(/\S/.test(val)){style.borderWidth=val+"px";}else{style.borderWidth="";};if(params["f_st_borderStyle"]=="none")style.borderWidth="0px";if(params["f_st_borderStyle"]=="not set")style.borderWidth="";break;case "f_st_borderStyle":style.borderStyle=(val!="not set")?val:"";break;case "f_st_borderColor":style.borderColor=val;break;case "f_st_borderCollapse":style.borderCollapse=val?"collapse":"";break;case "f_st_width":if(/\S/.test(val)){style.width=val+params["f_st_widthUnit"];}else{style.width="";};break;case "f_st_height":if(/\S/.test(val)){style.height=val+params["f_st_heightUnit"];}else{style.height="";};break;case "f_st_textAlign":if(val=="character"){var ch=params["f_st_textAlignChar"];if(ch=='"'){ch='\\"';};style.textAlign='"'+ch+'"';}else{style.textAlign=(val!="not set")?val:"";};break;case "f_st_vertAlign":style.verticalAlign=(val!="not set")?val:"";break;case "f_st_float":if(HTMLArea.is_ie){style.styleFloat=(val!="not set")?val:"";}else{style.cssFloat=(val!="not set")?val:"";};break;}}};TableOperations.createColorButton=function(w,doc,editor,color,name){if(!color){color="";}else if(!/#/.test(color)){color=HTMLArea._colorToRgb(color);};var df=doc.createElement("span");var field=doc.createElement("input");field.type="hidden";df.appendChild(field);field.name="f_st_"+name;field.id="f_st_"+name;field.value=color;var button=doc.createElement("span");button.className="buttonColor";df.appendChild(button);var span=doc.createElement("span");span.className="chooser";span.style.backgroundColor=color;button.appendChild(span);button.onmouseover=function(){if(!this.disabled)this.className+=" buttonColor-hilite";};button.onmouseout=function(){if(!this.disabled)this.className="buttonColor";};span.onclick=function(){if(this.parentNode.disabled)return false;var selectColorPlugin=editor.plugins.SelectColor;if(selectColorPlugin)selectColorPlugin=selectColorPlugin.instance;if(selectColorPlugin){selectColorPlugin.dialogSelectColor("color",span,field,w);}else{editor._popupDialog("select_color.html",function(color){if(color){span.style.backgroundColor="#"+color;field.value="#"+color;}},color,200,182,w);}};var span2=doc.createElement("span");span2.innerHTML="&#x00d7;";span2.className="nocolor";span2.title=TableOperations.I18N["Unset color"];button.appendChild(span2);span2.onmouseover=function(){if(!this.parentNode.disabled)this.className+=" nocolor-hilite";};span2.onmouseout=function(){if(!this.parentNode.disabled)this.className="nocolor";};span2.onclick=function(){span.style.backgroundColor="";field.value="";};return df;};TableOperations.buildTitle=function(doc,i18n,content,title){var div=doc.createElement("div");div.className="title";div.innerHTML=i18n[title];content.appendChild(div);doc.title=i18n[title];};TableOperations.buildDescriptionFieldset=function(doc,el,i18n,content){var fieldset=doc.createElement("fieldset");TableOperations.insertLegend(doc,i18n,fieldset,"Description");TableOperations.insertSpace(doc,fieldset);var f_caption="";var capel=el.getElementsByTagName("caption")[0];if(capel)f_caption=capel.innerHTML;TableOperations.buildInput(doc,el,i18n,fieldset,"f_caption","Caption:","Description of the nature of the table","","",f_caption,"fr","value","");TableOperations.insertSpace(doc,fieldset);TableOperations.buildInput(doc,el,i18n,fieldset,"f_summary","Summary:","Summary of the table purpose and structure","","",el.summary,"fr","value","");TableOperations.insertSpace(doc,fieldset);content.appendChild(fieldset);};TableOperations.buildRowGroupFieldset=function(w,doc,editor,el,i18n,content){var fieldset=doc.createElement("fieldset");TableOperations.insertLegend(doc,i18n,fieldset,"Row group");TableOperations.insertSpace(doc,fieldset);selected=el.parentNode.tagName.toLowerCase();var selectScope=TableOperations.buildSelectField(doc,el,i18n,fieldset,"f_rowgroup","Row group:","fr","","Table section",["Table body","Table header","Table footer"],["tbody","thead","tfoot"],new RegExp((selected?selected:"tbody"),"i"));TableOperations.insertSpace(doc,fieldset);content.appendChild(fieldset);};TableOperations.buildCellTypeFieldset=function(w,doc,editor,el,i18n,content){var fieldset=doc.createElement("fieldset");TableOperations.insertLegend(doc,i18n,fieldset,"Cell Type and Scope");TableOperations.insertSpace(doc,fieldset);var ul=doc.createElement("ul");fieldset.appendChild(ul);var li=doc.createElement("li");ul.appendChild(li);var selectType=TableOperations.buildSelectField(doc,el,i18n,li,"f_cell_type","Type of cell","fr","","Specifies the type of cell",["Normal","Header"],["td","th"],new RegExp(el.tagName.toLowerCase(),"i"));selectType.onchange=function(){TableOperations.setStyleOptions(doc,editor,el,i18n,this);};var li=doc.createElement("li");ul.appendChild(li);selected=el.scope.toLowerCase();(selected.match(/([^\s]*)\s/))&&(selected=RegExp.$1);var selectScope=TableOperations.buildSelectField(doc,el,i18n,li,"f_scope","Scope","fr","","Scope of header cell",["Not set","scope_row","scope_column","scope_rowgroup"],["not set","row","col","rowgroup"],new RegExp((selected?selected:"not set"),"i"));TableOperations.insertSpace(doc,fieldset);content.appendChild(fieldset);};TableOperations.getCssLabelsClasses=function(cssArray,i18n,tagName,selectedIn){var cssLabels=new Array();var cssClasses=new Array();cssLabels[0]=i18n["Default"];cssClasses[0]="none";var selected=selectedIn;var cls=selected.split(" ");var nonReservedClassName=false;for(var ia=cls.length;ia>0;){if(!HTMLArea.reservedClassNames.test(cls[--ia])){selected=cls[ia];nonReservedClassName=true;break;}};var found=false,i=1,cssClass;if(cssArray[tagName]){for(cssClass in cssArray[tagName]){if(cssClass!="none"){cssLabels[i]=cssArray[tagName][cssClass];cssClasses[i]=cssClass;if(cssClass==selected)found=true;i++;}else{cssLabels[0]=cssArray[tagName][cssClass];}}};if(cssArray['all']){for(cssClass in cssArray['all']){cssLabels[i]=cssArray['all'][cssClass];cssClasses[i]=cssClass;if(cssClass==selected)found=true;i++;}};if(selected&&nonReservedClassName&&!found){cssLabels[i]=i18n["Undefined"];cssClasses[i]=selected;};return[cssLabels,cssClasses,selected];};TableOperations.setStyleOptions=function(doc,editor,el,i18n,typeSelect){var tagName=typeSelect.value;var select=doc.getElementById("f_class");if(!select)return false;var obj=editor.config.customSelects["DynamicCSS-class"];if(obj&&obj.loaded)var cssArray=obj.cssArray;else return false;var cssLabelsClasses=TableOperations.getCssLabelsClasses(cssArray,i18n,tagName,el.className);var options=cssLabelsClasses[0];var values=cssLabelsClasses[1];var selected=cssLabelsClasses[2];var selectedReg=new RegExp((selected?selected:"none"),"i");while(select.options.length>0)select.options[select.length-1]=null;select.selectedIndex=0;var option;for(var i=0;i<options.length;++i){option=doc.createElement("option");select.appendChild(option);option.value=values[i];option.appendChild(doc.createTextNode(options[i]));option.selected=selectedReg.test(values[i]);};if(select.options.length>1)select.disabled=false;else select.disabled=true;};TableOperations.buildStylingFieldset=function(doc,el,i18n,content,cssArray){var tagName=el.tagName.toLowerCase();var table=(tagName=="table");var cssLabelsClasses=TableOperations.getCssLabelsClasses(cssArray,i18n,tagName,el.className);var cssLabels=cssLabelsClasses[0];var cssClasses=cssLabelsClasses[1];var selected=cssLabelsClasses[2];var fieldset=doc.createElement("fieldset");TableOperations.insertLegend(doc,i18n,fieldset,"CSS Style");TableOperations.insertSpace(doc,fieldset);var ul=doc.createElement("ul");ul.className="floating";fieldset.appendChild(ul);var li=doc.createElement("li");ul.appendChild(li);TableOperations.buildSelectField(doc,el,i18n,li,"f_class",(table?"Table class:":"Class:"),"fr","",(table?"Table class selector":"Class selector"),cssLabels,cssClasses,new RegExp((selected?selected:"none"),"i"),"",false);if(table){var tbody=el.getElementsByTagName("tbody")[0];if(tbody){var li=doc.createElement("li");ul.appendChild(li);cssLabelsClasses=TableOperations.getCssLabelsClasses(cssArray,i18n,"tbody",tbody.className);cssLabels=cssLabelsClasses[0];cssClasses=cssLabelsClasses[1];selected=cssLabelsClasses[2];TableOperations.buildSelectField(doc,el,i18n,li,"f_class_tbody","Table body class:","fr","","Table body class selector",cssLabels,cssClasses,new RegExp((selected?selected:"none"),"i"),"",false);};ul=null;var thead=el.getElementsByTagName("thead")[0];if(thead){var ul=doc.createElement("ul");fieldset.appendChild(ul);var li=doc.createElement("li");ul.appendChild(li);cssLabelsClasses=TableOperations.getCssLabelsClasses(cssArray,i18n,"thead",thead.className);cssLabels=cssLabelsClasses[0];cssClasses=cssLabelsClasses[1];selected=cssLabelsClasses[2];TableOperations.buildSelectField(doc,el,i18n,li,"f_class_thead","Table header class:","fr","","Table header class selector",cssLabels,cssClasses,new RegExp((selected?selected:"none"),"i"),"",false);};var tfoot=el.getElementsByTagName("tfoot")[0];if(tfoot){if(!ul){var ul=doc.createElement("ul");fieldset.appendChild(ul);};var li=doc.createElement("li");ul.appendChild(li);cssLabelsClasses=TableOperations.getCssLabelsClasses(cssArray,i18n,"tfoot",tfoot.className);cssLabels=cssLabelsClasses[0];cssClasses=cssLabelsClasses[1];selected=cssLabelsClasses[2];TableOperations.buildSelectField(doc,el,i18n,li,"f_class_tfoot","Table footer class:","fr","","Table footer class selector",cssLabels,cssClasses,new RegExp((selected?selected:"none"),"i"),"",false);}};TableOperations.insertSpace(doc,fieldset);content.appendChild(fieldset);};TableOperations.buildLayoutFieldset=function(doc,el,i18n,content,fieldsetClass){var select,selected;var fieldset=doc.createElement("fieldset");if(fieldsetClass)fieldset.className=fieldsetClass;TableOperations.insertLegend(doc,i18n,fieldset,"Layout");var f_st_width=TableOperations.getLength(el.style.width);var f_st_height=TableOperations.getLength(el.style.height);var selectedWidthUnit=/%/.test(el.style.width)?'%':(/px/.test(el.style.width)?'px':'em');var selectedHeightUnit=/%/.test(el.style.height)?'%':(/px/.test(el.style.height)?'px':'em');var tag=el.tagName.toLowerCase();var ul=doc.createElement("ul");fieldset.appendChild(ul);switch(tag){case "table":var li=doc.createElement("li");ul.appendChild(li);TableOperations.buildInput(doc,el,i18n,li,"f_st_width","Width:","Table width","","5",f_st_width,"fr");select=TableOperations.buildSelectField(doc,el,i18n,li,"f_st_widthUnit","","","","Width unit",["percent","pixels","em"],["%","px","em"],new RegExp((f_st_width?selectedWidthUnit:"%"),"i"));var li=doc.createElement("li");ul.appendChild(li);TableOperations.buildInput(doc,el,i18n,li,"f_st_height","Height:","Table height","","5",f_st_height,"fr");select=TableOperations.buildSelectField(doc,el,i18n,li,"f_st_heightUnit","","","","Height unit",["percent","pixels","em"],["%","px","em"],new RegExp((f_st_height?selectedHeightUnit:"%"),"i"));selected=(HTMLArea._is_ie)?el.style.styleFloat:el.style.cssFloat;select=TableOperations.buildSelectField(doc,el,i18n,li,"f_st_float","Float:","","","Specifies where the table should float",["Not set","Non-floating","Left","Right"],["not set","none","left","right"],new RegExp((selected?selected:"not set"),"i"));break;case "tr":var li=doc.createElement("li");ul.appendChild(li);TableOperations.buildInput(doc,el,i18n,li,"f_st_width","Width:","Row width","","5",f_st_width,"fr");select=TableOperations.buildSelectField(doc,el,i18n,li,"f_st_widthUnit","","","","Width unit",["percent","pixels","em"],["%","px","em"],new RegExp((f_st_width?selectedWidthUnit:"%"),"i"));var li=doc.createElement("li");ul.appendChild(li);TableOperations.buildInput(doc,el,i18n,li,"f_st_height","Height:","Row height","","5",f_st_height,"fr");select=TableOperations.buildSelectField(doc,el,i18n,li,"f_st_heightUnit","","","","Height unit",["percent","pixels","em"],["%","px","em"],new RegExp((f_st_height?selectedHeightUnit:"%"),"i"));break;case "td":case "th":var li=doc.createElement("li");ul.appendChild(li);TableOperations.buildInput(doc,el,i18n,li,"f_st_width","Width:","Cell width","","5",f_st_width,"fr");select=TableOperations.buildSelectField(doc,el,i18n,li,"f_st_widthUnit","","","","Width unit",["percent","pixels","em"],["%","px","em"],new RegExp((f_st_width?selectedWidthUnit:"%"),"i"));var li=doc.createElement("li");ul.appendChild(li);TableOperations.buildInput(doc,el,i18n,li,"f_st_height","Height:","Cell height","","5",f_st_height,"fr");select=TableOperations.buildSelectField(doc,el,i18n,li,"f_st_heightUnit","","","","Height unit",["percent","pixels","em"],["%","px","em"],new RegExp((f_st_height?selectedHeightUnit:"%"),"i"));}content.appendChild(fieldset);};TableOperations.buildAlignmentFieldset=function(doc,el,i18n,content,fieldsetClass){var select;var tag=el.tagName.toLowerCase();var fieldset=doc.createElement("fieldset");if(fieldsetClass)fieldset.className=fieldsetClass;TableOperations.insertLegend(doc,i18n,fieldset,"Alignment");var options=["Not set","Left","Center","Right","Justify"];var values=["not set","left","center","right","justify"];var selected=el.style.textAlign;(selected.match(/([^\s]*)\s/))&&(selected=RegExp.$1);var ul=doc.createElement("ul");fieldset.appendChild(ul);var li=doc.createElement("li");ul.appendChild(li);select=TableOperations.buildSelectField(doc,el,i18n,li,"f_st_textAlign","Text alignment:","fl","","Horizontal alignment of text within cell",options,values,new RegExp((selected?selected:"not set"),"i"));var li=doc.createElement("li");ul.appendChild(li);selected=el.style.verticalAlign;(selected.match(/([^\s]*)\s/))&&(selected=RegExp.$1);select=TableOperations.buildSelectField(doc,el,i18n,li,"f_st_vertAlign","Vertical alignment:","fl","","Vertical alignment of content within cell",["Not set","Top","Middle","Bottom","Baseline"],["not set","top","middle","bottom","baseline"],new RegExp((selected?selected:"not set"),"i"));content.appendChild(fieldset);};TableOperations.buildSpacingFieldset=function(doc,el,i18n,content){var fieldset=doc.createElement("fieldset");TableOperations.insertLegend(doc,i18n,fieldset,"Spacing and padding");var ul=doc.createElement("ul");fieldset.appendChild(ul);var li=doc.createElement("li");ul.appendChild(li);TableOperations.buildInput(doc,el,i18n,li,"f_spacing","Cell spacing:","Space between adjacent cells","pixels","5",el.cellSpacing,"fr","","postlabel");var li=doc.createElement("li");ul.appendChild(li);TableOperations.buildInput(doc,el,i18n,li,"f_padding","Cell padding:","Space between content and border in cell","pixels","5",el.cellPadding,"fr","","postlabel");content.appendChild(fieldset);};TableOperations.buildBordersFieldset=function(w,doc,editor,el,i18n,content,fieldsetClass){var select;var selected;var borderFields=[];function setBorderFieldsVisibility(value){for(var i=0;i<borderFields.length;++i){var borderFieldElement=borderFields[i];borderFieldElement.style.visibility=value?"hidden":"visible";if(!value&&(borderFieldElement.tagName.toLowerCase()=="input")){borderFieldElement.focus();borderFieldElement.select();}}};var fieldset=doc.createElement("fieldset");fieldset.className=fieldsetClass;TableOperations.insertLegend(doc,i18n,fieldset,"Frame and borders");TableOperations.insertSpace(doc,fieldset);selected=el.style.borderStyle;(selected.match(/([^\s]*)\s/))&&(selected=RegExp.$1);selectBorderStyle=TableOperations.buildSelectField(doc,el,i18n,fieldset,"f_st_borderStyle","Border style:","fr","floating","Border style",["Not set","No border","Dotted","Dashed","Solid","Double","Groove","Ridge","Inset","Outset"],["not set","none","dotted","dashed","solid","double","groove","ridge","inset","outset"],new RegExp((selected?selected:"not set"),"i"));selectBorderStyle.onchange=function(){setBorderFieldsVisibility(this.value=="none");};TableOperations.buildInput(doc,el,i18n,fieldset,"f_st_borderWidth","Border width:","Border width","pixels","5",TableOperations.getLength(el.style.borderWidth),"fr","floating","postlabel",borderFields);TableOperations.insertSpace(doc,fieldset,borderFields);if(el.tagName.toLowerCase()=="table"){TableOperations.buildColorField(w,doc,editor,el,i18n,fieldset,"","Color:","fr","colorButton",el.style.borderColor,"borderColor",borderFields);var label=doc.createElement("label");label.className="fl-borderCollapse";label.htmlFor="f_st_borderCollapse";label.innerHTML=i18n["Collapsed borders"];fieldset.appendChild(label);borderFields.push(label);var input=doc.createElement("input");input.className="checkbox";input.type="checkbox";input.name="f_st_borderCollapse";input.id="f_st_borderCollapse";input.defaultChecked=/collapse/i.test(el.style.borderCollapse);input.checked=input.defaultChecked;fieldset.appendChild(input);borderFields.push(input);TableOperations.insertSpace(doc,fieldset,borderFields);select=TableOperations.buildSelectField(doc,el,i18n,fieldset,"f_frames","Frames:","fr","floating","Specifies which sides should have a border",["Not set","No sides","The top side only","The bottom side only","The top and bottom sides only","The right and left sides only","The left-hand side only","The right-hand side only","All four sides"],["not set","void","above","below","hsides","vsides","lhs","rhs","box"],new RegExp((el.frame?el.frame:"not set"),"i"),borderFields);TableOperations.insertSpace(doc,fieldset,borderFields);select=TableOperations.buildSelectField(doc,el,i18n,fieldset,"f_rules","Rules:","fr","floating","Specifies where rules should be displayed",["Not set","No rules","Rules will appear between rows only","Rules will appear between columns only","Rules will appear between all rows and columns"],["not set","none","rows","cols","all"],new RegExp((el.rules?el.rules:"not set"),"i"),borderFields);}else{TableOperations.insertSpace(doc,fieldset,borderFields);TableOperations.buildColorField(w,doc,editor,el,i18n,fieldset,"","Color:","fr","colorButton",el.style.borderColor,"borderColor",borderFields);};setBorderFieldsVisibility(selectBorderStyle.value=="none");TableOperations.insertSpace(doc,fieldset);content.appendChild(fieldset);};TableOperations.buildColorsFieldset=function(w,doc,editor,el,i18n,content){var fieldset=doc.createElement("fieldset");TableOperations.insertLegend(doc,i18n,fieldset,"Background and colors");var ul=doc.createElement("ul");fieldset.appendChild(ul);var li=doc.createElement("li");ul.appendChild(li);TableOperations.buildColorField(w,doc,editor,el,i18n,li,"","FG Color:","fr","colorButtonNoFloat",el.style.color,"color");var li=doc.createElement("li");ul.appendChild(li);TableOperations.buildColorField(w,doc,editor,el,i18n,li,"","Background:","fr","colorButtonNoFloat",el.style.backgroundColor,"backgroundColor");var url;if(el.style.backgroundImage.match(/url\(\s*(.*?)\s*\)/))url=RegExp.$1;TableOperations.buildInput(doc,el,i18n,li,"f_st_backgroundImage","Image URL:","URL of the background image","","",url,"","shorter-value");content.appendChild(fieldset);};TableOperations.insertLegend=function(doc,i18n,fieldset,legend){var legendNode=doc.createElement("legend");legendNode.innerHTML=i18n[legend];fieldset.appendChild(legendNode);};TableOperations.insertSpace=function(doc,fieldset,fields){var space=doc.createElement("div");space.className="space";fieldset.appendChild(space);if(fields)fields.push(space);};TableOperations.buildInput=function(doc,el,i18n,fieldset,fieldName,fieldLabel,fieldTitle,postLabel,fieldSize,fieldValue,labelClass,inputClass,postClass,fields){var label;if(fieldLabel){label=doc.createElement("label");if(labelClass)label.className=labelClass;label.innerHTML=i18n[fieldLabel];label.htmlFor=fieldName;fieldset.appendChild(label);if(fields)fields.push(label);};var input=doc.createElement("input");input.type="text";input.id=fieldName;input.name=fieldName;if(inputClass)input.className=inputClass;if(fieldTitle)input.title=i18n[fieldTitle];if(fieldSize)input.size=fieldSize;if(fieldValue)input.value=fieldValue;fieldset.appendChild(input);if(fields)fields.push(input);if(postLabel){label=doc.createElement("span");if(postClass)label.className=postClass;label.innerHTML=i18n[postLabel];fieldset.appendChild(label);if(fields)fields.push(label);}};TableOperations.buildSelectField=function(doc,el,i18n,fieldset,fieldName,fieldLabel,labelClass,selectClass,fieldTitle,options,values,selected,fields,translateOptions){if(typeof(translateOptions)=="undefined")var translateOptions=true;if(fieldLabel){var label=doc.createElement("label");if(labelClass)label.className=labelClass;label.innerHTML=i18n[fieldLabel];label.htmlFor=fieldName;fieldset.appendChild(label);if(fields)fields.push(label);};var select=doc.createElement("select");if(selectClass)select.className=selectClass;select.id=fieldName;select.name=fieldName;select.title=i18n[fieldTitle];select.selectedIndex=0;var option;for(var i=0;i<options.length;++i){option=doc.createElement("option");select.appendChild(option);option.value=values[i];if(translateOptions)option.appendChild(doc.createTextNode(i18n[options[i]]));else option.appendChild(doc.createTextNode(options[i]));option.selected=selected.test(option.value);};if(select.options.length>1)select.disabled=false;else select.disabled=true;fieldset.appendChild(select);if(fields)fields.push(select);return select;};TableOperations.buildColorField=function(w,doc,editor,el,i18n,fieldset,fieldName,fieldLabel,labelClass,buttonClass,fieldValue,fieldType,fields){if(fieldLabel){var label=doc.createElement("label");if(labelClass)label.className=labelClass;label.innerHTML=i18n[fieldLabel];fieldset.appendChild(label);if(fields)fields.push(label);};var colorButton=TableOperations.createColorButton(w,doc,editor,fieldValue,fieldType);colorButton.className=buttonClass;fieldset.appendChild(colorButton);if(fields)fields.push(colorButton);};
 
index 6fba70f..69e20e2 100644 (file)
@@ -42,13 +42,12 @@ TableOperations = function(editor) {
        var cfg = editor.config;
        var bl = TableOperations.btnList;
        var actionHandlerFunctRef = TableOperations.actionHandler(this);
-       var hideInToolbar = cfg.hideTableOperationsInToolbar;
-       var hideToggleBorders = hideInToolbar && !cfg.keepToggleBordersInToolbar;
+       var hideToggleBorders = cfg.hideTableOperationsInToolbar && !(cfg.buttons["toggleborders"] && cfg.buttons["toggleborders"]["keepInToolbar"]);
        for(var i=0;i < bl.length;++i) {
                var btn = bl[i];
                var id = "TO-" + btn[0];
                cfg.registerButton(id, TableOperations_langArray[id], editor.imgURL(btn[0] + ".gif", "TableOperations"), false,
-                       actionHandlerFunctRef, btn[1], ((id == "TO-toggle-borders") ? hideToggleBorders : hideInToolbar));
+                       actionHandlerFunctRef, btn[1], ((id == "TO-toggle-borders") ? hideToggleBorders : cfg.hideTableOperationsInToolbar));
        }
 };
 
@@ -729,9 +728,9 @@ TableOperations.prototype.buttonPress = function(editor,button_id) {
            case "TO-toggle-borders":
                var tables = editor._doc.getElementsByTagName("table");
                if (tables.length != 0) {
-                       editor.borders = false;
-                       for (var ix=0; ix < tables.length; ix++) editor.borders = editor.borders || /htmlarea-showtableborders/.test(tables[ix].className);
-                       for ( ix=0; ix < tables.length; ix++) {
+                       editor.borders = true;
+                       for (var ix=0; ix < tables.length; ix++) editor.borders = editor.borders && /htmlarea-showtableborders/.test(tables[ix].className);
+                       for (ix=0; ix < tables.length; ix++) {
                                if (!editor.borders) HTMLArea._addClass(tables[ix],'htmlarea-showtableborders');
                                        else HTMLArea._removeClass(tables[ix],'htmlarea-showtableborders');
                        }
@@ -742,10 +741,6 @@ TableOperations.prototype.buttonPress = function(editor,button_id) {
        }
 };
 
-//// GENERIC CODE [style of any element; this should be moved into a separate
-//// file as it'll be very useful]
-//// BEGIN GENERIC CODE -----------------------------------------------------
-
 TableOperations.getLength = function(value) {
        var len = parseInt(value);
        if (isNaN(len)) len = "";
@@ -923,11 +918,17 @@ TableOperations.buildCellTypeFieldset = function(w,doc,editor,el,i18n,content) {
        var fieldset = doc.createElement("fieldset");
        TableOperations.insertLegend(doc, i18n, fieldset, "Cell Type and Scope");
        TableOperations.insertSpace(doc, fieldset);
-       var selectType = TableOperations.buildSelectField(doc, el, i18n, fieldset, "f_cell_type", "Type of cell", "fr", "", "Specifies the type of cell", ["Normal", "Header"], ["td", "th"], new RegExp(el.tagName.toLowerCase(), "i"));
+       var ul = doc.createElement("ul");
+       fieldset.appendChild(ul);
+       var li = doc.createElement("li");
+       ul.appendChild(li);
+       var selectType = TableOperations.buildSelectField(doc, el, i18n, li, "f_cell_type", "Type of cell", "fr", "", "Specifies the type of cell", ["Normal", "Header"], ["td", "th"], new RegExp(el.tagName.toLowerCase(), "i"));
        selectType.onchange = function() { TableOperations.setStyleOptions(doc, editor, el, i18n, this); };
+       var li = doc.createElement("li");
+       ul.appendChild(li);
        selected = el.scope.toLowerCase();
        (selected.match(/([^\s]*)\s/)) && (selected = RegExp.$1);
-       var selectScope = TableOperations.buildSelectField(doc, el, i18n, fieldset, "f_scope", "Scope", "fr", "", "Scope of header cell", ["Not set", "scope_row", "scope_column", "scope_rowgroup"], ["not set", "row", "col", "rowgroup"], new RegExp((selected ? selected : "not set"), "i"));
+       var selectScope = TableOperations.buildSelectField(doc, el, i18n, li, "f_scope", "Scope", "fr", "", "Scope of header cell", ["Not set", "scope_row", "scope_column", "scope_rowgroup"], ["not set", "row", "col", "rowgroup"], new RegExp((selected ? selected : "not set"), "i"));
        TableOperations.insertSpace(doc, fieldset);
        content.appendChild(fieldset);
 };
index ff596c9..b209ad4 100644 (file)
@@ -1,2 +1,2 @@
-UserElements=function(editor){this.editor=editor;var cfg=editor.config;var self=this;var actionHandlerFunctRef=UserElements.actionHandler(this);cfg.registerButton("UserElements",UserElements_langArray["Insert custom element"],editor.imgURL("ed_user.gif","UserElements"),false,actionHandlerFunctRef);};UserElements.I18N=UserElements_langArray;UserElements._pluginInfo={name:"UserElements",version:"1.3",developer:"Stanislas Rolland",developer_url:"http://www.fructifor.ca/",c_owner:"Stanislas Rolland",sponsor:"Fructifor Inc.",sponsor_url:"http://www.fructifor.ca/",license:"GPL"};UserElements.actionHandler=function(instance){return(function(editor){instance.buttonPress(editor);});};UserElements.prototype.buttonPress=function(editor){var editorNo=editor._doc._editorNo;var backreturn;var addUrlParams="?"+conf_RTEtsConfigParams;editor._popupDialog("../../mod1/popup.php"+addUrlParams+"&editorNo="+editorNo+"&popupname=user&srcpath="+encodeURI(rtePathUserFile),null,backreturn,550,350);return false;};
+UserElements=function(editor){this.editor=editor;var cfg=editor.config;var self=this;var actionHandlerFunctRef=UserElements.actionHandler(this);cfg.registerButton("UserElements",UserElements_langArray["Insert custom element"],editor.imgURL("ed_user.gif","UserElements"),false,actionHandlerFunctRef);};UserElements.I18N=UserElements_langArray;UserElements._pluginInfo={name:"UserElements",version:"1.5",developer:"Stanislas Rolland",developer_url:"http://www.fructifor.ca/",c_owner:"Stanislas Rolland",sponsor:"Fructifor Inc.",sponsor_url:"http://www.fructifor.ca/",license:"GPL"};UserElements.actionHandler=function(instance){return(function(editor){instance.buttonPress(editor);});};UserElements.prototype.buttonPress=function(editor){var editorNo=editor._doc._editorNo;var backreturn;var addUrlParams="?"+RTEarea[0]["RTEtsConfigParams"];editor._popupDialog(RTEarea[0]["pathUserModule"]+addUrlParams+"&editorNo="+editorNo,null,backreturn,550,350,null,"yes");return false;};
 
index f349606..7db7dae 100644 (file)
@@ -46,7 +46,7 @@ UserElements.I18N = UserElements_langArray;
 
 UserElements._pluginInfo = {
        name            : "UserElements",
-       version         : "1.3",
+       version         : "1.5",
        developer       : "Stanislas Rolland",
        developer_url   : "http://www.fructifor.ca/",
        c_owner         : "Stanislas Rolland",
@@ -64,7 +64,7 @@ UserElements.actionHandler = function(instance) {
 UserElements.prototype.buttonPress = function(editor) {
        var editorNo = editor._doc._editorNo;
        var backreturn;
-       var addUrlParams = "?" + conf_RTEtsConfigParams;
-       editor._popupDialog("../../mod1/popup.php" + addUrlParams + "&editorNo=" + editorNo + "&popupname=user&srcpath=" + encodeURI(rtePathUserFile), null, backreturn, 550, 350);
+       var addUrlParams = "?" + RTEarea[0]["RTEtsConfigParams"];
+       editor._popupDialog(RTEarea[0]["pathUserModule"] + addUrlParams + "&editorNo=" + editorNo, null, backreturn, 550, 350, null, "yes");
        return false;
 };
index 56c280a..dbe6e0d 100644 (file)
@@ -62,10 +62,9 @@ __dlg_loadStyle = function(url) {
 }
 
 __dlg_init = function(bottom,noResize) {
-       var body = document.body;
        window.dialogArguments = window.opener.Dialog._arguments;
                // resize if allowed
-       if (!HTMLArea.is_ie) {
+       if (HTMLArea.is_gecko && !HTMLArea.is_opera && !HTMLArea.is_safari) {
                setTimeout( function() {
                        try {
                                if (!noResize) window.sizeToContent();
@@ -78,31 +77,39 @@ __dlg_init = function(bottom,noResize) {
                        } catch(e) { };
                }, 25);
        } else {
-               var w = body.scrollWidth +12;
-               if (document.documentElement && document.documentElement.clientHeight) var h = document.documentElement.clientHeight;
-                       else var h = document.body.clientHeight;
-               if(h < body.scrollHeight) h = body.scrollHeight;
-               if(h < body.offsetHeight) h = body.offsetHeight;
-               
-                       // Sometimes IE is broken here, in those cases we wrap the inside of the body into a div with id = "content"
-                       // Then it seems that while the size of the body is wrong, the size of the div is right
-               var content = document.getElementById("content");
-               if(content) {
-                       var h = content.offsetHeight + 12;
-                       var w = content.offsetWidth + 12;
+               var innerX,innerY;
+               if (self.innerHeight) {
+                               // all except Explorer
+                       innerX = self.innerWidth;
+                       innerY = self.innerHeight;
+               } else if (document.documentElement && document.documentElement.clientHeight) {
+                               // Explorer 6 Strict Mode
+                       innerX = document.documentElement.clientWidth;
+                       innerY = document.documentElement.clientHeight;
+               } else if (document.body) {
+                               // other Explorers
+                       innerX = document.body.clientWidth;
+                       innerY = document.body.clientHeight;
                }
-               window.resizeTo(w, h);
-               if (document.documentElement && document.documentElement.clientHeight) {
-                       var ch = document.documentElement.clientHeight;
-                       var cw = document.documentElement.clientWidth;
+
+               var pageX,pageY;
+               var test1 = document.body.scrollHeight;
+               var test2 = document.body.offsetHeight
+               if (test1 > test2) {
+                               // all but Explorer Mac
+                       pageX = document.body.scrollWidth;
+                       pageY = document.body.scrollHeight;
                } else {
-                       var ch = body.clientHeight;
-                       var cw = body.clientWidth;
+                               // Explorer Mac;
+                               //would also work in Explorer 6 Strict, Mozilla and Safari
+                       pageX = document.body.offsetWidth;
+                       pageY = document.body.offsetHeight;
                }
-               window.resizeBy(w - cw, h - ch);
+               window.resizeBy(pageX - innerX, pageY - innerY);
+                       
                        // center on parent if allowed
-               var W = body.offsetWidth;
-               var H = body.offsetHeight;
+               var W = document.body.offsetWidth;
+               var H = document.body.offsetHeight;
                var x = (screen.availWidth - W) / 2;
                var y = (screen.availHeight - H) / 2;
                window.moveTo(x, y);
index db7d9c9..c959573 100644 (file)
@@ -1,2 +1,2 @@
-PopupWin=function(editor,_title,handler,initFunction,width,height,_opener){this.editor=editor;this.handler=handler;if(typeof(initFunction)=="undefined")var initFunction=window;this._geckoOpenModal(editor,_title,handler,initFunction,width,height,_opener);};PopupWin.prototype._parentEvent=function(ev){if(this.dialogWindow&&!this.dialogWindow.closed){if(!ev)var ev=this.dialogWindow.opener.event;HTMLArea._stopEvent(ev);this.dialogWindow.focus();};return false;};PopupWin.prototype._geckoOpenModal=function(editor,_title,handler,initFunction,width,height,_opener){if(!editor)var editor=this.editor;var dlg=editor._iframe.contentWindow.open("","","toolbar=no,menubar=no,personalbar=no,width="+(width?width:100)+",height="+(height?height:100)+",scrollbars=no,resizable=yes,modal=yes,dependent=yes,top=100,left=100");if(!dlg)var dlg=window.open("","","toolbar=no,menubar=no,personalbar=no,width="+(width?width:100)+",height="+(height?height:100)+",scrollbars=no,resizable=yes,modal=yes,dependent=yes,top=100,left=100");this.dialogWindow=dlg;if(typeof(_opener)!="undefined")this._opener=_opener;else this._opener=this.dialogWindow.opener;this._opener.dialog=this;if(Dialog._modal&&!Dialog._modal.closed)Dialog._dialog=this;var doc=this.dialogWindow.document;this.doc=doc;if(doc.all){doc.open();var html="<html><head></head><body></body></html>\n";doc.write(html);doc.close();};var html=doc.documentElement;html.className="popupwin";var head=doc.getElementsByTagName("head")[0];if(!doc.all)var head=doc.createElement("head");var title=doc.createElement("title");head.appendChild(title);doc.title=_title;var link=doc.createElement("link");link.rel="stylesheet";link.type="text/css";if(_editor_CSS.indexOf("http")==-1)link.href=_typo3_host_url+_editor_CSS;else link.href=_editor_CSS;head.appendChild(link);if(!doc.all)html.appendChild(head);var body=doc.body;if(!doc.all)var body=doc.createElement("body");body.className="popupwin dialog";body.id="--HA-body";var content=doc.createElement("div");content.className="content";this.content=content;body.appendChild(content);if(!doc.all)html.appendChild(body);this.element=body;initFunction(this);this.captureEvents();this.dialogWindow.focus();};PopupWin.prototype._dlg_close_on_esc=function(ev){if(!ev)var ev=window.event;if(ev.keyCode==27){this.close();return false;};return true;};PopupWin.prototype.callHandler=function(){var tags=["input","textarea","select"];var params=new Object();for(var ti=tags.length;--ti>=0;){var tag=tags[ti];var els=this.content.getElementsByTagName(tag);for(var j=0;j<els.length;++j){var el=els[j];var val=el.value;if(el.tagName.toLowerCase()=="input"){if(el.type=="checkbox"){val=el.checked;}};params[el.name]=val;}};this.handler(this,params);return false;};PopupWin.prototype.captureEvents=function(){var editor=this.editor;var _opener=this._opener;var self=this;function capwin(w){if(HTMLArea.is_gecko){w.addEventListener("focus",self._parentEvent,true);}else{HTMLArea._addEvent(w,"focus",function(ev){self._parentEvent(ev);});};for(var i=0;i<w.frames.length;i++){capwin(w.frames[i]);}};capwin(window);HTMLArea._addEvent(window,"unload",function(){self.releaseEvents();self.close();return false;});if(HTMLArea.is_gecko)HTMLArea._addEvent(editor._iframe.contentWindow,"unload",function(){self.releaseEvents();self.close();return false;});HTMLArea._addEvent(self.dialogWindow,"unload",function(){self.releaseEvents();self.close();return false;});HTMLArea._addEvent(self.doc,"keypress",function(ev){return self._dlg_close_on_esc(ev);});};PopupWin.prototype.releaseEvents=function(){var editor=this.editor;var _opener=this._opener;if(_opener&&!_opener.closed){var self=this;function relwin(w){if(HTMLArea.is_gecko)HTMLArea._removeEvent(w,"focus",self._parentEvent);else HTMLArea._removeEvent(w,"focus",function(ev){self._parentEvent(ev);});try{for(var i=0;i<w.frames.length;i++){relwin(w.frames[i]);};}catch(e){};};relwin(_opener);HTMLArea._removeEvent(_opener,"unload",function(){if(!self.dialogWindow.closed){self.releaseEvents();self.close();};return false;});if(HTMLArea.is_gecko)HTMLArea._addEvent(editor._iframe.contentWindow,"unload",function(){self.releaseEvents();self.close();return false;});}};PopupWin.prototype.close=function(){if(this.dialogWindow&&this.dialogWindow.dialog){this.dialogWindow.dialog.releaseEvents();this.dialogWindow.dialog.close();this.dialogWindow.dialog=null;};if(this.dialogWindow){this.releaseEvents();if(!this.dialogWindow.closed){this.dialogWindow.close();this.dialogWindow=null;}};if(HTMLArea.is_gecko&&this._opener){if(this._opener.dialog)this._opener.dialog=null;if(!this._opener.closed)this._opener.focus();}};PopupWin.prototype.addButtons=function(){var self=this;var div=this.doc.createElement("div");this.content.appendChild(div);div.className="buttons";for(var i=0;i<arguments.length;++i){var btn=arguments[i];var button=this.doc.createElement("button");div.appendChild(button);switch(btn){case "ok":button.innerHTML=HTMLArea.I18N.dialogs["OK"];button.onclick=function(){try{self.callHandler();}catch(e){};self.close();return false;};break;case "cancel":button.innerHTML=HTMLArea.I18N.dialogs["Cancel"];button.onclick=function(){self.close();return false;};break;}}};PopupWin.prototype.showAtElement=function(){var self=this;var doc=self.doc;var body=doc.body;if(!HTMLArea.is_ie){setTimeout(function(){try{self.dialogWindow.sizeToContent();self.dialogWindow.innerWidth+=20;}catch(e){};var x=self._opener.screenX+(self._opener.outerWidth-self.dialogWindow.outerWidth)/2;var y=self._opener.screenY+(self._opener.outerHeight-self.dialogWindow.outerHeight)/2;try{self.dialogWindow.moveTo(x,y);}catch(e){};},25);}else{var h=this.content.offsetHeight+12;var w=this.content.offsetWidth+12;self.dialogWindow.resizeTo(w,h);if(doc.documentElement&&doc.documentElement.clientHeight){var ch=doc.documentElement.clientHeight;var cw=doc.documentElement.clientWidth;}else{var ch=body.clientHeight;var cw=body.clientWidth;};self.dialogWindow.resizeBy(w-cw,h-ch);self.dialogWindow.moveTo((screen.availWidth-body.offsetWidth)/2,(screen.availHeight - body.offsetHeight)/2);}};
+PopupWin=function(editor,_title,handler,initFunction,width,height,_opener){this.editor=editor;this.handler=handler;if(typeof(initFunction)=="undefined")var initFunction=window;this._geckoOpenModal(editor,_title,handler,initFunction,width,height,_opener);};PopupWin.prototype._parentEvent=function(ev){if(this.dialogWindow&&!this.dialogWindow.closed){if(!ev)var ev=this.dialogWindow.opener.event;HTMLArea._stopEvent(ev);this.dialogWindow.focus();};return false;};PopupWin.prototype._geckoOpenModal=function(editor,_title,handler,initFunction,width,height,_opener){if(!editor)var editor=this.editor;var dlg=editor._iframe.contentWindow.open("","","toolbar=no,menubar=no,personalbar=no,width="+(width?width:100)+",height="+(height?height:100)+",scrollbars=no,resizable=yes,modal=yes,dependent=yes,top=100,left=100");if(!dlg)var dlg=window.open("","","toolbar=no,menubar=no,personalbar=no,width="+(width?width:100)+",height="+(height?height:100)+",scrollbars=no,resizable=yes,modal=yes,dependent=yes,top=100,left=100");this.dialogWindow=dlg;if(typeof(_opener)!="undefined")this._opener=_opener;else this._opener=this.dialogWindow.opener;this._opener.dialog=this;if(Dialog._modal&&!Dialog._modal.closed)Dialog._dialog=this;var doc=this.dialogWindow.document;this.doc=doc;if(doc.all){doc.open();var html="<html><head></head><body></body></html>\n";doc.write(html);doc.close();};var html=doc.documentElement;html.className="popupwin";var head=doc.getElementsByTagName("head")[0];if(!doc.all)var head=doc.createElement("head");var title=doc.createElement("title");head.appendChild(title);doc.title=_title;var link=doc.createElement("link");link.rel="stylesheet";link.type="text/css";if(_editor_CSS.indexOf("http")==-1)link.href=_typo3_host_url+_editor_CSS;else link.href=_editor_CSS;head.appendChild(link);if(!doc.all)html.appendChild(head);var body=doc.body;if(!doc.all)var body=doc.createElement("body");body.className="popupwin dialog";body.id="--HA-body";var content=doc.createElement("div");content.className="content";this.content=content;body.appendChild(content);if(!doc.all)html.appendChild(body);this.element=body;initFunction(this);this.captureEvents();this.dialogWindow.focus();};PopupWin.prototype._dlg_close_on_esc=function(ev){if(!ev)var ev=window.event;if(ev.keyCode==27){this.close();return false;};return true;};PopupWin.prototype.callHandler=function(){var tags=["input","textarea","select"];var params=new Object();for(var ti=tags.length;--ti>=0;){var tag=tags[ti];var els=this.content.getElementsByTagName(tag);for(var j=0;j<els.length;++j){var el=els[j];var val=el.value;if(el.tagName.toLowerCase()=="input"){if(el.type=="checkbox"){val=el.checked;}};params[el.name]=val;}};this.handler(this,params);return false;};PopupWin.prototype.captureEvents=function(){var editor=this.editor;var _opener=this._opener;var self=this;function capwin(w){if(HTMLArea.is_gecko){w.addEventListener("focus",self._parentEvent,true);}else{HTMLArea._addEvent(w,"focus",function(ev){self._parentEvent(ev);});};for(var i=0;i<w.frames.length;i++){capwin(w.frames[i]);}};capwin(window);HTMLArea._addEvent(window,"unload",function(){self.releaseEvents();self.close();return false;});if(HTMLArea.is_gecko)HTMLArea._addEvent(editor._iframe.contentWindow,"unload",function(){self.releaseEvents();self.close();return false;});HTMLArea._addEvent(self.dialogWindow,"unload",function(){self.releaseEvents();self.close();return false;});HTMLArea._addEvent(self.doc,"keypress",function(ev){return self._dlg_close_on_esc(ev);});};PopupWin.prototype.releaseEvents=function(){var editor=this.editor;var _opener=this._opener;if(_opener&&!_opener.closed){var self=this;function relwin(w){if(HTMLArea.is_gecko)HTMLArea._removeEvent(w,"focus",self._parentEvent);else HTMLArea._removeEvent(w,"focus",function(ev){self._parentEvent(ev);});try{for(var i=0;i<w.frames.length;i++){relwin(w.frames[i]);};}catch(e){};};relwin(_opener);HTMLArea._removeEvent(_opener,"unload",function(){if(!self.dialogWindow.closed){self.releaseEvents();self.close();};return false;});if(HTMLArea.is_gecko)HTMLArea._addEvent(editor._iframe.contentWindow,"unload",function(){self.releaseEvents();self.close();return false;});}};PopupWin.prototype.close=function(){if(this.dialogWindow&&this.dialogWindow.dialog){this.dialogWindow.dialog.releaseEvents();this.dialogWindow.dialog.close();this.dialogWindow.dialog=null;};if(this.dialogWindow){this.releaseEvents();if(!this.dialogWindow.closed){this.dialogWindow.close();this.dialogWindow=null;}};if(HTMLArea.is_gecko&&this._opener){if(this._opener.dialog)this._opener.dialog=null;if(!this._opener.closed)this._opener.focus();}};PopupWin.prototype.addButtons=function(){var self=this;var div=this.doc.createElement("div");this.content.appendChild(div);div.className="buttons";for(var i=0;i<arguments.length;++i){var btn=arguments[i];var button=this.doc.createElement("button");div.appendChild(button);switch(btn){case "ok":button.innerHTML=HTMLArea.I18N.dialogs["OK"];button.onclick=function(){try{self.callHandler();}catch(e){};self.close();return false;};break;case "cancel":button.innerHTML=HTMLArea.I18N.dialogs["Cancel"];button.onclick=function(){self.close();return false;};break;}}};PopupWin.prototype.showAtElement=function(){var popup=this;var doc=popup.dialogWindow.document;if(HTMLArea.is_gecko&&!HTMLArea.is_opera&&!HTMLArea.is_safari){setTimeout(function(){try{popup.dialogWindow.sizeToContent();popup.dialogWindow.innerWidth+=20;}catch(e){};var x=popup._opener.screenX+(popup._opener.outerWidth-popup.dialogWindow.outerWidth)/2;var y=popup._opener.screenY+(popup._opener.outerHeight-popup.dialogWindow.outerHeight)/2;try{popup.dialogWindow.moveTo(x,y);}catch(e){};},25);}else{var innerX,innerY;if(popup.dialogWindow.innerHeight){innerX=popup.dialogWindow.innerWidth;innerY=popup.dialogWindow.innerHeight;}else if(doc.documentElement&&doc.documentElement.clientHeight){innerX=doc.documentElement.clientWidth;innerY=doc.documentElement.clientHeight;}else if(document.body){innerX=doc.body.clientWidth;innerY=doc.body.clientHeight;};var pageX,pageY;var test1=doc.body.scrollHeight;var test2=doc.body.offsetHeight;if(test1>test2){pageX=doc.body.scrollWidth;pageY=doc.body.scrollHeight;}else{pageX=doc.body.offsetWidth;pageY=doc.body.offsetHeight;};popup.dialogWindow.resizeBy(pageX-innerX,pageY-innerY);popup.dialogWindow.moveTo((screen.availWidth-doc.body.offsetWidth)/2,(screen.availHeight - doc.body.offsetHeight)/2);}};
 
index 0fc9526..f144aa4 100644 (file)
@@ -225,47 +225,55 @@ PopupWin.prototype.addButtons = function() {
 
        // Resize the popup and center on screen
 PopupWin.prototype.showAtElement = function() {
-       var self = this;
-       var doc = self.doc;
-       var body = doc.body;
+       var popup = this;
+       var doc = popup.dialogWindow.document;
                // resize if allowed
-       if (!HTMLArea.is_ie) {
+       if (HTMLArea.is_gecko && !HTMLArea.is_opera && !HTMLArea.is_safari) {
                setTimeout( function() {
                        try {
-                               self.dialogWindow.sizeToContent();
-                               self.dialogWindow.innerWidth += 20;
+                               popup.dialogWindow.sizeToContent();
+                               popup.dialogWindow.innerWidth += 20;
                        } catch(e) { };
                                // center on parent if allowed
-                       var x = self._opener.screenX + (self._opener.outerWidth - self.dialogWindow.outerWidth) / 2;
-                       var y = self._opener.screenY + (self._opener.outerHeight - self.dialogWindow.outerHeight) / 2;
+                       var x = popup._opener.screenX + (popup._opener.outerWidth - popup.dialogWindow.outerWidth) / 2;
+                       var y = popup._opener.screenY + (popup._opener.outerHeight - popup.dialogWindow.outerHeight) / 2;
                        try {
-                               self.dialogWindow.moveTo(x, y);
+                               popup.dialogWindow.moveTo(x, y);
                        } catch(e) { };
                }, 25);
        } else {
-               /* Something broken in IE ...
-               var w = body.scrollWidth + 12;
-               if (doc.documentElement && doc.documentElement.clientHeight) var h = doc.documentElement.clientHeight;
-                       else var h = body.clientHeight;
-               if(h < body.scrollHeight) var h = body.scrollHeight;
-               if(h < body.offsetHeight) h = body.offsetHeight;
-               */
-               var h = this.content.offsetHeight + 12;
-               var w = this.content.offsetWidth + 12;
-               
-               self.dialogWindow.resizeTo(w, h);
-               
-               if (doc.documentElement && doc.documentElement.clientHeight) {
-                       var ch = doc.documentElement.clientHeight;
-                       var cw = doc.documentElement.clientWidth;
+               var innerX,innerY;
+               if (popup.dialogWindow.innerHeight) {
+                               // all except Explorer
+                       innerX = popup.dialogWindow.innerWidth;
+                       innerY = popup.dialogWindow.innerHeight;
+               } else if (doc.documentElement && doc.documentElement.clientHeight) {
+                               // Explorer 6 Strict Mode
+                       innerX = doc.documentElement.clientWidth;
+                       innerY = doc.documentElement.clientHeight;
+               } else if (document.body) {
+                               // other Explorers
+                       innerX = doc.body.clientWidth;
+                       innerY = doc.body.clientHeight;
+               }
+
+               var pageX,pageY;
+               var test1 = doc.body.scrollHeight;
+               var test2 = doc.body.offsetHeight;
+               if (test1 > test2) {
+                               // all but Explorer Mac
+                       pageX = doc.body.scrollWidth;
+                       pageY = doc.body.scrollHeight;
                } else {
-                       var ch = body.clientHeight;
-                       var cw = body.clientWidth;
+                               // Explorer Mac
+                               //would also work in Explorer 6 Strict, Mozilla and Safari
+                       pageX = doc.body.offsetWidth;
+                       pageY = doc.body.offsetHeight;
                }
-               self.dialogWindow.resizeBy(w - cw, h - ch);
+               popup.dialogWindow.resizeBy(pageX - innerX, pageY - innerY);
                
                        // center on parent if allowed
-               self.dialogWindow.moveTo((screen.availWidth - body.offsetWidth)/2,(screen.availHeight - body.offsetHeight)/2);
+               popup.dialogWindow.moveTo((screen.availWidth - doc.body.offsetWidth)/2,(screen.availHeight - doc.body.offsetHeight)/2);
        }
 };
 
index 2141f4b..1cdb146 100644 (file)
 
 error_reporting (E_ALL ^ E_NOTICE);
 unset($MCONF);
-require ('conf.php');
-require ($BACK_PATH.'init.php');
-require ($BACK_PATH.'template.php');
+require('conf.php');
+require($BACK_PATH.'init.php');
+require($BACK_PATH.'template.php');
+require_once('class.tx_rtehtmlarea_acronym.php');
 $LANG->includeLLFile('EXT:rtehtmlarea/mod2/locallang.xml');
-
-class tx_rtehtmlarea_acronym {
-       var $content;
-       var $modData;
-       var $doc;
-
-       /**
-        * @return      [type]          ...
-        */
-       function init() {
-               global $BE_USER,$LANG,$BACK_PATH;
-
-               $this->doc = t3lib_div::makeInstance("template");
-               $this->doc->backPath = $BACK_PATH;
-               $this->doc->bodyTagAdditions = 'class="popupwin" onload="init();"';
-               $this->doc->form = '<form action="" id="acronymForm" name="acronymForm" method="POST">';
-               $this->doc->JScode='
-               <script type="text/javascript">
-                       /*<![CDATA[*/
-                       var editor = parent.editor;
-                       var HTMLArea = parent.HTMLArea;
-                       var head = document.getElementsByTagName("head")[0];
-                       var link = document.createElement("link");
-                       link.rel = "stylesheet";
-                       link.href = parent._editor_CSS;
-                       head.appendChild(link);
-                       document.documentElement.className = "popupwin";
-                       var param = null;
-                       var html = editor.getSelectedHTML();
-                       var sel = editor._getSelection();
-                       var range = editor._createRange(sel);
-                       var abbr = editor._activeElement(sel);
-                       var abbrType = null;
-                       var acronyms = new Object();
-                       var abbreviations = new Object();
-                       if(!(abbr != null && (abbr.tagName.toLowerCase() == "acronym" || abbr.tagName.toLowerCase() == "abbr"))) { 
-                               abbr = editor._getFirstAncestor(sel, ["acronym", "abbr"]);
-                               if(abbr != null && (abbr.tagName.toLowerCase() == "acronym" || abbr.tagName.toLowerCase() == "abbr")) { 
-                                       param = { title : abbr.title, text : abbr.innerHTML};
-                                       abbrType = abbr.tagName.toLowerCase();
-                               } else {
-                                       param = { title : "", text : html};
-                               }
-                       }
-
-                       function setType() {
-                               if(document.acronymForm.acronym.checked) {
-                                       abbrType = "acronym";
-                                       document.getElementById("abbrType").innerHTML = "' . $LANG->getLL("Acronym") . '";
-                               } else {
-                                       abbrType = "abbr";
-                                       document.getElementById("abbrType").innerHTML = "' . $LANG->getLL("Abbreviation") . '";
-                               }
-                               document.getElementById("title").value = param["title"];
-                               fillSelect(param["text"]);
-                       }
-
-                       function init() {
-                               if(abbrType != null) document.getElementById("type").style.display = "none";
-                                       else abbrType = "abbr";
-                               if(HTMLArea.is_ie) document.getElementById("type").style.display = "none";
-                               if(abbrType == "acronym") document.acronymForm.acronym.checked = true;
-                                       else  document.acronymForm.abbreviation.checked = true;
-                               var acronymUrl = parent.window.opener.RTEarea[editor._doc._editorNo]["acronymUrl"];
-                               var abbrData = HTMLArea._getScript(0, false, acronymUrl);
-                               if(abbrData) eval(abbrData);
-                               setType();
-                               HTMLArea._addEvents(document.acronymForm.title,["keypress", "keydown", "dragdrop", "drop", "paste", "change"],function(ev) { document.acronymForm.termSelector.selectedIndex=-1; document.acronymForm.acronymSelector.selectedIndex=-1; });
-                               document.getElementById("title").focus();
-                       };
-
-                       function fillSelect(text) {
-                               var termSelector = document.getElementById("termSelector");
-                               var acronymSelector = document.getElementById("acronymSelector");
-                               while(termSelector.options.length>1) termSelector.options[termSelector.length-1] = null;
-                               while(acronymSelector.options.length>1) acronymSelector.options[acronymSelector.length-1] = null;
-                               if(abbrType == "acronym") var abbrObj = acronyms;
-                                       else var abbrObj = abbreviations;
-                               if(abbrObj != "") {
-                                       for(var i in abbrObj) {
-                                               same = (i==text);
-                                               termSelector.options[termSelector.options.length] = new Option(abbrObj[i], abbrObj[i], false, same);
-                                               acronymSelector.options[acronymSelector.options.length] = new Option(i, i, false, same);
-                                               if(same) document.acronymForm.title.value = abbrObj[i];
-                                       }
-                               }
-                               if(acronymSelector.options.length == 1) {
-                                       document.getElementById("selector").style.display = "none";
-                               } else {
-                                       document.getElementById("selector").style.display = "block";
-                               }
-                       };
-
-                       function processAcronym(title) {
-                               if (title == "" || title == null) {
-                                       if (abbr) {
-                                               var child = abbr.innerHTML;
-                                               abbr.parentNode.removeChild(abbr);
-                                               editor.insertHTML(child);
-                                       }
-                               } else {
-                                       var doc = editor._doc;
-                                       if (!abbr) {
-                                               abbr = doc.createElement(abbrType);
-                                               abbr.title = title;
-                                               if(document.acronymForm.acronymSelector.options.length != 1 && document.acronymForm.termSelector.selectedIndex > 0 && document.acronymForm.termSelector.options[document.acronymForm.termSelector.selectedIndex].value == title) html = document.acronymForm.acronymSelector.options[document.acronymForm.acronymSelector.selectedIndex].value;
-                                               abbr.innerHTML = html;
-                                               if (HTMLArea.is_ie) range.pasteHTML(abbr.outerHTML);
-                                                       else editor.insertNodeAtSelection(abbr);
-                                       } else {
-                                               abbr.title = title;
-                                               if(document.acronymForm.acronymSelector.options.length != 1 && document.acronymForm.termSelector.selectedIndex > 0 && document.acronymForm.termSelector.options[document.acronymForm.termSelector.selectedIndex].value == title) abbr.innerHTML = document.acronymForm.acronymSelector.options[document.acronymForm.acronymSelector.selectedIndex].value;
-                                       }
-                               }
-                       };
-
-                       function onOK() {
-                               processAcronym(document.getElementById("title").value);
-                               parent.__dlg_close(null);
-                               return false;
-                       };
-
-                       function onDelete() {
-                               processAcronym("");
-                               parent.__dlg_close(null);
-                               return false;
-                       };
-                       function onCancel() {
-                               parent.__dlg_close(null);
-                               return false;
-                       };
-                       /*]]>*/
-               </script>
-               ';
-
-               $this->modData = $BE_USER->getModuleData("acronym.php","ses");
-               if (t3lib_div::_GP("OC_key"))   {
-                       $parts = explode("|",t3lib_div::_GP("OC_key"));
-                       $this->modData["openKeys"][$parts[1]] = $parts[0]=="O" ? 1 : 0;
-                       $BE_USER->pushModuleData("acronym.php",$this->modData);
-               }
-       }
-
-       /**
-        * [Describe function...]
-        * 
-        * @return      [type]          ...
-        */
-       function main() {
-
-               $this->content="";
-               $this->content.=$this->main_acronym($this->modData["openKeys"]);
-       }
-
-       /**
-        * [Describe function...]
-        * 
-        * @return      [type]          ...
-        */
-       function printContent() {
-               echo $this->content;
-       }
-       
-       /**
-        * Rich Text Editor (RTE) acronym selector
-        * 
-        * @param       [type]          $openKeys: ...
-        * @return      [type]          ...
-        */
-       function main_acronym($openKeys)        {
-               global $LANG, $BE_USER;
-
-               $content.=$this->doc->startPage("RTE acronym");
-               $RTEtsConfigParts = explode(":",t3lib_div::_GP("RTEtsConfigParams"));
-               $RTEsetup = $BE_USER->getTSConfig("RTE",t3lib_BEfunc::getPagesTSconfig($RTEtsConfigParts[5]));
-               $thisConfig = t3lib_BEfunc::RTEsetup($RTEsetup["properties"],$RTEtsConfigParts[0],$RTEtsConfigParts[2],$RTEtsConfigParts[4]);
-
-               $content.='
-       <div class="title" id="abbrType">' . $LANG->getLL("Acronym") . '</div>
-       <fieldset id="type">
-               <legend>' . $LANG->getLL("Type_of_abridged_form") . '</legend>
-               <label for="abbreviation" class="checkbox">' . $LANG->getLL("Abbreviation") . '</label><input type="radio" name="type" id="abbreviation" value="abbreviation" checked="checked" onclick="setType();" />
-               <label for="acronym" class="checkbox">' . $LANG->getLL("Acronym") . '</label><input type="radio" name="type" id="acronym" value="acronym" onclick="setType();" />
-       </fieldset>
-       <fieldset id="selector">
-               <legend>' . $LANG->getLL("Defined_term") . '</legend>
-               <label for="termSelector" class="fl" id="termSelectorLabel" title="' . $LANG->getLL("Select_a_term") . '">' . $LANG->getLL("Unabridged_term") . '</label>
-               <select id="termSelector" name="termSelector"  title="' . $LANG->getLL("Select_a_term") . '"
-                       onChange="document.acronymForm.acronymSelector.selectedIndex=document.acronymForm.termSelector.selectedIndex; document.acronymForm.title.value=document.acronymForm.termSelector.options[document.acronymForm.termSelector.selectedIndex].value;">
-                       <option value=""></option>
-               </select>
-               <label for="acronymSelector" id="acronymSelectorLabel" title="' . $LANG->getLL("Select_an_acronym") . '">' . $LANG->getLL("Abridged_term") . '</label>
-               <select id="acronymSelector" name="acronymSelector"  title="' . $LANG->getLL("Select_an_acronym") . '"
-                       onChange="document.acronymForm.termSelector.selectedIndex=document.acronymForm.acronymSelector.selectedIndex; document.acronymForm.title.value=document.acronymForm.termSelector.options[document.acronymForm.termSelector.selectedIndex].value;">
-                       <option value=""></option>
-               </select>
-       </fieldset>
-       <fieldset>
-               <legend>' . $LANG->getLL("Term_to_abridge") . '</legend>
-               <label for="title" class="fl" title="' . $LANG->getLL('Use_this_term_explain') . '">' . $LANG->getLL('Use_this_term') . '</label>
-               <input type="text" id="title" name="title" size="60" title="' . $LANG->getLL('Use_this_term_explain') . '" />
-       </fieldset>
-       <div class="buttons">
-               <button type="button" title="' . $LANG->getLL("OK") . '"onclick="return onOK();">' . $LANG->getLL("OK") . '</button>
-               <button type="button" title="' . $LANG->getLL("Delete") . '" onclick="return onDelete();">' . $LANG->getLL("Delete") . '</button>
-               <button type="button" title="' . $LANG->getLL("Cancel")  . '" onclick="return onCancel();">' . $LANG->getLL("Cancel") . '</button>
-       </div>';
-       
-               $content.= $this->doc->endPage();
-               return $content;
-       }
-}
-
-if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rtehtmlarea/mod2/acronym.php'])       {
-       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rtehtmlarea/mod2/acronym.php']);
-}
-
-
+$LANG->includeLLFile('EXT:rtehtmlarea/htmlarea/locallang_dialogs.xml');
 
 // Make instance:
 $SOBE = t3lib_div::makeInstance('tx_rtehtmlarea_acronym');
diff --git a/typo3/sysext/rtehtmlarea/mod2/class.tx_rtehtmlarea_acronym.php b/typo3/sysext/rtehtmlarea/mod2/class.tx_rtehtmlarea_acronym.php
new file mode 100644 (file)
index 0000000..989fffa
--- /dev/null
@@ -0,0 +1,255 @@
+<?php
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 2005-2006 Stanislas Rolland <stanislas.rolland(arobas)fructifor.ca>
+*  All rights reserved
+*
+*  This script is part of the TYPO3 project. The TYPO3 project is 
+*  free software; you can redistribute it and/or modify
+*  it under the terms of the GNU General Public License as published by
+*  the Free Software Foundation; either version 2 of the License, or
+*  (at your option) any later version.
+*
+*  The GNU General Public License can be found at
+*  http://www.gnu.org/copyleft/gpl.html.
+*  A copy is found in the textfile GPL.txt and important notices to the license 
+*  from the author is found in LICENSE.txt distributed with these scripts.
+*
+*
+*  This script is distributed in the hope that it will be useful,
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*  GNU General Public License for more details.
+*
+*  This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+/** 
+ * Acronym content for htmlArea RTE
+ *
+ * @author     Stanislas Rolland <stanislas.rolland(arobas)fructifor.ca>
+ *
+ * $Id$  *
+ */
+
+class tx_rtehtmlarea_acronym {
+       var $content;
+       var $modData;
+       var $doc;
+
+       /**
+        * @return      [type]          ...
+        */
+       function init() {
+               global $BE_USER,$LANG,$BACK_PATH;
+               
+               $this->editorNo = t3lib_div::_GP('editorNo');
+               
+               $this->doc = t3lib_div::makeInstance('template');
+               $this->doc->docType = 'xhtml_trans';
+               $this->doc->backPath = $BACK_PATH;
+               
+               if ($this->doc->styleSheetFile_post) {
+                       $styleDir = dirname(dirname($this->doc->styleSheetFile_post));
+                       $this->doc->styleSheetFile_post = $styleDir.'/rtehtmlarea/htmlarea.css';
+               } else {
+                       $this->doc->styleSheetFile_post = $BACK_PATH . t3lib_extMgm::extRelPath('rtehtmlarea') . 'htmlarea/skins/default/htmlarea.css'; 
+               }
+               
+               $this->doc->JScode = '<script type="text/javascript" src="'. $BACK_PATH . t3lib_extMgm::extRelPath('rtehtmlarea') . 'htmlarea/popups/popup.js"></script>';
+               
+               $this->doc->bodyTagAdditions = 'class="popupwin" onload="init();"';
+               $this->doc->form = '<form action="" id="acronymForm" name="acronymForm" method="POST">';
+               $JScode='
+                       var editor = window.opener.RTEarea[' . $this->editorNo . ']["editor"];
+                       var HTMLArea = window.opener.HTMLArea;
+                       var param = null;
+                       var html = editor.getSelectedHTML();
+                       var sel = editor._getSelection();
+                       var range = editor._createRange(sel);
+                       var abbr = editor._activeElement(sel);
+                       var abbrType = null;
+                       var acronyms = new Object();
+                       var abbreviations = new Object();
+                       if(!(abbr != null && (abbr.tagName.toLowerCase() == "acronym" || abbr.tagName.toLowerCase() == "abbr"))) { 
+                               abbr = editor._getFirstAncestor(sel, ["acronym", "abbr"]);
+                               if(abbr != null && (abbr.tagName.toLowerCase() == "acronym" || abbr.tagName.toLowerCase() == "abbr")) { 
+                                       param = { title : abbr.title, text : abbr.innerHTML};
+                                       abbrType = abbr.tagName.toLowerCase();
+                               } else {
+                                       param = { title : "", text : html};
+                               }
+                       }
+                       
+                       function setType() {
+                               if(document.acronymForm.acronym.checked) {
+                                       abbrType = "acronym";
+                                       document.getElementById("abbrType").innerHTML = "' . $LANG->getLL('Acronym') . '";
+                               } else {
+                                       abbrType = "abbr";
+                                       document.getElementById("abbrType").innerHTML = "' . $LANG->getLL('Abbreviation') . '";
+                               }
+                               document.getElementById("title").value = param["title"];
+                               fillSelect(param["text"]);
+                               __dlg_init(null, false);
+                       }
+                       
+                       function init() {
+                               if(abbrType != null) document.getElementById("type").style.display = "none";
+                                       else abbrType = "abbr";
+                               if(HTMLArea.is_ie) document.getElementById("type").style.display = "none";
+                               if(abbrType == "acronym") document.acronymForm.acronym.checked = true;
+                                       else  document.acronymForm.abbreviation.checked = true;
+                               var acronymUrl = window.opener.RTEarea[editor._doc._editorNo]["acronymUrl"];
+                               var abbrData = HTMLArea._getScript(0, false, acronymUrl);
+                               if(abbrData) eval(abbrData);
+                               setType();
+                               HTMLArea._addEvents(document.acronymForm.title,["keypress", "keydown", "dragdrop", "drop", "paste", "change"],function(ev) { document.acronymForm.termSelector.selectedIndex=-1; document.acronymForm.acronymSelector.selectedIndex=-1; });
+                               document.body.onkeypress = __dlg_close_on_esc;
+                               document.getElementById("title").focus();
+                       };
+                       
+                       function fillSelect(text) {
+                               var termSelector = document.getElementById("termSelector");
+                               var acronymSelector = document.getElementById("acronymSelector");
+                               while(termSelector.options.length>1) termSelector.options[termSelector.length-1] = null;
+                               while(acronymSelector.options.length>1) acronymSelector.options[acronymSelector.length-1] = null;
+                               if(abbrType == "acronym") var abbrObj = acronyms;
+                                       else var abbrObj = abbreviations;
+                               if(abbrObj != "") {
+                                       for(var i in abbrObj) {
+                                               same = (i==text);
+                                               termSelector.options[termSelector.options.length] = new Option(abbrObj[i], abbrObj[i], false, same);
+                                               acronymSelector.options[acronymSelector.options.length] = new Option(i, i, false, same);
+                                               if(same) document.acronymForm.title.value = abbrObj[i];
+                                       }
+                               }
+                               if(acronymSelector.options.length == 1) {
+                                       document.getElementById("selector").style.display = "none";
+                               } else {
+                                       document.getElementById("selector").style.display = "block";
+                               }
+                       };
+                       
+                       function processAcronym(title) {
+                               if (title == "" || title == null) {
+                                       if (abbr) {
+                                               var child = abbr.innerHTML;
+                                               abbr.parentNode.removeChild(abbr);
+                                               editor.insertHTML(child);
+                                       }
+                               } else {
+                                       var doc = editor._doc;
+                                       if (!abbr) {
+                                               abbr = doc.createElement(abbrType);
+                                               abbr.title = title;
+                                               if(document.acronymForm.acronymSelector.options.length != 1 && document.acronymForm.termSelector.selectedIndex > 0 && document.acronymForm.termSelector.options[document.acronymForm.termSelector.selectedIndex].value == title) html = document.acronymForm.acronymSelector.options[document.acronymForm.acronymSelector.selectedIndex].value;
+                                               abbr.innerHTML = html;
+                                               if (HTMLArea.is_ie) range.pasteHTML(abbr.outerHTML);
+                                                       else editor.insertNodeAtSelection(abbr);
+                                       } else {
+                                               abbr.title = title;
+                                               if(document.acronymForm.acronymSelector.options.length != 1 && document.acronymForm.termSelector.selectedIndex > 0 && document.acronymForm.termSelector.options[document.acronymForm.termSelector.selectedIndex].value == title) abbr.innerHTML = document.acronymForm.acronymSelector.options[document.acronymForm.acronymSelector.selectedIndex].value;
+                                       }
+                               }
+                       };
+                       
+                       function onOK() {
+                               processAcronym(document.getElementById("title").value);
+                               __dlg_close(null);
+                               return false;
+                       };
+                       
+                       function onDelete() {
+                               processAcronym("");
+                               __dlg_close(null);
+                               return false;
+                       };
+                       function onCancel() {
+                               __dlg_close(null);
+                               return false;
+                       };
+               ';
+               
+               $this->doc->JScode .= $this->doc->wrapScriptTags($JScode);
+               
+               $this->modData = $BE_USER->getModuleData('acronym.php','ses');
+               $BE_USER->pushModuleData('acronym.php',$this->modData);
+       }
+       
+       /**
+        * [Describe function...]
+        * 
+        * @return      [type]          ...
+        */
+       function main() {
+               
+               $this->content='';
+               $this->content.=$this->main_acronym($this->modData['openKeys']);
+       }
+       
+       /**
+        * [Describe function...]
+        * 
+        * @return      [type]          ...
+        */
+       function printContent() {
+               echo $this->content;
+       }
+       
+       /**
+        * Rich Text Editor (RTE) acronym selector
+        * 
+        * @param       [type]          $openKeys: ...
+        * @return      [type]          ...
+        */
+       function main_acronym($openKeys)        {
+               global $LANG, $BE_USER;
+
+               $content.=$this->doc->startPage($LANG->getLL('Insert/Modify Acronym',1));
+               
+               $RTEtsConfigParts = explode(':',t3lib_div::_GP('RTEtsConfigParams'));
+               $RTEsetup = $BE_USER->getTSConfig('RTE',t3lib_BEfunc::getPagesTSconfig($RTEtsConfigParts[5]));
+               $thisConfig = t3lib_BEfunc::RTEsetup($RTEsetup['properties'],$RTEtsConfigParts[0],$RTEtsConfigParts[2],$RTEtsConfigParts[4]);
+               
+               $content.='
+       <div class="title" id="abbrType">' . $LANG->getLL('Acronym',1) . '</div>
+       <fieldset id="type">
+               <legend>' . $LANG->getLL('Type_of_abridged_form',1) . '</legend>
+               <label for="abbreviation" class="checkbox">' . $LANG->getLL('Abbreviation',1) . '</label><input type="radio" name="type" id="abbreviation" value="abbreviation" checked="checked" onclick="setType();" />
+               <label for="acronym" class="checkbox">' . $LANG->getLL('Acronym',1) . '</label><input type="radio" name="type" id="acronym" value="acronym" onclick="setType();" />
+       </fieldset>
+       <fieldset id="selector">
+               <legend>' . $LANG->getLL('Defined_term',1) . '</legend>
+               <label for="termSelector" class="fl" id="termSelectorLabel" title="' . $LANG->getLL('Select_a_term',1) . '">' . $LANG->getLL('Unabridged_term',1) . '</label>
+               <select id="termSelector" name="termSelector"  title="' . $LANG->getLL('Select_a_term',1) . '"
+                       onChange="document.acronymForm.acronymSelector.selectedIndex=document.acronymForm.termSelector.selectedIndex; document.acronymForm.title.value=document.acronymForm.termSelector.options[document.acronymForm.termSelector.selectedIndex].value;">
+                       <option value=""></option>
+               </select>
+               <label for="acronymSelector" id="acronymSelectorLabel" title="' . $LANG->getLL('Select_an_acronym',1) . '">' . $LANG->getLL('Abridged_term',1) . '</label>
+               <select id="acronymSelector" name="acronymSelector"  title="' . $LANG->getLL('Select_an_acronym',1) . '"
+                       onChange="document.acronymForm.termSelector.selectedIndex=document.acronymForm.acronymSelector.selectedIndex; document.acronymForm.title.value=document.acronymForm.termSelector.options[document.acronymForm.termSelector.selectedIndex].value;">
+                       <option value=""></option>
+               </select>
+       </fieldset>
+       <fieldset>
+               <legend>' . $LANG->getLL('Term_to_abridge',1) . '</legend>
+               <label for="title" class="fl" title="' . $LANG->getLL('Use_this_term_explain',1) . '">' . $LANG->getLL('Use_this_term',1) . '</label>
+               <input type="text" id="title" name="title" size="60" title="' . $LANG->getLL('Use_this_term_explain',1) . '" />
+       </fieldset>
+       <div class="buttons">
+               <button type="button" title="' . $LANG->getLL('OK',1) . '"onclick="return onOK();">' . $LANG->getLL('OK',1) . '</button>
+               <button type="button" title="' . $LANG->getLL('Delete',1) . '" onclick="return onDelete();">' . $LANG->getLL('Delete',1) . '</button>
+               <button type="button" title="' . $LANG->getLL('Cancel',1)  . '" onclick="return onCancel();">' . $LANG->getLL('Cancel',1) . '</button>
+       </div>';
+       
+               $content.= $this->doc->endPage();
+               return $content;
+       }
+}
+
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rtehtmlarea/mod2/class.tx_rtehtmlarea_acronym.php'])  {
+       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rtehtmlarea/mod2/class.tx_rtehtmlarea_acronym.php']);
+}
+
+?>
index 0368c17..8d34dd9 100644 (file)
@@ -30,9 +30,6 @@
  * Used from TCEFORMS an other elements
  * In other words: This is the ELEMENT BROWSER!
  *
- * Revised for TYPO3 3.6 November/2003 by Kasper Skaarhoj
- * XHTML compliant
- *
  * Adapted for htmlArea RTE by Stanislas Rolland
  *
  * $Id$
  * @author     Kasper Skaarhoj <kasperYYYY@typo3.com>
  * @author     Stanislas Rolland <stanislas.rolland(arobas)fructifor.ca>
  */
-/**
- * [CLASS/FUNCTION INDEX of SCRIPT]
- *
- *
- *
- *  157: class TBE_browser_recordList extends localRecordList
- *  168:     function listURL($altId='',$table=-1,$exclList='')
- *  187:     function ext_addP()
- *  204:     function linkWrapItems($table,$uid,$code,$row)
- *  237:     function linkWrapTable($table,$code)
- *
- *
- *  254: class localPageTree extends t3lib_browseTree
- *  261:     function localPageTree()
- *  275:     function wrapTitle($title,$v,$ext_pArrPages='')
- *  290:     function printTree($treeArr='')
- *  340:     function ext_isLinkable($doktype,$uid)
- *  354:     function PM_ATagWrap($icon,$cmd,$bMark='')
- *  371:     function wrapIcon($icon,$row)
- *
- *
- *  390: class rtePageTree extends localPageTree
- *
- *
- *  407: class TBE_PageTree extends localPageTree
- *  416:     function ext_isLinkable($doktype,$uid)
- *  428:     function wrapTitle($title,$v,$ext_pArrPages)
- *
- *
- *  454: class localFolderTree extends t3lib_folderTree
- *  464:     function wrapTitle($title,$v)
- *  479:     function ext_isLinkable($v)
- *  496:     function PM_ATagWrap($icon,$cmd,$bMark='')
- *  511:     function printTree($treeArr='')
- *
- *
- *  577: class rteFolderTree extends localFolderTree
- *
- *
- *  593: class TBE_FolderTree extends localFolderTree
- *  602:     function ext_isLinkable($v)
- *  615:     function wrapTitle($title,$v)
- *
- *
- *  636: class SC_browse_links
- *  729:     function init()
- *  984:     function main()
- * 1026:     function printContent()
- *
- *              SECTION: Main functions
- * 1057:     function main_rte($wiz=0)
- * 1336:     function main_db()
- * 1380:     function main_file()
- *
- *              SECTION: Record listing
- * 1489:     function expandPage()
- * 1568:     function TBE_expandPage($tables)
- *
- *              SECTION: File listing
- * 1661:     function expandFolder($expandFolder=0,$extensionList='')
- * 1730:     function TBE_expandFolder($expandFolder=0,$extensionList='',$noThumbs=0)
- * 1753:     function fileList($files, $folderName='', $noThumbs=0)
- * 1870:     function TBE_dragNDrop($expandFolder=0,$extensionList='')
- *
- *              SECTION: Miscellaneous functions
- * 1997:     function isWebFolder($folder)
- * 2008:     function checkFolder($folder)
- * 2021:     function barheader($str)
- * 2038:     function getMsgBox($in_msg,$icon='icon_note')
- * 2060:     function printCurrentUrl($str)
- * 2080:     function parseCurUrl($href,$siteUrl)
- * 2142:     function uploadForm($path)
- * 2195:     function createFolder($path)
- *
- * TOTAL FUNCTIONS: 38
- * (This index is automatically created/updated by the extension "extdeveval")
- *
- */
 
 error_reporting (E_ALL ^ E_NOTICE);
 unset($MCONF);
-require ('conf.php');
-require ($BACK_PATH.'init.php');
-require ($BACK_PATH.'template.php');
-require_once (PATH_t3lib.'class.t3lib_browsetree.php');
-require_once (PATH_t3lib.'class.t3lib_foldertree.php');
-require_once (PATH_t3lib.'class.t3lib_stdgraphic.php');
-require_once (PATH_t3lib.'class.t3lib_basicfilefunc.php');
-
+require('conf.php');
+require($BACK_PATH.'init.php');
+require($BACK_PATH.'template.php');
+require_once('class.tx_rtehtmlarea_browse_links.php');
 $LANG->includeLLFile('EXT:rtehtmlarea/mod3/locallang.xml');
-
-       // Include classes
-require_once (PATH_t3lib.'class.t3lib_page.php');
-require_once (PATH_t3lib.'class.t3lib_recordlist.php');
-require_once ($BACK_PATH.'class.db_list.inc');
-require_once ($BACK_PATH.'class.db_list_extra.inc');
-
-
-/**
- * Local version of the record list.
- *
- * @author     Kasper Skaarhoj <kasperYYYY@typo3.com>
- * @package TYPO3
- * @subpackage core
- */
-class TBE_browser_recordList extends localRecordList {
-
-       /**
-        * Creates the URL for links
-        *
-        * @param       mixed           If not blank string, this is used instead of $this->id as the id value.
-        * @param       string          If this is "-1" then $this->table is used, otherwise the value of the input variable.
-        * @param       string          Commalist of fields NOT to pass as parameters (currently "sortField" and "sortRev")
-        * @return      string          Query-string for URL
-        */
-       function listURL($altId='',$table=-1,$exclList='')      {
-               return $BACK_PATH . t3lib_extMgm::extRelPath('rtehtmlarea') . 'mod3/' . $this->script .
-                       '?id='.(strcmp($altId,'')?$altId:$this->id).
-                       '&table='.rawurlencode($table==-1?$this->table:$table).
-                       ($this->thumbs?'&imagemode='.$this->thumbs:'').
-                       ($this->searchString?'&search_field='.rawurlencode($this->searchString):'').
-                       ($this->searchLevels?'&search_levels='.rawurlencode($this->searchLevels):'').
-                       ((!$exclList || !t3lib_div::inList($exclList,'sortField')) && $this->sortField?'&sortField='.rawurlencode($this->sortField):'').
-                       ((!$exclList || !t3lib_div::inList($exclList,'sortRev')) && $this->sortRev?'&sortRev='.rawurlencode($this->sortRev):'').
-                               // extra:
-                       $this->ext_addP()
-                       ;
-       }
-
-       /**
-        * Returns additional, local GET parameters to include in the links of the record list.
-        *
-        * @return      string
-        */
-       function ext_addP()     {
-               $str = '&act='.$GLOBALS['SOBE']->act.
-                               '&mode='.$GLOBALS['SOBE']->mode.
-                               '&expandPage='.$GLOBALS['SOBE']->expandPage.
-                               '&bparams='.rawurlencode($GLOBALS['SOBE']->bparams);
-               return $str;
-       }
-
-       /**
-        * Returns the title (based on $code) of a record (from table $table) with the proper link around (that is for "pages"-records a link to the level of that record...)
-        *
-        * @param       string          Table name
-        * @param       integer         UID (not used here)
-        * @param       string          Title string
-        * @param       array           Records array (from table name)
-        * @return      string
-        */
-       function linkWrapItems($table,$uid,$code,$row)  {
-               global $TCA, $BACK_PATH;
-
-               if (!$code) {
-                       $code = '<i>['.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.no_title',1).']</i>';
-               } else {
-                       if(t3lib_div::int_from_ver($GLOBALS['TYPO_VERSION']) >= 3007000 ) {
-                               $code = htmlspecialchars(t3lib_div::fixed_lgd_cs($code,$this->fixedL));
-                       } else {
-                               $code = htmlspecialchars(t3lib_div::fixed_lgd($code,$this->fixedL));
-                       }
-               }
-
-               $titleCol = $TCA[$table]['ctrl']['label'];
-               $title = $row[$titleCol];
-
-               $ficon = t3lib_iconWorks::getIcon($table,$row);
-               $aOnClick = "return insertElement('".$table."', '".$row['uid']."', 'db', unescape('".rawurlencode($title)."'), '', '', '".$ficon."');";
-               $ATag = '<a href="#" onclick="'.htmlspecialchars($aOnClick).'">';
-               $ATag_alt = substr($ATag,0,-4).',\'\',1);">';
-               $ATag_e = '</a>';
-
-               return $ATag.
-                               '<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/plusbullet2.gif','width="18" height="16"').' title="'.$GLOBALS['LANG']->getLL('addToList',1).'" alt="" />'.
-                               $ATag_e.
-                               $ATag_alt.
-                               $code.
-                               $ATag_e;
-       }
-
-       /**
-        * Returns the title (based on $code) of a table ($table) without a link
-        *
-        * @param       string          Table name
-        * @param       string          Table label
-        * @return      string          The linked table label
-        */
-       function linkWrapTable($table,$code)    {
-               return $code;
-       }
-}
+$LANG->includeLLFile('EXT:rtehtmlarea/htmlarea/locallang_dialogs.xml');
 
 /**
- * Class which generates the page tree
+ * Script class for the Element Browser window.
  *
  * @author     Kasper Skaarhoj <kasperYYYY@typo3.com>
  * @package TYPO3
  * @subpackage core
  */
-class localPageTree extends t3lib_browseTree {
-
+class tx_rtehtmlarea_SC_browse_links {
+       var $mode;
+       
        /**
-        * Constructor. Just calling init()
+        * Main function, detecting the current mode of the element browser and branching out to internal methods.
         *
         * @return      void
         */
-       function localPageTree() {
-               $this->init();
-               $this->clause = ' AND doktype!=255'.$this->clause;
-       }
-
-       /**
-        * Wrapping the title in a link, if applicable.
-        *
-        * @param       string          Title, (must be ready for output, that means it must be htmlspecialchars()'ed).
-        * @param       array           The record
-        * @param       boolean         (Ignore)
-        * @return      string          Wrapping title string.
-        */
-       function wrapTitle($title,$v,$ext_pArrPages='') {
-               if ($this->ext_isLinkable($v['doktype'],$v['uid']))     {
-                       $aOnClick = "return link_typo3Page('".$v['uid']."');";
-                       return '<a href="#" onclick="'.htmlspecialchars($aOnClick).'">'.$title.'</a>';
-               } else {
-                       return '<span style="color: #666666;">'.$title.'</span>';
+       function main() {
+               global $BE_USER, $SOBE;
+               
+               $this->mode = t3lib_div::_GP('mode');
+               if (!$this->mode)       {
+                       $this->mode = 'rte';
                }
-       }
-
-       /**
-        * Create the page navigation tree in HTML
-        *
-        * @param       array           Tree array
-        * @return      string          HTML output.
-        */
-       function printTree($treeArr='') {
-               global $BACK_PATH;
-               $titleLen=intval($GLOBALS['BE_USER']->uc['titleLen']);
-               if (!is_array($treeArr))        $treeArr=$this->tree;
 
-               $out='';
-               $c=0;
+               $this->content = '';
 
-               foreach($treeArr as $k => $v)   {
-                       $c++;
-                       $bgColorClass = ($c+1)%2 ? 'bgColor' : 'bgColor-10';
-                       if ($GLOBALS['SOBE']->curUrlInfo['act']=='page' && $GLOBALS['SOBE']->curUrlInfo['pageid']==$v['row']['uid'] && $GLOBALS['SOBE']->curUrlInfo['pageid'])  {
-                               $arrCol='<td><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/blinkarrow_right.gif','width="5" height="9"').' class="c-blinkArrowR" alt="" /></td>';
-                               $bgColorClass='bgColor4';
-                       } else {
-                               $arrCol='<td></td>';
+                       // render type by user func
+               $browserRendered = false;
+               if (is_array ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/browse_links.php']['browserRendering'])) {
+                       foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/browse_links.php']['browserRendering'] as $classRef) {
+                               $browserRenderObj = t3lib_div::getUserObj($classRef);
+                               if(is_object($browserRenderObj) && method_exists($browserRenderObj, 'isValid') && method_exists($browserRenderObj, 'render'))   {
+                                       if ($browserRenderObj->isValid($this->mode, $this)) {
+                                               $this->content .=  $browserRenderObj->render($this->mode, $this);
+                                               $browserRendered = true;
+                                               break;
+                                       }
+                               }
                        }
-
-                       $aOnClick = 'return jumpToUrl(\''.$this->thisScript.'?act='.$GLOBALS['SOBE']->act.'&mode='.$GLOBALS['SOBE']->mode.'&expandPage='.$v['row']['uid'].'\');';
-                       $cEbullet = $this->ext_isLinkable($v['row']['doktype'],$v['row']['uid']) ?
-                                               '<a href="#" onclick="'.htmlspecialchars($aOnClick).'"><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/ol/arrowbullet.gif','width="18" height="16"').' alt="" /></a>' :
-                                               '';
-                       $out.='
-                               <tr class="'.$bgColorClass.'">
-                                       <td nowrap="nowrap">'.
-                                       $v['HTML'].
-                                       $this->wrapTitle($this->getTitleStr($v['row'],$titleLen),$v['row'],$this->ext_pArrPages).
-                                       '</td>'.
-                                       $arrCol.
-                                       '<td>'.$cEbullet.'</td>
-                               </tr>';
-               }
-               $out='
-                       <!--
-                               Navigation Page Tree:
-                       -->
-                       <table border="0" cellpadding="0" cellspacing="0" id="typo3-tree">
-                               '.$out.'
-                       </table>';
-               return $out;
-       }
-
-       /**
-        * Returns true if a doktype can be linked.
-        *
-        * @param       integer         Doktype value to test
-        * @param       integer         uid to test.
-        * @return      boolean
-        */
-       function ext_isLinkable($doktype,$uid)  {
-               if ($uid && $doktype<199)       {
-                       return true;
-               }
-       }
-
-       /**
-        * Wrap the plus/minus icon in a link
-        *
-        * @param       string          HTML string to wrap, probably an image tag.
-        * @param       string          Command for 'PM' get var
-        * @param       boolean         If set, the link will have a anchor point (=$bMark) and a name attribute (=$bMark)
-        * @return      string          Link-wrapped input string
-        */
-       function PM_ATagWrap($icon,$cmd,$bMark='')      {
-               if ($bMark)     {
-                       $anchor = '#'.$bMark;
-                       $name=' name="'.$bMark.'"';
-               }
-               $aOnClick = "return jumpToUrl('".$this->script.'?PM='.$cmd."','".$anchor."');";
-
-               return '<a href="#"'.$name.' onclick="'.htmlspecialchars($aOnClick).'">'.$icon.'</a>';
-       }
-
-       /**
-        * Wrapping the image tag, $icon, for the row, $row
-        *
-        * @param       string          The image tag for the icon
-        * @param       array           The row for the current element
-        * @return      string          The processed icon input value.
-        */
-       function wrapIcon($icon,$row)   {
-               return $this->addTagAttributes($icon,' title="id='.$row['uid'].'"');
-       }
-}
-
-/**
- * Page tree for the RTE - totally the same, no changes needed. (Just for the sake of beauty - or confusion... :-)
- *
- * @author     Kasper Skaarhoj <kasperYYYY@typo3.com>
- * @package TYPO3
- * @subpackage core
- */
-class rtePageTree extends localPageTree {
-}
-
-/**
- * For TBE record browser
- *
- * @author     Kasper Skaarhoj <kasperYYYY@typo3.com>
- * @package TYPO3
- * @subpackage core
- */
-class TBE_PageTree extends localPageTree {
-
-       /**
-        * Returns true if a doktype can be linked (which is always the case here).
-        *
-        * @param       integer         Doktype value to test
-        * @param       integer         uid to test.
-        * @return      boolean
-        */
-       function ext_isLinkable($doktype,$uid)  {
-               return true;
-       }
-
-       /**
-        * Wrapping the title in a link, if applicable.
-        *
-        * @param       string          Title, ready for output.
-        * @param       array           The record
-        * @param       boolean         If set, pages clicked will return immediately, otherwise reload page.
-        * @return      string          Wrapping title string.
-        */
-       function wrapTitle($title,$v,$ext_pArrPages)    {
-               if ($ext_pArrPages)     {
-                       $ficon=t3lib_iconWorks::getIcon('pages',$v);
-                       $onClick = "return insertElement('pages', '".$v['uid']."', 'db', unescape('".rawurlencode($v['title'])."'), '', '', '".$ficon."','',1);";
-               } else {
-                       $onClick = 'return jumpToUrl(\'' . $this->thisScript . '?act='.$GLOBALS['SOBE']->act.'&mode='.$GLOBALS['SOBE']->mode.'&expandPage='.$v['uid'].'\');';
                }
-               return '<a href="#" onclick="'.htmlspecialchars($onClick).'">'.$title.'</a>';
-       }
-}
 
-/**
- * Base extension class which generates the folder tree.
- * Used directly by the RTE.
- *
- * @author     Kasper Skaarhoj <kasperYYYY@typo3.com>
- * @package TYPO3
- * @subpackage core
- */
-class localFolderTree extends t3lib_folderTree {
-       var $ext_IconMode=1;
+                       // if type was not rendered use default rendering functions
+               if(!$browserRendered) {
 
-       /**
-        * Wrapping the title in a link, if applicable.
-        *
-        * @param       string          Title, ready for output.
-        * @param       array           The "record"
-        * @return      string          Wrapping title string.
-        */
-       function wrapTitle($title,$v)   {
-               if ($this->ext_isLinkable($v))  {
-                       $aOnClick = 'return jumpToUrl(\''.$this->thisScript.'?act='.$GLOBALS['SOBE']->act.'&mode='.$GLOBALS['SOBE']->mode.'&expandFolder='.rawurlencode($v['path']).'\');';
-                       return '<a href="#" onclick="'.htmlspecialchars($aOnClick).'">'.$title.'</a>';
-               } else {
-                       return '<span class="typo3-dimmed">'.$title.'</span>';
-               }
-       }
+                       $SOBE->browser = t3lib_div::makeInstance('tx_rtehtmlarea_browse_links');
+                       $SOBE->browser->init();
+                       
+                       $modData = $BE_USER->getModuleData('browse_links.php','ses');
+                       list($modData, $store) = $SOBE->browser->processSessionData($modData);
+                       $BE_USER->pushModuleData('browse_links.php',$modData);
 
-       /**
-        * Returns true if the input "record" contains a folder which can be linked.
-        *
-        * @param       array           Array with information about the folder element. Contains keys like title, uid, path, _title
-        * @return      boolean         True is returned if the path is found in the web-part of the the server and is NOT a recycler or temp folder
-        */
-       function ext_isLinkable($v)     {
-               $webpath=t3lib_BEfunc::getPathType_web_nonweb($v['path']);      // Checking, if the input path is a web-path.
-               if (strstr($v['path'],'_recycler_') || strstr($v['path'],'_temp_') || $webpath!='web')  {
-                       return 0;
+                                                       // Output the correct content according to $this->mode
+                       switch((string)$this->mode)     {
+                               case 'rte':
+                                       $this->content = $SOBE->browser->main_rte();
+                               break;
+                               case 'db':
+                                       $this->content = $SOBE->browser->main_db();
+                               break;
+                               case 'file':
+                               case 'filedrag':
+                                       $this->content = $SOBE->browser->main_file();
+                               break;
+                               case 'wizard':
+                                       $this->content = $SOBE->browser->main_rte(1);
+                               break;
+                       }
                }
-               return 1;
        }
 
        /**
-        * Wrap the plus/minus icon in a link
+        * Print module content
         *
-        * @param       string          HTML string to wrap, probably an image tag.
-        * @param       string          Command for 'PM' get var
-        * @param       boolean         If set, the link will have a anchor point (=$bMark) and a name attribute (=$bMark)
-        * @return      string          Link-wrapped input string
-        * @access private
+        * @return      void
         */
-       function PM_ATagWrap($icon,$cmd,$bMark='')      {
-               if ($bMark)     {
-                       $anchor = '#'.$bMark;
-                       $name=' name="'.$bMark.'"';
-               }
-               $aOnClick = 'return jumpToUrl(\''.$this->thisScript.'?PM='.$cmd.'\',\''.$anchor.'\');';
-               return '<a href="#"'.$name.' onclick="'.htmlspecialchars($aOnClick).'">'.$icon.'</a>';
+       function printContent() {
+               echo $this->content;
        }
 
-       /**
-        * Create the folder navigation tree in HTML
-        *
-        * @param       mixed           Input tree array. If not array, then $this->tree is used.
-        * @return      string          HTML output of the tree.
-        */
-       function printTree($treeArr='') {
-               global $BACK_PATH;
-               $titleLen=intval($GLOBALS['BE_USER']->uc['titleLen']);
-
-               if (!is_array($treeArr))        $treeArr=$this->tree;
-               $out='';
-               $c=0;
-                       // Preparing the current-path string (if found in the listing we will see a red blinking arrow).
-               if (!$GLOBALS['SOBE']->curUrlInfo['value'])     {
-                       $cmpPath='';
-               } else if (substr(trim($GLOBALS['SOBE']->curUrlInfo['info']),-1)!='/')  {
-                       $cmpPath=PATH_site.dirname($GLOBALS['SOBE']->curUrlInfo['info']).'/';
-               } else {
-                       $cmpPath=PATH_site.$GLOBALS['SOBE']->curUrlInfo['info'];
-               }
-
-                       // Traverse rows for the tree and print them into table rows:
-               foreach($treeArr as $k => $v)   {
-                       $c++;
-                       $bgColorClass=($c+1)%2 ? 'bgColor' : 'bgColor-10';
-
-                               // Creating blinking arrow, if applicable:
-                       if ($GLOBALS['SOBE']->curUrlInfo['act']=='file' && $cmpPath==$v['row']['path']) {
-                               $arrCol='<td><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/blinkarrow_right.gif','width="5" height="9"').' class="c-blinkArrowR" alt="" /></td>';
-                               $bgColorClass='bgColor4';
-                       } else {
-                               $arrCol='<td></td>';
-                       }
-                               // Create arrow-bullet for file listing (if folder path is linkable):
-                       $aOnClick = 'return jumpToUrl(\''.$this->thisScript.'?act='.$GLOBALS['SOBE']->act.'&mode='.$GLOBALS['SOBE']->mode.'&expandFolder='.rawurlencode($v['row']['path']).'\');';
-                       $cEbullet = $this->ext_isLinkable($v['row']) ? '<a href="#" onclick="'.htmlspecialchars($aOnClick).'"><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/ol/arrowbullet.gif','width="18" height="16"').' alt="" /></a>' : '';
-
-                               // Put table row with folder together:
-                       if(t3lib_div::int_from_ver($GLOBALS['TYPO_VERSION']) >= 3007000 ) {
-                               $out.='
-                                       <tr class="'.$bgColorClass.'">
-                                               <td nowrap="nowrap">'.$v['HTML'].$this->wrapTitle(t3lib_div::fixed_lgd_cs($v['row']['title'],$titleLen),$v['row']).'</td>
-                                               '.$arrCol.'
-                                               <td>'.$cEbullet.'</td>
-                                       </tr>';
-                       } else {
-                               $out.='
-                                       <tr class="'.$bgColorClass.'">
-                                               <td nowrap="nowrap">'.$v['HTML'].$this->wrapTitle(t3lib_div::fixed_lgd($v['row']['title'],$titleLen),$v['row']).'</td>
-                                               '.$arrCol.'
-                                               <td>'.$cEbullet.'</td>
-                                       </tr>';
-                       }
-               }
-
-               $out='
-                       <!--
-                               Folder tree:
-                       -->
-                       <table border="0" cellpadding="0" cellspacing="0" id="typo3-tree">
-                               '.$out.'
-                       </table>';
-               return $out;
-       }
-}
 
-/**
- * Folder tree for the RTE - totally the same, no changes needed. (Just for the sake of beauty - or confusion... :-)
- *
- * @author     Kasper Skaarhoj <kasperYYYY@typo3.com>
- * @package TYPO3
- * @subpackage core
- */
-class rteFolderTree extends localFolderTree {
 }
 
-/**
- * For TBE File Browser
- *
- * @author     Kasper Skaarhoj <kasperYYYY@typo3.com>
- * @package TYPO3
- * @subpackage core
- */
-class TBE_FolderTree extends localFolderTree {
-       var $ext_noTempRecyclerDirs=0;          // If file-drag mode is set, temp and recycler folders are filtered out.
-
-       /**
-        * Returns true if the input "record" contains a folder which can be linked.
-        *
-        * @param       array           Array with information about the folder element. Contains keys like title, uid, path, _title
-        * @return      boolean         True is returned if the path is NOT a recycler or temp folder AND if ->ext_noTempRecyclerDirs is not set.
-        */
-       function ext_isLinkable($v)     {
-               if ($this->ext_noTempRecyclerDirs && (substr($v['path'],-7)=='_temp_/' || substr($v['path'],-11)=='_recycler_/'))       {
-                       return 0;
-               } return 1;
-       }
-
-       /**
-        * Wrapping the title in a link, if applicable.
-        *
-        * @param       string          Title, ready for output.
-        * @param       array           The 'record'
-        * @return      string          Wrapping title string.
-        */
-       function wrapTitle($title,$v)   {
-              &nbs