Skip to content

Commit

Permalink
Move .js files to /js and /lib folders (#47)
Browse files Browse the repository at this point in the history
Signed-off-by: Tomáš Taro <tomas@getadblock.com>
  • Loading branch information
tomasko126 committed May 22, 2016
1 parent 8f42694 commit 7a6d29d
Show file tree
Hide file tree
Showing 31 changed files with 77 additions and 237 deletions.
14 changes: 7 additions & 7 deletions Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<dict>
<key>End</key>
<array>
<string>punycode.min.js</string>
<string>lib/punycode.min.js</string>
<string>uiscripts/load_jquery_ui.js</string>
<string>uiscripts/blacklisting/rightclick_hook.js</string>
<string>uiscripts/blacklisting/overlay.js</string>
Expand All @@ -58,13 +58,13 @@
</array>
<key>Start</key>
<array>
<string>jquery/jquery.min.js</string>
<string>port.js</string>
<string>functions.js</string>
<string>lib/jquery.min.js</string>
<string>js/port.js</string>
<string>js/functions.js</string>
<string>filtering/filteroptions.js</string>
<string>bandaids.js</string>
<string>adblock_start_common.js</string>
<string>adblock_start_safari.js</string>
<string>js/bandaids.js</string>
<string>js/adblock_start_common.js</string>
<string>js/adblock_start_safari.js</string>
<string>catblock/contentscript.js</string>
</array>
</dict>
Expand Down
14 changes: 7 additions & 7 deletions background.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<script type="text/javascript" src="punycode.min.js"></script>
<script type="text/javascript" src="jquery/jquery.min.js"></script>
<script type="text/javascript" src="port.js"></script>
<script type="text/javascript" src="functions.js"></script>
<script type="text/javascript" src="lib/punycode.min.js"></script>
<script type="text/javascript" src="lib/jquery.min.js"></script>
<script type="text/javascript" src="js/port.js"></script>
<script type="text/javascript" src="js/functions.js"></script>
<script type="text/javascript" src="filtering/domainset.js"></script>
<script type="text/javascript" src="filtering/filteroptions.js"></script>
<script type="text/javascript" src="filtering/filtertypes.js"></script>
<script type="text/javascript" src="filtering/filterset.js"></script>
<script type="text/javascript" src="filtering/myfilters.js"></script>
<script type="text/javascript" src="filtering/filternormalizer.js"></script>
<script type="text/javascript" src="idlehandler.js"></script>
<script type="text/javascript" src="js/idlehandler.js"></script>
<script type="text/javascript" src="catblock/channels.js"></script>
<script type="text/javascript" src="edge-updates.js"></script>
<script type="text/javascript" src="background.js"></script>
<script type="text/javascript" src="js/edge-updates.js"></script>
<script type="text/javascript" src="js/background.js"></script>
</head>
</html>
14 changes: 7 additions & 7 deletions background_safari.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<html>
<head>
<script src="punycode.min.js"></script>
<script src="jquery/jquery.min.js"></script>
<script src="port.js"></script>
<script src="functions.js"></script>
<script src="lib/punycode.min.js"></script>
<script src="lib/jquery.min.js"></script>
<script src="js/port.js"></script>
<script src="js/functions.js"></script>
<script src="filtering/domainset.js"></script>
<script src="filtering/filteroptions.js"></script>
<script src="filtering/filtertypes.js"></script>
<script src="filtering/filterset.js"></script>
<script src="filtering/declarativewebrequest.js"></script>
<script src="filtering/myfilters.js"></script>
<script src="filtering/filternormalizer.js"></script>
<script src="idlehandler.js"></script>
<script src="js/idlehandler.js"></script>
<script src="catblock/channels.js"></script>
<script src="background.js"></script>
<script src="safari_bg.js"></script>
<script src="js/background.js"></script>
<script src="js/safari_bg.js"></script>
</head>
<body>
</body>
Expand Down
8 changes: 4 additions & 4 deletions button/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<html>
<head>
<link rel="stylesheet" href="popup.css"/>
<script src="../punycode.min.js"></script>
<script src="../port.js"></script>
<script src="../jquery/jquery.min.js"></script>
<script src="../functions.js"></script>
<script src="../lib/punycode.min.js"></script>
<script src="../lib/jquery.min.js"></script>
<script src="../js/port.js"></script>
<script src="../js/functions.js"></script>
</head>
<body style="overflow:hidden;">
<div id="wrapper">
Expand Down
64 changes: 0 additions & 64 deletions filters/adblock_custom.txt

This file was deleted.

Binary file removed img/white-bg.png
Binary file not shown.
96 changes: 0 additions & 96 deletions jquery/jquery.cookie.js

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 11 additions & 11 deletions background.js → js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -727,9 +727,9 @@ adblock_is_paused = function(newValue) {
// add it back when AdBlock is un-paused
if (SAFARI && !get_settings().safari_content_blocking) {
if (newValue) {
safari.extension.removeContentScript(safari.extension.baseURI + "adblock_safari_beforeload.js");
safari.extension.removeContentScript(safari.extension.baseURI + "js/adblock_safari_beforeload.js");
} else {
safari.extension.addContentScriptFromURL(safari.extension.baseURI + "adblock_safari_beforeload.js", [], [], false);
safari.extension.addContentScriptFromURL(safari.extension.baseURI + "js/adblock_safari_beforeload.js", [], [], false);
}
}
}
Expand Down Expand Up @@ -1000,7 +1000,7 @@ add_custom_filter = function(filter) {
// Injects jQuery UI
injectjQueryUI = function() {
if (SAFARI) {
safari.extension.addContentScriptFromURL(safari.extension.baseURI + "jquery/jquery-ui.custom.min.js", [], [], false);
safari.extension.addContentScriptFromURL(safari.extension.baseURI + "lib/jquery-ui.custom.min.js", [], [], false);
return true;
}
};
Expand Down Expand Up @@ -1071,19 +1071,19 @@ if (!SAFARI) {
'top_open_whitelist_ui': {
allFrames: false,
include: [
"punycode.min.js",
"jquery/jquery.min.js",
"jquery/jquery-ui.custom.min.js",
"lib/punycode.min.js",
"lib/jquery.min.js",
"lib/jquery-ui.custom.min.js",
"uiscripts/load_jquery_ui.js",
"uiscripts/top_open_whitelist_ui.js"
]
},
'top_open_blacklist_ui': {
allFrames: false,
include: [
"punycode.min.js",
"jquery/jquery.min.js",
"jquery/jquery-ui.custom.min.js",
"lib/punycode.min.js",
"lib/jquery.min.js",
"lib/jquery-ui.custom.min.js",
"uiscripts/load_jquery_ui.js",
"uiscripts/blacklisting/overlay.js",
"uiscripts/blacklisting/clickwatcher.js",
Expand Down Expand Up @@ -1529,11 +1529,11 @@ chrome.runtime.onMessage.addListener(
function(request, sender, sendResponse) {
if (request.command === "inject_jquery") {
if (!SAFARI) {
chrome.tabs.executeScript(undefined, { allFrames: request.allFrames, file: "../jquery/jquery.min.js" },
chrome.tabs.executeScript(undefined, { allFrames: request.allFrames, file: "../lib/jquery.min.js" },
function() { sendResponse({});
});
} else {
safari.extension.addContentScriptFromURL(safari.extension.baseURI + "jquery/jquery.min.js", [], [], false);
safari.extension.addContentScriptFromURL(safari.extension.baseURI + "lib/jquery.min.js", [], [], false);
}
}
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion functions.js → js/functions.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Set to true to get noisier console.log statements
VERBOSE_DEBUG = false;

// Global variable for detection of Opera, Edge and Safari
// Global variable for detection of Opera, Edge and Firefox
OPERA = navigator.userAgent.indexOf("OPR") > -1;
EDGE = navigator.userAgent.indexOf("Edge") > -1;
FIREFOX = navigator.userAgent.indexOf("Firefox") > -1;
Expand Down
File renamed without changes.
File renamed without changes.
14 changes: 7 additions & 7 deletions safari_bg.js → js/safari_bg.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,11 @@ if (!LEGACY_SAFARI) {
// Add and remove the specific content script based on the safari_content_blocking setting
function set_content_scripts() {
if (get_settings().safari_content_blocking) {
safari.extension.addContentScriptFromURL(safari.extension.baseURI + "adblock_safari_contentblocking.js", [], [], false);
safari.extension.removeContentScript(safari.extension.baseURI + "adblock_safari_beforeload.js");
safari.extension.addContentScriptFromURL(safari.extension.baseURI + "js/adblock_safari_contentblocking.js", [], [], false);
safari.extension.removeContentScript(safari.extension.baseURI + "js/adblock_safari_beforeload.js");
} else {
safari.extension.addContentScriptFromURL(safari.extension.baseURI + "adblock_safari_beforeload.js", [], [], false);
safari.extension.removeContentScript(safari.extension.baseURI + "adblock_safari_contentblocking.js");
safari.extension.addContentScriptFromURL(safari.extension.baseURI + "js/adblock_safari_beforeload.js", [], [], false);
safari.extension.removeContentScript(safari.extension.baseURI + "js/adblock_safari_contentblocking.js");
}
}
set_content_scripts();
Expand All @@ -237,13 +237,13 @@ safari.application.addEventListener("beforeNavigate", function(event) {

//remove bandaids.js from YouTube.com when a user pauses AdBlock or if the enabled click to flash compatibility mode
if (/youtube.com/.test(event.url) && (is_adblock_paused() || (get_settings().clicktoflash_compatibility_mode === true))) {
safari.extension.removeContentScript(safari.extension.baseURI + "bandaids.js");
safari.extension.removeContentScript(safari.extension.baseURI + "js/bandaids.js");
}
// YouTube Channel Whitelist
if (/youtube.com/.test(event.url) && get_settings().youtube_channel_whitelist && !parseUri.parseSearch(event.url).ab_channel) {
safari.extension.addContentScriptFromURL(safari.extension.baseURI + "ytchannel.js", [], [], false);
safari.extension.addContentScriptFromURL(safari.extension.baseURI + "js/ytchannel.js", [], [], false);
} else {
safari.extension.removeContentScript(safari.extension.baseURI + "ytchannel.js");
safari.extension.removeContentScript(safari.extension.baseURI + "js/ytchannel.js");
}
}, true);

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@
{
"matches": ["http://*/*", "https://*/*"],
"js": [
"port.js",
"functions.js",
"jquery/jquery.min.js",
"lib/jquery.min.js",
"js/port.js",
"js/functions.js",
"filtering/filteroptions.js",
"adblock_start_common.js",
"adblock_start_chrome.js",
"js/adblock_start_common.js",
"js/adblock_start_chrome.js",
"catblock/contentscript.js"
],
"run_at": "document_start",
Expand Down
Loading

0 comments on commit 7a6d29d

Please sign in to comment.