This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //SEARCHES THE "document.body" for a TEXT_NODE that matches the string "book" and returns true if it does and false if it doesnt. | |
| function talksAbout( node, string ) { | |
| if ( node.nodeType == document.ELEMENT_NODE ) { | |
| for ( var i = 0; i < node.childNodes.length; i++ ) { | |
| if ( talksAbout( node.childNodes[ i ], string ) ) | |
| return true; | |
| } | |
| return false; | |
| } else if ( node.nodeType == document.TEXT_NODE ) { | |
| return node.nodeValue.indexOf( string ) > -1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function onOpen() { | |
| var menuEntries = [ {name: "Create Diary Doc from Sheet", functionName: "createDocFromSheet"}]; | |
| var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
| ss.addMenu("Fitness Diaries", menuEntries); | |
| } | |
| function createDocFromSheet(){ | |
| var templateid = "1O4afl8SZmMxMFpAiN16VZIddJDaFdeRBbFyBtJvepwM"; // get template file id | |
| var FOLDER_NAME = "Fitness Diaries"; // folder name of where to put completed diaries | |
| // get the data from an individual user |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <header>MINIMALISTIC FORM</header> | |
| <form id="form" class="topBefore"> | |
| <input id="name" type="text" placeholder="NAME"> | |
| <input id="email" type="text" placeholder="E-MAIL"> | |
| <textarea id="message" type="text" placeholder="MESSAGE"></textarea> | |
| <input id="submit" type="submit" value="GO!"> | |
| </form> |