1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-08-30 01:18:01 +00:00

Merge branch 'master' into pageTemplate-new-syntax

This commit is contained in:
pmario
2024-02-16 22:11:53 +01:00
6 changed files with 98 additions and 98 deletions

View File

@@ -1,5 +1,9 @@
title: $:/core/ui/EditTemplate/body/default title: $:/core/ui/EditTemplate/body/default
\function edit-preview-state()
[{$:/config/ShowEditPreview/PerTiddler}!match[yes]then[$:/state/showeditpreview]] :else[<qualified-preview-state>] +[get[text]] :else[[no]]
\end
\define config-visibility-title() \define config-visibility-title()
$:/config/EditorToolbarButtons/Visibility/$(currentTiddler)$ $:/config/EditorToolbarButtons/Visibility/$(currentTiddler)$
\end \end
@@ -10,12 +14,13 @@ $:/config/EditorToolbarButtons/Visibility/$(currentTiddler)$
\whitespace trim \whitespace trim
<$let <$let
editPreviewStateTiddler={{{ [{$:/config/ShowEditPreview/PerTiddler}!match[yes]then[$:/state/showeditpreview]] :else[<qualify "$:/state/showeditpreview">] }}} qualified-preview-state=<<qualify "$:/state/showeditpreview">>
editPreviewStateTiddler={{{ [{$:/config/ShowEditPreview/PerTiddler}!match[yes]then[$:/state/showeditpreview]] :else[<qualified-preview-state>] }}}
importTitle=<<qualify $:/ImportImage>> importTitle=<<qualify $:/ImportImage>>
importState=<<qualify $:/state/ImportImage>> > importState=<<qualify $:/state/ImportImage>> >
<$dropzone importTitle=<<importTitle>> autoOpenOnImport="no" contentTypesFilter={{$:/config/Editor/ImportContentTypesFilter}} class="tc-dropzone-editor" enable={{{ [{$:/config/DragAndDrop/Enable}match[no]] :else[subfilter{$:/config/Editor/EnableImportFilter}then[yes]else[no]] }}} filesOnly="yes" actions=<<importFileActions>> > <$dropzone importTitle=<<importTitle>> autoOpenOnImport="no" contentTypesFilter={{$:/config/Editor/ImportContentTypesFilter}} class="tc-dropzone-editor" enable={{{ [{$:/config/DragAndDrop/Enable}match[no]] :else[subfilter{$:/config/Editor/EnableImportFilter}then[yes]else[no]] }}} filesOnly="yes" actions=<<importFileActions>> >
<div> <div>
<div class={{{ [<editPreviewStateTiddler>get[text]match[yes]then[tc-tiddler-preview]else[tc-tiddler-preview-hidden]] [[tc-tiddler-editor]] +[join[ ]] }}}> <div class={{{ [<edit-preview-state>match[yes]then[tc-tiddler-preview]else[tc-tiddler-preview-hidden]] [[tc-tiddler-editor]] +[join[ ]] }}}>
<$transclude tiddler="$:/core/ui/EditTemplate/body/editor" mode="inline"/> <$transclude tiddler="$:/core/ui/EditTemplate/body/editor" mode="inline"/>

View File

@@ -10,7 +10,7 @@ shortcuts: ((preview))
\whitespace trim \whitespace trim
<span> <span>
<$transclude $tiddler={{{ [<editPreviewStateTiddler>get[text]match[yes]then[$:/core/images/preview-open]else[$:/core/images/preview-closed]] }}} /> <$transclude $tiddler={{{ [<edit-preview-state>match[yes]then[$:/core/images/preview-open]else[$:/core/images/preview-closed]] }}} />
</span> </span>
<$action-setfield $tiddler=<<editPreviewStateTiddler>> $value={{{ [<editPreviewStateTiddler>get[text]toggle[yes],[no]] }}} /> <$action-setfield $tiddler=<<editPreviewStateTiddler>> $value={{{ [<editPreviewStateTiddler>get[text]toggle[yes],[no]] }}} />
<$action-sendmessage $message="tm-edit-text-operation" $param="focus-editor"/> <$action-sendmessage $message="tm-edit-text-operation" $param="focus-editor"/>

View File

@@ -1,76 +1,69 @@
title: $:/core/macros/CSS title: $:/core/macros/CSS
tags: $:/tags/Macro tags: $:/tags/Global
\define colour(name) \procedure colour(name)
<$transclude tiddler={{$:/palette}} index="$name$"><$transclude tiddler="$:/palettes/Vanilla" index="$name$"><$transclude tiddler="$:/config/DefaultColourMappings/$name$"/></$transclude></$transclude> \whitespace trim
<$transclude $tiddler={{$:/palette}} $index=`$(name)$`>
<$transclude $tiddler="$:/palettes/Vanilla" $index=`$(name)$`>
<$transclude $tiddler=`$:/config/DefaultColourMappings/$(name)$`/>
</$transclude>
</$transclude>
\end \end
\define color(name) \procedure color(name)
<<colour $name$>> <$macrocall $name=colour name=`$(name)$`/>
\end \end
\define box-shadow(shadow) \function box-shadow(shadow)
`` [[ -webkit-box-shadow: $(shadow)$;
-webkit-box-shadow: $shadow$; -moz-box-shadow: $(shadow)$;
-moz-box-shadow: $shadow$; box-shadow: $(shadow)$;]substitute[]]
box-shadow: $shadow$;
``
\end \end
\define filter(filter) \function filter(filter)
`` [[ -webkit-filter: $(filter)$;
-webkit-filter: $filter$; -moz-filter: $(filter)$;
-moz-filter: $filter$; filter: $(filter)$;]substitute[]]
filter: $filter$;
``
\end \end
\define transition(transition) \function transition(transition)
`` [[ -webkit-transition: $(transition)$;
-webkit-transition: $transition$; -moz-transition: $(transition)$;
-moz-transition: $transition$; transition: $(transition)$;]substitute[]]
transition: $transition$;
``
\end \end
\define transform-origin(origin) \function transform-origin(origin)
`` [[ -webkit-transform-origin: $(origin)$;
-webkit-transform-origin: $origin$; -moz-transform-origin: $(origin)$;
-moz-transform-origin: $origin$; transform-origin: $(origin)$;]substitute[]]
transform-origin: $origin$;
``
\end \end
\define background-linear-gradient(gradient) \function background-linear-gradient(gradient)
`` [[ background-image: linear-gradient($(gradient)$);
background-image: linear-gradient($gradient$); background-image: -o-linear-gradient($(gradient)$);
background-image: -o-linear-gradient($gradient$); background-image: -moz-linear-gradient($(gradient)$);
background-image: -moz-linear-gradient($gradient$); background-image: -webkit-linear-gradient($(gradient)$);
background-image: -webkit-linear-gradient($gradient$); background-image: -ms-linear-gradient($(gradient)$);]substitute[]]
background-image: -ms-linear-gradient($gradient$);
``
\end \end
\define column-count(columns) \function column-count(columns)
`` [[-moz-column-count: $(columns)$;
-moz-column-count: $columns$; -webkit-column-count: $(columns)$;
-webkit-column-count: $columns$; column-count: $(columns)$;]substitute[]]
column-count: $columns$;
``
\end \end
\define datauri(title) \procedure datauri(title)
<$macrocall $name="makedatauri" type={{$title$!!type}} text={{$title$}} _canonical_uri={{$title$!!_canonical_uri}}/> <$macrocall $name="makedatauri" type={{{ [<title>get[type]] }}} text={{{ [<title>get[text]] }}} _canonical_uri={{{ [<title>get[_canonical_uri]] }}}/>
\end \end
\define if-sidebar(text) \procedure if-sidebar(text)
<$reveal state="$:/state/sidebar" type="match" text="yes" default="yes">$text$</$reveal> <$reveal state="$:/state/sidebar" type="match" text="yes" default="yes"><<text>></$reveal>
\end \end
\define if-no-sidebar(text) \procedure if-no-sidebar(text)
<$reveal state="$:/state/sidebar" type="nomatch" text="yes" default="yes">$text$</$reveal> <$reveal state="$:/state/sidebar" type="nomatch" text="yes" default="yes"><<text>></$reveal>
\end \end
\define if-background-attachment(text) \procedure if-background-attachment(text)
<$reveal state="$:/themes/tiddlywiki/vanilla/settings/backgroundimage" type="nomatch" text="">$text$</$reveal> <$reveal state="$:/themes/tiddlywiki/vanilla/settings/backgroundimage" type="nomatch" text=""><<text>></$reveal>
\end \end

View File

@@ -1,20 +1,26 @@
title: $:/core/macros/copy-to-clipboard title: $:/core/macros/copy-to-clipboard
tags: $:/tags/Macro tags: $:/tags/Global
\define copy-to-clipboard(src,class:"tc-btn-invisible",style)
\whitespace trim \whitespace trim
<$button class=<<__class__>> style=<<__style__>> message="tm-copy-to-clipboard" param=<<__src__>> tooltip={{$:/language/Buttons/CopyToClipboard/Hint}}>
\procedure copy-to-clipboard(src,class:"tc-btn-invisible",style)
<$button message="tm-copy-to-clipboard"
param=<<src>>
class=<<class>>
style=<<style>>
tooltip={{$:/language/Buttons/CopyToClipboard/Hint}}
>
{{$:/core/images/copy-clipboard}} {{$:/core/images/copy-clipboard}}
&#32; <span class="tc-tiny-gap-left">
<$text text={{$:/language/Buttons/CopyToClipboard/Caption}}/> <$text text={{$:/language/Buttons/CopyToClipboard/Caption}}/>
</span>
</$button> </$button>
\end \end
\define copy-to-clipboard-above-right(src,class:"tc-btn-invisible",style) \procedure copy-to-clipboard-above-right(src,class:"tc-btn-invisible",style)
\whitespace trim
<div style="position: relative;"> <div style="position: relative;">
<div style="position: absolute; bottom: 0; right: 0;"> <div style="position: absolute; bottom: 0; right: 0;">
<$macrocall $name="copy-to-clipboard" src=<<__src__>> class=<<__class__>> style=<<__style__>>/> <$macrocall $name="copy-to-clipboard" src=<<src>> class=<<class>> style=<<style>>/>
</div> </div>
</div> </div>
\end \end

View File

@@ -1,29 +1,29 @@
title: $:/core/macros/diff title: $:/core/macros/diff
tags: $:/tags/Macro tags: $:/tags/Global
\define compareTiddlerText(sourceTiddlerTitle,sourceSubTiddlerTitle,destTiddlerTitle,destSubTiddlerTitle)
\whitespace trim \whitespace trim
<$set name="source" tiddler=<<__sourceTiddlerTitle__>> subtiddler=<<__sourceSubTiddlerTitle__>>>
<$set name="dest" tiddler=<<__destTiddlerTitle__>> subtiddler=<<__destSubTiddlerTitle__>>> \procedure compareTiddlerText(sourceTiddlerTitle,sourceSubTiddlerTitle,destTiddlerTitle,destSubTiddlerTitle)
<$set name="source" tiddler=<<sourceTiddlerTitle>> subtiddler=<<sourceSubTiddlerTitle>>>
<$set name="dest" tiddler=<<destTiddlerTitle>> subtiddler=<<destSubTiddlerTitle>>>
<$diff-text source=<<source>> dest=<<dest>>/> <$diff-text source=<<source>> dest=<<dest>>/>
</$set> </$set>
</$set> </$set>
\end \end
\define compareTiddlers(sourceTiddlerTitle,sourceSubTiddlerTitle,destTiddlerTitle,destSubTiddlerTitle,exclude) \procedure compareTiddlers(sourceTiddlerTitle,sourceSubTiddlerTitle,destTiddlerTitle,destSubTiddlerTitle,exclude)
\whitespace trim
<table class="tc-diff-tiddlers"> <table class="tc-diff-tiddlers">
<tbody> <tbody>
<$set name="sourceFields" filter="[<__sourceTiddlerTitle__>fields[]sort[]]"> <$set name="sourceFields" filter="[<sourceTiddlerTitle>fields[]sort[]]">
<$set name="destFields" filter="[<__destSubTiddlerTitle__>subtiddlerfields<__destTiddlerTitle__>sort[]]"> <$set name="destFields" filter="[<destSubTiddlerTitle>subtiddlerfields<destTiddlerTitle>sort[]]">
<$list filter="[enlist<sourceFields>] [enlist<destFields>] -[enlist<__exclude__>] +[sort[]]" variable="fieldName"> <$list filter="[enlist<sourceFields>] [enlist<destFields>] -[enlist<exclude>] +[sort[]]" variable="fieldName">
<tr> <tr>
<th> <th>
<$text text=<<fieldName>>/> <$text text=<<fieldName>>/>
</th> </th>
<td> <td>
<$set name="source" tiddler=<<__sourceTiddlerTitle__>> subtiddler=<<__sourceSubTiddlerTitle__>> field=<<fieldName>>> <$set name="source" tiddler=<<sourceTiddlerTitle>> subtiddler=<<sourceSubTiddlerTitle>> field=<<fieldName>>>
<$set name="dest" tiddler=<<__destTiddlerTitle__>> subtiddler=<<__destSubTiddlerTitle__>> field=<<fieldName>>> <$set name="dest" tiddler=<<destTiddlerTitle>> subtiddler=<<destSubTiddlerTitle>> field=<<fieldName>>>
<$diff-text source=<<source>> dest=<<dest>>>&#32;</$diff-text> <$diff-text source=<<source>> dest=<<dest>>>&#32;</$diff-text>
</$set> </$set>
</$set> </$set>

View File

@@ -1577,10 +1577,6 @@ html body.tc-body.tc-single-tiddler-window {
padding-left: 4px; padding-left: 4px;
} }
.tc-tiddler-preview {
overflow: auto;
}
.tc-tiddler-editor { .tc-tiddler-editor {
display: grid; display: grid;
} }