Check-in [79711085be]
Not logged in

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

Overview
Comment:Improvement on g+ import, limiter for chat text
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 79711085be30ba2cd6f0ca1111b3f253df0f6258
User & Date: bernd 2019-03-14 22:14:13
Context
2019-03-18
22:54
Improvement in social network display check-in: d9332e3ec1 user: bernd tags: trunk
2019-03-14
22:14
Improvement on g+ import, limiter for chat text check-in: 79711085be user: bernd tags: trunk
18:39
Try to fix problems with non-identical posts check-in: 0c5170aaaa user: bernd tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to gui.fs.

219
220
221
222
223
224
225




226
227
228
229
230
231
232
...
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
...
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
    $000020FF color, FValue login-bg-col#
[THEN]

: entropy-colorize ( -- )
    prev-text$ erase  addr prev-text$ $free
    edit-w .text$ passphrase-entropy 1e fmin pw-bg-col# f+
    pw-back >o to w-color o> ;





glue new Constant glue*lll±
glue*lll± >o 1Mglue fnip 1000e fswap hglue-c glue! 0glue fnip 1filll fswap dglue-c glue! 1glue vglue-c glue! o>

glue new Constant glue*shrink
glue*shrink >o 0e 1filll 0e hglue-c glue! 1glue dglue-c glue! 1glue vglue-c glue! o>

................................................................................
		{{
		    {{
			pw-text-col# to x-color
			"" }}pw dup to pw-field
			25%b >o config:passmode# @ to pw-mode o o>
			glue*lll }}glue
		    }}h
		    pw-field ' pw-done edit[]
		    >o act >o ' entropy-colorize is edit-filter o> o o>
		    {{
			\large \sans whitish "👁" }}text
			\normal \bold show-sign-color# to x-color "\" }}text dup value show-pw-sign /center blackish
		    }}z \regular
		    : pw-show/hide ( flag -- )
			dup IF  ['] transparent >body f@
			ELSE  show-sign-color#  THEN
................................................................................
	    font-size# 66% f* fdup hslider
	}}v box[]
	{{
	    {{ glue*lll $FFFFFFFF color, font-size# 40% f* }}frame dup .button3
		{{ \normal \regular blackish "" }}edit 40%b dup to chat-edit glue*l }}glue
		    glue*lll }}glue
		}}h box[]
	    }}z chat-edit [: edit-w .chat-edit-enter drop nip 0 tuck false ;] edit[]
	    >o act >o [: connection .chat-next-line ;] is edit-next-line o> o o>
	    >o act >o [: connection .chat-prev-line ;] is edit-prev-line o> o o>
	    {{
		glue*l $80FF80FF color, font-size# 40% f* }}frame dup .button2
		!i18n l" Send" }}text' !lit 40%b
		[: data >o chat-edit-enter "" to text$ o>
		    chat-edit engage ;] chat-edit click[]







>
>
>
>







 







|
<







 







|







219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
...
285
286
287
288
289
290
291
292

293
294
295
296
297
298
299
...
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
    $000020FF color, FValue login-bg-col#
[THEN]

: entropy-colorize ( -- )
    prev-text$ erase  addr prev-text$ $free
    edit-w .text$ passphrase-entropy 1e fmin pw-bg-col# f+
    pw-back >o to w-color o> ;
: size-limit ( -- )
    edit-w .text$ nip #800 u> IF
	prev-text$ edit-w >o to text$ o>
    THEN ;

glue new Constant glue*lll±
glue*lll± >o 1Mglue fnip 1000e fswap hglue-c glue! 0glue fnip 1filll fswap dglue-c glue! 1glue vglue-c glue! o>

glue new Constant glue*shrink
glue*shrink >o 0e 1filll 0e hglue-c glue! 1glue dglue-c glue! 1glue vglue-c glue! o>

................................................................................
		{{
		    {{
			pw-text-col# to x-color
			"" }}pw dup to pw-field
			25%b >o config:passmode# @ to pw-mode o o>
			glue*lll }}glue
		    }}h
		    pw-field ' pw-done edit[] ' entropy-colorize filter[]

		    {{
			\large \sans whitish "👁" }}text
			\normal \bold show-sign-color# to x-color "\" }}text dup value show-pw-sign /center blackish
		    }}z \regular
		    : pw-show/hide ( flag -- )
			dup IF  ['] transparent >body f@
			ELSE  show-sign-color#  THEN
................................................................................
	    font-size# 66% f* fdup hslider
	}}v box[]
	{{
	    {{ glue*lll $FFFFFFFF color, font-size# 40% f* }}frame dup .button3
		{{ \normal \regular blackish "" }}edit 40%b dup to chat-edit glue*l }}glue
		    glue*lll }}glue
		}}h box[]
	    }}z chat-edit [: edit-w .chat-edit-enter drop nip 0 tuck false ;] edit[] ' size-limit filter[]
	    >o act >o [: connection .chat-next-line ;] is edit-next-line o> o o>
	    >o act >o [: connection .chat-prev-line ;] is edit-prev-line o> o o>
	    {{
		glue*l $80FF80FF color, font-size# 40% f* }}frame dup .button2
		!i18n l" Send" }}text' !lit 40%b
		[: data >o chat-edit-enter "" to text$ o>
		    chat-edit engage ;] chat-edit click[]

Changes to html/parser.fs.

257
258
259
260
261
262
263
264

265
266
267
268
269
270
271
    ELSE  html-throw throw  THEN ;

\ post-process to cleanup

: process-pattern ( addr u -- addr' u' )
    2dup "_**_"     string-prefix? IF  4 safe/string ." **"  EXIT  THEN
    2dup "**+++ "   string-prefix? IF  6 safe/string ." # "  EXIT  THEN
    2dup " +++**\n" string-prefix? IF  7 safe/string ."  #" cr

    ELSE
	dup 2 u>= IF  2dup #lf skip nip over swap - >r
	    r@ 1 = IF  '\' emit  THEN
	    over r@ type r> safe/string  THEN
    THEN
    dup IF  over c@ emit 1 safe/string  THEN ;
: process-patterns ( addr u -- )







|
>







257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
    ELSE  html-throw throw  THEN ;

\ post-process to cleanup

: process-pattern ( addr u -- addr' u' )
    2dup "_**_"     string-prefix? IF  4 safe/string ." **"  EXIT  THEN
    2dup "**+++ "   string-prefix? IF  6 safe/string ." # "  EXIT  THEN
    2dup " +++**\n" 2 pick 6 = + string-prefix? IF
	."  #" dup 6 <> IF  cr  THEN  7 safe/string
    ELSE
	dup 2 u>= IF  2dup #lf skip nip over swap - >r
	    r@ 1 = IF  '\' emit  THEN
	    over r@ type r> safe/string  THEN
    THEN
    dup IF  over c@ emit 1 safe/string  THEN ;
: process-patterns ( addr u -- )

Changes to json/g+-import.fs.

177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196


197
198




199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
    comments:link{} ?dup-IF cr >o
	'[' emit link:title$ type-esc'd ." ](" link:url$ type ')' emit cr
	o>  THEN ;

0 Value img-req-fid

: .mfile { d: fn -- }
    fn basedir+name pics# #@ 2dup d0= IF
	2drop fn .url
	fn [: .url cr ;] img-req-fid outfile-execute
    ELSE
	." file:" picbase# #@ type
    THEN ;
: .csv-link { d: fn -- }
    ." ![" fn picdesc# #@ .simple-text ." ](file:" fn picbase# #@ type ." )" cr ;
: .media ( -- )
    comments:media{} ?dup-IF cr >o
	." ![" media:description$ .simple-text ." ]("
	media:url$ 2dup basename nip $100 > IF
	    ." file:" 2drop media:localFilePath$ basename type


	ELSE  .mfile  THEN  ')' emit cr
	o>  THEN ;




: .album ( -- )
    comments:album{} ?dup-IF cr
	." ::album::" cr cr
	.album:media[] $@ over @ .media:url$
	basedir+name pics# #@ d0= IF
	    bounds U+DO
		I @ >o
		." ![" media:description$ .simple-text ." ]("
		media:localFilePath$ nip IF  ." file:" media:url$ basename type
		ELSE  media:url$ .mfile  THEN ')' emit cr
		o>
	    cell +LOOP
	ELSE
	    2drop
	    last# cell+ $@ 5 umin album# #@ bounds U+DO
		I $@ .csv-link
	    cell +LOOP
	THEN







|



|



|
<
<
|
|
>
>
|
|
>
>
>
>






|
<
<
<
<







177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192


193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209




210
211
212
213
214
215
216
    comments:link{} ?dup-IF cr >o
	'[' emit link:title$ type-esc'd ." ](" link:url$ type ')' emit cr
	o>  THEN ;

0 Value img-req-fid

: .mfile { d: fn -- }
    fn basedir+name ~~ pics# #@ ~~ 2dup d0= IF
	2drop fn .url
	fn [: .url cr ;] img-req-fid outfile-execute
    ELSE
	." file:" picbase# #@ ~~ type
    THEN ;
: .csv-link { d: fn -- }
    ." ![" fn picdesc# #@ .simple-text ." ](file:" fn picbase# #@ type ." )" cr ;
: .media-file ( -- )


    media:url$ basename nip $100 > IF
	." file:" media:localFilePath$ basename type
    ELSE
	media:localFilePath$ nip IF  ." file:" media:url$ basename type
	ELSE  media:url$ .mfile  THEN
    THEN ;
: inline-image ( -- )
    ." ![" media:description$ .simple-text ." ](" .media-file ')' emit cr ;
: .media ( -- )
    comments:media{} ?dup-IF cr .inline-image  THEN ;
: .album ( -- )
    comments:album{} ?dup-IF cr
	." ::album::" cr cr
	.album:media[] $@ over @ .media:url$
	basedir+name pics# #@ d0= IF
	    bounds U+DO
		I @ .inline-image




	    cell +LOOP
	ELSE
	    2drop
	    last# cell+ $@ 5 umin album# #@ bounds U+DO
		I $@ .csv-link
	    cell +LOOP
	THEN

Changes to msg.fs.

481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
	2dup = IF  ."  [otrified] "  addr u startdate@ .ticks  THEN
	U+DO
	    I last# cell+ $[]@
	    2dup dup sigpksize# - /string key| msg:id$ str= IF
		dup u - /string addr u str= IF
		    ."  OTRify #" I u.
		    sig u' I last# cell+ $[]@ replace-sig
		    \ !!Schedule message saving!!
		ELSE
		    ."  [OTRified] #" I u.
		THEN
	    ELSE
		2drop
	    THEN
	LOOP







|







481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
	2dup = IF  ."  [otrified] "  addr u startdate@ .ticks  THEN
	U+DO
	    I last# cell+ $[]@
	    2dup dup sigpksize# - /string key| msg:id$ str= IF
		dup u - /string addr u str= IF
		    ."  OTRify #" I u.
		    sig u' I last# cell+ $[]@ replace-sig
		    save-msgs&
		ELSE
		    ."  [OTRified] #" I u.
		THEN
	    ELSE
		2drop
	    THEN
	LOOP