[Pkg-mozext-commits] [autofill-forms] 04/10: removing sdk.js and require definition
David Prévot
taffit at moszumanska.debian.org
Fri May 27 19:28:28 UTC 2016
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository autofill-forms.
commit 50c2888e41c8d5391c45dc264f2e34398f2ae8f7
Author: Sarah Avilov <sarah.avilov at gmail.com>
Date: Wed May 25 01:50:02 2016 +0430
removing sdk.js and require definition
---
chrome/content/autofillForms.js | 9 -----
chrome/content/sdk.js | 78 -----------------------------------------
2 files changed, 87 deletions(-)
diff --git a/chrome/content/autofillForms.js b/chrome/content/autofillForms.js
index 86e791f..64abfb2 100644
--- a/chrome/content/autofillForms.js
+++ b/chrome/content/autofillForms.js
@@ -7,15 +7,6 @@
*/
var autofillForms = {
- require: (function () {
- var {require} = Components.utils.import("resource://gre/modules/commonjs/toolkit/require.js", {});
- return require ? {
- Worker: require('sdk/content/worker').Worker,
- utils: require('sdk/tabs/utils'),
- tabs: require('sdk/tabs')
- } : {};
- })(),
-
// The selected profile index:
profileIndex: null,
// The selected global profile index:
diff --git a/chrome/content/sdk.js b/chrome/content/sdk.js
deleted file mode 100644
index 35d56d0..0000000
--- a/chrome/content/sdk.js
+++ /dev/null
@@ -1,78 +0,0 @@
-/* global self */
-'use strict';
-
-function onchange (elem) {
- try {
- elem.dispatchEvent(new Event('change'));
- elem.dispatchEvent(new Event('keydown'));
- elem.dispatchEvent(new Event('keyup'));
- elem.dispatchEvent(new Event('keychange'));
- }
- catch (e) {}
-}
-
-function toList (att) {
- return [].concat.apply(
- [window.document],
- [].map.call(window.document.getElementsByTagName('iframe'), f => f.contentDocument)
- )
- .filter(doc => doc)
- .map(function (doc) {
- return [].slice.call(doc.querySelectorAll(att), 0);
- })
- .reduce(function (a, b) {
- return [].concat.call(a, b);
- });
-}
-
-self.port.on('click', function () {
- toList('[data-aff-click]').forEach(function (elem) {
- elem.removeAttribute('data-aff-click');
- elem.click();
- });
- self.port.emit('done');
-});
-self.port.on('submit', function () {
- toList('[data-aff-submit]').forEach(function (elem) {
- elem.removeAttribute('data-aff-submit');
- elem.submit();
- });
- self.port.emit('done');
-});
-self.port.on('focus', function () {
- toList('[data-aff-focus]').forEach(function (elem) {
- elem.removeAttribute('data-aff-focus');
- elem.focus();
- onchange(elem);
- });
- self.port.emit('done');
-});
-self.port.on('change', function () {
- toList('[data-aff-change]').forEach(function (elem) {
- elem.removeAttribute('data-aff-change');
- onchange(elem);
- });
- self.port.emit('done');
-});
-self.port.on('value', function () {
- toList('[data-aff-value]').forEach(function (elem) {
- elem.value = elem.dataset.affValue;
- elem.removeAttribute('data-aff-value');
- onchange(elem);
- });
- self.port.emit('done');
-});
-self.port.on('selectionEnd', function () {
- toList('[data-aff-selectionEnd]').forEach(function (elem) {
- elem.selectionEnd = elem.dataset.affSelectionend;
- elem.removeAttribute('data-aff-selectionEnd');
- });
- self.port.emit('done');
-});
-self.port.on('selectionStart', function () {
- toList('[data-aff-selectionStart]').forEach(function (elem) {
- elem.selectionStart = elem.dataset.affSelectionstart;
- elem.removeAttribute('data-aff-selectionstart');
- });
- self.port.emit('done');
-});
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/autofill-forms.git
More information about the Pkg-mozext-commits
mailing list