forked from Blueprinter/Update-Apps-Script
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJS_Picker.html
More file actions
60 lines (48 loc) · 2.37 KB
/
JS_Picker.html
File metadata and controls
60 lines (48 loc) · 2.37 KB
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
<script>
window.fncShowFiles = function(srcOrTrgt) {
document.getElementById("idRootFldr").selected = "selected";
document.getElementById("tblFilesList").style.display = "inline";
document.getElementById("idFilePkr").style.display = "inline";
window.whichBtnWuzClykt = srcOrTrgt;
//document.getElementById("tblFilesList").style.backgroundColor = "#0c343d";
google.script.run.withSuccessHandler(showListOfScriptFiles).getFilesGS_Code();
};
window.showListOfScriptFiles = function(strObjScripts) {
//console.log('showListOfScriptFiles ran');
if (strObjScripts !== "") {
document.getElementById('tblFilesList').innerHTML = strObjScripts;
} else {
document.getElementById('tblFilesList').innerHTML = '<div>No APPS SCRIPT FILES in this Folder</div>';
};
document.getElementById('tblFilesList').style.backgroundColor = "#b5d5a7";
};
window.pkThisFile = function(theElmt) {
if (window.lastChoosenLine!==undefined) {
window.lastChoosenLine.setAttribute("style","background-color:#b5d5a7; color:black;");
};
var theScriptName = theElmt.childNodes[0].innerHTML,theID = theElmt.childNodes[1].textContent;
theElmt.setAttribute("style","background-color:#4a86e8;color:#990000;");
window.lastChoosenLine = theElmt;
window.ssInfo = theScriptName + "," + theID;
document.getElementById('idBtnSlct').removeAttribute('disabled'); //clear disabled attribute on Save btn
};
window.cnclFilePkr = function() {
document.getElementById("tblFilesList").style.display = "none";
document.getElementById("idFilePkr").style.display = "none";
};
window.getMoreFiles = function(whatFldr) {
google.script.run.withSuccessHandler(showListOfScriptFiles).getFilesGS_Code(whatFldr);
};
window.slctBtnWuzClkt = function() {
var objWhichPkr = {'src':['idSourceFile','idSrcID'],'trgt':['idTrgetFile','idTrgetID']};
var whatKey = window.whichBtnWuzClykt;
var elmtIdOfFileName = objWhichPkr[whatKey][0];
var tagIdOffileID = objWhichPkr[whatKey][1];
var arryLastChoosenSS = window.ssInfo.split(",");
document.getElementById(elmtIdOfFileName).textContent = arryLastChoosenSS[0];
document.getElementById(tagIdOffileID).textContent = arryLastChoosenSS[1];
document.getElementById("tblFilesList").style.display = "none";
document.getElementById("idFilePkr").style.display = "none";
document.getElementById("tblFilesList").innerHTML = "<div>Loading . . . . </div>";
};
</script>