GRMrGecko
14 years ago
6 changed files with 156 additions and 8 deletions
-
17License.txt
-
22Settings.plist
-
22flashfire.js
-
18global.html
-
3preferences.css
-
82preferences.html
@ -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. |
@ -0,0 +1,3 @@ |
|||
.flashfireTitle { |
|||
font-weight: bold; |
|||
} |
@ -0,0 +1,82 @@ |
|||
<!DOCTYPE HTML> |
|||
<html> |
|||
<head> |
|||
<title>FlashFire Preferences</title> |
|||
<script type="text/javascript"> |
|||
var FFWhitelist = null; |
|||
function handleMessage(theEvent) { |
|||
if (theEvent.name=="preferences") { |
|||
console.log(theEvent.message); |
|||
document.getElementById("invisible").checked = theEvent.message.invisible; |
|||
FFWhitelist = theEvent.message.whitelist; |
|||
var whitelist = document.getElementById("whitelist"); |
|||
for (i=0; i<FFWhitelist.length; i++) { |
|||
var item = document.createElement("option"); |
|||
item.value = FFWhitelist[i]; |
|||
item.innerHTML = FFWhitelist[i]; |
|||
whitelist.appendChild(item); |
|||
} |
|||
document.getElementById("loading").style.display = "none"; |
|||
document.getElementById("settings").style.display = "block"; |
|||
} |
|||
} |
|||
|
|||
function setInvisible() { |
|||
safari.self.tab.dispatchMessage("setInvisible", document.getElementById("invisible").checked); |
|||
} |
|||
|
|||
function whitelistSelect() { |
|||
document.getElementById("whitelistRemoveButton").disabled = true; |
|||
var options = document.getElementById("whitelist").options; |
|||
for (i=0; i<options.length; i++) { |
|||
if (options[i].selected==true) { |
|||
document.getElementById("whitelistRemoveButton").disabled = false; |
|||
break; |
|||
} |
|||
} |
|||
} |
|||
function whitelistRemove() { |
|||
var options = document.getElementById("whitelist").options; |
|||
for (i=0; i<options.length; i++) { |
|||
if (options[i].selected==true) { |
|||
console.log("Removing"); |
|||
document.getElementById("whitelist").removeChild(options[i]); |
|||
document.getElementById("whitelistRemoveButton").disabled = true; |
|||
break; |
|||
} |
|||
} |
|||
} |
|||
function whitelistAdd() { |
|||
var site = document.getElementById("whitelistField").value; |
|||
if (site=="") |
|||
return; |
|||
var found = false; |
|||
for (i=0; i<FFWhitelist.length; i++) { |
|||
if (FFWhitelist[i]==site) |
|||
found = true; |
|||
} |
|||
if (!found) { |
|||
var item = document.createElement("option"); |
|||
item.value = site; |
|||
item.innerHTML = site; |
|||
whitelist.appendChild(item); |
|||
} |
|||
document.getElementById("whitelistField").value = ""; |
|||
return false; |
|||
} |
|||
|
|||
safari.self.tab.dispatchMessage("getPreferences"); |
|||
safari.self.addEventListener("message", handleMessage, false); |
|||
</script> |
|||
<link rel="stylesheet" href="preferences.css" type="text/css" media="screen" /> |
|||
</head> |
|||
<body> |
|||
<div id="settings" style="display: none"> |
|||
<label for="invisible"><input type="checkbox" id="invisible" name="invisible" value="true" onclick="setInvisible();"> Load invisible flash automatically</label><br /> |
|||
<br /><div class="flashfireTitle">Whitelist</div> |
|||
<select name="whitelist" id="whitelist" size="10" style="width: 400px" onchange="whitelistSelect()"></select><br /> |
|||
<form onsubmit="return whitelistAdd();"><input type="text" id="whitelistField" size="54"><input type="submit" value="Add"><input type="button" id="whitelistRemoveButton" value="Remove" onclick="whitelistRemove()" disabled></form> |
|||
</div> |
|||
<div id="loading" style="text-align: center">Loading Preferences...</div> |
|||
</body> |
|||
</html> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue