/
856links.js
35 lines (28 loc) · 1.23 KB
/
856links.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
var linkText
var qrCode
var theLinks = new Array();
function linkQR(){
if ($("table").is('.bibLinks')){
$(".bibLinks a").each(function(index) {
if($(this).parent().html().indexOf("williamwoods") > -1 || $(this).parent().html().indexOf("westminster") > -1 || $(this).parent().html().indexOf("Missouri State Employee") > -1){
$(this).parent().parent().hide()
}else {
theLinks.push($(this).attr("href"));
linkText = $(this).text();
$("<input type='radio' name='item' />" + linkText + "<br />").appendTo("#qrChoice")
}
});
if ( theLinks.length > 1 ) {
$("#qrChoice").show();
}
$("#qrChoice input").change(function () {
index = $("#qrChoice input").index(this);
var qrCode = '<img src="http://chart.apis.google.com/chart?chs=100x100&cht=qr&chl=' + encodeURIComponent(theLinks[index]) + '">';
$("#qr").html(qrCode);
});
var qrCode = '<img src="http://chart.apis.google.com/chart?chs=100x100&cht=qr&chl=' + encodeURIComponent(theLinks[0]) + '">';
$("#qr").html(qrCode);
$("#qr").show();
}else{
}
}