User:H Fern/source/forumfix/1.7.0/main.js

/*
 * @ Author: HFern, Klypto
 * @ Data:   8/21/2011
 * @ Version: BETA 0.7.0
 * @ License: Creative Commons Attribution-NoDerivs 3.0 Unported (until further notice)
 * @ Notes:  Rewritten by Fern for clarity and future module support.
 * This work is licensed under the Creative Commons Attribution-NoDerivs 3.0 Unported License.
 * To view a copy of this license, visit *http://creativecommons.org/licenses/by-nd/3.0/ or
 * send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.
 * send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.

var Avatars = {}; var Signatures = {};

Avatars["774791297"]    = "http://img146.imageshack.us/img146/3042/16569110150172285327892.jpg"; Signatures["774791297"] = '';

/*A*/ Avatars.AnakoChan       = "http://img560.imageshack.us/img560/6739/anako.png";

/*B*/ Avatars.BadDudeGio      = "http://i.imgur.com/NSBZK.png"; Signatures.BadDudeGio   = ''; Avatars.BemaniIIDX      = "http://img841.imageshack.us/img841/6537/couplej.png";

/*C*/ Avatars.CearaReborn     = "http://i.imgur.com/NWi8Q.jpg"; Signatures.CearaReborn  = ''; Avatars.ClericPhin      = "http://img534.imageshack.us/img534/1595/stocking.jpg";

/*D*/ Signatures.DntCryEmoKid = '';

/*E*/ Avatars.eshaandude      = "http://img215.imageshack.us/img215/8040/rsz3eshaandudewdf.jpg"; Signatures.eshaandude   = '   Steam: sH eDude- I play TF2 and AVA. ';

/*F*/ Avatars.ForteFZ         = "http://i53.tinypic.com/4rw0hz.png"; /*G*/ Avatars.Galactica       = "http://img143.imageshack.us/img143/2332/thbattlefield3.png"; /*H*/ Avatars.havenchild      = "http://i.imgur.com/QXDPw.jpg"; Signatures.havenchild   = ''; Avatars.hk1777          = "http://img803.imageshack.us/img803/788/avitar.jpg"; Signatures.hk1777       = ''; /*I*/ Avatars.IllIIlI         = "http://img30.imageshack.us/img30/3507/tigergrowls.jpg"; Signatures.IllIIlI      = '';

/*J*/

/*K*/ Avatars.kingofrunes       = "http://kingofrunes.com/images/yukari_profile.jpg"; Avatars.K0PWNS            = "http://img10.imageshack.us/img10/7797/imepic3.png"; Avatars.kris2341          = "http://img35.imageshack.us/img35/4519/lulzsec1.jpg";

/*L*/ Avatars.LeHunter          = "http://images4.wikia.nocookie.net/combatarms/images/b/b2/Crown_x_ray.png"; Signatures.LeHunter       = '  New in 1.5: Signatures! Get yours here! '; Avatars.likehome          = "http://img856.imageshack.us/img856/4475/images221.jpg"; Signatures.likehome       = ''; Avatars["Liverpool FC"]   = "http://img7.imageshack.us/img7/6048/liverpoolcrest.jpg"; Signatures["Liverpool FC"] = '';

/*M*/ Avatars.magerkil1         = "http://www.picdrop.net/images/20315550812352279759.jpg"; Signatures.magerkil1      = ''; Avatars.MMZephyr          = "http://img707.imageshack.us/img707/7922/unb.png"; Signatures.MMZephyr       = '<img src="http://img823.imageshack.us/img823/6640/mmzephyr2.jpg" border="0"> Check out my contest song here!</a> '; Avatars.mussrules         = "http://desmond.imageshack.us/Himg6/scaled.php?server=6&filename=generallee2.jpg&res=medium"; Signatures.mussrules      = '<img src="http://combatsigs.com/get/sig/34/mussrules" border="0">';

/*N*/

/*O*/

/*P*/ Avatars.phanatic51      = "http://img847.imageshack.us/img847/6793/images1ic.jpg"; Signatures.phanatic51   = '<img src="http://img836.imageshack.us/img836/9025/nyansig.jpg" />';

