onecrayon / Spice-sugar

Allows extending the Espresso editor using Javascript
http://onecrayon.com/spice/
Other
16 stars 0 forks source link

Update search paths to use Support layout #4

Closed onecrayon closed 15 years ago

onecrayon commented 15 years ago

When loading a script, JSCocoaLoader would look here:

  1. User's App Support folder => Support/Scripts
  2. Sugar that defines the action => Support/Scripts

Calls to importJS('scriptname') would search:

  1. User => Support/Library
  2. Sugar => Support/Library
  3. JSCocoaLoader => Support/Library

If a second optional boolean parameter is passed to importJS(), it will search in all known paths (on the off chance that someone needs to load another item in the Scripts folder). So User => Scripts, Library; Sugar => Scripts, Library; JSCocoaLoader => Library (unless you want to bundle some actions with JSCocoaLoader itself, in which case it would have a Scripts directory, too).

onecrayon commented 15 years ago

This change is complete; if Javascripts need to figure out where to find files outside of Support/Scripts or Support/Library they can get the paths to the Support folders from JSCocoaLoaderController.supportPaths.