Änderungen von Dokument Sandbox
Zuletzt geändert von Holger Engels am 2024/01/26 15:58
Von Version 26.1
bearbeitet von Holger Engels
am 2023/11/20 21:17
am 2023/11/20 21:17
Änderungskommentar:
Es gibt keinen Kommentar für diese Version
Auf Version 21.1
bearbeitet von Holger Engels
am 2023/11/14 19:44
am 2023/11/14 19:44
Änderungskommentar:
Es gibt keinen Kommentar für diese Version
Zusammenfassung
-
Seiteneigenschaften (1 geändert, 0 hinzugefügt, 0 gelöscht)
Details
- Seiteneigenschaften
-
- Inhalt
-
... ... @@ -120,14 +120,13 @@ 120 120 == Rating Tests == 121 121 122 122 {{velocity}} 123 -$services.ratings.aufgaben.setRating("xwiki:Sandbox.WebHome.WebHome^test", 0) 124 -$services.ratings.aufgaben.getCurrentUserRatings(0, 100, true) 125 - 123 +#set($average = $services.ratings.aufgaben.getAverageRating($doc.space + "^" + "test")) 124 +vote: $average.get().averageVote 126 126 {{html clean="false" wiki="true"}} 127 127 <style> 128 128 star-rating { display: inline-block; width: 120px } 129 129 </style> 130 -<star-rating stars=5 rating="$average.get().averageVote" rid="test"bgcolor="white" nocolor="lightgrey" color="gold" onclick="rated.call(this)"></star-rating>129 +<star-rating stars=5 rating="$average.get().averageVote" bgcolor="white" nocolor="lightgrey" color="gold" onclick="rated.call(this)"></star-rating> 131 131 {{/html}} 132 132 {{/velocity}} 133 133 ... ... @@ -134,18 +134,17 @@ 134 134 {{html clean="false"}} 135 135 <script> 136 136 function rated() { 137 - console.log(XWiki.currentDocument.space + ".WebHome") 138 138 console.log(this.getAttribute("rating")); 139 - sendRate( this.getAttribute("rid"),parseInt(this.getAttribute("rating")));137 + sendRate(parseInt(this.getAttribute("rating"))); 140 140 } 141 - var sendRate = function ( rid,vote) {139 + var sendRate = function (vote) { 142 142 fetch(new XWiki.Document('WebHome', 'Macros.Aufgabenbewertung').getURL('get') + "?outputSyntax=plain", { 143 143 method: "POST", 144 144 headers: { "Content-Type": "application/json"}, 145 145 body: JSON.stringify({ 146 146 vote: vote, 147 - doc: XWiki.currentDocument.space + ".WebHome",148 - id: rid,145 + doc: XWiki.currentDocument.space, 146 + id: "test", 149 149 form_token: document.documentElement.getAttribute("data-xwiki-form-token") 150 150 }) 151 151 }).then(data => { ... ... @@ -154,16 +154,3 @@ 154 154 } 155 155 </script> 156 156 {{/html}} 157 - 158 -== Alle Problemlöseaufgaben == 159 - 160 -{{html}} 161 -<h1>Header Level H1</h1> 162 -<h2>Header Level H2</h2> 163 -<h3>Header Level H3</h3> 164 -<h4>Header Level H4</h4> 165 -<h5>Header Level H5</h5> 166 -<h6>Header Level H6</h6> 167 - 168 - 169 -{{/html}}