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

Commit 200ba50

Browse files
authored
Merge pull request #193 from Idrinth/idrinth
Idrinth
2 parents 39a89a5 + 2c507bb commit 200ba50

File tree

3 files changed

+46
-54
lines changed

3 files changed

+46
-54
lines changed

Diff for: src/mods/ui.js

+16-25
Original file line numberDiff line numberDiff line change
@@ -236,32 +236,23 @@ idrinth.ui = {
236236
mod.children.push ( {
237237
css: 'buttons'
238238
} );
239-
var closeFunc = 'this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode);';
239+
var makeButton = function ( text, func ) {
240+
return {
241+
type: 'button',
242+
content: idrinth.text.get ( "ui.button." + text ),
243+
attributes: [ {
244+
name: 'onclick',
245+
value: 'this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode);' + func
246+
} ]
247+
};
248+
};
240249
if ( typeof altFunc === 'string' ) {
241-
mod.children[mod.children.length - 1].children = [ {
242-
type: 'button',
243-
content: idrinth.text.get ( "ui.button.ok" ),
244-
attributes: [ {
245-
name: 'onclick',
246-
value: closeFunc + altFunc
247-
} ]
248-
}, {
249-
type: 'button',
250-
content: idrinth.text.get ( "ui.button.cancel" ),
251-
attributes: [ {
252-
name: 'onclick',
253-
value: closeFunc
254-
} ]
255-
} ];
250+
mod.children[mod.children.length - 1].children = [
251+
makeButton ( 'ok', altFunc ),
252+
makeButton ( 'cancel', '' )
253+
];
256254
} else {
257-
mod.children[mod.children.length - 1].children = [ {
258-
type: 'button',
259-
content: idrinth.text.get ( "ui.button.ok" ),
260-
attributes: [ {
261-
name: 'onclick',
262-
value: closeFunc
263-
} ]
264-
} ];
255+
mod.children[mod.children.length - 1].children = [ makeButton ( 'ok', '' ) ];
265256
}
266257
idrinth.ui.body.appendChild ( idrinth.ui.buildElement ( mod ) );
267258
},
@@ -804,7 +795,7 @@ idrinth.ui = {
804795
value: 'stylesheet'
805796
}, {
806797
name: 'href',
807-
value: 'https://dotd.idrinth.de###PATH###/script-styles.css?###VERSION###'
798+
value: 'https://dotd.idrinth.de/static/userscript-styles/###RELOAD-VERSION###/'
808799
} ]
809800
} ) );
810801
build ();

Diff for: src/script-styles.css renamed to src/root.scss

+11-29
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
@mixin simple-square($size) {
2+
width:$size;
3+
height:$size;
4+
}
5+
@import "styles/mutik.scss";
16
/**
27
* These styles modify pages changed by the script of IDotD
38
**/
@@ -26,14 +31,12 @@
2631

2732
.idrinth-emoticon {
2833
display: inline-block;
29-
width: 16px;
30-
height: 16px;
34+
@include simple-square(16px);
3135
}
3236

3337
.idrinth-emoticon > span {
3438
display: none;
35-
width: 64px;
36-
height: 64px;
39+
@include simple-square(64px);
3740
position: absolute;
3841
}
3942

@@ -516,14 +519,12 @@
516519
}
517520

518521
.idrinth-central-box td.traffic > span {
519-
width: 2em;
520-
height: 2em;
522+
@include simple-square(2em);
521523
display: block;
522524
}
523525

524526
.idrinth-central-box td.traffic > span {
525-
width: 2em;
526-
height: 2em;
527+
@include simple-square(2em);
527528
border-radius: 1em;
528529
display: block;
529530
overflow: hidden;
@@ -563,23 +564,6 @@
563564
width: auto;
564565
}
565566

566-
#DRMng_main {
567-
margin-right: 5em;
568-
display: block;
569-
border-right: solid 1px #444;
570-
}
571-
572-
#DRMng_status {
573-
float: right;
574-
text-align: right;
575-
}
576-
577-
#DRMng_onoff {
578-
float: left;
579-
border-left-width: 0;
580-
border-right: solid 1px #444;
581-
}
582-
583567
td.is-os {
584568
background: #f000;
585569
background: rgba(255, 0, 0, 0.5);
@@ -625,14 +609,12 @@ td.is-os {
625609
.idrinth-join-frame {
626610
position:absolute;
627611
left:0;
628-
width:1px;
629-
height:1px;
612+
@include simple-square(1px);
630613
z-index:-100;
631614
}
632615
.idrinth-circle {
633616
padding:0.2em;
634-
width:1em;
635-
height:1em;
617+
@include simple-square(1em);
636618
float:right;
637619
cursor:pointer;
638620
background:#000;

Diff for: src/styles/mutik.scss

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* Adjustments to make sure mutik's new script is not broken by us
3+
**/
4+
#DRMng_main {
5+
margin-right: 5em;
6+
display: block;
7+
border-right: solid 1px #444;
8+
}
9+
10+
#DRMng_status {
11+
float: right;
12+
text-align: right;
13+
}
14+
15+
#DRMng_onoff {
16+
float: left;
17+
border-left-width: 0;
18+
border-right: solid 1px #444;
19+
}

0 commit comments

Comments
 (0)