2023-04-29 00:06:16 +02:00
|
|
|
var Templating = {
|
2023-05-01 00:08:01 +02:00
|
|
|
ViewNote(Note, Override) {
|
|
|
|
Override = Override || {};
|
|
|
|
//var Url = TryStr(Note.Url) || Note.ServerId;
|
|
|
|
var Url = Override.Url || GetWebUrl(Note, 'Note');
|
|
|
|
//var ProfileUrl = TryStr(Note.Profile.Url) || Note.Profile.ServerUsername;
|
|
|
|
var ProfileUrl = Override.ProfileUrl || GetWebUrl(Note.Profile, 'Profile');
|
|
|
|
//if (Note.Quoting) {
|
|
|
|
// //Note.Quoting.Profile.Url = TryStr(Note.Quoting.Profile.Url) || Note.Quoting.Profile.ServerUsername;
|
|
|
|
//};
|
2023-04-29 00:06:16 +02:00
|
|
|
return `<div class="View Note">
|
2023-05-01 00:08:01 +02:00
|
|
|
<a href="${ProfileUrl}" onclick="DisplayProfile('${ProfileUrl}'); return false;">
|
|
|
|
<img class="Profile Icon" src="${MkReqUrl(Note.Profile.Icon)}"/>
|
2023-04-29 00:06:16 +02:00
|
|
|
${Note.Profile.Name}
|
|
|
|
</a>
|
2023-04-29 17:14:23 +02:00
|
|
|
<div class="Note Content">
|
|
|
|
${Note.Content ? Note.Content : 'renoted:'}
|
|
|
|
${Note.Quoting ? Templating.ViewNote(Note.Quoting) : ''}
|
|
|
|
</div>
|
2023-05-01 00:08:01 +02:00
|
|
|
<a href="${Url}" onclick="DisplayThread('${Url}'); return false;">
|
|
|
|
${Note.Time}
|
|
|
|
</a>
|
2023-04-29 00:06:16 +02:00
|
|
|
</div>`;
|
|
|
|
},
|
2023-05-01 00:08:01 +02:00
|
|
|
ViewProfile(Profile, Override) {
|
|
|
|
Override = Override || {};
|
|
|
|
//var Url = TryStr(Profile.Url) || Profile.ServerUsername;
|
|
|
|
var Url = Override.Url || GetWebUrl(Profile, 'Profile');
|
|
|
|
var Name = Override.Name || Profile.Name;
|
|
|
|
return `<div class="View Profile">
|
|
|
|
<a href="${Url}" onclick="DisplayProfile('${Url}'); return false;">
|
|
|
|
<img class="Profile Banner" data-assign="src=Banner" src="${Override.Banner || MkReqUrl(Profile.Banner)}"/>
|
2023-04-29 17:14:23 +02:00
|
|
|
<div>
|
2023-05-01 00:08:01 +02:00
|
|
|
<img class="Profile Icon" data-assign="src=Icon" src="${Override.Icon || MkReqUrl(Profile.Icon)}"/>
|
|
|
|
<span data-assign="innerHTML=Name">
|
|
|
|
${Name}
|
|
|
|
</span>
|
2023-04-29 17:14:23 +02:00
|
|
|
</div>
|
|
|
|
</a>
|
|
|
|
</div>`;
|
|
|
|
},
|
2023-04-29 00:06:16 +02:00
|
|
|
};
|