Guest User

Untitled

a guest
Jul 15th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. function onMainPageAttach(page) {
  2. google.script.run.withSuccessHandler( function(resp) {
  3. page.descendants.ToFolderLink.text = resp.title;
  4. page.descendants.ToFolderLink.href = resp.link;
  5. }).getLinkToFolderByProperty();
  6. }
  7.  
  8. /**
  9. * @param {widget} widget - Button widget.
  10. * @param {event}
  11. */
  12. function onMainInputClick(widget, event) {
  13. // var widgets = widget.parent.descendants;
  14. var input = widget.parent.descendants.InputTextBox.value;
  15. app.popups.ModalLoadingIndicator.visible = true;
  16. google.script.run.withSuccessHandler( function(resp) {
  17. var props = app.currentPage.properties;
  18. props.TitleProperty = resp.title;
  19. props.UrlProperty = resp.url;
  20. props.MessageProperty = resp.message;
  21. app.popups.ModalLoadingIndicator.visible = false;
  22. }).processMain(input);
  23. }
  24.  
  25. /**
  26. * @param {widget} widget - Button widget.
  27. * @param {event}
  28. */
  29. function onToFolderButtonClick(widget) {
  30. var toFolder = widget.parent.descendants.ToFolderTextBox.value;
  31. widget.parent.descendants.ToFolderTextBox.value = '';
  32. app.popups.ModalLoadingIndicator.visible = true;
  33. google.script.run.withSuccessHandler( function(resp) {
  34. var props = app.currentPage.properties;
  35. props.ToFolderName = resp.title;
  36. props.ToFolderUrl = resp.url;
  37. props.MessageProperty = resp.message;
  38. app.popups.ModalLoadingIndicator.visible = false;
  39. }).setToFolderByUrl(toFolder);
  40. }
Add Comment
Please, Sign In to add comment