gnome-shell/js/misc
Jasper St. Pierre a622aba7eb extensionUtils: Create and allow access to a new "extension" object
The "extension" object is what I previously called the "helper" object.
It contains the extension importer object as well as the metadata object.
Things that were previously added on to the metadata (state, path, dir, etc.)
are now part of this new "extension" object.

With the new importer changes brought on by the extension prefs tool,
extensions are left without a way to import submodules at the global scope,
which would make them rely on techniques like:

  var MySubModule;

  function init(meta) {
      MySubModule = meta.importer.mySubModule;
  }

That is, there's now a lot more meaningless boilerplate that nobody wants
to write and nobody wants to reivew.

Let's solve this with a few clever hacks.
Allow extensions to get their current extension object with:

  let extension = imports.misc.extensionUtils.getCurrentExtension();

As such, extensions can now get their own extension object before the
'init' method is called, so they can import submodules or do other things
at the module scope:

  const MySubModule = extension.imports.mySubModule;
  const dataPath = GLib.build_filenamev([extension.path, 'awesome-data.json']);

https://bugzilla.gnome.org/show_bug.cgi?id=668429
2012-02-07 16:00:37 -05:00
..
config.js.in Add a new tool, 'gnome-shell-extension-prefs', which can configure extensions 2012-02-07 16:00:37 -05:00
docInfo.js Port everything to class framework 2011-11-24 09:50:04 +01:00
extensionUtils.js extensionUtils: Create and allow access to a new "extension" object 2012-02-07 16:00:37 -05:00
fileUtils.js fileUtils: Fix recursivelyDeleteDir 2011-11-30 22:04:00 -05:00
format.js *.js: Make emacs modelines consistent 2011-10-11 08:05:12 -04:00
gnomeSession.js screensaver, gnomesession: port to GDBus based bindings 2011-11-11 11:15:38 -05:00
history.js Port everything to class framework 2011-11-24 09:50:04 +01:00
jsParse.js lookingGlass: Add tab-completion 2011-11-05 13:05:11 -04:00
modemManager.js modemManager: Fix fallout from GDBus port 2012-01-27 14:59:32 -05:00
params.js *.js: Make emacs modelines consistent 2011-10-11 08:05:12 -04:00
screenSaver.js screensaver, gnomesession: port to GDBus based bindings 2011-11-11 11:15:38 -05:00
util.js Util: fix binary search exit condition 2011-12-20 22:44:03 +01:00