-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathoptions.js
23 lines (22 loc) · 915 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
function getJSONData() {
var data = localStorage["DropletAutofillJSONData"];
if(data == null || data == undefined || data == "") {
$("#note")[0].innerHTML = "<strong>Oh Snap!!</strong> It seems that you dont have any JSON data. Please contact your lead to get the latest JSON file.";
$("#note").addClass("alert alert-error");
}
else {
$("#jsonText").val(data);
}
}
/*
* called automatically as soon as the options page loads
*/
$( document ).ready(function() {
$("#updateButton").bind('click', function(){
localStorage["DropletAutofillJSONData"] = $("#jsonText").val();
$("#note").removeClass("alert-error");
$("#note").addClass("alert alert-success");
$("#note")[0].innerHTML = "<strong>Nice!!</strong> Now that you have the updated JSON data, try clicking on the droplet icon on the extentions bar.";
});
getJSONData();
});