Created
July 7, 2012 21:29
-
-
Save tzi/3068137 to your computer and use it in GitHub Desktop.
A #javascript #bookmarklet : To change CSS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
var is_old_view = false; | |
var current_css_href = "./themes/SilverScreen2/css/common.css"; | |
var old_css_href = "./themes/SilverScreen2/css/common_old.css"; | |
var link = document.querySelector( '[href="' + current_css_href + '"]' ); | |
if ( link ) { | |
var popin = new bm_popin( 3068137 ); | |
var switch_view = function() { | |
is_old_view = ! is_old_view ; | |
if ( is_old_view ) { | |
link.href = old_css_href; | |
popin.title( 'Old View' ); | |
} else { | |
link.href = current_css_href; | |
popin.title( 'Current View' ); | |
} | |
}; | |
switch_view(); | |
popin.add_button( 'Switch View', switch_view ); | |
} | |
}) (); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment