forked from irplus-remote/irplus-remote.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
49 lines (44 loc) · 1.39 KB
/
app.js
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
49
//console.log("app.js loaded");
function switchPage(page) {
//console.log("switch page");
$(".contentDiv").empty();
$(".contentDiv").append("<div data-include='" + page + "'></div>");
processIncludes();
}
function processIncludes() {
//console.log("processIncludes");
$("[data-include]").each(function () {
var that = $(this);
that.load(that.attr('data-include'), function () {
that.contents().unwrap();
});
});
}
function doCommonGSearches(el){
var autogvalue = el.val();
var gurl = 'https://www.google.com?#q=';
window.open(gurl + autogvalue + '+discrete ir codes', '_blank');
window.open(gurl + autogvalue + '+rmdu', '_blank');
window.open(gurl + autogvalue + '+remotecentral', '_blank');
window.open(gurl + autogvalue + '+lirc', '_blank');
window.open(gurl + autogvalue + '+ict', '_blank');
window.open(gurl + autogvalue + '+pronto hex', '_blank');
}
function pageLoaded(){
//console.log("pageLoaded");
var hash = window.location.hash;
if (hash !== undefined && hash !== "") {
switchPage(hash.replace("#", "") + ".html");
} else {
processIncludes();
}
}
$(window).on('hashchange', function(e) {
//collapse the responsive navbar after clicking a link
$('.navbar-collapse').collapse('hide');
//load content
pageLoaded();
});
$(function () {
pageLoaded();
});