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

Commit

Permalink
Merge pull request #193 from Idrinth/idrinth
Browse files Browse the repository at this point in the history
Idrinth
  • Loading branch information
w20k authored Oct 9, 2016
2 parents 39a89a5 + 2c507bb commit 200ba50
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 54 deletions.
41 changes: 16 additions & 25 deletions src/mods/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,32 +236,23 @@ idrinth.ui = {
mod.children.push ( {
css: 'buttons'
} );
var closeFunc = 'this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode);';
var makeButton = function ( text, func ) {
return {
type: 'button',
content: idrinth.text.get ( "ui.button." + text ),
attributes: [ {
name: 'onclick',
value: 'this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode);' + func
} ]
};
};
if ( typeof altFunc === 'string' ) {
mod.children[mod.children.length - 1].children = [ {
type: 'button',
content: idrinth.text.get ( "ui.button.ok" ),
attributes: [ {
name: 'onclick',
value: closeFunc + altFunc
} ]
}, {
type: 'button',
content: idrinth.text.get ( "ui.button.cancel" ),
attributes: [ {
name: 'onclick',
value: closeFunc
} ]
} ];
mod.children[mod.children.length - 1].children = [
makeButton ( 'ok', altFunc ),
makeButton ( 'cancel', '' )
];
} else {
mod.children[mod.children.length - 1].children = [ {
type: 'button',
content: idrinth.text.get ( "ui.button.ok" ),
attributes: [ {
name: 'onclick',
value: closeFunc
} ]
} ];
mod.children[mod.children.length - 1].children = [ makeButton ( 'ok', '' ) ];
}
idrinth.ui.body.appendChild ( idrinth.ui.buildElement ( mod ) );
},
Expand Down Expand Up @@ -804,7 +795,7 @@ idrinth.ui = {
value: 'stylesheet'
}, {
name: 'href',
value: 'https://dotd.idrinth.de###PATH###/script-styles.css?###VERSION###'
value: 'https://dotd.idrinth.de/static/userscript-styles/###RELOAD-VERSION###/'
} ]
} ) );
build ();
Expand Down
40 changes: 11 additions & 29 deletions src/script-styles.css → src/root.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
@mixin simple-square($size) {
width:$size;
height:$size;
}
@import "styles/mutik.scss";
/**
* These styles modify pages changed by the script of IDotD
**/
Expand Down Expand Up @@ -26,14 +31,12 @@

.idrinth-emoticon {
display: inline-block;
width: 16px;
height: 16px;
@include simple-square(16px);
}

.idrinth-emoticon > span {
display: none;
width: 64px;
height: 64px;
@include simple-square(64px);
position: absolute;
}

Expand Down Expand Up @@ -516,14 +519,12 @@
}

.idrinth-central-box td.traffic > span {
width: 2em;
height: 2em;
@include simple-square(2em);
display: block;
}

.idrinth-central-box td.traffic > span {
width: 2em;
height: 2em;
@include simple-square(2em);
border-radius: 1em;
display: block;
overflow: hidden;
Expand Down Expand Up @@ -563,23 +564,6 @@
width: auto;
}

#DRMng_main {
margin-right: 5em;
display: block;
border-right: solid 1px #444;
}

#DRMng_status {
float: right;
text-align: right;
}

#DRMng_onoff {
float: left;
border-left-width: 0;
border-right: solid 1px #444;
}

td.is-os {
background: #f000;
background: rgba(255, 0, 0, 0.5);
Expand Down Expand Up @@ -625,14 +609,12 @@ td.is-os {
.idrinth-join-frame {
position:absolute;
left:0;
width:1px;
height:1px;
@include simple-square(1px);
z-index:-100;
}
.idrinth-circle {
padding:0.2em;
width:1em;
height:1em;
@include simple-square(1em);
float:right;
cursor:pointer;
background:#000;
Expand Down
19 changes: 19 additions & 0 deletions src/styles/mutik.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* Adjustments to make sure mutik's new script is not broken by us
**/
#DRMng_main {
margin-right: 5em;
display: block;
border-right: solid 1px #444;
}

#DRMng_status {
float: right;
text-align: right;
}

#DRMng_onoff {
float: left;
border-left-width: 0;
border-right: solid 1px #444;
}

0 comments on commit 200ba50

Please sign in to comment.