Menu

How to make TinyMCE use a resizable iframe?

Help
Nap
2020-07-30
2020-08-12
  • Nap

    Nap - 2020-07-30

    [WikiNDX 6.3.7]

    I've been going through the CSS attempting to use resize: both; overflow: auto;, but in spite of Firefox's Inspector telling me it's there, I cannot see the tool, nor can I adust the size. Oddly, I've been able to make the TinyMCE drop-down buttons resizable, and on some screen refreshed, I can momentarily see the tool but it then disappears.

    I then realised, while googling, that TinyMCE has its own way of handling this through JS. I can see in the JS code that the "autoresize" plugin is included, but I haven't been able to get it to work.

    Has anyone attempted/succeeded at this?

     

    Last edit: Nap 2020-07-30
  • Mark Grimshaw

    Mark Grimshaw - 2020-07-30

    Hi Nap,

    Stéphane is in the middle of switching from TinyMCE v4 to v5 so why not wait until then. If it is important to do it now, I don't have the experience in that area to offer advice.

    Regards,

    Mark

     
    • Nap

      Nap - 2020-07-30

      Thanks Mark for the update. I wish Stephane all the best. TinyMCE is one of those things we love to hate but can't do without.

      Do you have a target date when this may be completed? (Just curious.)

       
      • Stéphane Aulery

        Hello Nap,

        That will take months.

        We jump from TinyMCE 2 to 5.

        Since you are programming, if you want to participate on this topic or others you are welcome!

        Regards,

         
  • Mark Grimshaw

    Mark Grimshaw - 2020-07-31

    No date yet Nap. It's a lot of work converting all the plugins.

    Mark

     
  • Nap

    Nap - 2020-08-02

    HI Stephane, I dug up my Eclipse PDT setup, and after battling with the PHP Server/Debug settings for a few hours, I am finally able to step through the WikiNDX code. So, I'm ready to take on some things.

    I do have some thoughts on what I would like to do, but I'm sure there are things you guys already have in the pipeline, like the move to a newer TinyMCE.

    The things I think I would like to do are:
    Enable user notes (with option to be public),
    Debug the abstract/notes fields, or introduce a new field, to allow reliable insertions of large images (i.e. screen-grabs of web pages). Using the abstract/notes fields works most of the time but fails in some cases (maybe due to the use of the 'back' button, not sure).
    Allow resizing of the TinyMCE edit window.
    (and various other ideas)

    Is there a TODO list somewhere?
    Are there any documents I can refer to so get an understanding of the overall architecture/design of WikiNDX?

    Cheers, Nap.

     
    • Stéphane Aulery

      Hi Nap,

      I have read your message. Great that you are interested in contributing to the Wikindx code! I'll leave it to Mark to answer you first.

      Regards,

       
  • Mark Grimshaw

    Mark Grimshaw - 2020-08-03

    Hi Nap,

    We're always welcoming to those who wish to contribute!

    The phpdoc-produced manual can be downloaded here: https://sourceforge.net/projects/wikindx/files/current_release/

    There are other docs under /docs in the installation folder.

    What do you mean by 'Enable user notes (with option to be public)?' Something similar to the ideas and musings both of which can be made private, limited to user groups, or public? Or are you thinking of something else?

    Re inserting of large images, I'm not sure what the problem is. I have no problem when the screen grab is saved as a file and then inserted (enable this in Admin|Configure|General Display). If you are talking about copy and paste of screengrabs, I haven't tried this.

    On the SF site, we have the list of bugs and feature requests so this currently functions as a part TODO list.

    The big TODO, as far as I'm concerned, is the collaborative authoring in the word processor. While I'm spending a fair bit of time thinking of strategies, I'll only really get going on it once we have TinyMCE v5. It's a big, big, complex task.

    If you're any good at javascript, you could try this: https://sourceforge.net/p/wikindx/v5bugs/155/

    Regards,

    Mark

     
    • Stéphane Aulery

      Hi Mark,

      Bug #155 is too overdependent ont the TinyMCE version. I already solved it for CKEditor. I keep that as a part of the migration of TinyMCE.

      Regards,

       
      • Stéphane Aulery

        Nap,

        Could you introduce yourself in private?

        I would also like to know your experiences and your tastes as a programmer.

        In my opinion you should add to https://sourceforge.net/p/wikindx/v5bugs/ what you would like to do, one ticket per subject so that we can discuss it. After that we can help you choose an easy task to discover the code according to what interests you.

        Regards,

         
        • Nap

          Nap - 2020-08-04

          Hi Stephane, I would be happy to introduce myself. Do you have any suggestions on how?
          I held a Jitsi conference with Mark the other day and screenshared our lab's implementation of WikiNDX. We could do the same if you like?
          I can be reached at napoleon_blownapart at the abms.net.au domain. We can make further arrangements from there.

           
          • Stéphane Aulery

            It's just to know who you are, what you're working on, and what your background in programming and computer systems is.

             
      • Mark Grimshaw

        Mark Grimshaw - 2020-08-03

        OK.

         
    • Nap

      Nap - 2020-08-04

      What do you mean by 'Enable user notes (with option to be public)?' Something similar to the ideas and musings both of which can be made private, limited to user groups, or public? Or are you thinking of something else?

      It would be useful, in our multi-user environment to allow each user to compile their own notes. It would also be useful to be able to make the notes visible to other users on the system. Following the Musings pattern seems ok.

      Re inserting of large images, I'm not sure what the problem is. I have no problem when the screen grab is saved as a file and then inserted (enable this in Admin|Configure|General Display). If you are talking about copy and paste of screengrabs, I haven't tried this.

      I've found that inserting images into Abstract and Notes using copy/paste works fine when they are surrounded by text . What I've found iffy though is when I have an abstract/note that only contains an image (e.g. a screenshot of a web page).

      When returning to resources that have image only abstracts/notes, rendering of the image works fine until I perform some action that causes a database update of the resource's data. I haven't yet determined exactly what is causing this, but I believe that it has to do with using the browser's back button coupled with the fact that the http POST method is used.

      Resources with image only abstracts/notes work fine when the image data in the resourcetextAbstract and resourcetextNote fields is formatted using the
      data:image/png;base64 mime type, e.g:
      <img src="data:image/png;base64,..[image_data].. alt="">.

      The corruption occurs when this is re-written into a more traditional image format:
      <img src="blob:http://wikindx.int/dc5c75ce-cdbd-4e84-bd17-c35f4b9ae4b8" alt="">.
      In such cases, rather than having the image rendered, I obviously end up with a 'broken' image icon in the textarea.
      I'm not sure where the GUID is coming from as I don't make use of attachments in my implementation and there are no files stored within my WikiNDX folder structure (I use an Apache Aliase to the folder where I keep all my papers and this folder is in an entirely different part of my hard-drive).

      I've looked at the TODO list, and I'll have a word with Stephane about this.

      I also looked at the documentation you referenced. One thing which I was hoping to find there is an explanation of what each of the "Resource Types" are. Some are obvious, but others seem ambiguous to me. I'm not sure if they all follow BiBTeX definitions.

       
      • Mark Grimshaw

        Mark Grimshaw - 2020-08-04

        Hi Nap,

        I think the Musings do what you want to do – perhaps one day I will rename them 'User notes'. If you want a small task to get navigating around the code you could do this yourself.

        When I paste an image into the Abstract field, I get:

        So, same as you.

        By itself it works fine. I can also add another image using the image plugin and can add text to the abstract. No problem. I can edit the resource itself – again without problems displaying the pasted image.

        So I'm not sure what the issue is with your image. I'm using Firefox on a Mac. I'd recommend navigating around wikindx without the use of the browser back button as wikindx uses sessions (but I can't see how this will affect image fields).

        I have no written explanation of the various resource types. Certainly, most of them do not map onto bibtex as bibtex has about 17 different types (if memory serves) whereas wikindx has almost 40 – bibtex, for this reason, is not used in the humanities. There is a file in core/importexport/ called BIBTEXMAP.php that shows how bibtex maps back and forth between wikindx and core/resources/RESOURCEMAP.php contains the definitions of the wikindx types.

        Regards,

        Mark

         
  • Nap

    Nap - 2020-08-11

    I'm not really good with BUG Reports, so I'm going to make a comment here for now, which has to do with pasting images directly into the text areas (I've been doing this with the abstract and note fields).
    (I have opened a BUG ticket with using what I've written here. Any suggestions on how to improve my report are welcome.)

    In PARSEPHRASE.php::createCondition, line 405, the line should be updated to:
    $storedHighlight = array_filter(UTF8::mb_explode(',', $this->session->getVar("search_Highlight")));
    Whereby array_filter has been added to the existing code.

    This is required because if search_Hightlight is not set, $this->session->getVar("search_Highlight") returns an array with element [0] equal to an empty string.
    Without array_filter, the next line sets $storedHighlight to be ",SearchTerm" which confuses further implode statements because of the leading comma.

    The symptom of this problem is not noticed until you paste images into the text fields being searched. You will know when this occurs because Apache->php will go into an endless loop that requires Apache to be restarted. In order to trigger the problem outlined below, do the following:

    Create a resource with pasted images in the Abstract or Notes fields.
    After doing a `Quick Search` say on the author, choose to view the resource.
    PHP will go into an endless loop when it gets to the `preg_replace` in RESOURCECOMMON.php::doHighlight, line 136.
    (This requires the Apache server to be restarted.)
    

    Filtering $storedHighlight as indicated above fixes this problem.

     
  • Nap

    Nap - 2020-08-12

    Regarding the addition of the array_filter, I'm wondering if this could also be needed in line 264, as well as in the else portion in both cases (263 & 404)?
    I'm not sure under what circumstances the other execution paths occur.
    (I have added these to my install for now.)

     
  • Mark Grimshaw

    Mark Grimshaw - 2020-08-12

    Thanks Nap,

    I'd already done the else{} after 404 but have now added it twice c. line 263.

    Regards,

    Mark

     
    👍
    1

Log in to post a comment.