From d26b319fd6f98517cc3421f10bf18698b953e4d2 Mon Sep 17 00:00:00 2001 From: Ruben Rodriguez Date: Thu, 13 Sep 2018 20:39:48 -0400 Subject: Updated extensions list for v60 --- .../node_modules/pathfinder/lib/xul/browser.js | 180 --------------------- .../node_modules/pathfinder/lib/xul/key.js | 43 ----- .../node_modules/pathfinder/lib/xul/listen.js | 29 ---- .../node_modules/pathfinder/lib/xul/namespace.js | 3 - 4 files changed, 255 deletions(-) delete mode 100644 data/extensions/jid1-KtlZuoiikVfFew@jetpack/node_modules/pathfinder/lib/xul/browser.js delete mode 100644 data/extensions/jid1-KtlZuoiikVfFew@jetpack/node_modules/pathfinder/lib/xul/key.js delete mode 100644 data/extensions/jid1-KtlZuoiikVfFew@jetpack/node_modules/pathfinder/lib/xul/listen.js delete mode 100644 data/extensions/jid1-KtlZuoiikVfFew@jetpack/node_modules/pathfinder/lib/xul/namespace.js (limited to 'data/extensions/jid1-KtlZuoiikVfFew@jetpack/node_modules/pathfinder/lib/xul') diff --git a/data/extensions/jid1-KtlZuoiikVfFew@jetpack/node_modules/pathfinder/lib/xul/browser.js b/data/extensions/jid1-KtlZuoiikVfFew@jetpack/node_modules/pathfinder/lib/xul/browser.js deleted file mode 100644 index 5b1ed47..0000000 --- a/data/extensions/jid1-KtlZuoiikVfFew@jetpack/node_modules/pathfinder/lib/xul/browser.js +++ /dev/null @@ -1,180 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -'use strict'; - -const { WindowTracker } = require("sdk/deprecated/window-utils"); -const { isBrowser, windows } = require('sdk/window/utils'); -const { validateOptions } = require("sdk/deprecated/api-utils"); -const { Class } = require("sdk/core/heritage"); -const { ns } = require("sdk/core/namespace"); -const { ensure } = require('sdk/system/unload'); - -const { xulNS } = require('./namespace'); - -const NS_XUL = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; -const VALID_POSITIONS = ['top']; - -// Converts anything that isn't false, null or undefined into a string -function stringOrNull(val) val ? String(val) : val; - -const XUL_SKELETON = Class({ - setup: function setup(attributes) { - const internals = xulNS(this); - internals.attributes = attributes; - ensure(this, 'destroy'); - }, - appendChild: function appendChild(node) { - const ID = this.getAttribute('id'); - - // keep note to update parent in future windows - xulNS(node).parentID = ID; - xulNS(node).insertBeforeID = null; - - // update parent on current windows - windows().forEach(function(window) { - let parent = window.document.getElementById(ID); - let { element } = xulNS(node).windowsNS(window); - parent.appendChild(element); - }); - }, - insertBefore: function(node, beforeNode) { - const ID = this.getAttribute('id'); - const B4_ID = (typeof beforeNode == 'string') ? beforeNode : beforeNode.getAttribute('id'); - - // keep note to update parent in future windows - xulNS(node).parentID = ID; - xulNS(node).insertBeforeID = B4_ID; - - // update parent on current windows - windows().forEach(function(window) { - let parent = window.document.getElementById(ID); - let before = window.document.getElementById(B4_ID); - let { element } = xulNS(node).windowsNS(window); - - parent.insertBefore(element, before); - }); - }, - addEventListener: function addEventListener(type, listener, useCapture) { - internals.eles.forEach(function(ele) { - ele.addEventListener(type, listener, useCapture); - }); - }, - removeEventListener: function removeEventListener(type, listener, useCapture) { - internals.eles.forEach(function(ele) { - ele.removeEventListener(type, listener, useCapture); - }); - }, - getAttribute: function getAttribute(attr) { - return xulNS(this).attributes[attr]; - }, - setAttribute: function setAttribute(attr, value) { - const internals = xulNS(this); - internals.eles.forEach(function(ele) { - ele.setAttribute(attr, value); - }); - internals.attributes[attr] = value; - }, - destroy: function() { - const internals = xulNS(this); - internals.attributes = null; - } -}); - -const XUL = Class({ - implements: [ XUL_SKELETON ], - initialize: function(nodeName, attributes) { - const self = this; - const internals = xulNS(this); - internals.windowsNS = ns(); - internals.eles = []; - internals.attributes = attributes; - - XUL_SKELETON.prototype.setup.call(this, attributes); - - // Set Window Tracker - internals.windowtracker = WindowTracker({ - onTrack: function(window) { - if (!isBrowser(window)) return; - let ele = window.document.createElementNS(NS_XUL, nodeName); - - Object.keys(attributes).forEach(function(key) { - ele.setAttribute(key, attributes[key]); - }) - - internals.eles.push(ele); - internals.windowsNS(window).element = ele; - - // update parent? - if (internals.parentID) { - let parent = window.document.getElementById(internals.parentID); - if (internals.insertBeforeID) { - let before = window.document.getElementById(internals.insertBeforeID); - parent.insertBefore(ele, before); - } - else { - parent.appendChild(ele); - } - } - }, - onUntrack: function(window) { - if (!isBrowser(window)) return; - let { element } = internals.windowsNS(window); - element.parentNode.removeChild(element); - internals.windowsNS(window).element = null; - } - }); - }, - destroy: function() { - XUL_SKELETON.prototype.destroy.call(this); - const internals = xulNS(this); - internals.windowtracker.unload(); - internals.windowtracker = null; - internals.windowsNS = null; - } -}); -exports.XUL = XUL; - -const XUL_GETTER = Class({ - implements: [ XUL_SKELETON ], - initialize: function(attributes) { - const self = this; - const internals = xulNS(this); - internals.windowsNS = ns(); - internals.eles = []; - internals.attributes = attributes; - - XUL_SKELETON.prototype.setup.call(this, attributes); - - // Set Window Tracker - internals.windowtracker = WindowTracker({ - onTrack: function(window) { - if (!isBrowser(window)) return; - let ele = window.document.getElementById(attributes.id); - internals.eles.push(ele); - internals.windowsNS(window).element = ele; - - // update parent? - if (internals.parentID) { - let parent = window.document.getElementById(internals.parentID); - parent.appendChild(ele); - } - } - }); - }, - destroy: function() { - const internals = xulNS(this); - - XUL_SKELETON.prototype.destroy.call(this); - - internals.windowtracker.unload(); - internals.windowtracker = null; - internals.windowsNS = null; - } -}); -exports.XUL_GETTER = XUL_GETTER; - -function getXULById(id) { - return XUL_GETTER({ id: id }); -} -exports.getXULById = getXULById; diff --git a/data/extensions/jid1-KtlZuoiikVfFew@jetpack/node_modules/pathfinder/lib/xul/key.js b/data/extensions/jid1-KtlZuoiikVfFew@jetpack/node_modules/pathfinder/lib/xul/key.js deleted file mode 100644 index c855fc3..0000000 --- a/data/extensions/jid1-KtlZuoiikVfFew@jetpack/node_modules/pathfinder/lib/xul/key.js +++ /dev/null @@ -1,43 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -'use strict'; - -const NS_XUL = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; - -exports.XulKey = function XulKey(options) { - var delegate = { - onTrack: function (window) { - if ("chrome://browser/content/browser.xul" != window.location) return; - - let doc = window.document; - function $(id) doc.getElementById(id); - function xul(type) doc.createElementNS(NS_XUL, type); - - var onCmd = function() { - options.onCommand && options.onCommand(); - }; - - var keyset = xul("keyset"); - - // add hotkey - var key = xul("key"); - key.setAttribute("id", options.id); - key.setAttribute("key", options.key); - if (options.modifiers) - key.setAttribute("modifiers", options.modifiers); - key.setAttribute("oncommand", "void(0);"); - key.addEventListener("command", onCmd, true); - ($("mainKeyset") || $("mailKeys")).parentNode.appendChild(keyset).appendChild(key); - - // add unloader - require("unload+").unload(function() { - key.removeEventListener("command", onCmd, true); // must do for some reason.. - keyset.parentNode.removeChild(keyset); - }, window); - }, - onUntrack: function (window) {} - }; - var winUtils = require("window-utils"); - var tracker = new winUtils.WindowTracker(delegate); -}; diff --git a/data/extensions/jid1-KtlZuoiikVfFew@jetpack/node_modules/pathfinder/lib/xul/listen.js b/data/extensions/jid1-KtlZuoiikVfFew@jetpack/node_modules/pathfinder/lib/xul/listen.js deleted file mode 100644 index 5536e30..0000000 --- a/data/extensions/jid1-KtlZuoiikVfFew@jetpack/node_modules/pathfinder/lib/xul/listen.js +++ /dev/null @@ -1,29 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -'use strict'; - -const { unload } = require('../addon/unload'); - -/** - * Helper that adds event listeners and remembers to remove on unload - */ -function listen(window, node, event, func, capture) { - // Default to use capture - if (capture == null) - capture = true; - - node.addEventListener(event, func, capture); - function undoListen() { - node.removeEventListener(event, func, capture); - } - - // Undo the listener on unload and provide a way to undo everything - let undoUnload = unload(undoListen, window); - return function() { - undoListen(); - undoUnload(); - }; -} -exports.listen = listen; - diff --git a/data/extensions/jid1-KtlZuoiikVfFew@jetpack/node_modules/pathfinder/lib/xul/namespace.js b/data/extensions/jid1-KtlZuoiikVfFew@jetpack/node_modules/pathfinder/lib/xul/namespace.js deleted file mode 100644 index 1a67716..0000000 --- a/data/extensions/jid1-KtlZuoiikVfFew@jetpack/node_modules/pathfinder/lib/xul/namespace.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; -const { ns } = require('sdk/core/namespace'); -exports.xulNS = ns(); -- cgit v1.2.3