TinyMCE, iFrames, JQuery and Drupal scattered notes
Drag and drop into the TinyMCE textarea triggers onEvent twice in such close succession that it creates a race condition, and the same values for the length of the textarea before and after are given.
Getting around this by putting the character change check new value set before running the code. Maybe a timer check, or ideally a way to check the textarea with just a timer and not use onEvent at all, would be best.
I am trying very hard to make a plugin that needs to watch the text area, that is, simply run code that isn't triggered by a button. Is there a plugin that would have an example of this? Any other advice? Many thanks.
Was not a question to which I found a straightforward answer.
You can take a look at what all has been done with a
git clone http://git.agariclabs.com/git/other/tinymce-cleanword.git
Wait, replace and insert couldn't be this easy, could it?
tinyMCE.activeEditor.setContent(tinyMCE.activeEditor.getContent());
http://tinymce.moxiecode.com/punbb/viewtopic.php?id=12070
This is the way that uses
Resources
Many of these I haven't really gone through yet. The work in this case was more about figuring out TinyMCE than
Enumerating JavaScript Objects
JQuery selector for inline style property
http://jquery.bassistance.de/api-browser/#loadStringObjectFunction
http://www.w3schools.com/htmldom/met_win_settimeout.asp
JavaScript TinyMCE/jQuery race condition on firefox
http://stackoverflow.com/questions/346926/javascript-tinymce-jquery-race-condition-on-firefox
tinyMCE.execCommand('mceSetContent',false,theText);
http://markmail.org/message/p7v4xxrdrgrp6ndu
http://blog.rebeccamurphey.com/2009/01/12/jquery-validation-and-tinymce/
http://tinymce.moxiecode.com/punbb/viewtopic.php?id=8686
http://brian.pontarelli.com/2007/09/12/how-to-get-jquery-and-tinymce-to-work/
http://dev.jquery.com/wiki/Plugins/tinyMCE
Making JQuery work within an iFrame
We didn't use this approach, doing things from within TinyMCE instead.
http://query7.com/manipulation-in-jquery/
New jQuery Plugin - $.frameReady()
http://ideamill.synaptrixgroup.com/?p=6
How to access iframe in jQuery
http://simple.procoding.net/2008/03/21/how-to-access-iframe-in-jquery/
http://jquery.bassistance.de/api-browser/#loadStringObjectFunction
From Drupaler Nate Haug, how to access things in an iFrame with JQuery:
http://quicksketch.org/node/263
Comments
Post new comment