Skip to content
This repository has been archived by the owner on Oct 6, 2021. It is now read-only.

Commit

Permalink
v.0.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudLigny committed Aug 27, 2014
1 parent 8e320cd commit 1285fb2
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Thumbs.db
.DS_Store

package/*
*.crx
*.pem
*.zip
Binary file added doc/opera-addons/opr_test.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion extension/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"message": "Battlelog Notifier"
},
"extDescription": {
"message": "Displays your Battlelog friends count (offline, online or playing)."
"message": "Displays the count of your Battlelog friends in the extension's badge, by status: in game, online or offline."
},
"browserActionDefaultTitle": {
"message": "$count$ friend(s) $status$",
Expand Down
18 changes: 9 additions & 9 deletions extension/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

var colorOffline = [63, 59, 61, 255];
var colorOnline = [120, 199, 83, 255];
var colorPlaying = [96, 192, 246, 255];
var colorIngame = [96, 192, 246, 255];

// XHR helper function
var xhr = function () {
Expand All @@ -53,7 +53,7 @@
var key;
var friendsCount = 0;
var friendsOnlineCount = 0;
var friendsPlayingCount = 0;
var friendsIngameCount = 0;
var count = '0';
var status;

Expand All @@ -77,14 +77,14 @@
if (json.data.friendscomcenter[key].presence.isOnline) {
friendsOnlineCount++;
}
if (json.data.friendscomcenter[key].presence.isPlaying) {
friendsPlayingCount++;
if (json.data.friendscomcenter[key].presence.isIngame) {
friendsIngameCount++;
}
}
}
if (friendsPlayingCount > 0) {
count = friendsPlayingCount.toString();
status = 'playing';
if (friendsIngameCount > 0) {
count = friendsIngameCount.toString();
status = 'in game';
}
else {
if (friendsOnlineCount > 0) {
Expand Down Expand Up @@ -151,8 +151,8 @@
//console.log('friends count: ' + count); // debug
if (count !== false) {
color = colorOffline;
if (status == 'playing') {
color = colorPlaying;
if (status == 'ingame') {
color = colorIngame;
}
if (status == 'online') {
color = colorOnline;
Expand Down
2 changes: 1 addition & 1 deletion extension/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "__MSG_extName__",
"description": "__MSG_extDescription__",
"version": "0.0.6",
"version": "0.0.7",
"background": {
"persistent": false,
"scripts": [
Expand Down

0 comments on commit 1285fb2

Please sign in to comment.