Skip to content

Commit

Permalink
feat: Display Changelog After Update
Browse files Browse the repository at this point in the history
  • Loading branch information
RossWang committed Nov 18, 2017
1 parent 3acedbc commit 71ffefd
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 4 deletions.
10 changes: 10 additions & 0 deletions App/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,16 @@
"description": ""
},

"OP_chgLog": {
"message": "Display Changelog",
"description": ""
},

"OPN_chgLog": {
"message": "Display Changelog After Update",
"description": ""
},

"OP_winWidth": {
"message": "Download Panel width offset",
"description": ""
Expand Down
12 changes: 11 additions & 1 deletion App/_locales/zh_CN/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,17 @@
},

"OPN_autoSet": {
"message": "按下详细按钮后自动设置 AriaNg",
"message": "按下详情按钮后自动设置 AriaNg",
"description": ""
},

"OP_chgLog": {
"message": "显示更新日誌",
"description": ""
},

"OPN_chgLog": {
"message": "更新后自动显示更新日誌",
"description": ""
},

Expand Down
10 changes: 10 additions & 0 deletions App/_locales/zh_TW/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,16 @@
"description": ""
},

"OP_chgLog": {
"message": "顯示更新日誌",
"description": ""
},

"OPN_chgLog": {
"message": "更新後自動顯示更新日誌",
"description": ""
},

"OP_winWidth": {
"message": "下載視窗寬度改變量",
"description": ""
Expand Down
14 changes: 12 additions & 2 deletions App/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -637,16 +637,26 @@ function contextMenus (enabled){
(function(callback) {
browser.runtime.onInstalled.addListener(callback);
//browser.runtime.onStartup.addListener(callback);
})(function() {
})(function(d) {
browser.storage.local.get("initialize", item => {
if(item.initialize == undefined) {
browser.runtime.openOptionsPage();
changeState(true);
browser.storage.local.set({
initialize: false
});
}
}
else {
browser.storage.local.get(config.command.guess, item => {
if (d.reason == "update" && item.chgLog == true){
browser.tabs.create({
url: "https://github.com/RossWang/Aria2-Integration/blob/master/CHANGELOG.md"
});
}
});
}
});

});

(function() {
Expand Down
1 change: 1 addition & 0 deletions App/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ config.command = {
windowLoc: false,
auto: true,
autoSet: true,
chgLog: true,
};
}
};
13 changes: 12 additions & 1 deletion App/data/options/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,24 @@
<td></td>
<td>
<input id="autoSet" style="margin-left: 0px; margin-top: 5px;" type="checkbox">
<label data-message="OP_autoSet" for="auto">AriaNg Auto Set</label>
<label data-message="OP_autoSet" for="autoSet">AriaNg Auto Set</label>
</td>
</tr>
<tr>
<td></td>
<td data-message="OPN_autoSet" class="note">Set AriaNg automatically when the user click "details"</td>
</tr>
<tr>
<td></td>
<td>
<input id="chgLog" style="margin-left: 0px; margin-top: 5px;" type="checkbox">
<label data-message="OP_chgLog" for="chgLog">Display Changelog</label>
</td>
</tr>
<tr>
<td></td>
<td data-message="OPN_chgLog" class="note">Display Changelog After Update</td>
</tr>
<tr>
<td></td>
<td>
Expand Down
3 changes: 3 additions & 0 deletions App/data/options/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ function save() {
const windowLoc = document.getElementById('winLoc').checked;
const auto = document.getElementById('auto').checked;
const autoSet = document.getElementById('autoSet').checked;
const chgLog = document.getElementById('chgLog').checked;
const dpHeight = document.getElementById('dpHeight').value;
const dpWidth = document.getElementById('dpWidth').value;
if (!windowLoc){
Expand Down Expand Up @@ -42,6 +43,7 @@ function save() {
windowLoc,
auto,
autoSet,
chgLog,
dpHeight,
dpWidth
}, () => {
Expand Down Expand Up @@ -74,6 +76,7 @@ function restore() {
document.getElementById('winLoc').checked = prefs.windowLoc;
document.getElementById('auto').checked = prefs.auto;
document.getElementById('autoSet').checked = prefs.autoSet;
document.getElementById('chgLog').checked = prefs.chgLog;
});
browser.storage.local.get(['dpWidth', 'dpHeight'], prefs => {
document.getElementById('dpWidth').value = prefs.dpWidth;
Expand Down

0 comments on commit 71ffefd

Please sign in to comment.