Check-in [b5815e53f6]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Improve history browsing
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b5815e53f65e81aa38def4dd595b432fc7e03e93
User & Date: bernd 2020-02-04 21:35:10.309
Context
2020-02-06
12:37
Bump version number check-in: 8981ab964e user: bernd tags: trunk, 0.9.7-20200206
2020-02-04
21:35
Improve history browsing check-in: b5815e53f6 user: bernd tags: trunk
2020-02-03
18:16
Clean up nick\! check-in: 8fca31bb94 user: bernd tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to gui.fs.
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
    pk key| to msg:id$  pk startdate@ to msg:timestamp
    pk [: .simple-id ." : " ;] $tmp notify-nick!
    pk key| pkc over str= { me? }
    pk enddate@ otr? { otr }
    pk key| last-bubble-pk $@ str= otr last-otr? = and
    pk startdate@ last-tick 64over to last-tick
    pk enddate@ to end-tick
    64- delta-bubble 64< and
    IF
	new-msg-par
    ELSE
	pk startdate@ add-dtms
	pk key| last-bubble-pk $!  otr to last-otr?  text-color!
	{{
	    {{ glue*l }}glue







|







901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
    pk key| to msg:id$  pk startdate@ to msg:timestamp
    pk [: .simple-id ." : " ;] $tmp notify-nick!
    pk key| pkc over str= { me? }
    pk enddate@ otr? { otr }
    pk key| last-bubble-pk $@ str= otr last-otr? = and
    pk startdate@ last-tick 64over to last-tick
    pk enddate@ to end-tick
    64- delta-bubble 64u< and
    IF
	new-msg-par
    ELSE
	pk startdate@ add-dtms
	pk key| last-bubble-pk $!  otr to last-otr?  text-color!
	{{
	    {{ glue*l }}glue
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
	msg:thumbnail# of  ?thumb  "thumbnail" name!  endof
	msg:patch#     of  [: ." patch["    85type ']' emit
	    ;] $tmp }}text  "patch" name!  endof
	msg:snapshot#  of  [: ." snapshot[" 85type ']' emit
	    ;] $tmp }}text  "snapshot" name!  endof
	msg:message#   of  [: ." message["  85type ']' emit
	    ;] $tmp }}text  "message" name!  endof
	msg:posting#   of  ." posting"
	    rdrop 2dup $make [: addr data $@ open-posting ;] swap 2>r
	    ['] .posting $tmp }}text 2r> click[]  "posting" name!
	endof
    endcase
    msg-box .child+
    text-color!
; wmsg-class is msg:object

in net2o : new-wmsg ( o:connection -- o )







|

|







1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
	msg:thumbnail# of  ?thumb  "thumbnail" name!  endof
	msg:patch#     of  [: ." patch["    85type ']' emit
	    ;] $tmp }}text  "patch" name!  endof
	msg:snapshot#  of  [: ." snapshot[" 85type ']' emit
	    ;] $tmp }}text  "snapshot" name!  endof
	msg:message#   of  [: ." message["  85type ']' emit
	    ;] $tmp }}text  "message" name!  endof
	msg:posting#   of
	    rdrop 2dup $make [: addr data $@ open-posting ;] swap 2>r
	    [: ." posting" .posting ;] $tmp }}text 2r> click[]  "posting" name!
	endof
    endcase
    msg-box .child+
    text-color!
; wmsg-class is msg:object

in net2o : new-wmsg ( o:connection -- o )
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
    r> ;
: }}closerh ( o1 .. on -- o )
	s" ❌" $444444FF new-color, }}text dup { closer }
    }}h box[] >r
    closer [: data chat-history .childs[] del$cell
      data .dispose-widget +resize +sync ;] r@ click[] drop
    r> ;
: log-data { endi starti -- }
    msg-log@ { log u } msgs-box { box }
    {{ }}v box[] dup to msgs-box
    closerz chat-history .child+
    log u starti cells safe/string endi starti - cells umin bounds U+DO
	I log - cell/ to log#
	I $@ { d: msgt }
	msgt ['] msg-tdisplay wmsg-o .catch nothrow  IF
	    <err> ." invalid entry" cr <default> 2drop
	THEN
    cell +LOOP +resize +sync
    box to msgs-box







|



|







1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
    r> ;
: }}closerh ( o1 .. on -- o )
	s" ❌" $444444FF new-color, }}text dup { closer }
    }}h box[] >r
    closer [: data chat-history .childs[] del$cell
      data .dispose-widget +resize +sync ;] r@ click[] drop
    r> ;
