Fixed bug #14770: htmlArea RTE: Abbreviation dialogue not always correctly initialized
authorStanislas Rolland <typo3@sjbr.ca>
Thu, 17 Jun 2010 21:07:16 +0000 (21:07 +0000)
committerStanislas Rolland <typo3@sjbr.ca>
Thu, 17 Jun 2010 21:07:16 +0000 (21:07 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7957 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/rtehtmlarea/ChangeLog
typo3/sysext/rtehtmlarea/htmlarea/plugins/Acronym/acronym.js

index 1c6e010..c6e201a 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-06-17  Stanislas Rolland  <typo3@sjbr.ca>
+
+       * Fixed bug #14770: htmlArea RTE: Abbreviation dialogue not always correctly initialized
+
 2010-06-17  Ingo Renner  <ingo@typo3.org>
 
        * Fixed issue #14729: Backwards compatibility broken by disabled deprecation log
index 9def715..4ce1bd9 100644 (file)
@@ -1,3 +1,7 @@
+2010-06-17  Stanislas Rolland  <typo3@sjbr.ca>
+
+       * Fixed bug #14770: htmlArea RTE: Abbreviation dialogue not always correctly initialized
+
 2010-06-16  Stanislas Rolland  <typo3@sjbr.ca>
 
        * Fixed bug #14567: htmlArea RTE: RTE is greyed out and has no "styles" in page module QuickEdit
index 37453f1..d049de3 100644 (file)
@@ -42,13 +42,13 @@ HTMLArea.Acronym = HTMLArea.Plugin.extend({
                 * Registering plugin "About" information
                 */
                var pluginInformation = {
-                       version         : "2.1",
-                       developer       : "Stanislas Rolland",
-                       developerUrl    : "http://www.sjbr.ca/",
-                       copyrightOwner  : "Stanislas Rolland",
-                       sponsor         : "SJBR",
-                       sponsorUrl      : "http://www.sjbr.ca/",
-                       license         : "GPL"
+                       version         : '2.2',
+                       developer       : 'Stanislas Rolland',
+                       developerUrl    : 'http://www.sjbr.ca/',
+                       copyrightOwner  : 'Stanislas Rolland',
+                       sponsor         : 'SJBR',
+                       sponsorUrl      : 'http://www.sjbr.ca/',
+                       license         : 'GPL'
                };
                this.registerPluginInformation(pluginInformation);
                /*
@@ -254,7 +254,13 @@ HTMLArea.Acronym = HTMLArea.Plugin.extend({
                        width: 350,
                        listeners: {
                                beforerender: {
-                                       fn: this.onSelectorRender,
+                                       fn: function (combo) {
+                                                       // Ensure the store is loaded
+                                               combo.getStore().load({
+                                                       callback: function () { this.onSelectorRender(combo); },
+                                                       scope: this
+                                               });
+                                       },
                                        scope: this
                                },
                                select: {
@@ -281,7 +287,13 @@ HTMLArea.Acronym = HTMLArea.Plugin.extend({
                        width: 100,
                        listeners: {
                                beforerender: {
-                                       fn: this.onSelectorRender,
+                                       fn: function (combo) {
+                                                       // Ensure the store is loaded
+                                               combo.getStore().load({
+                                                       callback: function () { this.onSelectorRender(combo); },
+                                                       scope: this
+                                               });
+                                       },
                                        scope: this
                                },
                                select: {
@@ -394,20 +406,31 @@ HTMLArea.Acronym = HTMLArea.Plugin.extend({
                        // Make sure the combo list is filtered
                store.snapshot = store.data;
                var store = combo.getStore();
-               if (combo.getItemId() == 'termSelector' && this.params.title) {
-                       var index = store.findExact('term', this.params.title);
-                       if (index !== -1) {
-                               combo.setValue(store.getAt(index).get('term'));
+                       // Initialize the term and abbr combos
+               if (combo.getItemId() == 'termSelector') {
+                       if (this.params.title) {
+                               var index = store.findExact('term', this.params.title);
+                               if (index !== -1) {
+                                       var record = store.getAt(index);
+                                       combo.setValue(record.get('term'));
+                                       this.onTermSelect(combo, record, index);
+                               }
+                       } else if (this.params.text) {
+                               var index = store.findExact('term', this.params.text);
+                               if (index !== -1) {
+                                       var record = store.getAt(index);
+                                       combo.setValue(record.get('term'));
+                                       this.onTermSelect(combo, record, index);
+                               }
                        }
                } else if (combo.getItemId() == 'abbrSelector' && this.params.text) {
                        var index = store.findExact('abbr', this.params.text);
                        if (index !== -1) {
-                               combo.setValue(store.getAt(index).get('abbr'));
+                               var record = store.getAt(index);
+                               combo.setValue(record.get('abbr'));
+                               this.onAbbrSelect(combo, record, index);
                        }
                }
-               if (this.params.abbr && store.getCount() < 2) {
-                       combo.ownerCt.hide();
-               }
        },
        /*
         * Handler when a term is selected