From 70a9460d136c86e62ee2d8e85b71955cc0f4911b Mon Sep 17 00:00:00 2001 From: Elbert Alias Date: Sun, 11 Nov 2012 08:25:22 +1100 Subject: [PATCH] Fixed jQuery, show all categories in tooltip --- drivers/firefox/content/apps.json | 2 +- drivers/firefox/content/js/driver.js | 24 +++++++++++++++--------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/drivers/firefox/content/apps.json b/drivers/firefox/content/apps.json index e9c0a5867..0c7053621 100644 --- a/drivers/firefox/content/apps.json +++ b/drivers/firefox/content/apps.json @@ -1694,7 +1694,7 @@ "WebsiteBaker": { "cats": [ 1 ], "meta": { "generator": "WebsiteBaker" }, - "implies": [ 'PHP' ] + "implies": [ "PHP" ] }, "Webtrekk": { "cats": [ 10 ], diff --git a/drivers/firefox/content/js/driver.js b/drivers/firefox/content/js/driver.js index ff65a020f..c84405937 100644 --- a/drivers/firefox/content/js/driver.js +++ b/drivers/firefox/content/js/driver.js @@ -151,14 +151,14 @@ } $('#wappalyzer-container > image, #wappalyzer-menu > menuitem, #wappalyzer-menu > menuseparator').attr('class', 'wappalyzer-remove'); - + if ( w.detected[url] != null && w.detected[url].length ) { if ( !prefs.getBoolPref('showIcons') ) { $('').attr('src', 'chrome://wappalyzer/skin/images/icon_hot.png').prependTo(document.getElementById('wappalyzer-container')); } w.detected[url].map(function(app, i) { - var j, cat, showCat; + var j, cat, showCat, categories = []; for ( i in w.apps[app].cats ) { showCat = false; @@ -168,10 +168,6 @@ } catch(e) { } if ( showCat ) { - if ( prefs.getBoolPref('showIcons') ) { - $('').attr('src', 'chrome://wappalyzer/skin/images/icons/' + app + '.png').attr('tooltiptext', app + ' - ' + strings.getString('wappalyzer.cat' + w.apps[app].cats[i])).prependTo(document.getElementById('wappalyzer-container')); - } - $('').appendTo(document.getElementById('wappalyzer-menu')); $('#wappalyzer-menu') @@ -185,7 +181,9 @@ })); for ( j in w.apps[app].cats ) { - var cat = w.apps[app].cats[j]; + cat = w.apps[app].cats[j]; + + categories.push(strings.getString('wappalyzer.cat' + cat)); $('#wappalyzer-menu') .append($('') @@ -196,6 +194,14 @@ })); } + if ( prefs.getBoolPref('showIcons') ) { + $('') + .attr('src', 'chrome://wappalyzer/skin/images/icons/' + app + '.png') + .attr('tooltiptext', app + ' - ' + categories.join(', ')) + .prependTo(document.getElementById('wappalyzer-container')) + ; + } + break; } } @@ -206,7 +212,7 @@ $('') .attr('src', 'chrome://wappalyzer/skin/images/icon.png') .prependTo(document.getElementById('wappalyzer-container')); - + $('').appendTo(document.getElementById('wappalyzer-menu')); $('') @@ -311,7 +317,7 @@ document.getElementById(prefix + 'github').onclick = function() { w.driver.goToURL({ url: w.config.githubURL }) }; - + document.getElementById(prefix + 'twitter').onclick = function() { w.driver.goToURL({ url: w.config.twitterURL }) };