aboutsummaryrefslogtreecommitdiff
path: root/tools/addon-sdk-1.12/examples/library-detector
diff options
context:
space:
mode:
Diffstat (limited to 'tools/addon-sdk-1.12/examples/library-detector')
-rwxr-xr-xtools/addon-sdk-1.12/examples/library-detector/README.md13
-rwxr-xr-xtools/addon-sdk-1.12/examples/library-detector/data/icons/closure.icobin1150 -> 0 bytes
-rwxr-xr-xtools/addon-sdk-1.12/examples/library-detector/data/icons/jquery.icobin3638 -> 0 bytes
-rwxr-xr-xtools/addon-sdk-1.12/examples/library-detector/data/icons/jquery_ui.icobin1150 -> 0 bytes
-rwxr-xr-xtools/addon-sdk-1.12/examples/library-detector/data/icons/modernizr.icobin1150 -> 0 bytes
-rwxr-xr-xtools/addon-sdk-1.12/examples/library-detector/data/icons/mootools.pngbin386 -> 0 bytes
-rwxr-xr-xtools/addon-sdk-1.12/examples/library-detector/data/icons/yui.icobin6598 -> 0 bytes
-rwxr-xr-xtools/addon-sdk-1.12/examples/library-detector/data/library-detector.js97
-rw-r--r--tools/addon-sdk-1.12/examples/library-detector/data/panel.html16
-rwxr-xr-xtools/addon-sdk-1.12/examples/library-detector/data/widget.html50
-rwxr-xr-xtools/addon-sdk-1.12/examples/library-detector/lib/main.js67
-rwxr-xr-xtools/addon-sdk-1.12/examples/library-detector/package.json9
-rw-r--r--tools/addon-sdk-1.12/examples/library-detector/test/test-main.js7
13 files changed, 0 insertions, 259 deletions
diff --git a/tools/addon-sdk-1.12/examples/library-detector/README.md b/tools/addon-sdk-1.12/examples/library-detector/README.md
deleted file mode 100755
index 72285ac..0000000
--- a/tools/addon-sdk-1.12/examples/library-detector/README.md
+++ /dev/null
@@ -1,13 +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/. -->
-
-This is a port to the SDK of the
-[Library Detector add-on](https://addons.mozilla.org/en-US/firefox/addon/library-detector/).
-The original Library Detector is written by
-[Paul Bakaus](http://paulbakaus.com/) and made available under the
-[MIT License](http://www.opensource.org/licenses/mit-license.php).
-
-It only recognizes a subset of the libraries recognized by the original,
-just to keep the SDK download package size and on-disk footprint as small
-as possible.
diff --git a/tools/addon-sdk-1.12/examples/library-detector/data/icons/closure.ico b/tools/addon-sdk-1.12/examples/library-detector/data/icons/closure.ico
deleted file mode 100755
index a8c91a0..0000000
--- a/tools/addon-sdk-1.12/examples/library-detector/data/icons/closure.ico
+++ /dev/null
Binary files differ
diff --git a/tools/addon-sdk-1.12/examples/library-detector/data/icons/jquery.ico b/tools/addon-sdk-1.12/examples/library-detector/data/icons/jquery.ico
deleted file mode 100755
index 8df8f38..0000000
--- a/tools/addon-sdk-1.12/examples/library-detector/data/icons/jquery.ico
+++ /dev/null
Binary files differ
diff --git a/tools/addon-sdk-1.12/examples/library-detector/data/icons/jquery_ui.ico b/tools/addon-sdk-1.12/examples/library-detector/data/icons/jquery_ui.ico
deleted file mode 100755
index 77e3bd2..0000000
--- a/tools/addon-sdk-1.12/examples/library-detector/data/icons/jquery_ui.ico
+++ /dev/null
Binary files differ
diff --git a/tools/addon-sdk-1.12/examples/library-detector/data/icons/modernizr.ico b/tools/addon-sdk-1.12/examples/library-detector/data/icons/modernizr.ico
deleted file mode 100755
index c37d438..0000000
--- a/tools/addon-sdk-1.12/examples/library-detector/data/icons/modernizr.ico
+++ /dev/null
Binary files differ
diff --git a/tools/addon-sdk-1.12/examples/library-detector/data/icons/mootools.png b/tools/addon-sdk-1.12/examples/library-detector/data/icons/mootools.png
deleted file mode 100755
index 2a5df7d..0000000
--- a/tools/addon-sdk-1.12/examples/library-detector/data/icons/mootools.png
+++ /dev/null
Binary files differ
diff --git a/tools/addon-sdk-1.12/examples/library-detector/data/icons/yui.ico b/tools/addon-sdk-1.12/examples/library-detector/data/icons/yui.ico
deleted file mode 100755
index 06acd8a..0000000
--- a/tools/addon-sdk-1.12/examples/library-detector/data/icons/yui.ico
+++ /dev/null
Binary files differ
diff --git a/tools/addon-sdk-1.12/examples/library-detector/data/library-detector.js b/tools/addon-sdk-1.12/examples/library-detector/data/library-detector.js
deleted file mode 100755
index af3a88e..0000000
--- a/tools/addon-sdk-1.12/examples/library-detector/data/library-detector.js
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
-The code in this file is adapted from the original
-Library Detector add-on
-(https://addons.mozilla.org/en-US/firefox/addon/library-detector/) written by
-Paul Bakaus (http://paulbakaus.com/) and made available under the
-MIT License (http://www.opensource.org/licenses/mit-license.php).
-*/
-
-var LD_tests = {
-
- 'jQuery': {
- test: function(win) {
- var jq = win.jQuery || win.$ || win.$jq || win.$j;
- if(jq && jq.fn && jq.fn.jquery) {
- return { version: jq.fn.jquery };
- } else {
- return false;
- }
- }
- },
-
- 'jQuery UI': {
- //phonehome: 'http://jqueryui.com/phone_home',
- test: function(win) {
-
- var jq = win.jQuery || win.$ || win.$jq || win.$j;
- if(jq && jq.fn && jq.fn.jquery && jq.ui) {
-
- var plugins = 'accordion,datepicker,dialog,draggable,droppable,progressbar,resizable,selectable,slider,menu,grid,tabs'.split(','), concat = [];
- for (var i=0; i < plugins.length; i++) { if(jq.ui[plugins[i]]) concat.push(plugins[i].substr(0,1).toUpperCase() + plugins[i].substr(1)); };
-
- return { version: jq.ui.version, details: concat.length ? 'Plugins used: '+concat.join(',') : '' };
- } else {
- return false;
- }
-
- }
- },
-
- 'MooTools': {
- test: function(win) {
- if(win.MooTools && win.MooTools.version) {
- return { version: win.MooTools.version };
- } else {
- return false;
- }
- }
- },
-
- 'YUI': {
- test: function(win) {
- if(win.YAHOO && win.YAHOO.VERSION) {
- return { version: win.YAHOO.VERSION };
- } else {
- return false;
- }
- }
- },
-
- 'Closure': {
- test: function(win) {
- if(win.goog) {
- return { version: '2.0' };
- }
- return false;
- }
- },
-
- 'Modernizr': {
- test: function(win) {
- if(win.Modernizr) {
- return { version: win.Modernizr._version };
- }
- return false;
- }
- },
-
-
-};
-
-function testLibraries() {
- var win = unsafeWindow;
- var libraryList = [];
- for(var i in LD_tests) {
- var passed = LD_tests[i].test(win);
- if (passed) {
- let libraryInfo = {
- name: i,
- version: passed.version
- };
- libraryList.push(libraryInfo);
- }
- }
- self.postMessage(libraryList);
-}
-
-testLibraries(); \ No newline at end of file
diff --git a/tools/addon-sdk-1.12/examples/library-detector/data/panel.html b/tools/addon-sdk-1.12/examples/library-detector/data/panel.html
deleted file mode 100644
index 2829006..0000000
--- a/tools/addon-sdk-1.12/examples/library-detector/data/panel.html
+++ /dev/null
@@ -1,16 +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/. -->
-
-<html>
-<head>
- <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
- <title>Library detector</title>
- <script type="text/javascript">
- addon.on('message', function (libraryInfo) {
- document.body.innerHTML = libraryInfo;
- });
- </script>
-</head>
-<body></body>
-</html>
diff --git a/tools/addon-sdk-1.12/examples/library-detector/data/widget.html b/tools/addon-sdk-1.12/examples/library-detector/data/widget.html
deleted file mode 100755
index 4ca5b50..0000000
--- a/tools/addon-sdk-1.12/examples/library-detector/data/widget.html
+++ /dev/null
@@ -1,50 +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/. -->
-
-<html>
-<head>
- <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
- <title>Library detector</title>
- <style type="text/css" media="all">
- img {
- display: inline;
- width: 16px;
- height: 16px;
- }
- </style>
- <script type="text/javascript">
- var icons = {
- 'jQuery' : 'jquery.ico',
- 'jQuery UI' : 'jquery_ui.ico',
- 'MooTools' : 'mootools.png',
- 'YUI' : 'yui.ico',
- 'Closure' : 'closure.ico',
- 'Modernizr': 'modernizr.ico',
- };
-
- // Listen for mouse events over icons, in order to send a message up to
- // the panel and update its content with library name and version
- window.addEventListener('mouseover', function (event) {
- if (event.target.tagName == 'IMG') {
- addon.port.emit('setLibraryInfo', event.target.title);
- }
- }, false);
-
- addon.port.on('update', function (libraries) {
- // Cleanup previous content
- document.body.innerHTML = '';
-
- // Create new updated list of icons
- libraries.forEach(function(library) {
- var img = document.createElement('img');
- img.setAttribute('src', 'icons/' + icons[library.name]);
- img.setAttribute('title', library.name + "<br>Version: " +
- library.version);
- document.body.appendChild(img);
- });
- });
- </script>
-</head>
-<body></body>
-</html>
diff --git a/tools/addon-sdk-1.12/examples/library-detector/lib/main.js b/tools/addon-sdk-1.12/examples/library-detector/lib/main.js
deleted file mode 100755
index 3f2b0c5..0000000
--- a/tools/addon-sdk-1.12/examples/library-detector/lib/main.js
+++ /dev/null
@@ -1,67 +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/. */
-
-const tabs = require('tabs');
-const widgets = require('widget');
-const data = require('self').data;
-const pageMod = require('page-mod');
-const panel = require('panel');
-
-const ICON_WIDTH = 16;
-
-function updateWidgetView(tab) {
- let widgetView = widget.getView(tab.window);
- if (!tab.libraries) {
- tab.libraries = [];
- }
- widgetView.port.emit("update", tab.libraries);
- widgetView.width = tab.libraries.length * ICON_WIDTH;
-}
-
-var widget = widgets.Widget({
- id: "library-detector",
- label: "Library Detector",
- contentURL: data.url("widget.html"),
- panel: panel.Panel({
- width: 240,
- height: 60,
- contentURL: data.url("panel.html")
- })
-});
-
-widget.port.on('setLibraryInfo', function(libraryInfo) {
- widget.panel.postMessage(libraryInfo);
-});
-
-pageMod.PageMod({
- include: "*",
- contentScriptWhen: 'end',
- contentScriptFile: (data.url('library-detector.js')),
- onAttach: function(worker) {
- worker.on('message', function(libraryList) {
- if (!worker.tab.libraries) {
- worker.tab.libraries = [];
- }
- libraryList.forEach(function(library) {
- if (worker.tab.libraries.indexOf(library) == -1) {
- worker.tab.libraries.push(library);
- }
- });
- if (worker.tab == tabs.activeTab) {
- updateWidgetView(worker.tab);
- }
- });
- }
-});
-
-tabs.on('activate', function(tab) {
- updateWidgetView(tab);
-});
-
-/*
-For change of location
-*/
-tabs.on('ready', function(tab) {
- tab.libraries = [];
-}); \ No newline at end of file
diff --git a/tools/addon-sdk-1.12/examples/library-detector/package.json b/tools/addon-sdk-1.12/examples/library-detector/package.json
deleted file mode 100755
index 6d868ff..0000000
--- a/tools/addon-sdk-1.12/examples/library-detector/package.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "name": "library-detector-sdk",
- "license": "MPL 2.0",
- "author": "",
- "version": "0.1",
- "fullName": "library-detector-sdk",
- "id": "jid1-R4rSVNkBANnvGQ",
- "description": "a basic add-on"
-}
diff --git a/tools/addon-sdk-1.12/examples/library-detector/test/test-main.js b/tools/addon-sdk-1.12/examples/library-detector/test/test-main.js
deleted file mode 100644
index 72fedf4..0000000
--- a/tools/addon-sdk-1.12/examples/library-detector/test/test-main.js
+++ /dev/null
@@ -1,7 +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/. */
-
-exports.testMain = function(test) {
- test.pass("TODO: Write some tests.");
-};