Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Wykop - Fullscreen Mikro
- // @namespace Dunno.
- // @description Mikroblog na całą szerokość ekranu.
- // @author Patryk "Linux__Shines" N.
- // @version 1.0.0.0
- // @include http://*wykop.pl/mikroblog*
- // @include http://*wykop.pl/moj*
- // @include http://*wykop.pl/wpis*
- // @include http://*wykop.pl/tag*
- // ==/UserScript==
- var main = $("<li><a id='ChangeBar' title='Przełącz belkę'>Przełącz belkę</a></li>").insertBefore($("openNaturalSearch").parent());
- var bar = $(".grid-right");
- var grid = $(".grid-main");
- var wrap = grid.parent();
- var action = "click";
- var vis = "visible";
- var invis = "invisible";
- var steering = {
- Show: function() {
- bar.show();
- grid.css("width", "auto");
- wrap.css("padding-right", "4px");
- localStorage.BarStatus = vis;
- },
- Hide: function() {
- bar.hide();
- grid.css("width", "100%");
- wrap.css("padding-right", 0);
- localStorage.BarStatus = invis;
- }
- };
- localStorage.BarStatus = localStorage.BarStatus || vis;
- switch(localStorage.BarStatus) {
- case vis: {
- steering.Hide();
- break;
- }
- }
- main.on(action, function() {
- switch(localStorage.BarStatus) {
- case vis: {
- steering.Hide();
- break;
- }
- case invis: {
- steering.Show();
- break;
- }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement