-
Notifications
You must be signed in to change notification settings - Fork 1
/
options.js
39 lines (33 loc) · 957 Bytes
/
options.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
$(function () {
$("input,checkbox,textarea,radio,checkbox").not("[type=submit],[type=image]").jqBootstrapValidation(
{
submitSuccess: function ($form, event) {
event.preventDefault();
alert("Prevented submit");
}
}
);
var names = [];
$("input[type=radio]").each(function (i, el) {
names.push(el.attr("name"));
});
names = $.grep(names,function(v,k){
return $.inArray(v,names) === k;
});
$.each(names, function (i, el) {
var val = window.localStorage.getItem("GitHub_Preferences_" + el);
if (val == "false") {
val = false;
}
if (val) {
$("input[type=radio][name=" + el + "][value=true]").attr("checked", "checked");
} else {
$("input[type=radio][name=" + el + "][value=false]").attr("checked", "checked");
}
});
$("input[type=radio]").click(function () {
var $this = $(this);
if ($this.val() === "true") {
}
})
});