Guzik

jsfoidfsdgs

  1. // ==UserScript==
  2. // @name Guzik
  3. // @namespace https://mongla.net
  4. // @version 6.6.6
  5. // @description jsfoidfsdgs
  6. // @include https://www.ufs.pt/forum/showthread.php*
  7. // @require https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js
  8. // ==/UserScript==
  9.  
  10. (function() {
  11. var css = ".wheatButton { padding: 5px 10px; display: inline-block; color: black!important; font-size: 11px; font-weight: bold; font-variant: small-caps; text-decoration: none!important; background-color: #606060; border-radius: 2px; cursor: pointer; -webkit-font-smoothing:antialiased; box-sizing: border-box; box-shadow: -2px 2px 1px black; border: 1px solid #1b1b1b; transition: all 250ms; } .wheatButton:hover{ background-color: #1b1b1b; color: #d35400!important; box-shadow: -4px 4px 5px black!important; border: 1px solid #606060; transition: all 250ms;}";
  12. if (typeof GM_addStyle != "undefined") {
  13. GM_addStyle(css);
  14. } else if (typeof PRO_addStyle != "undefined") {
  15. PRO_addStyle(css);
  16. } else if (typeof addStyle != "undefined") {
  17. addStyle(css);
  18. } else {
  19. var heads = document.getElementsByTagName("head");
  20. if (heads.length > 0) {
  21. var node = document.createElement("style");
  22. node.type = "text/css";
  23. node.appendChild(document.createTextNode(css));
  24. heads[0].appendChild(node);
  25. }
  26. }
  27. })();
  28.  
  29.  
  30. $(document).ready(function ()
  31. {
  32. $("<a>",
  33. {
  34. "class": "wheatButton",
  35. text: "Edytuj Pierwszy",
  36. "id": "PostTwo",
  37. value: "up",
  38. type: "button",
  39. style: "position: fixed; top: 5px; right: 5px;"
  40. }).appendTo("body");
  41. $("<a>",
  42. {
  43. "class": "wheatButton",
  44. text: "Sprawdzam",
  45. "id": "sprawdzam",
  46. value: "up",
  47. type: "button",
  48. style: "position: fixed; top: 33px; right: 5px;"
  49. }).appendTo("body");
  50. $("<a>",
  51. {
  52. "class": "wheatButton",
  53. text: "Zatwierdź",
  54. "id": "zatwierdz",
  55. value: "up",
  56. type: "button",
  57. style: "position: fixed; top: 61px; right: 5px;"
  58. }).appendTo("body");
  59. $("<a>",
  60. {
  61. "class": "wheatButton",
  62. text: "Niezatwierdzony",
  63. "id": "niet",
  64. value: "up",
  65. type: "button",
  66. style: "position: fixed; top: 89px; right: 5px;"
  67. }).appendTo("body");
  68. $("<a>",
  69. {
  70. "class": "wheatButton",
  71. text: "Usuń 2 Post",
  72. "id": "stamp",
  73. value: "up",
  74. type: "button",
  75. style: "position: fixed; top: 117px; right: 5px;"
  76. }).appendTo("body");
  77. $("<a>",
  78. {
  79. "class": "wheatButton",
  80. text: "Przenieś",
  81. "id": "teleport",
  82. value: "up",
  83. type: "button",
  84. style: "position: fixed; top: 145px; right: 5px;"
  85. }).appendTo("body");
  86. $("<a>",
  87. {
  88. "class": "wheatButton",
  89. text: "Dodaj Hide",
  90. "id": "addHide",
  91. value: "up",
  92. type: "button",
  93. style: "position: fixed; top: 173px; right: 5px;"
  94. }).appendTo("body");
  95. $("<a>",
  96. {
  97. "class": "wheatButton",
  98. text: "HC Up Na Życzenie",
  99. "id": "zyczenie",
  100. value: "up",
  101. type: "button",
  102. style: "position: fixed; top: 201px; right: 5px;"
  103. }).appendTo("body");
  104.  
  105. $('#PostTwo').click(function() {
  106. testy();
  107. });
  108. $('#sprawdzam').click(function() {
  109. sprawdzam();
  110. }); $('#zatwierdz').click(function() {
  111. zatwierdz();
  112. }); $('#niet').click(function() {
  113. niet();
  114. }); $('#stamp').click(function() {
  115. stamp();
  116. });
  117. $('#teleport').click(function() {
  118. teleport();
  119. });
  120. $('#czer').click(function() {
  121. czer();
  122. });
  123. $('#addHide').click(function() {
  124. addHide();
  125. });
  126. $('#zyczenie').click(function() {
  127. upnazyczenie();
  128. });
  129. function testy() {
  130. postie = $(".editpost").first().attr("href");
  131. window.location.href = postie;
  132. }
  133. function sprawdzam(){
  134. $('.cke_enable_context_menu').last().val('Pacze/moje cyferkicyferkicyferki ' + $("#posts li:first-child").first().attr("id"));
  135. $('#qr_submit').click()
  136. }
  137. function addHide(){
  138. $(".editpost").first().click()
  139. setTimeout(
  140. function()
  141. {
  142. $('.cke_enable_context_menu').first().val(
  143. function(i,val){
  144. return '[hide] ' + val;
  145. });
  146. $('.cke_enable_context_menu').first().val(
  147. function(i,val){
  148. return val + '[/hide]';
  149. });
  150. $("input[value='Zapisz']").first().click()
  151. }, 2000);
  152. }
  153. function czer(){
  154. $('.cke_enable_context_menu').last().val('[center][img]https://www.ufs.pt/grafika/niezatwierdzone.png[/img][/center]')
  155. $('#qr_submit').click()
  156. }
  157. function zatwierdz(){
  158. if($(".editpost").length==1) {
  159. sprawdzam();
  160. setTimeout(function() { zatwierdz(); }, 2000);
  161. } else {
  162. $(".editpost").last().click()
  163. setTimeout(
  164. function()
  165. {
  166. $('.cke_enable_context_menu').first().val('[center][img]https://www.ufs.pt/grafika/zatwierdzone.png[/img][/center]')
  167. $("input[value='Zapisz']").first().click()
  168. }, 2000);
  169. }
  170. }
  171. function niet(){
  172. if($(".editpost").length==1) {
  173. sprawdzam();
  174. setTimeout(function() { niet(); }, 2000);
  175. } else {
  176. $(".editpost").last().click()
  177. setTimeout(
  178. function()
  179. {
  180. $('.cke_enable_context_menu').first().val('[center][img]https://www.ufs.pt/grafika/niezatwierdzone.png[/img][/center]')
  181. $("input[value='Zapisz']").first().click()
  182. }, 2000);
  183. }
  184. }
  185. function stamp(){
  186. $(".editpost:eq(1)").last().click()
  187. setTimeout(
  188. function()
  189. {
  190. $("input[value='Usuń']").first().click()
  191. $("input[name='deletepost']").first().click()
  192. $("input[value='Usuń posta']").first().click()
  193. }, 2000);
  194. }
  195. function teleport(){
  196. $("a[class='popupctrl']").first().click()
  197. $("input[value='movethread']").first().click()
  198. $("input[value='Dalej']").first().click()
  199. }
  200. function upnazyczenie(){
  201. const regex = /(showthread\.php\?\d+)/gm;
  202. let m;
  203. var str = ($("h1 .threadtitle a").attr("href"));
  204. let link = [];
  205. while ((m = regex.exec(str)) !== null) {
  206. // This is necessary to avoid infinite loops with zero-width matches
  207. if (m.index === regex.lastIndex) {
  208. regex.lastIndex++;
  209. }
  210.  
  211. // The result can be accessed through the `m`-variable.
  212. m.forEach((match, groupIndex) => {
  213. console.log(`Found match, group ${groupIndex}: ${match}`);
  214. link.push(match);
  215. });
  216. }
  217. // console.log(link);
  218. // $('.cke_enable_context_menu').first().val('[img]https://www.ufs.pt/forum/images/icons/http.png[/img]' + $("title").text().match(/.*GB/) + ' [url=https://www.ufs.pt/forum/' + ($("h1 .threadtitle a").attr("href")) + ']' + $("h1 .threadtitle a").text() + '[/url]');
  219. $('.cke_enable_context_menu').first().val('[img]https://www.ufs.pt/forum/images/icons/http.png[/img]' + $("title").text().match(/.*GB/) + ' [url=https://www.ufs.pt/forum/' + (link[1]) + ']' + $("h1 .threadtitle a").text() + '[/url]');
  220. }
  221. })