// ==UserScript== // @name KOC Throne Room Organizer // @version 20140519a // @namespace mmm // @homepage http://userscripts.org:8080/scripts/show/411452 // @delay 2000 // @priority -10 // @include *.kingdomsofcamelot.com/*main_src.php* // @include *kabam.com/kingdoms-of-camelot/play* // @resource jqcss http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css // @icon https://kabam1-a.akamaihd.net/kingdomsofcamelot/fb/e2/src/img/throne/icons/70/briton_chair_normal_1.png // @require https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js // @require https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js // @grant unsafeWindow // @grant GM_getValue // @grant GM_setValue // @grant GM_addStyle // @grant GM_xmlhttpRequest // @grant GM_log // @grant GM_registerMenuCommand // @grant GM_getResourceText // @grant GM_getResourceURL // @description Organizes, upgrades and salvages KOC throne room items // @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZPJBNYUNXLLT4 // @downloadURL https://update.greasyfork.icu/scripts/2214/KOC%20Throne%20Room%20Organizer.user.js // @updateURL https://update.greasyfork.icu/scripts/2214/KOC%20Throne%20Room%20Organizer.meta.js // ==/UserScript== //var xx= {level: 2}; alert(CM.ThronePanelController.calcRiskBarWidth("upgrade", xx, 0)) var Version = '20140519a_Goat'; var trPopUpTopClass = 'trPopTop'; var ResetAll = false; var DEBUG_TRACE = false; var maxTrLevel = 17; /* * Modifiedd from object.watch polyfill * * 2012-04-03 * * By Eli Grey, http://eligrey.com * Public Domain. * NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. */ //This version has been updated to allow more than one updater function contentEval(source) { // Check for function input. if ('function' == typeof source) { // Execute this function with no arguments, by adding parentheses. // One set around the function, required for valid syntax, and a // second empty set calls the surrounded function. source = '(' + source + ')();' } // Create a script node holding this source code. var script = document.createElement('script'); script.setAttribute("type", "application/javascript"); script.textContent = source; // Insert the script node into the page, so it will run, and immediately // remove it to clean up. document.body.appendChild(script); document.body.removeChild(script); } function addWatchFunctions() { // object.watch if (!Object.prototype.multiWatch) { Object.defineProperty(Object.prototype, "multiWatch", { enumerable: false, configurable: true, writable: false, value: function (prop, watcher) { var obj = this, oldval = this[prop], newval = oldval, getter = function () { return newval; }, setter = function (val) { oldval = newval; for (var f=0; f < obj.watchers[prop].length; f++) { obj.watchers[prop][f](prop, oldval, val); } newval = val; return newval; }; if (delete obj[prop]) { // can't watch constants Object.defineProperty(this, prop, { get: getter, set: setter, enumerable: true, configurable: true }); if (!obj.watchers) obj.watchers = {}; if (!obj.watchers[prop]) obj.watchers[prop] = []; // check for duplicates for (var i=0; i < obj.watchers[prop].length; i++){ if(obj.watchers[prop][i] === watcher){ return; } } //obj.watchers[prop].push( eval(watcher)); //add the new watcher in the watchers array obj.watchers[prop].push(watcher); } } }); } // object.unwatch if (!Object.prototype.multiUnwatch) { Object.defineProperty(Object.prototype, "multiUnwatch", { enumerable: false, configurable: true, writable: false, value: function (prop, watcher) { var obj = this; // if a watcher is supplied, just remove it if(arguments.length == 2) { for(var i=0; i < obj.watchers[prop].length; i++){ var w = obj.watchers[prop][i]; if(w == watcher) { obj.watchers[prop].splice(i, 1); } } } else { obj.watchers[prop] = []; } if (obj.watchers[prop].length == 0 ) { delete obj.watchers[prop]; var val = this[prop]; delete this[prop]; // remove accessors this[prop] = val; } } }); } } //add the new functions to the main window contentEval(addWatchFunctions); //add the new functions to this script addWatchFunctions(); var JSON;if(!JSON){JSON={};}(function(){"use strict";function f(n){return n<10?'0'+n:n;}if(typeof Date.prototype.toJSON!=='function'){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+'-'+f(this.getUTCMonth()+1)+'-'+f(this.getUTCDate())+'T'+f(this.getUTCHours())+':'+f(this.getUTCMinutes())+':'+f(this.getUTCSeconds())+'Z':null;};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf();};}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==='string'?c:'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+string+'"';}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==='object'&&typeof value.toJSON==='function'){value=value.toJSON(key);}if(typeof rep==='function'){value=rep.call(holder,key,value);}switch(typeof value){case'string':return quote(value);case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null';}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==='[object Array]'){length=value.length;for(i=0;i Seed.cities.length -1 ) upgradeData.uCityNum = 0; if (upgradeData.sCityNum && upgradeData.sCityNum > Seed.cities.length -1 ) upgradeData.sCityNum = 0; readSalvageData(); readQueueData(); readPresetData(); readTagData(); logit ("Throne room organizer loaded"); installHandlerFunctions(); var styles = '.xtab {padding-right: 5px; border:none; background:none; white-space:nowrap;}\ .xtabBR {padding-right: 5px; border:none; background:none;}\ .aquaBorder { margin-right: -100%; margin-bottom: -100%; height: 72%; width: 72%; padding: 4%; border: 3px solid aqua; background: transparent;}\ .blackBorder { margin-right: -100%; margin-bottom: -100%; height: 72%; width: 72%; padding: 4%; border: 3px solid black; background: transparent;}\ .crimsonBorder { margin-right: -100%; margin-bottom: -100%; height: 72%; width: 72%; padding: 4%; border: 3px solid crimson; background: transparent;}\ .forestgreenBorder { margin-right: -100%; margin-bottom: -100%; height: 72%; width: 72%; padding: 4%; border: 3px solid forestgreen; background: transparent;}\ .fuchsiaBorder { margin-right: -100%; margin-bottom: -100%; height: 72%; width: 72%; padding: 4%; border: 3px solid fuchsia; background: transparent;}\ .greenBorder { margin-right: -100%; margin-bottom: -100%; height: 72%; width: 72%; padding: 4%; border: 3px solid cyan; background: transparent;}\ .khakiBorder { margin-right: -100%; margin-bottom: -100%; height: 72%; width: 72%; padding: 4%; border: 3px solid khaki; background: transparent;}\ .limeBorder { margin-right: -100%; margin-bottom: -100%; height: 72%; width: 72%; padding: 4%; border: 3px solid lime; background: transparent;}\ .maroonBorder { margin-right: -100%; margin-bottom: -100%; height: 72%; width: 72%; padding: 4%; border: 3px solid maroon; background: transparent;}\ .orangeBorder { margin-right: -100%; margin-bottom: -100%; height: 72%; width: 72%; padding: 4%; border: 3px solid orange; background: transparent;}\ .purpleBorder { margin-right: -100%; margin-bottom: -100%; height: 72%; width: 72%; padding: 4%; border: 3px solid purple; background: transparent;}\ .redBorder { margin-right: -100%; margin-bottom: -100%; height: 72%; width: 72%; padding: 4%; border: 3px solid red; background: transparent;}\ .salmonBorder { margin-right: -100%; margin-bottom: -100%; height: 72%; width: 72%; padding: 4%; border: 3px solid salmon; background: transparent;}\ .silverBorder { margin-right: -100%; margin-bottom: -100%; height: 72%; width: 72%; padding: 4%; border: 3px solid silver; background: transparent;}\ .siennaBorder { margin-right: -100%; margin-bottom: -100%; height: 72%; width: 72%; padding: 4%; border: 3px solid sienna; background: transparent;}\ .skyblueBorder { margin-right: -100%; margin-bottom: -100%; height: 72%; width: 72%; padding: 4%; border: 3px solid skyblue; background: transparent;}\ .slateblueBorder { margin-right: -100%; margin-bottom: -100%; height: 72%; width: 72%; padding: 4%; border: 3px solid slateblue; background: transparent;}\ .slategrayBorder { margin-right: -100%; margin-bottom: -100%; height: 72%; width: 72%; padding: 4%; border: 3px solid slategray; background: transparent;}\ .tealBorder { margin-right: -100%; margin-bottom: -100%; height: 72%; width: 72%; padding: 4%; border: 3px solid teal; background: transparent;}\ .whiteBorder { margin-right: -100%; margin-bottom: -100%; height: 72%; width: 72%; padding: 4%; border: 3px solid white; background: transparent;}\ .yellowgreenBorder { margin-right: -100%; margin-bottom: -100%; height: 72%; width: 72%; padding: 4%; border: 3px solid yellowgreen; background: transparent;}\ div.greenBorder2 {position: absolute; }\ .semi_transparent { zoom: 1; filter: alpha(opacity=60); opacity: 0.6;} \ .rot45 { transform: rotate(-45deg); -ms-transform: rotate(-45deg); -webkit-transform: rotate(-45deg); -o-transform: rotate(-45deg); -moz-transform: rotate(-45deg); -moz-transform-origin: 100% 100%; z-index: 10;}\ div.cardOverlay { font: cracked; font-size:3.5em; position: absolute; left: 0%; top: 50%; color: red; text-align: center; text-shadow: 2px 2px 4px #000;} \ body table.trMainTab tbody tr td {background: transparent;}\ table.trTabdef { height: 0px;}\ .trCardDisp { display: static;}\ table.trTabDef thead {background: transparent;}\ table.trPopMain tbody tr td,th {background: transparent;}\ table.trTabDef tbody tr td {background: transparent; height: 0px; }\ table.trTab tr td, th { border: 1px solid brown;}\ #tr_footer {height: 50px; background: url("https://kabam1-a.akamaihd.net/kingdomsofcamelot/fb/e2/src/img/dialog_740_r3_c1.jpg") scroll no-repeat center bottom;}\ #tr_footer { background-size: cover; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; }\ table.trTab tr td,th {border:none; background:none; padding: 0px}\ table.trTab#trDisplayTable tr th { border: 3px solid grey; font-size:1.2em; }\ table.trStatTab tr td { background-color: #ffffff; white-space:nowrap; padding:5px; border-bottom:solid black 1px;}\ table.trStatTab tr td:last-child { border-right:solid black 1px; }\ table.trStatTab tr:first-child th { border-top:solid black 1px; }\ table.trStatTab tr td.td0 { background-color: white; }\ table.trStatTab tr td.td1 { background-color: #eeeeee; }\ table.trStatTab tr td.td2 { background-color: white; }\ table.trStatTab tr th {border:solid black 1px; border-top: none; background-color: #357; color: white; white-space:nowrap; padding:5px}\ table.trStatTab tr:last-child td:first-child, table.trStatTab tr:last-child th:first-child { -moz-border-radius-bottomleft:10px; -webkit-border-bottom-left-radius:10px; border-bottom-left-radius:10px} \ table.trStatTab tr:last-child td:last-child, table.trStatTab tr:last-child th:last-child { -moz-border-radius-bottomright:10px; -webkit-border-bottom-right-radius:10px; border-bottom-right-radius:10px} \ table.trStatTab tr:first-child th:first-child { -moz-border-radius-topleft:10px; -webkit-border-top-left-radius:10px; border-top-left-radius:10px} \ table.trStatTab tr:first-child th:last-child { -moz-border-radius-topright:10px; -webkit-border-top-right-radius:10px; border-top-right-radius:10px} \ table.trTabLined tbody tr td {border-bottom:1px solid gray; padding: 2px 5px; }\ table.trOptions tr td,th {border:1px none none solid none; padding: 1px 3px; white-space:nowrap;}\ table.trSrchResults tr td,th {border:1px none none solid none; padding: 1px 3px; white-space:nowrap;}\ table.trTabSome tr td,th {border:none; background:none; padding: 1px 3px; white-space:nowrap;}\ table.trTabPad tr td,th { padding-left: 2px; background: none;}\ table.trTabPad2 tr td,th { padding-left: 20px; background: none;}\ .trDetLeft {padding:0 5px 0 0 !important; font-weight:bold; text-align:right}\ .trStat {border:1px solid; border-color:#000000; font-weight:bold; padding-top:2px; padding-bottom:2px; text-align:center; color:#ffffff ; background-color:#357; -moz-border-radius:5px;}\ .trentry {padding: 7px; white-space:nowrap;}\ button::-moz-focus-inner, input[type="submit"]::-moz-focus-inner { border: none; }\ button::-moz-focus-inner, input[type="button"]::-moz-focus-inner { border: none; }\ .castleBut {outline:0px; margin-left:0px; margin-right:0px; width:24px; height:26px; font-size:12px; font-weight:bold;}\ .castleBut:hover {background-image:url("'+ URL_CASTLE_BUT_SEL +'")}\ .castleButNon {background-image:url("'+ URL_CASTLE_BUT +'")}\ .castleButSel {background-image:url("'+ URL_CASTLE_BUT_SEL +'")}\ input.trDefButOn {cursor:pointer; border:1px solid #45d183; -moz-box-shadow:inset 0px 1px 5px #3aef8b; -moz-border-radius:5px;}\ input.trDefButOff {cursor:pointer; border:1px solid #f61646; -moz-box-shadow:inset 0px 1px 5px #f6375f; -moz-border-radius:5px;}\ table.trMainTab { empty-cells: show; }\ table.trMainTab tr td,th a {color:inherit }\ table.trMainTab tr td,th {height:60%; empty-cells:show; padding: 0px 0px 0px 0px; margin-top:5px; white-space:nowrap; border: 1px solid; border-style: none none solid none; -moz-border-radius:5px; }\ table.trMainTab tr td.spacer,th.space {padding: 0px 0px;}\ table.trMainTab tr th.sel,td.sel {font-weight:bold; font-size:13px; }\ table.trMainTab tr th.notSel,td.notSel {font-weight:bold; font-size:13px; }\ tr.trPopTop td,th { background-color:transparent; border:none; height: 21px; padding:0px;}\ .trPopMain { -moz-box-shadow:inset 0px 0px 10px #6a6a6a; -moz-border-radius-bottomright: 20px; -moz-border-radius-bottomleft: 20px;}\ .trPopup { border:3px ridge #666; opacity:'+upgradeData.Opacity+'; -moz-border-radius:25px; -moz-box-shadow: 1px 1px 5px #000000;}\ .trPopup { overflow-x: hide; overflow-y: hide; max-height: 900px; min-height: 400px; height: 500px; }\ #tr_top { background: url("https://kabam1-a.akamaihd.net/kingdomsofcamelot/fb/e2/src/img/dialog_740_r2_c1.jpg") no-repeat transparent 0% 0%; }\ #tr_top { background-size: cover; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; }\ /* this was needed because the css used a object id and not a class. reusing the ID caused display issues w/ the TR tooltips */ \ div.trCard {width: 200px;}\ div.trCard div.description>div{width:70px;height:70px; }\ div.trCard div.description div.briton.advisor{background:transparent url("https://kabam1-a.akamaihd.net/kingdomsofcamelot/fb/e2/src/img/throne/icons/70/briton_advisor_normal_1.png") top left no-repeat;}\ div.trCard div.description div.briton.banner{background:transparent url("https://kabam1-a.akamaihd.net/kingdomsofcamelot/fb/e2/src/img/throne/icons/70/briton_banner_normal_1.png") top left no-repeat;}\ div.trCard div.description div.briton.chair{background:transparent url("https://kabam1-a.akamaihd.net/kingdomsofcamelot/fb/e2/src/img/throne/icons/70/briton_chair_normal_1.png") top left no-repeat;}\ div.trCard div.description div.briton.table{background:transparent url("https://kabam1-a.akamaihd.net/kingdomsofcamelot/fb/e2/src/img/throne/icons/70/briton_table_normal_1.png") top left no-repeat;}\ div.trCard div.description div.briton.window{background:transparent url("https://kabam1-a.akamaihd.net/kingdomsofcamelot/fb/e2/src/img/throne/icons/70/briton_window_normal_1.png") top left no-repeat;}\ div.trCard div.description div.briton.trophy{background:transparent url("https://kabam1-a.akamaihd.net/kingdomsofcamelot/fb/e2/src/img/throne/icons/70/briton_trophy_normal_1_5.png") top left no-repeat;}\ div.trCard div.description div.briton.hero{background:transparent url("https://kabam1-a.akamaihd.net/kingdomsofcamelot/fb/e2/src/img/throne/icons/70/briton_hero_normal_1_5.png") top left no-repeat;}\ div.trCard div.description div.briton.statue{background:transparent url("https://kabam1-a.akamaihd.net/kingdomsofcamelot/fb/e2/src/img/throne/icons/70/briton_statue_normal_1_5.png") top left no-repeat;}\ div.trCard div.description div.briton.candelabrum{background:transparent url("https://kabam1-a.akamaihd.net/kingdomsofcamelot/fb/e2/src/img/throne/icons/70/briton_candelabrum_normal_1_5.png") top left no-repeat;}\ div.trCard div.description div.briton.pet{background:transparent url("https://kabam1-a.akamaihd.net/kingdomsofcamelot/fb/e2/src/img/throne/icons/70/briton_pet_normal_1_5.png") top left no-repeat;}\ div.trCard div.description div.druid.advisor{background:transparent url("https://kabam1-a.akamaihd.net/kingdomsofcamelot/fb/e2/src/img/throne/icons/70/druid_advisor_normal_1.png") top left no-repeat;}\ div.trCard div.description div.druid.banner{background:transparent url("https://kabam1-a.akamaihd.net/kingdomsofcamelot/fb/e2/src/img/throne/icons/70/druid_banner_normal_1.png") top left no-repeat;}\ div.trCard div.description div.druid.chair{background:transparent url("https://kabam1-a.akamaihd.net/kingdomsofcamelot/fb/e2/src/img/throne/icons/70/druid_chair_normal_1.png") top left no-repeat;}\ div.trCard div.description div.druid.table{background:transparent url("https://kabam1-a.akamaihd.net/kingdomsofcamelot/fb/e2/src/img/throne/icons/70/druid_table_normal_1.png") top left no-repeat;}\ div.trCard div.description div.druid.window{background:transparent url("https://kabam1-a.akamaihd.net/kingdomsofcamelot/fb/e2/src/img/throne/icons/70/druid_window_normal_1.png") top left no-repeat;}\ div.trCard div.description div.druid.trophy{background:transparent url("https://kabam1-a.akamaihd.net/kingdomsofcamelot/fb/e2/src/img/throne/icons/70/druid_trophy_normal_1_5.png") top left no-repeat;}\ div.trCard div.description div.druid.hero{background:transparent url("https://kabam1-a.akamaihd.net/kingdomsofcamelot/fb/e2/src/img/throne/icons/70/druid_hero_normal_1_5.png") top left no-repeat;}\ div.trCard div.description div.druid.statue{background:transparent url("https://kabam1-a.akamaihd.net/kingdomsofcamelot/fb/e2/src/img/throne/icons/70/druid_statue_normal_1_5.png") top left no-repeat;}\ div.trCard div.description div.druid.pet{background:transparent url("https://kabam1-a.akamaihd.net/kingdomsofcamelot/fb/e2/src/img/throne/icons/70/druid_pet_normal_1_5.png") top left no-repeat;}\ div.trCard div.description div.druid.candelabrum{background:transparent url("https://kabam1-a.akamaihd.net/kingdomsofcamelot/fb/e2/src/img/throne/icons/70/druid_candelabrum_normal_1_5.png") top left no-repeat;}\ div.trCard div.description div.fey.advisor{background:transparent url("https://kabam1-a.akamaihd.net/kingdomsofcamelot/fb/e2/src/img/throne/icons/70/fey_advisor_normal_1.png") top left no-repeat;}\ div.trCard div.description div.fey.banner{background:transparent url("https://kabam1-a.akamaihd.net/kingdomsofcamelot/fb/e2/src/img/throne/icons/70/fey_banner_normal_1.png") top left no-repeat;}\ div.trCard div.description div.fey.chair{background:transparent url("https://kabam1-a.akamaihd.net/kingdomsofcamelot/fb/e2/src/img/throne/icons/70/fey_chair_normal_1.png") top left no-repeat;}\ div.trCard div.description div.fey.table{background:transparent url("https://kabam1-a.akamaihd.net/kingdomsofcamelot/fb/e2/src/img/throne/icons/70/fey_table_normal_1.png") top left no-repeat;}\ div.trCard div.description div.fey.window{background:transparent url("https://kabam1-a.akamaihd.net/kingdomsofcamelot/fb/e2/src/img/throne/icons/70/fey_window_normal_1.png") top left no-repeat;}\ div.trCard div.description div.fey.trophy{background:transparent url("https://kabam1-a.akamaihd.net/kingdomsofcamelot/fb/e2/src/img/throne/icons/70/fey_trophy_normal_1_5.png") top left no-repeat;}\ div.trCard div.description div.fey.hero{background:transparent url("https://kabam1-a.akamaihd.net/kingdomsofcamelot/fb/e2/src/img/throne/icons/70/fey_hero_normal_1_5.png") top left no-repeat;}\ div.trCard div.description div.fey.statue{background:transparent url("https://kabam1-a.akamaihd.net/kingdomsofcamelot/fb/e2/src/img/throne/icons/70/fey_statue_normal_1_5.png") top left no-repeat;}\ div.trCard div.description div.fey.candelabrum{background:transparent url("https://kabam1-a.akamaihd.net/kingdomsofcamelot/fb/e2/src/img/throne/icons/70/fey_candelabrum_normal_1_5.png") top left no-repeat;}\ div.trCard div.description div.fey.pet{background:transparent url("https://kabam1-a.akamaihd.net/kingdomsofcamelot/fb/e2/src/img/throne/icons/70/fey_pet_normal_1_5.png") top left no-repeat;}\ div.trCard{font:bold 16px Georiga; overflow: hidden;}\ div.trCard>div{float:left;border:1px solid #a56631;margin:0px;padding:0px;width:200px; height: 300px;background:transparent url("https://kabam1-a.akamaihd.net/kingdomsofcamelot/fb/e2/src/img/modal/modal_med_bg_4.png") -200px 0 no-repeat;}\ div.trCard div.title{font:bold 16px Georgia;border-bottom:1px solid #703200;padding:4px 3px 5px 8px;background:transparent url("https://kabam1-a.akamaihd.net/kingdomsofcamelot/fb/e2/src/img/throne/panel/modal/item_bg.png") -20px -100px no-repeat;}\ div.trCard div.title span.icon{background:transparent url("https://kabam1-a.akamaihd.net/kingdomsofcamelot/fb/e2/src/img/throne/modal/equip.png") top right no-repeat;display:block;height:20px;width:20px;top:12px;right:12px;position:absolute;}\ div.trCard .disabled{opacity:.5;}\ div.trCard ul{margin:0px;padding:0;list-style:none;}\ div.trCard li{padding:0px 0 0 0px;color:#3f2300;font-weight:bold;font-size:16px;}\ div.trCard div.description{overflow:hidden;border-bottom:1px solid #703200;padding:5px 0;}\ div.trCard div.description{overflow:hidden;border-bottom:1px solid #703200;}\ div.trCard div.description div.portrait{float:left;}\ div.trCard div.description div.portrait{border:3px solid #deaf69;margin-right:10px;}\ div.trCard div.description>ul{float:left;margin:3px 0 0 0;padding:0;}\ div.trCard div.description>ul li{padding:0;font-weight:bold;font-size:13px;text-transform:capitalize;}\ div.trRule {border:2px inset #c0c0c0; margin-right:10px; margin-left:10px; margin-bottom:2px; padding-left:5px; padding-bottom:5px} \ div.trRuleCreate {margin-right:10px; padding-right: 5px; margin-bottom:2px; padding-bottom:5px} \ div.trRule { background-color: #eeeeee; } \ div.blueBorder { border: 2px solid blue; } \ div.blueBorder2 { border: 10px solid blue; } \ div.yellowBorder { outline: 2px solid yellow; outline-offset:0px; }\ div.yellowBorder2 { outline: 10px solid yellow; outline-offset:0px; }\ #trhammer { background-image: url("https://kabam1-a.akamaihd.net/kingdomsofcamelot/fb/e2/src/img/throne/modal/sm_hammer.png"); background-repeat: no-repeat; background-color: transparent; display: inline-block; width: 28px; height: 32px; margin: 2px; vertical-align: middle;}\ div.trhammer { background-image: url("https://kabam1-a.akamaihd.net/kingdomsofcamelot/fb/e2/src/img/throne/modal/sm_hammer.png"); background-repeat: no-repeat; background-color: transparent; display: inline-block; width: 28px; height: 32px; margin: 2px; vertical-align: middle;}\ div.trbroken { background-image: url("https://kabam1-a.akamaihd.net/kingdomsofcamelot/fb/e2/src/img/throne/modal/sm_fail_overlay.png"); background-repeat: no-repeat; background-color: transparent; display: inline-block; width: 28px; height: 32px; margin: 2px; vertical-align: middle;}\ div.trsuccess { background-image: url('+ success_image +'); background-repeat: no-repeat; background-color: transparent; display: inline-block; width: 28px; height: 32px; margin: 2px; vertical-align: middle;}\ div.trup { display=inline; background-image: url('+ up_img +'); background-repeat: no-repeat; background-color: transparent; width: 28px; height: 24px; }\ div.trup:hover { display=inline; background-image: url('+ up_glow +'); background-repeat: no-repeat; background-color: transparent; width: 28px; height: 24px; }\ div.trremove { display=inline; background-image: url('+ remove_img +'); background-repeat: no-repeat; background-color: transparent; width: 50px; height: 50px; }\ div.trremove:hover { display=inline; background-image: url('+ remove_glow +'); background-repeat: no-repeat; background-color: transparent; width: 50px; height: 50px; }\ div.trdown { display=inline; background-image: url('+ down_img +'); background-repeat: no-repeat; background-color: transparent; width: 28px; height: 24px; }\ div.trdown:hover { display=inline; background-image: url('+ down_glow +'); background-repeat: no-repeat; background-color: transparent; width: 28px; height: 24px; }\ div.trgbtn { display=inline; background-image: url('+ gbtn_img +'); background-repeat: no-repeat; background-color: transparent; width: 32px; height: 32px; margin: 0px; }\ ul#MM_throneStatList li { float: left; width: 22px; height: 22px; text-align: center; color: white; }\ ul#MM_throneStatList li.active { background: transparent url("https://kabam1-a.akamaihd.net/kingdomsofcamelot/fb/e2/src/img/throne/modal/set_active.png") top left no-repeat; } \ ul#MM_throneStatList li.selected { background: transparent url("https://kabam1-a.akamaihd.net/kingdomsofcamelot/fb/e2/src/img/throne/modal/set_selected.png") top left no-repeat; }\ ul#MM_throneStatList li.locked { background: transparent url("https://kabam1-a.akamaihd.net/kingdomsofcamelot/fb/e2/src/img/throne/modal/set_locked.png") top left no-repeat; text-indent: -999px; }\ ul#MM_throneStatList li.buy { background: transparent url("https://kabam1-a.akamaihd.net/kingdomsofcamelot/fb/e2/src/img/throne/modal/set_buy.png") top left no-repeat; text-indent: -999px; }\ #trQueue th { text-align: center; }\ a.loadGPreset { border-radius:5px; border-style: solid; border-width: 3px; }\ div.indent25 {padding-left:25px}\ li.guardbutton { border: 4px inset Peru; display: inline; float: left; width: 31px; height: 33px; text-align: center; color: white; }\ li.guardbutton.active { border: 4px solid blue;}\ li.guardbutton:hover div.tt { visibility: visible;}\ li.guardbutton div.tt { visibility: hidden; border-radius: 5px 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px;\ box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.1); -webkit-box-shadow: 5px 5px rgba(0, 0, 0, 0.1); -moz-box-shadow: 5px 5px rgba(0, 0, 0, 0.1);\ font-family: Calibri, Tahoma, Geneva, sans-serif; font-weight: normal;\ position: relative; left: -30px; top: 50px; \ margin-left: 0; width: 200px; background-color: white; color: black;\ background: #FFFFAA; border: 1px solid #FFAD33; padding: 0.8em 1em;}\ #preset_tt {margin-left: -999em; position: absolute;}\ #preset_tt.showit { border-radius: 5px 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px;\ box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.1); -webkit-box-shadow: 5px 5px rgba(0, 0, 0, 0.1); -moz-box-shadow: 5px 5px rgba(0, 0, 0, 0.1);\ font-family: Calibri, Tahoma, Geneva, sans-serif; font-weight: normal;\ position: absolute; left: 400px; top: 100px; z-index: 99;\ margin-left: 0; width: 200px; background-color: white; color: black;\ background: #FFFFAA; border: 1px solid #FFAD33; padding: 0.8em 1em;}'; window.name = 'TR'; if (upgradeData.trWinPos==null || upgradeData.trWinPos.x==null || upgradeData.trWinPos.x=='' || isNaN(upgradeData.trWinPos.x)){ var c = getClientCoords (document.getElementById('main_engagement_tabs')); upgradeData.trWinPos.x = 100; upgradeData.trWinPos.y = 100; saveUpgradeData(); } var newCSS = GM_getResourceText ("jqcss"); GM_addStyle (newCSS); GM_addStyle (styles); // clear some styles var styles2 = ".trDiag .ui-widget-content { font-size: 1.0em; background: none; border: none;}" + ".trDiag.ui-widget-content { font-size: 0.95em; background: none; border: none;}" + ".trDiag .ui-tabs .ui-tabs-nav li a { font-weight: bold; font-family: georgia,arial,sans-serif; color: white; font-size: 1.0em; background: url('https://kabam1-a.akamaihd.net/kingdomsofcamelot/fb/e2/src/img/tab_unselected.png') no-repeat scroll 0% 0% transparent;}" + ".trDiag .ui-tabs .ui-tabs-nav li.ui-tabs-active a { background: url('https://kabam1-a.akamaihd.net/kingdomsofcamelot/fb/e2/src/img/tab_selected.png') no-repeat scroll 0% 0% transparent;}" + ".trDiag .ui-widget-content a { color: white;}" + ".trDiag a.buttonDown20 span { color: white;}" + ".trDiag .ui-widget {font-size: 1.0em;}" + ".trDiag.ui-dialog .ui-dialog-title {margin: 0px; width: 100%;}" + ".trDiag .ui-widget-header {background: none; border: none;}" + ".trDiag .ui-state-deafault {background-color: none; }" + ".trDiag .ui-widget .ui-widget {font-size: 0.9em;}" + ".trDiag .ui-dialog-titlebar {text-shadow: 0px 1px 0px white; line-height: 24px; text-align: center; color: #5C3317; font: bold 1.3em Georiga;}" + '.trDiag.ui-dialog .ui-dialog-titlebar-close { background-position: 0px 0px; background-image: url("https://kabam1-a.akamaihd.net/kingdomsofcamelot/fb/e2/src/img/close_icon.png"); background-repeat: no-repeat; height: 20px; width: 20px; }' + ".trDiag.ui-dialog .ui-dialog-titlebar-close { width: 20px; height: 20px;}" + ".trDiag .ui-resizable-s { background: rgba(0,0,255,0.3);}" + ".trDiag .ui-tabs .ui-tabs-nav { position: relative; top: 10px; left: 15px;}" + "table.trTable tbody tr td { background: none;}"; GM_addStyle(styles2); var prefix = 'tr'; var topClass = 'trPopTop'; $("#mainbody").append( "
" + '' + '' + '' + '
'); $("#tr_dialog").css({ "overflow-y": "hidden", "overflow-x": "hidden", "padding": '0px' }); var trPop = null; var tStr= 'Throne Room Organizer'; $("#tr_dialog").dialog({ title: tStr, //zIndex: 111111, position: [ upgradeData.trWinPos.x, upgradeData.trWinPos.y], draggable: true, height: "auto", maxHeight: 2000, minHeight: 300, width: "auto", resizable: false, autoOpen: upgradeData.trWinIsOpen, dragStop: function( event, ui ) { upgradeData.trWinPos.x = ui.position.left; upgradeData.trWinPos.y = ui.position.top; saveUpgradeData(); }, close: function( event, ui ) { upgradeData.trWinIsOpen = false; saveUpgradeData(); }, open: function( event, ui ) { $("#tr_dialog").parent().css('z-index', 111111 ); if (trPop) trPop.focusMe(); } }); $("#tr_dialog").css('max-height', '2000px'); $("#tr_dialog").parent().attr( {id: 'tr_top', padding: '0px'}); mainPop = $("#tr_top")[0]; $("div#tr_bar").css( {background: 'none', border: 'none'} ); $("#tr_top").addClass('trDiag'); var mainDiv = $("#tr_top")[0]; trPop = new trPopup('tr'); // block the copy/paste stuff added by sharethis var a = document.getElementsByTagName("body")[0]; a.oncopy = function () { return true;} setCities(); CM.cheatDetector.detect = foo; $("#tr_main").html( '
\ \
Options tab
\
Salvage tab
\
Organize tab
\
Options tab
\
Caps tab
\
Tags tab
\
Jewels tab
\
Log tab
\
'); $("#tr_main").tabs({ heightStyle: "content", active: upgradeData.activeTab, beforeActivate: function( event, ui ) { if (ui.oldPanel && ui.oldPanel[0]) { tab = findTab(ui.oldPanel[0]); if (tab) { Tabs[tab].hide(); } } if (ui.newPanel && ui.newPanel[0]) { var tab = findTab(ui.newPanel[0]); if (tab) Tabs[tab].show(); } } }); // set the width of all main tab divs /* $("#tr_main>div").css({ "width": "auto", "padding": "0px" }); */ window.addEventListener('unload', onUnload, false); Tabs.options.init($("#tabs-options")[0]); Tabs.trActionLog.init($("#tabs-log")[0]); Tabs.upgrader.init($("#tabs-upgrade")[0]); Tabs.throneSalvage.init($("#tabs-salvage")[0]); Tabs.organizer.init($("#tabs-organize")[0]); Tabs.caps.init($("#tabs-caps")[0]); Tabs.tags.init($("#tabs-tags")[0]); Tabs.jewels.init($("#tabs-jewels")[0]); $( "#tr_main" ).tabs( "refresh" ); AddMainTabLink('TR Organizer', trHideShow, trMainTab); attachTab(); // set the labels on the new salvage tab /* $("a.throne").click( function() { Tabs.throneSalvage.updateTRTab(); Tabs.upgrader.updateTRTab(); //Tabs.upgrader.updateTRSelect(); $("ul#throneInventoryList > li > div").removeClass('blueBorder'); $("ul#throneInventoryList > li > div").removeClass('yellowBorder'); $("div#throneMainContainer div#heroContainer").css('left', '450px'); for (ii in queueData.list) { var list_item = queueData.list[ii]; if (!list_item) continue; if (list_item.status != "complete") { var id = list_item.item; if (list_item.action == "upgrade") $("div#throneInventoryItem" + id).addClass('blueBorder'); if (list_item.action == "enhance") $("div#throneInventoryItem" + id).addClass('yellowBorder'); } } for (ii in presetData.taggedItems) { $("div#throneInventoryItem" + ii).prepend("
"); } $("ul#throneInventoryList").css('height', '520px'); $("div#throneInventoryContainer").css('height', '520px'); // update the other presets buttons when clicked $('ul#throneStatList li.active, ul#throneStatList li.selected').click( function () { var s = $(this).attr('id').split('throneInventoryPreset')[1]; setPresetWidget(+s); }); }); */ // create a preset list on the main display. Wait 2 seconds for the chat-on-right to fire first. if (upgradeData.presetWidget) setTimeout(buildPresetWidget,2000); // set the color on the tab button setUpgradeColor(); trDispTimer = setInterval(updateTimerDisp , 1000); } var foo = function() { }; function setUpgradeColor() { if (upgradeData.newUpgradeState == 0) $("#trtab>span").css('color', '#FFFF66'); else if (upgradeData.newUpgradeState == 1) $("#trtab>span").css('color', 'cyan'); else if (upgradeData.newUpgradeState == 2) $("#trtab>span").css('color', 'red'); } var presetTimer = null; var presetFailures = 0; //callback handler when a preset button is presed function processPresetClick(btn) { // if there is a timer still running, kill it clearTimeout(presetTimer); // don't do anything if already the right preset if (btn == Seed.throne.activeSlot) { // redarw everything setPresetWidget(btn); unsafeWindow.cm.ThroneView.renderThrone(); unsafeWindow.cm.ThroneView.renderStats(); Tabs.organizer.show(); //return; } // send message unsafeWindow.AjaxCall.gPostRequest( "ajax/_dispatch53.php", { ctrl: "throneRoom\\ThroneRoomServiceAjax", action: "setPreset", presetId: btn }, function (v) { if (v.ok === true) { presetFailures = 0; // success var H = Seed.throne.slotEquip[btn]; Seed.throne.activeSlot = btn; // set the right items as equiped $.each(unsafeWindow.kocThroneItems, function (I, J) { C = $.inArray(J.id, H) > -1; if (C) { J.isEquipped = true; } else { J.isEquipped = false; } }); // update the buttons setPresetWidget(btn); unsafeWindow.cm.ThroneView.renderThrone(); unsafeWindow.cm.ThroneView.renderStats(); // redraw the organizer tab Tabs.organizer.show(); } else { presetFailures++; logit("Preset change failed. Error code: " + v.error_code); // try again in 2 seconds if (presetFailures <=10) { presetTimer = setTimeout( function () {processPresetClick(btn)}, 2000); } else { // after 10 failures, give up presetFailures = 0; } } } ); } //handler when a guardian button is presed function processGuardianClick(type) { // callback. only called when successful var cb = function(h) { // set the outline and turn the background gray var btn = "li.guardbutton." + type; $("li.guardbutton").removeClass('active'); $(btn).css('background-color', 'darkgray'); $(btn).addClass('active'); // after lockout time is complete, redraw the control var timeLeft = h.finishTime - unixTime(); setTimeout( function () { h.summonFinishCallback(type, unsafeWindow.cm.guardianSummonModel.getSummonGuardian()); $(btn).css('background-color', 'white'); drawGuardWidget(); }, (timeLeft + 1.0)* 1000); }; // change guardian unsafeWindow.cm.guardianSummonModel.summon(type, cb) } //update the preset list buttons function setPresetWidget(slot) { var x = ($("#MM_throneStatList .selected, #throneStatList .selected")); x.removeClass('selected'); x.addClass('active'); x.bind("mouseenter", function (I) { unsafeWindow.cm.ThroneView.boostsTooltip(this, I, I.target.id) }); x.bind("mouseleave", function (I) { unsafeWindow.removeTooltip() }); var s = $("#MM_throneInventoryPreset" + slot + ", #throneInventoryPreset" + slot); s.removeClass('active'); s.addClass('selected') s.unbind("mouseenter").unbind("mouseleave"); $("a.loadGPreset").css('border-color', 'transparent'); $("#trPresetNum" + slot ).css('border-color', 'green'); document.getElementById ('PresetList').value = slot; Tabs.organizer.selectPreset(slot); } //create a preset list on the main display function buildPresetWidget() { var E = []; var J = Seed.throne.activeSlot; var F = Seed.throne.slotNum; for (var G = 0; G < 16; ++G) { var H = G + 1; var I = $("
  • "); if (H === J) { I.attr("id", "MM_throneInventoryPreset" + H); I.addClass("selected"); I.html(H); I.bind("click", { idx: G }, function (K) { var L = K.data.idx + 1; processPresetClick(L); }); } else { if (H === (F + 1)) { I.attr("id", "MM_throneInventoryPreset" + H); I.addClass("buy"); I.bind("click", function () { unsafeWindow.cm.ContextualMenuThrone.renderMenu(this, null); }) } else { if (H <= F) { I.attr("id", "MM_throneInventoryPreset" + H); I.addClass("active"); I.html(H); I.bind("click", { idx: G }, function (K) { var L = K.data.idx + 1; processPresetClick(L); }); I.bind("mouseenter", function (K) { unsafeWindow.cm.ThroneView.boostsTooltip(this, K, K.target.id) }); I.bind("mouseleave", function (K) { unsafeWindow.removeTooltip() }) } else { I.attr("id", "MM_throneInventoryPreset" + H); I.addClass("locked"); } } } E.push(I) } var C = $("