Browse Source

[Web UI] Changes in Force Resume icon and menu order

adaptive-webui-19844
ngosang 10 years ago
parent
commit
1f4d01e512
  1. 2
      src/webui/www/private/index.html
  2. 32
      src/webui/www/public/scripts/contextmenu.js
  3. 4
      src/webui/www/public/scripts/mocha-init.js
  4. 6
      src/webui/www/public/transferlist.html

2
src/webui/www/private/index.html

@ -102,8 +102,8 @@ @@ -102,8 +102,8 @@
</div>
<ul id="contextmenu">
<li><a href="#Start"><img src="theme/media-playback-start" alt="QBT_TR(Resume)QBT_TR"/> QBT_TR(Resume)QBT_TR</a></li>
<li><a href="#ForceStart"><img src="theme/checked" alt="QBT_TR(Force Resume)QBT_TR"/> QBT_TR(Force Resume)QBT_TR</a></li>
<li><a href="#Pause"><img src="theme/media-playback-pause" alt="QBT_TR(Pause)QBT_TR"/> QBT_TR(Pause)QBT_TR</a></li>
<li><a href="#ForceStart"><img src="theme/media-seek-forward" alt="QBT_TR(Force Resume)QBT_TR"/> QBT_TR(Force Resume)QBT_TR</a></li>
<li class="separator"><a href="#Delete"><img src="theme/list-remove" alt="QBT_TR(Delete)QBT_TR"/> QBT_TR(Delete)QBT_TR</a></li>
<li id="queueingMenuItems" class="separator">
<a href="#priority" class="arrow-right"><span style="display: inline-block; width:16px"></span> QBT_TR(Priority)QBT_TR</a>

32
src/webui/www/public/scripts/contextmenu.js

@ -136,8 +136,9 @@ var ContextMenu = new Class({ @@ -136,8 +136,9 @@ var ContextMenu = new Class({
all_are_downloaded = true;
all_are_paused = true;
there_are_paused = false;
all_are_super_seeding = true;
all_are_force_start = true;
there_are_force_start = false;
all_are_super_seeding = true;
var h = myTable.selectedIds();
h.each(function(item, index){
@ -153,19 +154,20 @@ var ContextMenu = new Class({ @@ -153,19 +154,20 @@ var ContextMenu = new Class({
else
there_are_f_l_piece_prio = true;
if (data['force_start'] != true)
all_are_force_start = false;
if (data['progress'] != 1.0) // not downloaded
all_are_downloaded = false;
else if (data['super_seeding'] != true)
all_are_super_seeding = false;
state = data['state'];
if ((state != 'pausedUP') && (state != 'pausedDL'))
if (data['state'] != 'pausedUP' && data['state'] != 'pausedDL')
all_are_paused = false;
else
there_are_paused = true;
if (data['force_start'] != true)
all_are_force_start = false;
else
there_are_force_start = true;
});
show_seq_dl = true;
@ -178,8 +180,6 @@ var ContextMenu = new Class({ @@ -178,8 +180,6 @@ var ContextMenu = new Class({
if (!all_are_f_l_piece_prio && there_are_f_l_piece_prio)
show_f_l_piece_prio = false;
this.setItemChecked('ForceStart', all_are_force_start);
if (all_are_downloaded) {
this.hideItem('SequentialDownload');
this.hideItem('FirstLastPiecePrio');
@ -207,18 +207,16 @@ var ContextMenu = new Class({ @@ -207,18 +207,16 @@ var ContextMenu = new Class({
this.hideItem('SuperSeeding');
}
if (all_are_paused) {
this.showItem('Start');
this.hideItem('Pause');
} else {
if (there_are_paused) {
this.showItem('Start');
this.showItem('Pause');
} else {
this.showItem('ForceStart');
if (all_are_paused)
this.hideItem('Pause');
else if (all_are_force_start)
this.hideItem('ForceStart');
else if (!there_are_paused && !there_are_force_start)
this.hideItem('Start');
this.showItem('Pause');
}
}
},
//show menu

4
src/webui/www/public/scripts/mocha-init.js

@ -181,14 +181,14 @@ initializeWindows = function() { @@ -181,14 +181,14 @@ initializeWindows = function() {
}
};
setForceStartFN = function(val) {
setForceStartFN = function() {
var h = myTable.selectedIds();
if (h.length) {
new Request({
url: 'command/setForceStart',
method: 'post',
data: {
value: val,
value: 'true',
hashes: h.join("|")
}
}).send();

6
src/webui/www/public/transferlist.html

@ -25,6 +25,9 @@ @@ -25,6 +25,9 @@
Pause : function (element, ref) {
pauseFN();
},
ForceStart : function (element, ref) {
setForceStartFN();
},
prioTop : function (element, ref) {
setPriorityFN('topPrio');
},
@ -54,9 +57,6 @@ @@ -54,9 +57,6 @@
},
SuperSeeding : function (element, ref) {
setSuperSeedingFN(!ref.getItemChecked('SuperSeeding'));
},
ForceStart : function (element, ref) {
setForceStartFN(!ref.getItemChecked('ForceStart'));
}
},
offsets : {

Loading…
Cancel
Save