You are here: Foswiki>Tasks Web>Item10178 (12 Oct 2013, MichaelDaum)Edit Attach

Item10178: JQREQUIRE names and ADDTOZONE require's are un-necessarily incompatible.

pencil
Priority: Normal
Current State: Closed
Released In: n/a
Target Release: n/a
Applies To: Engine
Component: ADDTOZONE, JQueryPlugin, JREQUIRE
Branches:
Reported By: SvenDowideit
Waiting For: Main.SvenDowideit
Last Change By: MichaelDaum
%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:

  1. have ADDTOZONE understand JQREQUIRE names (if it find one, it uses it, if not, it treats it as a regular literal zone
  2. 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
 

ItemTemplate edit

Summary JQREQUIRE names and ADDTOZONE require's are un-necessarily incompatible.
ReportedBy SvenDowideit
Codebase
SVN Range
AppliesTo Engine
Component ADDTOZONE, JQueryPlugin, JREQUIRE
Priority Normal
CurrentState Closed
WaitingFor SvenDowideit
Checkins
TargetRelease n/a
ReleasedIn n/a
CheckinsOnBranches
trunkCheckins
Release01x01Checkins
Topic revision: r6 - 12 Oct 2013, MichaelDaum
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy