-
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.
date explanation, minor UI improvements and clean-ups
- click on the date in a conversation browser to get an explanation of the timezone - add missing oxford comma - communicate special value #always for downloadRange - rename DateAndTime>>talkPrettyPrintString - rename String>>talkAsTextFromHtmlWithCRs
- Loading branch information
Showing
29 changed files
with
115 additions
and
34 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
...ndTime.extension/instance/talkPrintOn..st → ....extension/instance/talkPrettyPrintOn..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
6 changes: 6 additions & 0 deletions
6
packages/SqueakInboxTalk.package/DateAndTime.extension/instance/talkPrettyPrintString.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 @@ | ||
*SqueakInboxTalk-UI-squeak protocol | ||
talkPrettyPrintString | ||
|
||
self flag: #moveUpstream. | ||
|
||
^ String streamContents: [:stream | self talkPrettyPrintOn: stream] |
6 changes: 0 additions & 6 deletions
6
packages/SqueakInboxTalk.package/DateAndTime.extension/instance/talkPrintString.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
4 changes: 1 addition & 3 deletions
4
....extension/instance/talkAsTextFromHtml.st → ...ion/instance/talkAsTextFromHtmlWithCRs.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,9 +1,7 @@ | ||
*SqueakInboxTalk-UI-converting | ||
talkAsTextFromHtml | ||
talkAsTextFromHtmlWithCRs | ||
"Answer a Text by interpreting the receiver as HTML. Don't ignore newlines." | ||
|
||
self flag: #moveUpstream. | ||
"maybe?" | ||
^ (HtmlReadWriter on: self readStream) | ||
breakLines: false; | ||
nextText |
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
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
4 changes: 2 additions & 2 deletions
4
packages/SqueakInboxTalk.package/TalkInbox.class/class/defaultMessageSignature.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,7 +1,7 @@ | ||
preferences | ||
defaultMessageSignature | ||
|
||
^ ('<font color="gray">---\\<i>Sent from {1}</i></font>' withCRs format: { | ||
^ ('<font color="gray">---<br><i>Sent from {1}</i></font>' format: { | ||
(self environment classNamed: #TalkInboxBrowser) | ||
ifNil: ['Squeak Inbox Talk'] | ||
ifNotNil: ['<a href="{2}"><u><font color="gray">{1}</font></u></a>' format: {TalkInboxBrowser appName. TalkInboxBrowser repositoryUrl}]}) talkAsTextFromHtml | ||
ifNotNil: ['<a href="{2}"><u><font color="gray">{1}</font></u></a>' format: {TalkInboxBrowser appName. TalkInboxBrowser repositoryUrl}]}) asTextFromHtml |
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
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
2 changes: 1 addition & 1 deletion
2
packages/SqueakInboxTalk.package/TalkInboxBrowser.class/instance/refreshMessagesHelp.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 @@ | ||
accessing - toolbuilder | ||
refreshMessagesHelp | ||
|
||
^ 'Download and prepare the latest messages from the mail archive\<b>Last refreshed:</b> {1}' withCRs talkAsTextFromHtml format: {inbox lastRefreshed ifNil: ['never'] ifNotNil: #talkPrintString} | ||
^ 'Download and prepare the latest messages from the mail archive<br><b>Last refreshed:</b> {1}' asTextFromHtml format: {inbox lastRefreshed ifNil: ['never'] ifNotNil: #talkPrettyPrintString} |
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
24 changes: 24 additions & 0 deletions
24
packages/SqueakInboxTalk.package/TalkMessage.class/instance/explainTimezone.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,24 @@ | ||
*SqueakInboxTalk-UI-tools | ||
explainTimezone | ||
|
||
| their our | | ||
their := self date printString asText. | ||
our := self date asLocal printString asText. | ||
their = our ifFalse: | ||
[their | ||
addAllAttributes: (((self userInterfaceTheme get: #removeTextAttributes for: #TextDiffBuilder) | ||
select: [:attr | attr isKindOf: TextColor]) | ||
ifEmpty: [{TextColor blue}]) | ||
from: their size - 5 to: their size. | ||
our | ||
addAllAttributes: (((self userInterfaceTheme get: #insertTextAttributes for: #TextDiffBuilder) | ||
select: [:attr | attr isKindOf: TextColor]) | ||
ifEmpty: [{TextColor red}]) | ||
from: our size - 5 to: our size]. | ||
Project uiManager | ||
inform: ('<b>In their timezone ({1})</b>: {2}<br><b>In our timezone ({3}):</b> {4}' asTextFromHtml format: | ||
{((TimeZone talkAllForOffset: self date offset) collect: #abbreviation) joinSeparatedBy: '/'. | ||
their. | ||
TimeZone local abbreviation. | ||
our}) | ||
title: 'Unraveling Timezones'. |
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
4 changes: 4 additions & 0 deletions
4
packages/SqueakInboxTalk.package/TimeZone.extension/class/talkAllForOffset..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 @@ | ||
*SqueakInboxTalk-UI-accessing | ||
talkAllForOffset: aDuration | ||
|
||
^ (self timeZones , self timeZonesDST) select: [:ea | ea offset = aDuration] |
5 changes: 5 additions & 0 deletions
5
packages/SqueakInboxTalk.package/TimeZone.extension/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,5 @@ | ||
{ | ||
"class" : { | ||
"talkAllForOffset:" : "ct 6/2/2023 20:07" }, | ||
"instance" : { | ||
} } |
2 changes: 2 additions & 0 deletions
2
packages/SqueakInboxTalk.package/TimeZone.extension/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,2 @@ | ||
{ | ||
"name" : "TimeZone" } |
4 changes: 2 additions & 2 deletions
4
...est.class/instance/testTalkPrintString.st → ...ass/instance/testTalkPrettyPrintString.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,7 +1,7 @@ | ||
test - squeak-protocol | ||
testTalkPrintString | ||
testTalkPrettyPrintString | ||
|
||
| date | | ||
date := DateAndTime year: 2159 month: 3 day: 14 hour: 2 minute: 53 second: 59. | ||
|
||
self assert: '2159-03-14 02:53:59' equals: date talkPrintString | ||
self assert: '2159-03-14 02:53:59' equals: date talkPrettyPrintString |
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
17 changes: 17 additions & 0 deletions
17
packages/SqueakInboxTalkTests.package/TalkMessageTest.class/instance/testExplainTimezone.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,17 @@ | ||
tests | ||
testExplainTimezone | ||
|
||
| message text | | ||
message := self classUnderTest new. | ||
|
||
self | ||
patch: message at: #date withValue: (DateAndTime fromString: '2023-06-04T00:53:27-07:00'); | ||
patch: TimeZone at: #local with: [TimeZone timeZones detect: [:tz | tz abbreviation = 'EST']]; | ||
patch: DateAndTime at: #localOffset withValue: -5 hours. | ||
|
||
text := [message explainTimezone] | ||
on: ProvideAnswerNotification | ||
do: [:ex | ex messageText]. | ||
|
||
self assert: 'In their timezone (MST/PDT): 2023-06-04T00:53:27-07:00 | ||
In our timezone (EST): 2023-06-04T02:53:27-05:00' equals: text. |
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/SqueakInboxTalkTests.package/TalkTimeZoneTest.class/instance/classToBeTested.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 | ||
classToBeTested | ||
|
||
^ TimeZone |
5 changes: 5 additions & 0 deletions
5
packages/SqueakInboxTalkTests.package/TalkTimeZoneTest.class/instance/testAllForOffset.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 @@ | ||
tests | ||
testAllForOffset | ||
|
||
self assert: ((self classToBeTested talkAllForOffset: 0 hours) collect: #abbreviation) = #('UTC' 'GMT'). | ||
self assert: (self classToBeTested talkAllForOffset: -14 hours) isEmpty. |
6 changes: 6 additions & 0 deletions
6
packages/SqueakInboxTalkTests.package/TalkTimeZoneTest.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,6 @@ | ||
{ | ||
"class" : { | ||
}, | ||
"instance" : { | ||
"classToBeTested" : "ct 6/2/2023 20:09", | ||
"testAllForOffset" : "ct 6/2/2023 20:08" } } |
14 changes: 14 additions & 0 deletions
14
packages/SqueakInboxTalkTests.package/TalkTimeZoneTest.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" : "SqueakInboxTalkTests-CoreExtensions", | ||
"classinstvars" : [ | ||
], | ||
"classvars" : [ | ||
], | ||
"commentStamp" : "", | ||
"instvars" : [ | ||
], | ||
"name" : "TalkTimeZoneTest", | ||
"pools" : [ | ||
], | ||
"super" : "TalkTestCase", | ||
"type" : "normal" } |
9eac07e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.