GOTA_Extender_Constants

Constants definition.

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://update.greatest.deepsurf.us/scripts/5427/70467/GOTA_Extender_Constants.js

  1. var templates = {
  2. menuBtn:
  3. '<a id="extender-menu" class="navlink" data-menu="manager">' +
  4. '<span class="navlinkbox">' +
  5. '<span class="navlinkicon"></span>' +
  6. '<span class="vertcenter">' +
  7. '<span>Extender</span>' +
  8. '</span>' +
  9. '</span>' +
  10. '</a>',
  11.  
  12. findGifts: function(start, end) {
  13. return '<div class="exrow"><span id="find_gifts" class="btnwrap btnlg exBtn" onclick="findGifts(event)">' +
  14. '<span class="btnedge"><a class="btngold">Find Gifts</a></span>' +
  15. '</span>Range of offers: ' +
  16. '<div class="contribcount">' +
  17. '<input type="text" id="offerIdRangeStart" onkeypress="return isNumberKeyPressed(event)" value="'+ start +'" maxlength="3" name="quantity" style="height: auto;">' +
  18. '<a id="excountup" onclick="inputIncrement(this)"></a><a id="excountdown" onclick="inputIncrement(this)"></a></div>' +
  19. '&nbsp;-&nbsp;<div class="contribcount">' +
  20. '<input type="text" id="offerIdRangeEnd" onkeypress="return isNumberKeyPressed(event)" value="'+ end +'" maxlength="3" name="quantity" style="height: auto;">' +
  21. '<a id="excountup" onclick="inputIncrement(this)"></a><a id="excountdown" onclick="inputIncrement(this)"></a></div></div>'
  22. },
  23.  
  24. sendAllBtn:
  25. '<span id="adventureSendAll" class="btnwrap btnsm exSendAllButton">' +
  26. '<span class="btnedge">' +
  27. '<a onclick="adventureSendAll(userContext.adventureData.symbol, getSwornSwords(extender.options.sendAllAction));" class="btnbrown">' +
  28. '<span></span>Send All</a></span></span>',
  29.  
  30. pvpSendAllBtn:
  31. '<span id="pvpSendAll" class="btnwrap btnsm exSendAllButton">' +
  32. '<span class="btnedge">' +
  33. '<a onclick="pvpSendBatch(getSwornSwords(extender.options.sendAllAction));" class="btnbrown">' +
  34. '<span></span>Send All</a></span></span>',
  35.  
  36. avaSendAllBtn:
  37. '<span id="avaSendAll" class="btnwrap btnsm exSendAllButton">' +
  38. '<span class="btnedge">' +
  39. '<a onclick="avaSendAll_onclick" class="btnbrown">' +
  40. '<span></span>Send All</a></span></span>',
  41.  
  42. queueBtn:
  43. '<span class="btnwrap btnmed equipbtn queue" data-quantity="1">' +
  44. '<span class="btnedge">' +
  45. '<a class="btngold">Queue</a>' +
  46. '</span>' +
  47. '</span>',
  48.  
  49. queue5Btn:
  50. '<span class="btnwrap btnmed equipbtn queue" data-quantity="5">' +
  51. '<span class="btnedge">' +
  52. '<a class="btngold">Queue x5</a>' +
  53. '</span>' +
  54. '</span>',
  55.  
  56. queueUpgradeBtn:
  57. '<h5>Actions:</h5>' +
  58. '<div class="upgradeinfo">' +
  59. '<span id="upgradeQueue" class="btnwrap btnmed btnprice upgradeQueue">' +
  60. '<span class="btnedge">' +
  61. '<a class="btngold">Enqueue upgrade</a>' +
  62. '</span>' +
  63. '</span>' +
  64. '</div>',
  65.  
  66. saveOptionsBtn:
  67. '<span id="saveOptions" class="btnwrap btnlg">' +
  68. '<span class="btnedge">' +
  69. '<a class="btngold">Save</a>' +
  70. '</span>' +
  71. '</span>',
  72.  
  73. resetOptionsBtn:
  74. '<span id="resetOptions" class="btnwrap btnlg">' +
  75. '<span class="btnedge">' +
  76. '<a class="btngold">Reset</a>' +
  77. '</span>' +
  78. '</span>',
  79.  
  80. clearLogOptionsBtn:
  81. '<span id="clearExLog" class="btnwrap btnlg exBtn" onclick="clearLog()">' +
  82. '<span class="btnedge">' +
  83. '<a class="btngold">Clear log</a>' +
  84. '</span>' +
  85. '</span>',
  86.  
  87. showObservableBtn:
  88. '<span id="showObservable" class="btnwrap btnlg exBtn" onclick="javascript: $(\'#observable\').toggle(\'display\');">' +
  89. '<span class="btnedge">' +
  90. '<a class="btngold">Console</a>' +
  91. '</span>' +
  92. '</span>',
  93.  
  94. tabContent:
  95. '<div id="extenderTabContent" style="margin-top: 18px; margin-top: 18px; overlow-x: scroll; height: 460px;"></div>',
  96.  
  97. optionsHeader:
  98. '<h1 style="font-family:GoudyTrajan-Bold,Trajan,\'Trajan Pro\',Trajanbold;">Extender options | v.' + GM_info.script.version + '</h1><hr />' +
  99. '<div id="extenderTabMenu" style="margin: 0 0 0;">' +
  100. '<div class="charactertabs"></div>' +
  101. '<div class="barbtmedge"></div>' +
  102. '</div>',
  103.  
  104. tableSkeleton:
  105. '<div style="overflow-y: auto; height: 360px;">' +
  106. '<table class="queueTable powertable">' +
  107. '<tbody>' +
  108. '<tr class="headerRow">' +
  109. '<th id="col4"><span class="colsort">QueueID</span></th>' +
  110. '<th id="col1"><span class="colsort">Type</span></th>' +
  111. '<th id="col1"><span class="colsort">Building</span></th>' +
  112. '<th id="col2"><span class="colsort">Name</span></th>' +
  113. '<th id="col3"><span class="colsort">Icon</span></th>' +
  114. '</tr>' +
  115. '</tbody>' +
  116. '</table>' +
  117. '</div>',
  118.  
  119. bruteBtn:
  120. '<span id="bruteBtn" class="btnwrap btnmed" style="margin-top: 6px; padding: 0 0 0 0;">' +
  121. '<span class="btnedge">' +
  122. '<a class="btngold" style="min-width: 0px;">Brute!</a>' +
  123. '</span>' +
  124. '</span>',
  125.  
  126. bruteAllBtn:
  127. '<span id="bruteAllBtn" class="btnwrap btnmed" style="margin-top: 6px;">' +
  128. '<span class="btnedge">' +
  129. '<a class="btngold" style="min-width: 0px;">Brute ALL!</a>' +
  130. '</span>' +
  131. '</span>',
  132.  
  133. infoBtn:
  134. '<span id="infoBtn" class="btnwrap btnmed" style="margin-top: 6px; padding: 0 0 0 8px;">' +
  135. '<span class="btnedge">' +
  136. '<a class="btngold" style="min-width:0px !important;">Trainer</a>' +
  137. '</span>' +
  138. '</span>',
  139.  
  140. searchAllianceBtn:
  141. '<div id="ex_search_row" class="exrow" style="padding-top: 78px;">' +
  142. '<span class="alliancesearch">' +
  143. '<input type="text" placeholder="Search For An Alliance" id="ex_alliance_search_input">' +
  144. '<a id="ex_alliance_search" href="#"></a></span></div>',
  145.  
  146. finishAllBtn:
  147. '<span id="extender_finishBtn" class="btnwrap btnlg" onclick="finishAll()"><span class="btnedge"><a class="btngold">Finish All Buildings</a></span></span>',
  148.  
  149. buildingQueueTabBtn:
  150. '<span class="inventorytabwrap" id="buildingQueueTab">' +
  151. '<span class="inventorytabedge"><a id="buildingQueueTab_inner" class="inventorytab">' +
  152. '<span></span>Queue<em></em>' +
  153. '</a></span></span>',
  154.  
  155. buildingTabQueue: function() {
  156. return '<div style="display: none; padding: 0 20px 0 20px;" id="building_tab_queue">' +
  157. '<div class="exrow" style="text-align: left">' + this.defaultBtn("clearQueue", "exBtn",
  158. "production.clear(userContext.activeBuildingPanel); production.render(userContext.activeBuildingPanel)", "Clear") + '</div><hr/>' +
  159. this.tableSkeleton +
  160. '</div>'
  161. },
  162.  
  163. boonsSortingOptions: [
  164. { val: "available_quantity", text: "Quantity" },
  165. { val: "rarity", text: "Rarity" },
  166. { val: "calc_battle", text: "Battle stats" },
  167. { val: "calc_trade", text: "Trade stats" },
  168. { val: "calc_intrigue", text: "Intrigue stats" }
  169. ],
  170.  
  171. shopSortingOptions: [
  172. { val: "price", text: "Silver" },
  173. { val: "price_perk_points", text: "Gold" },
  174. { val: "rarity", text: "Rarity" },
  175. { val: "calc_battle", text: "Battle stats" },
  176. { val: "calc_trade", text: "Trade stats" },
  177. { val: "calc_intrigue", text: "Intrigue stats" }
  178. ],
  179.  
  180. sendAllActions: [
  181. { val: "none", text: "Disable" },
  182. { val: "fight", text: "Vanguards" },
  183. { val: "harass", text: "Skirmishers" },
  184. { val: "aid", text: "Protectors" },
  185. { val: "barter", text: "Merchants" },
  186. { val: "hoodwink", text: "Charlatans" },
  187. { val: "bribe", text: "Corruptors" },
  188. { val: "spy", text: "Agents" },
  189. { val: "sabotage", text: "Saboteurs" },
  190. { val: "steal", text: "Thieves" },
  191. { val: "battle", text: "Battle" },
  192. { val: "trade", text: "Trade" },
  193. { val: "intrigue", text: "Intrigue" },
  194. { val: "friendly", text: "Friendly" },
  195. { val: "hostile", text: "Hostile" },
  196. { val: "selected", text: "Selected action" },
  197. { val: "all", text: "Throw everything" }
  198. ],
  199.  
  200. battleModifiers: [
  201. { val: "fight", text: "FIGHT" },
  202. { val: "harass", text: "HARASS" },
  203. { val: "aid", text: "PROTECT" }
  204. ],
  205.  
  206. tradeModifiers: [
  207. { val: "barter", text: "BARTER" },
  208. { val: "hoodwink", text: "SWINDLE" },
  209. { val: "bribe", text: "BRIBE" }
  210. ],
  211.  
  212. intrigueModifiers: [
  213. { val: "spy", text: "SPY" },
  214. { val: "sabotage", text: "SABOTAGE" },
  215. { val: "steal", text: "STEAL" }
  216. ],
  217.  
  218. logLevelTimestamps: [
  219. { val: "last_hour", text: "Last hour" },
  220. { val: "last_day", text: "Last day" },
  221. { val: "last_week", text: "Last week" },
  222. { val: "all_time", text: "All logged time" }
  223. ],
  224.  
  225. get orders() {
  226. return [
  227. {val: "none", text: "NONE"}
  228. ].concat(this.battleModifiers, this.tradeModifiers, this.intrigueModifiers)
  229. },
  230.  
  231. get selectedActions() {
  232. return [
  233. {val: "none", text: "BEST"}
  234. ].concat(this.battleModifiers, this.tradeModifiers, this.intrigueModifiers)
  235. },
  236.  
  237. get trainCommands() {
  238. return [
  239. {val: "stats", text: "STATS"}
  240. ].concat(this.battleModifiers, this.tradeModifiers, this.intrigueModifiers)
  241. },
  242.  
  243. stats: function(battle, trade, intrigue) {
  244. return '<div class="exstatbox">' +
  245. '<div id="battle" class="statitem">' +
  246. '<div><span></span>' +
  247. '</div><var class="battle_val" id="battle_val">' + battle + '</var></div>' +
  248. '<div id="trade" class="statitem">' +
  249. '<div><span></span>' +
  250. '</div><var class="trade_val" id="trade_val">' + trade + '</var></div>' +
  251. '<div id="intrigue" class="statitem">' +
  252. '<div><span></span></div>' +
  253. '<var class="intrigue_val" id="intrigue_val">' + intrigue + '</var></div>' +
  254. '</div>';
  255. },
  256.  
  257. outputMiniView: function (rarity, src, quantity, name, type, timestamp) {
  258. return '<span style="display: inline-block;" class="miniview rarity' + rarity + '">' +
  259. '<em></em>' +
  260. '<span class="miniviewimg">' +
  261. '<img src="' + src + '">' +
  262. '<span><span class="miniviewquantity">x' + quantity + '</span></span>' +
  263. '<span class="miniviewframe"><span></span></span></span>' +
  264. '<span class="miniviewname">' + name + '<br>' + type + '<br><b style="color: white; font-size: 14px">' + (!timestamp ? "" : moment(timestamp).format("HH:mm:ss")) + '</b></span></span>';
  265. },
  266.  
  267. formatAlert: function(message, progress, progressInformation) {
  268. var markup = '<div id="exalert" class="exrow" style="text-align: center; font-family: GoudyTrajan-Bold,Trajan,\'Trajan Pro\',Trajanbold;">' +
  269. '' + message +
  270. '</div><br />';
  271.  
  272. progress &&
  273. (markup += this.progressBar(progress, progressInformation));
  274.  
  275. return markup;
  276. },
  277.  
  278. brownBtn: function (id, cssClass, onclick, text) {
  279. return '<span id="' + id + '" class="btnwrap btnsm ' + cssClass + '">' +
  280. '<span class="btnedge">' +
  281. '<a ' + (onclick != void 0 ? 'onclick="' + onclick + '"' : 'onclick:"return false"') + ' class="btnbrown">' +
  282. '<span></span>' + text + '</a></span></span>';
  283. },
  284.  
  285. defaultBtn: function (id, cssClass, onclick, text) {
  286. return '<span id="' + id + '" class="btnwrap btnlg ' + cssClass + '" ' + (onclick != void 0 ? 'onclick="' + onclick + '"' : "") + '>' +
  287. '<span class="btnedge">' +
  288. '<a class="btngold">' + text + '</a>' +
  289. '</span>' +
  290. '</span>';
  291. },
  292.  
  293. observable: function(display) {
  294. return '<textarea id="observable" rows="3" style="width:99%; overflow:auto; display: ' + (display ? 'inline' : 'none') + ';" onkeyup="observable_onkeyup(event)"></textarea>';
  295. },
  296.  
  297. progressBar: function(progress, info) {
  298. return '<div class="progstretch" style="margin: 0 10px 0 10px;">' +
  299. '<div class="progstretch-outer">' +
  300. '<div style="width: ' + progress + '%;" id="exprogress" class="progstretch-inner"></div>' +
  301. '</div>' +
  302. '</div>' +
  303. '<div id="expinfo" class="exrow" style="text-align: center; font-family: GoudyTrajan-Bold,Trajan,\'Trajan Pro\',Trajanbold;">' + info + '</div>';
  304. },
  305.  
  306. ssInfo: function(swornSwords){
  307.  
  308. var output = this.defaultBtn("train_all", "exBtn", "extenderSSTrainAll();", "Train All") + "List of sworn swords:<br />";
  309. output += '<div style="text-align: left; margin: 20px 20px 0 20px; overflow-y: scroll; height: 420px;" id="swornSwordsInfo">';
  310.  
  311. output += '<table class="powertable">';
  312. output += '<thead><tr><td>#id</td><td>Name</td><td>Train</td></tr></thead>';
  313. output += '<tbody>';
  314.  
  315. if (!(swornSwords instanceof Array) || swornSwords.length == 0)
  316. output += '<tr><td colspan="3">' + "You have no sworn swords to output." + '</td></tr>';
  317. else
  318. for (var j = 0; j < swornSwords.length; j++) {
  319. var s = swornSwords[j];
  320.  
  321. output += s.upgrade_points ? '<tr style="background: green;">' : '<tr>';
  322. output += '<td>' + s.id + '</td>';
  323. output += '<td>' + s.full_name + '</td>';
  324. output += '<td>' + (s.upgrade_points ? s.upgrade_points + ' x ' : '') + this.selectOption("", "ss_" + s.id + "_orders", this.trainCommands, (s.modifier || "stats"), null) + '</td>';
  325. output += '</tr>';
  326. }
  327.  
  328. output += '</tbody>';
  329. return output;
  330. },
  331.  
  332. allianceRow: function(a, region) {
  333. return '<tr>' +
  334. '<td>unknown</td>' +
  335. '<td><a onclick="return allianceInfo(' + a.id + ')" href="#">' + a.name + '</a></td>' +
  336. '<td>members: ' + a.members + '</td>' +
  337. '<td>-</td>' +
  338. '<td><span class="btnmed btnwrap"><span class="btnedge"><a onclick="return allianceCampTarget(' + a.id + ', \'' + a.name + '\', ' + region + ')" class="btngold">Go</a></span></span></td>' +
  339. '</tr>';
  340. },
  341.  
  342. configLog: function(o) {
  343. var output = "";
  344. output += this.selectOption("Log level scope: ", "logLevelTimestamp", this.logLevelTimestamps, o.logLevelTimestamp, "return false;");
  345. output += this.checkOption("outputLogAsText", "Output log as text", o.outputLogAsText) + '<hr>';
  346. output +=
  347. this.checkOption("logAdventures", "ADVENTURES ", o.logLevel.indexOf("ADVENTURE") > -1) +
  348. this.checkOption("logQMaster", "QUARTERMASTER", o.logLevel.indexOf("QMASTER") > -1) +
  349. this.checkOption("logDaily", "DAILY CLAIMS", o.logLevel.indexOf("DAILY") > -1) +
  350. this.checkOption("logFavors", "FAVORS", o.logLevel.indexOf("FAVOR") > -1) + '<hr>';
  351. return output;
  352. },
  353.  
  354. outputSwornSwords: function (swornSwords) {
  355.  
  356. if (!(swornSwords instanceof Array) || swornSwords.length == 0)
  357. return "";
  358.  
  359. var v = [];
  360. v.push({
  361. val: "none",
  362. text: "None"
  363. });
  364.  
  365. for (var j = 0; j < swornSwords.length; j++) {
  366. var s = swornSwords[j];
  367. if (s.full_name && s.id) {
  368.  
  369. v.push({
  370. val: s.id,
  371. text: s.full_name
  372. });
  373. }
  374. }
  375.  
  376. var c = unsafeWindow.userContext.setSwornSword;
  377. return this.selectOption("Set sworn sword: ", "ss_select", v, c ? c.id : "none", "setSwornSword($(this).val())");
  378.  
  379. },
  380.  
  381. selectOption: function (label, id, options, selected, onchange) {
  382. var select = "";
  383.  
  384. //console.debug("Debugging arguments: ", arguments);
  385.  
  386. if (!(options instanceof Array)) {
  387. return select;
  388. }
  389.  
  390. select += '<label for="' + id + '">' + label + '</label>';
  391. if (typeof onchange != "undefined") {
  392. select += '<select id="' + id + '" class="extender-select" onchange="' + onchange + '">';
  393. } else {
  394. select += '<select id="' + id + '" class="extender-select">';
  395. }
  396.  
  397.  
  398. for (var i = 0; i < options.length; i++) {
  399. var o = options[i];
  400.  
  401. if (!o.val || !o.text)
  402. continue;
  403.  
  404. select += '<option value="' + o.val + '" ' + ((o.val === selected) ? 'selected' : '') + '>' + o.text + '</option>';
  405. }
  406.  
  407. select += '</select>';
  408. return select;
  409. },
  410.  
  411. checkOption: function (id, name, val) {
  412. return '<a style="color:white;" id="' + id + '" class="extender-option checkbox ' + (val ? 'checked' : '') + '" onclick="check(this)">' + name + '</a>';
  413. },
  414.  
  415. numberOption: function (id, label, val, min, max, step) {
  416. return '<label for="' + id + '">' + label + '</label>' +
  417. '<span id="' + id + '" ' +
  418. 'class="extender-option extender-number" ' +
  419. 'min="' + min + '" ' +
  420. 'max="' + max + '" ' +
  421. 'step="' + step + '"' +
  422. 'onclick="increment(this)">' + val + '</span>';
  423. },
  424.  
  425. inputNumberOption: function (id, val, maxlength) {
  426. return '<div class="contribcount">' +
  427. '<input id="' + id + '" type="text" onkeypress="return isNumberKeyPressed(event)" value="' + val + '" maxlength="' + maxlength + '" name="quantity" style="height: auto;">' +
  428. '<a id="excountup" onclick="inputIncrement(this)"></a>' +
  429. '<a id="excountdown" onclick="inputIncrement(this)"></a>' +
  430. '</div>';
  431. },
  432.  
  433. sellBulkBtn: function (itemId) {
  434. return '<span class="sellbulk">' +
  435. '<input type="number" id="sell_bulk_amount" placeholder="Amount">' +
  436. '<span id="do_sell_bulk" class="btnwrap btnsm" item-id="' + itemId + '">' +
  437. '<span class="btnedge">' +
  438. '<a class="btngold">Sell</a>' +
  439. '</span></span></span>';
  440. },
  441.  
  442. outputLog: function(log, logAsText){
  443. var item;
  444. var itemImage;
  445. var output = "";
  446.  
  447. for(var i = log.length - 1; i > -1; i--){
  448. var entry = log[i];
  449.  
  450. if(logAsText){
  451. output += '<div class="exRow" style="background-color: ' + (entry.type ? "green" : "none") + '; text-align: left; padding: 2px 0 2px 8px; font-family: GoudyTrajan-Bold,Trajan,\'Trajan Pro\',Trajanbold">'
  452. entry.message != void 0
  453. ? output += (entry.type
  454. ? entry.type
  455. : "ENDEAVOURS") + " ( " + moment(entry.timestamp).format("DD.MM.YYYY HH:mm:ss") + " ) " + entry.message + "<br>"
  456. : output += (entry.type
  457. ? entry.type
  458. : "ENDEAVOURS") + " ( " + (entry.timestamp
  459. ? moment(entry.timestamp).format("DD.MM.YYYY HH:mm:ss")
  460. : "ACCUMULATED") + " ) " + entry.quantity + " x " + entry.symbol + "<br>";
  461. output += '</div>';
  462. } else {
  463.  
  464. // When log is only visual
  465. // skip message entries
  466. if (entry.message != void 0)
  467. continue;
  468.  
  469. item = unsafeWindow.itemFromSymbol(entry.symbol);
  470. itemImage = unsafeWindow.itemImage(item, 'icon');
  471.  
  472. output += this.outputMiniView(item.rarity, itemImage, entry.quantity, item.id ? item.full_name : entry.symbol, entry.type, entry.timestamp);
  473. }
  474. }
  475.  
  476. return output;
  477. },
  478.  
  479. optionsTab: function (id, name) {
  480. return '<span id="' + id + '" class="inventorytabwrap">' +
  481. '<span class="inventorytabedge">' +
  482. '<a class="inventorytab" style="padding: 1px 15px 0 15px; !important">' +
  483. name +
  484. '<em></em>' +
  485. '</a>' +
  486. '</span></span>';
  487. },
  488.  
  489. tableRow: function (i, el) {
  490. return '<tr class="tableRow" style="cursor: pointer">' +
  491. '<td><span class="ranklist colsort">' + i + '</span></td>' +
  492. '<td><span class="ranklist colsort">' + el.type + '</span></td>' +
  493. '<td><span class="name colsort">' + el.activeBuildingPanel + '</span></td>' +
  494. '<td><span class="name colsort">' + el.name + '</span></td>' +
  495. '<td><span class="avatarimg"><img src="' + el.img + '"></span></td>' +
  496. '</tr>';
  497. },
  498.  
  499. logTab: function (o) {
  500.  
  501. var log = sessionStorage.get("clientEntries", []);
  502.  
  503. switch(o.logLevelTimestamp){
  504. case "last_hour": {
  505. var anHourAgo = moment().subtract(1, 'hour');
  506. log = log.filter(function(a){
  507. if(!a.timestamp)
  508. return false;
  509.  
  510. return moment(a.timestamp).isAfter(anHourAgo);
  511. });
  512. break;
  513. }
  514. case "last_day": {
  515. var aDayAgo = moment().subtract(1, 'day');
  516. log = log.filter(function(a){
  517. if(!a.timestamp)
  518. return false;
  519.  
  520. return moment(a.timestamp).isAfter(aDayAgo);
  521. });
  522. break;
  523. }
  524. case "last_week": {
  525. var aWeekAgo = moment().subtract(1, 'week');
  526. log = log.filter(function(a){
  527. if(!a.timestamp)
  528. return false;
  529.  
  530. return moment(a.timestamp).isAfter(aWeekAgo);
  531. });
  532. break;
  533. }
  534. case "all_time":
  535. default: break;
  536. }
  537.  
  538. var output = '<div class="exrow" style="text-align: right"> ' + this.defaultBtn("configLogBtn", "exBtn", null, "Config") + this.showObservableBtn + this.clearLogOptionsBtn + '</div>';
  539.  
  540. output += '<div id="logContent" class="exrow" style="height: 400px; overflow-y: scroll; border: solid;">'; //<textarea style="width: 95%; height: 400px; overflow-y: scroll;" readonly="readonly" onkeydown="return false;" onkeypress="return false;" onkeyup="return false;" disabled="disabled">';
  541. output += this.outputLog(log, o.outputLogAsText);
  542. output += '</div>';
  543. return output;
  544. },
  545.  
  546. mainTab: function (o) {
  547. return '<div class="exrow">' +
  548. this.numberOption("baseDelay", "Extender base delay (seconds):", o.baseDelay, 2, 24, 2) +
  549. this.finishAllBtn +
  550. '</div>' +
  551. '<div class="exrow">' +
  552. this.checkOption("toggleDebugModes", "Debug mode", o.debugMode) +
  553. this.checkOption("toggleTooltips", "Tooltips on buildings", o.doTooltips) +
  554. this.checkOption("toggleLastSeen", "Last seen", o.appendLastSeen) +
  555. '</div>' +
  556. '<div class="exrow">' +
  557. 'Reload in (hours): ' +
  558. this.inputNumberOption("autoReloadInterval", o.autoReloadInterval, 2) +
  559. 'Collect in (minutes): ' +
  560. this.inputNumberOption("autoCollectInterval", o.autoCollectInterval, 2) + '(0 = disabled)' +
  561. '</div>' +
  562. '<div class="exrow">' +
  563. this.checkOption("neverSpendGold", "Never spend gold", o.neverSpendGold) +
  564. "AUTO: " +
  565. this.checkOption("autoBossChallenge", "Boss challenge", o.autoBossChallenge) +
  566. this.checkOption("autoQMaster", "Quarter master", o.autoQMaster) +
  567. '</div>' +
  568. '<div class="exrow">' +
  569. this.selectOption("Sort player inventory by: ", "boonsSortBy", this.boonsSortingOptions, o.boonsSortBy) +
  570. this.selectOption(" and then by: ", "boonsSortBy2", this.boonsSortingOptions, o.boonsSortBy2) +
  571. '</div>' +
  572. '<div class="exrow">' +
  573. this.selectOption("Sort shop by: ", "shopSortBy", this.shopSortingOptions, o.shopSortBy) +
  574. this.selectOption(" and then by: ", "shopSortBy2", this.shopSortingOptions, o.shopSortBy2) +
  575. '</div>' +
  576. '<div class="exrow">' +
  577. this.selectOption("Send all button context: ", "sendAllAction", this.sendAllActions, o.sendAllAction) +
  578. '</div>' +
  579. '<div class="exrow"> ' +
  580. this.checkOption("toggleLockedBuildings", "Hide locked buildings", o.hideLockedBuildings) +
  581. //this.checkOption("toggleLocalDbOnly", "SQLite only", o.useLocalDbOnly) +
  582. '</div>' +
  583. '<div class="exrow"> ' +
  584. ' AvA: ' + this.checkOption("avaSendSubcamps", "From all camps in region,", o.avaSendSubcamps) +
  585. ' Default modifier for <hr>' +
  586. this.selectOption("Battle: ", "default_battle", this.battleModifiers, o.defaultBattle) + '&nbsp;' +
  587. this.selectOption("Trade: ", "default_trade", this.tradeModifiers, o.defaultTrade) + '&nbsp;' +
  588. this.selectOption("Intrigue: ", "default_intrigue", this.intrigueModifiers, o.defaultIntrigue) + '&nbsp;' +
  589. '</div>';
  590. },
  591.  
  592. queueTab: function (o) {
  593. return '<div class="exrow">' +
  594. this.numberOption("queueDelay", "Delay in (seconds):", o.queueDelay, 4, 20, 4) +
  595. this.checkOption("toggleSuperiorMaterials", "Use superior materials", o.superiorMaterials) +
  596. this.checkOption("toggleDoSpeedUp", "Speed Up", o.doSpeedUp) +
  597. '</div>' +
  598. '<div class="exrow">' +
  599. this.defaultBtn("clearQueue", "exBtn",
  600. "production.clear(); production.render()", "Clear") +
  601. 'Try production in (minutes): ' +
  602. this.inputNumberOption("queueTimerInterval", o.queueTimerInterval, 3) + '(0 = disabled)' +
  603. '</div><hr/>' +
  604. this.tableSkeleton;
  605. },
  606.  
  607. bruteTab: function (o) {
  608. return '<div class="exrow">' +
  609. this.numberOption("bruteWounds", "Brute until: ", o.bruteWounds, 0, 4, 1) + 'wound(s) (0 = disabled) ' +
  610. '<span class="btnwrap btnlg" id="bruteSwitchOff" onclick="bruteSwitchToggle(this)" style="display: none;"><span class="btnedge"><a class="btngold">' + (o.bruteSwitchOff ? 'switch off' : 'adjust') + '</a></span></span>' +
  611. this.infoBtn +
  612. '</div>' +
  613. (o.sendAllAction == "selected" ?
  614. '<div class="exrow">' +
  615. this.selectOption("Send all action is 'SELECTED', last stored action was: ", "selectedAction", this.selectedActions, o.selectedAction) +
  616. '</div>' : '') +
  617. '<div class="exrow">' +
  618. this.outputSwornSwords(o.swornSwords) +
  619. this.bruteAllBtn +
  620. this.bruteBtn +
  621. '</div>';
  622. },
  623.  
  624. weAttackersOutput: function(){
  625.  
  626. var weAttackerIds = unsafeWindow.worldEvent.attackers;
  627.  
  628. var markup = '';
  629. for(var i = 0; i < 5; i ++) {
  630.  
  631. var swornsword = null;
  632. if(weAttackerIds[i] != void 0)
  633. swornsword = unsafeWindow.getSwornSwords(weAttackerIds[i]);
  634.  
  635. markup += '<div class="exrow">';
  636. markup += 'SLOT ' + i + ' : ' + (swornsword != void 0 ? swornsword.id + ' # ' + swornsword.full_name + ' | ' : 'Empty | ');
  637. markup += this.selectOption("Orders: ", "slot_" + i + "_orders", this.orders, (swornsword != void 0 ? swornsword.modifier : "none"), "return false") +
  638. '</div>';
  639. }
  640.  
  641. return markup;
  642. },
  643.  
  644. weTab: function (o) {
  645.  
  646. var markup = '';
  647. markup += '<div class="exrow">WORLD EVENT BATTLE MANAGER</div><hr />';
  648. markup += '<div class="exrow">' + this.numberOption("worldEventDelay", "Delay: ", o.worldEventDelay, 2, 12, 2) + this.checkOption("weManagerEnabled", " Enabled", o.weManagerEnabled) + '</div><hr />';
  649. markup += '<div class="exrow">' +
  650. this.outputSwornSwords(o.swornSwords) +
  651. this.defaultBtn("pushSSid", "", "worldEvent.enlistSS();", "PUSH") +
  652. '</div>';
  653.  
  654. markup += '<div class="exrow">' +
  655. this.weAttackersOutput() +
  656. '</div>';
  657.  
  658. return markup;
  659. }
  660. };
  661.  
  662. var styles = {
  663. modalAlertsHigh:
  664. '#modals_container_high {' +
  665. 'z-index: 99999;' +
  666. '}',
  667.  
  668. resetOptions:
  669. '#resetOptions { ' +
  670. 'bottom: 15px; ' +
  671. 'left: 66%; ' +
  672. 'margin-left: -40px; ' +
  673. 'padding: 0; ' +
  674. 'position: absolute; ' +
  675. 'width: 80px; ' +
  676. '}',
  677.  
  678. saveOptions:
  679. '#saveOptions {' +
  680. 'bottom: 15px;' +
  681. 'left: 34%;' +
  682. 'margin-left: -40px; ' +
  683. 'padding: 0; ' +
  684. 'position: absolute; ' +
  685. 'width: 80px; ' +
  686. '}',
  687.  
  688. extenderMenu:
  689. '#extender-menu .navlinkicon {' +
  690. 'background-image: url("http://disruptorbeamcdn-01.insnw.net/images/icons/newnav-menu.png?t=386c1688da2a"); ' +
  691. '}',
  692.  
  693. extenderTabMenu:
  694. '#extenderTabMenu {' +
  695. 'background: url("http://disruptorbeamcdn-01.insnw.net/images/character/horzmenubg.png?t=074863387615") repeat-x scroll 0 bottom #000;' +
  696. 'height: 46px;' +
  697. 'margin: 0px 6px 0px;' +
  698. 'position: relative;' +
  699. 'text-align: center;' +
  700. 'width: auto;' +
  701. '}',
  702.  
  703. exRow:
  704. '.exrow {' +
  705. 'margin: 8px 0 0;' +
  706. '}',
  707.  
  708. exBtn:
  709. '.exBtn {' +
  710. 'padding: 0 10px 0 0;' +
  711. '}',
  712.  
  713. exOption:
  714. '.extender-option {' +
  715. 'margin: 0 10px 0 8px;' +
  716. '}',
  717.  
  718. exNumber:
  719. '.extender-number {' +
  720. 'background: url("http://disruptorbeamcdn-01.insnw.net/images/city/buildinglvl.png?t=7e85013c75ef") no-repeat scroll 0 0 transparent;' +
  721. 'color: #d6b97a;' +
  722. 'display: inline-block;' +
  723. 'font-family: GoudyTrajan-Bold,Trajan,"Trajan Pro",Trajanbold;' +
  724. 'font-weight: bold;' +
  725. 'height: 32px;' +
  726. 'line-height: 32px;' +
  727. 'right: 5px;' +
  728. 'text-align: center;' +
  729. 'top: 70px;' +
  730. 'width: 33px;' +
  731. 'cursor: pointer;' +
  732. '}',
  733.  
  734. exSelect:
  735. '.extender-select { ' +
  736. 'background-color: #000;' +
  737. 'border: 1px solid #444;' +
  738. 'border-radius: 5px;' +
  739. 'color: white;' +
  740. '}',
  741.  
  742. excountup:
  743. '#excountup {' +
  744. 'background-position: 0 0;' +
  745. 'top: -4px;' +
  746. '}',
  747.  
  748. excountdown:
  749. '#excountdown {' +
  750. 'background-position: 0 bottom;' +
  751. 'top: 12px;' +
  752. '}',
  753.  
  754. sellBulk:
  755. '.sellbulk {' +
  756. 'color: white;' +
  757. 'position: relative;' +
  758. '} \n' +
  759. '.sellbulk input {' +
  760. 'background-color: #000;' +
  761. 'border: 1px solid #444;' +
  762. 'border-radius: 5px;' +
  763. 'color: white;' +
  764. 'padding: 5px;' +
  765. 'width: 100px;' +
  766. '}',
  767.  
  768. exstatbox:
  769. '.exstatbox {' +
  770. 'height: 84px;' +
  771. 'left: 166px;' +
  772. 'position: absolute;' +
  773. 'top: 44px;' +
  774. 'width: 101px;' +
  775. 'z-index: 2;' +
  776. '}',
  777.  
  778. plevel:
  779. '#plevel {' +
  780. 'top: -38px;' +
  781. '} \n' +
  782. '#plevel span {' +
  783. 'background: url("http://disruptorbeamcdn-01.insnw.net/images/icons/icon-xp.png?t=b8e2c654bf59") no-repeat scroll 0px 0px transparent;' +
  784. 'z-index: 2;' +
  785. 'width: 34px !important;' +
  786. 'height: 34px !important;' +
  787. 'top: -5px;' +
  788. '} \n' +
  789. '#plevel var {' +
  790. 'padding-left: 10px !important;' +
  791. '}',
  792.  
  793. exSendAllButton:
  794. '.questmodal .exSendAllButton {' +
  795. 'left: 110px;' +
  796. '} \n' +
  797. '.exSendAllButton {' +
  798. 'position: absolute;' +
  799. 'top: 7px;' +
  800. '}',
  801.  
  802. exAttackTimestamp:
  803. '.ex_attack_timestamp {' +
  804. 'text-align: left;'+
  805. 'margin-bottom: 15px;' +
  806. 'padding: 10px 0 0 15px;' +
  807. 'font-family: GoudyTrajan-Bold,Trajan,"Trajan Pro",Trajanbold;' +
  808. '}',
  809.  
  810. addAllStyles: function() {
  811.  
  812. try {
  813.  
  814. var elmHead, elmStyle;
  815. elmHead = document.getElementsByTagName('head')[0];
  816. elmStyle = document.createElement('style');
  817. elmStyle.type = 'text/css';
  818. elmStyle.id = "extenderStyles";
  819. elmHead.appendChild(elmStyle);
  820. for (var style in this) {
  821. if (this.hasOwnProperty(style) && typeof this[style] == "string") {
  822. elmStyle.innerHTML
  823. ? elmStyle.innerHTML += "\n" + this[style]
  824. : elmStyle.innerHTML = this[style];
  825. }
  826. }
  827.  
  828. } catch (e) {
  829. warn("Error occured: " + e + ". Retrying... ");
  830.  
  831. if (!document.styleSheets.length)
  832. document.createStyleSheet();
  833.  
  834. for (var cStyle in this) {
  835. if (this.hasOwnProperty(cStyle) && typeof this[cStyle] == "string") {
  836. document.styleSheets[0].cssText
  837. ? document.styleSheets[0].cssText += "\n" + this[cStyle]
  838. : document.styleSheets[0].cssText = this[cStyle];
  839. }
  840. }
  841. }
  842. }
  843. };