Skip to content
This repository was archived by the owner on Mar 22, 2018. It is now read-only.

Commit 6340d8b

Browse files
committed
Release extension 2.0.3
1 parent 60edde4 commit 6340d8b

File tree

5 files changed

+65
-46
lines changed

5 files changed

+65
-46
lines changed

extension/background.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ try {
4949
}
5050
chromeVersion = parseInt(chromeVersion);
5151
sendMessageToHost({
52-
version: "2.0.0"
52+
version: "2.0.3"
5353
});
5454

5555
if (localStorage["uget-keywords"]) {
@@ -104,11 +104,11 @@ function sendMessageToHost(message) {
104104

105105
function getInfo() {
106106
if (ugetWrapperNotFound || !ugetChromeWrapperVersion) {
107-
return "<font color='red'>Error: Unable to connect to the uget-chrome-wrapper</font>";
107+
return "Error: Unable to connect to the uget-chrome-wrapper";
108108
} else if (!ugetChromeWrapperVersion.startsWith("2.")) {
109-
return "<font color='orange'>Warning: Please update the uget-chrome-wrapper to the latest version</font>";
109+
return "Warning: Please update the uget-chrome-wrapper to the latest version";
110110
} else {
111-
return "<font color='green'>Info: Found uGet: " + ugetVersion + " and uget-chrome-wrapper: " + ugetChromeWrapperVersion + "</font>";
111+
return "Info: Found uGet: " + ugetVersion + " and uget-chrome-wrapper: " + ugetChromeWrapperVersion;
112112
}
113113
}
114114

extension/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,5 @@
4343
"downloads",
4444
"storage"
4545
],
46-
"version": "2.0.0"
46+
"version": "2.0.3"
4747
}

extension/popup.css

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,27 @@ hr {
5959
}
6060

6161
#info {
62-
color: #808080;
6362
display: table;
6463
text-align: center;
6564
margin: 0 auto;
6665
line-height: 50%;
66+
color: green;
67+
}
68+
69+
#warn {
70+
display: table;
71+
text-align: center;
72+
margin: 0 auto;
73+
line-height: 50%;
74+
color: orange;
75+
}
76+
77+
#error {
78+
display: table;
79+
text-align: center;
80+
margin: 0 auto;
81+
line-height: 50%;
82+
color: red;
6783
}
6884

6985
#label {

extension/popup.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
<body>
2828
<div id="parent-container">
2929
<div id="title-container">
30-
<img id="img-icon" src="icon_32.png" /> <span>uGet Integration 2.0.0</span>
30+
<img id="img-icon" src="icon_32.png" /> <span>uGet Integration 2.0.3</span>
3131
</div>
3232
<hr>
33-
<label id="info"></label>
33+
<label id="info"></label><label id="error"></label><label id="warn"></label>
3434
<hr>
3535
<div id="controls-container" class="inline">
3636
<label id="label" title="Ctrl + Shift + U" for="switch">Interrupt downloads:&nbsp;</label>

extension/popup.js

Lines changed: 41 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,53 @@
11
/*
2-
* uget-chrome-wrapper is an extension to integrate uGet Download manager
3-
* with Google Chrome, Chromium, Vivaldi and Opera in Linux and Windows.
4-
*
5-
* Copyright (C) 2016 Gobinath
6-
*
7-
* This program is free software: you can redistribute it and/or modify
8-
* it under the terms of the GNU General Public License as published by
9-
* the Free Software Foundation, either version 3 of the License, or
10-
* (at your option) any later version.
11-
*
12-
* This program is distributed in the hope that it will be useful,
13-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15-
* GNU General Public License for more details.
16-
*
17-
* You should have received a copy of the GNU General Public License
18-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19-
*/
2+
* uget-chrome-wrapper is an extension to integrate uGet Download manager
3+
* with Google Chrome, Chromium, Vivaldi and Opera in Linux and Windows.
4+
*
5+
* Copyright (C) 2016 Gobinath
6+
*
7+
* This program is free software: you can redistribute it and/or modify
8+
* it under the terms of the GNU General Public License as published by
9+
* the Free Software Foundation, either version 3 of the License, or
10+
* (at your option) any later version.
11+
*
12+
* This program is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU General Public License
18+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19+
*/
2020

2121
function saveChanges() {
22-
var keywords = document.getElementById("keywords").value;
23-
var interrupt = document.getElementById('chk-interrupt').checked;
22+
var keywords = document.getElementById("keywords").value;
23+
var interrupt = document.getElementById('chk-interrupt').checked;
2424

25-
localStorage["uget-keywords"] = keywords;
25+
localStorage["uget-keywords"] = keywords;
2626

27-
chrome.runtime.getBackgroundPage(function(backgroundPage) {
28-
backgroundPage.updateKeywords(keywords);
29-
backgroundPage.setInterruptDownload(interrupt, true);
30-
});
27+
chrome.runtime.getBackgroundPage(function(backgroundPage) {
28+
backgroundPage.updateKeywords(keywords);
29+
backgroundPage.setInterruptDownload(interrupt, true);
30+
});
3131

32-
window.close();
33-
}
34-
35-
function updateInfo(info) {
36-
document.getElementById('info').innerHTML = info;
32+
window.close();
3733
}
3834

3935
// When the popup HTML has loaded
4036
window.addEventListener('load', function(evt) {
41-
chrome.runtime.getBackgroundPage(function(backgroundPage) {
42-
// alert('hi');
43-
document.getElementById('info').innerHTML = backgroundPage.getInfo();
44-
});
37+
// Show the system status
38+
chrome.runtime.getBackgroundPage(function(backgroundPage) {
39+
var message = backgroundPage.getInfo().replace(/<[^>]*>?/g, '');
40+
var label = 'error';
41+
if(message.toLowerCase().startsWith("info")) {
42+
label = 'info';
43+
} else if(message.toLowerCase().startsWith("warn")) {
44+
label = 'warn';
45+
}
46+
document.getElementById(label).innerHTML = message;
47+
});
4548

4649
var interrupt = (localStorage["uget-interrupt"] == "true");
47-
document.getElementById('save').addEventListener('click', saveChanges);
48-
document.getElementById('keywords').value = localStorage["uget-keywords"];
49-
document.getElementById('chk-interrupt').checked = interrupt;
50-
});
50+
document.getElementById('save').addEventListener('click', saveChanges);
51+
document.getElementById('keywords').value = localStorage["uget-keywords"];
52+
document.getElementById('chk-interrupt').checked = interrupt;
53+
});

0 commit comments

Comments
 (0)