-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
61 changed files
with
411 additions
and
82 deletions.
There are no files selected for viewing
4 changes: 0 additions & 4 deletions
4
packages/MarkdownEditor-Core.package/MarkdownEditor.class/instance/applyBold.st
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
packages/MarkdownEditor-Core.package/MarkdownEditor.class/instance/applyItalic.st
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
packages/MarkdownEditor-Core.package/MarkdownEditor.class/instance/applyStrikeout.st
This file was deleted.
Oops, something went wrong.
4 changes: 4 additions & 0 deletions
4
packages/MarkdownEditor-Core.package/MarkdownEditor.class/instance/markdownMenu..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
markdownMenu: aMarkdownEditorMenu | ||
|
||
markdownMenu := aMarkdownEditorMenu |
4 changes: 4 additions & 0 deletions
4
packages/MarkdownEditor-Core.package/MarkdownEditor.class/instance/markdownMenu.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
markdownMenu | ||
|
||
^ markdownMenu |
3 changes: 2 additions & 1 deletion
3
packages/MarkdownEditor-Core.package/MarkdownEditor.class/instance/textMorph..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
accessing | ||
textMorph: aTextMorph | ||
|
||
textMorph := aTextMorph | ||
textMorph := aTextMorph. | ||
self markdownMenu: (MarkdownEditorMenu newFor: aTextMorph) |
2 changes: 1 addition & 1 deletion
2
packages/MarkdownEditor-Core.package/MarkdownEditor.class/instance/yellowButtonMenu..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
yellowButtonMenu | ||
yellowButtonMenu: aMenu | ||
|
||
^ aMenu addList: self yellowButtonMenuItems; yourself | ||
^ self markdownMenu yellowButtonMenu: aMenu |
20 changes: 0 additions & 20 deletions
20
packages/MarkdownEditor-Core.package/MarkdownEditor.class/instance/yellowButtonMenuItems.st
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
4 changes: 4 additions & 0 deletions
4
packages/MarkdownEditor-Core.package/MarkdownEditorMenu.class/class/newFor..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
initialize-release | ||
newFor: aPluggableTextMorph | ||
|
||
^ self new pluggableTextMorph: aPluggableTextMorph |
13 changes: 13 additions & 0 deletions
13
packages/MarkdownEditor-Core.package/MarkdownEditorMenu.class/instance/addExportItemsTo..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
yellowButtonMenu | ||
addExportItemsTo: aMenu | ||
|
||
| items | | ||
items := OrderedCollection withAll: | ||
{ | ||
#-. | ||
{'convert to html' translated. #convertToHTML}. | ||
{'appearance...' translated. #openSettings} | ||
}. | ||
^ aMenu | ||
addList: items; | ||
yourself |
15 changes: 15 additions & 0 deletions
15
packages/MarkdownEditor-Core.package/MarkdownEditorMenu.class/instance/addFileItemsTo..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
yellowButtonMenu | ||
addFileItemsTo: aMenu | ||
|
||
| items | | ||
items := OrderedCollection withAll: | ||
{ | ||
{'new' translated. #createNewInstance}. | ||
{'open...' translated. #openFileDialog}. | ||
{'save' translated. #saveText}. | ||
{'save as...' translated. #saveAsFileDialog}. | ||
#-. | ||
}. | ||
^ aMenu | ||
addList: items; | ||
yourself |
16 changes: 16 additions & 0 deletions
16
...s/MarkdownEditor-Core.package/MarkdownEditorMenu.class/instance/addFindReplaceItemsTo..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
yellowButtonMenu | ||
addFindReplaceItemsTo: aMenu | ||
|
||
| inline| | ||
inline := OrderedCollection withAll: | ||
{ | ||
#-. | ||
{'find...(f)' translated. #find}. | ||
{'find again (g)' translated. #findAgain}. | ||
{'find and replace ...' translated. #findReplace}. | ||
{'do/replace again (j)' translated. #again} | ||
}. | ||
^ aMenu | ||
addList: inline; | ||
add: 'find and replace all' action: [self findAndReplaceAll]; | ||
yourself |
5 changes: 5 additions & 0 deletions
5
...s/MarkdownEditor-Core.package/MarkdownEditorMenu.class/instance/addHeadingMenuItemsTo..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
yellowButtonMenu | ||
addHeadingMenuItemsTo: aMenu | ||
|
||
1 to: 6 do: [:i | aMenu add: 'level ', i action: [self applyHeadingAt: i]]. | ||
^ aMenu |
11 changes: 11 additions & 0 deletions
11
packages/MarkdownEditor-Core.package/MarkdownEditorMenu.class/instance/addInlineItemsTo..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
yellowButtonMenu | ||
addInlineItemsTo: aMenu | ||
|
||
^ aMenu | ||
add: 'italic' action: [self applyInlineOnSelectionWith: '*']; | ||
add: 'bold' action: [self applyInlineOnSelectionWith: '**']; | ||
add: 'strikeout' action: [self applyInlineOnSelectionWith: '~~']; | ||
add: 'heading' subMenu: (self addHeadingMenuItemsTo: MenuMorph new); | ||
add: 'link' subMenu: (self addLinkMenuItemsTo: MenuMorph new); | ||
add: 'blockquote' action: [self applyBlockquote]; | ||
yourself |
11 changes: 11 additions & 0 deletions
11
...ages/MarkdownEditor-Core.package/MarkdownEditorMenu.class/instance/addLinkMenuItemsTo..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
yellowButtonMenu | ||
addLinkMenuItemsTo: aMenu | ||
|
||
^ aMenu | ||
add: '[...]()' action: [self applyLinkText]; | ||
add: '[](...)' action: [self applyLinkDestination]; | ||
add: '<...>' action: [self applyAutoLink]; | ||
addLine; | ||
add: '![...]()' action: [self applyImageText]; | ||
add: '![](...)' action: [self applyImageDestination]; | ||
yourself |
7 changes: 7 additions & 0 deletions
7
...MarkdownEditor-Core.package/MarkdownEditorMenu.class/instance/addMenuItemsSelectionTo..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
yellowButtonMenu | ||
addMenuItemsSelectionTo: aMenu | ||
|
||
^ self | ||
addInlineItemsTo: aMenu; | ||
addFindReplaceItemsTo: aMenu; | ||
yourself |
8 changes: 8 additions & 0 deletions
8
packages/MarkdownEditor-Core.package/MarkdownEditorMenu.class/instance/addMenuItemsTo..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
yellowButtonMenu | ||
addMenuItemsTo: aMenu | ||
|
||
^ self | ||
addFileItemsTo: aMenu; | ||
addFindReplaceItemsTo: aMenu; | ||
addExportItemsTo: aMenu; | ||
yourself |
6 changes: 6 additions & 0 deletions
6
packages/MarkdownEditor-Core.package/MarkdownEditorMenu.class/instance/applyAutoLink.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
text interaction | ||
applyAutoLink | ||
|
||
| selection | | ||
selection := self pluggableTextMorph textMorph selection. | ||
self pluggableTextMorph replaceSelectionWith: '<', selection, '>' |
6 changes: 6 additions & 0 deletions
6
packages/MarkdownEditor-Core.package/MarkdownEditorMenu.class/instance/applyBlockquote.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
text interaction | ||
applyBlockquote | ||
|
||
| selection | | ||
selection := self pluggableTextMorph textMorph selection. | ||
self pluggableTextMorph replaceSelectionWith: '>', selection |
12 changes: 12 additions & 0 deletions
12
packages/MarkdownEditor-Core.package/MarkdownEditorMenu.class/instance/applyHeadingAt..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
text interaction | ||
applyHeadingAt: aLevel | ||
|
||
| selection matcher prefix content | | ||
selection := self pluggableTextMorph textMorph selection. | ||
matcher := RxMatcher forString: '(#*)(\s*)(\S.*\S|\S)(\s*)'. | ||
(matcher matches: selection) ifFalse: [^ nil]. | ||
|
||
content := matcher subexpression: 4. | ||
prefix := ''. | ||
aLevel timesRepeat: [prefix := prefix, '#']. | ||
self pluggableTextMorph replaceSelectionWith: prefix, Character space, content, Character cr |
6 changes: 6 additions & 0 deletions
6
...es/MarkdownEditor-Core.package/MarkdownEditorMenu.class/instance/applyImageDestination.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
text interaction | ||
applyImageDestination | ||
|
||
| selection | | ||
selection := self pluggableTextMorph textMorph selection. | ||
self pluggableTextMorph replaceSelectionWith: '![](', selection, ')' |
6 changes: 6 additions & 0 deletions
6
packages/MarkdownEditor-Core.package/MarkdownEditorMenu.class/instance/applyImageText.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
text interaction | ||
applyImageText | ||
|
||
| selection | | ||
selection := self pluggableTextMorph textMorph selection. | ||
self pluggableTextMorph replaceSelectionWith: '![', selection, ']()' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
...ges/MarkdownEditor-Core.package/MarkdownEditorMenu.class/instance/applyLinkDestination.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
text interaction | ||
applyLinkDestination | ||
|
||
| selection | | ||
selection := self pluggableTextMorph textMorph selection. | ||
self pluggableTextMorph replaceSelectionWith: '[](', selection, ')' |
6 changes: 6 additions & 0 deletions
6
packages/MarkdownEditor-Core.package/MarkdownEditorMenu.class/instance/applyLinkText.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
text interaction | ||
applyLinkText | ||
|
||
| selection | | ||
selection := self pluggableTextMorph textMorph selection. | ||
self pluggableTextMorph replaceSelectionWith: '[', selection, ']()' |
10 changes: 10 additions & 0 deletions
10
packages/MarkdownEditor-Core.package/MarkdownEditorMenu.class/instance/findAndReplaceAll.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
text interaction | ||
findAndReplaceAll | ||
|
||
| continue | | ||
self pluggableTextMorph setSelection: #(1. 0). | ||
self pluggableTextMorph findReplace. "Opens UI that requests Input" | ||
continue := true. | ||
[continue] whileTrue: [ | ||
continue := self pluggableTextMorph handleEdit: [self pluggableTextMorph textMorph editor again]] | ||
|
4 changes: 4 additions & 0 deletions
4
...ages/MarkdownEditor-Core.package/MarkdownEditorMenu.class/instance/pluggableTextMorph..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
pluggableTextMorph: aPluggableTextMorph | ||
|
||
pluggableTextMorph := aPluggableTextMorph |
4 changes: 4 additions & 0 deletions
4
packages/MarkdownEditor-Core.package/MarkdownEditorMenu.class/instance/pluggableTextMorph.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
pluggableTextMorph | ||
|
||
^ pluggableTextMorph |
4 changes: 4 additions & 0 deletions
4
packages/MarkdownEditor-Core.package/MarkdownEditorMenu.class/instance/textSelected.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
text interaction | ||
textSelected | ||
|
||
^ self pluggableTextMorph textMorph selection notEmpty |
7 changes: 7 additions & 0 deletions
7
packages/MarkdownEditor-Core.package/MarkdownEditorMenu.class/instance/yellowButtonMenu..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
yellowButtonMenu | ||
yellowButtonMenu: aMenu | ||
|
||
self textSelected | ||
ifTrue: [self addMenuItemsSelectionTo: aMenu] | ||
ifFalse: [self addMenuItemsTo: aMenu]. | ||
^ aMenu |
25 changes: 25 additions & 0 deletions
25
packages/MarkdownEditor-Core.package/MarkdownEditorMenu.class/methodProperties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"class" : { | ||
"newFor:" : "JE 7/11/2021 16:31" }, | ||
"instance" : { | ||
"addExportItemsTo:" : "JE 7/11/2021 16:53", | ||
"addFileItemsTo:" : "JE 7/11/2021 16:52", | ||
"addFindReplaceItemsTo:" : "JE 7/11/2021 16:50", | ||
"addHeadingMenuItemsTo:" : "JE 7/11/2021 16:35", | ||
"addInlineItemsTo:" : "JE 7/11/2021 16:56", | ||
"addLinkMenuItemsTo:" : "JE 7/11/2021 17:40", | ||
"addMenuItemsSelectionTo:" : "JE 7/11/2021 16:51", | ||
"addMenuItemsTo:" : "JE 7/11/2021 16:54", | ||
"applyAutoLink" : "JE 7/11/2021 16:38", | ||
"applyBlockquote" : "JE 7/11/2021 16:38", | ||
"applyHeadingAt:" : "JE 7/11/2021 17:45", | ||
"applyImageDestination" : "JE 7/11/2021 17:22", | ||
"applyImageText" : "JE 7/11/2021 17:22", | ||
"applyInlineOnSelectionWith:" : "JE 7/11/2021 16:40", | ||
"applyLinkDestination" : "JE 7/11/2021 17:24", | ||
"applyLinkText" : "JE 7/11/2021 17:24", | ||
"findAndReplaceAll" : "JE 7/11/2021 17:31", | ||
"pluggableTextMorph" : "JE 7/11/2021 16:31", | ||
"pluggableTextMorph:" : "JE 7/11/2021 16:31", | ||
"textSelected" : "JE 7/11/2021 16:57", | ||
"yellowButtonMenu:" : "JE 7/11/2021 16:50" } } |
14 changes: 14 additions & 0 deletions
14
packages/MarkdownEditor-Core.package/MarkdownEditorMenu.class/properties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"category" : "MarkdownEditor-Core", | ||
"classinstvars" : [ | ||
], | ||
"classvars" : [ | ||
], | ||
"commentStamp" : "", | ||
"instvars" : [ | ||
"pluggableTextMorph" ], | ||
"name" : "MarkdownEditorMenu", | ||
"pools" : [ | ||
], | ||
"super" : "Object", | ||
"type" : "normal" } |
Empty file.
6 changes: 6 additions & 0 deletions
6
packages/MarkdownEditor-Tests.package/MarkdownEditorMenuTest.class/instance/setUp.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
running | ||
setUp | ||
|
||
editor := MarkdownEditor new. | ||
toolbuilder := ToolBuilder default. | ||
window := toolbuilder open: editor |
Oops, something went wrong.