-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added option to disable/enable scrollbar
Bugfixes
- Loading branch information
1 parent
62ee43d
commit 6c22913
Showing
10 changed files
with
105 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
function handleOptions() { | ||
chrome.storage.sync.get({ | ||
useScrollbar: true | ||
}, function(items) { | ||
if (!items.useScrollbar) { | ||
$('.slimScrollBar').remove(); | ||
$('.slimScrollRail').remove(); | ||
} | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>FB fixed navbar</title> | ||
</head> | ||
<body> | ||
|
||
<h1>FB fixed navbar</h1> | ||
|
||
<h2>Options</h2> | ||
|
||
<label> | ||
<input type="checkbox" id="scrollbar"> | ||
Use scrollbar | ||
</label> | ||
|
||
<div id="status"></div> | ||
<button id="save">Save</button> | ||
|
||
<script src="options.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
function save_options() { | ||
var useScrollbar = document.getElementById('scrollbar').checked; | ||
chrome.storage.sync.set({ | ||
useScrollbar: useScrollbar | ||
}, function() { | ||
var status = document.getElementById('status'); | ||
status.textContent = 'Options saved.'; | ||
setTimeout(function() { | ||
status.textContent = ''; | ||
}, 750); | ||
}); | ||
} | ||
|
||
function restore_options() { | ||
chrome.storage.sync.get({ | ||
useScrollbar: true | ||
}, function(items) { | ||
document.getElementById('scrollbar').checked = items.useScrollbar; | ||
}); | ||
} | ||
document.addEventListener('DOMContentLoaded', restore_options); | ||
document.getElementById('save').addEventListener('click', | ||
save_options); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
var useScrollbar; | ||
|
||
function handleOptions() { | ||
if (!useScrollbar) { | ||
$('.slimScrollBar').remove(); | ||
$('.slimScrollRail').remove(); | ||
} | ||
} | ||
|
||
self.port.on("useScrollbar", function(value) { | ||
useScrollbar = value; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
var data = require("sdk/self").data; | ||
var pageMod = require("sdk/page-mod"); | ||
var prefs = require("sdk/simple-prefs").prefs; | ||
|
||
pageMod.PageMod({ | ||
include: "*.facebook.com", | ||
contentScriptFile: [data.url("jquery-1.11.1.min.js"), data.url("jquery.slimscroll.min.js"), data.url("fixed_navbar.js")], | ||
contentScriptFile: [data.url("jquery-1.11.1.min.js"), data.url("jquery.slimscroll.min.js"), data.url("fixed_navbar_options.js"), data.url("fixed_navbar.js")], | ||
contentStyleFile: data.url("fixed_navbar.css"), | ||
contentScriptWhen: "end" | ||
contentScriptWhen: "end", | ||
onAttach: function(worker) { | ||
worker.port.emit("useScrollbar", prefs.useScrollbar); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters