-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
48 lines (42 loc) · 1.4 KB
/
index.js
File metadata and controls
48 lines (42 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
$(document).ready(function () {
"use strict";
var leftdiv = document.getElementById("leftrow");
var rightdiv = document.getElementById("rightrow");
function resize(width) {
if (width < 985) {
$(rightdiv).css("display", "none").removeClass("col-xs-4");
$(leftdiv).removeClass("col-xs-8");
} else {
$(rightdiv).css("display", "block").addClass("col-xs-4");
$(leftdiv).addClass("col-xs-8");
}
}
// Resize divs properly
resize($(window).width());
$(window).resize(function() {
var width = $(window).width();
resize(width);
});
// Let's detect the browser, and show a Safari downloads link if it's unsupported
var chrome = window.chrome;
var opera = window.opr;
var safari = window.safari;
var $DLbutton = $("#downloadbtn");
if (opera) {
$DLbutton.text("Download for Opera");
$DLbutton.click(function() {
opr.addons.installExtension("pejeadkbfbppoaoinpmkeonebmngpnkk");
});
} else if (chrome) {
$DLbutton.text("Download for Chrome");
$DLbutton.click(function() {
chrome.webstore.install();
});
} else if (safari) {
$DLbutton.text("Download for Safari");
$DLbutton.attr("href", "/safari");
} else {
$DLbutton.text("Unfortunately, CatBlock is not available for your browser.");
$DLbutton.attr("href", "#");
}
});