: log-data { endi starti -- } 64#0 to last-tick
    msg-log@ { log u } msgs-box { box }
    {{ }}v box[] dup to msgs-box
    closerz chat-history .child+
    log u endi cells umin starti cells safe/string bounds U+DO
	I log - cell/ to log#
	I $@ { d: msgt }
	msgt ['] msg-tdisplay wmsg-o .catch nothrow  IF
	    <err> ." invalid entry" cr <default> 2drop
	THEN
    cell +LOOP +resize +sync
    box to msgs-box
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
	\Large \sans \bold
	glue*ll }}glue
	year 0 <# '-' hold #s #> }}text
	r> r> DO
	    year I 1+ month>i year I month>i - IF
		I 0 <# # # #> day-color x-color blackish }}button-lit
		[: data #12 /mod { m y }
		  y m 2 + month>i  y m 1 + month>i -
		  IF
		      y m 2 + 1 ymd2day unix-day0 -
		      y m 1 + 1 ymd2day unix-day0 - +days
		      chat-history .child+ +resize +sync
		  ELSE
		      y m 2 + month>i  y m 1 + month>i log-data
		  THEN
		;] I 1- year 12 * + click[]
	    THEN
	LOOP
	glue*ll }}glue
    }}closerh ;
: +quartals ( year end start -- o )
    >r 1+ >r { year }
    {{
	\Large \sans \bold
	glue*ll }}glue
	year 0 <# '/' hold #s #> }}text
	r> r> DO
	    I year 4 * + quartal>i
	    I 1- year 4 * + quartal>i - IF
		I 0 <# #s 'Q' hold #> day-color x-color blackish }}button-lit
		[:
		  data 1+ quartal>i data quartal>i -
		  IF
		      data 4 /mod swap dup 2* + dup 3 + swap 1+ +months
		      chat-history .child+ +resize +sync
		  ELSE
		      data 1+ quartal>i data quartal>i log-data
		  THEN
		;] I 1- year 2* 2* + click[]
	    THEN
	LOOP
	glue*ll }}glue
    }}closerh ;
: +years ( end start -- o ) { | lastyear }
    >r 1+ >r
    {{
	\Large \sans \bold
	glue*ll }}glue
	r> r> DO
	    I 1+ year>i I year>i -
	    IF  I lastyear - dup #100 u>= IF  lastyear +  THEN
		0 <# #s #> day-color x-color blackish }}button-lit
		[: data 1+ year>i data year>i - gui-msgs# u> IF
		      data 4 1 +quartals chat-history .child+ +resize +sync
		  ELSE
		      data 1+ year>i data year>i log-data
		  THEN
		;] I click[]
	    THEN
	    I #100 / #100 * to lastyear
	LOOP
	glue*ll }}glue
    }}h box[] ;







|
|




|
















<
|
|



|















|


|







1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268

1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
	\Large \sans \bold
	glue*ll }}glue
	year 0 <# '-' hold #s #> }}text
	r> r> DO
	    year I 1+ month>i year I month>i - IF
		I 0 <# # # #> day-color x-color blackish }}button-lit
		[: data #12 /mod { m y }
		  y m 2 + month>i  y m 1 + month>i 2dup - gui-msgs# u>
		  IF  2drop
		      y m 2 + 1 ymd2day unix-day0 -
		      y m 1 + 1 ymd2day unix-day0 - +days
		      chat-history .child+ +resize +sync
		  ELSE
		      log-data
		  THEN
		;] I 1- year 12 * + click[]
	    THEN
	LOOP
	glue*ll }}glue
    }}closerh ;
: +quartals ( year end start -- o )
    >r 1+ >r { year }
    {{
	\Large \sans \bold
	glue*ll }}glue
	year 0 <# '/' hold #s #> }}text
	r> r> DO
	    I year 4 * + quartal>i
	    I 1- year 4 * + quartal>i - IF
		I 0 <# #s 'Q' hold #> day-color x-color blackish }}button-lit

		[: data 1+ quartal>i data quartal>i 2dup - gui-msgs# u>
		  IF  2drop
		      data 4 /mod swap dup 2* + dup 3 + swap 1+ +months
		      chat-history .child+ +resize +sync
		  ELSE
		      log-data
		  THEN
		;] I 1- year 2* 2* + click[]
	    THEN
	LOOP
	glue*ll }}glue
    }}closerh ;
: +years ( end start -- o ) { | lastyear }
    >r 1+ >r
    {{
	\Large \sans \bold
	glue*ll }}glue
	r> r> DO
	    I 1+ year>i I year>i -
	    IF  I lastyear - dup #100 u>= IF  lastyear +  THEN
		0 <# #s #> day-color x-color blackish }}button-lit
		[: data 1+ year>i data year>i 2dup - gui-msgs# u> IF  2drop
		      data 4 1 +quartals chat-history .child+ +resize +sync
		  ELSE
		      log-data
		  THEN
		;] I click[]
	    THEN
	    I #100 / #100 * to lastyear
	LOOP
	glue*ll }}glue
    }}h box[] ;