Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.64 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <base target="_top">
  5. </head>
  6. <body>
  7. <center>
  8. Enter your User ID below. If you are re-using a row in your Catalog Spreadsheet (meaning you know the row number),<br>
  9. enter it below in the "Song ID" field, enter the Song Title, and then click the "Continue" button. Else, enter your<br>
  10. User ID only and click the "Continue" button. We will find the next avalable empty row at the end of your Catalog<br>
  11. Spreadsheet and display its value to you. Then you may enter it and your Song Title. After you do, click the<br>
  12. "Continue" button to create the lyric sheet and add the new song to your Catalog Spreadsheet.<br><br>
  13.  
  14. Note: We will automatically add your name to the lyric sheet as the songwriter. Add additional writers manually<br>
  15. on the lyric sheet.<br><br>
  16.  
  17. <div>
  18. <input id="user" type="text" placeholder="User ID"><br><br>
  19. <div id="results"></div>
  20. </div>
  21. <input id="song" type="text" placeholder="Song ID"><br><br>
  22. <input id="title" type="text" placeholder="Song Title"><br><br>
  23. <input type="button" value="Continue" onclick="saveUserInput()"><br><br>
  24. </center>
  25. <script>
  26.  
  27. function saveUserInput() {
  28. var userId = document.getElementById('userId').value;
  29. var songId = document.getElementById('userId').value;
  30. if(songId != ""){
  31. window.saveUserInput = function() {
  32. var userId = document.getElementById('userId').value;
  33. var songId = document.getElementById('songId').value;
  34. var songTitle = document.getElementById('idNewSongTitle').value;
  35. console.log('songTitle: ' + songTitle)
  36. google.script.run
  37. .withSuccessHandler(openPrompt)
  38. .getSongId({userId:userId, songId:songId, songTitle:songTitle})
  39. }
  40. }
  41. else {
  42. google.script.run
  43. .withSuccessHandler(function(hl){
  44. document.getElementById('results').innerHTML=hl;
  45. })
  46. .getSongId({userId:userId})
  47. }
  48.  
  49. function openPrompt(results){
  50. window.open(results.url, '_blank').focus();
  51. }
  52. }
  53. </script>
  54. </body>
  55. </html>
  56.  
  57. function doGet() {
  58. return HtmlService.createHtmlOutputFromFile('Index');
  59. }
  60.  
  61. function getSongId(uObj) {
  62. var userId = uObj.userId;
  63. var songId = uObj.songId;
  64. var songTitle = uObj.songTitle;
  65.  
  66. if(songId !=""){
  67.  
  68. Code not included to keep this brief, but it has been tested in other applications of this project and works and what it does is: if the user has entered a Song ID, this code creates the new lyric sheet and adds the new song name to the Catalog SS.
  69.  
  70. }
  71. else{
  72.  
  73. This code does this:
  74. return ('The next available row for the new song is '+songId);
  75. }
  76. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement