Skip to content
This repository has been archived by the owner on Nov 12, 2022. It is now read-only.

Commit

Permalink
having some fun, getting bouncy little smilies in there, show net pro…
Browse files Browse the repository at this point in the history
…test logo. made clickable. fix contextmenu mode toggle issue. bumping to 0.1.1.
  • Loading branch information
gleuch committed Oct 11, 2011
1 parent 53e54e5 commit d5862db
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 14 deletions.
10 changes: 6 additions & 4 deletions chrome/css/protest/occupy.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified chrome/icons/occupyinternet48.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added chrome/images/net_protester48.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added chrome/images/protester16.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion chrome/js/contextmenu.js
Expand Up @@ -29,7 +29,7 @@ OccupyInternet.ContextMenu = {

jQuery.each(OccupyInternet.mode_types, function(k,v) {
if (!OccupyInternet.ContextMenu.menus['mode_'+ k]) {
OccupyInternet.ContextMenu.menus['mode_'+ k] = chrome.contextMenus.create({title : v, checked : OccupyInternet.isMode(k), type : 'checkbox', contexts : ['all'], onclick : OccupyInternet.setMode}, function() {});
OccupyInternet.ContextMenu.menus['mode_'+ k] = chrome.contextMenus.create({title : v, checked : OccupyInternet.isMode(k), type : 'radio', contexts : ['all'], onclick : OccupyInternet.setMode}, function() {});
}
});

Expand Down
2 changes: 1 addition & 1 deletion chrome/js/init.js
Expand Up @@ -45,7 +45,7 @@ var OccupyInternet = {
setMode : function(info) {
var changed = false;
jQuery.each(OccupyInternet.mode_types, function(k,v) {
if (OccupyInternet.ContextMenu['mode_'+ k] == info['menuItemId']) {
if (OccupyInternet.ContextMenu.menus['mode_'+ k] == info['menuItemId']) {
OccupyInternet.mode(k);
changed = true;
}
Expand Down
22 changes: 16 additions & 6 deletions chrome/js/protest/occupy.js
Expand Up @@ -48,9 +48,11 @@ jQuery.extend(true, OccupyInternetPage, {
if (OccupyInternetPage.mode == 'quiet') return;

if (!OccupyInternetPage.gathered) {
jQuery('body').append(OccupyInternetPage.html.liberty_plaza).attr('title', OccupyInternetPage.phrase());
jQuery('body').append(OccupyInternetPage.html.liberty_plaza);
OccupyInternetPage.gathered = true;

OccupyInternetPage._add_logo();

for (var i=0; i<OccupyInternetPage.count; i++) {
OccupyInternetPage._add_protester();
}
Expand All @@ -60,11 +62,18 @@ jQuery.extend(true, OccupyInternetPage, {
_show_protest : function() {if (jQuery('#occupyinternet_plaza')) jQuery('#occupyinternet_plaza').show();},
_hide_protest : function() {if (jQuery('#occupyinternet_plaza')) jQuery('#occupyinternet_plaza').hide();},

_add_logo : function() {
jQuery('#occupyinternet_plaza_area').append(OccupyInternetPage.html.logo);
jQuery('#occupyinternet_logo').attr('title', 'OccupyInter.net - '+ OccupyInternetPage.phrase());
},

_add_protester : function() {
if (OccupyInternetPage.mode == 'peaceful') {
jQuery('#occupyinternet_plaza').append(OccupyInternetPage.html.peaceful_protester);
setTimeout(function() {
jQuery('#occupyinternet_plaza_area').append(OccupyInternetPage.html.peaceful_protester.replace(/\?rnd/, '?'+Math.floor(Math.random()*1000)));
}, Math.floor(Math.random()*1500));
} else if (OccupyInternetPage.mode == 'loud') {
jQuery('#occupyinternet_plaza').append(OccupyInternetPage.html.loud_protester);
jQuery('#occupyinternet_plaza_area').append(OccupyInternetPage.html.loud_protester);
}
},

Expand All @@ -85,7 +94,7 @@ jQuery.extend(true, OccupyInternetPage, {
var diff = (num - OccupyInternetPage.count);
OccupyInternetPage.count = num;

jQuery('#occupyinternet_plaza').attr('title', OccupyInternetPage.phrase());
jQuery('#occupyinternet_logo').attr('title', OccupyInternetPage.phrase());

for (var i=0; i<Math.abs(diff); i++) {
if (diff > 0) {
Expand All @@ -112,9 +121,10 @@ jQuery.extend(true, OccupyInternetPage, {
phrase : function() {return OccupyInternetPage.count +' '+ (OccupyInternetPage.count != 1 ? 'protesters' : 'protester');},

html : {
peaceful_protester : '<span class="occupyinternet occupyinternet_protester occupyinternet_protester_peaceful">X</span>',
peaceful_protester : '<span class="occupyinternet occupyinternet_protester occupyinternet_protester_peaceful"><img class="occupyinternet" src="'+ chrome.extension.getURL('images/protester16.gif') +'?rnd" title="" alt="" /></span>',
loud_protester : '<span class="occupyinternet occupyinternet_protester occupyinternet_protester_loud">!!!</span>',
liberty_plaza : '<div id="occupyinternet_plaza" class="occupyinternet"></div>',
logo : '<a href="http://occupyinter.net" target="_blank" class="occupyinternet occupyinternet_logo"><img class="occupyinternet" id="occupyinternet_logo" src="'+ chrome.extension.getURL('images/net_protester48.gif') +'" title="OccupyInter.net" alt="" /></a>',
liberty_plaza : '<div id="occupyinternet_plaza" class="occupyinternet"><div class="occupyinternet" id="occupyinternet_plaza_area"></div></div>',
police : '',
nets : ''
}
Expand Down
4 changes: 2 additions & 2 deletions chrome/manifest.json
Expand Up @@ -12,7 +12,7 @@

{
"name": "OccupyInter.net",
"version": "0.1.0",
"version": "0.1.1",
"description": "",
"homepage_url": "http://occupyinter.net",

Expand All @@ -25,7 +25,7 @@
},

"background_page": "background.html",
"permissions": [ "notifications", "contextMenus", "tabs", "http://*/*", "https://*/*" ],
"permissions": [ "contextMenus", "tabs", "http://*/*", "https://*/*" ],

"update_url": "http://tools.occupyinter,net/extensions/chrome/update"
}

0 comments on commit d5862db

Please sign in to comment.