0 Votes

Changes for page Todolist Macro

Last modified by Ryan C on 2025/04/30 07:54

From version 24.1
edited by Ryan C
on 2025/04/24 11:16
Change comment: There is no comment for this version
To version 21.1
edited by Ryan C
on 2025/04/24 11:12
Change comment: Todo List updated

Summary

Details

Page properties
Content
... ... @@ -3,7 +3,5 @@
3 3  {{todolist width="50%" center="1"}}
4 4  a 3nd thing|0
5 5  adding this thing|0
6 -adding this thing|0
7 -refreshed they are still there not even having to save page|0
8 8  
9 9  {{/todolist}}
XWiki.JavaScriptExtension[0]
Code
... ... @@ -87,33 +87,30 @@
87 87   }
88 88   return Ember.RSVP.resolve();
89 89   },
90 +
90 90   saveAll: function(alldata) {
91 91   console.log("saveAll");
92 92   var query = { save: "1", content: JSON.stringify(alldata) };
93 -return new Ember.RSVP.Promise(function(resolve, reject) {
94 - jQuery.getJSON(
95 - "${xwiki.getURL('TodoLists.TodoListsService')}?page=" +
96 - (
97 - typeof XWiki !== 'undefined' &&
98 - XWiki.currentSpace &&
99 - XWiki.currentPage
100 - ? XWiki.currentSpace + "." + XWiki.currentPage
101 - : document.location.pathname.split('/').pop()
102 - ) +
103 - "&xpage=plain&outputSyntax=plain",
104 - query
105 - ).then(function(data) {
106 - Ember.run(function() {
107 - resolve(data);
108 - });
109 - }, function(jqXHR) {
110 - Ember.run(function() {
111 - reject(jqXHR);
112 - });
94 +
95 + return new Ember.RSVP.Promise(function(resolve, reject) {
96 + jQuery.getJSON(
97 + "${xwiki.getURL('TodoLists.TodoListsService')}?page=" +
98 + XWiki.currentSpace + "." + XWiki.currentPage +
99 + "&xpage=plain&outputSyntax=plain",
100 + query
101 + ).then(function(data) {
102 + Ember.run(function() {
103 + resolve(data);
104 + });
105 + }, function(jqXHR) {
106 + Ember.run(function() {
107 + reject(jqXHR);
108 + });
109 + });
110 + });
111 + }
113 113   });
114 -});
115 115  
116 -
117 117   // Register the adapter
118 118   Todos.ApplicationAdapter.reopen({
119 119   namespace: 'api'