Fixed jQuery, show all categories in tooltip

main
Elbert Alias 12 years ago
parent a35571efea
commit 70a9460d13

@ -1694,7 +1694,7 @@
"WebsiteBaker": { "WebsiteBaker": {
"cats": [ 1 ], "cats": [ 1 ],
"meta": { "generator": "WebsiteBaker" }, "meta": { "generator": "WebsiteBaker" },
"implies": [ 'PHP' ] "implies": [ "PHP" ]
}, },
"Webtrekk": { "Webtrekk": {
"cats": [ 10 ], "cats": [ 10 ],

@ -151,14 +151,14 @@
} }
$('#wappalyzer-container > image, #wappalyzer-menu > menuitem, #wappalyzer-menu > menuseparator').attr('class', 'wappalyzer-remove'); $('#wappalyzer-container > image, #wappalyzer-menu > menuitem, #wappalyzer-menu > menuseparator').attr('class', 'wappalyzer-remove');
if ( w.detected[url] != null && w.detected[url].length ) { if ( w.detected[url] != null && w.detected[url].length ) {
if ( !prefs.getBoolPref('showIcons') ) { if ( !prefs.getBoolPref('showIcons') ) {
$('<image>').attr('src', 'chrome://wappalyzer/skin/images/icon_hot.png').prependTo(document.getElementById('wappalyzer-container')); $('<image>').attr('src', 'chrome://wappalyzer/skin/images/icon_hot.png').prependTo(document.getElementById('wappalyzer-container'));
} }
w.detected[url].map(function(app, i) { w.detected[url].map(function(app, i) {
var j, cat, showCat; var j, cat, showCat, categories = [];
for ( i in w.apps[app].cats ) { for ( i in w.apps[app].cats ) {
showCat = false; showCat = false;
@ -168,10 +168,6 @@
} catch(e) { } } catch(e) { }
if ( showCat ) { if ( showCat ) {
if ( prefs.getBoolPref('showIcons') ) {
$('<image>').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'));
}
$('<menuseparator>').appendTo(document.getElementById('wappalyzer-menu')); $('<menuseparator>').appendTo(document.getElementById('wappalyzer-menu'));
$('#wappalyzer-menu') $('#wappalyzer-menu')
@ -185,7 +181,9 @@
})); }));
for ( j in w.apps[app].cats ) { 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') $('#wappalyzer-menu')
.append($('<menuitem>') .append($('<menuitem>')
@ -196,6 +194,14 @@
})); }));
} }
if ( prefs.getBoolPref('showIcons') ) {
$('<image>')
.attr('src', 'chrome://wappalyzer/skin/images/icons/' + app + '.png')
.attr('tooltiptext', app + ' - ' + categories.join(', '))
.prependTo(document.getElementById('wappalyzer-container'))
;
}
break; break;
} }
} }
@ -206,7 +212,7 @@
$('<image>') $('<image>')
.attr('src', 'chrome://wappalyzer/skin/images/icon.png') .attr('src', 'chrome://wappalyzer/skin/images/icon.png')
.prependTo(document.getElementById('wappalyzer-container')); .prependTo(document.getElementById('wappalyzer-container'));
$('<menuseparator>').appendTo(document.getElementById('wappalyzer-menu')); $('<menuseparator>').appendTo(document.getElementById('wappalyzer-menu'));
$('<menuitem>') $('<menuitem>')
@ -311,7 +317,7 @@
document.getElementById(prefix + 'github').onclick = function() { document.getElementById(prefix + 'github').onclick = function() {
w.driver.goToURL({ url: w.config.githubURL }) w.driver.goToURL({ url: w.config.githubURL })
}; };
document.getElementById(prefix + 'twitter').onclick = function() { document.getElementById(prefix + 'twitter').onclick = function() {
w.driver.goToURL({ url: w.config.twitterURL }) w.driver.goToURL({ url: w.config.twitterURL })
}; };

Loading…
Cancel
Save