10
10
div TopicText
11
11
div ImageDiv
12
12
div Mask
13
- pre Branch
14
13
pre Resources
15
14
img BigPic
16
15
img TopImage
29
28
variable CDNPath
30
29
variable Args
31
30
variable Arg
31
+ variable Mode
32
+ variable NClicks
32
33
variable Stories
33
34
variable Themes
34
35
variable Theme
92
93
if portrait set Mobile
93
94
end
94
95
95
- ! attach Branch to `storyteller-branch`
96
- ! put the content of Branch into Value
97
- ! put `https://cdn.jsdelivr.net/gh/easycoder/storyteller@` cat Value into CDNPath
98
- put `https://cdn.jsdelivr.net/gh/easycoder/storyteller@master` into CDNPath
96
+ put `https://cdn.jsdelivr.net/gh/easycoder/storyteller` into CDNPath
99
97
100
98
attach Resources to `storyteller-stories`
101
99
put the content of Resources into Stories
123
121
124
122
create Content in Container
125
123
set style `position` of Content to `absolute`
124
+ set style `height` of Content to `100vh`
126
125
if Mobile
127
126
begin
128
127
create ButtonBar in Content
135
134
end
136
135
create TopicText in Content
137
136
137
+ ! Detect a triple click on the title
138
+ get Mode from storage as `mode`
139
+ put 0 into NClicks
140
+ on click TitleDiv
141
+ begin
142
+ add 1 to NClicks
143
+ if NClicks is 1
144
+ begin
145
+ if Mode is `admin`
146
+ begin
147
+ put empty into Mode
148
+ put 0 into NClicks
149
+ end
150
+ end
151
+ else if NClicks is 3
152
+ begin
153
+ put `admin` into Mode
154
+ put 0 into NClicks
155
+ end
156
+ end
157
+
138
158
json parse url the location as Args
139
159
put property `arg` of Args into Arg
140
160
if Arg is empty
190
210
191
211
! View a record, given its Subject and Topic ids.
192
212
ViewRecord:
193
- if not Mobile scroll TopicText to 0
194
213
rest get Record from Stories cat SID cat `/content.txt?v=` cat now
195
214
or begin
196
215
put `home` into SID
@@ -405,12 +424,18 @@ ViewRecord:
405
424
end
406
425
end
407
426
end
427
+
428
+ wait 20 ticks
429
+ if Mode is `admin` alert `Scroll`
430
+ if Mobile scroll to 0 else scroll TopicText to 0
431
+ ! scroll TopicText to 0 ! This doesn't work on mobile
432
+
408
433
stop
409
434
410
435
! Set up the theme
411
436
SetupTheme:
412
437
get Theme from storage as `theme`
413
- if Theme is empty rest get Theme from Stories cat `theme.txt`
438
+ if Theme is empty rest get Theme from Stories cat `theme.txt?v=` cat now
414
439
if left 1 of Theme is `/`
415
440
begin
416
441
put from 1 of Theme into Theme
@@ -436,11 +461,16 @@ SetupTheme:
436
461
put property `border-t` of Layout into BorderT
437
462
put property `border-b` of Layout into BorderB
438
463
put property `font-scale` of Layout into FontScale
439
- if not Mobile
464
+ if Mobile
440
465
begin
441
- set attribute `src` of MidImage to CDNPath cat `/themes/` cat Theme cat `/mid.jpg`
442
- set attribute `src` of TopImage to CDNPath cat `/themes/` cat Theme cat `/top.jpg`
443
- set attribute `src` of BottomImage to CDNPath cat `/themes/` cat Theme cat `/bottom.jpg`
466
+ multiply FontScale by 3
467
+ divide FontScale by 2
468
+ end
469
+ else
470
+ begin
471
+ set attribute `src` of MidImage to Path cat `/themes/` cat Theme cat `/mid.jpg`
472
+ set attribute `src` of TopImage to Path cat `/themes/` cat Theme cat `/top.jpg`
473
+ set attribute `src` of BottomImage to Path cat `/themes/` cat Theme cat `/bottom.jpg`
444
474
end
445
475
return
446
476
@@ -512,7 +542,6 @@ CreateButtons:
512
542
put `content` into TID
513
543
go to ViewAnotherRecord
514
544
end
515
-
516
545
return
517
546
518
547
! View another record, given the Subject and Topic ids
@@ -730,8 +759,10 @@ ProcessImage:
730
759
add 1 to N
731
760
if Data is not empty
732
761
begin
733
- if Class is not empty put Class cat ` ` into Class
734
- put Class cat from N of Data into Class
762
+ ! Redundant code removed, 27/7/21
763
+ ! if Class is not empty put Class cat ` ` into Class
764
+ ! put Class cat from N of Data into Class
765
+ put from N of Data into Class
735
766
end
736
767
put the position of `!` in Class into N
737
768
if N is not -1
0 commit comments