diff --git a/core/language/en-GB/Misc.multids b/core/language/en-GB/Misc.multids index d8c0913750d..eb295000c11 100644 --- a/core/language/en-GB/Misc.multids +++ b/core/language/en-GB/Misc.multids @@ -47,6 +47,7 @@ InternalJavaScriptError/Title: Internal JavaScript Error InternalJavaScriptError/Hint: Well, this is embarrassing. It is recommended that you restart TiddlyWiki by refreshing your browser LayoutSwitcher/Description: Open the layout switcher LazyLoadingWarning:

Trying to load external content from ''<$text text={{!!_canonical_uri}}/>''

If this message doesn't disappear, either the tiddler content type doesn't match the type of the external content, or you may be using a browser that doesn't support external content for wikis loaded as standalone files. See https://tiddlywiki.com/#ExternalText

+Left: Left LoginToTiddlySpace: Login to TiddlySpace Manager/Controls/FilterByTag/None: (none) Manager/Controls/FilterByTag/Prompt: Filter by tag: @@ -73,6 +74,7 @@ PageTemplate/Description: the default ~TiddlyWiki layout PageTemplate/Name: Standard Layout PluginReloadWarning: Please save {{$:/core/ui/Buttons/save-wiki}} and reload {{$:/core/ui/Buttons/refresh}} to allow changes to ~JavaScript plugins to take effect RecentChanges/DateFormat: DDth MMM YYYY +Right: Right Shortcuts/Input/AdvancedSearch/Hint: Open the ~AdvancedSearch panel from within the sidebar search field Shortcuts/Input/Accept/Hint: Accept the selected item Shortcuts/Input/AcceptVariant/Hint: Accept the selected item (variant) diff --git a/core/language/en-GB/ThemeTweaks.multids b/core/language/en-GB/ThemeTweaks.multids index 5168053c30b..f1e7483074c 100644 --- a/core/language/en-GB/ThemeTweaks.multids +++ b/core/language/en-GB/ThemeTweaks.multids @@ -1,11 +1,13 @@ title: $:/language/ThemeTweaks/ ThemeTweaks: Theme Tweaks -ThemeTweaks/Hint: You can tweak certain aspects of the ''Vanilla'' theme. +ThemeTweaks/Hint: You can tweak certain aspects of the ''<$text text={{{ [get[name]] :else[[current]] }}}/>'' theme. Options: Options Options/SidebarLayout: Sidebar layout Options/SidebarLayout/Fixed-Fluid: Fixed story, fluid sidebar Options/SidebarLayout/Fluid-Fixed: Fluid story, fixed sidebar +Options/SidebarPosition: Sidebar position +Options/SidebarResizer: Sidebar resizer Options/StickyTitles: Sticky titles Options/StickyTitles/Hint: Causes tiddler titles to "stick" to the top of the browser window Options/CodeWrapping: Wrap long lines in code blocks @@ -26,17 +28,30 @@ Metrics/FontSize: Font size Metrics/LineHeight: Line height Metrics/BodyFontSize: Font size for tiddler body Metrics/BodyLineHeight: Line height for tiddler body +Metrics/PreviewSliderWidth: Preview slider width +Metrics/PreviewSliderWidth/Hint: the width of the slider between editor and editor preview +Metrics/SidebarPadding: Sidebar padding +Metrics/SidebarPadding/Hint: the padding of the sidebar between sidebar and story river - determines the position of the sidebar resizer +Metrics/SidebarResizer/Hint: the values for `storyleft`, `storyright`, `storywidth`, `storyminwidth`, `sidebarwidth` and `sidebarminwidth` need to be ''absolute'' CSS units, ''percentages'' or ''em'' units in order for the sidebar resizer to work Metrics/StoryLeft: Story left position Metrics/StoryLeft/Hint: how far the left margin of the story river
(tiddler area) is from the left of the page +Metrics/StoryMinWidth: Minimum Story width +Metrics/StoryMinWidth/Hint: the minimun width of the story river +Metrics/StoryPaddingLeft: Story Padding Left +Metrics/StoryPaddingLeft/Hint: the left padding of the story river +Metrics/StoryPaddingRight: Story Padding Right +Metrics/StoryPaddingRight/Hint: the right padding of the story river, also controls the width and positioning of the resizer Metrics/StoryTop: Story top position Metrics/StoryTop/Hint: how far the top margin of the story river
is from the top of the page Metrics/StoryRight: Story right Metrics/StoryRight/Hint: how far the left margin of the sidebar
is from the left of the page Metrics/StoryWidth: Story width Metrics/StoryWidth/Hint: the overall width of the story river -Metrics/TiddlerWidth: Tiddler width -Metrics/TiddlerWidth/Hint: within the story river Metrics/SidebarBreakpoint: Sidebar breakpoint Metrics/SidebarBreakpoint/Hint: the minimum page width at which the story
river and sidebar will appear side by side +Metrics/SidebarMinWidth: Minimum Sidebar width +Metrics/SidebarMinWidth/Hint: the minimum width of the sidebar Metrics/SidebarWidth: Sidebar width Metrics/SidebarWidth/Hint: the width of the sidebar in fluid-fixed layout +Metrics/TiddlerWidth: Tiddler width +Metrics/TiddlerWidth/Hint: within the story river diff --git a/core/ui/EditTemplate/body-editor.tid b/core/ui/EditTemplate/body-editor.tid index 374567acddc..ae3e7ffc70a 100644 --- a/core/ui/EditTemplate/body-editor.tid +++ b/core/ui/EditTemplate/body-editor.tid @@ -5,7 +5,7 @@ title: $:/core/ui/EditTemplate/body/editor <$edit field="text" - class="tc-edit-texteditor tc-edit-texteditor-body" + class=<> placeholder={{$:/language/EditTemplate/Body/Placeholder}} tabindex={{$:/config/EditTabIndex}} focus={{{ [{$:/config/AutoFocus}match[text]then[true]] ~[[false]] }}} diff --git a/core/ui/EditTemplate/body/default.tid b/core/ui/EditTemplate/body/default.tid index d004032f149..04c2f9d527b 100644 --- a/core/ui/EditTemplate/body/default.tid +++ b/core/ui/EditTemplate/body/default.tid @@ -1,9 +1,23 @@ title: $:/core/ui/EditTemplate/body/default -\function edit-preview-state() +\function get.edit-preview-state() [{$:/config/ShowEditPreview/PerTiddler}!match[yes]then[$:/state/showeditpreview]] :else[] +[get[text]] :else[[no]] \end +\function get.tc-edit-texteditor.class() tc-edit-texteditor tc-edit-texteditor-body [match[yes]thenaddprefix[tc-edit-texteditor-identified-]] +[join[ ]] + +\function get.tc-tiddler-preview-preview.class() tc-tiddler-preview-preview [addprefix[tc-tiddler-preview-preview-identified-]] +[join[ ]] + +\function get.preview.width() [get[text]] + +\function get.style.grid-template-columns() +[!match[yes]then[1fr]] +:else[is[tiddler]then[calc(100% - ]addsuffixaddsuffix[) ]addsuffix[calc(]addsuffixaddsuffix[)]] +:else[[repeat(2, minmax(0px, 1fr))]] +\end + +\function get.slider.condition() [match[yes]] :else[[no]] + \define config-visibility-title() $:/config/EditorToolbarButtons/Visibility/$(currentTiddler)$ \end @@ -12,33 +26,50 @@ $:/config/EditorToolbarButtons/Visibility/$(currentTiddler)$ <$action-popup $state=<> $coords="(0,0,0,0)" $floating="yes"/> \end -\whitespace trim -<$let - qualified-preview-state=<> - editPreviewStateTiddler={{{ [{$:/config/ShowEditPreview/PerTiddler}!match[yes]then[$:/state/showeditpreview]] :else[] }}} - importTitle=<> - importState=<> > -<$dropzone 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=<> > -
-
match[yes]then[tc-tiddler-preview]else[tc-tiddler-preview-hidden]] [[tc-tiddler-editor]] +[join[ ]] }}}> +\procedure tp-tiddler-editor-preview() +
match[yes]then[tc-tiddler-preview]else[tc-tiddler-preview-hidden]] [[tc-tiddler-editor]] +[join[ ]] }}} + style.grid-template-columns=<>> -<$transclude tiddler="$:/core/ui/EditTemplate/body/editor" mode="inline"/> + <$transclude tiddler="$:/core/ui/EditTemplate/body/editor" mode="inline"/> -<$list filter="[get[text]match[yes]]" variable="ignore"> + <$list filter="[get[text]match[yes]]" variable="ignore"> -
+
> data-tiddler-title={{!!draft.title}} data-tags={{!!tags}}> -<$transclude tiddler={{$:/state/editpreviewtype}} mode="inline"> + <$transclude tiddler={{$:/state/editpreviewtype}} mode="inline"> -<$transclude tiddler="$:/core/ui/EditTemplate/body/preview/output" mode="inline"/> + <$transclude tiddler="$:/core/ui/EditTemplate/body/preview/output" mode="inline"/> - + -
+
- +
+\end + +\whitespace trim +<$let + qualified-preview-state=<> + editPreviewStateTiddler={{{ [{$:/config/ShowEditPreview/PerTiddler}!match[yes]then[$:/state/showeditpreview]] :else[] }}} + importTitle=<> + importState=<> + identifier={{{ [addsuffix[-]addsuffixsha256[]] }}} + sidebarWidthTiddler={{{ [addprefix[$:/state/resizer/previewwidth-]] }}} > +<$dropzone 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=<> > +
+ +<$transclude + $variable="editor-preview-slider" + class="tc-edit-texteditor-slider" + template="tp-tiddler-editor-preview" + sliderCondition=<> + mode="inline" + padding="0px" + sliderWidth=<> +/>
diff --git a/core/ui/PageTemplate/sidebar-resizer.tid b/core/ui/PageTemplate/sidebar-resizer.tid new file mode 100644 index 00000000000..ceca2da6b0b --- /dev/null +++ b/core/ui/PageTemplate/sidebar-resizer.tid @@ -0,0 +1,35 @@ +title: $:/core/ui/PageTemplate/sidebar-resizer +tags: $:/tags/PageTemplate +list-after: $:/core/ui/PageTemplate/story +code-body: yes + +\import [function[get.base.functions.theme],first[]is[tiddler]] :else[function[get.base.functions.theme],first[]is[shadow]] :else[[$:/themes/tiddlywiki/vanilla/functions]] [[$:/core/procedures/sidebar-resizer]] +\function resizer.state.tiddler() $:/state/sidebar/resizing +\function resizer.state() [{$:/state/sidebar}] +\function resizer.class() tc-main-sidebar-resizer +\function set.throttling() yes +\whitespace trim + +<%if [match[show]] %> + + <$let + tv-set-storywidth-storyright=<> + tv-set-sidebarwidth=<> + tv-set-centralised=<> + + storyLeftTiddler=<> + storyRightTiddler=<> + sidebarWidthTiddler=<> + tiddlerWidthTiddler=<> + storyWidthTiddler=<> + storyMinWidthTiddler=<> + sidebarMinWidthTiddler=<> + storyPaddingLeftTiddler=<> + storyPaddingRightTiddler=<> + > + + <$transclude $variable="sidebar-resizer"/> + + + +<% endif %> diff --git a/core/ui/PageTemplateClassFilters.tid b/core/ui/PageTemplateClassFilters.tid new file mode 100644 index 00000000000..e1babac4b3f --- /dev/null +++ b/core/ui/PageTemplateClassFilters.tid @@ -0,0 +1,4 @@ +title: $:/core/ui/PageTemplateClassFilters +tags: $:/tags/ClassFilters/PageTemplate + +[match[left]then[tc-sidebar-left]] \ No newline at end of file diff --git a/core/wiki/functions/themes.tid b/core/wiki/functions/themes.tid new file mode 100644 index 00000000000..f3637b35b8e --- /dev/null +++ b/core/wiki/functions/themes.tid @@ -0,0 +1,109 @@ +title: $:/core/functions/themes +tags: $:/tags/Global +code-body: yes + +\function is.pixel.value(value) [removesuffix[px]] +\function is.percentage.value(value) [removesuffix[%]] +\function is.cm.value(value) [removesuffix[cm]] +\function is.mm.value(value) [removesuffix[mm]] +\function is.Q.value(value) [removesuffix[Q]] +\function is.in.value(value) [removesuffix[in]] +\function is.pc.value(value) [removesuffix[pc]] +\function is.pt.value(value) [removesuffix[pt]] +\function is.em.value(value) [removesuffix[em]] + +\function convert.to.cm(value) [divide[37.8]] +\function convert.to.mm(value) [convert.to.cmmultiply[10]] +\function convert.to.Q(value) [convert.to.cmmultiply[40]] +\function convert.to.in(value) [divide[96]] +\function convert.to.pc(value) [convert.to.inmultiply[6]] +\function convert.to.pt(value) [convert.to.inmultiply[72]] +\function convert.to.em(value) [[storyTiddler]is[variable]thendivide{$:/themes/tiddlywiki/vanilla/metrics/bodyfontsize}] [[storyTiddler]!is[variable]thendivide{$:/themes/tiddlywiki/vanilla/metrics/fontsize}] + +\function convert.to.pixels(value) +[is.pixel.value] +:else[is.cm.valuemultiply[37.8]] +:else[is.mm.valuemultiply[37.8]divide[10]] +:else[is.Q.valuemultiply[37.8]divide[40]] +:else[is.in.valuemultiply[96]] +:else[is.pc.valuemultiply[96]divide[6]] +:else[is.pt.valuemultiply[96]divide[72]] +:else[is.em.valuethen[storyTiddler]is[variable]thenmultiply{$:/themes/tiddlywiki/vanilla/metrics/bodyfontsize}] +:else[is.em.valuethen[storyTiddler]!is[variable]thenmultiply{$:/themes/tiddlywiki/vanilla/metrics/fontsize}] +\end + +\function convert.to.pixels.metric(value,metric) [addsuffix] :map[convert.to.pixels] + +\function subtract.one.from.sidebarbreakpoint(value) +[is.pixel.valuesubtract[1]addsuffix[px]] +:else[is.cm.valueconvert.to.pixels.metric,[cm]subtract[1]divide[37.8]addsuffix[cm]] +:else[is.mm.valueconvert.to.pixels.metric,[mm]subtract[1]divide[37.8]multiply[10]addsuffix[mm]] +:else[is.Q.valueconvert.to.pixels.metric,[Q]subtract[1]divide[37.8]multiply[40]addsuffix[Q]] +:else[is.in.valueconvert.to.pixels.metric,[in]subtract[1]divide[96]addsuffix[in]] +:else[is.pc.valueconvert.to.pixels.metric,[pc]subtract[1]divide[96]multiply[6]addsuffix[pc]] +:else[is.pt.valueconvert.to.pixels.metric,[pt]subtract[1]divide[96]multiply[72]addsuffix[pt]] +:else[is.em.valueconvert.to.pixels.metric,[em]subtract[1]divide{$:/themes/tiddlywiki/vanilla/metrics/fontsize}addsuffix[em]] +\end + +\function sidebarbreakpoint() [{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}] + +\function sidebarbreakpoint-minus-one() [subtract.one.from.sidebarbreakpoint] :else[] + +\function add.one.to.breakpoint(value) +[is.pixel.valueadd[1]addsuffix[px]] +:else[is.cm.valueconvert.to.pixels.metric,[cm]add[1]divide[37.8]addsuffix[cm]] +:else[is.mm.valueconvert.to.pixels.metric,[mm]add[1]divide[37.8]multiply[10]addsuffix[mm]] +:else[is.Q.valueconvert.to.pixels.metric,[Q]add[1]divide[37.8]multiply[40]addsuffix[Q]] +:else[is.in.valueconvert.to.pixels.metric,[in]add[1]divide[96]addsuffix[in]] +:else[is.pc.valueconvert.to.pixels.metric,[pc]add[1]divide[96]multiply[6]addsuffix[pc]] +:else[is.pt.valueconvert.to.pixels.metric,[pt]add[1]divide[96]multiply[72]addsuffix[pt]] +:else[is.em.valueconvert.to.pixels.metric,[em]add[1]divide{$:/themes/tiddlywiki/vanilla/metrics/fontsize}addsuffix[em]] +\end + +\function breakpoint-plus-one() [add.one.to.breakpoint{$:/config/plugins/menubar/breakpoint}] :else[{$:/config/plugins/menubar/breakpoint}] + +\function get.base.theme.metric.recursive(theme,metric) [get[dependents]enlist-input[]] :map[get.base.theme.metric,] + +\function get.base.theme.metric(theme,metric) +[addsuffix[/metrics/]addsuffixis[tiddler]] +:else[addsuffix[/metrics/]addsuffixis[shadow]] +:else[get.base.theme.metric.recursive,] +\end + +\function get.base.theme(theme,metric) [get.base.theme.metric,first[]removesuffixremovesuffix[/metrics/]] + +\function get.theme.metric(metric) [get.base.theme.metric,first[]get[text]] + +\function get.base.theme.option.recursive(theme,option) [get[dependents]enlist-input[]] :map[get.base.theme.option,