// ==UserScript== // @name WLR for IE & Opera // @namespace http://forums.whirlpool.net.au // @version 0.1 // @description A port to IE & Opera of Meat Sack's WLR script // @include http://forums.whirlpool.net.au/* // @exclude http://forums.whirlpool.net.au/forum-replies.cfm?*p=-2* // @exclude http://forums.whirlpool.net.au/forum-replies-archive.cfm* // ==/UserScript== /**to do**/ //set up options page to turn on/off features //put the smack-down on Bravo //test the next cookie when cookie full //Meat Sack's suggestions /*function bugga(bugsName,bugsValue){ if($('#hideShow')[0] === undefined){ $('body').prepend('
'); } var tempHoldDebug = $('#debugDiv').html(); $('#debugDiv').html(tempHoldDebug+"----------------------------------
"+""+bugsName+": "+bugsValue+"
"); $('#hideShow').unbind(); $('#hideShow').mouseup( function(){$('#debugDiv').toggle();}); }*/ /***WLR settings***/ if(document.URL.toLowerCase().indexOf('wlr') > -1){ if(document.cookie.indexOf('wlrsettings') < 0){ document.cookie = 'wlrsettings=LastReadTracker:fals,avatars:fals,highlightRight:fals,InlineImages:fals,Smileys:fals,StyleWiki:fals,CodeHighlight:fals,HidePosts:fals,HideOwnDetails:fals,SwickiSearch:fals,MyRig:fals,Quicknav:fals,WhimBig:fals,HoldThePhone:fals;expires=Fri, 17 Dec 2009 10:00:00 GMT'; } $('#replies').prepend('Does the thing that remembers where ya bin
A guy that flies planes
Shows where you dun read upta
Keeps images inline in case they misbehave
Gives each poster LSD
Makes wiki links ghey
Turns your code (in between [##] whirlcode) into a tranvestite that wears too much makeup in the Coding and Web section
Yeah does that and any replies
Makes your own user page bettera
Adds a swicki search box to search page
Adds link inderneath usernames to users pc specspage in wiki
Moves Phone forums on index page down to bottom right
Navigation menu that sits top left of every page
Increases the size of your penis
';
var smlFrown = '
';
var smlRazz = '
';
var smlGrin ='
';
var smlNtl ='
';
var smlWink ='
';
var smlRoll ='
';
var smlShock ='
';
var smlEvil ='
';
var imgStar ='
';
var imgGUWPCT ='
';
smileys = {
">:\\)" : smlEvil,
":\\)" : smlHappy,
":-\\)" : smlHappy,
":\\(" : smlFrown,
":-\\(" : smlFrown,
":D" : smlGrin,
":-D" : smlGrin,
":\\|" : smlNtl,
":-\\|" : smlNtl,
":P" : smlRazz,
":-P" : smlRazz,
";\\)" : smlWink,
";-\\)" : smlWink,
"rolls eyes": smlRoll,
":o" : smlShock,
":-o" : smlShock,
"GUWPCT" : imgGUWPCT,
"gold star" : imgStar
};
regex = {};
for (key in smileys) {
regex[key] = new RegExp(key, 'g');
}
/*******whirlcode********/
var whirlCode = {
wc_whirlBold : { encloseLeft : "[*", encloseRight : "*]"},
wc_whirlItalic : { encloseLeft : "[/", encloseRight : "/]"},
wc_whirlSingleQuote : { encloseLeft : "['", encloseRight : "']"},
wc_whirlDoubleQuote : { encloseLeft : "[\"", encloseRight : "\"]"},
wc_whirlQuote : { encloseLeft : "[+", encloseRight : "+]"},
wc_whirlSuperscript : { encloseLeft : "[^", encloseRight : "^]"},
wc_whirlSubscript : { encloseLeft : "[\\", encloseRight : "\\]"},
wc_whirlStrike : { encloseLeft : "[-", encloseRight : "-]"},
wc_whirlCourier : { encloseLeft : "[#", encloseRight : "#]"},
wc_whirlSmall : { encloseLeft : "[(", encloseRight : ")]"},
wc_whirlGrey : { encloseLeft : "[`", encloseRight : "`]"},
wc_whirlSerif : { encloseLeft : "[~", encloseRight : "~]"},
wc_whirlGoogle : { encloseLeft : "[?", encloseRight : "?]"},
wc_whirlEscape : { encloseLeft : "[.", encloseRight : ".]"},
wc_whirlWiki : { encloseLeft : "[[", encloseRight : "]]"}
};
/********whirlcode buttons*********/
var wcButtons = '';
/*******whirlcode buttons event handler********/
function doStuffToTheText(theTextBox){
$('.wcodeButtons').mouseup(function(){
var buttonID = $(this).attr('id');
var currentValue = theTextBox.value;
var theSelection = document.selection.createRange().text;
theTextBox.focus();
if(theSelection === ""){
if(buttonID == "wc_whirlurl"){ //for some reason IE7 considers an input box a security risk - so gotta do modal
document.selection.createRange().text = '&<#^';
$('body').prepend('Enter link address:
'+ 'Enter link title:
'+ '');
if($.browser.opera) {
var head = document.getElementsByTagName('head')[0];
var el2 = document.createElement('style');
el2.type = 'text/css';
el2.innerHTML = ".str { color: #080; }.kwd { color: #008; }.com { color: #800; }.typ { color: #606; }.lit { color: #066; }"+
".pun { color: #660; }.pln { color: #000; }.tag { color: #008; }.atn { color: #606; }.atv { color: #080; }.dec { color: #606; }"+
"code.prettyprint { padding: 2px; }";
head.appendChild(el2);
}
else{
var mysheet3=document.styleSheets[1];
mysheet3.addRule(".str ", "color:#080;");
mysheet3.addRule(".kwd ", "color:#008;");
mysheet3.addRule(".com ", "color:#800;");
mysheet3.addRule(".typ ", "color:#606;");
mysheet3.addRule(".lit ", "color:#066;");
mysheet3.addRule(".pun ", "color:#660;");
mysheet3.addRule(".pln ", "color:#000;");
mysheet3.addRule(".tag ", "color:#008;");
mysheet3.addRule(".atn ", "color:#606;");
mysheet3.addRule(".atv ", "color:#080;");
mysheet3.addRule(".dec ", "color:#606;");
mysheet3.addRule("code.prettyprint ", "padding:2px;");
}
// See http://code.google.com/p/google-code-prettify/
(function () {
var F={};(function(){var b=["abstract bool break case catch char class const const_cast continue default delete deprecated dllexport dllimport do double dynamic_cast else enum explicit extern false float for friend goto if inline int long mutable naked namespace new noinline noreturn nothrow novtable operator private property protected public register reinterpret_cast return selectany short signed sizeof static static_cast struct switch template this thread throw true try typedef typeid typename union unsigned using declaration, directive uuid virtual void volatile while typeof",
"as base by byte checked decimal delegate descending event finally fixed foreach from group implicit in interface internal into is lock null object out override orderby params readonly ref sbyte sealed stackalloc string select uint ulong unchecked unsafe ushort var","package synchronized boolean implements import throws instanceof transient extends final strictfp native super","debugger export function with NaN Infinity","require sub unless until use elsif BEGIN END","and assert def del elif except exec global lambda not or pass print raise yield False True None",
"then end begin rescue ensure module when undef next redo retry alias defined","done fi"];for(var c=0;c
');
$.get(wikiLink, function(data){
if (data.indexOf("No entry yet for") < 0){
var sliceData = data.slice(data.indexOf(''),data.indexOf('',data.indexOf('')));
parentIDGetonce.html(sliceData).before('Show ImagesX');
}
else {
parentIDGetonce.html('User has no rig details listed.
').prepend('X'); } $('.showImages').click(function(event){ event.preventDefault(); if($(this).text() == 'Show Images'){ $(this).text('Hide Images'); } else{ $(this).text('Show Images'); } showImages(); }); $('.closediv').click(function(event){ event.preventDefault(); parentIDGetonce.css("display","none"); $(this).prev().remove(); $(this).remove(); }); }); } else{ parentIDGetonce.css("display","none"); $(this).parent().siblings('a:gt(0)').remove() } return false; }); } }//end of run on forum-replies page /***run on wiki pages****/ if(document.URL.indexOf('wiki') > -1){ var theTextBox = $('#f_body')[0]; $('#f_body').after(wcButtons); doStuffToTheText(theTextBox); } /***run on whim read****/ if((document.URL.indexOf("whim-read")>-1) && (document.cookie.substr(document.cookie.indexOf('Smileys:')+8,4) == 'true')){ for (key in smileys) { var smilRep = $('#replies').html().replace(regex[key], smileys[key]); $('#replies').html(smilRep); } } /***run on whim send****/ if(document.URL.indexOf("whim-send")>-1){ var theTextBox = $('#body')[0]; $('#body').css({width:'600px'}).before(wcButtons); $('#buttonsDiv').css({fontSize: '80%', textAlign: 'center', marginTop: '5px', marginBottom: '5px', width:'600px'}); doStuffToTheText(theTextBox); if(document.cookie.substr(document.cookie.indexOf('Smileys:')+8,4) == 'true'){ for (key in smileys) { var smilRep = $('td[@bgcolor="#c3c9de"]').html().replace(regex[key], smileys[key]); $('td[@bgcolor="#c3c9de"]').html(smilRep); } } } /***run on preview page****/ if(document.URL.indexOf("reply")>-1){ var theTextBox = $('#body')[0]; $('#body').css({width:'600px',marginTop: '10px'}).before(wcButtons).parent().css('width','600px'); doStuffToTheText(theTextBox); if(document.cookie.substr(document.cookie.indexOf('Smileys:')+8,4) == 'true'){ for (key in smileys) { var smilRep = $('.bodytext:last').html().replace(regex[key], smileys[key]); $('.bodytext:last').html(smilRep); } } } /***run on user page****/ if(document.URL.indexOf("forum-user.cfm")>-1){ var theTextBox = $('#body')[0]; $('#body').before(wcButtons); $('#buttonsDiv').css({fontSize: '80%', textAlign: 'center', marginTop: '5px', marginBottom: '5px'}).parent().css("width","410px").parent().parent().css("width","410px"); doStuffToTheText(theTextBox); if(document.cookie.substr(document.cookie.indexOf('WhimBig:')+8,4) == 'true'){ document.forms[ 1 ].elements.namedItem( 'body' ).style.width = "400px"; document.forms[ 1 ].elements.namedItem( 'body' ).setAttribute( "rows", "10"); document.forms[ 1 ].elements.namedItem( 'subject' ).style.width = "400px"; document.forms[ 1 ].elements.namedItem( 'subject' ).style.marginBottom = "20px"; } if((document.URL.indexOf($(".nav_item_name > a > span").text().split('user ')[1]) > -1) && (document.cookie.substr(document.cookie.indexOf('HideOwnDetails:')+15,4) == 'true')){ var aboutTr = $('tr[@valign=bottom]:first'); aboutTr.css({cursor:'pointer'}).children('td').css("opacity","0.5").end().next().attr('id','hider'); aboutTr.hover(function(){ $(this).children('td').css("opacity","1"); },function(){ if(trHide.css('display') == 'none'){ $(this).children('td').css("opacity","0.5"); } else{ $(this).children('td').css("opacity","0.9"); } }); var trHide = $('#hider'); trHide.hide(); aboutTr.toggle(function(){ trHide.css('display','block'); $(this).children('td').css('opacity','0.9'); },function(){ trHide.css('display','none'); $(this).children('td').css('opacity','0.5'); }); } } /***run on thread search page***/ else if((document.URL.indexOf("search")>-1) && (document.URL.indexOf("head") < 0) && (document.cookie.substr(document.cookie.indexOf('SwickiSearch:')+13,4) == 'true')){ function mywrite(s) { $("form[@action*=forum-search]").next().after('