Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name BBH Map Redirector by Davf
- // @namespace http://zenoo0.fr
- // @version 0.1
- // @description Map redirection
- // @author Zenoo
- // @include http://www.hordes.fr/*
- // @include http://www.die2nite.com/*
- // @require https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js
- // @grant unsafeWindow
- // @downloadURL http://zenoo0.fr/uploaded/bbhmr.user.js
- // @updateURL http://zenoo0.fr/uploaded/bbhmr.meta.js
- // ==/UserScript==
- // Update by Davf
- // Include die2nite => For the test
- // Cleaning code is necessary
- var init = function() {
- var refresh = function() {
- if($('.random').children().first().text() == 'Choisissez votre prochaine existence :' || 'Choose where you will live and die next:'){
- $('.random').next().children().first().children().first().append('<th>BBH</th>');
- $('.random').next().children().first().children().each(function(){
- if($(this).children().first().hasClass('name')){
- if($(this).find('.lockReason').length == 0){
- var temp = $(this).children().first().children().eq(1).attr('href');
- console.log(temp)
- var regex = "=(.*?);";
- var mapId = temp.match(regex)[1];
- $(this).append('<td class="bbhmr"><a class="bbhmr_lk" href="http://bbh.fred26.fr/?cid='+mapId+'" target="_blank"><img src="http://www.hordes.fr/file/64.dat"></a></td>');
- }
- else {
- $(this).append('<td class="bbhmr nope"><img src="http://www.hordes.fr/file/64.dat" style="opacity:0.5;" onmouseover="js.HordeTip.showSpecialTip(this, 'helpTip', '', 'Lien vers BBH impossible.', event);" onmouseout="js.HordeTip.hide(event)"></td>')
- }
- }
- });
- }
- else{
- if($('.bbhmr').length != 0){
- $('bbhmr').remove();
- }
- }
- }
- js.XmlHttp._bbhmr_onEnd = js.XmlHttp.onEnd;
- js.XmlHttp.onEnd = function() {
- var url = this.urlForBack;
- this._bbhmr_onEnd();
- refresh();
- };
- };
- var script = document.createElement('script');
- script.setAttribute('id', 'bbhmr:script:init');
- script.setAttribute('type', 'application/javascript');
- document.body.appendChild(script);
- script.textContent = '(' + init.toString() + ')();';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement