diff --git a/core/ui/EditTemplate/body/default.tid b/core/ui/EditTemplate/body/default.tid index 953d1488a..9986c4142 100644 --- a/core/ui/EditTemplate/body/default.tid +++ b/core/ui/EditTemplate/body/default.tid @@ -1,10 +1,20 @@ 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-edit-texteditor.class() tc-edit-texteditor tc-edit-texteditor-body [match[yes]thenaddprefix[tc-edit-texteditor-identified-]] +[join[ ]] + +\function get.preview.width() [get[text]] + +\function get.style.grid-template-columns() +[!match[yes]then[1fr]] +:else[!is[missing]then[calc(100% - ]addsuffixaddsuffix[) ]addsuffix] +:else[[repeat(2, minmax(0px, 1fr))]] +\end + +\function get.slider.condition() [match[yes]] :else[[no]] \define config-visibility-title() $:/config/EditorToolbarButtons/Visibility/$(currentTiddler)$ @@ -14,20 +24,28 @@ $:/config/EditorToolbarButtons/Visibility/$(currentTiddler)$ <$action-popup $state=<> $coords="(0,0,0,0)" $floating="yes"/> \end -\procedure tp-tiddler-preview() -<$list filter="[get[text]match[yes]]" variable="ignore"> +\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={{$:/state/editpreviewtype}} mode="inline"> + <$list filter="[get[text]match[yes]]" variable="ignore"> -<$transclude tiddler="$:/core/ui/EditTemplate/body/preview/output" mode="inline"/> +
- + <$transclude tiddler={{$:/state/editpreviewtype}} mode="inline"> + + <$transclude tiddler="$:/core/ui/EditTemplate/body/preview/output" mode="inline"/> + + + +
+ +
- - \end \whitespace trim @@ -35,27 +53,22 @@ $:/config/EditorToolbarButtons/Visibility/$(currentTiddler)$ qualified-preview-state=<> editPreviewStateTiddler={{{ [{$:/config/ShowEditPreview/PerTiddler}!match[yes]then[$:/state/showeditpreview]] :else[] }}} importTitle=<> - importState=<> > + 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=<> >
-
match[yes]then[tc-tiddler-preview]else[tc-tiddler-preview-hidden]] [[tc-tiddler-editor]] +[join[ ]] }}}> - -<$let identifier={{{ [addsuffix[-]addsuffixsha256[]] }}} sidebarWidthTiddler={{{ [addprefix[$:/state/resizer/texteditorwidth-]] }}}> - -<$transclude tiddler="$:/core/ui/EditTemplate/body/editor" mode="inline"/> <$transclude - $variable="one-cell-slider" - template="tp-tiddler-preview" + $variable="editor-preview-slider" + class="tc-edit-texteditor-slider" + template="tp-tiddler-editor-preview" + sliderCondition=<> mode="inline" padding="0px" sliderWidth="6px" /> - - -
-
diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index f8433c588..f115874a2 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -410,3 +410,76 @@ title: $:/core/procedures/sidebar-resizer \end + +\procedure editor-resizer(template:"",mode:"block",sliderCondition:"yes",eventCatcherClass:"") +<$set name="resizerWidthDivided" value={{{ [divide[2]] }}}> + + <$eventcatcher + tag="div" + class=<> + selector=".tc-sidebar-resizer" + matchSelector=".tc-sidebar-resizer" + $pointerdown=<> + $pointerup=<>> + + <%if [!match[no]] %> + + <$eventcatcher + tag="div" + class=<> + selector=".tc-sidebar-resizer" + matchSelector=".tc-sidebar-resizer" + $pointerup={{{ [!is[missing]then] }}}> + + <$eventcatcher + tag="div" + selector=".tc-sidebar-resizer-pointermove" + matchSelector=".tc-sidebar-resizer-pointermove" + class=<> + $pointerup=<> + $pointerleave=<> + $pointerout=<> + $pointercancel=<> + $pointerdown=<> + $touchstart=<> + $pointermove=<> + $contextmenu=<>> + +
>/> + + + + <%if [match[yes]] %> + +
> + style.position=<> + style.left=<> + style.width=<> + /> + + <% endif %> + + <%if [