-
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
1 parent
9a8e0c4
commit f4479f2
Showing
7 changed files
with
40 additions
and
9 deletions.
There are no files selected for viewing
10 changes: 2 additions & 8 deletions
10
packages/MarkdownEditor-Core.package/MarkdownEditor.class/instance/openFile.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,14 +1,8 @@ | ||
open / save | ||
openFile | ||
|
||
| fc stream dict | | ||
| fc | | ||
fc := FileChooser new. | ||
fc initializeAsDialogBox. | ||
fc setSuffixes: {self fileEnding}. | ||
stream := fc open. | ||
|
||
stream ifNotNil: [ | ||
self currentFilePath: stream name. | ||
dict := STON fromStream: stream. | ||
self textMorph setText: (dict at: 'text'). | ||
self applySavedStyleSettingsFrom: dict] | ||
self openStream: (fc open) |
10 changes: 10 additions & 0 deletions
10
packages/MarkdownEditor-Core.package/MarkdownEditor.class/instance/openStream..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 @@ | ||
open / save | ||
openStream: aStream | ||
|
||
| dict | | ||
|
||
aStream ifNotNil: [ | ||
self currentFilePath: aStream name. | ||
dict := STON fromStream: aStream. | ||
self textMorph setText: (dict at: 'text'). | ||
self applySavedStyleSettingsFrom: dict] |
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
7 changes: 7 additions & 0 deletions
7
...ges/MarkdownEditor-Tests.package/MarkdownEditorTest.class/instance/testCurrentFilePath.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 @@ | ||
test - open / close | ||
testCurrentFilePath | ||
|
||
| editor | | ||
editor := MarkdownEditor new. | ||
editor currentFilePath: 'Test test'. | ||
self assert: editor currentFilePath equals: 'Test test' |
6 changes: 6 additions & 0 deletions
6
packages/MarkdownEditor-Tests.package/MarkdownEditorTest.class/instance/testFileEnding.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 @@ | ||
test - open / close | ||
testFileEnding | ||
|
||
| editor | | ||
editor := MarkdownEditor new. | ||
self assert: editor fileEnding equals: 'mde' |
10 changes: 10 additions & 0 deletions
10
packages/MarkdownEditor-Tests.package/MarkdownEditorTest.class/instance/testSaveAndOpen.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 @@ | ||
test - open / close | ||
testSaveAndOpen | ||
|
||
| editor | | ||
window delete. | ||
FileStream fileNamed: 'testSaveAndOpenTestFile.mde'. | ||
editor := MarkdownEditor new. | ||
window := toolbuilder open: editor. | ||
editor openFile. | ||
self assert: True. |
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