Fixed bug #17078: in fileadmin saving changes from t3editor doesn't work
authorTobias Liebig <mail@etobi.de>
Mon, 24 Jan 2011 14:44:42 +0000 (14:44 +0000)
committerTobias Liebig <mail@etobi.de>
Mon, 24 Jan 2011 14:44:42 +0000 (14:44 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@10278 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/t3editor/classes/class.tx_t3editor_hooks_fileedit.php
typo3/sysext/t3editor/ext_emconf.php
typo3/sysext/t3editor/res/jslib/fileedit.js [new file with mode: 0644]
typo3/sysext/t3editor/res/jslib/t3editor.js

index ecbcb92..2739249 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-01-24  Tobias Liebig  <mail_typo3@etobi.de>
+
+       * Fixed bug #17078: in fileadmin saving changes from t3editor doesn't work
+
 2011-01-24  Francois Suter  <francois.suter@typo3.org>
 
        * Follow-up to #16848: Added link to buzz.typo3.org article about changes to CSH in FlexForms to NEWS.txt
index 831f07a..18acc35 100644 (file)
@@ -86,6 +86,7 @@ class tx_t3editor_hooks_fileedit {
                                return;
                        }
                        $pObj->JScode .= $t3editor->getJavascriptCode($pObj);
+                       $pObj->loadJavascriptLib(t3lib_extmgm::extRelPath('t3editor') . 'res/jslib/fileedit.js');
                }
        }
 
index ee5b93a..f5ffc2c 100755 (executable)
@@ -3,7 +3,7 @@
 ########################################################################
 # Extension Manager/Repository config file for ext "t3editor".
 #
-# Auto generated 22-01-2011 20:11
+# Auto generated 24-01-2011 15:41
 #
 # Manual updates:
 # Only the data in the array - everything else is removed by next
