aboutsummaryrefslogtreecommitdiff
path: root/tools/addon-sdk-1.5/examples/library-detector
diff options
context:
space:
mode:
Diffstat (limited to 'tools/addon-sdk-1.5/examples/library-detector')
-rwxr-xr-xtools/addon-sdk-1.5/examples/library-detector/README.md9
-rwxr-xr-xtools/addon-sdk-1.5/examples/library-detector/data/icons/closure.icobin1150 -> 0 bytes
-rwxr-xr-xtools/addon-sdk-1.5/examples/library-detector/data/icons/jquery.icobin3638 -> 0 bytes
-rwxr-xr-xtools/addon-sdk-1.5/examples/library-detector/data/icons/jquery_ui.icobin1150 -> 0 bytes
-rwxr-xr-xtools/addon-sdk-1.5/examples/library-detector/data/icons/modernizr.icobin1150 -> 0 bytes
-rwxr-xr-xtools/addon-sdk-1.5/examples/library-detector/data/icons/mootools.pngbin386 -> 0 bytes
-rwxr-xr-xtools/addon-sdk-1.5/examples/library-detector/data/icons/yui.icobin6598 -> 0 bytes
-rwxr-xr-xtools/addon-sdk-1.5/examples/library-detector/data/library-detector.js97
-rwxr-xr-xtools/addon-sdk-1.5/examples/library-detector/data/widget.js14
-rwxr-xr-xtools/addon-sdk-1.5/examples/library-detector/lib/main.js107
-rwxr-xr-xtools/addon-sdk-1.5/examples/library-detector/package.json9
-rw-r--r--tools/addon-sdk-1.5/examples/library-detector/test/test-main.js7
12 files changed, 0 insertions, 243 deletions
diff --git a/tools/addon-sdk-1.5/examples/library-detector/README.md b/tools/addon-sdk-1.5/examples/library-detector/README.md
deleted file mode 100755
index e222fdc..0000000
--- a/tools/addon-sdk-1.5/examples/library-detector/README.md
+++ /dev/null
@@ -1,9 +0,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.5/examples/library-detector/data/icons/closure.ico b/tools/addon-sdk-1.5/examples/library-detector/data/icons/closure.ico
deleted file mode 100755
index a8c91a0..0000000
--- a/tools/addon-sdk-1.5/examples/library-detector/data/icons/closure.ico
+++ /dev/null
Binary files differ
diff --git a/tools/addon-sdk-1.5/examples/library-detector/data/icons/jquery.ico b/tools/addon-sdk-1.5/examples/library-detector/data/icons/jquery.ico
deleted file mode 100755
index 8df8f38..0000000
--- a/tools/addon-sdk-1.5/examples/library-detector/data/icons/jquery.ico
+++ /dev/null
Binary files differ
diff --git a/tools/addon-sdk-1.5/examples/library-detector/data/icons/jquery_ui.ico b/tools/addon-sdk-1.5/examples/library-detector/data/icons/jquery_ui.ico
deleted file mode 100755
index 77e3bd2..0000000
--- a/tools/addon-sdk-1.5/examples/library-detector/data/icons/jquery_ui.ico
+++ /dev/null
Binary files differ
diff --git a/tools/addon-sdk-1.5/examples/library-detector/data/icons/modernizr.ico b/tools/addon-sdk-1.5/examples/library-detector/data/icons/modernizr.ico
deleted file mode 100755
index c37d438..0000000
--- a/tools/addon-sdk-1.5/examples/library-detector/data/icons/modernizr.ico
+++ /dev/null
Binary files differ
diff --git a/tools/addon-sdk-1.5/examples/library-detector/data/icons/mootools.png b/tools/addon-sdk-1.5/examples/library-detector/data/icons/mootools.png
deleted file mode 100755
index 2a5df7d..0000000
--- a/tools/addon-sdk-1.5/examples/library-detector/data/icons/mootools.png
+++ /dev/null
Binary files differ
diff --git a/tools/addon-sdk-1.5/examples/library-detector/data/icons/yui.ico b/tools/addon-sdk-1.5/examples/library-detector/data/icons/yui.ico
deleted file mode 100755
index 06acd8a..0000000
--- a/tools/addon-sdk-1.5/examples/library-detector/data/icons/yui.ico
+++ /dev/null
Binary files differ
diff --git a/tools/addon-sdk-1.5/examples/library-detector/data/library-detector.js b/tools/addon-sdk-1.5/examples/library-detector/data/library-detector.js
deleted file mode 100755
index af3a88e..0000000
--- a/tools/addon-sdk-1.5/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.5/examples/library-detector/data/widget.js b/tools/addon-sdk-1.5/examples/library-detector/data/widget.js
deleted file mode 100755
index 293537e..0000000
--- a/tools/addon-sdk-1.5/examples/library-detector/data/widget.js
+++ /dev/null
@@ -1,14 +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/. */
-
-
-function setLibraryInfo(element) {
- self.port.emit('setLibraryInfo', element.target.title);
-}
-
-var elements = document.getElementsByTagName('img');
-
-for (var i = 0; i < elements.length; i++) {
- elements[i].addEventListener('mouseover', setLibraryInfo, false);
-}
diff --git a/tools/addon-sdk-1.5/examples/library-detector/lib/main.js b/tools/addon-sdk-1.5/examples/library-detector/lib/main.js
deleted file mode 100755
index 4380c6f..0000000
--- a/tools/addon-sdk-1.5/examples/library-detector/lib/main.js
+++ /dev/null
@@ -1,107 +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 htmlContentPreamble =
- '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"' +
- ' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">' +
- ' <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">' +
- ' <head>' +
- ' <style type="text/css" media="all">' +
- ' img {display: inline;}' +
- ' </style>' +
- ' </head>' +
- ' <body>'
-
-const htmlContentPostamble =
- ' </body>' +
- '</html>'
-
-const icons = {
- 'jQuery' : 'jquery.ico',
- 'jQuery UI' : 'jquery_ui.ico',
- 'MooTools' : 'mootools.png',
- 'YUI' : 'yui.ico',
- 'Closure' : 'closure.ico',
- 'Modernizr': 'modernizr.ico',
-}
-
-const ICON_WIDTH = 32;
-
-function buildIconHtml(imageName, libraryInfo) {
- return '<img src="' + data.url("icons/" + imageName) + '" title="' + libraryInfo + '">';
-}
-
-function buildWidgetViewContent(libraryList) {
- widgetContent = htmlContentPreamble;
- libraryList.forEach(function(library) {
- widgetContent += buildIconHtml(icons[library.name], library.name + "<br>Version: " + library.version);
- });
- widgetContent += htmlContentPostamble;
- return widgetContent;
-}
-
-function updateWidgetView(tab) {
- let widgetView = widget.getView(tab.window);
- if (!tab.libraries) {
- tab.libraries = [];
- }
- widgetView.content = buildWidgetViewContent(tab.libraries);
- widgetView.width = tab.libraries.length * ICON_WIDTH;
-}
-
-var widget = widgets.Widget({
- id: "library-detector",
- label: "Library Detector",
- content: "<html></html>",
- contentScriptFile: data.url("widget.js"),
- panel: panel.Panel({
- width: 240,
- height: 60,
- contentScript: 'self.on("message", function(libraryInfo) {' +
- ' window.document.body.innerHTML = libraryInfo;' +
- '});'
- }),
-});
-
-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.5/examples/library-detector/package.json b/tools/addon-sdk-1.5/examples/library-detector/package.json
deleted file mode 100755
index 7bd9eaa..0000000
--- a/tools/addon-sdk-1.5/examples/library-detector/package.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "name": "library-detector-sdk",
- "license": "MPL 1.1/GPL 2.0/LGPL 2.1",
- "author": "",
- "version": "0.1",
- "fullName": "library-detector-sdk",
- "id": "jid1-R4rSVNkBANnvGQ",
- "description": "a basic add-on"
-}
diff --git a/tools/addon-sdk-1.5/examples/library-detector/test/test-main.js b/tools/addon-sdk-1.5/examples/library-detector/test/test-main.js
deleted file mode 100644
index 72fedf4..0000000
--- a/tools/addon-sdk-1.5/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.");
-};