Skip to content

Commit

Permalink
simplified version
Browse files Browse the repository at this point in the history
  • Loading branch information
cdfhalle committed May 29, 2021
1 parent a635c4c commit 5bf5089
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
converting
asText

self text ifNil: [self text: self generateText. self text addAttribute: (TextColor color: Color random)].
self text ifNil: [self text: self generateText].
^ self text
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"instance" : {
"=" : "C.H. 5/29/2021 09:57",
"append:" : "jko 7/4/2019 16:17",
"asText" : "C.H. 5/28/2021 18:10",
"asText" : "C.H. 5/29/2021 21:42",
"contains:" : "C.H. 5/28/2021 17:05",
"convertWith:" : "cg 6/29/2020 21:31",
"firstLine" : "jst 6/10/2019 11:18",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
styling
buildAttributeRunsFrom: aCollectionOfMarkdownBlocks

| runs time1 time2 |
time1 := TimeStamp now.
| runs newBlocks |
newBlocks:= Set new.
runs := aCollectionOfMarkdownBlocks
inject: RunArray new
into: [:accumulatedRuns :block | |currentBlock|
currentBlock := self blocks detect: [:b | b = block] ifNone: [self blocks add: block. block].
currentBlock := self newOrExistingBlock: block.
newBlocks add: currentBlock.
accumulatedRuns, currentBlock asText runs].
Transcript show: 'Time for choosing between old or new: ', (TimeStamp now - time1) asString, Character cr.
time2 := TimeStamp now.
self blocks: (self blocks select: [:b | aCollectionOfMarkdownBlocks includes: b]).
Transcript show: 'Time for removing old blocks: ', (TimeStamp now - time2) asString, Character cr.
self blocks: newBlocks.
^ runs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
styling
newOrExistingBlock: aMarkdownBlock

"if the new block is choosen it will also get added to the Set of blocks"
^ self blocks
detect: [:b | b = aMarkdownBlock]
ifNone: [self blocks add: aMarkdownBlock.
aMarkdownBlock].
ifNone: [aMarkdownBlock].
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"instance" : {
"blocks" : "C.H. 5/29/2021 20:35",
"blocks:" : "C.H. 5/28/2021 14:52",
"buildAttributeRunsFrom:" : "C.H. 5/29/2021 21:03",
"buildAttributeRunsFrom:" : "C.H. 5/29/2021 22:29",
"buildBlockStructureFrom:" : "C.H. 5/29/2021 08:40",
"createLines:" : "azi 6/1/2020 15:40",
"initialize" : "MAS 6/1/2020 17:49",
"newOrExistingBlock:" : "C.H. 5/29/2021 21:17",
"newOrExistingBlock:" : "C.H. 5/29/2021 22:06",
"parse:" : "jko 6/21/2019 14:20",
"privateFormat:" : "jst 6/28/2019 14:02",
"privateStyle:" : "C.H. 5/29/2021 20:52",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ testCancelChanges
self
assertRuns: {20}
values: {{TextColor color: Color brown. self fontSized: 11}}
areStyleOf: paragraphBlock asText.
areStyleOf: paragraphBlock generateText.
options handleCancel.
styleSettings := editor blockTextStyler styleSettings.
paragraphBlock styleSettings: styleSettings. "not needed in project because of block text styler"
self
assertRuns: {20}
values: {{TextColor color: (originalSettings fontColors at: 'Paragraph'). self fontSized: (originalSettings fontSizes at: 'Paragraph')}}
areStyleOf: paragraphBlock asText.
areStyleOf: paragraphBlock generateText.
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ testCancelChangesOnClosing
self
assertRuns: {20}
values: {{TextColor color: Color green. self fontSized: 17}}
areStyleOf: paragraphBlock asText.
areStyleOf: paragraphBlock generateText.

options closeBoxHit.
styleSettings := editor blockTextStyler styleSettings.
paragraphBlock styleSettings: styleSettings. "not needed in project because of block text styler"
self
assertRuns: {20}
values: {{TextColor color: (originalSettings fontColors at: 'Paragraph'). self fontSized: (originalSettings fontSizes at: 'Paragraph')}}
areStyleOf: paragraphBlock asText.
areStyleOf: paragraphBlock generateText.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"setUp" : "JE 5/7/2021 14:27",
"tearDown" : "JE 5/7/2021 14:28",
"testApplyChanges" : "JE 5/7/2021 14:25",
"testCancelChanges" : "JE 5/7/2021 14:33",
"testCancelChangesOnClosing" : "JE 5/7/2021 14:30",
"testCancelChanges" : "C.H. 5/29/2021 21:55",
"testCancelChangesOnClosing" : "C.H. 5/29/2021 21:54",
"testChangeCommentFontSizeColor" : "JE 5/7/2021 14:06",
"testChangeHeadingFontSizesColors" : "JE 5/7/2021 14:03",
"testChangeMultipleEditors" : "JE 5/7/2021 14:54",
Expand Down

0 comments on commit 5bf5089

Please sign in to comment.