-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathview.js
81 lines (77 loc) · 2.63 KB
/
view.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
70
71
72
73
74
75
76
77
78
79
80
81
//data set
/*
var design = {};
design.color = {
bg: 'blue'
};
chrome.storage.local.set(design, function() {
console.log('stored');
});
*/
//data get
///*
var defaults = {};
defaults.color = {
bg: 'no data',
bg_img:'no data',
box1:'no data',
box2:'no data',
box3:'no data',
box4:'no data',
box5:'no data',
box6:'no data',
};
chrome.storage.local.get(defaults, function(items) {
console.log(items.color.bg);
var backcolor = document.getElementById('bgcolor');
if(items.color.box1 != ""){document.getElementById("view_box1").innerHTML = "<iframe src='content/"+items.color.box1+".html'></iframe>"}
if(items.color.box2 != ""){document.getElementById("view_box2").innerHTML = "<iframe src='content/"+items.color.box2+".html'></iframe>"}
if(items.color.box3 != ""){document.getElementById("view_box3").innerHTML = "<iframe src='content/"+items.color.box3+".html'></iframe>"}
if(items.color.box4 != ""){document.getElementById("view_box4").innerHTML = "<iframe src='content/"+items.color.box4+".html'></iframe>"}
if(items.color.box5 != ""){document.getElementById("view_box5").innerHTML = "<iframe src='content/"+items.color.box5+".html'></iframe>"}
if(items.color.box6 != ""){document.getElementById("view_box6").innerHTML = "<iframe src='content/"+items.color.box6+".html'></iframe>"}
//bgcolor***********************************/
if(items.color.bg == "red"){
bgcolor_rgb = "#ff0000"
}else
if(items.color.bg == "orange"){
bgcolor_rgb = "#ff8000"
}else
if(items.color.bg == "yellow"){
bgcolor_rgb = "#ffff00"
}else
if(items.color.bg == "yellow-green"){
bgcolor_rgb = "#80ff00"
}else
if(items.color.bg == "green"){
bgcolor_rgb = "#00ff00"
}else
if(items.color.bg == "melon"){
bgcolor_rgb = "#00ff80"
}else
if(items.color.bg == "light-blue"){
bgcolor_rgb = "#00ffff"
}else
if (items.color.bg == "blue"){
bgcolor_rgb = "#0000ff"
}else
if (items.color.bg == "purple"){
bgcolor_rgb = "#ff00ff"
}else
if (items.color.bg == "gray"){
bgcolor_rgb = "#aaaaaa"
}else
if (items.color.bg == "white"){
bgcolor_rgb = "#ffffff"
}else
if (items.color.bg == "black"){
bgcolor_rgb = "#000000"
}else{
bgcolor_rgb="#000000"
}
backcolor.style.backgroundColor=bgcolor_rgb;//bgcolor style set
backcolor.style.backgroundImage="url("+items.color.bg_img+")";//bgcolor imgs set
console.log(items.color.bg_img)
/********************************************/
});
//*/