Avatars.pulsus          = "http://img198.imageshack.us/img198/2738/hollowichigoavatarpic.jpg"; /*Q*/ /*R*/ Avatars.RaptorJesus     = "http://i.imgur.com/k9OTx.jpg"; Signatures.RaptorJesus  = '<img src="http://thecbl.net/mycbl/sig/753.jpg" />'; /*S*/ Avatars.smw232          = "http://i.imgur.com/znnx3.jpg"; Signatures.smw232       = '<img src="http://i.imgur.com/UFRne.png" />'; Avatars.supersavior2    = "http://img204.imageshack.us/img204/7756/trollbz.jpg"; Signatures.supersavior2 = '<img src="http://combatsigs.com/get/sig/212/supersavior5" />'; Avatars.steelra         = "http://img268.imageshack.us/img268/2429/steelra.png"; /*T*/ Avatars.Talisman        = "http://images.wikia.com/acecombat/images/b/b6/Osean_Flag.gif"; Signatures.Talisman     = '<img src="http://img89.imageshack.us/img89/2411/talismanforumsig1copy.jpg" border="0">  Support! MP5SD For GP here!</a> Check out my Stories here</a> and here!</a>'; Avatars.TehClownz       = "http://img837.imageshack.us/img837/9409/82082785.jpg"; Avatars.TPSLAYSYOU      = "http://img856.imageshack.us/img856/8816/2563524zfmesefw.jpg"; Signatures.TPSLAYSYOU   = '<img src="http://img97.imageshack.us/img97/7710/siggyws.png" />'; Avatars.TopsyKretts3    = "http://i.imgur.com/uWEq6.jpg"; Signatures.TopsyKretts3 = '<img src="http://i.imgur.com/P6ixb.jpg" />'; /*U*/ Avatars.UnamedPlayer    = "http://i.imgur.com/7aExZ.jpg"; Signatures.UnamedPlayer = '<img src="http://i.imgur.com/8Cit0.png" />'; /*V*/ /*W*/ /*X*/ Avatars.Xemnaes         = "http://img15.imageshack.us/img15/5495/xemnasavatar.png"; Signatures.Xemnaes      = '<img src="http://img834.imageshack.us/img834/1528/forumssig.jpg" />'; Avatars.XtremeKill      = "http://img856.imageshack.us/img856/893/yrfc6008.png"; Signatures.XtremeKill   = '<img src="http://i53.tinypic.com/ao00no.jpg" />'; Avatars.XxV4D3RxX       = "http://img683.imageshack.us/img683/1372/1724d.jpg"; Signatures.XxV4D3RxX    = '<img src="http://img825.imageshack.us/img825/4803/warriordark.jpg" />'; Avatars.xzBaka          = "http://img96.imageshack.us/img96/7395/9080g.jpg"; /*Y*/ /*Z*/ Avatars.zer0beat        = "http://i.imgur.com/BKKn1.jpg"; Signatures.zer0beat     = '<img src="http://i.imgur.com/lp68t.jpg" />'; Avatars.zero564         = "http://img339.imageshack.us/img339/5363/zeroociar3.jpg"; Signatures.zero564      = '<img src="http://www.bungie.net/card/halo3/zirus%20zero.ashx" /></a>'; Avatars["Zero Exalted"] = "http://img856.imageshack.us/img856/5148/tek4e3ac4375da516598959.png";

Avatars.UziOwns     = "http://img21.imageshack.us/img21/8228/unled2iu.jpg"; Avatars.zodiark1234 = "http://img8.imageshack.us/img8/8167/180px157typhlosion.png"; Avatars.X0V3RD0S3X  = "http://static.leaguecraft.com/images/icons/champions/champion_64.jpg"; Avatars.iFly55      = "http://i.imgur.com/6aAZm.png"; Avatars.Slayer666   = "http://img808.imageshack.us/img808/4912/snipery.jpg"; Avatars.Aguythatownz = "http://img29.imageshack.us/img29/2756/combatarmsawesomeface.jpg"; Avatars.uatanoli    = "http://img843.imageshack.us/img843/8360/fearless1.png"; Avatars.Klypto      = "http://img845.imageshack.us/img845/8255/vuzt74k2.png"; Avatars.canoob18    = "http://img233.imageshack.us/img233/443/camei.gif"; Avatars.iLoveGunzzzz = "http://img97.imageshack.us/img97/3162/1999yamahabanshee.jpg"; Avatars.BLYFACTOR   = "http://img268.imageshack.us/img268/7727/amazingb.png"; Avatars.Gagagigo    = "http://imgboot.com/images/Ireul/lizardman.png"; Avatars.kody174     = "http://img94.imageshack.us/img94/5525/kody174.png"; Avatars.Glasgavelen = "http://www.picdrop.net/images/1z1us92drd.jpg"; Avatars.TehShocker  = "http://img33.imageshack.us/img33/5830/sensesfaildec82010200.jpg"; Avatars.Enhanced    = "http://i55.tinypic.com/16c29zl.gif"; Avatars.VenusFallen = "http://img96.imageshack.us/img96/1980/blrevy.jpg"; Avatars.Zurenriri   = "http://img594.imageshack.us/img594/2420/289a3jb22.png"; Avatars.Aniyaki     = "http://img193.imageshack.us/img193/6648/yukarit.png"; Avatars.mereck      = "http://img834.imageshack.us/img834/5239/whatvp.png"; Avatars.frost221    = "http://img59.imageshack.us/img59/5852/resizeszt.jpg"; Avatars.TohnoShiki  = "http://img66.imageshack.us/img66/4387/shiki2v3.gif"; Avatars.TmcmuffinT  = "http://desmond.imageshack.us/Himg814/scaled.php?server=814&filename=avatarll.jpg&res=medium"; Avatars.gotron228   = "http://img171.imageshack.us/img171/4272/38031687.jpg"; Avatars.DreamingKai = "http://u.mapledreams.com/lolf2.png"; Avatars.xgrantwallx = "http://mapletimes.tk/signature.png"; Avatars.SGIndygo    = "http://img163.imageshack.us/img163/2378/caavee.png"; Avatars.LoliKitten  = "http://dl.dropbox.com/u/18562797/1307593028834.png"; Avatars.Viean007    = "http://img641.imageshack.us/img641/7720/terrorp.png"; Avatars.izzyroxursox = "http://img23.imageshack.us/img23/5866/izzyavatar.png"; Avatars.BebeInMyBed = "http://img191.imageshack.us/img191/3130/ymht40031.jpg"; Avatars.Lavallois   = "http://i.imgur.com/lh59m.png"; Avatars.ReXxas      = "http://img27.imageshack.us/img27/4213/nexonavi.png"; Avatars.alphess1    = "http://img13.imageshack.us/img13/437/earthbendergoogleimages.png"; Avatars.Homicide    = "http://incubus.in/mypants/nxav.png"; Avatars.Bloodoath   = "http://img171.imageshack.us/img171/1/avatar1fhj.jpg"; Avatars.Lavallois   = "http://i.imgur.com/lh59m.png";

var VERSION = ["1.7.0","Ristretto","Dev"];

var jsload=function(url){js = document.createElement('script');js.setAttribute('language','javascript');js.setAttribute('type','text/javascript');js .setAttribute('src',url);document.body.appendChild(js);return js;}; // BEGIN Memory function checkObj(obj,type){if ( typeof(type)==='undefined') type="object";if (typeof(obj)===type) return true; else return false;}

function validateMemory(ForumFix){ console.log( 'Begin Validate Memory' ); console.log( "Typeof(ForumFix : )" + typeof(ForumFix) ); if (typeof(ForumFix) === 'undefined') {ForumFix = {};console.log( "Undefined Forum Fix caught, new")} if (typeof(ForumFix) === 'undefined') var ForumFix = {}; if( typeof(ForumFix) !== 'object') var ForumFix = {}; if( typeof(ForumFix) === null) var ForumFix = {}; if( typeof(ForumFix.filters) !== 'object') ForumFix.filters = {}; if (!checkObj(ForumFix.filters.users))	ForumFix.filters.users = {}; if (!checkObj(ForumFix.stats)) ForumFix.stats ={}; if (!checkObj(ForumFix.stats.posts)) ForumFix.stats.posts = {}; if (!checkObj(ForumFix.stats.posts.read, 'number')) ForumFix.stats.posts.read = 0; if (!checkObj(ForumFix.stats.posts.quoted, 'number')) ForumFix.stats.posts.quoted = 0; if (!checkObj(ForumFix.stats.posts.replied, 'number')) ForumFix.stats.posts.replied = 0; if (!checkObj(ForumFix.stats.posts.users)) ForumFix.stats.posts.users = {}; if (!checkObj(ForumFix.stats.misc)) ForumFix.stats.misc = {}; if (!checkObj(ForumFix.stats.misc.generated)) ForumFix.stats.misc.generated = {}; if (!checkObj(ForumFix.stats.misc.generated.sigs, 'number')) ForumFix.stats.misc.generated.sigs = 0; if (!checkObj(ForumFix.stats.misc.generated.avatars, 'number')) ForumFix.stats.misc.generated.avatars = 0; if (!checkObj(ForumFix.settings)) ForumFix.settings = {}; if (!checkObj(ForumFix.settings.terms, 'boolean')) ForumFix.settings.terms = false; if (!checkObj(ForumFix.settings.avatarMax)) ForumFix.settings.avatarMax = {}; if (!checkObj(ForumFix.settings.avatarMax.x, 'number')) ForumFix.settings.avatarMax.x = 200; if (!checkObj(ForumFix.settings.avatarMax.y, 'number')) ForumFix.settings.avatarMax.y = 200; if (!checkObj(ForumFix.internal)) ForumFix.internal = {}; ForumFix.internal.add = function(type){ switch(type){ case 'read': ForumFix.stats.posts.read++; return ForumFix.stats.posts.read; break; case 'quoted': ForumFix.stats.posts.read++; return ForumFix.stats.posts.read; break; case 'read': ForumFix.stats.posts.read++; return ForumFix.stats.posts.read; break; }			}		return ForumFix; }

function save(ffhandle){ } function createMemory{ if( typeof( localStorage.getItem("ForumFix") ) == null ){ return validateMemory; }	if( typeof( localStorage.getItem("ForumFix") ) == null ){ return validateMemory; }	else{ var FF; try { FF = validateMemory( JSON.parse( localStorage.getItem("ForumFix") )); } catch (err) {FF = validateMemory;} return FF; } }

function userstatadd(user, stat, makesave){ if (typeof(ForumFix.stats.posts.users[user]) === "undefined"){ ForumFix.stats.posts.users[user] = {"read":0,"replied":0,"quoted":0}; }	ForumFix.stats.posts.users[user][stat]++; if (makesave === true) save(ForumFix); return ForumFix.stats.posts.users[user][stat]; }

function save( ffhandle ){ if ( (ffhandle) == 'undefined') return false; else { localStorage.setItem("ForumFix", JSON.stringify(ffhandle) ); return localStorage.getItem("ForumFix"); } }

var ForumFix = createMemory;

//END Memory //BEGIN Url Checker function showUrlWarning( url ){ if ( url.match(/(.*)\:\/\/([^\/]+)/) !== null){ document.getElementById('external-url-malformed').style.display = 'none'; if (url.match(/(.*)\:\/\/([^\/]+)/)[1].toUpperCase === 'HTTPS') document.getElementById('external-url-secure').style.display = ''; else document.getElementById('external-url-secure').style.display = 'none'; document.getElementById('external-url-domain').childNodes[0].nodeValue = url.match(/(.*)\:\/\/([^\/]+)/)[2]; } else { document.getElementById('external-url-malformed').style.display = ''; document.getElementById('external-url-secure').style.display = 'none'; document.getElementById('external-url-domain').childNodes[0].nodeValue = 'url malformed!'; }	document.getElementById('external-url-fullurl').childNodes[0].nodeValue = url; document.getElementById('external-url-go').setAttribute('href', url) document.getElementById('ff-externalurl-warning').style.display = ''; } function absmove(url){ window.location.href = url;} function goto( url ){ if (! (url.match(/[^\:]*\:\/\/[^\.]*\.?nexon.net\/?.*/) === null) ){ window.location.href = url; } else { showUrlWarning( url ); } } //END Url Checker

function isOdd(value){ if (value%2 == 0) return false; else return true; }

function getMS{ var tD = new Date; return tD.getTime; }

if (window.location.pathname.substr(0,10) === "/ForumFix/"){ document.body.parentNode.innerHTML = ""; skinI = document.createElement("script"); skinI.setAttribute("id","mainscript"); skinI.setAttribute("type","text/javascript"); skinI.setAttribute("src","http:///*--!{ http_host }!--*//devForum/hosted/skin_init.js"); document.body.appendChild(skinI); console.log("FF.main: /ForumFix/* detected. Initializing skin_init.") } else { //BEGIN FORUM MAIN

var occurencesAvatar = 0;

var avtMaxX = ForumFix.settings.avatarMax.x > 200 ? 200 : ForumFix.settings.avatarMax.x; var avtMaxY = ForumFix.settings.avatarMax.y > 200 ? 200 : ForumFix.settings.avatarMax.y;

var occurencesSignature = 0; var mainLoop = 0; var length = document.getElementsByClassName("ForumPostList")[0].childNodes.length; var d = new Date; var benchmark = d.getTime; var STARTTIME = getMS; var lastBMT = getMS; //interval, operation, user, operation time, time since start, output var canBenchmark = true; var Benchmarks = new Array;

function proccesslog(proccess, comment){ if ( canBenchmark ) { Benchmarks.push({0:proccess,1:comment,2:getMS-STARTTIME}); } }

proccesslog("main", 'begin post iteration'); while ( mainLoop < length ){ var i = mainLoop; proccesslog("main_loop", 'main loop #'+i); //Benchmarks.push([i, "element_scan", "_", getMS, getMS-STARTTIME,""]); if ( isOdd(mainLoop) ){ var UserPosting = document.getElementsByClassName("ForumPostList")[0].childNodes[i].getElementsByClassName("ForumPostUserName")[0].getElementsByTagName("a")[0].childNodes[0].nodeValue; proccesslog("post_loop", 'post @ loop #'+i+ ' &lt;' + UserPosting +'&gt;'); var root = document.getElementsByClassName("ForumPostList")[0].childNodes[i]; //Benchmarks.push([i, "post_scan", UserPosting, getMS, getMS-STARTTIME,""]); //console.log( typeof(ForumFix.stats.users[UserPosting]) ); as = document.getElementsByClassName("ForumPostList")[0].childNodes[i].getElementsByClassName("ForumPostBodyArea")[0].getElementsByTagName("a"); proccesslog("post_href_cleans", 'cleaning hyperlinks...'); var refs = 0; for (it in as){ a = as[it]; if ( typeof(a.href) !== 'undefined' ){ href = a.href; a.setAttribute('href','javascript: goto("'+ href +'")'); a.setAttribute('target','_self'); refs++; }		}		proccesslog("post_href_cleans", 'New UPC report: ' + refs); if ( UserPosting == "Anonymous" ){ proccesslog("post_anon_abort", 'Anon detectect, aborting'); //Benchmarks.push([i, "post_scan", UserPosting, getMS, getMS-STARTTIME,""]); var anons = ["http://img585.imageshack.us/img585/1328/zxjn.png","http://img696.imageshack.us/img696/9964/anony.png"]; var rando = Math.floor(Math.random*anons.length) var anonAvt = document.createElement("img"); anonAvt.setAttribute("src", anons[rando]); anonAvt.setAttribute("style", "max-width:200px; max-height:200px;"); document.getElementsByClassName("ForumPostList")[0].childNodes[i].getElementsByClassName("ForumPostUserName")[0].appendChild( anonAvt ); proccesslog("post_anon_abort", 'aborted!'); mainLoop++; continue; }		proccesslog("stats_add", 'iterating stats'); ForumFix.internal.add('read'); userstatadd(UserPosting, "read"); proccesslog("avatar_init", 'searching for avatar...'); if ( UserPosting in Avatars ){ //BEING AVAT occurencesAvatar++; proccesslog("avatar_init", 'avatar found. creating objects...'); document.getElementsByClassName("ForumPostList")[0].childNodes[i].childNodes[1].childNodes[3].childNodes[1].childNodes[0].childNodes[1].childNodes[1].childNodes[1].childNodes[1].childNodes[3].setAttribute("style", "font-size: 125%;"); var avtImgWrap = document.createElement("div"); var avtImg = document.createElement("img"); avtImgWrap.appendChild(avtImg); avtImg.setAttribute("style","border-width: 1px; max-width: " + avtMaxX + "px; max-height: " + avtMaxY + "px;"); avtImg.setAttribute('class', 'forumfix avatar '+encodeURI(UserPosting)); avtImg.setAttribute("src", Avatars[UserPosting]); document.getElementsByClassName("ForumPostList")[0].childNodes[i].childNodes[1].childNodes[3].childNodes[1].childNodes[0].childNodes[1].childNodes[1].childNodes[1].childNodes[1].appendChild(avtImgWrap); var reportAbuseRoot = document.getElementsByClassName("ForumPostList")[0].childNodes[i].getElementsByClassName("ForumPostStatistics")[0]; var reportLi = document.createElement("li"); reportAbuseRoot.insertBefore(reportLi,reportAbuseRoot.childNodes[5]); var reportA = document.createElement("a"); reportA.setAttribute("href", "http://www.klyptotech.com/feedback.html"); reportA.setAttribute("style", "color:black;"); reportA.setAttribute("target", "_blank"); reportLi.appendChild( reportA ); var reportTxt = document.createTextNode("Report Avatar"); reportA.appendChild( reportTxt ); proccesslog("avatar_app", 'objects appended'); //END AVAT }		if ( UserPosting in Signatures && (UserPosting != "Anonymous") ){ occurencesSignature++; var parent = document.getElementsByClassName("ForumPostList")[0].childNodes[i].getElementsByClassName("ForumPostBodyArea")[0].parentNode; var sigWrap = document.createElement("div"); var sigBreak = document.createElement("hr"); sigBreak.setAttribute("style", "width:90%; float:left;"); parent.appendChild( sigBreak ); sigWrap.setAttribute("class", "x-signature " + UserPosting); sigWrap.setAttribute("style", "width:100%;max-height:300px; margin-left: 10px; margin-right: 10px;"); sigWrap.innerHTML = ' ' + Signatures[UserPosting]; parent.appendChild( sigWrap ); /* Begin Filter  */ /* End Filter  */ }		//END Main } else proccesslog("avatar_init", 'no avatar detected'); //DO NOT TOUCH

mainLoop++; }; save(ForumFix)

var d = new Date; var ms = d.getTime; var btime = ms-benchmark;

document.getElementsByClassName( "CommonContentArea")[0].setAttribute("style","padding-bottom:0px !important;margin-bottom:0px !important;"); document.getElementsByClassName( "CommonContent")[0].setAttribute("style","padding-bottom:0px !important;");

var root = document.getElementsByClassName( "CommonContent")[0]; var injNotice = document.createElement("div"); injNotice.setAttribute("style", "text-align:right; font-size: 80%;");

function togglebox{ if(document.getElementById("ff-opsWrap").style.display == "none"){ document.getElementById("ff-opsWrap").style.display = "block"; document.getElementById("ff-opChangable").childNodes[0].nodeValue = "Show Less"; }else{ document.getElementById("ff-opsWrap").style.display = "none"; document.getElementById("ff-opChangable").childNodes[0].nodeValue = "Show More"; } }

var injWrap = document.createElement("ul"); injWrap.setAttribute("style", "list-style-type:none; margin:0px; padding:0px;width:100%; display:table;"); root.appendChild( injWrap );

var optsToggleEle = document.createElement("li"); var optsToggleTxt = document.createElement("a"); //ff-opsWrap optsToggleTxt.setAttribute("href",'javascript: togglebox '); optsToggleTxt.setAttribute("id","ff-opChangable"); var optsToggleLit = document.createTextNode("Show More"); optsToggleTxt.appendChild(optsToggleLit); optsToggleEle.appendChild( optsToggleTxt ); optsToggleEle.setAttribute("style","font-size:80%; float:left;"); injWrap.appendChild(optsToggleEle);

var txtNotice = document.createTextNode(occurencesAvatar + "+" + occurencesSignature + " occurences processed in "+ (btime/1000) +" seconds.") var occnotice = document.createElement("li"); occnotice.setAttribute("style","font-size:80%; float:right;"); occnotice.appendChild( txtNotice); injWrap.appendChild(occnotice);

/* var txtNotice = document.createTextNode(occurencesAvatar + "+" + occurencesSignature + " occurences processed in "+ (btime/1000) +" seconds."); injNotice.appendChild( txtNotice ); root.appendChild( injNotice );

var injWrap = document.createElement("ul"); injWrap.setAttribute("style", "list-style-type:none; margin:0px; padding:0px;width:100%; display:table;"); //list-style-type: root.appendChild( injWrap );

var versionNotice = document.createElement("li"); versionNotice.setAttribute("style", "text-align:left; font-size: 80%; display:table-cell ; width: 350px; "); versionNotice.setAttribute("float", "left"); var versiontxtNotice = document.createTextNode("Forum Fix "+ VERSION[2] + " "+ VERSION[0] + " (" + VERSION[1] + ")"); versionNotice.appendChild( versiontxtNotice ); injWrap.appendChild( versionNotice );

var bugNotice = document.createElement("li"); bugNotice.setAttribute("style", "text-align:center; font-size: 80%; display:table-cell ; "); bugNotice.setAttribute("float", "center"); var bugA = document.createElement("a"); bugA.setAttribute("href", "http://forum.nexon.net/CombatArms/forums/thread/7852750.aspx"); var bugtxtNotice = document.createTextNode("Report a Bug"); bugA.appendChild( bugtxtNotice ); bugNotice.appendChild( bugA ); injWrap.appendChild( bugNotice );

var speedFact = document.createElement("li"); speedFact.setAttribute("style", "text-align:right; font-size: 80%; display:table-cell ; width: 350px;"); speedFact.setAttribute("float", "right");

var btime = ms-benchmark; function getSpeedFact( btime ){ if (btime == 1) return "As fast as Fern on coffee." ; else if (btime < 3)  return "Faster than a fly's wing flaps." ;else if (btime < 5)  return "Faster than a bee's wing flaps." ;else if (btime < 8)  return "Faster than a camera shutter." ;else if (btime < 16) return "Faster than a frame lapse." ; else if (btime < 300) return "Faster than a blink of an eye." ; else return "Faster than a forum page load."; }

var speedFacttxtNotice = document.createTextNode( getSpeedFact( btime ) ); speedFact.appendChild( speedFacttxtNotice ); injWrap.appendChild( speedFact ); // rewrite

var statsBoxWrap = document.createElement("div"); var hr = document.createElement("hr"); hr.setAttribute("style","margin-top: 6px;margin-bottom: 20px;"); statsBoxWrap.setAttribute("style", "min-height: 200px; margin:0px; padding:0px;width:100%; display:none;"); statsBoxWrap.setAttribute("id", "ff-opsWrap"); statsBoxWrap.appendChild(hr); //list-style-type: root.appendChild( statsBoxWrap );

var reportingStyle = document.createElement('LINK'); //<LINK REL=StyleSheet HREF="style.css" TYPE="text/css" MEDIA=screen> reportingStyle.setAttribute('REL','StyleSheet'); reportingStyle.setAttribute('HREF','http:///*--!{ http_host }!--*//devForum/hosted/reporting.css'); reportingStyle.setAttribute('TYPE','text/css'); reportingStyle.setAttribute('MEDIA','screen'); statsBoxWrap.appendChild(reportingStyle);

var reportingJS = jsload('http:///*--!{ http_host }!--*//devForum/hosted/reporting.js');

var reportingBox = document.createElement('div'); reportingBox.innerHTML = ' \n   Options</a> \n    Stats</a> \n    Page Log</a> Tags</a> \n  \n   Options Page  \n  \n  \n    This is content box Two \n  \n  \n     as  ';

statsBoxWrap.appendChild(reportingBox); var hasRenLog = false; function renderlog{ if (! hasRenLog){ document.getElementById('forumfix-log').innerHTML = ''; lo = document.createElement('center'); lo.setAttribute('style','width:100%; height:20px;'); document.getElementById('forumfix-log').appendChild(lo); imglo = new Image; imglo.src = 'http:///*--!{ http_host }!--*//devForum/hosted/loading.gif'; lotex = document.createElement('span'); lotex.setAttribute('style','margin-left:10px;'); lotex.setAttribute('id','forumfix-log-loadingtext'); lotex.innerHTML = 'Loading...'; lo.appendChild(imglo); lo.appendChild(lotex); var rdl_css = document.createElement('LINK'); rdl_css.setAttribute('REL','StyleSheet'); rdl_css.setAttribute('HREF','http:///*--!{ http_host }!--*//devForum/hosted/renderer.log.css'); rdl_css.setAttribute('TYPE','text/css'); rdl_css.setAttribute('MEDIA','screen'); statsBoxWrap.appendChild(rdl_css); var rdl_js = document.createElement('script'); rdl_js.setAttribute('language','javascript'); rdl_js.setAttribute('type','text/javascript'); rdl_js .setAttribute('src','http:///*--!{ http_host }!--*//devForum/hosted/renderer.log.js'); document.body.appendChild(rdl_js); hasRenLog = true; } } var hasRenTags = false; function ef_tagcloud(tag_data){ hasRenTags = true; itr = 0; for (x in tag_data){ if ( (typeof(tag_data[x]) === 'object') && (typeof(tag_data[x][1]) !== 'undefined') ){ sp = document.createElement('span'); 1+(tag_data[x][1]/10) sp.setAttribute('style','font-size: '+ (1 + tag_data[x][1]/10) +'em;'); sp.setAttribute('title',tag_data[x][2] + ' Instances.'); console.log( JSON.stringify( tag_data[x] ) ); sp.setAttribute('class','word size'+ tag_data[x][1]); sp.innerHTML = tag_data[x][0] + ' '; document.getElementById('forumfix-tagcloud').appendChild(sp); if (itr === tag_data.length-1) document.getElementById('forumfix-tagcloud-temp').innerHTML=''; }		itr++; }	document.getElementById('forumfix-tagcloud-temp').innerHTML=''; } function rendertags{ if (! hasRenTags){ document.getElementById('forumfix-tagcloud').innerHTML = ''; lo = document.createElement('center'); lo.setAttribute('id','forumfix-tagcloud-temp'); lo.setAttribute('style','width:100%; height:20px;'); document.getElementById('forumfix-tagcloud').appendChild(lo); imglo = new Image; imglo.src = 'http:///*--!{ http_host }!--*//devForum/hosted/loading.gif'; lotex = document.createElement('span'); lotex.setAttribute('style','margin-left:10px;'); lotex.setAttribute('id','forumfix-tagcloud-loadingtext'); lotex.innerHTML = 'Loading...'; lo.appendChild(imglo); lo.appendChild(lotex); var rdl_css = document.createElement('LINK'); rdl_css.setAttribute('REL','StyleSheet'); rdl_css.setAttribute('HREF','http:///*--!{ http_host }!--*//devForum/hosted/renderer.wordcloud.css'); rdl_css.setAttribute('TYPE','text/css'); rdl_css.setAttribute('MEDIA','screen'); statsBoxWrap.appendChild(rdl_css); var rdl_js = document.createElement('script'); rdl_js.setAttribute('language','javascript'); rdl_js.setAttribute('type','text/javascript'); rdl_js .setAttribute('src','http:///*--!{ http_host }!--*//devForum/hosted/tags_js.js'); document.body.appendChild(rdl_js); }	}

save(ForumFix);

function addGlobalStyle(css) { var head, style; head = document.getElementsByTagName('head')[0]; if (!head) { return; } style = document.createElement('style'); style.type = 'text/css'; style.innerHTML = css; head.appendChild(style); return true; }

var ffExtWarning = document.createElement('div'); ffExtWarning.setAttribute('style','position: fixed; left: 30%; width:40%; top: 30%; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-width: 2px; border-style: solid; border-color: rgb(34, 102, 170); z-index: 100; background-color: rgb(249, 249, 249); -webkit-box-shadow: rgb(119, 119, 119) 0px 0px 25px 0px; box-shadow: rgb(119, 119, 119) 0px 0px 25px; display: none;');

ffExtWarning.setAttribute('id','ff-externalurl-warning'); inhtml = ' You are leaving Nexon.net &gt;   Websites not owned by Nexon America may have different Privacy policies, or none at all. Offsite, you may not not protected by the Nexon America Terms of Use or EULA. <ul style="margin-top:5px;margin-bottom:5px; min-height:35px;font-size:13px;"> <li style="color:green;display:none;" id="external-url-secure">URL uses SSL Encryption.</li> <li style="color:red;display:none;" id="external-url-malformed">This URL appears to be malformed.</li> </ul> Your destination is: <span style="font-family: \'Courier New\',monospace; font-size: 11px; font-weight: bold; color: #622; word-break:break-all" id="external-url-fullurl"> http://javascript/archive_forum/thread.35.htm  .ff-button {	display: inline-block;font-family: Tahoma, Arial, Helvetica;background-color:#3F3F3F;border: 2px solid black;font-size: 15px;height: 17px;color:white;font-weight: bold;padding: 1px 3px 3px 3px;text-align: center;min-width: 75px;margin-left:6px;margin-top: 6px;}  Go </a> Cancel </a> '; ffExtWarning.innerHTML = inhtml; document.body.appendChild( ffExtWarning );

function closeUrlWarning{ ffExtWarning.style.display = 'none'; }

//alert( var_dump(Benchmarks) ); addGlobalStyle('.ForumPostUserContent { width: 200px !important; }'+       '.ForumPostUserPropertyList { padding: 0 0 0 0 !important; }'+        '.ForumPostUserName { margin:4px 0 0px !important; padding-left:0px !important; }');

//END FORUM MAIN }