sleemanj / xinha

WYSIWYG HTML Editor Component (turns <textarea> into HTML editors)
http://trac.xinha.org/
Other
13 stars 2 forks source link

No way to set `showLoading=false` if using XinhaLoader.js (Trac #1563) #1563

Closed sleemanj closed 3 years ago

sleemanj commented 13 years ago

See http://www.xinha.org/punbb/viewtopic.php?pid=8777#p8777

There is no way to disable the "loading" message if you are using XinhaLoader.js, because that file unconditionally calls createLoadingMessages for all xinha_editors.

The config.showLoading option doesn't work, because when the XinhaLoader.js script is executed, the configuration object isn't available yet.

A simple solution is to let the user specify an explicit list of editors that the loading message should be shown for (in parallel to xinha_editors). This is a suboptimal solution because it means configuration of the loading message behavior looks totally different if you use XinhaLoader.js vs XinhaCore.js -- but I don't think there's any way around that.

More broadly, XinhaLoader.js makes me nervous, because it duplicates large chunks of code from XinhaCore.js so it's easy for them to get out of sync. And also because of the problem mentioned above -- that there is no way to pass configuration to it without inventing a whole new configuration system just for it. (For the most part this doesn't matter, because most configuration doesn't have any effect until the xinha editors are actually created .. it may just be the showLoading option.)

Of course, it could also be argued that if you're using XinhaLoader.js you are accepting the unconditional existence of loading messages.

Reported by ejucovy, migrated from http://trac.xinha.org/ticket/1563

sleemanj commented 13 years ago

Attachment: XinhaLoader.patch

sleemanj commented 13 years ago

an example configuration (based on the Newbie config) that shows how to disable XinhaLoader.js's loading message for some editors (needs patch to XinhaLoader.js) Attachment: XinhaConfig.js

sleemanj commented 13 years ago

ejucovy commented:

I attached a patch to XinhaLoader.js which lets the user specify which editors should have loading messages, using a new global variable. I also attached an example XinhaConfig.js that shows how to use this.

But, I am leaning towards the last approach in the ticket:

Of course, it could also be argued that if you're using XinhaLoader.js you are accepting the unconditional existence of loading messages.

Part of the reason I'm leaning towards this is that I don't think we should be adding new functionality to XinhaLoader.js; I'd rather try to deprecate it (though I don't know how realistic that is)

sleemanj commented 13 years ago

ejucovy commented:

I attached a patch to XinhaLoader.js which lets the user specify which editors should have loading messages, using a new global variable. I also attached an example XinhaConfig.js that shows how to use this.

But, I am leaning towards the last approach in the ticket:

Of course, it could also be argued that if you're using XinhaLoader.js you are accepting the unconditional existence of loading messages.

Part of the reason I'm leaning towards this is that I don't think we should be adding new functionality to XinhaLoader.js; I'd rather try to deprecate it (though I don't know how realistic that is)

sleemanj commented 13 years ago