Multitool Gatinho

Multitool for the game Grepolis

  1. // ==UserScript==
  2. // @name Multitool Gatinho
  3. // @namespace Multitool Gatinho
  4. // @version 0.0.4
  5. // @author JoeMan
  6. // @description Multitool for the game Grepolis
  7. // @match http://*.grepolis.com/*
  8. // @match https://*.grepolis.com/*
  9. // @match https://code.jquery.com/jquery-3.6.4.min.js
  10. // @match https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js
  11. // @match https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/2.0.5/FileSaver.min.js
  12. // @exclude https://*.forum.grepolis.com/*
  13. // @exclude https://wiki.*.grepolis.com/*
  14. // @icon https://i.imgur.com/qYhrH44.gif
  15. // @license GPL-3.0
  16. // @grant GM_addStyle
  17. // @grant GM_download
  18. // ==/UserScript==
  19.  
  20. var version = '0.0.4';
  21. GM_addStyle ( `
  22. #btnRefresh {
  23. background-color: #2c3684;
  24. cursor: pointer;
  25. border: none;
  26. border-radius: 3px;
  27. width: auto;
  28. position: relative;
  29. margin: 0 1px;
  30. line-height: 20px;
  31. overflow: hidden;
  32. white-space: nowrap;
  33. text-overflow: ellipsis;
  34. color: #fc6;
  35. text-align: center;
  36. font-weight: 700;
  37. padding: 0 10px;
  38. font-size: 10px;
  39. }
  40. #diciplinas {
  41. margin-bottom: 3px;
  42. }
  43. #inputfile {
  44. background-color: #141338;
  45. cursor: pointer;
  46. border: none;
  47. border-radius: 3px;
  48. width: auto;
  49. position: relative;
  50. margin: 0 1px;
  51. margin-top: 0px;
  52. line-height: 20px;
  53. overflow: hidden;
  54. white-space: nowrap;
  55. text-overflow: ellipsis;
  56. color: #fc6;
  57. text-align: center;
  58. font-weight: 700;
  59. padding: 0 10px;
  60. font-size: 10px;
  61. }
  62. #adicionar-btn, #show-btn, #hide-btn {
  63. background-color: #132338;
  64. cursor: pointer;
  65. border: none;
  66. border-radius: 3px;
  67. width: auto;
  68. position: relative;
  69. margin: 0 1px;
  70. line-height: 20px;
  71. overflow: hidden;
  72. white-space: nowrap;
  73. text-overflow: ellipsis;
  74. color: #fc6;
  75. text-align: center;
  76. font-weight: 700;
  77. padding: 0 10px;
  78. font-size: 12px;
  79. }
  80. .bloco-de-nota {
  81. margin-bottom: 20px;
  82. padding: 10px;
  83. border: 1px solid #ccc;
  84. border-radius: 5px;
  85. }
  86. .titulo-input {
  87. margin-bottom: 1px;
  88. width: 20%;
  89. display: block !important;;
  90. }
  91. .format-btn {
  92. border: none;
  93. border-radius: 3px;
  94. width: auto;
  95. position: relative;
  96. margin: 0 1px;
  97. line-height: 18px;
  98. color: #fc6;
  99. text-align: center;
  100. font-weight: 700;
  101. padding: 0 5px;
  102. font-size: 10px;
  103. background-color: #132338;
  104. }
  105. .format-btn:hover {
  106. background-image: linear-gradient( 0deg, hsl(220, 1.6%, 63.7%) 0%, hsl(214deg 15% 25%) 20%, hsl(214deg 28% 13%) 40%, hsl(214deg 28% 13%) 60%, hsl(214deg 15% 25%) 80%, hsl(240, 0.7%, 70%) 100% );
  107. }
  108. #adicionar-btn:hover {
  109. background-image: linear-gradient( 0deg, hsl(220, 1.6%, 63.7%) 0%, hsl(214deg 15% 25%) 20%, hsl(214deg 28% 13%) 40%, hsl(214deg 28% 13%) 60%, hsl(214deg 15% 25%) 80%, hsl(240, 0.7%, 70%) 100% );
  110. }
  111. #show-btn:hover {
  112. background-image: linear-gradient( 0deg, hsl(220, 1.6%, 63.7%) 0%, hsl(214deg 15% 25%) 20%, hsl(214deg 28% 13%) 40%, hsl(214deg 28% 13%) 60%, hsl(214deg 15% 25%) 80%, hsl(240, 0.7%, 70%) 100% );
  113. }
  114. #hide-btn:hover, #inputfile:hover {
  115. background-image: linear-gradient( 0deg, hsl(220, 1.6%, 63.7%) 0%, hsl(214deg 15% 25%) 20%, hsl(214deg 28% 13%) 40%, hsl(214deg 28% 13%) 60%, hsl(214deg 15% 25%) 80%, hsl(240, 0.7%, 70%) 100% );
  116. }
  117. .deletar-btn, #clear, .reset-btn, #resetBtgi {
  118. background-color: #842c2c;
  119. cursor: pointer;
  120. border: none;
  121. border-radius: 3px;
  122. width: auto;
  123. position: relative;
  124. margin: 0 1px;
  125. line-height: 20px;
  126. overflow: hidden;
  127. white-space: nowrap;
  128. text-overflow: ellipsis;
  129. color: #fc6;
  130. text-align: center;
  131. font-weight: 700;
  132. padding: 0 10px;
  133. font-size: 10px;
  134. }
  135. .salvar-btn, .save-file, #activerbouton {
  136. background-color: #0e6f24;
  137. cursor: pointer;
  138. border: none;
  139. border-radius: 3px;
  140. width: auto;
  141. position: relative;
  142. margin: 0 1px;
  143. line-height: 20px;
  144. overflow: hidden;
  145. white-space: nowrap;
  146. text-overflow: ellipsis;
  147. color: #fc6;
  148. text-align: center;
  149. font-weight: 700;
  150. padding: 0 10px;
  151. font-size: 10px;
  152. margin-top: 2px;
  153. }
  154. #btnRefresh:hover {
  155. background-image: linear-gradient(0deg,hsl(0deg 0% 80%) 0%,hsl(245deg 20% 69%) 8%,hsl(241deg 28% 58%) 17%,hsl(233deg 42% 45%) 25%,hsl(233deg 44% 41%) 33%,hsl(233deg 47% 38%) 42%,hsl(233deg 50% 35%) 50%,hsl(233deg 47% 38%) 58%,hsl(233deg 44% 41%) 67%,hsl(233deg 42% 45%) 75%,hsl(241deg 28% 58%) 83%,hsl(245deg 20% 69%) 92%,hsl(0deg 0% 80%) 100%);
  156. }
  157. .salvar-btn:hover, .save-file:hover {
  158. background-image: linear-gradient(0deg,hsl(120deg 2% 80%) 0%,hsl(131deg 14% 49%) 20%,hsl(131deg 42% 32%) 40%,hsl(131deg 42% 32%) 60%,hsl(131deg 14% 49%) 80%,hsl(120deg 2% 80%) 100%);
  159. }
  160. .deletar-btn:hover, #clear:hover, #resetBtgi:hover {
  161. background-image: linear-gradient(0deg,hsl(0deg 0% 81%) 0%,hsl(1deg 15% 50%) 20%,hsl(1deg 37% 38%) 40%,hsl(1deg 37% 38%) 60%,hsl(1deg 15% 50%) 80%,hsl(0deg 0% 81%) 100%);
  162. }
  163. #AC1, #AC2, #AC3, #AC4, #AC5, #AC6, #AC7 {
  164. box-sizing: border-box;
  165. -webkit-box-sizing: border-box;
  166. background: transparent url(https://gppt.innogamescdn.com/images/game/border/even.png) repeat scroll 0 0;
  167. }
  168. body {
  169. background: #eee;
  170. font-family: Arial;
  171. }
  172. #AB {
  173. margin: 20px auto;
  174. overflow-y: scroll;
  175. scrollbar-color: #2c5284 #2c528478;
  176. scrollbar-width: thin;
  177. background-image: url(https://gppt.innogamescdn.com/images/game/border/odd.png);
  178. }
  179. .tab {
  180. width: auto;
  181. height: 450px;
  182. }
  183. .tab input[type] {
  184. display: none;
  185. }
  186. .tab label {
  187. display: block;
  188. float: left;
  189. padding: 12px 20px;
  190. margin-right: 5px;
  191. cursor: pointer;
  192. transition: background-color .3s;
  193. }
  194. .tab label:hover,
  195. .tab input:checked + label {
  196. background: #2c5284;
  197. color: #fff;
  198. }
  199. #tib1, #tib2, #tib3, #tib4 {
  200. background: #0000000d;
  201. }
  202. .tabs {
  203. clear: both;
  204. perspective: 400px;
  205. -webkit-perspective: 400px;
  206. }
  207. .tabs .content {
  208. background: #fff;
  209. width: 100%;
  210. position: absolute;
  211. border: 2px solid #2c5284;
  212. padding: 10px 30px 40px;
  213. line-height: 1.4em;
  214. opacity: 0;
  215. transform: rotateX(-20deg);
  216. transform-origin: top center;
  217. transition: opacity .3s, transform 1s;
  218. z-index: 0;
  219. }
  220. #tab1:checked ~ .tabs .content:nth-of-type(1),
  221. #tab2:checked ~ .tabs .content:nth-of-type(2),
  222. #tab3:checked ~ .tabs .content:nth-of-type(3),
  223. #tab4:checked ~ .tabs .content:nth-of-type(4),
  224. #tab5:checked ~ .tabs .content:nth-of-type(5),
  225. #tab6:checked ~ .tabs .content:nth-of-type(6),
  226. #tab7:checked ~ .tabs .content:nth-of-type(7) {
  227. transform: rotateX(0);
  228. opacity: 1;
  229. z-index: 1;
  230. }
  231. #AA1, #AA1, #AA2, #AA3, #AA4, #AA5, #AA6, #AA7, #AA8, #AA9, #AA10, #AA11, #AA12, #BA1, #BA2, #BA3, #BA4, #BA5, #BA6, #BA7, #BA8, #BA9, #BA10, #BA11, #BA12 {
  232. color: #e41528;
  233. text-align: center;
  234. }
  235. #pointsperc, #pointsperc1, #pointsperc2, #pointsperc3, #pointsperc4, #pointCavaleiros2, #pointHop, #pointBigas, #pointArq, #pointCavaleiros, #pointHop2, #pointBigas2 {
  236. color: #e41528;
  237. text-align: center;
  238. }
  239. #nbr1, #nbr2, #nbr3, #nbr4 {
  240. color: #e41528;
  241. }
  242. .hour, .minute, .second, #totalTimeHHMMSS {
  243. color: #2f578c;
  244. }
  245. #calc-output {
  246. color: #5fae5f;
  247. }
  248. #totalTimeHHMMSS, .hour, .minute, .second {
  249. background: url(https://gppt.innogamescdn.com/images/game/barracks/input.png) no-repeat;
  250. border: 0;
  251. height: 17px;
  252. padding: 3px;
  253. }
  254. .titre{
  255. font-size: 25px;
  256. font-style: italic;
  257. font-family: sans-serif;
  258. color: #0C620C;
  259. }
  260. #case{
  261. height: 37px;
  262. width: 200px;
  263. border: 2px solid #2D882D;
  264. border-radius: 10px;
  265. background: #ffebbf;
  266. }
  267. .numbir{
  268. height: 50px;
  269. width: 50px;
  270. font-size: 25px;
  271. color: white;
  272. border: 2px solid #2D882D;
  273. border-radius: 10px;
  274. background-color: #5FAE5F;
  275. }
  276. .numbir:hover {
  277. background-color: #0C620C;
  278. }
  279. .operator{
  280. height: 50px;
  281. width: 50px;
  282. font-size: 25px;
  283. color: white;
  284. border: 2px solid #5FAE5F;
  285. border-radius: 10px;
  286. background-color: #9FD29F;
  287. }
  288. .operator:hover{
  289. background-color: #0C620C;
  290. }
  291. #pointsgiven, #pointsBigas, #pointsArqueiros, #pointsCavaleiros, #pointsHoplitas {
  292. color: #fff6e3;
  293. }
  294. ` );
  295. var uw = unsafeWindow || window, $ = uw.jQuery || jQuery, DATA, GM;
  296. GM = (typeof GM_info === 'object');
  297. console.log('%c-Grepotemas-Grepolympia- Ready', 'color: green; font-size: 1em; font-weight: bolder; ');
  298. var dbf_tooltip = "GrepotemasGrepolympia";
  299. $('.gods_area').append('<div class="btn_settings circle_button dbf_btn" style="top: 90px; right: 3px; z-index: 10;"><div class="dbf_icon js-caption" style="margin: 1px 0px 0px -3px; width: 120px; height: 120px; background: url(https://i.imgur.com/qYhrH44.gif) no-repeat 0px 0px; background-size: 33%"></div></div>');
  300. $('.dbf_btn').tooltip(dbf_tooltip);
  301. $('.dbf_btn').on('mousedown', function () {
  302. $('.dbf_icon').addClass('click');
  303. });
  304. $('.dbf_btn').on('mouseup', function () {
  305. $('.dbf_icon').removeClass('click');
  306. });
  307. $('.dbf_btn').click(editDBF);
  308. $('body').append('<div><div id="dbfwndw" class="ui-dialog ui-widget ui-widget-content ui-corner-all ui-draggable js-window-main-container dbfwndw" tabindex="-1" style="position: absolute; outline: 0px; z-index: 1101; height: auto; width: 800px; top: 96px; left: 124px; display: none;" role="dialog" aria-labelledby="ui-id-6"><div id="drag" class="ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix"><span id="ui-id-6" class="ui-dialog-title">Gatinho: Ferramentas Grepolis</span><a href="#" class="ui-dialog-titlebar-close ui-corner-all" role="button"><span class="ui-icon ui-icon-closethick" style="margin-left: 31%; width: 50px; height: 20px; border: 1px solid; display: inline-block; position: absolute; background: url(https://gppt.innogamescdn.com/images/game/autogenerated/windows/buttons/buttons_a55d708.png) no-repeat 0 -92px;" ></span></a></div>' +
  309. '<div class="gpwindow_frame ui-dialog-content ui-widget-content" style="display: block; width: auto; min-height: 0px; height: 600px;" scrolltop="0" scrollleft="0"><div class="gpwindow_left"></div><div class="gpwindow_right"></div><div class="gpwindow_bottom"><div class="gpwindow_left corner"></div><div class="gpwindow_right corner"></div></div><div class="gpwindow_top"><div class="gpwindow_left corner"></div><div class="gpwindow_right corner"></div></div><div id="gpwnd_1005" style="overflow-x: auto;" class="gpwindow_content"><div class="game_border"><div class="game_border_top"></div><div class="game_border_bottom"></div><div class="game_border_left"></div><div class="game_border_right"></div><div class="game_border_corner corner1"></div><div class="game_border_corner corner2"></div><div class="game_border_corner corner3"></div><div class="game_border_corner corner4"></div><div class="game_header bold" style="height:18px;"><div style="float:left; padding-right:10px;">Multitool Gatinho</div></div>'+
  310.  
  311. '<div id="AB" class="tab">'+
  312. '<input type="radio" name="tabs" id="tab1" checked>'+
  313. '<label for="tab1">Grepolympia.H</label>'+
  314.  
  315. '<input type="radio" name="tabs" id="tab2">'+
  316. ' <label for="tab2">Grepolympia</label>'+
  317.  
  318. '<input type="radio" name="tabs" id="tab3">'+
  319. '<label for="tab3">Pandora</label>'+
  320.  
  321. '<input type="radio" name="tabs" id="tab4">'+
  322. '<label for="tab4">Calcular NC</label>'+
  323.  
  324. '<input type="radio" name="tabs" id="tab5">'+
  325. '<label for="tab5">Cal.Horas</label>'+
  326.  
  327. '<input type="radio" name="tabs" id="tab6">'+
  328. '<label for="tab6">Notas</label>'+
  329.  
  330. '<input type="radio" name="tabs" id="tab7">'+
  331. '<label for="tab7">Calculadora</label>'+
  332.  
  333. '<div class="tabs">'+
  334. '<div id="AC1" class="content">'+
  335. '<h1 style="color: #2c5284;">Grepolympia de inverno</h1><center><img style="width: 38%;"src="https://wiki.pt.grepolis.com/images/6/62/Winter_grepolympia_wiki_logo.png"></center><div id="numbers"></div>'+
  336. '<center>'+
  337. '<input size="32" id="TotalUnit" style="color: #406691; font-weight: 700; width: 230px;" value="Distribution of points" disabled/><input size="2" class="skillPoints" id="skillPoints" style="color: #406691; font-weight: 700; width: 24px; text-align: center;" value="0" /><input size="2" id="Pop1" style="display: none;" value="" disabled/><br>'+
  338. '<p id="diciplinas" style="color: #406691; font-weight: 700; width: 230px;"> Bobsledge </p><input size="32" id="Speed" value="Balance" disabled/><input style="display: none;" size="2" id="pointsgiven1" value="76%" disabled/><input size="2" id="AA1" disabled/><br/><input size="32" id="Force" value="Control" disabled/><input style="display: none;" size="2" id="pointsgiven2" value="12%" disabled/><input size="2" id="AA2" disabled/><br/><input size="32" id="Resistance" value="Speed" disabled/><input style="display: none;" size="2" id="pointsgiven3" value="12%" disabled/><input size="2" id="AA3" disabled/><br>'+
  339. '<p id="diciplinas" style="color: #406691; font-weight: 700; width: 230px;"> Biathlon </p><input size="32" id="Resistance" value="Resistance" disabled/><input style="display: none;" size="2" id="pointsgiven4" value="10%" disabled/><input size="2" id="AA4" disabled/><br/><input size="32" id="Speed" value="Speed" disabled/><input style="display: none;" size="2" id="pointsgiven5" value="80%" disabled/><input size="2" id="AA5" disabled/><br/><input size="32" id="Precision" value="Precision" disabled/><input style="display: none;" size="2" id="pointsgiven6" value="10%" disabled/><input size="2" id="AA6" disabled/><br>' +
  340. '<p id="diciplinas" style="color: #406691; font-weight: 700; width: 230px;"> Figure Skating </p><input size="32" id="Technique" value="Technique" disabled/><input style="display: none;" size="2" id="pointsgiven7" value="12%" disabled/><input size="2" id="AA7" disabled/><br/><input size="32" id="Performance" value="Performance" disabled/><input style="display: none;" size="2" id="pointsgiven8" value="9%" disabled/><input size="2" id="AA8" disabled/><br/><input size="32" id="Balance" value="Balance" disabled/><input style="display: none;" size="2" id="pointsgiven9" value="79%" disabled/><input size="2" id="AA9" disabled/><br>'+
  341. '<p id="diciplinas" style="color: #406691; font-weight: 700; width: 230px;"> Ski Jumping </p><input size="32" id="Speed" value="Speed" disabled/><input style="display: none;" size="2" id="pointsgiven10" value="72%" disabled/><input size="2" id="AA10" disabled/><br/><input size="32" id="Focus" value="Focus" disabled/><input style="display: none;" size="2" id="pointsgiven11" value="5%" disabled/><input size="2" id="AA11" disabled/><br/><input size="32" id="Technique" value="Technique" disabled/><input style="display: none;" size="2" id="pointsgiven12" value="23%" disabled/><input size="2" id="AA12" disabled/><br/>'+
  342. '<div class="form-group mt-2">'+
  343. '<a id="resetBtgh" class="button" href="#">'+
  344. '<span class="left"><span class="right"><span class="middle">Reset</span></span></span>'+
  345. '<span style="clear:both;"></span>'+
  346. '</a>'+
  347. '</div>'+
  348. '</center>'+
  349. ' </div>'+
  350.  
  351. '<div id="AC2" class="content">'+
  352. '<h1 style="color: #2c5284;">Grepolympia</h1><center><img style="width: 38%;"src="https://wiki.pt.grepolis.com/images/9/98/Grepolympia.png"></center>'+
  353. '<center>'+
  354. '<input size="32" id="TotalUnit" style="color: #406691; font-weight: 700; width: 230px;" value="Distribution of points" disabled/><input size="2" class="skillPointsh" id="skillPointsh" style="color: #406691; font-weight: 700; width: 24px; text-align: center;" value="0" /><input size="2" id="Pop1" style="display: none;" value="" disabled/><br>'+
  355. '<p id="diciplinas" style="color: #406691; font-weight: 700; width: 230px;"> Bobsledge </p><input size="32" id="Speed" value="Balance" disabled/><input style="display: none;" size="2" id="pointsgiven11" value="76%" disabled/><input size="2" id="BA1" disabled/><br/><input size="32" id="Force" value="Control" disabled/><input style="display: none;" size="2" id="pointsgiven21" value="12%" disabled/><input size="2" id="BA2" disabled/><br/><input size="32" id="Resistance" value="Speed" disabled/><input style="display: none;" size="2" id="pointsgiven31" value="12%" disabled/><input size="2" id="BA3" disabled/><br>'+
  356. '<p id="diciplinas" style="color: #406691; font-weight: 700; width: 230px;"> Biathlon </p><input size="32" id="Resistance" value="Resistance" disabled/><input style="display: none;" size="2" id="pointsgiven41" value="10%" disabled/><input size="2" id="BA4" disabled/><br/><input size="32" id="Speed" value="Speed" disabled/><input style="display: none;" size="2" id="pointsgiven51" value="80%" disabled/><input size="2" id="BA5" disabled/><br/><input size="32" id="Precision" value="Precision" disabled/><input style="display: none;" size="2" id="pointsgiven61" value="10%" disabled/><input size="2" id="BA6" disabled/><br>' +
  357. '<p id="diciplinas" style="color: #406691; font-weight: 700; width: 230px;"> Figure Skating </p><input size="32" id="Technique" value="Technique" disabled/><input style="display: none;" size="2" id="pointsgiven71" value="12%" disabled/><input size="2" id="BA7" disabled/><br/><input size="32" id="Performance" value="Performance" disabled/><input style="display: none;" size="2" id="pointsgiven81" value="9%" disabled/><input size="2" id="BA8" disabled/><br/><input size="32" id="Balance" value="Balance" disabled/><input style="display: none;" size="2" id="pointsgiven91" value="79%" disabled/><input size="2" id="BA9" disabled/><br>'+
  358. '<p id="diciplinas" style="color: #406691; font-weight: 700; width: 230px;"> Ski Jumping </p><input size="32" id="Speed" value="Speed" disabled/><input style="display: none;" size="2" id="pointsgiven101" value="72%" disabled/><input size="2" id="BA10" disabled/><br/><input size="32" id="Focus" value="Focus" disabled/><input style="display: none;" size="2" id="pointsgiven111" value="5%" disabled/><input size="2" id="BA11" disabled/><br/><input size="32" id="Technique" value="Technique" disabled/><input style="display: none;" size="2" id="pointsgiven121" value="23%" disabled/><input size="2" id="BA12" disabled/><br>'+
  359. '<div class="form-group mt-2">'+
  360. '<a id="resetBtg" class="button" href="#">'+
  361. '<span class="left"><span class="right"><span class="middle">Reset</span></span></span>'+
  362. '<span style="clear:both;"></span>'+
  363. '</a>'+
  364. '</div>'+
  365. '</center>'+
  366. ' </div>'+
  367.  
  368. ' <div id="AC3" class="content">'+
  369. ' <h1 style="color: #2c5284;">Caixa de Pandora</h1><center><img style="width: 38%;"src="https://wiki.pt.grepolis.com/images/1/11/Pandoras_Box_logo.png?20171028210109"></center>'+
  370. '<center id="imf">'+
  371. '<input size="12" id="TotalUnit" value="Total Unidades" disabled="">'+
  372. '<input size="2" style="text-align: center;" id="pointspossible">'+
  373. '<input size="12" id="nul" value="" disabled="">'+
  374. '<input size="2" id="Pop1" value="Pop" disabled="">'+
  375. '<input size="2" id="nul1" value="" disabled="">'+
  376. '<input size="12" id="nul2" value="" disabled="">'+
  377. '<input size="2" id="Pop2" value="Pop" disabled="">'+
  378. '<br>'+
  379. '<input size="12" id="Keres" value="Keres" disabled="">'+
  380. '<input size="2" id="pointsgiven" value="50%" disabled="">'+
  381. '<input size="12" id="Fondibulario" value="Fondibulario" disabled="">'+
  382. '<input size="2" id="pointsperc" disabled="">'+
  383. '<input size="2" id="pointsHoplitas" value="50%" disabled="">'+
  384. '<input size="12" id="Hoplitas" value="Hoplitas" disabled="">'+
  385. '<input size="2" id="pointHop" disabled="">'+
  386. '<br>'+
  387. '<input size="12" id="Thrasus" value="Thrasus" disabled="">'+
  388. '<input size="2" id="pointsgiven" value="50%" disabled="">'+
  389. '<input size="12" id="Fondibulario" value="Fondibulario" disabled="">'+
  390. '<input size="2" id="pointsperc1" disabled="">'+
  391. '<input size="2" id="pointsBigas" value="50%" disabled="">'+
  392. '<input size="12" id="Bigas" value="Bigas" disabled="">'+
  393. '<input size="2" id="pointBigas" disabled="">'+
  394. '<br>'+
  395. '<input size="12" id="Ascálafo" value="Ascálafo" disabled="">'+
  396. '<input size="2" id="pointsgiven" value="50%" disabled="">'+
  397. '<input size="12" id="Espadachim" value="Espadachim" disabled="">'+
  398. '<input size="2" id="pointsperc2" disabled="">'+
  399. '<input size="2" id="pointsArqueiros" value="50%" disabled="">'+
  400. '<input size="12" id="Arqueiros" value="Arqueiros" disabled="">'+
  401. '<input size="2" id="pointArq" disabled="">'+
  402. '<br>'+
  403. '<input size="12" id="Kakodaimones" value="Kakodaimones" disabled="">'+
  404. '<input size="2" id="pointsgiven" value="50%" disabled="">'+
  405. '<input size="12" id="Fondibulario" value="Fondibulario" disabled="">'+
  406. '<input size="2" id="pointsperc3" disabled="">'+
  407. '<input size="2" id="pointsCavaleiros" value="50%" disabled="">'+
  408. '<input size="12" id="Cavaleiros" value="Cavaleiros" disabled="">'+
  409. '<input size="2" id="pointCavaleiros" disabled="">'+
  410. '<br>'+
  411. '<input size="12" id="Taraxippoi" value="Taraxippoi" disabled="">'+
  412. '<input size="2" id="pointsgiven" value="50%" disabled="">'+
  413. '<input size="12" id="Arqueiros" value="Arqueiros" disabled="">'+
  414. '<input size="2" id="pointsperc4" disabled="">'+
  415. '<input size="2" id="pointsHoplitas" value="50%" disabled="">'+
  416. '<input size="12" id="Hoplitas" value="Hoplitas" disabled="">'+
  417. '<input size="2" id="pointHop2" disabled="">'+
  418. '<br>'+
  419. '<input size="12" id="Proseous" value="Proseous" disabled="">'+
  420. '<input size="2" id="pointsgiven" value="50%" disabled="">'+
  421. '<input size="12" id="Cavaleiros" value="Cavaleiros" disabled="">'+
  422. '<input size="2" id="pointCavaleiros2" disabled="">'+
  423. '<input size="2" id="pointsBigas" value="50%" disabled="">'+
  424. '<input size="12" id="Bigas" value="Bigas" disabled="">'+
  425. '<input size="2" id="pointBigas2" disabled="">'+
  426. '<br><br>'+
  427. '<div class="form-group mt-2">'+
  428. '<a id="resetBtp" class="button" href="#">'+
  429. '<span class="left"><span class="right"><span class="middle">Reset</span></span></span>'+
  430. '<span style="clear:both;"></span>'+
  431. '</a>'+
  432. '</div>'+
  433. '</center>'+
  434.  
  435. '</div>'+
  436. '<div id="AC4" class="content">'+
  437. '<h2 style="color: #2c5284;">Cálcular a quantidade maxima de navios de escolta.</h2><img src="https://wiki.pt.grepolis.com/images/4/48/P4.png" style="width: 5%;" alt="Hydras" id="hidra" class="Hydras">'+
  438. '<center>'+
  439. '<h4>Protege o ceu NC contra o feitiço => ( tempestade no mar )</h4>'+
  440. '<h4>A Tempestade no mar destroi entre 10-30% dos navios alvo.</h4>'+
  441. '<h3>Calculadora anti-tempestade</h3>'+
  442. '<p>O valor calculado de todos os navios nao deve passar acima dos <font color="#910000">(170)</font></p>'+
  443. '<table>'+
  444. '<thead>'+
  445. '<tr>'+
  446. '<th>Navio</th>'+
  447. '<th>Valor</th>'+
  448. '</tr>'+
  449. '</thead>'+
  450. '<tfoot>'+
  451. '<tr>'+
  452. '<td><button style="width: 40px; height: 38px;font-size: 8px; background: #e8f5e2;" onclick="somme()">Calcular</button></td>'+
  453. '<td><input id="sum" name="Trirremes" style="width: 32px; height: 32px; text-align: center; color: rgb(0, 128, 0); font-weight: bold;"/></td>'+
  454. '</tr>'+
  455. '</tfoot>'+
  456. '<tfoot>'+
  457. '<tr>'+
  458. '<td><img class="Colonizador" src="https://grmh.pl/i.php?v=sg" alt="Colonizador"/></td>'+
  459. '<td><input id="nbr5" name="Colon" style="width: 40px; height: 37px; text-align:center; background: #e9e9ed; display: block;margin-top: -3px;" type="submit" value="1"/></td>'+
  460. '</tr>'+
  461. '</tfoot>'+
  462. '<tfoot>'+
  463. '<tr>'+
  464. '<td><img class="Hydras" src="https://grmh.pl/i.php?v=gd" alt="Hydras"/></td>'+
  465. '<td><input id="nbr1" name="Hydras" style="width: 32px; height: 32px; text-align:center;margin-top: -5px;"/></td>'+
  466. '</tr>'+
  467. '</tfoot>'+
  468. '<tfoot>'+
  469. '<tr>'+
  470. '<td><img class="Farois" src="https://grmh.pl/i.php?v=sc" alt="Farois"/></td>'+
  471. '<td><input id="nbr2" name="Farois" style="width: 32px; height: 32px; text-align:center;margin-top: -5px;"/></td>'+
  472. '</tr>'+
  473. '</tfoot>'+
  474. '<tfoot>'+
  475. '<tr>'+
  476. '<td><img class="Birremes" src="https://grmh.pl/i.php?v=sb" alt="Birremes"/></td>'+
  477. '<td><input id="nbr3" name="Birremes" style="width: 32px; height: 32px; text-align:center;margin-top: -5px;"/></td>'+
  478. '</tr>'+
  479. '</tfoot>'+
  480. '<tfoot>'+
  481. '<tr>'+
  482. '<td><img class="Trirremes" src="https://grmh.pl/i.php?v=sf" alt="Trirremes"/></td>'+
  483. '<td><input id="nbr4" name="Trirremes" style="width: 32px; height: 32px; text-align:center;margin-top: -5px;"/></td>'+
  484. '</tr>'+
  485. '</tfoot>'+
  486. '</table>'+
  487. '<div><h4 id="Tposi" style="display: inline-block; margin-left: 50px;" type="text" value="Mickey"></h4>&nbsp;&nbsp;&nbsp;&nbsp;'+
  488. '<img id="Posidon" style="width: 5%;" class="Hydras" src="https://wiki.pt.grepolis.com/images/4/48/P4.png" alt="Hydras"/>'+
  489. '</div>'+
  490. '<div class="form-group mt-2">'+
  491. '<a id="resetBtc" class="button" href="#">'+
  492. '<span class="left"><span class="right"><span class="middle">Reset</span></span></span>'+
  493. '<span style="clear:both;"></span>'+
  494. '</a>'+
  495. '</div>'+
  496. '</center>'+
  497. ' </div>'+
  498.  
  499. '<div id="AC5" class="content">'+
  500. '<h1 style="color: #2c5284;">Calculadora de horas</h1><center><img style="width: 38%;"src="https://wiki.fr.grepolis.com/images/4/41/OlympusWikiBanner.png"></center>'+
  501. '<svg style="width: 85px;transform: rotate(20deg); right: 450px; position: absolute; top: 80px; z-index: -5;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Layer_1" viewBox="0 0 422.32 422.32" xml:space="preserve" fill="#000000"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <g id="_x34_2._Calculator_1_"> <g id="XMLID_90_"> <g> <g> <path style="fill:#FF7124;" d="M385.68,121.69v275.63c0,8.28-6.72,15-15,15H269.33v-0.93V266.98V122.57v-0.88H385.68z"></path> </g> <g> <path style="fill:#8ECAC1;" d="M385.68,25v96.69H269.33H152.99H36.64V25c0-8.28,6.72-15,15-15h319.04 C378.96,10,385.68,16.72,385.68,25z"></path> </g> <g> <path style="fill:#E6B263;" d="M269.33,411.39v0.93H152.99v-0.93V266.98H268.6h0.73V411.39z M238.83,358.82 c0-4.71-3.82-8.53-8.53-8.53c-4.71,0-8.53,3.82-8.53,8.53c0,4.71,3.82,8.53,8.53,8.53 C235.01,367.35,238.83,363.53,238.83,358.82z M200.54,320.53c0-4.71-3.81-8.53-8.53-8.53c-4.71,0-8.52,3.82-8.52,8.53 c0,4.71,3.81,8.53,8.52,8.53C196.73,329.06,200.54,325.24,200.54,320.53z"></path> </g> <g> <polygon style="fill:#F2D59F;" points="269.33,122.57 269.33,266.98 268.6,266.98 152.99,266.98 152.99,122.57 152.99,121.69 269.33,121.69 "></polygon> </g> <g> <circle style="fill:#5E2A41;" cx="230.3" cy="358.82" r="8.53"></circle> </g> <g> <path style="fill:#5E2A41;" d="M192.01,312c4.72,0,8.53,3.82,8.53,8.53c0,4.71-3.81,8.53-8.53,8.53c-4.71,0-8.52-3.82-8.52-8.53 C183.49,315.82,187.3,312,192.01,312z"></path> </g> <g> <path style="fill:#F2D59F;" d="M152.99,411.39v0.93H51.64c-8.28,0-15-6.72-15-15V266.98h0.73h115.62V411.39z"></path> </g> <g> <polygon style="fill:#E6B263;" points="152.99,122.57 152.99,266.98 37.37,266.98 36.64,266.98 36.64,121.69 152.99,121.69 "></polygon> </g> </g> <g> <g> <path style="fill:#5E2A41;" d="M370.68,422.32H51.64c-13.785,0-25-11.215-25-25V25c0-13.785,11.215-25,25-25h319.04 c13.785,0,25,11.215,25,25v372.32C395.68,411.105,384.465,422.32,370.68,422.32z M51.64,20c-2.757,0-5,2.243-5,5v372.32 c0,2.757,2.243,5,5,5h319.04c2.757,0,5-2.243,5-5V25c0-2.757-2.243-5-5-5H51.64z"></path> </g> <g> <path style="fill:#5E2A41;" d="M385.68,131.69H36.64c-5.523,0-10-4.477-10-10c0-5.523,4.477-10,10-10h349.04 c5.523,0,10,4.477,10,10C395.68,127.213,391.203,131.69,385.68,131.69z"></path> </g> <g> <path style="fill:#5E2A41;" d="M269.33,421.39c-5.523,0-10-4.477-10-10V122.57c0-5.523,4.477-10,10-10c5.523,0,10,4.477,10,10 v288.82C279.33,416.913,274.853,421.39,269.33,421.39z"></path> </g> <g> <path style="fill:#5E2A41;" d="M268.6,276.98H37.37c-5.523,0-10-4.477-10-10c0-5.523,4.477-10,10-10H268.6 c5.523,0,10,4.477,10,10C278.6,272.503,274.123,276.98,268.6,276.98z"></path> </g> <g> <path style="fill:#5E2A41;" d="M119.54,204.34H70.09c-5.523,0-10-4.477-10-10c0-5.523,4.477-10,10-10h49.45 c5.523,0,10,4.477,10,10C129.54,199.863,125.063,204.34,119.54,204.34z"></path> </g> <g> <path style="fill:#5E2A41;" d="M94.82,229.06c-5.523,0-10-4.477-10-10v-49.45c0-5.523,4.477-10,10-10c5.523,0,10,4.477,10,10 v49.45C104.82,224.583,100.343,229.06,94.82,229.06z"></path> </g> <g> <path style="fill:#5E2A41;" d="M236.38,204.34h-50.44c-5.523,0-10-4.477-10-10c0-5.523,4.477-10,10-10h50.44 c5.523,0,10,4.477,10,10C246.38,199.863,241.903,204.34,236.38,204.34z"></path> </g> <g> <path style="fill:#5E2A41;" d="M113.96,368.82c-2.56,0-5.118-0.976-7.071-2.929l-38.289-38.29 c-3.905-3.905-3.906-10.237-0.001-14.142c3.905-3.905,10.237-3.906,14.142,0l38.29,38.29c3.905,3.905,3.905,10.237,0,14.142 C119.078,367.843,116.519,368.82,113.96,368.82z"></path> </g> <g> <path style="fill:#5E2A41;" d="M75.67,368.82c-2.56,0-5.12-0.977-7.073-2.931c-3.904-3.906-3.903-10.238,0.003-14.142 l38.287-38.287c3.903-3.907,10.235-3.908,14.142-0.003c3.906,3.904,3.908,10.236,0.004,14.142l-38.294,38.293 C80.786,367.844,78.228,368.82,75.67,368.82z"></path> </g> <g> <path style="fill:#5E2A41;" d="M192.01,368.82c-2.559,0-5.119-0.976-7.071-2.929c-3.905-3.905-3.905-10.237,0-14.142 l38.29-38.29c3.905-3.905,10.237-3.905,14.143,0c3.905,3.905,3.905,10.237,0,14.143l-38.29,38.29 C197.129,367.844,194.569,368.82,192.01,368.82z"></path> </g> <g> <path style="fill:#5E2A41;" d="M352.77,259.55h-51.11c-5.523,0-10-4.477-10-10c0-5.523,4.477-10,10-10h51.11 c5.523,0,10,4.477,10,10C362.77,255.073,358.293,259.55,352.77,259.55z"></path> </g> <g> <path style="fill:#5E2A41;" d="M352.77,294.46h-51.11c-5.523,0-10-4.477-10-10c0-5.523,4.477-10,10-10h51.11 c5.523,0,10,4.477,10,10C362.77,289.983,358.293,294.46,352.77,294.46z"></path> </g> <g> <path style="fill:#5E2A41;" d="M152.99,421.39c-5.523,0-10-4.477-10-10V122.57c0-5.523,4.477-10,10-10c5.523,0,10,4.477,10,10 v288.82C162.99,416.913,158.513,421.39,152.99,421.39z"></path> </g> </g> </g> </g> </g></svg>'+
  502. '<br/>'+
  503. '<div><h4>Esta calculadora permite efetuar a soma entre dois horários.</h4></div>'+
  504. '<br/>'+
  505. '<table id="timeTable" class="table table-bordered">'+
  506. '<tbody>'+
  507. '<tr>'+
  508. '<td><strong>horas</strong></td>'+
  509. '<td><strong>minutos</strong></td>'+
  510. '<td><strong>segundos</strong></td>'+
  511. '<td style="border:0">&nbsp;</td>'+
  512. '</tr>'+
  513.  
  514. '<tr>'+
  515. '<td><input style="width: 55px;text-align: center;" min="0" max="23" placeholder="HH" class="hour" maxlength="2"></td>'+
  516. '<td><input style="width: 55px;text-align: center;" min="0" max="59" placeholder="MM" class="minute" maxlength="2"></td>'+
  517. '<td><input style="width: 55px;text-align: center;" min="0" max="59" placeholder="SS" class="second" maxlength="2"></td>'+
  518. '</tr>'+
  519.  
  520. '<tr>'+
  521. '<td><input style="width: 55px;text-align: center;" min="0" max="23" placeholder="HH" class="hour" maxlength="2"></td>'+
  522. '<td><input style="width: 55px;text-align: center;" min="0" max="59" placeholder="MM" class="minute" maxlength="2"></td>'+
  523. '<td><input style="width: 55px;text-align: center;" min="0" max="59" placeholder="SS" class="second" maxlength="2"></td>'+
  524. '</tr>'+
  525.  
  526. '</tbody>'+
  527. '</table>'+
  528.  
  529. '<table id="timeTable2" class="table table-bordered">'+
  530. '<tbody><tr><td><input id="totalTimeHHMMSS" style="font-size: 10px; font-weight: bold;" placeholder="Resultado" class="Total"></td></tr>'+
  531. '</tbody>'+
  532. '</table>'+
  533.  
  534. '<div class="form-group mt-2">'+
  535. '<a id="calcularSomaBtn" class="button" href="#" onclick="calcularSoma();">'+
  536. '<span class="left"><span class="right"><span class="middle">Calcular horas</span></span></span>'+
  537. '<span style="clear:both;"></span>'+
  538. '</a>'+
  539. '</div>'+
  540.  
  541. '<div class="form-group mt-2">'+
  542. '<a id="copiarBtn" class="button" href="#">'+
  543. '<span class="left"><span class="right"><span class="middle">Copiar horas</span></span></span>'+
  544. '<span style="clear:both;"></span>'+
  545. '</a>'+
  546. '</div>'+
  547.  
  548. '<div class="form-group mt-2">'+
  549. '<a id="resetBtn" class="button" href="#">'+
  550. '<span class="left"><span class="right"><span class="middle">Reset</span></span></span>'+
  551. '<span style="clear:both;"></span>'+
  552. '</a>'+
  553. '</div>'+
  554.  
  555. '</div>'+
  556. '<div id="AC6" class="content">'+
  557. '<h1 style="color: #2c5284;">Bloco de nota</h1><center><img style="width: 38%;"src="https://wiki.fr.grepolis.com/images/4/41/OlympusWikiBanner.png"></center>'+
  558. '<img src="https://cdn.icon-icons.com/icons2/74/PNG/256/bloc_notes_14535.png" style="width: 15%;transform: rotate(-20deg); right: 460px; position: absolute; top: 60px; z-index: -1;" alt="notas" id="notas" class="notas">'+
  559. '<h3 style="color: #2c5284; text-shadow: #2c528445 1px 1px 0;">1- Criar una nova anotação, pode ser salva no formato (.txt) em (Downloads) local.</h3>'+
  560. '<button id="adicionar-btn">Adicionar Bloco de Nota</button>'+
  561. '<br><br>'+
  562. '<div class="containers">'+
  563. '</div>'+
  564. '<h3 style="color: #2c5284; text-shadow: #2c528445 1px 1px 0;">2- Modificar uma anotação (.txt*) salva em (Downloads) local.</h3>'+
  565. '<button id="show-btn">Mostrar bloco de nota</button><button id="hide-btn">Ocultar bloco de nota</button>'+
  566. '<br>'+
  567. '<div style="display: none" class="hideshow">'+
  568. '<br>'+
  569. '<div id="Important" style="background: #ccf3ff85;"><svg style="width: 20px;" viewBox="0 0 200 200" data-name="Layer 1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" fill="#000000"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"><defs><style>.cls-1{fill:#ffffff;}.cls-2{fill:#ffc861;}.cls-3{fill:#2f4360;}.cls-4{fill:none;stroke:#2f4360;stroke-linecap:round;stroke-linejoin:round;stroke-width:6px;}</style></defs><title></title><path class="cls-1" d="M180.77,164a11.28,11.28,0,0,1-10.82,8H30a11.33,11.33,0,0,1-9.81-17l70-121.16a11.32,11.32,0,0,1,19.62,0l70,121.16A11.15,11.15,0,0,1,180.77,164Z"></path><path class="cls-2" d="M180.77,164H36.07c-8.72,0-5.17-9.44-.81-17l68.3-118.3a11.2,11.2,0,0,1,6.25,5.1l70,121.16A11.15,11.15,0,0,1,180.77,164Z"></path><path class="cls-3" d="M101.69,139.57q-2.92-.07-5.84,0A4.72,4.72,0,0,1,91,135.15l-3.7-58.79a4.74,4.74,0,0,1,4.55-5q6.9-.25,13.81,0a4.74,4.74,0,0,1,4.55,5l-3.7,58.79A4.72,4.72,0,0,1,101.69,139.57Z"></path><path class="cls-3" d="M105.62,149.69a6.88,6.88,0,0,1-13.69,0c-0.27-3.54,2.8-6.66,6.84-6.66S105.88,146.15,105.62,149.69Z"></path><path class="cls-4" d="M20.23,154.92l70-121.16a11.33,11.33,0,0,1,19.63,0l70,121.16a11.33,11.33,0,0,1-9.81,17H30A11.33,11.33,0,0,1,20.23,154.92Z"></path></g></svg><span style="color: #842c2c; font-weight: 700; font-size: 16px; position: absolute; margin-top: 3px;">Importante</span><br>Enfrentam um problema para carregar um arquivo em uma pasta Local?<br>É imperativo salvar seu trabalho antes de seguir a próxima etapa.<br>Para solucionar o problema clique no botao (Refresh page).</div>'+
  570. '<br>'+
  571. '<input style="display: block; margin-top: 2px;"class="select-zone" type="file" name="inputfile" id="inputfile">'+
  572. '<textarea cols="99" rows="10" id="output"></textarea>'+
  573. '<button class="save-file">Salvar</button>'+
  574. '<button value="Clear" id="clear">Redefinir texto</button>'+
  575. '<button value="Clear" id="resetBtgi">Redefinir nome do arquivo</button>'+
  576. '<button id="btnRefresh" type="button">Atualizar a página</button>'+
  577. '</div>'+
  578. ' </div>'+
  579. '<div id="AC7" class="content">'+
  580. '<h1 style="color: #2c5284;">Calculadora</h1>'+
  581. '<svg style="width: 85px;transform: rotate(20deg); right: 500px; position: absolute; top: 60px; z-index: -5;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Layer_1" viewBox="0 0 422.32 422.32" xml:space="preserve" fill="#000000"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <g id="_x34_2._Calculator_1_"> <g id="XMLID_90_"> <g> <g> <path style="fill:#FF7124;" d="M385.68,121.69v275.63c0,8.28-6.72,15-15,15H269.33v-0.93V266.98V122.57v-0.88H385.68z"></path> </g> <g> <path style="fill:#8ECAC1;" d="M385.68,25v96.69H269.33H152.99H36.64V25c0-8.28,6.72-15,15-15h319.04 C378.96,10,385.68,16.72,385.68,25z"></path> </g> <g> <path style="fill:#E6B263;" d="M269.33,411.39v0.93H152.99v-0.93V266.98H268.6h0.73V411.39z M238.83,358.82 c0-4.71-3.82-8.53-8.53-8.53c-4.71,0-8.53,3.82-8.53,8.53c0,4.71,3.82,8.53,8.53,8.53 C235.01,367.35,238.83,363.53,238.83,358.82z M200.54,320.53c0-4.71-3.81-8.53-8.53-8.53c-4.71,0-8.52,3.82-8.52,8.53 c0,4.71,3.81,8.53,8.52,8.53C196.73,329.06,200.54,325.24,200.54,320.53z"></path> </g> <g> <polygon style="fill:#F2D59F;" points="269.33,122.57 269.33,266.98 268.6,266.98 152.99,266.98 152.99,122.57 152.99,121.69 269.33,121.69 "></polygon> </g> <g> <circle style="fill:#5E2A41;" cx="230.3" cy="358.82" r="8.53"></circle> </g> <g> <path style="fill:#5E2A41;" d="M192.01,312c4.72,0,8.53,3.82,8.53,8.53c0,4.71-3.81,8.53-8.53,8.53c-4.71,0-8.52-3.82-8.52-8.53 C183.49,315.82,187.3,312,192.01,312z"></path> </g> <g> <path style="fill:#F2D59F;" d="M152.99,411.39v0.93H51.64c-8.28,0-15-6.72-15-15V266.98h0.73h115.62V411.39z"></path> </g> <g> <polygon style="fill:#E6B263;" points="152.99,122.57 152.99,266.98 37.37,266.98 36.64,266.98 36.64,121.69 152.99,121.69 "></polygon> </g> </g> <g> <g> <path style="fill:#5E2A41;" d="M370.68,422.32H51.64c-13.785,0-25-11.215-25-25V25c0-13.785,11.215-25,25-25h319.04 c13.785,0,25,11.215,25,25v372.32C395.68,411.105,384.465,422.32,370.68,422.32z M51.64,20c-2.757,0-5,2.243-5,5v372.32 c0,2.757,2.243,5,5,5h319.04c2.757,0,5-2.243,5-5V25c0-2.757-2.243-5-5-5H51.64z"></path> </g> <g> <path style="fill:#5E2A41;" d="M385.68,131.69H36.64c-5.523,0-10-4.477-10-10c0-5.523,4.477-10,10-10h349.04 c5.523,0,10,4.477,10,10C395.68,127.213,391.203,131.69,385.68,131.69z"></path> </g> <g> <path style="fill:#5E2A41;" d="M269.33,421.39c-5.523,0-10-4.477-10-10V122.57c0-5.523,4.477-10,10-10c5.523,0,10,4.477,10,10 v288.82C279.33,416.913,274.853,421.39,269.33,421.39z"></path> </g> <g> <path style="fill:#5E2A41;" d="M268.6,276.98H37.37c-5.523,0-10-4.477-10-10c0-5.523,4.477-10,10-10H268.6 c5.523,0,10,4.477,10,10C278.6,272.503,274.123,276.98,268.6,276.98z"></path> </g> <g> <path style="fill:#5E2A41;" d="M119.54,204.34H70.09c-5.523,0-10-4.477-10-10c0-5.523,4.477-10,10-10h49.45 c5.523,0,10,4.477,10,10C129.54,199.863,125.063,204.34,119.54,204.34z"></path> </g> <g> <path style="fill:#5E2A41;" d="M94.82,229.06c-5.523,0-10-4.477-10-10v-49.45c0-5.523,4.477-10,10-10c5.523,0,10,4.477,10,10 v49.45C104.82,224.583,100.343,229.06,94.82,229.06z"></path> </g> <g> <path style="fill:#5E2A41;" d="M236.38,204.34h-50.44c-5.523,0-10-4.477-10-10c0-5.523,4.477-10,10-10h50.44 c5.523,0,10,4.477,10,10C246.38,199.863,241.903,204.34,236.38,204.34z"></path> </g> <g> <path style="fill:#5E2A41;" d="M113.96,368.82c-2.56,0-5.118-0.976-7.071-2.929l-38.289-38.29 c-3.905-3.905-3.906-10.237-0.001-14.142c3.905-3.905,10.237-3.906,14.142,0l38.29,38.29c3.905,3.905,3.905,10.237,0,14.142 C119.078,367.843,116.519,368.82,113.96,368.82z"></path> </g> <g> <path style="fill:#5E2A41;" d="M75.67,368.82c-2.56,0-5.12-0.977-7.073-2.931c-3.904-3.906-3.903-10.238,0.003-14.142 l38.287-38.287c3.903-3.907,10.235-3.908,14.142-0.003c3.906,3.904,3.908,10.236,0.004,14.142l-38.294,38.293 C80.786,367.844,78.228,368.82,75.67,368.82z"></path> </g> <g> <path style="fill:#5E2A41;" d="M192.01,368.82c-2.559,0-5.119-0.976-7.071-2.929c-3.905-3.905-3.905-10.237,0-14.142 l38.29-38.29c3.905-3.905,10.237-3.905,14.143,0c3.905,3.905,3.905,10.237,0,14.143l-38.29,38.29 C197.129,367.844,194.569,368.82,192.01,368.82z"></path> </g> <g> <path style="fill:#5E2A41;" d="M352.77,259.55h-51.11c-5.523,0-10-4.477-10-10c0-5.523,4.477-10,10-10h51.11 c5.523,0,10,4.477,10,10C362.77,255.073,358.293,259.55,352.77,259.55z"></path> </g> <g> <path style="fill:#5E2A41;" d="M352.77,294.46h-51.11c-5.523,0-10-4.477-10-10c0-5.523,4.477-10,10-10h51.11 c5.523,0,10,4.477,10,10C362.77,289.983,358.293,294.46,352.77,294.46z"></path> </g> <g> <path style="fill:#5E2A41;" d="M152.99,421.39c-5.523,0-10-4.477-10-10V122.57c0-5.523,4.477-10,10-10c5.523,0,10,4.477,10,10 v288.82C162.99,416.913,158.513,421.39,152.99,421.39z"></path> </g> </g> </g> </g> </g></svg>'+
  582. '<center><h1 class="titre">Calculadora<h1>'+
  583. '<table><tr><td colspan="4" align="right" id="case"><span id="calc-output"></span></td></tr></table><table><tr><td><input style="display: block" class="numbir" type="button" value="1" id="button-1" onclick="btm(1)"/></td><td><input style="display: block" class="numbir" type="button" value="2" id="button-2" onclick="btm(2)"/></td><td>'+
  584. '<input style="display: block" class="numbir" type="button" value="3" id="button-3" onclick="btm(3)"/></td><td><input style="display: block" class="operator" type="button" value="C" id="button-C" onclick="btmClean()"/></td></tr><tr><td><input style="display: block" class="numbir" type="button" value="4" id="button-4" onclick="btm(4)"/></td><td>'+
  585. '<input style="display: block" class="numbir" type="button" value="5" id="button-5" onclick="btm(5)"/></td><td><input style="display: block" class="numbir" type="button" value="6" id="button-6" onclick="btm(6)"/></td><td><input style="display: block" class="operator" type="button" value="+" id="button-+" onclick="btmPlus()"/></td></tr><tr><td>'+
  586. '<input style="display: block" class="numbir" type="button" value="7" id="button-7" onclick="btm(7)"/></td><td><input style="display: block" class="numbir" type="button" value="8" id="button-8" onclick="btm(8)"/></td><td>'+
  587. '<input style="display: block" class="numbir" type="button" value="9" id="button-9" onclick="btm(9)"/></td><td><input style="display: block" class="operator" type="button" value="-" id="button--" onclick="btmLess()"/></td></tr><tr><td><input style="display: block" class="operator" type="button" value="x" id="button-*" onclick="btmMultiply()"/></td><td>'+
  588. '<input style="display: block" class="numbir"type="button" value="0" id="button-0" onclick="btm(0)"/></td><td><input style="display: block" class="operator" type="button" value="÷" id="button-/" onclick="btmDivision()"/></td><td><input style="display: block" class="operator" type="button" value="=" id="button-=" onclick="btmEgal()"/></td></tr>'+
  589. '<tfoot>'+
  590. '<tr><th scope="row" colspan="3"><input class="numbir" type="button" onclick="" value="" id="button-" style="display: block;width: 158px;"></th>'+
  591. '<td><input style="display: block" class="numbir"type="button" value="." id="button-." onclick="btm(.)"/></td></tr>'+
  592. '</tfoot>'+
  593. '</table></center>'+
  594. ' </div>'+
  595. ' </div>'+
  596. ' </div>'+
  597. '</div>');
  598. function editDBF() {
  599. var x = document.getElementById('dbfwndw');
  600. if (x.style.display === 'none') {
  601. x.style.display = 'block';
  602. } else {
  603. x.style.display = 'none';
  604. }
  605. }
  606. $('.ui-dialog-titlebar-close').on('mousedown', function () {
  607. $('.dbf_icon').addClass('click');
  608. });
  609. $('.ui-dialog-titlebar-close').on('mouseup', function () {
  610. $('.dbf_icon').removeClass('click');
  611. });
  612. $('.ui-dialog-titlebar-close').click(editDBF);
  613. $( "#dbfwndw" ).draggable();
  614.  
  615. $(function() {
  616. $('#skillPoints').on('input', function() {
  617. calculate();
  618. });
  619.  
  620. function calculate() {
  621. var pPos = parseInt($('#skillPoints').val());
  622. var pEarned1 = parseInt($('#pointsgiven1').val());
  623. var pEarned2 = parseInt($('#pointsgiven2').val());
  624. var pEarned3 = parseInt($('#pointsgiven3').val());
  625. var pEarned4 = parseInt($('#pointsgiven4').val());
  626. var pEarned5 = parseInt($('#pointsgiven5').val());
  627. var pEarned6 = parseInt($('#pointsgiven6').val());
  628. var pEarned7 = parseInt($('#pointsgiven7').val());
  629. var pEarned8 = parseInt($('#pointsgiven8').val());
  630. var pEarned9 = parseInt($('#pointsgiven9').val());
  631. var pEarned10 = parseInt($('#pointsgiven10').val())
  632. var pEarned11 = parseInt($('#pointsgiven11').val());
  633. var pEarned12 = parseInt($('#pointsgiven12').val());
  634.  
  635. var percBal = "";
  636. var percCom = "";
  637. var percSpee = "";
  638. var percResi = "";
  639. var percSpeed = "";
  640. var percPrec = "";
  641. var percTechn = "";
  642. var percPerf = "";
  643. var percBala = "";
  644. var percSpeedi = "";
  645. var percFocus = "";
  646. var percTechni = "";
  647.  
  648. if (isNaN(pPos) || isNaN(pEarned1) || isNaN(pEarned2) || isNaN(pEarned3) || isNaN(pEarned4) || isNaN(pEarned5) || isNaN(pEarned6) || isNaN(pEarned7) || isNaN(pEarned8) || isNaN(pEarned9) || isNaN(pEarned10) || isNaN(pEarned11) || isNaN(pEarned12)) {
  649. percBal = "";
  650. percCom = "";
  651. percSpee = "";
  652.  
  653. } else {
  654. percBal = ((pEarned1 / 100) * pPos).toFixed(0);
  655. percCom = ((pEarned2 / 100) * pPos).toFixed(0);
  656. percSpee = ((pEarned3 / 100) * pPos).toFixed(0);
  657. percResi = ((pEarned4 / 100) * pPos).toFixed(0);
  658. percSpeed = ((pEarned5 / 100) * pPos).toFixed(0);
  659. percPrec = ((pEarned6 / 100) * pPos).toFixed(0);
  660. percTechn = ((pEarned7 / 100) * pPos).toFixed(0);
  661. percPerf = ((pEarned8 / 100) * pPos).toFixed(0);
  662. percBala = ((pEarned9 / 100) * pPos).toFixed(0);
  663. percSpeedi = ((pEarned10 / 100) * pPos).toFixed(0);
  664. percFocus = ((pEarned11 / 100) * pPos).toFixed(0);
  665. percTechni = ((pEarned12 / 100) * pPos).toFixed(0);
  666. }
  667.  
  668. $('#AA1').val(percBal);
  669. $('#AA2').val(percCom);
  670. $('#AA3').val(percSpee);
  671. $('#AA4').val(percResi);
  672. $('#AA5').val(percSpeed);
  673. $('#AA6').val(percPrec);
  674. $('#AA7').val(percTechn);
  675. $('#AA8').val(percPerf);
  676. $('#AA9').val(percBala);
  677. $('#AA10').val(percSpeedi);
  678. $('#AA11').val(percFocus);
  679. $('#AA12').val(percTechni);
  680.  
  681. }
  682. });
  683.  
  684. $(function() {
  685. $('#skillPointsh').on('input', function() {
  686. calculate();
  687. });
  688.  
  689. function calculate() {
  690. var pPos = parseInt($('#skillPointsh').val());
  691. var pEarned1 = parseInt($('#pointsgiven11').val());
  692. var pEarned2 = parseInt($('#pointsgiven21').val());
  693. var pEarned3 = parseInt($('#pointsgiven31').val());
  694. var pEarned4 = parseInt($('#pointsgiven41').val());
  695. var pEarned5 = parseInt($('#pointsgiven51').val());
  696. var pEarned6 = parseInt($('#pointsgiven61').val());
  697. var pEarned7 = parseInt($('#pointsgiven71').val());
  698. var pEarned8 = parseInt($('#pointsgiven81').val());
  699. var pEarned9 = parseInt($('#pointsgiven91').val());
  700. var pEarned10 = parseInt($('#pointsgiven101').val())
  701. var pEarned11 = parseInt($('#pointsgiven111').val());
  702. var pEarned12 = parseInt($('#pointsgiven121').val());
  703. var percBal = "";
  704. var percCom = "";
  705. var percSpee = "";
  706. var percResi = "";
  707. var percSpeed = "";
  708. var percPrec = "";
  709. var percTechn = "";
  710. var percPerf = "";
  711. var percBala = "";
  712. var percSpeedi = "";
  713. var percFocus = "";
  714. var percTechni = "";
  715.  
  716. if (isNaN(pPos) || isNaN(pEarned1) || isNaN(pEarned2) || isNaN(pEarned3) || isNaN(pEarned4) || isNaN(pEarned5) || isNaN(pEarned6) || isNaN(pEarned7) || isNaN(pEarned8) || isNaN(pEarned9) || isNaN(pEarned10) || isNaN(pEarned11) || isNaN(pEarned12)) {
  717. percBal = "";
  718. percCom = "";
  719. percSpee = "";
  720.  
  721. } else {
  722. percBal = ((pEarned1 / 100) * pPos).toFixed(0);
  723. percCom = ((pEarned2 / 100) * pPos).toFixed(0);
  724. percSpee = ((pEarned3 / 100) * pPos).toFixed(0);
  725. percResi = ((pEarned4 / 100) * pPos).toFixed(0);
  726. percSpeed = ((pEarned5 / 100) * pPos).toFixed(0);
  727. percPrec = ((pEarned6 / 100) * pPos).toFixed(0);
  728. percTechn = ((pEarned7 / 100) * pPos).toFixed(0);
  729. percPerf = ((pEarned8 / 100) * pPos).toFixed(0);
  730. percBala = ((pEarned9 / 100) * pPos).toFixed(0);
  731. percSpeedi = ((pEarned10 / 100) * pPos).toFixed(0);
  732. percFocus = ((pEarned11 / 100) * pPos).toFixed(0);
  733. percTechni = ((pEarned12 / 100) * pPos).toFixed(0);
  734. }
  735.  
  736. $('#BA1').val(percBal);
  737. $('#BA2').val(percCom);
  738. $('#BA3').val(percSpee);
  739. $('#BA4').val(percResi);
  740. $('#BA5').val(percSpeed);
  741. $('#BA6').val(percPrec);
  742. $('#BA7').val(percTechn);
  743. $('#BA8').val(percPerf);
  744. $('#BA9').val(percBala);
  745. $('#BA10').val(percSpeedi);
  746. $('#BA11').val(percFocus);
  747. $('#BA12').val(percTechni);
  748.  
  749. }
  750. });
  751.  
  752. $(function(){
  753. $('#pointspossible').on('input', function() {
  754. calculate();
  755. });
  756. $('#pointsgiven').on('input', function() {
  757. calculate();
  758. });
  759. function calculate(){
  760. var pPos = parseInt($('#pointspossible').val());
  761. var pEarned = parseInt($('#pointsgiven').val());
  762. var perc="";
  763. if(isNaN(pPos) || isNaN(pEarned)){
  764. perc=" ";
  765. }else{
  766. perc = ((pEarned/100) * pPos).toFixed(0);
  767. percBig = ((pEarned/100) * (pPos/4)).toFixed(0);
  768. percCav = ((pEarned/100) * (pPos/3)).toFixed(0);
  769. }
  770. $('#pointsperc').val(perc);
  771. $('#pointsperc1').val(perc);
  772. $('#pointsperc2').val(perc);
  773. $('#pointsperc3').val(perc);
  774. $('#pointsperc4').val(perc);
  775. $('#pointHop').val(perc);
  776. $('#pointArq').val(perc);
  777. $('#pointHop2').val(perc);
  778. $('#pointBigas').val(percBig);
  779. $('#pointCavaleiros').val(percCav);
  780. $('#pointBigas2').val(percBig);
  781. $('#pointCavaleiros2').val(percCav);
  782. }
  783. });
  784.  
  785. (function($) {
  786. 'use strict';
  787. function somme() {
  788. var nbr1, nbr2, nbr3, nbr4, nbr5, sum;
  789. var percentual = 0.30;
  790.  
  791. nbr1 = Number($("#nbr1").val()) * 50;
  792. nbr2 = Number($("#nbr2").val()) * 10;
  793. nbr3 = Number($("#nbr3").val()) * 8;
  794. nbr4 = Number($("#nbr4").val()) * 16;
  795. nbr5 = Number($("#nbr5").val()) * 170;
  796.  
  797. sum = Math.round(nbr1 + nbr2 + nbr3 + nbr4 + nbr5);
  798.  
  799. var sumElement = $("#sum");
  800. sumElement.val(Math.round(sum * percentual));
  801.  
  802. if (sum > 566) {
  803. console.log('Valor acima de 170. Mudando para vermelho.');
  804. sumElement.css({ color: 'red', fontWeight: 'bold' });
  805. $("#Posidon").css({ filter: 'drop-shadow(16px 16px 20px red) invert(5%)' });
  806. $("#Tposi").html("Colon Afundado");
  807. $("#Tposi").css({ color: 'red' });
  808. } else {
  809. console.log('Valor 170 ou abaixo. Mudando para verde.');
  810. sumElement.css({ color: 'green', fontWeight: 'bold' });
  811. $("#Posidon").css({ filter: 'drop-shadow(16px 16px 20px green) invert(5%)' });
  812. // Limpar mensagem em caso de mudança para um valor menor ou igual a 566
  813. $("#Tposi").html("Sem danos no Colon");
  814. $("#Tposi").css({ color: 'green' });
  815. }
  816. }
  817.  
  818. $("#nbr1, #nbr2, #nbr3, #nbr4, #nbr5").on("change", somme);
  819. somme();
  820. })(jQuery);
  821.  
  822. function limparCampos(campos) {
  823. for (var i = 0; i < campos.length; i++) {
  824. $('#' + campos[i]).val('');
  825. }
  826. }
  827.  
  828. $(document).ready(function() {
  829. $('#resetBtc').click(function() {
  830. limparCampos(['nbr1', 'nbr2', 'nbr3', 'nbr4', 'sum']);
  831. });
  832.  
  833. $('#resetBtp').click(function() {
  834. limparCampos(['pointspossible', 'pointsperc', 'pointsperc1', 'pointsperc2', 'pointsperc3', 'pointsperc4', 'pointCavaleiros2', 'pointHop', 'pointBigas', 'pointArq', 'pointCavaleiros', 'pointHop2', 'pointBigas2']);
  835. });
  836.  
  837. $('#resetBtg').click(function() {
  838. limparCampos(['skillPointsh', 'BA1', 'BA2', 'BA3', 'BA4', 'BA5', 'BA6', 'BA7', 'BA8', 'BA9', 'BA10', 'BA11', 'BA12']);
  839. });
  840.  
  841. $('#resetBtgh').click(function() {
  842. limparCampos(['skillPoints', 'AA1', 'AA2', 'AA3', 'AA4', 'AA5', 'AA6', 'AA7', 'AA8', 'AA9', 'AA10', 'AA11', 'AA12']);
  843. });
  844. $('#resetBtgi').click(function() {
  845. limparCampos(['inputfile']);
  846. });
  847. });
  848.  
  849. (function() {
  850. 'use strict';
  851.  
  852. function calcularSoma() {
  853. var totalHoras = 0;
  854. var totalMinutos = 0;
  855. var totalSegundos = 0;
  856.  
  857. $('#timeTable tbody tr').each(function() {
  858. var horas = parseInt($(this).find('.hour').val()) || 0;
  859. var minutos = parseInt($(this).find('.minute').val()) || 0;
  860. var segundos = parseInt($(this).find('.second').val()) || 0;
  861.  
  862. totalHoras += horas;
  863. totalMinutos += minutos;
  864. totalSegundos += segundos;
  865. });
  866.  
  867. totalMinutos += Math.floor(totalSegundos / 60);
  868. totalSegundos %= 60;
  869.  
  870. totalHoras += Math.floor(totalMinutos / 60);
  871. totalMinutos %= 60;
  872.  
  873. $('#totalTimeHHMMSS').val(
  874. padLeft(totalHoras, 2) + ':' +
  875. padLeft(totalMinutos, 2) + ':' +
  876. padLeft(totalSegundos, 2)
  877. );
  878. }
  879.  
  880. function padLeft(value, length) {
  881. return ('0' + value).slice(-length);
  882. }
  883.  
  884. $('#resetBtn').click(function() {
  885. // Limpa os campos .hour, .minute e .second
  886. $('.hour').val('');
  887. $('.minute').val('');
  888. $('.second').val('');
  889.  
  890. $('#totalTimeHHMMSS').val('');
  891. });
  892.  
  893. $('#calcularSomaBtn').click(function() {
  894. calcularSoma(); // Chamada movida para dentro da função anônima
  895. });
  896.  
  897. $('#copiarBtn').click(function() {
  898. $('#totalTimeHHMMSS').select();
  899. document.execCommand('copy');
  900. });
  901.  
  902. calcularSoma();
  903. })();
  904.  
  905. (function() {
  906. 'use strict';
  907. function injectCustomScript() {
  908. function btm(val) {
  909. document.getElementById("calc-output").innerHTML += val;
  910. }
  911.  
  912. function btmClean() {
  913. document.getElementById("calc-output").innerHTML = "";
  914. }
  915.  
  916. function btmPlus() {
  917. document.getElementById("calc-output").innerHTML += "+";
  918. }
  919.  
  920. function btmLess() {
  921. document.getElementById("calc-output").innerHTML += "-";
  922. }
  923.  
  924. function btmMultiply() {
  925. document.getElementById("calc-output").innerHTML += "*";
  926. }
  927.  
  928. function btmDivision() {
  929. document.getElementById("calc-output").innerHTML += "/";
  930. }
  931.  
  932. function btmEgal() {
  933. var egal = eval(document.getElementById('calc-output').innerHTML);
  934. document.getElementById('calc-output').innerHTML = egal;
  935. }
  936.  
  937. document.getElementById('button-1').addEventListener('click', function() {
  938. btm(1);
  939. });
  940.  
  941. document.getElementById('button-2').addEventListener('click', function() {
  942. btm(2);
  943. });
  944.  
  945. document.getElementById('button-3').addEventListener('click', function() {
  946. btm(3);
  947. });
  948.  
  949. document.getElementById('button-4').addEventListener('click', function() {
  950. btm(4);
  951. });
  952.  
  953. document.getElementById('button-5').addEventListener('click', function() {
  954. btm(5);
  955. });
  956.  
  957. document.getElementById('button-6').addEventListener('click', function() {
  958. btm(6);
  959. });
  960.  
  961. document.getElementById('button-7').addEventListener('click', function() {
  962. btm(7);
  963. });
  964.  
  965. document.getElementById('button-8').addEventListener('click', function() {
  966. btm(8);
  967. });
  968.  
  969. document.getElementById('button-9').addEventListener('click', function() {
  970. btm(9);
  971. });
  972.  
  973. document.getElementById('button-0').addEventListener('click', function() {
  974. btm(0);
  975. });
  976.  
  977. document.getElementById('button-C').addEventListener('click', function() {
  978. btmClean();
  979. });
  980.  
  981. document.getElementById('button-+').addEventListener('click', function() {
  982. btmPlus();
  983. });
  984.  
  985. document.getElementById('button--').addEventListener('click', function() {
  986. btmLess();
  987. });
  988.  
  989. document.getElementById('button-*').addEventListener('click', function() {
  990. btmMultiply();
  991. });
  992.  
  993. document.getElementById('button-/').addEventListener('click', function() {
  994. btmDivision();
  995. });
  996.  
  997. document.getElementById('button-=').addEventListener('click', function() {
  998. btmEgal();
  999. });
  1000. document.getElementById('button-.').addEventListener('click', function() {
  1001. btm('.');
  1002. });
  1003. }
  1004.  
  1005. function waitForDocumentReady(callback) {
  1006. if (document.readyState === 'complete') {
  1007. callback();
  1008. } else {
  1009. document.addEventListener('DOMContentLoaded', callback);
  1010. }
  1011. }
  1012.  
  1013. waitForDocumentReady(function() {
  1014. injectCustomScript();
  1015. });
  1016. })();
  1017.  
  1018. function adicionarBlocoDeNota() {
  1019. var novoBloco = $('<div class="bloco-de-nota"><input type="text" class="titulo-input" placeholder="Título"><textarea class="nota-input" cols="96" rows="10" placeholder="Nota"></textarea><br><button class="format-btn" data-format="[b][/b]">[b]</button><button class="format-btn" data-format="[i][/i]">[i]</button><button class="format-btn" data-format="[u][/u]">[u]</button><button class="format-btn" data-format="[s][/s]">[s]</button><button class="format-btn" data-format="[center][/center]">[center]</button><button class="format-btn" data-format="[player][/player]">[player]</button><button class="format-btn" data-format="[ally][/ally]">[ally]</button><button class="format-btn" data-format="[size=7][/size]">[size]</button><button class="format-btn" data-format="[img][/img]">[img]</button><button class="format-btn" data-format="[spoiler=Spoiler][/spoiler]">[spoiler]</button><button class="format-btn" data-format="[table]\n[**][||][/**]\n[*][|][/*]\n[/table]">[table]</button><button class="format-btn" data-format="[quote=Author][/quote]">[quote]</button><button class="format-btn" data-format="[url][/url]">[url]</button><button class="format-btn" data-format="[town][/town]">[town]</button><button class="format-btn" data-format="[color=#6E0000][/color]">[color]</button><button class="format-btn" data-format="[island][/island]">[island]</button><br><button class="salvar-btn">Salvar</button><button class="deletar-btn">Excluir</button><button class="reset-btn">Reiniciar</button></div>');
  1020. $('.containers').append(novoBloco);
  1021.  
  1022. novoBloco.find('.reset-btn').click(function() {
  1023. $(this).siblings(['.nota-input', '.titulo-input']).val('');
  1024. });
  1025. }
  1026.  
  1027. function adicionarFormato() {
  1028. var notaInput = $(this).siblings('.nota-input');
  1029. var formato = $(this).data('format');
  1030. var nota = notaInput.val();
  1031. notaInput.val(nota + formato);
  1032. notaInput.focus();
  1033. }
  1034.  
  1035. function deletarBlocoDeNota() {
  1036. $(this).parent('.bloco-de-nota').remove();
  1037. }
  1038.  
  1039. function salvarBlocoDeNota() {
  1040. var titulo = $(this).siblings('.titulo-input').val();
  1041. var nota = $(this).siblings('.nota-input').val();
  1042.  
  1043. if (titulo.trim() === "") {
  1044. alert("Por favor, insira um título para salvar a nota.");
  1045. return;
  1046. }
  1047.  
  1048. salvarNotaNoDownload(titulo, nota);
  1049. }
  1050.  
  1051. function salvarNotaNoDownload(titulo, nota) {
  1052. var notasTexto = titulo + "\n" + nota + "\n\n";
  1053. var blob = new Blob([notasTexto], { type: 'text/plain' });
  1054. var url = window.URL.createObjectURL(blob);
  1055. var a = document.createElement('a');
  1056. a.href = url;
  1057. a.download = titulo + '.txt';
  1058. document.body.appendChild(a);
  1059. a.click();
  1060.  
  1061. document.body.removeChild(a);
  1062. window.URL.revokeObjectURL(url);
  1063. }
  1064.  
  1065. $(document).ready(function() {
  1066.  
  1067. $('#adicionar-btn').click(adicionarBlocoDeNota);
  1068.  
  1069. $('.containers').on('click', '.format-btn', adicionarFormato);
  1070.  
  1071. $('.containers').on('click', '.deletar-btn', deletarBlocoDeNota);
  1072.  
  1073. $('.containers').on('click', '.salvar-btn', salvarBlocoDeNota);
  1074. });
  1075.  
  1076. var loadedFileName = "";
  1077.  
  1078. document.getElementById('inputfile').addEventListener('change', function() {
  1079. var fr = new FileReader();
  1080. fr.onload = function() {
  1081. loadedFileName = document.getElementById('inputfile').files[0].name;
  1082. document.getElementById('output').textContent = fr.result;
  1083. }
  1084. fr.readAsText(this.files[0]);
  1085. });
  1086.  
  1087. const saveBtn = document.querySelector('button.save-file');
  1088.  
  1089. saveBtn.addEventListener('click', function() {
  1090. console.log('Botão de salvar clicado');
  1091. var textArea = document.querySelector("textarea");
  1092. var textContent = textArea.value;
  1093. console.log('Conteúdo do textarea:', textContent);
  1094. var textBlob = new Blob([textContent], { type: 'text/plain' });
  1095. var tempLink = document.createElement("a");
  1096. tempLink.setAttribute('href', URL.createObjectURL(textBlob));
  1097. tempLink.setAttribute('download', loadedFileName.toLowerCase()); // Usa o nome do arquivo carregado para o download
  1098. tempLink.style.display = 'none'; // Oculta o link
  1099. console.log('Link temporário criado:', tempLink);
  1100. document.body.appendChild(tempLink); // Adiciona o link ao corpo do documento
  1101. console.log('Link temporário adicionado ao corpo do documento');
  1102. tempLink.click(); // Simula um clique no link
  1103. console.log('Clique no link simulado');
  1104. document.body.removeChild(tempLink); // Remove o link do corpo do documento
  1105. console.log('Link temporário removido do corpo do documento');
  1106. });
  1107.  
  1108. let widthMachine = document.querySelector(".width-machine");
  1109.  
  1110. function calcHeight(value) {
  1111. let numberOfLineBreaks = (value.match(/\n/g) || []).length;
  1112. let newHeight = 20 + numberOfLineBreaks * 20 + 12 + 2;
  1113. return newHeight;
  1114. }
  1115.  
  1116. let clear = document.querySelector('button#clear');
  1117. let textarea = document.querySelector('#output');
  1118.  
  1119. clear.addEventListener('click', function() {
  1120. textarea.value = '';
  1121. });
  1122.  
  1123. textarea.addEventListener("keyup", () => {
  1124. textarea.style.height = calcHeight(textarea.value) + "px";
  1125. });
  1126.  
  1127. $("#hide-btn").click(function(){
  1128. $(".hideshow").hide();
  1129. });
  1130. $("#show-btn").click(function(){
  1131. $(".hideshow").show();
  1132. });
  1133.  
  1134. const refreshBtn = document.getElementById("btnRefresh");
  1135. function handleClick() {
  1136. window.location.reload();
  1137. }
  1138. refreshBtn.addEventListener("click", handleClick);