Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
e45f816
updated version number; zipped for chrome store
Dbz Nov 21, 2014
86498e8
fixed bug for first time users
Dbz Nov 23, 2014
7fe4426
updated version number; zipped
Dbz Nov 23, 2014
3c58cc9
added chrome zip
Dbz Nov 23, 2014
14f6391
fixed bug where button didn't work for new users
Dbz Dec 13, 2015
a32fbde
Updated chrome store zip after rewriting git history to remove large …
Dbz Dec 13, 2015
2c220be
added basic privacy policy
Dbz Apr 21, 2016
dffc772
Started on new options page
Dbz Dec 3, 2016
416ddd2
Added more html/css and fixed issues
Dbz Dec 5, 2016
4ad3e31
Added more styling
Dbz Dec 6, 2016
787f4b6
Fixed spacing
Dbz Dec 7, 2016
1f151a5
On off toggle instead of radio buttons
Dbz Dec 8, 2016
b59ae11
New javascript for new toggle
Dbz Dec 9, 2016
794844a
Created checkbox buttons
Dbz Dec 11, 2016
8ef3c17
Better sortable grabbing
Dbz Dec 12, 2016
e2c583e
Added contextMenus permission
Dbz Dec 13, 2016
3ef5b93
Options Page UI options are saved and set properly
Dbz Dec 17, 2016
b3a11ed
Changed to storage sync instead of local
Dbz Dec 18, 2016
f2b4faa
Mostly style changes, and now compatible with new options page
Dbz Dec 18, 2016
6f9d142
Add/Remove context menu functionality
Dbz Jan 2, 2017
9b62867
Updated Readme
Dbz Jan 5, 2017
0f82444
Refactored adding and removing context menus
Dbz Mar 5, 2017
cda383b
Context menu caches fully working
Dbz Mar 5, 2017
0f88b86
Fixed style issues
Dbz Mar 5, 2017
0eaedf9
Style changes. Removed old thank you from ReadMe
Dbz Mar 11, 2017
8d67af7
Added chrome store description
Dbz Mar 13, 2017
81d53e3
Switched to new icons. Removed old images.
Dbz Mar 16, 2017
87dc9d5
Updated jQuery
Dbz Mar 17, 2017
baa864a
Merge pull request #2 from Dbz/right-click-menus
Dbz Mar 17, 2017
c27fe2b
Fixed readme formatting
Dbz Mar 17, 2017
ca8f009
Create License.txt
Dbz Mar 17, 2017
e0c4a65
Ready for Chrome Store
Dbz Mar 18, 2017
d4fe7fb
Updated Chrome Store Description
Dbz May 23, 2017
25b5e8f
New Chrome Store Archive
Dbz May 23, 2017
9d3fd97
Create CODE_OF_CONDUCT.md
Dbz Jul 12, 2017
d06a8ee
Wayback Machine goes to the latest version of a page
Dbz Jul 13, 2017
0a036d9
Added Archive.is to caches
Dbz Jul 24, 2017
64b20ad
Added promotional tiles
Dbz Jul 25, 2017
4491c7e
fixed bug
Dbz Sep 13, 2017
6f6208c
Delete the chrome store zip
Dbz Sep 13, 2017
46f74e7
Updated chrome store text with latest version
Dbz Sep 14, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Style changes. Removed old thank you from ReadMe
  • Loading branch information
Dbz committed Mar 11, 2017
commit 0eaedf96ae4e833195fda172b1fca86c2d3b7a09
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ I am also actively seeking to diversify our contributors and especially welcome
If you're interested in contributing, fork this repo and create a pull request.
Please follow the [JavaScript Style Guide](https://github.com/airbnb/javascript).

Thank you to Jason Rainbows for making all of the images

##Version

v4.0.0
Expand Down
11 changes: 6 additions & 5 deletions options.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ var CONTEXT_MENU_CACHES = [

// Remove context menu caches
function removeContextMenu(cache) {
var saveObj = {};
var saveObj = {};
saveObj[cache] = false;

chrome.contextMenus.remove(cache);
chrome.storage.sync.set(saveObj);
}

// Create context menu caches
function createContextMenu(cache) {
var saveObj = {};
var saveObj = {};
var create_properties = {
id: cache,
title: "Open page with " + cache.split("-").join(" "), //$("label[for=""+ cache +""]").text()
Expand All @@ -28,7 +29,7 @@ function createContextMenu(cache) {

// Add/Remove context menu caches
function updateContextMenuCaches(event) {
var cache = $(event.target).attr("for");
var cache = $(event.target).attr("for");
var add_context_menu = !$("#" + cache).is(":checked");
add_context_menu ? createContextMenu(cache) : removeContextMenu(cache);
}
Expand All @@ -50,10 +51,10 @@ $("#sortable").sortable({
create: function(event, ui) {
// Set up sortable
chrome.storage.sync.get("cacheOrder4", function(result) {
order = result["cacheOrder4"] || ["google-cache-sortable", "wayback-machine-sortable", "coral-cdn-sortable"];

var ul = $("#sortable");
var li = ul.children("li").get();
order = result["cacheOrder4"] || ["google-cache-sortable", "wayback-machine-sortable", "coral-cdn-sortable"];

li.sort(function(a, b) {
return order.indexOf($(a).attr("id")) - order.indexOf($(b).attr("id"));
});
Expand Down
30 changes: 17 additions & 13 deletions redirect.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,23 @@ var cacheURL = [
"http://web.archive.org/web/*/",
".nyud.net"
];
var cacheNames = ["google-cache-sortable", "wayback-machine-sortable", "coral-cdn-sortable"];
var cacheNames = [
"google-cache-sortable",
"wayback-machine-sortable",
"coral-cdn-sortable"
];
var URL_HASH = [
{ name: "google-cache-sortable", URL: "http://webcache.googleusercontent.com/search?q=cache:" },
{ name: "google-cache-sortable", URL: "http://webcache.googleusercontent.com/search?q=cache:" },
{ name: "wayback-machine-sortable", URL: "http://web.archive.org/web/*/" },
{ name: "coral-cdn-sortable", URL: ".nyud.net" }
{ name: "coral-cdn-sortable", URL: ".nyud.net" }
];

function getURL() {
++numberOfRedirects;
if(cacheURL[index] == cacheURL.length) {
index = 0;
}

if(cacheURL[index] != ".nyud.net") { // Google and Wayback Machine
return cacheURL[index] + (isHTTPS ? currentURL.substr(8) : currentURL.substr(7));
} else { // Coral CDN
Expand All @@ -39,15 +44,14 @@ function handler(details) {
redirecting = false;
return { cancel: true };
}

if(~details.statusLine.search("404")) { // Not found
++index;
return { redirectUrl:getURL() };
}
else if(~details.statusLine.search("403")) { // Forbidden
} else if(~details.statusLine.search("403")) { // Forbidden
++index;
return { redirectUrl:getURL() };
}
else { // Success
} else { // Success
chrome.webRequest.onHeadersReceived.removeListener(handler);
redirecting = false;
return { cancel: false };
Expand All @@ -62,16 +66,16 @@ function openPage(currentTab) {
return cacheOrder.indexOf(a.name) - cacheOrder.indexOf(b.name);
});

for (var i = 0; i< 3; i++) {
cacheURL[i] = URL_HASH[i].URL;
for(var i = 0; i < 3; i++) {
cacheURL[i] = URL_HASH[i].URL;
cacheNames[i] = URL_HASH[i].name;
}

console.log(cacheURL);
// console.log(cacheURL);

index = 0;
index = 0;
numberOfRedirects = 0;
redirecting = true;
redirecting = true;

chrome.webRequest.onHeadersReceived.addListener(
handler,
Expand All @@ -98,7 +102,7 @@ function autoRedirect(details) {
// Make sure it is the current tab
var tab = null;
tabs.forEach(function(t) {
if(t.url == details.url) { // What if multiple tabs open with same url?
if(t.url === details.url) { // What if multiple tabs open with same url?
tab = t;
}
});
Expand Down