]> git.aero2k.de Git - dfde/quickmods.git/commitdiff
some fixes on dfde theme
authorThorsten S <mail@aero2k.de>
Wed, 24 Dec 2014 11:56:30 +0000 (12:56 +0100)
committerThorsten S <mail@aero2k.de>
Wed, 24 Dec 2014 11:56:30 +0000 (12:56 +0100)
quickmod.user.js

index 33d3d88a1c8695e6fbfdee1f0af0fa62da5c1cba..e2c40aaf2db734805356d95587b65df98bff292a 100644 (file)
@@ -3,13 +3,15 @@
 // @namespace     org.free.for.all
 // @require       http://code.jquery.com/jquery-latest.min.js
 // @include       /^https?://debianforum\.de/forum/viewtopic\.php.*
+// @include       /^https?://heimdall/qi/boards/fuckyou/viewtopic\.php.*/
 // @author        Thorsten Sperber
-// @version       0.2
+// @version       0.2.2
 // ==/UserScript==
 
 _log = console.log;
-ARCHIVFORUMID = 12;
-boardurl = "/";
+ARCHIVFORUMID = 35;
+boardurl = "/forum/";
+user_id = "18865";
 
 
 function get_post_id(_this) {
@@ -33,7 +35,7 @@ function removepost(event) {
     var thread_id = get_thread_id();
     _log(this);
 
-    var url = boardurl + "/mcp.php?&f=" + get_forum_id() + "&t=" + thread_id + "&i=main&mode=topic_view&action=split&start=0";
+    var url = boardurl + "mcp.php?&f=" + get_forum_id() + "&t=" + thread_id + "&i=main&mode=topic_view&action=split&start=0";
     var data = {
         "action": "split_all",
         "icon": "1",
@@ -48,7 +50,6 @@ function removepost(event) {
         "to_forum_id": ARCHIVFORUMID,
         "to_topic_id": "0",
     };
-    _log(data)
     $.ajax(
         {
         type: 'POST',
@@ -60,7 +61,6 @@ function removepost(event) {
         },
         success: function(data, status) {
             key = data.match("confirm_key=([A-Z0-9]+)")[1];
-            _log(key);
             _removepost(post_id, key);
             }
         }
@@ -70,11 +70,11 @@ function removepost(event) {
 }
  function _removepost(post_id, confirm_key) {
     var thread_id = get_thread_id();
-    url = boardurl + "/mcp.php?action=split&f=" + get_forum_id() + "&i=main&mode=topic_view&start=0&t=" + thread_id + "&confirm_key=" + confirm_key;
+    url = boardurl + "mcp.php?action=split&f=" + get_forum_id() + "&i=main&mode=topic_view&start=0&t=" + thread_id + "&confirm_key=" + confirm_key;
     data = {
         "action": "split_all",
-        "confirm": "Yes",
-        "confirm_uid": "2",
+        "confirm": "Ja",
+        "confirm_uid": user_id,
         "f": "0",
         "i": "main",
         "icon": "1",
@@ -83,7 +83,7 @@ function removepost(event) {
         "redirect": "/",
         "sess": get_session_id(),
         "start": "0",
-        "subject": "[spam] " + $('.topic-title a').text(),
+        "subject": "[spam] " + $('#page-body h2').text(),
         "t": thread_id,
         "to_forum_id": ARCHIVFORUMID
     }
@@ -99,7 +99,16 @@ function removepost(event) {
     );
 
 }
-$('.locked-icon').remove();
-$(".post-buttons").off('click');
-$(".post-buttons").append('<li>').append('<a class="button icon-button locked-icon" name="spampost" title="Cut this shit">').on('click', removepost);
+
+$(".postbody .profile-icons .droppost").off('click');
+li = $("<li class='droppost'>");
+li.css("background-image", 'url("/forum/styles/debianforum/imageset/topic_read_locked.gif")');
+li.css("background-repeat", "no-repeat");
+li.css("height", "27px");
+li.css("width", "27px");
+li.on('click', removepost);
+$(".postbody .profile-icons").prepend(li);
+
+
+li.html('<a class="button icon-button locked-icon" name="spampost" title="Cut this shit">&nbsp;</a>').on('click', removepost);