Skip directly to content

Adding SOPA blackout to a Drupal Gardens

on January 17th, 2012 at 11:55:53 PM

If you want to blackout your site in protest of SOPA/PIPA, here's what you gotta do:

(hat tip to http://www.zachstronaut.com for the blackout page).

Important: Keep the url mysite.drupalgardens.com/admin/content handy. 

Once you follow these instructions, your site will go dark (if it is January 18th 2012).  If you want to get it back, you will need to delete the block later.

  1. Navigate to Structure -> Blocks
  2. Click on "Add Block"
  3. In the "Body" use the dropdown to change from "Safe HTML" to "Full HTML" (the buttons will go away)
  4. Make the block show by setting a region.
  5. Copy the following and paste it into the body:

 


<script type="text/javascript">
    var a = new Date;
    if (18 == a.getDate() && 0 == a.getMonth() && 2012 == a.getFullYear()) {
        window.onload = function () {
            var cover = document.createElement('div');
            cover.style.position = 'fixed';
            cover.style.zIndex = 9999999;
            cover.style.width = window.innerWidth + 'px';
            cover.style.height = window.innerHeight + 'px';
            cover.style.top = 0;
            cover.style.backgroundColor = '#000';
            cover.innerHTML = '<iframe src="http://www.zachstronaut.com/lab/text-shadow-box/stop-sopa.html" width="100%" height="100%" frameBorder="0"></iframe>';
            document.body.appendChild(cover);
            window.onresize = function () {
                cover.style.width = window.innerWidth + 'px';
                cover.style.height = window.innerHeight + 'px';
            }
        }
    }
</script>

Comments

Kelly Bell's picture

Wow! Ask and ye shall receive! Thank you so much Jacob! I'm now all set and ready for the blackout tomorrow. You rock!

Big hug,
@Kelly

Hari K T's picture

Good tip to help the people who uses Drupal Garden who don't know what to do.

Kelly Bell's picture

It's not just about the tip bit (though i was following the directions and hit save before I snapped that I should have exempted the admin pages, so now I can't turn off the block and restore my site). 

I was hoping for CONSISTENCY of application - plain black is fine, but I was thinking if we all showed the "censored" label like what the FBI put on the Pirate Bay, or something, but adapted for Drupal Gardens, it would be really cool. Plus if you made it super easy for people to do it, they'd be more likely to participate in the blackout,which is good for everyone. 

In my case, I just flat out didn't have time to code something by the time I heard everyone was still doing the blackout (after Obama's speech I thought it might not happen), and since I'm on Gardens, and cant install any modules, I really just wanted them to install the Blackout module so we could use it if we wanted to. 

Of course ow I have to figure out how to turn this block off without access to any admin pages or to drush...

Kelly Bell
---------------
Gotham City Drupal
@gothamdrupal   |   @Kelly

Kelly Bell's picture

I can't believe I was that stupid.
I literally hit the button and thought of it in the same moment.
D'oh!

Kelly Bell's picture

I just wanted to mention that I really thought the image and the animation and all for this was REALLY well-done, and that I am very thankful that Jacon was so cool to make this happen for all the denizens of DG - thank you so much, Jacob.

Also, thanks for tweeting me the fix (worked!) to my own stupidity :)

The protest in Manhattan today went very well, and the whole protest was a great success, IMHO. Thank you for helping us do our little part.

Warmest regards,
Kelly

Nick Freear's picture

Hi Jacob,

This is a great write-up - useful instructions for a generic custom block. Also, the code is applicable to many CMSs, not just Drupal. I've created a Gist, with some modifications:

  • Option for the <iframe> to cover the top H pixels;
  • Added configuration variables;
  • Added optional Google Analytics campaign parameters;
  • MSIE 8 fixes.

Kudos to Zachstronaut.

Stop SOPA + PIPA!

Nick

Ladies Boots's picture

I am very thankful that Jacon was so cool to make this happen for all the denizens of DG - thank you so much, Jacob.  Office shoes

auto diagnostic tool's picture

The reason why we need the obd2 auto diagnostic tools is the need for curbing "mobile emissions". In tune with the need for global preservation, the EPA has been empowered to place firm emission standards. This has compelled the car manufacturers to bring in better non-polluting cars into the market. In turn, such strict measures for controlling emission levels have also helped to increase the functional life of the vehicle as well.

Post new comment

Addthis