Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds a version number as per #1088 #1356

Merged
merged 7 commits into from
May 2, 2017
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/js/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ var require = backgroundPage.require;
var constants = backgroundPage.constants;
var badger = backgroundPage.badger;
var htmlUtils = require("htmlutils").htmlUtils;
var utils = require("utils");

var i18n = chrome.i18n;
var reloadTab = chrome.tabs.reload;
Expand Down Expand Up @@ -103,6 +104,14 @@ function init() {
$("#deactivate_site_btn").hide();
}
});
utils.xhrRequest("manifest.json", function(err, response){
if(err){
console.error('Problem loading manifest.json:', err.status, err.message);
return;
}
response = JSON.parse(response);
$("#version_number").text("v" + response.display_version);
});
}
$(init);

Expand Down
3 changes: 2 additions & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,6 @@
"web_accessible_resources": [
"skin/*",
"icons/*"
]
],
Copy link
Member

@ghostwords ghostwords May 1, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The trailing comma makes it invalid JSON (JSON is more constrained than JavaScript). Chrome doesn't let you load the extension; all the tests fail because of this.

"display_version": "2.0.0"
}
4 changes: 4 additions & 0 deletions src/skin/popup.css
Original file line number Diff line number Diff line change
Expand Up @@ -378,3 +378,7 @@ font-size: 16px;
#siteControls button {
font-size: 12px;
}

#version_number{
color: #ec9329;
}
2 changes: 1 addition & 1 deletion src/skin/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ <h1 id="report_title" class="i18n_report_title"></h1>
<div id='privacyBadgerHeader'>
<a id="options" title="options" href='/skin/options.html' class="control-button grey-button" style="display:block" target="_blank"><img src='/icons/options.svg'></a>
<a id="help" title="help" href='/skin/firstRun.html' class="control-button grey-button" style="display:block" target="_blank"><img src='/icons/help.svg'></a>
<div id='title'><img src='/icons/badger-48.png'> <h2><span class="i18n_privacy_badger"></span></h2></div>
<div id='title'><img src='/icons/badger-48.png'> <h2><span class="i18n_privacy_badger"></span></h2> <h2><span id="version_number"></span></h2></div>
<div class='clear'></div>
</div>
<div id="blockedResourcesContainer">
Expand Down