This question about Missing functionality: Task closed

TinyMCEPlugin attachment uploader/inserter does not sync the list of attachments after upload

Implementation 1 and 2 will avoid the Close-to-Refresh-the-list-of-attachments issue. Maybe someone can choose one of these, make it better, and release it ?

Implementation 1: manual update button.

The following is a patch which adds a "Refresh" button next to the attachment list select field. When hit, this button will refresh the select field.

It has the following issues
  • we have hard-coded the "Refresh" text because we haven't yet understood what language file to change
  • the select update should be automatic either when going back to the link tab, or just after uploading a new one (just after displaying the "has been added" text).
  • we do not respect the "no-linefeed-nor-space" convention in the tiny_mce_popup.js script. Maybe we changed the wrong file and this file is being generated from the real one?

Implementation 2: automatic

The following is a patch which updates the attachment list (select field) every time you activate the Attachment tab.

It has the following issues
  • it will refresh the list, through a Foswiki REST call, every time you activate the Attachment tab, which might lead to performance problems.
  • we do not respect the "no-linefeed-nor-space" convention in the tiny_mce_popup.js script. Maybe we changed the wrong file and this file is being generated from the real one?


Hello Marc,

Great work! Do you have svn commit access? If not, please RequestAccessToSubversion and you may commit against Tasks.Item1482.

Your patch is not quite ready though, I'd like to talk you through it on IRC if possible, as I have some familiarity with packaging and fixing TMCE.

I haven't worked on these issues because I have been experimenting with re-working foswiki integration from scratch using jquery (JQueryPlugin will be shipped with 1.1). However this is some way off being available.

If you do checkin, please do so on both Release01x00 and trunk branches.

-- PaulHarvey - 15 Jun 2010

After reviewing the auto-refresh patch, I have decided we should find a different way smile
  • tiny_mce_popup.js does not have a _src version because this is a "core" file shipped with TinyMCE; many .htm files are hard-coded to this file and could not use a _src version easily even if it were made available. Foswiki should avoid modifying it because it becomes an extra maintenance and support cost.
  • Its uncompressed form is held in pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/classes/Popup.js .
  • It is built when you build TinyMCE itself, see the build.xml
  • These files are not distributed in the released versions of TinyMCEPlugin because they are only of use to developers who will be wanting all the source - please use a svn checkout of the TinyMCEPlugin when working on modifications

Solution:
  • The refresh method should be moved out of the tniyMCEPopup object and written into the foswikibuttons/jscripts/attach_src.js code
  • Actually, why don't we just call the already existing AttachDlg.init() method? This change seems to work:
--- a/trunk/TinyMCEPlugin/pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikibuttons/attach.htm
+++ b/trunk/TinyMCEPlugin/pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/foswikibuttons/attach.htm
@@ -13,7 +13,7 @@
     <body style="display: none">
       <div class="tabs">
         <ul>
-          <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#foswikibuttons_dlg.general_tab}</a></span></li>
+          <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="AttachDlg.init();return false;">{#foswikibuttons_dlg.general_tab}</a></span></li>
           <li id="upload_tab"><span><a href="javascript:mcTabs.displayTab('upload_tab','upload_panel');" onmousedown="return false;">{#foswikibuttons_dlg.upload_tab}</a></span></li>
         </ul>
       </div>

-- PaulHarvey - 16 Jun 2010

Done! A new release in Extensions/Testing.TinyMCEPlugin should be available soon. It will need latest JQueryPlugin + ZonePlugin, so upgrade to the trunk/1.1 version of TinyMCEPlugin with caution.

-- PaulHarvey - 25 Jun 2010

QuestionForm edit

Subject Missing functionality
Extension TinyMCEPlugin
Version Foswiki 1.0.9
Status Task closed
I Attachment Action Size Date Who Comment
add-refresh-attachment-list-tinymcepluginEXT add-refresh-attachment-list-tinymceplugin manage 11 K 15 Jun 2010 - 17:57 MarcSCHAEFER First attempt for a new functionnality
auto-refresh-attachment-list-tinymcepluginEXT auto-refresh-attachment-list-tinymceplugin manage 12 K 15 Jun 2010 - 19:31 MarcSCHAEFER Automatic refresh of select list
Topic revision: r5 - 25 Jun 2010, PaulHarvey
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy