Item10178: JQREQUIRE names and ADDTOZONE require's are un-necessarily incompatible.
Priority: Normal
Current State: Closed
Released In: n/a
Target Release: n/a
%JQREQUIRE{jsoneditor}%
%ADDTOZONE{id="json-editor-demo" requires="JQUERYPLUGIN::JSONEDITOR" text="<script type='text/javascript' src='%PUBURL%/%SYSTEMWEB%/JSONEditorJQueryPlugin/json-editor-demo.js'></script>"}%
if a user has written
No such plugin jsoneditor
they would then expect to be able to say
%ADDTOZONE{ requires="jsoneditor"
and additionally, its pretty darned trivial to point out that a .js with a require probably requires to eb after the script section.
jsoneditor (in JSONEDITOR.pm cdefined both css and js sections which then results in 2 sections, one in css and one in script with the same
require
name, so the user of add to zone not only needs to use a different name, but remember that the 'default' param in
ADDTOZONE is not optinoal (dispite the docco), but needs to tell it that its a script section
this can be avoided via clever naming of the generated sections..
so - there are 3 things we could do to make JQREQUIRE and
ADDTOZONE less irritating:
- have ADDTOZONE understand JQREQUIRE names (if it find one, it uses it, if not, it treats it as a regular literal zone
- have the JQueryPlugin created zones (from the JQueryPlugin Plugins
javascript
and css
definitions) result in different zone id
- JQUERYPLUGIN::JSONEDITOR::HEAD
and JQUERYPLUGIN::JSONEDITOR::SCRIPT
so that it becomes obvious to the user why their require
isn't where they thought it was
tbh, i don't grok why adding to a
script
section uses literal html, rather than a list of relocatable files to import -
Web.Topic/jquery.jsoneditor.js,http://somehwere.com/somefile.js
etc, which can then be minified, compressed and cdn'd - maybe later..
--
SvenDowideit - 19 Dec 2010
Is this about
- convenience or
- missing docu only or
- a coding problem or
- a conceptual problem?
Could you be a bit more clear, please.
--
MichaelDaum - 20 Dec 2010
all of the above - basically, we're defining a label in one macro, and then not re-using that same label in another macro - this leads to an un-necessarily error prone user experience.
--
SvenDowideit - 18 Feb 2011
Closing due to inactivity. Last state was Proposal Required.
--
MichaelDaum - 12 Oct 2013