+ anekos
+ New BSD License
+
+ Load jQuery for commandline.
+
+>;
+// }}}
+
+(function () {
+
+ let filepath = liberator.globalVariables.jquery_filepath;
+ let moduleName = liberator.globalVariables.jquery_modulename || 'jQuery';
+ let coreName = liberator.globalVariables.jquery_corename || 'core';
+
+ let setup = function () {
+ let context = {
+ get window () content.window.wrappedJSObject,
+ get document () content.document.wrappedJSObject
+ };
+ liberator.eval(File(filepath).read(), context);
+ return context.window.jQuery;
+ };
+
+ modules[moduleName] = {};
+ modules[moduleName].__defineGetter__(
+ coreName,
+ function ()
+ content.window.wrappedJSObject.jQuery || setup()
+ );
+
+
+ return '以下のコードは無効';
+
+ commands.addUserCommand(
+ ['jquery'],
+ 'jQuery commandline',
+ function (args) {
+ let context = {};
+ context.__defineGetter__(
+ moduleName,
+ function ()
+ modules[moduleName][coreName]
+ );
+ liberator.eval(args.literalArg, context);
+ },
+ {
+ literal: 0,
+ completer: function (context) completion.javascript(context)
+ },
+ true
+ );
+
+})();
+
+// vim:sw=2 ts=2 et si fdm=marker:
--
cgit v1.2.3