-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstudentmatrix-dev.js
113 lines (106 loc) · 2.6 KB
/
studentmatrix-dev.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
StudentMatrix.plugins.dev = {
name : 'Development',
description : 'Debugging and development tools for StudentMatrix.',
version : '1.1',
updateUrl : 'https://raw.github.com/Itangalo/studentmatrix/3.x/studentmatrix-dev.js',
cell : 'D3',
dependencies : {
core : '3.0',
modules : {
menu : '1.0',
},
},
globalActions : {
devMenu : {
name : 'Add development menu',
group : 'Development',
processor : function() {
addDevMenu();
},
},
reset : {
name : 'Reset all properties and settings',
group : 'Development',
processor : function() {
StudentMatrixMenu_resetProperties();
},
},
rebuildMenu : {
name : 'Rebuild the menu',
group : 'Development',
processor : function() {
StudentMatrixMenu_buildMenu();
},
},
resetMenu : {
name : 'Reset the menu',
group : 'Development',
processor : function() {
StudentMatrixMenu_resetMenu();
},
},
dev : {
name : 'Run temporary dev function',
group : 'Development',
processor : function() {
dev();
},
},
},
};
function debug(variable, option) {
if (option == 'index') {
var indexes = '';
for (var i in variable) {
indexes = indexes + i + ':' + variable[i] + ' ';
}
option = 'pause';
variable = indexes;
}
if (option == 'pause') {
Browser.msgBox(variable);
return;
}
SpreadsheetApp.getActiveSpreadsheet().toast(variable, typeof variable);
}
function addDevMenu() {
var entry = {
weight : 50,
};
StudentMatrix.setProperty(entry, 'StudentMatrixMenu', 'dev_bar');
var entry = {
callback : 'dev',
name : 'Dev',
weight : 51,
};
StudentMatrix.setProperty(entry, 'StudentMatrixMenu', 'dev');
var entry = {
name : 'Rebuild menu',
weight : 52,
};
StudentMatrix.setProperty(entry, 'StudentMatrixMenu', 'buildMenu');
var entry = {
name : 'Reset menu',
weight : 55,
};
StudentMatrix.setProperty(entry, 'StudentMatrixMenu', 'resetMenu');
var entry = {
name : 'Reset all properties',
weight : 57,
};
StudentMatrix.setProperty(entry, 'StudentMatrixMenu', 'resetProperties');
StudentMatrix.modules.menu.buildMenuEntries();
}
function StudentMatrixMenu_buildMenu() {
StudentMatrix.modules.menu.buildMenuEntries();
}
function StudentMatrixMenu_resetMenu() {
StudentMatrix.modules.menu.resetMenu();
}
function StudentMatrixMenu_resetProperties() {
ScriptProperties.deleteAllProperties();
StudentMatrix.modules.menu.buildMenuEntries();
debug('All properties deleted.');
}
function dev() {
}