Advertisement
Shiny_

Untitled

Oct 19th, 2014
480
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name              Wykop - Fullscreen Mikro
  3. // @description       Mikroblog na całą szerokość ekranu.
  4. // @author            Patryk "Linux__Shines" N.
  5. // @version           1.0.0.0
  6. // @include           http://wykop.pl/tag/*
  7. // ==/UserScript==
  8.  
  9. var vis          = "visible";
  10. var invis        = "invisible";
  11. var title        = "Przełącz belkę";
  12. var action       = "click";
  13. var bar_title    = "ChangeBar";
  14. var click_type   = "a";
  15. var wrap_size    = 4;
  16.  
  17. var main         = $("<li><" + click_type + " id='" + bar_title + "' title='" + title + "'>" + title + "</" + click_type + "></li>").insertBefore($("#openNaturalSearch").parent());
  18.  
  19. var bar          = $(".grid-right");
  20. var grid         = $(".grid-main");
  21. var wrap         = grid.parent();
  22.  
  23. var check_site   = function CheckURL(url) {
  24.     if(url === url.match("/http:\/\/www.wykop.pl/i")) {
  25.         alert("TEST");
  26.     }    
  27. }
  28.  
  29. var steering     = {
  30.     Show: function() {
  31.         bar.show();
  32.         grid.css("width", "auto");
  33.         wrap.css("padding-right", wrap_size + "px");
  34.         localStorage.BarStatus = vis;
  35.     },
  36.     Hide: function() {
  37.         bar.hide();
  38.         grid.css("width", "100%");
  39.         wrap.css("padding-right", 0);
  40.         localStorage.BarStatus = invis;
  41.     }
  42. };
  43. localStorage.BarStatus = localStorage.BarStatus || vis;
  44. localStorage.BarStatus == vis? steering.Hide(): steering.Show();
  45.  
  46. main.on(action, function() {
  47.     localStorage.BarStatus == vis? steering.Hide(): steering.Show();
  48. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement