Skip to content

Commit 5b51e12

Browse files
authored
Various bug fixes for v5-beta1 (#2722)
* Prevent legend text overlapping - As well as some minor display adjustment for MaterialDesign theme. * Fix indent issue * Fix legend text bg-color * Fix spectrogram image save * Fix create torrent save * Clean up dialog verbose utility classes - Replace verbose utility classes with plain CSS rules. - Center any open dialogs when the WebUI resizes. * Group dialog windows in a container * Fix spectrogram init.js indent * Fix Blue theme dialog windows
1 parent cd84559 commit 5b51e12

19 files changed

Lines changed: 104 additions & 260 deletions

File tree

css/style.css

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,19 @@ div.dlg-window {
129129
color: #000000;
130130
border: 2px solid #909090;
131131
border-radius: 8px;
132+
outline: 0px solid transparent;
132133
display: none;
133134
max-width: 95vw;
134135
max-height: 95vh;
135136
}
137+
div.dlg-window > div:first-child {
138+
display: flex;
139+
flex-direction: row;
140+
align-items: center;
141+
justify-content: space-between;
142+
position: sticky;
143+
top: 0;
144+
}
136145
div.dlg-window div.row {
137146
margin: 0.5rem 0;
138147
padding: 0;
@@ -150,6 +159,9 @@ div.dlg-header {
150159
background: #F0F0F0 url(../images/blank.gif) no-repeat scroll 4px center;
151160
border-bottom: 1px solid #909090;
152161
border-radius: 10px 10px 0 0;
162+
font-weight: bold;
163+
padding: 0.25rem 0.25rem 0.25rem 3rem;
164+
flex-grow: 1;
153165
}
154166
a.dlg-close:link, a.dlg-close:visited {
155167
display: block;
@@ -294,6 +306,7 @@ div#stg {width: 95vw;}
294306
div#stg_c {
295307
display: flex;
296308
flex-direction: row;
309+
background-color: var(--settings-background-color);
297310
}
298311
div#stg-pages {
299312
padding: 0 0.5rem;
@@ -367,6 +380,7 @@ div#stg .lm {
367380
.stg_con legend {
368381
position: sticky;
369382
top: 0;
383+
background-color: var(--settings-background-color);
370384
}
371385
.ie9 .stg_con {position: static}
372386
.stg_con table {width: 100%}
@@ -415,9 +429,7 @@ div#gcont div.row:not(.Header) {padding: 0 0.3rem; word-break: break-all;}
415429
div#gcont div.row > div {padding-top: 0.25rem; padding-bottom: 0.25rem;}
416430

417431
div.graph_tab {background-color: #FFFFFF; overflow: hidden; display: block; -moz-user-focus: normal; -moz-user-input: enabled; line-height: 11px; color: #545454;}
418-
.graph_tab_grid,.graph_tab_legend {
419-
display: none;
420-
}
432+
.graph_tab_grid,.graph_tab_legend {display: none;}
421433
.graph_tab_grid { background-color: transparent; border: 2px solid #545454; }
422434
.graph_tab_legend { background-color: #F0F0F0; border: 0px none transparent; }
423435
.graph_tab_tooltip { position: absolute; border: 1px solid #fdd; padding: 2px; background-color: #fee; color: black; font-size: 11px; font-weight: bold; font-family: Tahoma, Arial, Helvetica, sans-serif; opacity: 0.80; }

index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ <h4 class="offcanvas-title" id="offcanvas-sidepanel-label"></h4>
296296
</div>
297297
<div class="graph_tab_grid"></div>
298298
<div class="graph_tab_legend"></div>
299+
<div id="dialog-container"></div>
299300
<div id="dir-container"></div>
300301
<script type="text/javascript" src="./js/bootstrap.bundle.min.js?v=5b1"></script>
301302
</body>

js/objects.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ var theDialogManager =
108108
modalState: false,
109109

110110
make: function(id, name, content, isModal, noClose) {
111-
$(document.body).append($("<div>").attr("id",id).addClass("dlg-window").append(
112-
$("<div>").addClass("d-flex flex-row align-items-center justify-content-between position-sticky top-0").append(
113-
$("<div>").attr("id",id+"-header").addClass("dlg-header fw-bold ps-5 pe-1 py-1 flex-grow-1").text(name),
111+
$("#dialog-container").append($("<div>").attr("id",id).addClass("dlg-window").append(
112+
$("<div>").append(
113+
$("<div>").attr("id",id+"-header").addClass("dlg-header").text(name),
114114
$("<a>").attr({href:"#"}).addClass("dlg-close"),
115115
),
116116
$(content),
@@ -121,22 +121,22 @@ var theDialogManager =
121121
var obj = $('#'+id);
122122
if(!isModal)
123123
isModal = false;
124-
obj.css( { position: "absolute", display: "none", outline: "0px solid transparent" } ).
125-
data("modal",isModal).data("nokeyclose",noClose);
124+
obj.data({
125+
modal: isModal,
126+
nokeyclose: noClose,
127+
});
126128
if(!noClose)
127129
obj.find(".dlg-close").on("click", () => theDialogManager.hide(id));
128130
var self = this;
129-
var checkForButtons = function me(val)
130-
{
131+
var checkForButtons = function me(val) {
131132
if(val.hasClass("Cancel"))
132133
val.on('click', function() { theDialogManager.hide(id); } );
133134
if(val.hasClass("Button"))
134135
$(val).on('focus', function() { this.blur(); } );
135136
val.children().each( function(ndx,val) { me($(val)) } );
136137
};
137138
checkForButtons(obj);
138-
var inScrollBarArea = function(obj,x,y)
139-
{
139+
var inScrollBarArea = function(obj,x,y) {
140140
if(obj.tagName && (/^input|textarea$/i).test(obj.tagName))
141141
return(false);
142142
var c = $(obj).offset();

js/webui.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,9 @@ var theWebUI =
249249
}
250250
},
251251

252-
assignEvents: function()
253-
{
254-
window.onresize = theWebUI.resize;
255-
window.onorientationchange = theWebUI.resize;
252+
assignEvents: function() {
253+
window.addEventListener("resize", () => theWebUI.resize());
254+
window.addEventListener("orientationchange", () => theWebUI.resize());
256255
$(document).on("dragstart", function(e) { return(false); } );
257256
$(document).on("selectstart", function(e) { return(e.fromTextCtrl); });
258257
$(document).on("contextmenu", function(e) {
@@ -2306,6 +2305,8 @@ var theWebUI =
23062305
theWebUI.resizeLeft(w);
23072306
const h = $("#maincont").height() * theWebUI.settings["webui.vsplit"];
23082307
theWebUI.resizeTop(null, h);
2308+
// center any open dialog
2309+
theDialogManager.visible.forEach(id => theDialogManager.center(id));
23092310
},
23102311

23112312
update: function()

plugins/_task/_task.css

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@
33
line-height: 16px;
44
background: #F5F5F5;
55
white-space: pre;
6-
overflow: scroll;
6+
overflow: auto;
77
width: 580px;
88
cursor: text;
99
}
10+
.tskconsole img {
11+
width: 100%;
12+
}
1013
#tskcmdlog {
1114
height: 36rem;
1215
}

plugins/create/create.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
div#create {background: url(../../images/toolbar.png) -48px center}
22
div#tcreate div.dlg-header {background-image: url(./images/create16.gif)}
3-
div#tcreate .row {margin: 0 0 0.25rem 0; padding: 0; align-items: center;}
43
div#tcreate textarea {resize: none; height: 8rem;}
54

65
#recentTrackers {width: 130px;}

plugins/create/init.js

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,13 @@ theWebUI.deleteFromRecentTrackers = function()
119119
plugin.onLangLoaded = function()
120120
{
121121
var plg = thePlugins.get("_task");
122-
if(!plg.allStuffLoaded)
122+
if (!plg.allStuffLoaded)
123123
setTimeout(arguments.callee,1000);
124-
else
125-
{
124+
else {
126125
theWebUI.request('?action=rtget',[plugin.getRecentTrackers, plugin]);
127126
$('#tsk_btns').prepend(
128-
"<input type='button' class='Button' id='xcsave' value='"+theUILang.torrentSave+"'>"
129-
);
127+
$("<button>").attr({type:"button", id:"xcsave"}).text(theUILang.torrentSave).hide(),
128+
);
130129
plugin.addButtonToToolbar("create",theUILang.mnu_create,"theWebUI.showCreate()","remove");
131130
plugin.addSeparatorToToolbar("remove");
132131
var pieceSize = $("<div>").addClass("row").append(
@@ -221,18 +220,16 @@ plugin.onLangLoaded = function()
221220
)[0].outerHTML,
222221
true
223222
);
224-
$("option[value='1024']").attr({selected: ""});
223+
$("option[value='1024']").prop("selected", true);
225224

226225
$(document.body).append($("<iframe name='xcreatefrm'/>").css({visibility: "hidden"}).attr( { name: "xcreatefrm", id: "xcreatefrm" } ).width(0).height(0));
227226
$(document.body).append(
228227
$('<form action="plugins/create/action.php" id="xgetfile" method="post" target="xcreatefrm">'+
229228
'<input type="hidden" name="cmd" value="getfile">'+
230229
'<input type="hidden" name="no" id="xtaskno" value="0">'+
231-
'</form>').width(0).height(0));
232-
$("#xcsave").on('click', function()
233-
{
234-
$('#xgetfile').trigger('submit');
235-
});
230+
'</form>').width(0).height(0),
231+
);
232+
$("#xcsave").on('click', () => $('#xgetfile').trigger('submit'));
236233
if (thePlugins.isInstalled("_getdir")) {
237234
new theWebUI.rDirBrowser("path_edit", true, 375);
238235
}

0 commit comments

Comments
 (0)