Skip to content

Commit

Permalink
feat: Optionally Skip Confirmation Window (#30)
Browse files Browse the repository at this point in the history
thanks nyfair
  • Loading branch information
RossWang committed Jul 13, 2018
1 parent b675908 commit b1eaa3e
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 6 deletions.
12 changes: 11 additions & 1 deletion App/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -325,11 +325,21 @@
"description": ""
},

"OP_cmDownPanel": {
"OP_downPanel": {
"message": "Display Download Panel",
"description": ""
},

"OPN_downPanel": {
"message": "Whether to display a download panel for the download event trigger from the auto observer",
"description": ""
},

"OP_cmDownPanel": {
"message": "Display Download Panel (context menu)",
"description": ""
},

"OPN_cmDownPanel": {
"message": "Whether to display a download panel for the download event trigger from the context menu",
"description": ""
Expand Down
14 changes: 12 additions & 2 deletions App/_locales/zh_CN/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -326,13 +326,23 @@
"description": ""
},

"OP_downPanel": {
"message": "显示下载窗口",
"description": ""
},

"OPN_downPanel": {
"message": "自动启动的下载是否要下载窗口",
"description": ""
},

"OP_cmDownPanel": {
"message": "显示下载视窗",
"message": "显示下载窗口 (右键菜单)",
"description": ""
},

"OPN_cmDownPanel": {
"message": "从右键选单启动的下载是否要下载视窗",
"message": "从右键菜单启动的下载是否要下载窗口",
"description": ""
},

Expand Down
12 changes: 11 additions & 1 deletion App/_locales/zh_TW/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -326,11 +326,21 @@
"description": ""
},

"OP_cmDownPanel": {
"OP_downPanel": {
"message": "顯示下載視窗",
"description": ""
},

"OPN_downPanel": {
"message": "自動啟動的下載是否要下載視窗",
"description": ""
},

"OP_cmDownPanel": {
"message": "顯示下載視窗 (右鍵選單)",
"description": ""
},

"OPN_cmDownPanel": {
"message": "從右鍵選單啟動的下載是否要下載視窗",
"description": ""
Expand Down
9 changes: 8 additions & 1 deletion App/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,14 @@ async function prepareDownload(d) {
details.fileSize = getFileSize(d);

// create download panel
downloadPanel(details);
browser.storage.local.get(config.command.guess, item => {
if (item.downPanel) {
downloadPanel(details);
}
else {
sendTo(details.url,details.fileName,"",details.requestHeaders,"1");
}
});

// avoid blank new tab
var getting = browser.tabs.query({
Expand Down
1 change: 1 addition & 0 deletions App/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ config.command = {
chgLog: true,
badge: true,
cmDownPanel: true,
downPanel: true,
ua: false,
fileSizeLimit: 0,
typeFilterA: "",
Expand Down
11 changes: 10 additions & 1 deletion App/data/options/general.html
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,19 @@
<tr>
<td data-message="OPN_badge" class="note">Display current active download count on top of the icon</td>
</tr>
<tr>
<td>
<input id="downPanel" style="margin-left: 0px; margin-top: 15px;" type="checkbox">
<label data-message="OP_downPanel" for="downPanel">Display Download Panel</label>
</td>
</tr>
<tr>
<td data-message="OPN_downPanel" class="note">Whether to display a download panel for the download event trigger from the auto observer</td>
</tr>
<tr>
<td>
<input id="cmDownPanel" style="margin-left: 0px; margin-top: 15px;" type="checkbox">
<label data-message="OP_cmDownPanel" for="cmDownPanel">Display Download Panel</label>
<label data-message="OP_cmDownPanel" for="cmDownPanel">Display Download Panel (context menu)</label>
</td>
</tr>
<tr>
Expand Down
3 changes: 3 additions & 0 deletions App/data/options/general.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ function save() {
const autoSet = document.getElementById('autoSet').checked;
const chgLog = document.getElementById('chgLog').checked;
const badge = document.getElementById('badge').checked;
const downPanel = document.getElementById('downPanel').checked;
const cmDownPanel = document.getElementById('cmDownPanel').checked;
const dpHeight = document.getElementById('dpHeight').value;
const dpWidth = document.getElementById('dpWidth').value;
Expand All @@ -28,6 +29,7 @@ function save() {
autoSet,
chgLog,
badge,
downPanel,
cmDownPanel,
dpHeight,
dpWidth
Expand Down Expand Up @@ -56,6 +58,7 @@ function restore() {
document.getElementById('chgLog').checked = prefs.chgLog;
document.getElementById('badge').checked = prefs.badge;
document.getElementById('cmDownPanel').checked = prefs.cmDownPanel;
document.getElementById('downPanel').checked = prefs.downPanel;
});
browser.storage.local.get(['dpWidth', 'dpHeight'], prefs => {
document.getElementById('dpWidth').value = prefs.dpWidth;
Expand Down

0 comments on commit b1eaa3e

Please sign in to comment.