-
Notifications
You must be signed in to change notification settings - Fork 1
/
settings.js
69 lines (49 loc) · 2.29 KB
/
settings.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
var entry= document.getElementById("entry");
entry.addEventListener("click",displaySitenames);
var row=1;
function displaySitenames(){
var siteName=document.getElementById("site-name").value;
if(!siteName){
alert("Enter Sitename:")
return;
}
var i=1;
var display=document.getElementById("display");
var newRow=display.insertRow(row);
var cell1=newRow.insertCell(0);
cell1.innerHTML=siteName;
row++;
localStorage.setItem("siteName",siteName);
localStorage.getItem(siteName);
}
// var storage = new LocalStorage();
// var restrictionList = [];
// document.getElementById('entry').addEventListener('click', function () {
// addNewSiteClickHandler('addRestrictionSiteLbl', 'addRestrictionTimeLbl', actionAddRectrictionToList, 'notifyForRestrictionList');
// function actionAddRectrictionToList(newSite, newTime) {
// if (!isContainsRestrictionSite(newSite)) {
// var restriction = new Restriction(newSite, newTime);
// addDomainToEditableListBox(restriction, 'restrictionsList', actionEditSite, deleteRestrictionSite, updateItemFromRestrictionList, updateRestrictionList);
// if (restrictionList === undefined)
// restrictionList = [];
// restrictionList.push(restriction);
// document.getElementById('site-name').value = '';
// //document.getElementById('addRestrictionTimeLbl').value = '';
// updateRestrictionList();
// return true;
// } else return false;
// function addDomainToEditableListBox(entity, elementId, actionEdit, actionDelete, actionUpdateTimeFromList, actionUpdateList) {
// var li = document.createElement('li');
// function updateRestrictionList() {
// storage.saveValue(STORAGE_RESTRICTION_LIST, restrictionList);
// }
// function isContainsRestrictionSite(domain) {
// return restrictionList.find(x => x.url.isMatch(domain)) != undefined;
// }
// function viewRestrictionList(items) {
// if (items !== undefined) {
// for (var i = 0; i < items.length; i++) {
// addDomainToEditableListBox(items[i], 'restrictionsList', actionEditSite, deleteRestrictionSite, updateItemFromRestrictionList, updateRestrictionList);
// }
// }
// }