1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-26 15:23:15 +00:00

Merge branch 'master' into confetti-plugin

This commit is contained in:
Jeremy Ruston 2023-10-17 11:56:06 +01:00
commit 10fad328dd
5 changed files with 45 additions and 13 deletions

View File

@ -58,24 +58,25 @@ ImageWidget.prototype.render = function(parent,nextSibling) {
if(this.wiki.isImageTiddler(this.imageSource)) {
var type = tiddler.fields.type,
text = tiddler.fields.text,
_canonical_uri = tiddler.fields._canonical_uri;
_canonical_uri = tiddler.fields._canonical_uri,
typeInfo = $tw.config.contentTypeInfo[type] || {},
deserializerType = typeInfo.deserializerType || type;
// If the tiddler has body text then it doesn't need to be lazily loaded
if(text) {
// Render the appropriate element for the image type
switch(type) {
case "application/pdf":
// Render the appropriate element for the image type by looking up the encoding in the content type info
var encoding = typeInfo.encoding || "utf8";
if (encoding === "base64") {
// .pdf .png .jpg etc.
src = "data:" + deserializerType + ";base64," + text;
if (deserializerType === "application/pdf") {
tag = "embed";
src = "data:application/pdf;base64," + text;
break;
case "image/svg+xml":
src = "data:image/svg+xml," + encodeURIComponent(text);
break;
default:
src = "data:" + type + ";base64," + text;
break;
}
} else {
// .svg .tid .xml etc.
src = "data:" + deserializerType + "," + encodeURIComponent(text);
}
} else if(_canonical_uri) {
switch(type) {
switch(deserializerType) {
case "application/pdf":
tag = "embed";
src = _canonical_uri;

View File

@ -0,0 +1,20 @@
title: 中文社区 - Chinese Community
tags: Community
# A Chinese community tutorial program that people can edit together:
#* Main site: [ext[https://tw-cn.netlify.app/]]
#* Accelerated access: [ext[https://tw-cn.cpolar.top/]]
#* Alternate: [ext[https://tiddly-wiki-chinese-tutorial.vercel.app]]
# Tiddlywiki Chinese Chat Forum: [ext[https://talk.tidgi.fun/topic/6]]
# Chinese translation of Tiddlywiki official website [ext[https://bramchen.github.io/tw5-docs/zh-Hans/]]
# The best Chinese introductory tutorial for newbies [ext[https://keatonlao.github.io/tiddlywiki-xp/]]
---
# 大家可以一起编辑的中文社区教程项目:
#* 主站:[ext[https://tw-cn.netlify.app/]]
#* 加速访问:[ext[https://tw-cn.cpolar.top/]]
#* 备用:[ext[https://tiddly-wiki-chinese-tutorial.vercel.app]]
# 太微中文交流论坛:[ext[https://talk.tidgi.fun/topic/6]]
# 太微官网汉化版:[ext[https://bramchen.github.io/tw5-docs/zh-Hans/]]
# 最适合新手的中文入门教程:[ext[https://keatonlao.github.io/tiddlywiki-xp/]]

View File

@ -33,6 +33,11 @@ TiddlyWiki lets you choose where to keep your data, guaranteeing that in the dec
<$macrocall $name="flex-card" bordercolor={{!!color}} textcolor={{!!text-color}} backgroundcolor={{!!background-color}} captionField="caption" descriptionField="text"/>
</$list>
</div>
<div class="tc-cards tc-small">
<$link to="中文社区 - Chinese Community" class="tc-btn-big-green tc-card">
中文社区 - Chinese Community
</$link>
</div>
!! ''Find Out More''

View File

@ -147,6 +147,10 @@ type: text/vnd.tiddlywiki
gap: 1em;
}
.tc-cards.tc-small {
font-size: 0.7em;
}
.tc-cards.tc-action-card {
text-align: center;
background: none;

View File

@ -551,3 +551,5 @@ Eric Haberstroh, @pille1842, 2023/07/23
BuckarooBanzay, @BuckarooBanzay, 2023/09/01
Timur, @T1mL3arn, 2023/10/04
Wang Ke, @Gk0Wk, 2023/10/17