diff --git a/License.txt b/License.txt new file mode 100644 index 0000000..76edf31 --- /dev/null +++ b/License.txt @@ -0,0 +1,17 @@ +Copyright (c) 2010 Mr. Gecko's Media (James Coleman). All rights reserved. http://mrgeckosmedia.com/ + +Permission is granted, to any person obtaining a copy of this extension, to + use, copy, modify, merge, or redistribute this extension under the following terms: + +1. THIS EXTENSION IS PROVIDED "AS IS" BY JAMES COLEMAN, WITHOUT WARRANTY OF + ANY KIND. IF YOUR SOFTWARE/EXTENSION/COMPUTER CRASH OR FAILS TO WORK IN ANY + WAY SHAPE OR FORM BECAUSE OF THIS EXTENSION, I (JAMES COLEMAN) AM NOT IN ANYWAY + RESPONSIBLE FOR YOUR PROBLEM. BUT, I MAY BE WILLING TO HELP YOU, NO PROMISES. + +2. Redistributions of source code included in this extension must retain the + copyright notice above this license file without modifications. + +3. Redistributions of binary must contain the copyright above this license file + without modifications. + +4. Mr. Gecko's Media (James Coleman) is allowed to modify these terms with little or no notice to anyone. \ No newline at end of file diff --git a/Settings.plist b/Settings.plist index 8a92213..5961532 100644 --- a/Settings.plist +++ b/Settings.plist @@ -4,9 +4,29 @@ DefaultValue - + + Key + invisible + Title + Load invisible flash automatically + Type + CheckBox + + + DefaultValue + vimeo.com,mrgeckosmedia.net Key whitelist + Title + White list + Type + Hidden + + + Key + blacklist + Type + Hidden diff --git a/flashfire.js b/flashfire.js index 57288ee..32bda82 100644 --- a/flashfire.js +++ b/flashfire.js @@ -26,10 +26,10 @@ function handleBeforeLoadEvent(event) { } } - //console.log(safari.self.tab.canLoad(event, {name: "getSettings", data: ""})); + if (safari.self.tab.canLoad(event, {name: "getSetting", setting: "invisible"})==true && element.style.display=="none") + return; event.preventDefault(); - blockElement(element); } } @@ -83,7 +83,6 @@ function displayContextMenu(event) { var element = event.target; var left = event.pageX; var top = event.pageY; - console.log(event); while (element.className!="flashfireBlocked") element = element.parentNode; @@ -124,6 +123,23 @@ function displayContextMenu(event) { autoLoadElement.innerHTML = "Automatically Load Flash on "" + window.location.host + """; menuElement.appendChild(autoLoadElement); + var autoHideElement = document.createElement("li"); + autoHideElement.className = "flashfireMenuItem"; + autoHideElement.innerHTML = "Automatically Hide Flash on "" + window.location.host + """; + menuElement.appendChild(autoHideElement); + + var prefSeparatorElement = document.createElement("li"); + prefSeparatorElement.className = "flashfireMenuSeparator"; + menuElement.appendChild(prefSeparatorElement); + + var preferencesElement = document.createElement("li"); + preferencesElement.className = "flashfireMenuItem"; + preferencesElement.innerHTML = "FlashFire Preferences..."; + var prefWidth = 445; + var prefHeigth = 500; + preferencesElement.onclick = function() {window.open(safari.extension.baseURI + "preferences.html", "FlashFire Preferences", "width=" + prefWidth + ",height=" + prefHeigth + ",left=" + (screen.availWidth-prefWidth)/2 + ",top=" + (screen.availHeight-prefHeigth)/2 + ",resizable=no,scrollbars=no,menubar=no,status=no,location=no")} + menuElement.appendChild(preferencesElement); + document.body.appendChild(menuElement); var closeContentMenu = function(event) { diff --git a/global.html b/global.html index eaa1a7e..23ef28e 100644 --- a/global.html +++ b/global.html @@ -2,15 +2,25 @@ + + + + +
Loading Preferences...
+ + \ No newline at end of file