Skip to content

Commit

Permalink
Merge 233f94b into 00be7b0
Browse files Browse the repository at this point in the history
  • Loading branch information
konradh committed Jul 2, 2020
2 parents 00be7b0 + 233f94b commit d2f9675
Show file tree
Hide file tree
Showing 212 changed files with 659 additions and 579 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
adding
add: aTextAttribute
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
testing
includes: aTextAttribute

^ false
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
removing
remove: aTextAttribute

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
color
resetColorOfCurrentStructure

self noCurrentStructureWarning

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
font
resetFontOfCurrentStructure

self noCurrentStructureWarning
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
accessing
structureIdentifier: aSymbol
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
"class" : {
"warningText" : "tok 6/12/2020 12:41" },
"instance" : {
"add:" : "kh 6/18/2020 21:24",
"includes:" : "kh 6/18/2020 21:25",
"noCurrentStructureWarning" : "tok 6/12/2020 12:41",
"openColorPicker" : "ls 7/24/2019 21:54",
"openFontChooser" : "ls 7/24/2019 21:22",
"resetColor" : "ls 7/24/2019 21:57",
"resetFont" : "ls 7/24/2019 21:23",
"structureIdentifier" : "ls 7/24/2019 22:17" } }
"remove:" : "kh 6/18/2020 21:24",
"resetColorOfCurrentStructure" : "kh 6/19/2020 18:05",
"resetFontOfCurrentStructure" : "kh 6/19/2020 18:07",
"structureIdentifier" : "ls 7/24/2019 22:17",
"structureIdentifier:" : "kh 6/18/2020 21:57" } }
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ I am a RichTextDocument. I represent the text someone wrote in order to improve

I am independent from the RichTextEditorModel, as the textStructures as well as my name and my text can be manipulated directly, so the RichTextEditorModel is not always needed, even though it can always be used.

You can add a new structure to the structures available in new instances of me by adding a new TextStructure to my initialTextStructures method on class side.

My instance variables are:
name - aString
text - aText
textStructures - anOrderedCollection
textStructures - anOrderedCollection
timeLastSaved - aDateAndTime

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
constants
commonStructures

^ {} asSet

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
constants
initial structures
initialBoldStructure

^ TextStructure
newWith: #bold
withStyles: (self defaultStyles union: {TextStructure boldStyle})
^ TextStructure
new: #bold
from: {TextStructure bold}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
constants
initial structures
initialFootnoteStructure

^ (TextStructure
newWith: #footnote
withStyles: self defaultStyles)
font: (StrikeFont createDejaVuDark: 9)

^ TextStructure
new: #footnote
from: {TextStructure fontFrom: (StrikeFont createDejaVuDark: 9)}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
constants
initial structures
initialHeading1Structure

^ (TextStructure
newWith: #heading1
withStyles: (self defaultStyles union: {TextStructure boldStyle}))
font: (StrikeFont createDejaVuDark: 20)

^ TextStructure
new: #heading1
from: {TextStructure fontFrom: (StrikeFont createDejaVuDark: 20). TextStructure bold}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
constants
initial structures
initialHeading2Structure

^ (TextStructure
newWith: #heading2
withStyles: (self defaultStyles union: {TextStructure boldStyle}))
font: (StrikeFont createDejaVuDark: 17)

^ TextStructure
new: #heading2
from: {TextStructure fontFrom: (StrikeFont createDejaVuDark: 17). TextStructure bold}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
constants
initial structures
initialHeading3Structure

^ (TextStructure
newWith: #heading3
withStyles: (self defaultStyles union: {TextStructure boldStyle}))
font: (StrikeFont createDejaVuDark: 14)

^ TextStructure
new: #heading3
from: {TextStructure fontFrom: (StrikeFont createDejaVuDark: 14). TextStructure bold}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
constants
initial structures
initialItalicStructure

^ TextStructure
newWith: #italic
withStyles: (self defaultStyles union: {TextStructure italicStyle})
new: #italic
from: {TextStructure italic}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
constants
initial structures
initialListStructure

^ TextStructure
newWith: #list
withStyles: (self defaultStyles union: {TextStructure indentedStyle})
new: #list
from: {TextStructure indented}
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
constants
initial structures
initialTextStructures

^ {self initialBoldStructure.
self initialItalicStructure.
self initialUnderlinedStructure.
self initialFootnoteStructure.
self initialHeading1Structure.
self initialHeading2Structure.
self initialHeading3Structure.
self initialListStructure} asOrderedCollection
self initialFootnoteStructure.
self initialListStructure.
self initialURLStructure} asOrderedCollection
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
initial structures
initialURLStructure

^ TextStructure
new: #url
from: {TextStructure autohyperlink. TextStructure underlined. TextStructure notExtendable}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
constants
initial structures
initialUnderlinedStructure

^ TextStructure
newWith: #underlined
withStyles: (self defaultStyles union: {TextStructure underlinedStyle})
^ TextStructure
new: #underlined
from: {TextStructure underlined}
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
text structures
addAttribute: aTextAttribute from: startInteger to: stopInteger

aTextAttribute isTextStructure
ifTrue: [aTextAttribute preAdd: (self text copyFrom: startInteger to: stopInteger)].

self text addAttribute: aTextAttribute from: startInteger to: stopInteger.
self
sortRunsByPriority;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
text structures
initializeStructure: aSymbol

self initializeStructure: aSymbol withEmphasis: self class defaultStyles
self textStructures add: (TextStructure new: aSymbol from: self class commonStructures)

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
text structures
removeStructure: aSymbol

self textStructures remove: (self symbolToStructure: aSymbol).
self textStructures remove: (self textStructureAt: aSymbol).
self
textChanged;
structuresChanged

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
text structures
textStructureAt: aSymbol

^ self textStructures detect: [:each | each structureIdentifier = aSymbol]
ifNone: [^ NullTextStructure new]

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,49 +1,47 @@
{
"class" : {
"defaultStyles" : "tok 6/8/2020 12:21",
"commonStructures" : "kh 6/21/2020 17:03",
"editorClass" : "ls 6/26/2019 17:33",
"fromText:withStructures:" : "ls 6/26/2019 17:31",
"initialBoldStructure" : "tok 6/8/2020 12:22",
"initialFootnoteStructure" : "tok 6/8/2020 12:06",
"initialHeading1Structure" : "tok 6/8/2020 12:22",
"initialHeading2Structure" : "tok 6/8/2020 12:22",
"initialHeading3Structure" : "tok 6/8/2020 12:22",
"initialItalicStructure" : "tok 6/8/2020 12:22",
"initialListStructure" : "tok 6/8/2020 12:22",
"initialTextStructures" : "tok 5/31/2020 21:15",
"initialUnderlinedStructure" : "tok 6/8/2020 12:23" },
"initialBoldStructure" : "kh 6/21/2020 16:43",
"initialFootnoteStructure" : "kh 6/21/2020 16:55",
"initialHeading1Structure" : "kh 6/21/2020 16:55",
"initialHeading2Structure" : "kh 6/21/2020 16:55",
"initialHeading3Structure" : "kh 6/21/2020 16:55",
"initialItalicStructure" : "kh 6/21/2020 16:44",
"initialListStructure" : "kh 6/21/2020 16:44",
"initialTextStructures" : "kh 6/19/2020 12:37",
"initialURLStructure" : "kh 6/19/2020 17:28",
"initialUnderlinedStructure" : "kh 6/21/2020 16:44" },
"instance" : {
"addAttribute:from:to:" : "AG 7/25/2019 13:08",
"addAttribute:from:to:" : "kh 6/19/2020 12:35",
"charcount" : "frc 5/25/2020 16:02",
"charcountExcept:" : "frc 6/13/2020 11:15",
"copy:" : "MB 7/3/2019 18:58",
"createNewStructure:" : "ls 7/24/2019 15:24",
"emptyChars" : "frc 6/1/2020 13:43",
"hasStructure:forText:from:to:" : "AG 7/25/2019 13:20",
"initialize" : "ls 7/24/2019 15:10",
"initializeStructure:" : "ls 7/24/2019 15:13",
"initializeStructure:withEmphasis:" : "tok 6/8/2020 12:06",
"initializeStructure:" : "kh 6/21/2020 17:03",
"initializeStructures" : "ls 7/24/2019 15:12",
"isUnsavedDocument" : "OS 6/14/2020 18:19",
"name" : "ls 6/26/2019 17:28",
"name:" : "MB 7/3/2019 19:29",
"openEditor" : "lh 7/24/2019 21:27",
"openInEditor" : "ls 7/24/2019 20:14",
"removeStructure:" : "ls 7/24/2019 17:28",
"removeStructure:" : "kh 6/21/2020 10:03",
"removeTextAttribute:from:to:" : "MB 7/24/2019 20:40",
"sortRunsByPriority" : "JEH 5/20/2020 10:28",
"structuresChanged" : "ls 7/24/2019 14:46",
"stylesForStructure:" : "AG 7/25/2019 13:30",
"symbolToStructure:" : "ls 7/24/2019 14:24",
"text" : "ls 6/26/2019 17:28",
"text:" : "MB 7/3/2019 19:29",
"textChanged" : "ls 7/24/2019 14:41",
"textRuns" : "lh 7/24/2019 17:14",
"textStructureAt:" : "kh 6/19/2020 15:00",
"textStructureSymbols" : "ls 7/24/2019 14:25",
"textStructures" : "ls 6/26/2019 17:28",
"textStructures:" : "MB 7/3/2019 19:29",
"textStructuresDo:" : "ls 7/24/2019 21:29",
"timeLastSaved" : "OS 6/14/2020 11:16",
"timeLastSaved:" : "OS 6/15/2020 12:22",
"updateStyle:withEmphasis:" : "ls 6/26/2019 22:44",
"wordcount" : "frc 6/1/2020 13:46" } }
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
],
"classvars" : [
],
"commentStamp" : "lh 7/25/2019 11:57",
"commentStamp" : "kh 6/19/2020 00:40",
"instvars" : [
"textStructures",
"text",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ pasting
makeTextURLFrom: aString

^ aString asText
addAttribute: (TextURL new url: aString);
addAttribute: (TextStructure hyperlinkTo: aString);
addAttribute: (TextEmphasis underlined)
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ pasting
pasteURL

self
replaceSelectionWith: (self makeTextURLFrom: self clipboardText asString);
replaceSelectionWith: (self makeTextURLFrom: self clipboardText);
selectAt: self pointIndex
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
"isStructureShortcut:" : "OS 6/12/2020 12:09",
"isValidCharacter:" : "tok 6/13/2020 12:04",
"keyStroke:" : "OS 6/12/2020 12:09",
"makeTextURLFrom:" : "kh 6/15/2020 10:39",
"makeTextURLFrom:" : "kh 6/21/2020 16:56",
"mouseDown:" : "OS 6/1/2020 00:56",
"paste" : "kh 6/15/2020 13:32",
"pasteURL" : "kh 6/15/2020 10:39",
"pasteURL" : "kh 6/19/2020 13:10",
"setEmphasisHere" : "6/1/2020 14:03:21",
"specialCharacters" : "tok 6/13/2020 12:14",
"storeSelectionInParagraph" : "lh 7/24/2019 21:51",
Expand Down

This file was deleted.

Loading

0 comments on commit d2f9675

Please sign in to comment.