@@ -34,7 +34,7 @@ $EM_CONF[$_EXTKEY] = array(
        'CGLcompliance' => '',
        'CGLcompliance_note' => '',
        'version' => '1.5.0',
-       '_md5_values_when_last_written' => 'a:28:{s:7:"LICENSE";s:4:"c17d";s:12:"ext_icon.gif";s:4:"7eb5";s:17:"ext_localconf.php";s:4:"3b52";s:14:"ext_tables.php";s:4:"7dff";s:13:"locallang.xml";s:4:"fa0e";s:29:"classes/class.tx_t3editor.php";s:4:"509a";s:44:"classes/class.tx_t3editor_hooks_fileedit.php";s:4:"bcae";s:50:"classes/class.tx_t3editor_hooks_tstemplateinfo.php";s:4:"2d87";s:62:"classes/ts_codecompletion/class.tx_t3editor_codecompletion.php";s:4:"baa9";s:59:"classes/ts_codecompletion/class.tx_t3editor_tsrefloader.php";s:4:"94f6";s:23:"icons/loader_eeeeee.gif";s:4:"83a4";s:21:"res/css/csscolors.css";s:4:"3845";s:20:"res/css/jscolors.css";s:4:"e5a0";s:24:"res/css/sparqlcolors.css";s:4:"40ba";s:20:"res/css/t3editor.css";s:4:"454d";s:26:"res/css/t3editor_inner.css";s:4:"7b52";s:28:"res/css/typoscriptcolors.css";s:4:"e060";s:21:"res/css/xmlcolors.css";s:4:"847a";s:21:"res/jslib/t3editor.js";s:4:"765d";s:45:"res/jslib/parse_typoscript/parsetyposcript.js";s:4:"c8af";s:48:"res/jslib/parse_typoscript/tokenizetyposcript.js";s:4:"dce5";s:47:"res/jslib/ts_codecompletion/completionresult.js";s:4:"ba5f";s:48:"res/jslib/ts_codecompletion/descriptionPlugin.js";s:4:"87a5";s:47:"res/jslib/ts_codecompletion/tscodecompletion.js";s:4:"8140";s:39:"res/jslib/ts_codecompletion/tsparser.js";s:4:"ab5c";s:36:"res/jslib/ts_codecompletion/tsref.js";s:4:"969e";s:27:"res/templates/t3editor.html";s:4:"4133";s:19:"res/tsref/tsref.xml";s:4:"9f7b";}',
+       '_md5_values_when_last_written' => 'a:29:{s:7:"LICENSE";s:4:"c17d";s:12:"ext_icon.gif";s:4:"7eb5";s:17:"ext_localconf.php";s:4:"3b52";s:14:"ext_tables.php";s:4:"7dff";s:13:"locallang.xml";s:4:"fa0e";s:29:"classes/class.tx_t3editor.php";s:4:"509a";s:44:"classes/class.tx_t3editor_hooks_fileedit.php";s:4:"ab8c";s:50:"classes/class.tx_t3editor_hooks_tstemplateinfo.php";s:4:"2d87";s:62:"classes/ts_codecompletion/class.tx_t3editor_codecompletion.php";s:4:"baa9";s:59:"classes/ts_codecompletion/class.tx_t3editor_tsrefloader.php";s:4:"94f6";s:23:"icons/loader_eeeeee.gif";s:4:"83a4";s:21:"res/css/csscolors.css";s:4:"3845";s:20:"res/css/jscolors.css";s:4:"e5a0";s:24:"res/css/sparqlcolors.css";s:4:"40ba";s:20:"res/css/t3editor.css";s:4:"454d";s:26:"res/css/t3editor_inner.css";s:4:"7b52";s:28:"res/css/typoscriptcolors.css";s:4:"e060";s:21:"res/css/xmlcolors.css";s:4:"847a";s:21:"res/jslib/fileedit.js";s:4:"e87e";s:21:"res/jslib/t3editor.js";s:4:"d87b";s:45:"res/jslib/parse_typoscript/parsetyposcript.js";s:4:"c8af";s:48:"res/jslib/parse_typoscript/tokenizetyposcript.js";s:4:"dce5";s:47:"res/jslib/ts_codecompletion/completionresult.js";s:4:"ba5f";s:48:"res/jslib/ts_codecompletion/descriptionPlugin.js";s:4:"87a5";s:47:"res/jslib/ts_codecompletion/tscodecompletion.js";s:4:"8140";s:39:"res/jslib/ts_codecompletion/tsparser.js";s:4:"ab5c";s:36:"res/jslib/ts_codecompletion/tsref.js";s:4:"969e";s:27:"res/templates/t3editor.html";s:4:"4133";s:19:"res/tsref/tsref.xml";s:4:"9f7b";}',
        'constraints' => array(
                'depends' => array(
                        'php' => '5.1.0-0.0.0',
diff --git a/typo3/sysext/t3editor/res/jslib/fileedit.js b/typo3/sysext/t3editor/res/jslib/fileedit.js
new file mode 100644 (file)
index 0000000..60b3fd9
--- /dev/null
@@ -0,0 +1,57 @@
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 2011 Tobias Liebig <mail_typo3@etobi.de>
+*  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!
+***************************************************************/
+
+Ext.onReady(function() {
+       Ext.select('.t3-icon-document-save, .t3-icon-document-save-close').each(function(element) {
+               var link = element.up('a');
+               if (link) {
+                       link.dom.setAttribute(
+                               'onclick',
+                               link.dom.getAttribute('onclick').replace('document.editform.submit();', '')
+                       );
+                       link.on('click', function(event, target) {
+                               event.stopEvent();
+                               if (!T3editor || !T3editor.instances[0]) {
+                                       document.editform.submit();
+                                       return false;
+                               }
+                               if (Ext.get(target).hasClass('t3-icon-document-save')) {
+                                       if (!T3editor.instances[0].disabled) {
+                                               T3editor.instances[0].saveFunctionEvent();
+                                       } else {
+                                               document.editform.submit();
+                                       }
+                               } else {
+                                       if (!T3editor.instances[0].disabled) {
+                                               T3editor.instances[0].updateTextareaEvent();
+                                       }
+                                       document.editform.submit();
+                               }
+                               return false;
+                       });
+               }
+       });
+});
index 8ad0ccc..4ed088a 100644 (file)
@@ -95,6 +95,7 @@ T3editor.prototype = {
                saveButtons: null,
                updateTextareaEvent: null,
                adjustWidth: -30,
+               disabled: false,
 
                init: function() {
                        var textareaDim = $(this.textarea).getDimensions();
@@ -189,6 +190,7 @@ T3editor.prototype = {
                // toggle between the textarea and t3editor
                toggleView: function(disable) {
                        $(this.outerdiv).fire('t3editor:toggleView', {t3editor: this, disable: disable});
+                       this.disabled = disable;
                        if (disable) {
                                this.textarea.value = this.mirror.editor.getCode();
                                this.outerdiv.hide();