Added feature #14051: htmlArea RTE: Streamline the RTE loading process
authorStanislas Rolland <typo3@sjbr.ca>
Sat, 10 Apr 2010 04:51:04 +0000 (04:51 +0000)
committerStanislas Rolland <typo3@sjbr.ca>
Sat, 10 Apr 2010 04:51:04 +0000 (04:51 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7270 709f56b5-9817-0410-a4d7-c38de5d9e867

13 files changed:
ChangeLog
typo3/sysext/rtehtmlarea/ChangeLog
typo3/sysext/rtehtmlarea/class.tx_rtehtmlarea_base.php
typo3/sysext/rtehtmlarea/extensions/SpellChecker/class.tx_rtehtmlarea_spellchecker.php
typo3/sysext/rtehtmlarea/extensions/TYPO3HtmlParser/class.tx_rtehtmlarea_typo3htmlparser.php
typo3/sysext/rtehtmlarea/extensions/TYPO3Image/class.tx_rtehtmlarea_typo3image.php
typo3/sysext/rtehtmlarea/extensions/TYPO3Link/class.tx_rtehtmlarea_typo3link.php
typo3/sysext/rtehtmlarea/extensions/UserElements/class.tx_rtehtmlarea_userelements.php
typo3/sysext/rtehtmlarea/htmlarea/htmlarea.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/InsertSmiley/insert-smiley.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/SpellChecker/spell-checker.js
typo3/sysext/rtehtmlarea/mod6/class.tx_rtehtmlarea_parse_html.php
typo3/sysext/rtehtmlarea/pi2/class.tx_rtehtmlarea_pi2.php

index d9c3fdf..d8f2643 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-04-10  Stanislas Rolland  <typo3@sjbr.ca>
+
+       * Added feature #14051: htmlArea RTE: Streamline the RTE loading process
+
 2010-04-09  Michael Stucki  <michael@typo3.org>
 
        * Fixed bug #13959: Core autoloader should accept class names only (could lead to remote command execution). Thanks to Helmut Hummel and Marcus Krause for providing a fix.
index 6921f53..8a37ba8 100644 (file)
@@ -1,3 +1,7 @@
+2010-04-10  Stanislas Rolland  <typo3@sjbr.ca>
+
+       * Added feature #14051: htmlArea RTE: Streamline the RTE loading process
+
 2010-04-08  Stanislas Rolland  <typo3@sjbr.ca>
 
        * Added feature #14035: htmlArea RTE: Use sprite for toolbar icons
index fb8ed97..38c27cd 100644 (file)
@@ -79,19 +79,20 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
 
        var $pluginButton = array();
        var $pluginLabel = array();
-
-               // External:
-       var $RTEdivStyle;                       // Alternative style for RTE <div> tag.
-       public $httpTypo3Path;
-       var $extHttpPath;                       // full Path to this extension for http (so no Server path). It ends with "/"
-       var $siteURL;                           // TYPO3 site url
-       var $hostURL;                           // TYPO3 host url
-       var $typoVersion;                       // Typo3 version
-
-               // Internal, static:
-       var $ID = 'rtehtmlarea';                // Identifies the RTE as being the one from the "rte" extension if any external code needs to know...
-       var $debugMode = FALSE;                 // If set, the content goes into a regular TEXT area field - for developing testing of transformations. (Also any browser will load the field!)
-
+               // Alternative style for RTE <div> tag.
+       public $RTEdivStyle;
+               // Relative path to this extension. It ends with "/"
+       public $extHttpPath;
+               // TYPO3 site url
+       public $siteURL;
+               // TYPO3 host url
+       public $hostURL;
+               // Typo3 version
+       public $typoVersion;
+               // Identifies the RTE as being the one from the "rtehtmlarea" extension if any external code needs to know
+       var $ID = 'rtehtmlarea';
+               // If set, the content goes into a regular TEXT area field - for developing testing of transformations.
+       var $debugMode = FALSE;
                // For the editor
        var $client;
 
@@ -120,6 +121,7 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
        var $toolbarOrderArray = array();
        protected $pluginEnabledArray = array();                // Array of plugin id's enabled in the current RTE editing area
        protected $pluginEnabledCumulativeArray = array();      // Cumulative array of plugin id's enabled so far in any of the RTE editing areas of the form
+       protected $cumulativeScripts = array();
        public $registeredPlugins = array();                    // Array of registered plugins indexed by their plugin Id's
        protected $fullScreen = false;
 
@@ -207,25 +209,15 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
                         * INIT THE EDITOR-SETTINGS
                         * =======================================
                         */
-
-                               // first get the http-path to typo3:
-                       $this->httpTypo3Path = substr( substr( t3lib_div::getIndpEnv('TYPO3_SITE_URL'), strlen( t3lib_div::getIndpEnv('TYPO3_REQUEST_HOST') ) ), 0, -1 );
-                       if (strlen($this->httpTypo3Path) == 1) {
-                               $this->httpTypo3Path = '/';
-                       } else {
-                               $this->httpTypo3Path .= '/';
-                       }
                                // Get the path to this extension:
-                       $this->extHttpPath = $this->httpTypo3Path . t3lib_extMgm::siteRelPath($this->ID);
+                       $this->extHttpPath = t3lib_extMgm::extRelPath($this->ID);
                                // Get the site URL
                        $this->siteURL = t3lib_div::getIndpEnv('TYPO3_SITE_URL');
                                // Get the host URL
-                       $this->hostURL = t3lib_div::getIndpEnv('TYPO3_REQUEST_HOST');
-
+                       $this->hostURL = $this->siteURL . TYPO3_mainDir;
                                // Element ID + pid
                        $this->elementId = $PA['itemFormElName']; // Form element name
                        $this->elementParts = explode('][',preg_replace('/\]$/','',preg_replace('/^(TSFE_EDIT\[data\]\[|data\[)/','',$this->elementId)));
-
                                // Find the page PIDs:
                        list($this->tscPID,$this->thePid) = t3lib_BEfunc::getTSCpid(trim($this->elementParts[0]),trim($this->elementParts[1]),$thePidValue);
 
@@ -241,7 +233,6 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
                        $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);
@@ -421,12 +412,12 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
                        list($extKey,$local) = explode('/',substr($skinFilename,4),2);
                        $skinFilename='';
                        if (strcmp($extKey,'') &&  t3lib_extMgm::isLoaded($extKey) && strcmp($local,'')) {
-                               $skinFilename = $this->httpTypo3Path . t3lib_extMgm::siteRelPath($extKey) . $local;
-                               $skinDir = $this->siteURL . t3lib_extMgm::siteRelPath($extKey) . dirname($local);
+                               $skinFilename = ($this->is_FE() ? t3lib_extMgm::siteRelPath($extKey) : t3lib_extMgm::extRelPath($extKey)) . $local;
+                               $skinDir = ($this->is_FE() ? t3lib_extMgm::siteRelPath($extKey) : t3lib_extMgm::extRelPath($extKey)) . dirname($local);
                        }
                } elseif (substr($skinFilename,0,1) != '/') {
-                       $skinDir = $this->siteURL.dirname($skinFilename);
-                       $skinFilename = $this->siteURL . $skinFilename;
+                       $skinDir = dirname($skinFilename);
+                       $skinFilename = $skinFilename;
                } else {
                        $skinDir = substr($this->siteURL,0,-1) . dirname($skinFilename);
                }
@@ -449,7 +440,7 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
                                if ($pathToSkin) {
                                        $this->addStyleSheet(
                                                'rtehtmlarea-plugin-' . $pluginId . '-skin',
-                                               $this->httpTypo3Path . t3lib_extMgm::siteRelPath($this->registeredPlugins[$pluginId]->getExtensionKey()) . $pathToSkin
+                                               ($this->is_FE() ? t3lib_extMgm::siteRelPath($key) : t3lib_extMgm::extRelPath($key)) . $pathToSkin
                                                );
                                }
                        }
@@ -711,57 +702,50 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
         * @return      string          the html code for loading the Javascript Files
         */
        function loadJSfiles($RTEcounter) {
-               global $TYPO3_CONF_VARS;
-
-               $loadPluginCode = '
-                                               HTMLArea_plugins = new Array();';
+               $this->buildJSMainLangFile($RTEcounter);
+               $this->writeTemporaryFile('EXT:' . $this->ID . '/htmlarea/htmlarea.js', 'htmlarea', 'js', '', TRUE);
+               if ($this->client['BROWSER'] == 'msie') {
+                       $this->writeTemporaryFile('EXT:' . $this->ID . '/htmlarea/htmlarea-ie.js', 'htmlarea-ie', 'js', '', TRUE);
+               } else {
+                       $this->writeTemporaryFile('EXT:' . $this->ID . '/htmlarea/htmlarea-gecko.js', 'htmlarea-gecko', 'js', '', TRUE);
+               }
                foreach ($this->pluginEnabledCumulativeArray[$RTEcounter] as $pluginId) {
                        $extensionKey = is_object($this->registeredPlugins[$pluginId]) ? $this->registeredPlugins[$pluginId]->getExtensionKey() : $this->ID;
-                       $loadPluginCode .= '
-                                               HTMLArea_plugins.push({url : "' . $this->writeTemporaryFile('EXT:' . $extensionKey . '/htmlarea/plugins/' . $pluginId . '/' . strtolower(preg_replace('/([a-z])([A-Z])([a-z])/', "$1".'-'."$2"."$3", $pluginId)) . '.js', $pluginId) . '", asynchronous : ' . ($this->registeredPlugins[$pluginId]->requiresSynchronousLoad() ? 'false' : 'true'). ' });';
+                       $this->writeTemporaryFile('EXT:' . $extensionKey . '/htmlarea/plugins/' . $pluginId . '/' . strtolower(preg_replace('/([a-z])([A-Z])([a-z])/', "$1".'-'."$2"."$3", $pluginId)) . '.js', $pluginId, 'js', '', TRUE);
                }
                        // Avoid re-initialization on AJax call when RTEarea object was already initialized
                $loadJavascriptCode = '
+               <script type="text/javascript" src="' . $this->doConcatenate() . '"></script>
                <script type="text/javascript">
                /*<![CDATA[*/
                        if (typeof(RTEarea) == "undefined") {
                                RTEarea = new Object();
+                               RTEarea[0] = new Object();
+                               RTEarea[0].version = "' . $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->ID]['version'] . '";
+                               RTEarea[0].editorUrl = "' . $this->extHttpPath . 'htmlarea/";
+                               RTEarea[0].editorCSS = "' . $this->editorCSS . '";
+                               RTEarea[0].editorSkin = "' . dirname($this->editorCSS) . '/";
+                               RTEarea[0].editedContentCSS = "' .  $this->editedContentCSS  . '";
+                               RTEarea[0].hostUrl = "' . $this->hostURL . '";
+                               RTEarea[0].enableDebugMode = ' . ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->ID]['enableDebugMode'] ? 'true' : 'false') . ';
                                RTEarea.init = function() {
                                        if (typeof(HTMLArea) == "undefined" || !Ext.isReady) {
                                                window.setTimeout("RTEarea.init();", 40);
-                                       } else {'
-                                               . $loadPluginCode . '
+                                       } else {
+                                               Ext.QuickTips.init();
                                                HTMLArea.init();
                                        }
                                };
                                RTEarea.initEditor = function(editorNumber) {
                                        if (typeof(HTMLArea) == "undefined") {
-                                               window.setTimeout("RTEarea.initEditor(\'" + editorNumber + "\');", 40);
+                                               RTEarea.initEditor.defer(40, null, [editorNumber]);
                                        } else {
                                                HTMLArea.initEditor(editorNumber);
                                        }
                                };
-                               RTEarea[0] = new Object();
-                               RTEarea[0].version = "' . $TYPO3_CONF_VARS['EXTCONF'][$this->ID]['version'] . '";'
-                               . (($this->client['BROWSER'] == 'msie') ? ('
-                               RTEarea[0]["htmlarea-ie"] = "' . $this->writeTemporaryFile('EXT:' . $this->ID . '/htmlarea/htmlarea-ie.js', "htmlarea-ie") . '";')
-                               : ('
-                               RTEarea[0]["htmlarea-gecko"] = "' . $this->writeTemporaryFile('EXT:' . $this->ID . '/htmlarea/htmlarea-gecko.js', "htmlarea-gecko") . '";')) . '
-                               _editor_url = "' . $this->extHttpPath . 'htmlarea";
-                               _editor_lang = "' . $this->language . '";
-                               _editor_CSS = "' . $this->editorCSS . '";
-                               _editor_skin = "' . dirname($this->editorCSS) . '";
-                               _editor_edited_content_CSS = "' .  $this->editedContentCSS  . '";
-                               _typo3_host_url = "' . $this->hostURL . '";
-                               _editor_debug_mode = ' . ($TYPO3_CONF_VARS['EXTCONF'][$this->ID]['enableDebugMode'] ? 'true' : 'false') . ';
-                               _editor_compressed_scripts = ' . ($TYPO3_CONF_VARS['EXTCONF'][$this->ID]['enableCompressedScripts'] ? 'true' : 'false') . ';
                        }
                /*]]>*/
                </script>';
-               $loadJavascriptCode .= '
-               <script type="text/javascript" src="' . $this->buildJSMainLangFile($RTEcounter) . '" charset="utf-8"></script>
-               <script type="text/javascript" src="' . $this->writeTemporaryFile('EXT:' . $this->ID . '/htmlarea/htmlarea.js', "htmlarea") . '"></script>
-               ';
                return $loadJavascriptCode;
        }
 
@@ -791,7 +775,6 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
         * @return      string          the Javascript code for configuring the RTE
         */
        function registerRTEinJS($RTEcounter, $table='', $uid='', $field='', $textAreaId = '') {
-               global $TYPO3_CONF_VARS;
 
                $configureRTEInJavascriptString = (!$this->is_FE() ? '' : '
                        ' . '/*<![CDATA[*/') . '
@@ -814,15 +797,15 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
                        RTEarea[editornumber].fullScreen = ' . ($this->fullScreen ? 'true' : 'false') . ';
                        RTEarea[editornumber].showStatusBar = ' . (trim($this->thisConfig['showStatusBar'])?'true':'false') . ';
                        RTEarea[editornumber].enableWordClean = ' . (trim($this->thisConfig['enableWordClean'])?'true':'false') . ';
-                       RTEarea[editornumber]["htmlRemoveComments"] = ' . (trim($this->thisConfig['removeComments'])?'true':'false') . ';
+                       RTEarea[editornumber].htmlRemoveComments = ' . (trim($this->thisConfig['removeComments'])?'true':'false') . ';
                        RTEarea[editornumber].disableEnterParagraphs = ' . (trim($this->thisConfig['disableEnterParagraphs'])?'true':'false') . ';
                        RTEarea[editornumber].disableObjectResizing = ' . (trim($this->thisConfig['disableObjectResizing'])?'true':'false') . ';
-                       RTEarea[editornumber]["removeTrailingBR"] = ' . (trim($this->thisConfig['removeTrailingBR'])?'true':'false') . ';
-                       RTEarea[editornumber]["useCSS"] = ' . (trim($this->thisConfig['useCSS'])?'true':'false') . ';
-                       RTEarea[editornumber]["keepButtonGroupTogether"] = ' . (trim($this->thisConfig['keepButtonGroupTogether'])?'true':'false') . ';
-                       RTEarea[editornumber]["disablePCexamples"] = ' . (trim($this->thisConfig['disablePCexamples'])?'true':'false') . ';
-                       RTEarea[editornumber]["showTagFreeClasses"] = ' . (trim($this->thisConfig['showTagFreeClasses'])?'true':'false') . ';
-                       RTEarea[editornumber]["useHTTPS"] = ' . ((trim(stristr($this->siteURL, 'https')) || $this->thisConfig['forceHTTPS'])?'true':'false') . ';
+                       RTEarea[editornumber].removeTrailingBR = ' . (trim($this->thisConfig['removeTrailingBR'])?'true':'false') . ';
+                       RTEarea[editornumber].useCSS = ' . (trim($this->thisConfig['useCSS'])?'true':'false') . ';
+                       RTEarea[editornumber].keepButtonGroupTogether = ' . (trim($this->thisConfig['keepButtonGroupTogether'])?'true':'false') . ';
+                       RTEarea[editornumber].disablePCexamples = ' . (trim($this->thisConfig['disablePCexamples'])?'true':'false') . ';
+                       RTEarea[editornumber].showTagFreeClasses = ' . (trim($this->thisConfig['showTagFreeClasses'])?'true':'false') . ';
+                       RTEarea[editornumber].useHTTPS = ' . ((trim(stristr($this->siteURL, 'https')) || $this->thisConfig['forceHTTPS'])?'true':'false') . ';
                        RTEarea[editornumber].tceformsNested = ' . (is_object($this->TCEform) && method_exists($this->TCEform, 'getDynNestedStack') ? $this->TCEform->getDynNestedStack(true) : '[]') . ';
                        RTEarea[editornumber].dialogueWindows = new Object();
                        RTEarea[editornumber].dialogueWindows.defaultPositionFromTop = ' . (isset($this->thisConfig['dialogueWindows.']['defaultPositionFromTop'])? intval($this->thisConfig['dialogueWindows.']['defaultPositionFromTop']) : '100') . ';
@@ -871,24 +854,21 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
                        // Setting the list of tags to be removed if specified in the RTE config
                if (trim($this->thisConfig['removeTags']))  {
                        $configureRTEInJavascriptString .= '
-                       RTEarea[editornumber]["htmlRemoveTags"] = /^(' . implode('|', t3lib_div::trimExplode(',', $this->thisConfig['removeTags'], 1)) . ')$/i;';
+                       RTEarea[editornumber].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']))  {
                        $configureRTEInJavascriptString .= '
-                       RTEarea[editornumber]["htmlRemoveTagsAndContents"] = /^(' . implode('|', t3lib_div::trimExplode(',', $this->thisConfig['removeTagsAndContents'], 1)) . ')$/i;';
+                       RTEarea[editornumber].htmlRemoveTagsAndContents = /^(' . implode('|', t3lib_div::trimExplode(',', $this->thisConfig['removeTagsAndContents'], 1)) . ')$/i;';
                }
-
                        // Process default style configuration
                $configureRTEInJavascriptString .= '
-                       RTEarea[editornumber].defaultPageStyle = "' . $this->hostURL . $this->writeTemporaryFile('', 'defaultPageStyle', 'css', $this->buildStyleSheet()) . '";';
-
+                       RTEarea[editornumber].defaultPageStyle = "' . $this->writeTemporaryFile('', 'defaultPageStyle', 'css', $this->buildStyleSheet()) . '";';
                        // Setting the pageStyle
                $filename = trim($this->thisConfig['contentCSS']) ? trim($this->thisConfig['contentCSS']) : 'EXT:' . $this->ID . '/res/contentcss/default.css';
                $configureRTEInJavascriptString .= '
                        RTEarea[editornumber].pageStyle = "' . $this->getFullFileName($filename) .'";';
-
                        // Process classes configuration
                $classesConfigurationRequired = false;
                foreach ($this->registeredPlugins as $pluginId => $plugin) {
@@ -899,7 +879,6 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
                if ($classesConfigurationRequired) {
                        $configureRTEInJavascriptString .= $this->buildJSClassesConfig($RTEcounter);
                }
-
                        // Add Javascript configuration for registered plugins
                foreach ($this->registeredPlugins as $pluginId => $plugin) {
                        if ($this->isPluginEnabled($pluginId)) {
@@ -990,17 +969,15 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
                $classesTagConvert = array( 'classesCharacter' => 'span', 'classesParagraph' => 'div', 'classesImage' => 'img', 'classesTable' => 'table', 'classesLinks' => 'a', 'classesTD' => 'td');
                $classesTagArray = t3lib_div::trimExplode(',' , $classesTagList);
                $configureRTEInJavascriptString = '
-                       RTEarea[editornumber]["classesTag"] = new Object();';
+                       RTEarea[editornumber].classesTag = new Object();';
                foreach ($classesTagArray as $classesTagName) {
                        $HTMLAreaJSClasses = ($this->thisConfig[$classesTagName])?('"' . $this->cleanList($this->thisConfig[$classesTagName]) . '";'):'null;';
                        $configureRTEInJavascriptString .= '
-                       RTEarea[editornumber]["classesTag"]["'. $classesTagConvert[$classesTagName] .'"] = '. $HTMLAreaJSClasses;
+                       RTEarea[editornumber].classesTag.'. $classesTagConvert[$classesTagName] .' = '. $HTMLAreaJSClasses;
                }
-
                        // Include JS arrays of configured classes
                $configureRTEInJavascriptString .= '
-                       RTEarea[editornumber]["classesUrl"] = "' . $this->hostURL . $this->writeTemporaryFile('', 'classes_'.$LANG->lang, 'js', $this->buildJSClassesArray()) . '";';
-
+                       RTEarea[editornumber].classesUrl = "' . $this->writeTemporaryFile('', 'classes_'.$LANG->lang, 'js', $this->buildJSClassesArray()) . '";';
                return $configureRTEInJavascriptString;
        }
 
@@ -1101,7 +1078,7 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
         *
         * @return      string          The name of the file writtten to typo3temp/rtehtmlarea
         */
-       public function writeTemporaryFile($sourceFileName='', $label, $fileExtension='js', $contents='') {
+       public function writeTemporaryFile($sourceFileName='', $label, $fileExtension='js', $contents='', $concatenate = FALSE) {
                global $TYPO3_CONF_VARS;
 
                if ($sourceFileName) {
@@ -1112,7 +1089,7 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
                        $output = $contents;
                }
                $compress = $TYPO3_CONF_VARS['EXTCONF'][$this->ID]['enableCompressedScripts'] && ($fileExtension == 'js') && ($output != '');
-               $relativeFilename = 'typo3temp/' . $this->ID . '/' . str_replace('-','_',$label) . '_' . t3lib_div::shortMD5(($TYPO3_CONF_VARS['EXTCONF'][$this->ID]['version'] . ($sourceFileName?$sourceFileName:$output)), 20) . ($compress ? '_compressed' : '') . '.' . $fileExtension;
+               $relativeFilename = 'typo3temp/' . $this->ID . '/' . str_replace('-','_',$label) . '_' . t3lib_div::shortMD5(($TYPO3_CONF_VARS['EXTCONF'][$this->ID]['version'] . ($sourceFileName ? $sourceFileName : $output)), 20) . ($compress ? '_compressed' : '') . '.' . $fileExtension;
                $destination = PATH_site . $relativeFilename;
                if(!file_exists($destination)) {
                        $compressedJavaScript = '';
@@ -1124,7 +1101,39 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
                                die($failure);
                        }
                }
-               return ($this->thisConfig['forceHTTPS']?$this->siteURL:$this->httpTypo3Path) . $relativeFilename;
+               if ($concatenate) {
+                       $this->cumulativeScripts[] = $destination;
+               }
+               return (($this->is_FE() && $GLOBALS['TSFE']->absRefPrefix) ? $GLOBALS['TSFE']->absRefPrefix : '../' ) . $relativeFilename;
+       }
+       /**
+        * Concatenates all accumulated scripts in a file in typo3temp/rtehtmlarea directory and returns the file name
+        *
+        * @return      string          The name of the file writtten to typo3temp/rtehtmlarea
+        */
+       protected function doConcatenate() {
+               $fileExtension = 'js';
+               $compress = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->ID]['enableCompressedScripts'];
+               $token = implode('|', $this->cumulativeScripts);
+               $relativeFilename = 'typo3temp/' . $this->ID . '/' . 'htmlarea_cumulative' . '_' . t3lib_div::shortMD5(($TYPO3_CONF_VARS['EXTCONF'][$this->ID]['version'] . $token ), 20) . ($compress ? '_compressed' : '') . '.' . $fileExtension;
+               $destination = PATH_site . $relativeFilename;
+               if (!file_exists($destination)) {
+                       foreach ($this->cumulativeScripts as $fileName) {
+                               $contents = file_get_contents($fileName);
+                               if (!file_exists($destination)) {
+                                       $failure = t3lib_div::writeFileToTypo3tempDir($destination, $contents);
+                                       if ($failure)  {
+                                               die($failure);
+                                       }
+                               } else {
+                                       $success = file_put_contents($destination, $contents, FILE_APPEND);
+                                       if (!$success)  {
+                                               die('Could not append script' + $fileName);
+                                       }
+                               }
+                       }
+               }
+               return (($this->is_FE() && $GLOBALS['TSFE']->absRefPrefix) ? $GLOBALS['TSFE']->absRefPrefix : '../' ) . $relativeFilename;
        }
 
        /**
@@ -1134,13 +1143,12 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
         *
         * @return      string          filename
         */
-
        function buildJSMainLangFile($RTEcounter) {
                $contents = $this->buildJSMainLangArray() . chr(10);
                foreach ($this->pluginEnabledCumulativeArray[$RTEcounter] as $pluginId) {
                        $contents .= $this->buildJSLangArray($pluginId) . chr(10);
                }
-               return $this->writeTemporaryFile('', $this->language.'_'.$this->OutputCharset, 'js', $contents);
+               return $this->writeTemporaryFile('', $this->language.'_'.$this->OutputCharset, 'js', $contents, TRUE);
        }
 
        /**
@@ -1278,14 +1286,14 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
                        list($extKey,$local) = explode('/',substr($filename,4),2);
                        $newFilename = '';
                        if (strcmp($extKey,'') &&  t3lib_extMgm::isLoaded($extKey) && strcmp($local,'')) {
-                               $newFilename = $this->siteURL . t3lib_extMgm::siteRelPath($extKey) . $local;
+                               $newFilename = ($this->is_FE() ? t3lib_extMgm::siteRelPath($extKey) : t3lib_extMgm::extRelPath($extKey)) . $local;
                        }
                } elseif (substr($filename,0,1) != '/') {
-                       $newFilename = $this->siteURL . $filename;
+                       $newFilename = ($this->is_FE() ? '' : '../') . $filename;
                } else {
-                       $newFilename = $this->siteURL . substr($filename,1);
+                       $newFilename = ($this->is_FE() ? '' : '../') . substr($filename, 1);
                }
-               return $newFilename;
+               return  $newFilename;
        }
 
        /**
@@ -1457,9 +1465,7 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
                                ";
        }
 }
-
 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rtehtmlarea/class.tx_rtehtmlarea_base.php'])  {
        include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rtehtmlarea/class.tx_rtehtmlarea_base.php']);
 }
-
 ?>
\ No newline at end of file
index 1fe3a2d..4f7931f 100644 (file)
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 2008-2209 Stanislas Rolland <typo3(arobas)sjbr.ca>
+*  (c) 2008-2010 Stanislas Rolland <typo3(arobas)sjbr.ca>
 *  All rights reserved
 *
 *  This script is part of the Typo3 project. The Typo3 project is
@@ -96,15 +96,12 @@ class tx_rtehtmlarea_spellchecker extends tx_rtehtmlareaapi {
                        RTEarea['.$RTEcounter.'].buttons.'. $button .'.spellCheckerMode = "' . $spellCheckerMode .'";
                        RTEarea['.$RTEcounter.'].buttons.'. $button .'.enablePersonalDicts = ' . ($enablePersonalDicts ? 'true' : 'false') .';';
                        $registerRTEinJavascriptString .= '
-                       RTEarea['.$RTEcounter.'].buttons.'. $button .'.path = "' . ($this->htmlAreaRTE->is_FE() ? t3lib_div::getIndpEnv('TYPO3_SITE_URL') . '/index.php?eID=rtehtmlarea_spellchecker' : substr(t3lib_div::getIndpEnv('TYPO3_SITE_URL'), strlen(t3lib_div::getIndpEnv('TYPO3_REQUEST_HOST'))) . TYPO3_mainDir . 'ajax.php?ajaxID=rtehtmlarea::spellchecker') . '";';
+                       RTEarea['.$RTEcounter.'].buttons.'. $button .'.path = "' . ($this->htmlAreaRTE->is_FE() ? ($GLOBALS['TSFE']->absRefPrefix ? $GLOBALS['TSFE']->absRefPrefix : '') . 'index.php?eID=rtehtmlarea_spellchecker' : 'ajax.php?ajaxID=rtehtmlarea::spellchecker') . '";';
                }
                return $registerRTEinJavascriptString;
        }
-
-} // end of class
-
+}
 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rtehtmlarea/extensions/SpellChecker/class.tx_rtehtmlarea_spellchecker.php']) {
        include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rtehtmlarea/extensions/SpellChecker/class.tx_rtehtmlarea_spellchecker.php']);
 }
-
 ?>
\ No newline at end of file
index d90b983..7aa8670 100644 (file)
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 2008-2009 Stanislas Rolland <typo3(arobas)sjbr.ca>
+*  (c) 2008-2010 Stanislas Rolland <typo3(arobas)sjbr.ca>
 *  All rights reserved
 *
 *  This script is part of the Typo3 project. The Typo3 project is
@@ -90,11 +90,8 @@ class tx_rtehtmlarea_typo3htmlparser extends tx_rtehtmlareaapi {
        public function applyToolbarConstraints($show) {
                return array_unique(array_merge($show, t3lib_div::trimExplode(',', $this->pluginButtons)));
        }
-
-} // end of class
-
+}
 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rtehtmlarea/extensions/TYPO3HtmlParser/class.tx_rtehtmlarea_typo3htmlparser.php']) {
        include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rtehtmlarea/extensions/TYPO3HtmlParser/class.tx_rtehtmlarea_typo3htmlparser.php']);
 }
-
 ?>
\ No newline at end of file
index f68c9f4..d803e64 100644 (file)
@@ -75,16 +75,12 @@ class tx_rtehtmlarea_typo3image extends tx_rtehtmlareaapi {
                        RTEarea['.$RTEcounter.']["buttons"]["'. $button .'"] = new Object();';
                        }
                        $registerRTEinJavascriptString .= '
-                       RTEarea['.$RTEcounter.'].buttons.'. $button .'.pathImageModule = "../../mod4/select_image.php";';
+                       RTEarea['.$RTEcounter.'].buttons.'. $button .'.pathImageModule = "' . $this->htmlAreaRTE->extHttpPath . 'mod4/select_image.php";';
                }
-
                return $registerRTEinJavascriptString;
        }
-
-} // end of class
-
+}
 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rtehtmlarea/extensions/TYPO3Image/class.tx_rtehtmlarea_typo3image.php']) {
        include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rtehtmlarea/extensions/TYPO3Image/class.tx_rtehtmlarea_typo3image.php']);
 }
-
 ?>
\ No newline at end of file
index 5e4a886..26c6068 100644 (file)
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 2008-2009 Stanislas Rolland <typo3(arobas)sjbr.ca>
+*  (c) 2008-2010 Stanislas Rolland <typo3(arobas)sjbr.ca>
 *  All rights reserved
 *
 *  This script is part of the Typo3 project. The Typo3 project is
@@ -76,7 +76,7 @@ class tx_rtehtmlarea_typo3link extends tx_rtehtmlareaapi {
                        RTEarea['.$RTEcounter.'].buttons.'. $button .' = new Object();';
                        }
                        $registerRTEinJavascriptString .= '
-                       RTEarea['.$RTEcounter.'].buttons.'. $button .'.pathLinkModule = "../../mod3/browse_links.php";';
+                       RTEarea['.$RTEcounter.'].buttons.'. $button .'.pathLinkModule = "' . $this->htmlAreaRTE->extHttpPath . 'mod3/browse_links.php";';
 
                        if ($this->htmlAreaRTE->is_FE()) {
                                $RTEProperties = $this->htmlAreaRTE->RTEsetup;
@@ -149,11 +149,8 @@ class tx_rtehtmlarea_typo3link extends tx_rtehtmlareaapi {
                        return $show;
                }
        }
-
-} // end of class
-
+}
 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rtehtmlarea/extensions/TYPO3Link/class.tx_rtehtmlarea_typo3link.php']) {
        include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rtehtmlarea/extensions/TYPO3Link/class.tx_rtehtmlarea_typo3link.php']);
 }
-
 ?>
\ No newline at end of file
index 7012174..128b781 100644 (file)
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 2008-2009 Stanislas Rolland <stanislas.rolland(arobas)fructifor.ca>
+*  (c) 2008-2010 Stanislas Rolland <typo3(arobas)sjbr.ca>
 *  All rights reserved
 *
 *  This script is part of the Typo3 project. The Typo3 project is
@@ -24,7 +24,7 @@
 /**
  * User Elements extension for htmlArea RTE
  *
- * @author Stanislas Rolland <stanislas.rolland(arobas)fructifor.ca>
+ * @author Stanislas Rolland <typo3(arobas)sjbr.ca>
  *
  * TYPO3 SVN ID: $Id$
  *
@@ -69,16 +69,12 @@ class tx_rtehtmlarea_userelements extends tx_rtehtmlareaapi {
                        RTEarea['.$RTEcounter.'].buttons.'. $button .' = new Object();';
                        }
                        $registerRTEinJavascriptString .= '
-                       RTEarea['.$RTEcounter.'].buttons.'. $button .'.pathUserModule = "../../mod5/user.php";';
+                       RTEarea['.$RTEcounter.'].buttons.'. $button .'.pathUserModule = "' . $this->htmlAreaRTE->extHttpPath . 'mod5/user.php";';
                }
-
                return $registerRTEinJavascriptString;
        }
-
-} // end of class
-
+}
 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rtehtmlarea/extensions/UserElements/class.tx_rtehtmlarea_userelements.php']) {
        include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rtehtmlarea/extensions/UserElements/class.tx_rtehtmlarea_userelements.php']);
 }
-
 ?>
\ No newline at end of file
index 07d0724..12d8f2d 100644 (file)
  *
  * TYPO3 SVN ID: $Id$
  */
-       // Avoid re-starting on Ajax request
+       // Avoid re-initialization on AJax call when HTMLArea object was already initialized
 if (typeof(HTMLArea) == 'undefined') {
        // Establish HTMLArea name space
 Ext.namespace('HTMLArea.util.TYPO3', 'HTMLArea.util.Tips', 'HTMLArea.util.Color', 'Ext.ux.form', 'Ext.ux.menu', 'Ext.ux.Toolbar');
+       // Establish some constants
+Ext.apply(HTMLArea, {
+               // Browser identification
+       is_gecko        : Ext.isGecko || Ext.isOpera || Ext.isWebKit,
+       is_ff2          : Ext.isGecko2,
+       is_ie           : Ext.isIE,
+       is_safari       : Ext.isWebKit,
+       is_chrome       : Ext.isChrome,
+       is_opera        : Ext.isOpera,
+               // Some operations require bug fixes provided by Opera 10 (Presto 2.2)
+       is_opera9       : Ext.isOpera && navigator.userAgent.toLowerCase().indexOf('presto/2.1') != -1,
+               // Compile some regular expressions
+       RE_tagName              : /(<\/|<)\s*([^ \t\n>]+)/ig,
+       RE_head                 : /<head>((.|\n)*?)<\/head>/i,
+       RE_body                 : /<body>((.|\n)*?)<\/body>/i,
+       Reg_body                : new RegExp('<\/?(body)[^>]*>', 'gi'),
+       reservedClassNames      : /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,
+       RE_url                  : /(([^:/?#]+):\/\/)?(([a-z0-9_]+:[a-z0-9_]+@)?[a-z0-9_-]{2,}(\.[a-z0-9_-]{2,})+\.[a-z]{2,5}(:[0-9]+)?(\/\S+)*)/i,
+       RE_blockTags            : /^(body|p|h1|h2|h3|h4|h5|h6|ul|ol|pre|dl|dt|dd|div|noscript|blockquote|form|hr|table|caption|fieldset|address|td|tr|th|li|tbody|thead|tfoot|iframe)$/,
+       RE_closingTags          : /^(p|blockquote|a|li|ol|ul|dl|dt|td|th|tr|tbody|thead|tfoot|caption|colgroup|table|div|b|bdo|big|cite|code|del|dfn|em|i|ins|kbd|label|q|samp|small|span|strike|strong|sub|sup|tt|u|var|abbr|acronym|font|center|object|embed|style|script|title|head)$/,
+       RE_noClosingTag         : /^(img|br|hr|col|input|area|base|link|meta|param)$/
+});
 /***************************************************
- *  BROWSER IDENTIFICATION
+ *  TROUBLESHOOTING
  ***************************************************/
-HTMLArea.agt = navigator.userAgent.toLowerCase();
-HTMLArea.is_opera  = Ext.isOpera;
-// Some operations require bug fixes provided by Opera 10 (Presto 2.2)
-HTMLArea.is_opera9 = Ext.isOpera && HTMLArea.agt.indexOf("Presto/2.1") != -1;
-HTMLArea.is_ie = Ext.isIE;
-HTMLArea.is_safari = Ext.isWebKit;
-HTMLArea.is_gecko  = Ext.isGecko || Ext.isOpera || Ext.isWebKit;
-HTMLArea.is_ff2 = Ext.isGecko2;
-HTMLArea.is_chrome = Ext.isChrome;
-
-/*
- * A log for troubleshooting
- */
 HTMLArea._appendToLog = function(str){
-       if(HTMLArea._debugMode) {
-               var log = document.getElementById("HTMLAreaLog");
+       if (HTMLArea.enableDebugMode) {
+               var log = document.getElementById('HTMLAreaLog');
                if(log) {
                        log.appendChild(document.createTextNode(str));
-                       log.appendChild(document.createElement("br"));
+                       log.appendChild(document.createElement('br'));
                }
        }
 };
 /***************************************************
- *  SCRIPTS LOADING PROCESS
+ *  HTMLArea INITIALIZATION
  ***************************************************/
-/*
- * Build stack of scripts to be loaded
- */
-HTMLArea.loadScript = function(url, pluginName, asynchronous) {
-       if (typeof(pluginName) == "undefined") {
-               var pluginName = "";
-       }
-       if (typeof(asynchronous) == "undefined") {
-               var asynchronous = true;
+HTMLArea.init = function() {
+               // Apply global configuration settings
+       Ext.apply(HTMLArea, RTEarea[0]);
+       Ext.applyIf(HTMLArea, {
+               editorSkin      : HTMLArea.editorUrl + 'skins/default/',
+               editorCSS       : HTMLArea.editorUrl + 'skins/default/htmlarea.css'
+       });
+       if (!Ext.isString(HTMLArea.editedContentCSS)) {
+               HTMLArea.editedContentCSS = HTMLArea.editorSkin + 'htmlarea-edited-content.css';
        }
-       if (Ext.isOpera) url = _typo3_host_url + url;
-       if (HTMLArea._compressedScripts && url.indexOf("compressed") == -1) url = url.replace(/\.js$/gi, "_compressed.js");
-       var scriptInfo = {
-               pluginName      : pluginName,
-               url             : url,
-               asynchronous    : asynchronous
-       };
-       HTMLArea._scripts.push(scriptInfo);
+               // Initialize pending request flag for Opera
+       HTMLArea.pendingSynchronousXMLHttpRequest = false;
+               // Localization of core script
+       HTMLArea.I18N = HTMLArea_langArray;
+       HTMLArea.isReady = true;
+       HTMLArea._appendToLog("[HTMLArea::init]: Editor url set to: " + HTMLArea.editorUrl);
+       HTMLArea._appendToLog("[HTMLArea::init]: Editor skin CSS set to: " + HTMLArea.editorCSS);
+       HTMLArea._appendToLog("[HTMLArea::init]: Editor content skin CSS set to: " + HTMLArea.editedContentCSS);
 };
-
+/***************************************************
+ *  SCRIPT LOADING
+ ***************************************************/
 /*
  * Get a script using asynchronous XMLHttpRequest
  */
-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) {
+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 (request, url) {
        return (function() {
-               var url = HTMLArea._scripts[i].url;
-               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);
+               if (request.readyState == 4) {
+                       if (request.status == 200) {
+                               try {
+                                       eval(request.responseText);
+                               } 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 ' + request.status);
                        }
-               } 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].url;
-       if (typeof(asynchronous) == "undefined") var asynchronous = HTMLArea._scripts[i].asynchronous;
-       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;
+       if (typeof(asynchronous) == 'undefined') {
+               var asynchronous = true;
+       }
+       if (window.XMLHttpRequest) {
+               var request = new XMLHttpRequest();
+       } else if (window.ActiveXObject) {
+               var success = false;
+               for (var k = 0; k < HTMLArea.MSXML_XMLHTTP_PROGIDS.length && !success; k++) {
+                       try {
+                               var request = new ActiveXObject(HTMLArea.MSXML_XMLHTTP_PROGIDS[k]);
+                               success = true;
+                       } catch (e) { }
                }
-       var request = HTMLArea._request[i];
+               if (!success) {
+                       return false;
+               }
+       }
        if (request) {
-               HTMLArea._appendToLog("[HTMLArea::getScript]: Requesting script " + url);
-               request.open("GET", url, asynchronous);
-               if (asynchronous) request.onreadystatechange = HTMLArea.XMLHTTPResponseHandler(i);
-               if (window.XMLHttpRequest) request.send(null);
-                       else if (window.ActiveXObject) request.send();
+               HTMLArea._appendToLog('[HTMLArea::getScript]: Requesting script ' + url);
+               request.open('GET', url, asynchronous);
+               if (asynchronous) {
+                       request.onreadystatechange = HTMLArea.XMLHTTPResponseHandler(request, url);
+               }
+               if (window.XMLHttpRequest) {
+                       request.send(null);
+               } else if (window.ActiveXObject) {
+                       request.send();
+               }
                if (!asynchronous) {
-                       if (request.status == 200) return request.responseText;
-                               else return '';
+                       return (request.status == 200 ? request.responseText : '');
                }
                return true;
        } else {
                return false;
        }
 };
-
-/*
- * Wait for the loading process to complete
- */
-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;
-       }
-};
-
-/*
- * Initial load
- */
-HTMLArea.init = function() {
-       if (typeof(_editor_url) != "string") {
-               window.setTimeout("HTMLArea.init();", 50);
-       } else {
-                       // Set some basic paths
-                       // Leave exactly one backslash at the end of _editor_url
-               _editor_url = _editor_url.replace(/\x2f*$/, '/');
-               if (typeof(_editor_skin) == "string") _editor_skin = _editor_skin.replace(/\x2f*$/, '/');
-                       else _editor_skin = _editor_url + "skins/default/";
-               if (typeof(_editor_CSS) != "string") _editor_CSS = _editor_url + "skins/default/htmlarea.css";
-               if (typeof(_editor_edited_content_CSS) != "string") _editor_edited_content_CSS = _editor_skin + "htmlarea-edited-content.css";
-               if (typeof(_editor_lang) == "string") _editor_lang = _editor_lang ? _editor_lang.toLowerCase() : "en";
-               HTMLArea.editorCSS = _editor_CSS;
-                       // Initialize pending request flag
-               HTMLArea.pendingSynchronousXMLHttpRequest = false;
-                       // Set troubleshooting mode
-               HTMLArea._debugMode = false;
-               if (typeof(_editor_debug_mode) != "undefined") HTMLArea._debugMode = _editor_debug_mode;
-                       // Using compressed scripts
-               HTMLArea._compressedScripts = false;
-               if (typeof(_editor_compressed_scripts) != "undefined") HTMLArea._compressedScripts = _editor_compressed_scripts;
-                       // Localization of core script
-               HTMLArea.I18N = HTMLArea_langArray;
-                       // Build array of scripts to be loaded
-               HTMLArea.is_loaded = false;
-               HTMLArea.loadTimer;
-               HTMLArea._scripts = [];
-               HTMLArea._scriptLoaded = [];
-               HTMLArea._request = [];
-               if (!Ext.isIE) HTMLArea.loadScript(RTEarea[0]["htmlarea-gecko"] ? RTEarea[0]["htmlarea-gecko"] : _editor_url + "htmlarea-gecko.js");
-               if (Ext.isIE) HTMLArea.loadScript(RTEarea[0]["htmlarea-ie"] ? RTEarea[0]["htmlarea-ie"] : _editor_url + "htmlarea-ie.js");
-               for (var i = 0, n = HTMLArea_plugins.length; i < n; i++) {
-                       HTMLArea.loadScript(HTMLArea_plugins[i].url, "", HTMLArea_plugins[i].asynchronous);
-               }
-                       // Get all the scripts
-               if (window.XMLHttpRequest || window.ActiveXObject) {
-                       try {
-                               var success = true;
-                               for (var i = 0, n = HTMLArea._scripts.length; i < n && success; i++) {
-                                       if (HTMLArea._scripts[i].asynchronous) {
-                                               success = success && HTMLArea._getScript(i);
-                                       } else {
-                                               try {
-                                                       eval(HTMLArea._getScript(i));
-                                                       HTMLArea._scriptLoaded[i] = true;
-                                               } catch (e) {
-                                                       HTMLArea._appendToLog("ERROR [HTMLArea::getScript]: Unable to get script " + url + ": " + e);
-                                               }
-                                       }
-                               }
-                       } catch (e) {
-                               HTMLArea._appendToLog("ERROR [HTMLArea::init]: Unable to use XMLHttpRequest: "+ e);
-                       }
-                       if (success) {
-                               HTMLArea.checkInitialLoad();
-                       } else {
-                               if (Ext.isIE) window.setTimeout('alert(HTMLArea.I18N.msg["ActiveX-required"]);', 200);
-                       }
-               } else {
-                       if (Ext.isIE) alert(HTMLArea.I18N.msg["ActiveX-required"]);
-               }
-       }
-};
-
-/*
- * Compile some regular expressions
- */
-HTMLArea.RE_tagName = /(<\/|<)\s*([^ \t\n>]+)/ig;
-HTMLArea.RE_head    = /<head>((.|\n)*?)<\/head>/i;
-HTMLArea.RE_body    = /<body>((.|\n)*?)<\/body>/i;
-HTMLArea.Reg_body = new RegExp("<\/?(body)[^>]*>", "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      = /(([^:/?#]+):\/\/)?(([a-z0-9_]+:[a-z0-9_]+@)?[a-z0-9_-]{2,}(\.[a-z0-9_-]{2,})+\.[a-z]{2,5}(:[0-9]+)?(\/\S+)*)/i;
 /***************************************************
  *  EDITOR CONFIGURATION
  ***************************************************/
@@ -255,7 +167,7 @@ HTMLArea.Config = function (editorId) {
        this.disableObjectResizing = false;
        this.removeTrailingBR = false;
                // style included in the iframe document
-       this.editedContentStyle = _editor_edited_content_CSS;
+       this.editedContentStyle = HTMLArea.editedContentCSS;
                // content style
        this.pageStyle = "";
                // remove tags (these have to be a regexp, or null if this functionality is not desired)
@@ -272,7 +184,6 @@ HTMLArea.Config = function (editorId) {
                this.baseURL = RegExp.$1 + "/";
        }
                // URL-s
-       this.imgURL = "images/";
        this.popupURL = "popups/";
                // DocumentType
        this.documentType = '<!DOCTYPE html\r'
@@ -924,18 +835,23 @@ HTMLArea.Iframe = Ext.extend(Ext.BoxComponent, {
         */
        initStyleChangeEventListener: function () {
                if (this.isNested  && !Ext.isWebKit) {
+                       var options = {
+                               single: true,
+                               stopEvent: true
+                       };
+                       if (Ext.isGecko) {
+                               options.delay = 50;
+                       }
                        Ext.each(this.nestedParentElements.sorted, function (nested) {
+                               if (!Ext.isGecko) {
+                                       options.target = Ext.get(nested);
+                               }
                                this.mon(
                                        Ext.get(nested),
                                        Ext.isIE ? 'propertychange' : 'DOMAttrModified',
                                        this.onNestedShow,
                                        this,
-                                       {
-                                               delay: 50,
-                                               single: true,
-                                               stopEvent: true,
-                                               target: Ext.get(nested)
-                                       }
+                                       options
                                );
                        }, this);
                }
@@ -1022,7 +938,7 @@ HTMLArea.Iframe = Ext.extend(Ext.BoxComponent, {
                        head = this.document.createElement('head');
                        this.document.documentElement.appendChild(head);
                }
-               if (this.config.baseURL && !Ext.isOpera) {
+               if (this.config.baseURL) {
                        var base = this.document.getElementsByTagName('base')[0];
                        if (!base) {
                                base = this.document.createElement('base');
@@ -2474,7 +2390,7 @@ HTMLArea.Editor = Ext.extend(Ext.util.Observable, {
                                                id: this.editorId + '-iframe',
                                                tag: 'iframe',
                                                cls: 'editorIframe',
-                                               src: Ext.isGecko ? 'javascript:void(0);' : (Ext.isOpera ? _typo3_host_url : '') + _editor_url + 'popups/blank.html'
+                                               src: Ext.isGecko ? 'javascript:void(0);' : HTMLArea.editorUrl + 'popups/blank.html'
                                        },
                                        isNested: this.isNested,
                                        nestedParentElements: this.nestedParentElements,
@@ -2841,23 +2757,15 @@ HTMLArea.Editor.prototype.registerPlugin = function(plugin) {
                return false;
        }
 };
-
-/*
- * Load the required plugin script
- */
-HTMLArea.loadPlugin = function (pluginName, url, asynchronous) {
-       if (typeof(asynchronous) == "undefined") {
-               var asynchronous = true;
-       }
-       HTMLArea.loadScript(url, pluginName, asynchronous);
-};
-
 /*
  * Load a stylesheet file
+ ***********************************************
+ * THIS FUNCTION IS DEPRECATED AS OF TYPO3 4.4 *
+ ***********************************************
  */
 HTMLArea.loadStyle = function(style, plugin, url) {
        if (typeof(url) == "undefined") {
-               var url = _editor_url || '';
+               var url = HTMLArea.editorUrl || '';
                if (typeof(plugin) != "undefined") { url += "plugins/" + plugin + "/"; }
                url += style;
                if (/^\//.test(style)) { url = style; }
@@ -2870,15 +2778,10 @@ HTMLArea.loadStyle = function(style, plugin, url) {
 };
 
 /*
- * Get the url of some image
- */
-HTMLArea.Editor.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;
-};
-
-/*
  * Get the url of some popup
+ ***********************************************
+ * THIS FUNCTION IS DEPRECATED AS OF TYPO3 4.4 *
+ ***********************************************
  */
 HTMLArea.Editor.prototype.popupURL = function(file) {
        var url = "";
@@ -2889,10 +2792,10 @@ HTMLArea.Editor.prototype.popupURL = function(file) {
                if (this.config.pathToPluginDirectory[pluginId]) {
                        url = this.config.pathToPluginDirectory[pluginId] + "popups/" + popup;
                } else {
-                       url = _typo3_host_url + _editor_url + "plugins/" + pluginId + "/popups/" + popup;
+                       url = HTMLArea.editorUrl + "plugins/" + pluginId + "/popups/" + popup;
                }
        } else {
-               url = _typo3_host_url + _editor_url + this.config.popupURL + file;
+               url = HTMLArea.editorUrl + this.config.popupURL + file;
        }
        return url;
 };
@@ -3209,9 +3112,6 @@ HTMLArea.Editor.prototype.scrollToCaret = function() {
  *  UTILITY FUNCTIONS
  ***************************************************/
 
-// variable used to pass the object to the popup editor window.
-HTMLArea._object = null;
-
 /*
  * Check if the client agent is supported
  */
@@ -3288,10 +3188,7 @@ HTMLArea._hasClass = function(el, className, substring) {
        return false;
 };
 
-HTMLArea.RE_blockTags = /^(body|p|h1|h2|h3|h4|h5|h6|ul|ol|pre|dl|dt|dd|div|noscript|blockquote|form|hr|table|caption|fieldset|address|td|tr|th|li|tbody|thead|tfoot|iframe)$/;
 HTMLArea.isBlockElement = function(el) { return el && el.nodeType == 1 && HTMLArea.RE_blockTags.test(el.nodeName.toLowerCase()); };
-HTMLArea.RE_closingTags = /^(p|blockquote|a|li|ol|ul|dl|dt|td|th|tr|tbody|thead|tfoot|caption|colgroup|table|div|b|bdo|big|cite|code|del|dfn|em|i|ins|kbd|label|q|samp|small|span|strike|strong|sub|sup|tt|u|var|abbr|acronym|font|center|object|embed|style|script|title|head)$/;
-HTMLArea.RE_noClosingTag = /^(img|br|hr|col|input|area|base|link|meta|param)$/;
 HTMLArea.needsClosingTag = function(el) { return el && el.nodeType == 1 && !HTMLArea.RE_noClosingTag.test(el.tagName.toLowerCase()); };
 
 /*
@@ -3325,7 +3222,7 @@ HTMLArea.getHTML = function(root, outputRoot, editor){
                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"]);
+               if (!HTMLArea.enableDebugMode) alert(HTMLArea.I18N.msg["HTML-document-not-well-formed"]);
                        else return HTMLArea.getHTMLWrapper(root,outputRoot,editor);
                return editor.document.body.innerHTML;
        }
@@ -3451,7 +3348,7 @@ HTMLArea.util.Tips = function () {
                                if (label && this.helpIcon && !Ext.isIE) {
                                        var helpImage = label.insertFirst({
                                                tag: 'img',
-                                               src: _editor_skin + 'images/helpbubble.gif',
+                                               src: HTMLArea.editorSkin + 'images/helpbubble.gif',
                                                style: 'vertical-align: middle; padding-right: 2px;'
                                        });
                                        if (this.helpDisplay == 'image' || this.helpDisplay == 'both'){
@@ -3775,11 +3672,6 @@ HTMLArea._postback = function(url, data, handler, addParams, charset, asynchrono
                }
                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) {
@@ -3787,7 +3679,7 @@ HTMLArea._postback = function(url, data, handler, addParams, charset, asynchrono
                                        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);
+                                       HTMLArea._appendToLog("ERROR [HTMLArea::_postback]: Unable to post " + url + " . Server reported " + req.statusText);
                                }
                        }
                }
@@ -3799,7 +3691,7 @@ HTMLArea._postback = function(url, data, handler, addParams, charset, asynchrono
                        req.send(content);
                }
 
-               req.open('POST', postUrl, asynchronous);
+               req.open('POST', url, asynchronous);
                req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
                if (!asynchronous) {
                        HTMLArea.pendingSynchronousXMLHttpRequest = true;
@@ -3810,7 +3702,7 @@ HTMLArea._postback = function(url, data, handler, addParams, charset, asynchrono
                                }
                                HTMLArea._appendToLog("[HTMLArea::_postback]: Server response: " + req.responseText);
                        } else {
-                               HTMLArea._appendToLog("ERROR [HTMLArea::_postback]: Unable to post " + postUrl + " . Server reported " + req.statusText);
+                               HTMLArea._appendToLog("ERROR [HTMLArea::_postback]: Unable to post " + url + " . Server reported " + req.statusText);
                        }
                        HTMLArea.pendingSynchronousXMLHttpRequest = false;
                } else {
@@ -3853,7 +3745,7 @@ HTMLArea.initEditor = function(editorNumber) {
                if (HTMLArea.checkSupportedBrowser()) {
                        document.getElementById('pleasewait' + editorNumber).style.display = 'block';
                        document.getElementById('editorWrap' + editorNumber).style.visibility = 'hidden';
-                       if (!HTMLArea.is_loaded) {
+                       if (!HTMLArea.isReady) {
                                HTMLArea.initEditor.defer(150, null, [editorNumber]);
                        } else {
                                        // Create an editor for the textarea
@@ -4545,7 +4437,7 @@ HTMLArea.Plugin = HTMLArea.Base.extend({
         * @return      string          the url
         */
        makeUrlFromModulePath: function(modulePath, parameters) {
-               return this.editor.popupURL(modulePath + "?" + this.editorConfiguration.RTEtsConfigParams + "&editorNo=" + this.editor.editorId + "&sys_language_content=" + this.editorConfiguration.sys_language_content + "&contentTypo3Language=" + this.editorConfiguration.typo3ContentLanguage + "&contentTypo3Charset=" + encodeURIComponent(this.editorConfiguration.typo3ContentCharset) + (parameters?parameters:''));
+               return modulePath + '?' + this.editorConfiguration.RTEtsConfigParams + '&editorNo=' + this.editor.editorId + '&sys_language_content=' + this.editorConfiguration.sys_language_content + '&contentTypo3Language=' + this.editorConfiguration.typo3ContentLanguage + '&contentTypo3Charset=' + encodeURIComponent(this.editorConfiguration.typo3ContentCharset) + (parameters?parameters:'');
        },
        /**
         * Append an entry at the end of the troubleshooting log
@@ -4556,7 +4448,7 @@ HTMLArea.Plugin = HTMLArea.Base.extend({
         * @return      void
         */
        appendToLog: function (functionName, text) {
-               HTMLArea._appendToLog("[" + this.name + "::" + functionName + "]: " + text);
+               HTMLArea._appendToLog('[' + this.name + '::' + functionName + ']: ' + text);
        },
        /*
         * Add a config element to config array if not empty
@@ -4822,7 +4714,7 @@ HTMLArea.Dialog = HTMLArea.Base.extend({
                link.rel = "stylesheet";
                link.type = "text/css";
                link.href = HTMLArea.editorCSS;
-               if (link.href.indexOf("http") == -1 && !Ext.isIE) link.href = _typo3_host_url + link.href;
+               if (link.href.indexOf("http") == -1 && !Ext.isIE) link.href = HTMLArea.hostUrl + link.href;
                head.appendChild(link);
        },
 
@@ -5087,4 +4979,4 @@ HTMLArea.Dialog = HTMLArea.Base.extend({
                Ext.EventManager.on(this.dialogWindow.document, 'keypress', this.closeOnEscape, this, {single: true});
         }
 });
-};
+}
index 3d16103..a696f9d 100644 (file)
@@ -42,28 +42,24 @@ InsertSmiley = HTMLArea.Plugin.extend({
         */
        configurePlugin : function(editor) {
                this.pageTSConfiguration = this.editorConfiguration.buttons.emoticon;
-               this.editor_url = _typo3_host_url + _editor_url;
-               if (this.editor_url == '../') {
-                       this.editor_url = document.URL.replace(/^(.*\/).*\/.*$/g, "$1");
-               }
                        // Default set of imoticons from Mozilla Thunderbird
                this.icons = [
-                       { file: this.editor_url + 'plugins/InsertSmiley/smileys/' + 'mozilla_smile' + '.png', alt: ':-)', title: this.localize('mozilla_smile')},
-                       { file: this.editor_url + 'plugins/InsertSmiley/smileys/' + 'mozilla_frown' + '.png', alt: ':-(', title: this.localize('mozilla_frown')},
-                       { file: this.editor_url + 'plugins/InsertSmiley/smileys/' + 'mozilla_wink' + '.png', alt: ';-)', title: this.localize('mozilla_wink')},
-                       { file: this.editor_url + 'plugins/InsertSmiley/smileys/' + 'mozilla_tongueout' + '.png', alt: ':-P', title: this.localize('mozilla_tongueout')},
-                       { file: this.editor_url + 'plugins/InsertSmiley/smileys/' + 'mozilla_laughing' + '.png', alt: ':-D', title: this.localize('mozilla_laughing')},
-                       { file: this.editor_url + 'plugins/InsertSmiley/smileys/' + 'mozilla_embarassed' + '.png', alt: ':-[', title: this.localize('mozilla_embarassed')},
-                       { file: this.editor_url + 'plugins/InsertSmiley/smileys/' + 'mozilla_undecided' + '.png', alt: ':-\\', title: this.localize('mozilla_undecided')},
-                       { file: this.editor_url + 'plugins/InsertSmiley/smileys/' + 'mozilla_surprised' + '.png', alt: '=-O', title: this.localize('mozilla_surprised')},
-                       { file: this.editor_url + 'plugins/InsertSmiley/smileys/' + 'mozilla_kiss' + '.png', alt: ':-*', title: this.localize('mozilla_kiss')},
-                       { file: this.editor_url + 'plugins/InsertSmiley/smileys/' + 'mozilla_yell' + '.png', alt: '>:o', title: this.localize('mozilla_yell')},
-                       { file: this.editor_url + 'plugins/InsertSmiley/smileys/' + 'mozilla_cool' + '.png', alt: '8-)', title: this.localize('mozilla_cool')},
-                       { file: this.editor_url + 'plugins/InsertSmiley/smileys/' + 'mozilla_moneyinmouth' + '.png', alt: ':-$', title: this.localize('mozilla_moneyinmouth')},
-                       { file: this.editor_url + 'plugins/InsertSmiley/smileys/' + 'mozilla_footinmouth' + '.png', alt: ':-!', title: this.localize('mozilla_footinmouth')},
-                       { file: this.editor_url + 'plugins/InsertSmiley/smileys/' + 'mozilla_innocent' + '.png', alt: 'O:-)', title: this.localize('mozilla_innocent')},
-                       { file: this.editor_url + 'plugins/InsertSmiley/smileys/' + 'mozilla_cry' + '.png', alt: ':\'(', title: this.localize('mozilla_cry')},
-                       { file: this.editor_url + 'plugins/InsertSmiley/smileys/' + 'mozilla_sealed' + '.png', alt: ':-X', title: this.localize('mozilla_sealed')}
+                       { file: HTMLArea.editorUrl + 'plugins/InsertSmiley/smileys/' + 'mozilla_smile' + '.png', alt: ':-)', title: this.localize('mozilla_smile')},
+                       { file: HTMLArea.editorUrl + 'plugins/InsertSmiley/smileys/' + 'mozilla_frown' + '.png', alt: ':-(', title: this.localize('mozilla_frown')},
+                       { file: HTMLArea.editorUrl + 'plugins/InsertSmiley/smileys/' + 'mozilla_wink' + '.png', alt: ';-)', title: this.localize('mozilla_wink')},
+                       { file: HTMLArea.editorUrl + 'plugins/InsertSmiley/smileys/' + 'mozilla_tongueout' + '.png', alt: ':-P', title: this.localize('mozilla_tongueout')},
+                       { file: HTMLArea.editorUrl + 'plugins/InsertSmiley/smileys/' + 'mozilla_laughing' + '.png', alt: ':-D', title: this.localize('mozilla_laughing')},
+                       { file: HTMLArea.editorUrl + 'plugins/InsertSmiley/smileys/' + 'mozilla_embarassed' + '.png', alt: ':-[', title: this.localize('mozilla_embarassed')},
+                       { file: HTMLArea.editorUrl + 'plugins/InsertSmiley/smileys/' + 'mozilla_undecided' + '.png', alt: ':-\\', title: this.localize('mozilla_undecided')},
+                       { file: HTMLArea.editorUrl + 'plugins/InsertSmiley/smileys/' + 'mozilla_surprised' + '.png', alt: '=-O', title: this.localize('mozilla_surprised')},
+                       { file: HTMLArea.editorUrl + 'plugins/InsertSmiley/smileys/' + 'mozilla_kiss' + '.png', alt: ':-*', title: this.localize('mozilla_kiss')},
+                       { file: HTMLArea.editorUrl + 'plugins/InsertSmiley/smileys/' + 'mozilla_yell' + '.png', alt: '>:o', title: this.localize('mozilla_yell')},
+                       { file: HTMLArea.editorUrl + 'plugins/InsertSmiley/smileys/' + 'mozilla_cool' + '.png', alt: '8-)', title: this.localize('mozilla_cool')},
+                       { file: HTMLArea.editorUrl + 'plugins/InsertSmiley/smileys/' + 'mozilla_moneyinmouth' + '.png', alt: ':-$', title: this.localize('mozilla_moneyinmouth')},
+                       { file: HTMLArea.editorUrl + 'plugins/InsertSmiley/smileys/' + 'mozilla_footinmouth' + '.png', alt: ':-!', title: this.localize('mozilla_footinmouth')},
+                       { file: HTMLArea.editorUrl + 'plugins/InsertSmiley/smileys/' + 'mozilla_innocent' + '.png', alt: 'O:-)', title: this.localize('mozilla_innocent')},
+                       { file: HTMLArea.editorUrl + 'plugins/InsertSmiley/smileys/' + 'mozilla_cry' + '.png', alt: ':\'(', title: this.localize('mozilla_cry')},
+                       { file: HTMLArea.editorUrl + 'plugins/InsertSmiley/smileys/' + 'mozilla_sealed' + '.png', alt: ':-X', title: this.localize('mozilla_sealed')}
                 ];
                /*
                 * Registering plugin "About" information
index ffda23a..8105353 100644 (file)
@@ -109,7 +109,7 @@ SpellChecker = HTMLArea.Plugin.extend({
                        'Spell Checker',
                        this.getWindowDimensions(
                                {
-                                       width: 710,
+                                       width: 740,
                                        height: 600
                                },
                                buttonId
@@ -207,7 +207,7 @@ SpellChecker = HTMLArea.Plugin.extend({
                                                name: 'contentframe',
                                                tag: 'iframe',
                                                cls: 'contentframe',
-                                               src: Ext.isGecko ? 'javascript:void(0);' : (Ext.isOpera ? _typo3_host_url : '') + _editor_url + 'popups/blank.html'
+                                               src: Ext.isGecko ? 'javascript:void(0);' : HTMLArea.editorUrl + 'popups/blank.html'
                                        }
                                },{
                                                // The original word
@@ -654,7 +654,7 @@ SpellChecker = HTMLArea.Plugin.extend({
                        select.setValue(store.getAt(0).get('value'));
                        select.fireEvent('select', select, store.getAt(0), 0);
                } else {
-                       this.dialog.find('itemId', 'replacement')[0].setVvalue(this.currentElement.innerHTML);
+                       this.dialog.find('itemId', 'replacement')[0].setValue(this.currentElement.innerHTML);
                }
                return false;
        },
index b72b1a2..417d232 100644 (file)
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 2005-2009 Stanislas Rolland <stanislas.rolland(arobas)fructifor.ca>
+*  (c) 2005-2010 Stanislas Rolland <typo3(arobas)sjbr.ca>
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
@@ -27,7 +27,7 @@
 /**
  * Content parsing for htmlArea RTE
  *
- * @author     Stanislas Rolland <stanislas.rolland(arobas)fructifor.ca>
+ * @author     Stanislas Rolland <typo3(arobas)sjbr.ca>
  *
  * $Id$  *
  */
@@ -138,14 +138,10 @@ class tx_rtehtmlarea_parse_html {
                                }
                        }
                }
-
                return $html;
        }
-
 }
-
 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rtehtmlarea/mod6/class.tx_rtehtmlarea_parse_html.php']) {
        include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rtehtmlarea/mod6/class.tx_rtehtmlarea_parse_html.php']);
 }
-
 ?>
\ No newline at end of file
index 3e324c3..f43af4a 100644 (file)
  *
  * $Id$  *
  */
-
 require_once(t3lib_extMgm::extPath('rtehtmlarea').'class.tx_rtehtmlarea_base.php');
-
 class tx_rtehtmlarea_pi2 extends tx_rtehtmlarea_base {
 
                // External:
-       var $RTEWrapStyle = '';                         // Alternative style for RTE wrapper <div> tag.
-       var $RTEdivStyle = '';                          // Alternative style for RTE <div> tag.
-       var $extHttpPath;                               // full Path to this extension for http (so no Server path). It ends with "/"
-       public $httpTypo3Path;
+       public $RTEWrapStyle = '';                              // Alternative style for RTE wrapper <div> tag.
+       public $RTEdivStyle = '';                               // Alternative style for RTE <div> tag.
 
                // For the editor
        var $elementId;
@@ -82,21 +78,12 @@ class tx_rtehtmlarea_pi2 extends tx_rtehtmlarea_base {
                 * INIT THE EDITOR-SETTINGS
                 * =======================================
                 */
-
-                       // first get the http-path to typo3:
-               $this->httpTypo3Path = substr( substr( t3lib_div::getIndpEnv('TYPO3_SITE_URL'), strlen( t3lib_div::getIndpEnv('TYPO3_REQUEST_HOST') ) ), 0, -1 );
-               if (strlen($this->httpTypo3Path) == 1) {
-                       $this->httpTypo3Path = '/';
-               } else {
-                       $this->httpTypo3Path .= '/';
-               }
                        // Get the path to this extension:
-               $this->extHttpPath = $this->httpTypo3Path.t3lib_extMgm::siteRelPath($this->ID);
+               $this->extHttpPath = t3lib_extMgm::siteRelPath($this->ID);
                        // Get the site URL
                $this->siteURL = t3lib_div::getIndpEnv('TYPO3_SITE_URL');
                        // Get the host URL
-               $this->hostURL = t3lib_div::getIndpEnv('TYPO3_REQUEST_HOST');
-
+               $this->hostURL = '';
                        // Element ID + pid
                $this->elementId = $PA['itemFormElName'];
                $this->elementParts[0] = $table;
@@ -123,12 +110,10 @@ class tx_rtehtmlarea_pi2 extends tx_rtehtmlarea_base {
                $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
                 * =======================================
@@ -312,9 +297,7 @@ class tx_rtehtmlarea_pi2 extends tx_rtehtmlarea_base {
                }';
        }
 }
-
-if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rtehtmlarea/pi2/class.tx_rtehtmlarea_pi2.php'])       {
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rtehtmlarea/pi2/class.tx_rtehtmlarea_pi2.php']) {
        include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rtehtmlarea/pi2/class.tx_rtehtmlarea_pi2.php']);
 }
-
 ?>
\ No newline at end of file