1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-25 01:20:30 +00:00

Fixes to get recent changes list to work

This commit is contained in:
Jeremy Ruston 2013-10-13 22:59:14 +01:00
parent ce4a6ffa49
commit 942e463b20
2 changed files with 10 additions and 3 deletions

View File

@ -44,6 +44,7 @@ ViewWidget.prototype.execute = function() {
this.viewField = this.getAttribute("field","text"); this.viewField = this.getAttribute("field","text");
this.viewIndex = this.getAttribute("index"); this.viewIndex = this.getAttribute("index");
this.viewFormat = this.getAttribute("format","text"); this.viewFormat = this.getAttribute("format","text");
this.viewTemplate = this.getAttribute("template","");
switch(this.viewFormat) { switch(this.viewFormat) {
case "wikified": case "wikified":
this.text = this.getValueAsWikified(); this.text = this.getValueAsWikified();
@ -55,7 +56,7 @@ ViewWidget.prototype.execute = function() {
this.text = this.getValueAsHtmlEncoded(); this.text = this.getValueAsHtmlEncoded();
break; break;
case "date": case "date":
this.text = this.getValueAsDate(this.viewFormat); this.text = this.getValueAsDate(this.viewTemplate);
break; break;
case "relativedate": case "relativedate":
this.text = this.getValueAsRelativeDate(); this.text = this.getValueAsRelativeDate();
@ -120,7 +121,7 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of
*/ */
ViewWidget.prototype.refresh = function(changedTiddlers) { ViewWidget.prototype.refresh = function(changedTiddlers) {
var changedAttributes = this.computeAttributes(); var changedAttributes = this.computeAttributes();
if(changedAttributes.title || changedAttributes.field || changedAttributes.index || changedTiddlers[this.viewTitle]) { if(changedAttributes.title || changedAttributes.field || changedAttributes.index || changedAttributes.template || changedAttributes.format || changedTiddlers[this.viewTitle]) {
this.refreshSelf(); this.refreshSelf();
return true; return true;
} else { } else {

View File

@ -1,8 +1,14 @@
title: $:/snippets/recentchanges title: $:/snippets/recentchanges
<$list filter="[!is[system]has[modified]!sort[modified]limit[100]eachday[modified]]" itemClass="tw-menu-list-item"> <$list filter="[!is[system]has[modified]!sort[modified]limit[100]eachday[modified]]" itemClass="tw-menu-list-item">
<div class="tw-menu-list-item">
<$view field="modified" format="date" template="DDth MMM YYYY"/> <$view field="modified" format="date" template="DDth MMM YYYY"/>
<$list filter="[sameday{!!modified}!is[system]!sort[modified]]" itemClass="tw-menu-list-subitem"> <$list filter="[sameday{!!modified}!is[system]!sort[modified]]" itemClass="tw-menu-list-subitem">
<$view field="title" format="link"/> <div class="tw-menu-list-subitem">
<$link to={{!!title}}>
<$view field="title"/>
</$link>
</div>
</$list> </$list>
</div>
</$list> </$list>