Uploaded image for project: 'Magnolia Javascript Models'
  1. Magnolia Javascript Models
  2. JSMODELS-17

Enable load function of Magnolia resource

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Neutral Neutral
    • 1.0
    • 1.0
    • None
    • Kromeriz 110
    • 3

      In a JavaScript model you can load other js files which define other JavaScript classes.
      Currently it works like this:

      load(__PATH__ + "/../js/utils.js");
      

      The _PATH_ variable is evaluated by the system, it is the path of the script (which calls load) on the file system.

      This is breaking the concept that a JS model can be any Magnolia resource (currently a Magnolia resource can be from the file system, from classpath or a file representation in a JCR node).

      An improved version should support something like this:

       loadScript('/path/to/resource/in/our/resource/origin')
      

      e.g.

       loadScript('/javascript-model-samples/templates/js/formProcessors/saveContact.js')
      

        Acceptance criteria

              jsimak Jaroslav Simak
              cmeier Christoph Meier
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Task DoD