Alcuinus

e-shuushuu

Jul 13th, 2011
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 1.88 KB | None | 0 0
  1. // All your GM code must be inside this function
  2. function letsJQuery() {
  3.  
  4.     //Initial Injection of Control Pannel
  5.     var DOMDisplay = document.createElement("div");
  6.     DOMDisplay.className = "display";
  7.     DOMDisplay.innerHTML =
  8.     "<h2>Subscriptions</h2>                                                                             " + "\n" +
  9.     "<ul class='center'>                                                                                " + "\n" +
  10.     "  <li>                                                                                             " + "\n" +
  11.     "    <a href='/tags/?tag_name=&type=1&show_aliases=0&subscribe=true'>Manage Subscriptions</a>       " + "\n" +
  12.     "  </li>                                                                                            " + "\n" +
  13.     "</ul>                                                                                              " + "\n" +
  14.     "";
  15.     document.getElementById("sidebar").insertBefore(DOMDisplay, document.getElementById("donations"));
  16.  
  17.     //If we are on the tags page and we came from the subscription controll panel.... highjack it :P
  18.     if (location.search.substr(location.search.lastIndexOf("&") + 1).split("=")[0] == "subscribe" &&
  19.         location.search.substr(location.search.lastIndexOf("&") + 1).split("=")[1] == "true") {
  20.         $("#content h1:first").html("Subscriptions");
  21.         var DOMSubscribeOption = document.createElement("li");
  22.         DOMSubscribeOption.style.display = "none";
  23.         DOMSubscribeOption.innerHTML =
  24.         '<label for="subscribe">Subscription:</label>' + "\n" +
  25.         '<select id="subscribe" name="subscribe">' + "\n" +
  26.         '  <option selected="true" value="true">Yes</option>' + "\n" +
  27.         '  <option value="false">No</option>' + "\n" +
  28.         '</select>' + "\n" +
  29.         '';
  30.         $("#sorting_controls ul").append(DOMSubscribeOption);
  31.     }
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment