Free code, from Eudaimonia

Posted by Eudaimonia 9 years, 12 months ago to Technology
10 comments | Share | Best of... | Flag

If you have a website that you maintain, here's some code for you.


<!-- %%%%% Mozilla Setup Start -->
<div id="mozilla_modal" title="[Your Title Here]">
<h1 align="left">[Your Heading Here]</h1>
<p align="left">[Your Message Here]</p>
</div>
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/ui-lightness/jquery-ui.css" />
<script src="//code.jquery.com/ui/1.10.4/jquery-ui.js" />
<script>
// Mozilla modal init
(function($){
$("#mozilla_modal").dialog({
height: 370,
width: 400,
modal: true,
autoOpen: false
});
})(jQuery);

$(document).ready(function(){
if (navigator.userAgent.toLowerCase().indexOf("firefox") > -1) {
var cookie_key = "mozilla_show_one_time_panel";
var cookie_match_key = cookie_key + "=";
var cookie_set = "set";
var cookie_val = "";

// Check if the one time cookie has been set
var ca = document.cookie.split(';');
for (var i = 0; ca.length > i; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') {
c = c.substring(1,c.length);
}
if (c.indexOf(cookie_match_key) == 0){
cookie_val = c.substring(cookie_match_key.length,c.length);
}
}

// Set the one time cookie if not already set
if (cookie_val != cookie_set) {
var date = new Date();
date.setTime(date.getTime()+(365*24*60*60*1000));
var expires = date.toGMTString();
document.cookie = cookie_key + "=" + cookie_set + "; expires=" + expires + "; path=/";

$("#mozilla_modal").dialog("open");
}
}
});
</script>
<!-- %%%%% Mozilla Setup End -->


If you're not a techie and you'd like to know what it does, then just go to the Papa Possum blog and find out (you have to be using a Mozilla browser like Firefox to see what the code does).

http://www.papapossum.com

You're welcome.


Add Comment

FORMATTING HELP

All Comments Hide marked as read Mark all as read

  • Posted by khalling 9 years, 12 months ago
    I had already removed the browser. What fun did I miss?
    Reply | Mark as read | Best of... | Permalink  
    • Posted by 9 years, 12 months ago
      A one time only message shown exclusively to Firefox users.

      The message is in a window titled "First Amendment Zone"

      The text of the message reads:

      ------
      Dear Reader,

      At http://papapossum.com, satire is what I do, and satire flourishes with free political speech.

      Please consider switching to a browser whose parent company cares as much about that free political speech as I do.

      Thank you for your time, and thank you for reading The Papa Possum Satires.

      Sincerely,

      (The creator of) Papa Possum
      ------
      Reply | Mark as read | Parent | Best of... | Permalink  
  • Comment hidden by post owner or admin, or due to low comment or member score. View Comment
  • -1
    Posted by $ Maphesdus 9 years, 11 months ago
    I support free speech. I do not support bigotry. That's why I side with those who criticized Brendan Eich. Freedom of speech does not mean freedom from criticism.
    Reply | Mark as read | Best of... | Permalink  

FORMATTING HELP

  • Comment hidden. Undo