Chrome driver options

main
ElbertF 13 years ago
parent b07b8b6541
commit e7eeedd990

@ -1,4 +1,7 @@
{ {
"github": { "message": "Fork Wappalyzer on GitHub!" },
"twitter": { "message": "Follow Wappalyzer on Twitter" },
"website": { "message": "Go to wappalyzer.com" },
"options": { "message": "Wappalyzer Options" }, "options": { "message": "Wappalyzer Options" },
"optionsSave": { "message": "Save options" }, "optionsSave": { "message": "Save options" },
"optionsSaved": { "message": "Saved" }, "optionsSaved": { "message": "Saved" },

@ -44,3 +44,16 @@ a:active {
#options-saved { #options-saved {
display: none; display: none;
} }
#about {
border-top: 1px solid #eee;
margin-top: 21px;
}
#about img {
vertical-align: middle;
}
#about button {
line-height: 30px;
}

@ -58,18 +58,35 @@ img {
text-align: center; text-align: center;
} }
#buttons {
margin-top: 12px;
overflow: hidden;
}
#buttons button {
height: 32px;
}
#analyze-headers { #analyze-headers {
border: 1px solid #eee; float: left;
border-radius: 3px; width: 158px;
cursor: pointer;
display: none;
line-height: 30px;
margin-top: 7px;
text-align: center;
} }
#analyze-headers.pending { #analyze-headers.pending {
background: url('../images/pending.gif') center center no-repeat; background-image: url('../images/pending2.gif');
color: #999; background-position: center center;
background-repeat: no-repeat;
text-indent: -999px; text-indent: -999px;
} }
#options {
background-image: url('../images/options.png');
background-position: center center;
background-repeat: no-repeat;
float: right;
height: 32px;
-webkit-padding-end: 0;
-webkit-padding-start: 0;
min-width: 32px;
width: 32px;
}

@ -5,6 +5,10 @@ $(function() {
init: function() { init: function() {
options.load(); options.load();
$('#github' ).click(function() { window.open(wappalyzer.config.githubURL); });
$('#twitter' ).click(function() { window.open(wappalyzer.config.twitterURL); });
$('#wappalyzer').click(function() { window.open(wappalyzer.config.websiteURL); });
$('#options-save').click(options.save); $('#options-save').click(options.save);
}, },

@ -5,12 +5,16 @@ var wappalyzer = {};
pollHeaders: null, pollHeaders: null,
init: function() { init: function() {
$('#options').click(function() {
window.open(chrome.extension.getURL('options.html'));
});
chrome.tabs.getSelected(null, function(tab) { chrome.tabs.getSelected(null, function(tab) {
if ( tab.url.match(/https?:\/\//) ) { if ( tab.url.match(/https?:\/\//) ) {
$('#detected-apps').html('<div class="empty">' + chrome.i18n.getMessage('noAppsDetected') + '</div>'); $('#detected-apps').html('<div class="empty">' + chrome.i18n.getMessage('noAppsDetected') + '</div>');
$('#analyze-headers').show().click(function() { $('#analyze-headers').removeAttr('disabled').click(function() {
$(this).addClass('pending'); $(this).attr('disabled', 'disabled');
chrome.extension.sendRequest({ id: 'fetch_headers', tab: tab }); chrome.extension.sendRequest({ id: 'fetch_headers', tab: tab });
@ -19,7 +23,7 @@ var wappalyzer = {};
} else { } else {
$('#detected-apps').html('<div class="empty">' + chrome.i18n.getMessage('nothingToDo') + '</div>'); $('#detected-apps').html('<div class="empty">' + chrome.i18n.getMessage('nothingToDo') + '</div>');
$('#analyze-headers').hide(); $('#analyze-headers').attr('disabled', 'disabled');
} }
}); });
@ -32,7 +36,7 @@ var wappalyzer = {};
if ( response.tabCache.analyzed.indexOf('headers') > 0 ) { if ( response.tabCache.analyzed.indexOf('headers') > 0 ) {
clearTimeout(popup.pollHeaders); clearTimeout(popup.pollHeaders);
$('#analyze-headers').hide().removeClass('pending'); $('#analyze-headers').removeAttr('disabled');
} }
if ( response.tabCache.count > 0 ) { if ( response.tabCache.count > 0 ) {
@ -65,5 +69,5 @@ var wappalyzer = {};
} }
} }
popup.init(); $(function() { popup.init(); });
})(); })();

@ -4,10 +4,13 @@
<head> <head>
<title data-i18n="options">Wappalyzer Options</title> <title data-i18n="options">Wappalyzer Options</title>
<link rel="icon" href="images/icon_hot.png">
<link rel="stylesheet" href="css/widgets.css"> <link rel="stylesheet" href="css/widgets.css">
<link rel="stylesheet" href="css/options.css"> <link rel="stylesheet" href="css/options.css">
<script src="js/ga.js"></script> <script src="js/ga.js"></script>
<script src="js/wappalyzer.js"></script>
<script src="js/lib/jquery.min.js"></script> <script src="js/lib/jquery.min.js"></script>
<script src="js/defaults.js"></script> <script src="js/defaults.js"></script>
<script src="js/options.js"></script> <script src="js/options.js"></script>
@ -23,5 +26,12 @@
<p> <p>
<button id="options-save" data-i18n="optionsSave"></button> <span id="options-saved" data-i18n="optionsSaved"></span> <button id="options-save" data-i18n="optionsSave"></button> <span id="options-saved" data-i18n="optionsSaved"></span>
</p> </p>
<div id="about">
<p>
<button id="github" ><img src="images/github.png" width="16" height="16" alt=""/> <span data-i18n="github" ></span></button>
<button id="twitter" ><img src="images/twitter.png" width="16" height="16" alt=""/> <span data-i18n="twitter"></span></button>
<button id="wappalyzer"><img src="images/icon_hot.png" width="16" height="16" alt=""/> <span data-i18n="website"></span></button>
</p>
</body> </body>
</html> </html>

@ -4,6 +4,7 @@
<head> <head>
<title>Popup</title> <title>Popup</title>
<link rel="stylesheet" href="css/widgets.css">
<link rel="stylesheet" href="css/popup.css"> <link rel="stylesheet" href="css/popup.css">
<script src="js/ga.js"></script> <script src="js/ga.js"></script>
@ -15,6 +16,9 @@
<body> <body>
<div id="detected-apps"></div> <div id="detected-apps"></div>
<div id="analyze-headers" data-i18n="analyzeHeaders"></div> <div id="buttons">
<button id="analyze-headers" data-i18n="analyzeHeaders" disabled="disabled"></button>
<button id="options"></button>
</div>
</body> </body>
</html> </html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 545 B

After

Width:  |  Height:  |  Size: 566 B