Opened 9 years ago

Closed 9 years ago

#1563 closed defect (wontfix)

No way to set `showLoading=false` if using XinhaLoader.js

Reported by: ejucovy Owned by: gogo
Priority: normal Milestone:
Component: Xinha Core Version: trunk
Severity: normal Keywords:
Cc:

Description

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.

Attachments (2)

XinhaLoader.patch (927 bytes) - added by ejucovy 9 years ago.
XinhaConfig.js (5.9 KB) - added by ejucovy 9 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)

Download all attachments as: .zip

Change History (5)

Changed 9 years ago by ejucovy

Changed 9 years ago by ejucovy

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)

comment:1 Changed 9 years ago by ejucovy

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)

comment:1 Changed 9 years ago by ejucovy

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)

comment:2 Changed 9 years ago by ejucovy

  • Resolution set to wontfix
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.