forked from sahava/gtm-tools-sheets-documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMarkChangesJavaScript.html
More file actions
28 lines (23 loc) · 868 Bytes
/
MarkChangesJavaScript.html
File metadata and controls
28 lines (23 loc) · 868 Bytes
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
<script>
(function() {
var mark = document.querySelector('#mark');
var info = document.querySelector('#info');
var changesMarked = function(status) {
mark.innerText = 'Finished';
info.innerHTML = '<strong>Done</strong>!<br/><br/>' + status + ' changed Notes highlighted.';
};
var onError = function(error) {
mark.innerText = 'Error';
info.innerHTML = '<span class="error">' + error.message + '</span>';
};
document.querySelector('#close').addEventListener('click', function() {
google.script.host.close();
});
mark.addEventListener('click', function() {
mark.disabled = true;
mark.innerText = 'Working...';
mark.className = 'share';
google.script.run.withSuccessHandler(changesMarked).withFailureHandler(onError).markChangedNotes();
});
})();
</script>