Skip to content

Instantly share code, notes, and snippets.

@satyr
Created February 11, 2012 04:00
Show Gist options
  • Save satyr/1796045 to your computer and use it in GitHub Desktop.
Save satyr/1796045 to your computer and use it in GitHub Desktop.
mondraguildhelper
// ==UserScript==
// @name mondraguildhelper
// @description Links each member to his/her ranking.
// @match http://w001.monsterdragon.jp/guild/index*
// @author satyr
// @version 0.5
// ==/UserScript==
var i$, ref$, len$, span, name;
for (i$ = 0, len$ = (ref$ = document.querySelectorAll('.ui-monster-profile')).length; i$ < len$; ++i$) {
span = ref$[i$];
if (!(name = span.getAttribute('gtag'))) {
continue;
}
(fn$.call(document.createElement('form'), span));
}
function fn$(span){
var dd;
this.setAttribute('method', 'POST');
this.setAttribute('action', '/ranking/index');
this.setAttribute('target', '_blank');
this.style.display = 'inline-block';
this.title = "view " + name + "'s ranking";
this.innerHTML = "<button name=name value=" + name + ">";
dd = span.parentNode.parentNode.lastElementChild;
this.firstChild.appendChild(dd.lastChild);
dd.appendChild(this);
}
`// ==UserScript==
// @name mondraguildhelper
// @description Links each member to his/her ranking.
// @match http://w001.monsterdragon.jp/guild/index*
// @author satyr
// @version 0.5
// ==/UserScript==`
for span of document.querySelectorAll \.ui-monster-profile
continue unless name = span.getAttribute \gtag
with document.createElement \form
@setAttribute \method \POST
@setAttribute \action \/ranking/index
@setAttribute \target \_blank
@style.display = \inline-block
@title = "view #name's ranking"
@innerHTML = "<button name=name value=#name>"
dd = span.parentNode.parentNode.lastElementChild
@firstChild.appendChild dd.lastChild
dd.appendChild this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment