Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-8831

Support arbitrary URL in JS skin extensions in addition to skin files

    XMLWordPrintable

Details

    • New Feature
    • Resolution: Unresolved
    • Major
    • None
    • 4.5
    • Skin - Skinx
    • None
    • Unknown

    Description

      There is currently no clean way to use skinx to add a <script> tag for JS stored in an attachment, or more importantly inside a zip attachment.

      For example, to have a JS framework stored as multiple files (one loading the others by relative path), I create a Zip file attached to a document, and I currently misuse the jsfx extension like this:

      #set($void = $xwiki.jsfx.use("../..${xwiki.getAttachmentURL('MySpace.MyPage', 'myzip.zip')}/path/to/myjavascript.js"))
      

      This is obviously not nice, but it works. I would like to have this available cleanly, let say through a jsux plugin, so I would be able to do something like:

      #set($void = $xwiki.jsux.use("${xwiki.getAttachmentURL('MySpace.MyPage', 'myzip.zip')}/path/to/myjavascript.js"))
      

      Other existing alternatives (without touching to the FS) currently does not work when the JS you are loading, load itself other JS based on its own path. Something that is used very often by third party libraries.
      More generally, integrating widgets or other pre-made web stuffs built for the filesystem is tricky to do in XWiki. Using zip file helps, but may needs the above to be complete.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              softec Denis Gervalle
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: