diff --git a/core/images/link.tid b/core/images/link.tid new file mode 100644 index 000000000..1e094a9b0 --- /dev/null +++ b/core/images/link.tid @@ -0,0 +1,9 @@ +title: $:/core/images/link +tags: $:/tags/Image + + + + + + + \ No newline at end of file diff --git a/core/language/en-GB/Buttons.multids b/core/language/en-GB/Buttons.multids index fe6c47695..d40011277 100644 --- a/core/language/en-GB/Buttons.multids +++ b/core/language/en-GB/Buttons.multids @@ -127,6 +127,8 @@ Italic/Caption: italic Italic/Hint: Apply italic formatting to selection LineWidth/Caption: line width LineWidth/Hint: Set line width for painting +Link/Caption: link +Link/Hint: Create wikitext link ListBullet/Caption: bulleted list ListBullet/Hint: Apply bulleted list formatting to lines containing selection ListNumber/Caption: numbered list diff --git a/core/modules/editor/operations/text/make-link.js b/core/modules/editor/operations/text/make-link.js new file mode 100644 index 000000000..e8caf21c5 --- /dev/null +++ b/core/modules/editor/operations/text/make-link.js @@ -0,0 +1,29 @@ +/*\ +title: $:/core/modules/editor/operations/text/make-link.js +type: application/javascript +module-type: texteditoroperation + +Text editor operation to make a link + +\*/ +(function(){ + +/*jslint node: true, browser: true */ +/*global $tw: false */ +"use strict"; + +exports["make-link"] = function(event,operation) { + if(operation.selection) { + operation.replacement = "[[" + operation.selection + "|" + event.paramObject.text + "]]"; + operation.cutStart = operation.selStart; + operation.cutEnd = operation.selEnd; + } else { + operation.replacement = "[[" + event.paramObject.text + "]]"; + operation.cutStart = operation.selStart; + operation.cutEnd = operation.selEnd; + } + operation.newSelStart = operation.selStart + operation.replacement.length; + operation.newSelEnd = operation.newSelStart; +}; + +})(); diff --git a/core/ui/EditTemplate/body-toolbar-button.tid b/core/ui/EditTemplate/body-toolbar-button.tid index 33d0d802d..465c2420e 100644 --- a/core/ui/EditTemplate/body-toolbar-button.tid +++ b/core/ui/EditTemplate/body-toolbar-button.tid @@ -28,7 +28,7 @@ title: $:/core/ui/EditTemplate/body/toolbar/button <$transclude tiddler=<> field="text"/> <$reveal state=<> type="popup" position="below" animate="yes" tag="span"> -
+
<$transclude tiddler={{!!dropdown}} mode="block"/>
diff --git a/core/ui/EditorToolbar/link-dropdown.tid b/core/ui/EditorToolbar/link-dropdown.tid new file mode 100644 index 000000000..16099a88b --- /dev/null +++ b/core/ui/EditorToolbar/link-dropdown.tid @@ -0,0 +1,40 @@ +title: $:/core/ui/EditorToolbar/link-dropdown + +\define lingo-base() $:/language/Buttons/Link/ + +\define link-actions() +<$action-sendmessage + $message="tm-edit-text-operation" + $param="make-link" + text={{$:/temp/mytemp}} +/> + +<$action-deletetiddler + $tiddler=<> +/> +\end + +''<>'' + +<$set name="searchTiddler" value="$:/temp/search"> + + +<$edit-text tiddler=<> type="search" tag="input" focus="true" placeholder={{$:/language/Search/Search}}/> +<$reveal tag="span" state=<> type="nomatch" text=""> +<$button class="tc-btn-invisible" style="width: auto; display: inline-block; background-colour: inherit;"> +<$action-setfield $tiddler=<> text="" /> +{{$:/core/images/close-button}} + + + +<$reveal tag="div" state=<> type="nomatch" text=""> + +<$linkcatcher actions=<> to="$:/temp/mytemp"> + +{{$:/core/ui/SearchResults}} + + + + + + diff --git a/core/ui/EditorToolbar/link.tid b/core/ui/EditorToolbar/link.tid new file mode 100644 index 000000000..e0527cfab --- /dev/null +++ b/core/ui/EditorToolbar/link.tid @@ -0,0 +1,10 @@ +title: $:/core/ui/EditorToolbar/link +tags: $:/tags/EditorToolbar +icon: $:/core/images/link +caption: {{$:/language/Buttons/Link/Caption}} +description: {{$:/language/Buttons/Link/Hint}} +condition: [!has[type]] [type[text/vnd.tiddlywiki]] +button-classes: tc-text-editor-toolbar-item-start-group +shortcuts: ((link)) +dropdown: $:/core/ui/EditorToolbar/link-dropdown + diff --git a/core/wiki/config/ShortcutInfo.multids b/core/wiki/config/ShortcutInfo.multids index d32ff82b6..8cd3c488f 100644 --- a/core/wiki/config/ShortcutInfo.multids +++ b/core/wiki/config/ShortcutInfo.multids @@ -10,6 +10,7 @@ heading-4: {{$:/language/Buttons/Heading4/Hint}} heading-5: {{$:/language/Buttons/Heading5/Hint}} heading-6: {{$:/language/Buttons/Heading6/Hint}} italic: {{$:/language/Buttons/Italic/Hint}} +link: {{$:/language/Buttons/Link/Hint}} list-bullet: {{$:/language/Buttons/ListBullet/Hint}} list-number: {{$:/language/Buttons/ListNumber/Hint}} mono-block: {{$:/language/Buttons/MonoBlock/Hint}} diff --git a/core/wiki/config/shortcuts/shortcuts.multids b/core/wiki/config/shortcuts/shortcuts.multids index ad3e56a40..84503a77b 100644 --- a/core/wiki/config/shortcuts/shortcuts.multids +++ b/core/wiki/config/shortcuts/shortcuts.multids @@ -8,8 +8,9 @@ heading-3: ctrl-3 heading-4: ctrl-4 heading-5: ctrl-5 heading-6: ctrl-6 -list-bullet: ctrl-L -list-number: ctrl-N +link: ctrl-L +list-bullet: ctrl-shift-L +list-number: ctrl-shift-N mono-block: ctrl-shift-M mono-line: ctrl-M picture: ctrl-shift-I diff --git a/core/wiki/tags/EditorToolbar.tid b/core/wiki/tags/EditorToolbar.tid index 8c70b7cb1..695791870 100644 --- a/core/wiki/tags/EditorToolbar.tid +++ b/core/wiki/tags/EditorToolbar.tid @@ -1,2 +1,2 @@ title: $:/tags/EditorToolbar -list: $:/core/ui/EditorToolbar/paint $:/core/ui/EditorToolbar/opacity $:/core/ui/EditorToolbar/line-width $:/core/ui/EditorToolbar/clear $:/core/ui/EditorToolbar/bold $:/core/ui/EditorToolbar/italic $:/core/ui/EditorToolbar/strikethrough $:/core/ui/EditorToolbar/underline $:/core/ui/EditorToolbar/superscript $:/core/ui/EditorToolbar/subscript $:/core/ui/EditorToolbar/mono-line $:/core/ui/EditorToolbar/mono-block $:/core/ui/EditorToolbar/quote $:/core/ui/EditorToolbar/list-bullet $:/core/ui/EditorToolbar/list-number $:/core/ui/EditorToolbar/heading-1 $:/core/ui/EditorToolbar/heading-2 $:/core/ui/EditorToolbar/heading-3 $:/core/ui/EditorToolbar/heading-4 $:/core/ui/EditorToolbar/heading-5 $:/core/ui/EditorToolbar/heading-6 $:/core/ui/EditorToolbar/excise $:/core/ui/EditorToolbar/picture $:/core/ui/EditorToolbar/stamp $:/core/ui/EditorToolbar/undo $:/core/ui/EditorToolbar/redo $:/core/ui/EditorToolbar/size $:/core/ui/EditorToolbar/editor-height $:/core/ui/EditorToolbar/more $:/core/ui/EditorToolbar/preview $:/core/ui/EditorToolbar/preview-type +list: $:/core/ui/EditorToolbar/paint $:/core/ui/EditorToolbar/opacity $:/core/ui/EditorToolbar/line-width $:/core/ui/EditorToolbar/clear $:/core/ui/EditorToolbar/bold $:/core/ui/EditorToolbar/italic $:/core/ui/EditorToolbar/strikethrough $:/core/ui/EditorToolbar/underline $:/core/ui/EditorToolbar/superscript $:/core/ui/EditorToolbar/subscript $:/core/ui/EditorToolbar/mono-line $:/core/ui/EditorToolbar/mono-block $:/core/ui/EditorToolbar/quote $:/core/ui/EditorToolbar/list-bullet $:/core/ui/EditorToolbar/list-number $:/core/ui/EditorToolbar/heading-1 $:/core/ui/EditorToolbar/heading-2 $:/core/ui/EditorToolbar/heading-3 $:/core/ui/EditorToolbar/heading-4 $:/core/ui/EditorToolbar/heading-5 $:/core/ui/EditorToolbar/heading-6 $:/core/ui/EditorToolbar/link $:/core/ui/EditorToolbar/excise $:/core/ui/EditorToolbar/picture $:/core/ui/EditorToolbar/stamp $:/core/ui/EditorToolbar/undo $:/core/ui/EditorToolbar/redo $:/core/ui/EditorToolbar/size $:/core/ui/EditorToolbar/editor-height $:/core/ui/EditorToolbar/more $:/core/ui/EditorToolbar/preview $:/core/ui/EditorToolbar/preview-type diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index 5a0436049..96dd04eb5 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -982,7 +982,7 @@ html body.tc-body.tc-single-tiddler-window { } .tc-editor-toolbar button.tc-text-editor-toolbar-item-adjunct { - margin-left: -4px; + margin-left: -3px; width: 1em; border-radius: 8px; } @@ -1015,6 +1015,10 @@ html body.tc-body.tc-single-tiddler-window { width: auto; } +.tc-editor-toolbar .tc-search-results { + padding: 0; +} + /* ** Adjustments for fluid-fixed mode */ @@ -1299,6 +1303,14 @@ html body.tc-body.tc-single-tiddler-window { line-height: 1.4; } +.tc-drop-down .tc-tab-set .tc-tab-buttons button { + display: inline-block; + width: auto; + margin-bottom: 0px; + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; +} + .tc-drop-down .tc-prompt { padding: 0 14px; }