Skip to content
This repository has been archived by the owner on Feb 21, 2021. It is now read-only.

Commit

Permalink
Added Safari support.
Browse files Browse the repository at this point in the history
  • Loading branch information
snoack committed Nov 2, 2013
1 parent fd9e104 commit 6427e65
Show file tree
Hide file tree
Showing 31 changed files with 2,325 additions and 527 deletions.
309 changes: 79 additions & 230 deletions background.js

Large diffs are not rendered by default.

43 changes: 21 additions & 22 deletions block.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,20 @@ function init()
// Apply jQuery UI styles
$("button").button();

chrome.extension.sendRequest(
{
reqtype: "forward",
request:
{
reqtype: "clickhide-init",
width: Math.max(document.body.offsetWidth || document.body.scrollWidth),
height: Math.max(document.body.offsetHeight || document.body.scrollHeight)
}
},
function(response)
ext.backgroundPage.sendMessage(
{
type: "forward",
payload:
{
document.getElementById("filters").value = response.filters.join("\n");
type: "clickhide-init",
width: Math.max(document.body.offsetWidth || document.body.scrollWidth),
height: Math.max(document.body.offsetHeight || document.body.scrollHeight)
}
);
},
function(response)
{
document.getElementById("filters").value = response.filters.join("\n");
});

document.getElementById("filters").focus();
}
Expand All @@ -69,18 +68,18 @@ function addFilters()
var filters = document.getElementById("filters").value.split(/[\r\n]+/)
.map(function(f) {return f.replace(/^\s+/, "").replace(/\s+$/, "");})
.filter(function(f) {return f != "";});
chrome.extension.sendRequest({reqtype: "add-filters", filters: filters});
ext.backgroundPage.sendMessage({type: "add-filters", filters: filters});
closeDialog(true);
}

function closeDialog(success)
{
chrome.extension.sendRequest(
ext.backgroundPage.sendMessage(
{
reqtype: "forward",
request:
type: "forward",
payload:
{
reqtype: "clickhide-close",
type: "clickhide-close",
remove: (typeof success == "boolean" ? success : false)
}
}
Expand All @@ -104,12 +103,12 @@ function onDrag(event)
var diff = [event.screenX - dragCoords[0], event.screenY - dragCoords[1]];
if (diff[0] || diff[1])
{
chrome.extension.sendRequest(
ext.backgroundPage.sendMessage(
{
reqtype: "forward",
request:
type: "forward",
payload:
{
reqtype: "clickhide-move",
type: "clickhide-move",
x: diff[0],
y: diff[1]
}
Expand Down
Loading

0 comments on commit 6427e65

Please sign in to comment.