The Inbox: HelpSystem-Core-ct.117.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Inbox: HelpSystem-Core-ct.117.mcz

commits-2
A new version of HelpSystem-Core was added to project The Inbox:
http://source.squeak.org/inbox/HelpSystem-Core-ct.117.mcz

==================== Summary ====================

Name: HelpSystem-Core-ct.117
Author: ct
Time: 20 September 2019, 7:53:36.226726 pm
UUID: 7f73f090-17d8-8843-bbff-03e67c26e396
Ancestors: HelpSystem-Core-mt.116

Convenience method for subtopic lookup

=============== Diff against HelpSystem-Core-mt.116 ===============

Item was added:
+ ----- Method: AbstractHelpTopic>>subtopicAt: (in category 'accessing') -----
+ subtopicAt: key
+
+ ^ self subtopics detect: [:topic | topic key = key]!

Item was changed:
  ----- Method: HelpBrowser>>accept: (in category 'actions') -----
  accept: text
  "Accept edited text. Compile it into a HelpTopic"
 
  | parent currentKey normalizedText colorsToRemove |
  ((self currentParentTopic isNil or: [self currentParentTopic isEditable not])
  or: [self currentTopic isEditable not])
  ifTrue: [^ self inform: 'This help topic cannot be edited.'].
 
  self changed: #clearUserEdits.
 
  "Remove default colors for the sake of UI themes."
  normalizedText := text.
  colorsToRemove := {Color black. Color white}.
  normalizedText runs: (normalizedText runs collect: [:attributes | attributes reject: [:attribute |
  (((attribute respondsTo: #color) and: [colorsToRemove includes: attribute color])
  or: [attribute respondsTo: #font])]]).
 
  parent := self currentParentTopic.
  currentKey := self currentTopic key.
 
  isUpdating := true.
 
  parent accept: normalizedText for: self currentTopic.
  parent refresh.
  parent == self rootTopic ifTrue: [self rootTopic: parent].
 
  isUpdating := false.
 
+ self currentTopic: (parent subtopicAt: currentKey).!
- self currentTopic: (parent subtopics detect: [:t | t key = currentKey]).!