-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSettings.html
1587 lines (1447 loc) · 81.5 KB
/
Settings.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?
//FOR WHATEVER STRANGE REASON, ON ONE GMAIL ACCOUNT I'M GETTING AN ERROR
//WHEN OPENING THE SETTINGS DIALOG, ABOUT AN UNEXPEXTED 'u' CHARACTER???
//ONLY SEEMS TO HAPPEN WITH THE BIBLEGET ACCOUNT AND NOT OTHER ACCOUNTS
let locale = 'en';
try{ locale = getUserLocale(); }
catch(e){ alertMe("Error: " + e.message + "\r\nFile: " + e.fileName + "\r\nLine: " + e.lineNumber); }
var scriptProperties = PropertiesService.getScriptProperties();
if(scriptProperties.getProperty("languages")===null || scriptProperties.getProperty("versions")===null){
//consoleLog('now setting properties from Settings.html');
setScriptProps();
}
var propLangs = scriptProperties.getProperty("languages");
//consoleLog(propLangs);
languages = JSON.parse(propLangs);
var propVersions = scriptProperties.getProperty("versions");
//consoleLog(propVersions);
var versions = JSON.parse(propVersions);
if(CURRENTSTATE == ADDONSTATE.DEVELOPMENT){ consoleLog('now running getUserProperties from within Settings.html'); }
var userProperties = getUserProperties(true); //will be a pure JSON obj, without any stringified values (nostringify=true)
if(userProperties === false){
//there has been some error in getting or setting properties in the properties service, we will resort to default values to avoid blocking the ui completely
userProperties = DefaultUserProperties;
}
if(CURRENTSTATE == ADDONSTATE.DEVELOPMENT){ consoleLog('getUserProperties has been run from within Settings.html'); }
//DEFINE devicePixelRatio constant useful for drawing the canvas with image of ruler precisely, correctly, sharply
const dPR = 1.0; //a typical screen will have a ratio of 1.0 == 96 dpi
//some lower quality graphics display might have for example a ratio of 0.78125 = 75 dpi
//high retina displays can have a ratio of 2.0 = 192 dpi
//my laptop has 1.25 = 120 dpi
//TODO: my tests however show that on my display 115 dpi is actually closer to 1 physical inch. is it just my display?
// If I compensate for my display, will the compensation work for other displays? Need to do some testing on other displays.
//In any we cannot actually know window.devicePixelRatio at this point, because it is only available to client javascript, so here it doesn't mean much of anything
//we will therefor retrieve this value in the client javascript using window.devicePixelRatio and update both css properties and accordingly!!!
if(CURRENTSTATE == ADDONSTATE.DEVELOPMENT){ consoleLog('left and right indent have been set based on userproperties in Settings.html'); }
var wrap1 = '', wrap2 = '', wrap3 = '', wrap4 = '';
switch(userProperties.LayoutPrefs.BIBLEVERSIONWRAP){
case BGET.WRAP.NONE:
break;
case BGET.WRAP.PARENTHESES:
wrap1 = '(';
wrap2 = ')';
break;
case BGET.WRAP.BRACKETS:
wrap1 = '[';
wrap2 = ']';
break;
}
switch(userProperties.LayoutPrefs.BOOKCHAPTERWRAP){
case BGET.WRAP.NONE:
break;
case BGET.WRAP.PARENTHESES:
wrap3 = '(';
wrap4 = ')';
break;
case BGET.WRAP.BRACKETS:
wrap3 = '[';
wrap4 = ']';
break;
}
if(CURRENTSTATE == ADDONSTATE.DEVELOPMENT){
consoleLog('Settings.html: wraps have been prepared for bibleversion (wrap1 = '+wrap1+',wrap2 = '+wrap2+') and bookchapter (wrap3 = '+wrap3+',wrap4 = '+wrap4+') based on user preferences (userProperties.LayoutPrefs.BIBLEVERSIONWRAP = '+userProperties.LayoutPrefs.BIBLEVERSIONWRAP+') ');
consoleLog('typeof userProperties.LayoutPrefs.BIBLEVERSIONWRAP = '+(typeof userProperties.LayoutPrefs.BIBLEVERSIONWRAP)+', typeof BGET.WRAP.PARENTHESES = '+(typeof BGET.WRAP.PARENTHESES));
}
let bkChptr1Sam213 = '',
bkChptrPs11412 = '';
switch(userProperties.LayoutPrefs.BOOKCHAPTERFORMAT){
case BGET.FORMAT.BIBLELANG:
bkChptr1Sam213 = "I Samuelis 2";
bkChptrPs11412 = "Psalmorum 114";
break;
case BGET.FORMAT.BIBLELANGABBREV:
bkChptr1Sam213 = "ISam 2";
bkChptrPs11412 = "Ps 114";
break;
case BGET.FORMAT.USERLANG:
bkChptr1Sam213 = __('ISamuelis2',locale);
bkChptrPs11412 = __('Psalmorum114',locale);
break;
case BGET.FORMAT.USERLANGABBREV:
bkChptr1Sam213 = __('ISam2',locale);
bkChptrPs11412 = __('Ps114',locale);
break;
}
if(userProperties.LayoutPrefs.BOOKCHAPTERFULLQUERY){
bkChptr1Sam213 += ((locale=='en' ? ':' : ',') + '1-3');
bkChptrPs11412 += ((locale=='en' ? ':' : ',') + '1-2');
}
let ISam2_1 = 'Et oravit Anna et ait: Exsultavit cor meum in Domino, exaltatum est cornu meum in Deo meo; dilatatum est os meum super inimicos meos, quoniam laetata sum in salutari tuo.';
let ISam2_2 = 'Non est sanctus ut est Dominus; neque enim est alius extra te, et non est fortis sicut Deus noster.';
let ISam2_3 = 'Nolite multiplicare loqui sublimia gloriantes. Recedant superba de ore vestro, quia Deus scientiarum Dominus est, et ab eo ponderantur actiones.';
let Ps114_1 = 'In exitu Israel de Aegypto, domus Iacob de populo barbaro,';
let Ps114_2 = 'factus est Iuda sanctuarium eius, Israel potestas eius.';
var nonUniqueStr = userProperties.ParagraphStyles.FONT_FAMILY;
nonUniqueStr += bkChptr1Sam213;
nonUniqueStr += bkChptrPs11412;
nonUniqueStr += ISam2_1;
nonUniqueStr += ISam2_2;
nonUniqueStr += ISam2_3;
nonUniqueStr += Ps114_1;
nonUniqueStr += Ps114_2;
//consoleLog(nonUniqueStr);
var UniqueStr = makeUnique(nonUniqueStr);
if(CURRENTSTATE == ADDONSTATE.DEVELOPMENT){
consoleLog('UniqueStr has been set based on pagraphstyles.font_family in Settings.html');
}
var PreviewBox = '<fieldset class="fieldset-results"><legend><b>' + __('Preview',locale) + '</b></legend>';
PreviewBox += '<canvas class="previewRuler"></canvas>';
PreviewBox += '<p class="bibleversion showtop" style="display:'+(userProperties.LayoutPrefs.SHOWBIBLEVERSION==BGET.VISIBILITY.SHOW && userProperties.LayoutPrefs.BIBLEVERSIONPOSITION==BGET.POS.TOP?'block':'none')+';"><span class="bcWrap">' + wrap1 + '</span>NVBSE<span class="bcWrap">' + wrap2 + '</span></p>';
PreviewBox += '<div class="bookChapterWrapper">';
PreviewBox += (userProperties.LayoutPrefs.BOOKCHAPTERPOSITION==BGET.POS.TOP) ? '<span class="bookchapter" style="display:block;"><span class="bcWrap">' + wrap3 + '</span><span class="bcText1Sam">' + bkChptr1Sam213 + '</span><span class="bcWrap">' + wrap4 + '</span></span>' : '';
PreviewBox += '<div class="liveview-quote">';
PreviewBox += '<span class="versenumber" style="display:'+(userProperties.LayoutPrefs.SHOWVERSENUMBERS===BGET.VISIBILITY.SHOW ? 'inline' : 'none')+';">1</span><span class="versetext">'+ ISam2_1 +'</span>';
PreviewBox += '<span class="versenumber" style="display:'+(userProperties.LayoutPrefs.SHOWVERSENUMBERS===BGET.VISIBILITY.SHOW ? 'inline' : 'none')+';">2</span><span class="versetext">'+ ISam2_2 +'</span>';
PreviewBox += '<span class="versenumber" style="display:'+(userProperties.LayoutPrefs.SHOWVERSENUMBERS===BGET.VISIBILITY.SHOW ? 'inline' : 'none')+';">3</span><span class="versetext">'+ ISam2_3 +'</span>';
PreviewBox += (userProperties.LayoutPrefs.BOOKCHAPTERPOSITION==BGET.POS.BOTTOMINLINE) ? '<span class="bookchapter" style="margin-left:6px;"><span class="bcWrap">' + wrap3 + '</span><span class="bcText1Sam">' + bkChptr1Sam213 + '</span><span class="bcWrap">' + wrap4 + '</span></span>' : '';
PreviewBox += '</div>';
PreviewBox += (userProperties.LayoutPrefs.BOOKCHAPTERPOSITION==BGET.POS.BOTTOM) ? '<span class="bookchapter" style="display:block;"><span class="bcWrap">' + wrap3 + '</span><span class="bcText1Sam">' + bkChptr1Sam213 + '</span><span class="bcWrap">' + wrap4 + '</span></span>' : '';
PreviewBox += '</div>';
PreviewBox += '<div class="bookChapterWrapper">';
PreviewBox += (userProperties.LayoutPrefs.BOOKCHAPTERPOSITION==BGET.POS.TOP) ? '<span class="bookchapter" style="display:block;"><span class="bcWrap">' + wrap3 + '</span><span class="bcTextPs">' + bkChptrPs11412 + '</span><span class="bcWrap">' + wrap4 + '</span></span>' : '';
PreviewBox += '<div class="liveview-quote">';
PreviewBox += '<span class="versenumber" style="display:'+(userProperties.LayoutPrefs.SHOWVERSENUMBERS===BGET.VISIBILITY.SHOW ? 'inline' : 'none')+';">1</span><span class="versetext">'+ Ps114_1 +'</span>';
PreviewBox += '<span class="versenumber" style="display:'+(userProperties.LayoutPrefs.SHOWVERSENUMBERS===BGET.VISIBILITY.SHOW ? 'inline' : 'none')+';">2</span><span class="versetext">factus est Iuda sanctuarium eius, Israel potestas eius.</span>';
PreviewBox += (userProperties.LayoutPrefs.BOOKCHAPTERPOSITION==BGET.POS.BOTTOMINLINE) ? '<span class="bookchapter" style="margin-left:6px;"><span class="bcWrap">' + wrap3 + '</span><span class="bcTextPs">' + bkChptrPs11412 + '</span><span class="bcWrap">' + wrap4 + '</span></span>' : '';
PreviewBox += '</div>';
PreviewBox += (userProperties.LayoutPrefs.BOOKCHAPTERPOSITION==BGET.POS.BOTTOM) ? '<span class="bookchapter" style="display:block;"><span class="bcWrap">' + wrap3 + '</span><span class="bcTextPs">' + bkChptrPs11412 + '</span><span class="bcWrap">' + wrap4 + '</span></span>' : '';
PreviewBox += '</div>';
PreviewBox += '<p class="bibleversion showbottom" style="display:'+(userProperties.LayoutPrefs.SHOWBIBLEVERSION===BGET.VISIBILITY.SHOW && userProperties.LayoutPrefs.BIBLEVERSIONPOSITION===BGET.POS.BOTTOM?'block':'none')+';"><span class="bcWrap">' + wrap1 + '</span>NVBSE<span class="bcWrap">' + wrap2 + '</span></p>';
PreviewBox += '</fieldset>';
if(CURRENTSTATE == ADDONSTATE.DEVELOPMENT){
consoleLog('starting HTML output in Settings.html');
}
?>
<!DOCTYPE html>
<head>
<meta charset="UTF-8">
<link id="gfFontFamily" href="https://fonts.googleapis.com/css?family=<?!= userProperties.ParagraphStyles.FONT_FAMILY ?>&text=<?!= UniqueStr ?>" rel="stylesheet" />
<?!= include("Stylesheet"); ?>
<style>
.fieldset-results{
border: 1px groove LightBlue;
border-radius:6px;
/*padding:0px 8px 3px 6px;*/
/*background-color:#EEEEFF;*/
min-height: 60px;
max-height: 250px;
overflow-y:auto;
text-align: center;
}
.fieldset-results .bibleversion, .fieldset-results .bookChapterWrapper { /* .bookChapterWrapper wraps .bookchapter and .liveview-quote*/
box-sizing: border-box;
margin: 0px auto;
padding-left: 35px;
padding-right:35px;
}
.bibleversion, .bookchapter {
font-size: <?!= userProperties.BookChapterStyles.FONT_SIZE ?>px;
font-weight: <? if(userProperties.BookChapterStyles.BOLD){ ?>bold<? }else{ ?>normal<?} ?>;
font-style: <? if(userProperties.BookChapterStyles.ITALIC){ ?>italic<? }else{ ?>normal<?} ?>;
text-decoration:<? if(!userProperties.BookChapterStyles.UNDERLINE && !userProperties.BookChapterStyles.STRIKETHROUGH){ ?> none<? } else{ if (userProperties.BookChapterStyles.UNDERLINE){?> underline<?} if(userProperties.BookChapterStyles.STRIKETHROUGH){?> line-through<?} }?>;
color: <?!= userProperties.BookChapterStyles.FOREGROUND_COLOR ?>;
background-color: <?!= userProperties.BookChapterStyles.BACKGROUND_COLOR ?>;
padding-top:0px;
padding-bottom: 3px;
font-family: <?!= userProperties.ParagraphStyles.FONT_FAMILY ?>;
position: relative;
}
.bibleversion{
text-align: <?!=userProperties.LayoutPrefs.BIBLEVERSIONALIGNMENT?>;
}
.bookchapter {
text-align: <?!=userProperties.LayoutPrefs.BOOKCHAPTERALIGNMENT?>;
top: <?!= userProperties.BookChapterStyles.VALIGN==BGET.VALIGN.NORMAL ? 0 : (userProperties.BookChapterStyles.VALIGN==BGET.VALIGN.SUPERSCRIPT ? -4 : 4) ?>px;
}
.liveview-quote { /* wraps .versenumber and .versetext */
line-height: <?!= userProperties.ParagraphStyles.LINEHEIGHT?>em;
text-align: <?!=userProperties.ParagraphStyles.PARAGRAPHALIGN?>;
padding-top: 3px;
padding-bottom: 3px;
font-family: <?!= userProperties.ParagraphStyles.FONT_FAMILY ?>;
}
.versenumber{
font-size: <?!= userProperties.VerseNumberStyles.FONT_SIZE ?>px;
font-weight: <? if(userProperties.VerseNumberStyles.BOLD){ ?>bold<? }else{ ?>normal<? } ?>;
font-style: <? if(userProperties.VerseNumberStyles.ITALIC){ ?>italic<? }else{ ?>normal<?} ?>;
text-decoration:<? if(!userProperties.VerseNumberStyles.UNDERLINE && !userProperties.VerseNumberStyles.STRIKETHROUGH){ ?> none<? } else{ if (userProperties.VerseNumberStyles.UNDERLINE){?> underline<?} if(userProperties.VerseNumberStyles.STRIKETHROUGH){?> line-through<?} }?>;
color: <?!= userProperties.VerseNumberStyles.FOREGROUND_COLOR ?>;
background-color: <?!= userProperties.VerseNumberStyles.BACKGROUND_COLOR ?>;
position: relative;
top: <?!= userProperties.VerseNumberStyles.VALIGN==BGET.VALIGN.NORMAL ? 0 : (userProperties.VerseNumberStyles.VALIGN==BGET.VALIGN.SUPERSCRIPT ? -4 : 4) ?>px;
padding-left: 3px;
}
.versetext{
font-size: <?!= userProperties.VerseTextStyles.FONT_SIZE ?>px;
font-weight: <? if(userProperties.VerseTextStyles.BOLD){ ?>bold<? }else{ ?>normal<? } ?>;
font-style: <? if(userProperties.VerseTextStyles.ITALIC){ ?>italic<? }else{ ?>normal<?} ?>;
text-decoration:<? if(!userProperties.VerseTextStyles.UNDERLINE && !userProperties.VerseTextStyles.STRIKETHROUGH){ ?> none<? } else{ if (userProperties.VerseTextStyles.UNDERLINE){?> underline<?} if(userProperties.VerseTextStyles.STRIKETHROUGH){?> line-through<?} }?>;
color: <?!= userProperties.VerseTextStyles.FOREGROUND_COLOR ?>;
background-color: <?!= userProperties.VerseTextStyles.BACKGROUND_COLOR ?>;
position: relative;
top: <?!= userProperties.VerseTextStyles.VALIGN==BGET.VALIGN.NORMAL ? 0 : (userProperties.VerseTextStyles.VALIGN==BGET.VALIGN.SUPERSCRIPT ? -4 : 4) ?>px;
}
table, td, a {
color: #000;
font: normal normal 12px Verdana, Geneva, Arial, Helvetica, sans-serif;
}
/* define height and width of scrollable area. Add 16px to width for scrollbar */
div.tableContainer {
border: 1px solid #963;
height: <? if(Object.keys(versions).length > 3){ ?>108<? }else{ ?>85<? } ?>px;
overflow: auto;
width: 656px
}
/* Reset overflow value to hidden for all non-IE browsers. */
html>body div.tableContainer {
overflow: hidden;
width: 656px
}
/* define width of table. IE browsers only */
div.tableContainer table {
float: left;
width: 637px
}
/* define width of table. Add 16px to width for scrollbar. */
/* All other non-IE browsers. */
html>body div.tableContainer table {
width: 656px
}
/* set table header to a fixed position. WinIE 6.x only */
/* In WinIE 6.x, any element with a position property set to relative and is a child of */
/* an element that has an overflow property set, the relative value translates into fixed. */
/* Ex: parent element DIV with a class of tableContainer has an overflow property set to auto */
thead.fixedHeader tr {
position: relative;
}
/* set THEAD element to have block level attributes. All other non-IE browsers */
/* this enables overflow to work on TBODY element. All other non-IE, non-Mozilla browsers */
html>body thead.fixedHeader tr {
display: block;
}
/* make the TH elements pretty */
thead.fixedHeader th {
background: #C96;
border-left: 1px solid #EB8;
border-right: 1px solid #B74;
border-top: 1px solid #EB8;
font-weight: normal;
padding: 4px 3px;
text-align: left;
}
/* make the A elements pretty. makes for nice clickable headers */
thead.fixedHeader a, thead.fixedHeader a:link, thead.fixedHeader a:visited {
color: #FFF;
display: block;
text-decoration: none;
width: 100%;
}
/* make the A elements pretty. makes for nice clickable headers */
/* WARNING: swapping the background on hover may cause problems in WinIE 6.x */
thead.fixedHeader a:hover {
color: #FFF;
display: block;
text-decoration: underline;
width: 100%;
}
/* define the table content to be scrollable */
/* set TBODY element to have block level attributes. All other non-IE browsers */
/* this enables overflow to work on TBODY element. All other non-IE, non-Mozilla browsers */
/* induced side effect is that child TDs no longer accept width: auto */
tbody.scrollContent {
display: block;
height: <? if(Object.size(versions) > 3){ ?>85<? }else{ ?>62<? } ?>px;
overflow: auto;
width: 100%;
}
/* make TD elements pretty. Provide alternating classes for striping the table */
/* http://www.alistapart.com/articles/zebratables/ */
tbody.scrollContent td, tbody.scrollContent tr.normalRow td {
background: #FFF;
border-bottom: none;
border-left: none;
border-right: 1px solid #CCC;
border-top: 1px solid #DDD;
padding: 2px 3px 3px 4px
}
tbody.scrollContent tr.alternateRow td {
background: #EEE;
border-bottom: none;
border-left: none;
border-right: 1px solid #CCC;
border-top: 1px solid #DDD;
padding: 2px 3px 3px 4px
}
/* define width of TH elements: 1st, 2nd, and 3rd respectively. */
/* Add 16px to last TH for scrollbar padding. All other non-IE browsers. */
/* http://www.w3.org/TR/REC-CSS2/selector.html#adjacent-selectors */
html>body thead.fixedHeader th {
width: 150px
}
html>body thead.fixedHeader th + th {
width: 400px
}
html>body thead.fixedHeader th + th + th {
width: 106px
}
/* define width of TD elements: 1st, 2nd, and 3rd respectively. */
/* All other non-IE browsers. */
/* http://www.w3.org/TR/REC-CSS2/selector.html#adjacent-selectors */
html>body tbody.scrollContent td {
width: 151px
}
html>body tbody.scrollContent td + td {
width: 400px
}
html>body tbody.scrollContent td + td + td {
width: 105px
}
.custom-combobox {
position: relative;
display: inline-block;
right: 2px;
top: 0.5px;
}
.custom-combobox-toggle {
position: absolute;
top: 0;
bottom: 0;
margin-left: -1px;
padding: 0;
}
.custom-combobox-input {
margin: 0;
padding: 7.5px 10px;
background: -webkit-linear-gradient(top, #f5f5f5, #f1f1f1);
background-position: 95% 50%;
background-repeat: no-repeat;
border: 2px inset #ccc;
}
.flexcontainer {
display: flex;
flex-direction: row;
justify-content: space-between;
}
.flexcontainer .flexitem.bibleget-font-family {
min-width: 215px;
}
.bget-fontfamily-combobox {
max-width: 245px;
}
.flexcontainerX {
display: flex;
flex-direction: row;
justify-content: space-between;
}
.flexcontainerV {
display: flex;
flex-direction: column;
border-right: 1px groove White;
}
.flexcontainerV:last-child {
border-right: none;
}
.flexcontainerB {
display: flex;
flex-direction: row;
justify-content: center;
}
.flexitemB {
text-align: center;
font-size: .7em;
padding: 0 3px;
}
.ctrlGrpLbl {
font-weight: bold;
}
.centered {
text-align: center;
font-weight: bold;
height: 3em;
}
.flexitemB .ui-controlgroup-vertical .ui-controlgroup-item {
text-align: center;
}
/* override some jquery ui stylings to fix things up to the pixel (or fraction of a pixel!) */
ul.ui-autocomplete.ui-widget {
max-height: 300px;
overflow-y: scroll;
overflow-x: hidden;
}
span.ui-checkboxradio-icon { display: none; }
.ui-button {
line-height: 1.3em;
min-height: 1.3em;
}
.ui-button.ui-widget.ui-checkboxradio-radio-label.ui-checkboxradio-checked.ui-state-active.ui-checkboxradio-label.ui-controlgroup-item { position:relative; top: .3px; }
.ui-selectmenu-menu.ui-front.ui-selectmenu-open li.ui-menu-item div.ui-menu-item-wrapper.ui-state-active {
background-image: none;
background-color: #1a73e8;
color: White;
}
.ui-widget {
font-size: 1em;
}
#rightIndentIncreaseBtn .material-icons,#rightIndentDecreaseBtn .material-icons {
transform: scale(-1, 1);
}
#otherSettingsTab1 {
margin-top: 6px;
justify-content: space-around;
}
#otherSettingsTab1 .ui-button {
font-size: .8em;
}
#messageToUser {
border: 1px solid Gray;
background-color: pink;
color: Gray;
padding: 12px;
}
<?
if(CURRENTSTATE == ADDONSTATE.DEVELOPMENT){
consoleLog('styles in head of document have been set in Settings.html');
}
?>
</style>
</head>
<body>
<div id="messageToUser"></div>
<input id="idAccountOfEffectiveUsr" type="hidden" style="display:none" value="<?!= Session.getEffectiveUser().getEmail(); ?>"/>
<script>
let failedAcctTest = function(rtrn) {
$('.spinner').hide();
let usrWhoLoaded = document.getElementById('idAccountOfEffectiveUsr').textContent;
if (usrWhoLoaded !== rtrn) {
document.getElementById('messageToUser').textContent = "<?=__('The Add-on loaded under the account:',locale)?>" + " <" + usrWhoLoaded + ">" +
"\n\n" + "<?=__('However you are also logged into another account in this browser:',locale)?>" + " <" + rtrn + ">" +
"\n\n" + "<?=__('Being logged into multiple accounts in the same browser session causes authorization errors.',locale)?>" +
"\n\n" + "<?=__('In order to proceed, you must either log out of all accounts, and log back into the account that installed the add-on, or open an incognito window, log in with the account that installed the add-on and use the add-on from that window.',locale)?>" +
"\n\n" + "<?=__('The best practice to avoid these problems is to login to your accounts using the browser\'s own account manager. That way you have a different browser session for each account that you would like to use.',locale)?>";
}
},
successAcctTest = function(rtrn) {
$('#messageToUser').hide();
};
</script>
<div class="spinner lds-ring" id="spinner-gif"><div></div><div></div><div></div><div></div></div>
<div class="spinner" id="spinner-bg"></div>
<input type="hidden" id="activetab" value="<?!=activetab?>" />
<div id="tabs">
<ul>
<li><a href="#tab1"><?=__('Text Formatting',locale)?></a></li>
<li><a href="#tab2"><?=__('Preferred Layout',locale)?></a></li>
<li><a href="#tab3"><?=__('Versions and Languages',locale)?></a></li>
</ul>
<!-- BEGIN TAB 1-->
<div id="tab1">
<div id="accordion">
<h3><b><?=__('Paragraph Styles',locale)?></b></h3>
<div class="toolbar ui-widget-header ui-corner-bottom flexcontainer">
<div class="flexitem">
<span class="buttonset" title="<?!=__('Left Indent',locale)?>">
<button id="leftIndentDecreaseBtn" class="ui-button indentbtn" title="<?!=__('Left Indent decrease',locale)?>"><i class="material-icons md-18">format_indent_decrease</i></button>
<button id="leftIndentIncreaseBtn" class="ui-button indentbtn" title="<?!=__('Left Indent increase',locale)?>"><i class="material-icons md-18">format_indent_increase</i></button>
</span>
</div>
<div class="flexitem">
<span id="paragraphalign" class="buttonset">
<input type="radio" id="paragraphalign-left" value="<?!=BGET.ALIGN.LEFT?>" name="paragraphalign" <? if (userProperties.ParagraphStyles.PARAGRAPHALIGN==BGET.ALIGN.LEFT) { ?>CHECKED<? } ?>><label for="paragraphalign-left" title="<?!=__('ALIGN LEFT',locale)?>"><i class="material-icons md-18">format_align_left</i></label>
<input type="radio" id="paragraphalign-center" value="<?!=BGET.ALIGN.CENTER?>" name="paragraphalign"<? if (userProperties.ParagraphStyles.PARAGRAPHALIGN==BGET.ALIGN.CENTER) { ?>CHECKED<? } ?>><label for="paragraphalign-center" title="<?!=__('ALIGN CENTER',locale)?>"><i class="material-icons md-18">format_align_center</i></label>
<input type="radio" id="paragraphalign-right" value="<?!=BGET.ALIGN.RIGHT?>" name="paragraphalign"<? if (userProperties.ParagraphStyles.PARAGRAPHALIGN==BGET.ALIGN.RIGHT) { ?>CHECKED<? } ?>><label for="paragraphalign-right" title="<?!=__('ALIGN RIGHT',locale)?>"><i class="material-icons md-18">format_align_right</i></label>
<input type="radio" id="paragraphalign-justify" value="<?!=BGET.ALIGN.JUSTIFY?>" name="paragraphalign"<? if (userProperties.ParagraphStyles.PARAGRAPHALIGN==BGET.ALIGN.JUSTIFY) { ?>CHECKED<? } ?>><label for="paragraphalign-justify" title="<?!=__('Justify',locale).toUpperCase()?>"><i class="material-icons md-18">format_align_justify</i></label>
</span>
</div>
<div class="flexitem bibleget-font-family">
<select id="bibleget-font-family" class="bget-fontfamily-combobox" title="<?!=__('FONT',locale)?>"></select>
</div>
<div class="flexitem">
<span id="lineheightBtn" class="ui-button" title="<?!=__('Lineheight',locale).toUpperCase()?>"><i class="material-icons md-18">format_line_spacing</i></span>
<select id="lineheight-quote" class="selectmenu">
<option value="1.0"<? if(userProperties.ParagraphStyles.LINEHEIGHT=="1.0"){ ?> SELECTED<? } ?>><?!=__('Single',locale)?> 1.0</option>
<option value="1.15"<? if(userProperties.ParagraphStyles.LINEHEIGHT=="1.15"){ ?> SELECTED<? } ?>>1.15</option>
<option value="1.5"<? if(userProperties.ParagraphStyles.LINEHEIGHT=="1.5"){ ?> SELECTED<? } ?>>1½</option>
<option value="2.0"<? if(userProperties.ParagraphStyles.LINEHEIGHT=="2.0"){ ?> SELECTED<? } ?>><?!=__('Double',locale)?> 2.0</option>
</select>
</div>
<div class="flexitem">
<span class="buttonset" title="<?!=__('Right Indent',locale)?>">
<button id="rightIndentIncreaseBtn" class="ui-button indentbtn" title="<?!=__('Right Indent increase',locale)?>"><i class="material-icons md-18">format_indent_increase</i></button>
<button id="rightIndentDecreaseBtn" class="ui-button indentbtn" title="<?!=__('Right Indent decrease',locale)?>"><i class="material-icons md-18">format_indent_decrease</i></button>
</span>
</div>
</div>
<h3><b><?!=__('Book / Chapter Format',locale)?></b></h3>
<div class="toolbar ui-widget-header ui-corner-bottom">
<div>
<span id="bookchapterstyle" class="buttonset textstyles">
<input type="checkbox" id="BookChapterStyles-<?!=BGET.TEXTSTYLE.BOLD?>" value="<?!=BGET.TEXTSTYLE.BOLD?>" name="BookChapterStyles-<?!=BGET.TEXTSTYLE.BOLD?>" <? if (userProperties.BookChapterStyles.BOLD) { ?>CHECKED<? } ?>><label for="BookChapterStyles-<?!=BGET.TEXTSTYLE.BOLD?>" title="<?!=__("BOLD",locale)?>"><b><span><?!=__("B",locale)?></span></b></label>
<input type="checkbox" id="BookChapterStyles-<?!=BGET.TEXTSTYLE.ITALIC?>" value="<?!=BGET.TEXTSTYLE.ITALIC?>" name="BookChapterStyles-<?!=BGET.TEXTSTYLE.ITALIC?>" <? if (userProperties.BookChapterStyles.ITALIC) { ?>CHECKED<? } ?>><label for="BookChapterStyles-<?!=BGET.TEXTSTYLE.ITALIC?>" title="<?!=__("ITALIC",locale)?>"><b><i><span><?!=__("I",locale)?></span></i></b></label>
<input type="checkbox" id="BookChapterStyles-<?!=BGET.TEXTSTYLE.UNDERLINE?>" value="<?!=BGET.TEXTSTYLE.UNDERLINE?>" name="BookChapterStyles-<?!=BGET.TEXTSTYLE.UNDERLINE?>" <? if (userProperties.BookChapterStyles.UNDERLINE) { ?>CHECKED<? } ?>><label for="BookChapterStyles-<?!=BGET.TEXTSTYLE.UNDERLINE?>" title="<?!=__("UNDERLINE",locale)?>"><b><u><span><?!=__("U",locale)?></span></u></b></label>
<input type="checkbox" id="BookChapterStyles-<?!=BGET.TEXTSTYLE.STRIKETHROUGH?>" value="<?!=BGET.TEXTSTYLE.STRIKETHROUGH?>" name="BookChapterStyles-<?!=BGET.TEXTSTYLE.STRIKETHROUGH?>" <? if (userProperties.BookChapterStyles.STRIKETHROUGH) { ?>CHECKED<? } ?>><label for="BookChapterStyles-<?!=BGET.TEXTSTYLE.STRIKETHROUGH?>" title="<?!=__("STRIKETHROUGH",locale)?>"><b><del><span><?!=__("S",locale)?></span></del></b></label>
</span>
<span id="bookchapteralignment" class="buttonset">
<input type="radio" id="bookchapter-normal" value="<?!=BGET.VALIGN.NORMAL?>" name="bookchapteralignment" <? if (userProperties.BookChapterStyles.VALIGN==BGET.VALIGN.NORMAL) { ?>CHECKED<? } ?>><label for="bookchapter-normal" title="<?!=__("NORMAL",locale)?>"><span><b>X</b></span></label>
<input type="radio" id="bookchapter-superscript" value="<?!=BGET.VALIGN.SUPERSCRIPT?>" name="bookchapteralignment"<? if (userProperties.BookChapterStyles.VALIGN==BGET.VALIGN.SUPERSCRIPT) { ?>CHECKED<? } ?>><label for="bookchapter-superscript" title="<?!=__("SUPERSCRIPT",locale)?>"><span><b>X</b><b style="position: relative; top: -0.8em; font-size: 50%;">2</b></span></label>
<input type="radio" id="bookchapter-subscript" value="<?!=BGET.VALIGN.SUBSCRIPT?>" name="bookchapteralignment"<? if (userProperties.BookChapterStyles.VALIGN==BGET.VALIGN.SUBSCRIPT) { ?>CHECKED<? } ?>><label for="bookchapter-subscript" title="<?!=__("SUBSCRIPT",locale)?>"><span><b>X</b><b style="position: relative; top: 0.2em; font-size: 50%;">2</b></span></label>
</span>
<select id="bookchapter-fontsize" name="bookchapter-fontsize" class="fontsizes gapp-addon" title="<?!=__("FONT SIZE",locale)?>">
<? var ops=[8,9,10,11,12,14,18,24,30,36,48,60,72,96];
for(var i=0;i<ops.length;i++){ ?>
<option value=<?!= ops[i] ?><? if(userProperties.BookChapterStyles.FONT_SIZE == ops[i]){ ?> SELECTED<? } ?>><?= ops[i] ?></option>
<? } ?>
</select>
<input type="color" id="bookchapter-color" value="<?!= userProperties.BookChapterStyles.FOREGROUND_COLOR ?>" title="<?!=__("TEXT COLOR",locale)?>" />
<input type="color" id="bookchapter-bgcolor" value="<?!= userProperties.BookChapterStyles.BACKGROUND_COLOR ?>" title="<?!=__("HIGHLIGHT COLOR",locale)?>" />
</div>
</div>
<h3><b><?!=__('Verse Number Format',locale)?></b></h3>
<div class="toolbar ui-widget-header ui-corner-bottom">
<div>
<span id="versenumberstyle" class="buttonset textstyles">
<input type="checkbox" id="VerseNumberStyles-<?!=BGET.TEXTSTYLE.BOLD?>" value="<?!=BGET.TEXTSTYLE.BOLD?>" name="VerseNumberStyles-<?!=BGET.TEXTSTYLE.BOLD?>" <? if(userProperties.VerseNumberStyles.BOLD){ ?>CHECKED<? } ?>><label for="VerseNumberStyles-<?!=BGET.TEXTSTYLE.BOLD?>" title="<?!=__("BOLD",locale)?>"><b><span><?!=__("B",locale)?></span></b></label>
<input type="checkbox" id="VerseNumberStyles-<?!=BGET.TEXTSTYLE.ITALIC?>" value="<?!=BGET.TEXTSTYLE.ITALIC?>" name="VerseNumberStyles-<?!=BGET.TEXTSTYLE.ITALIC?>" <? if(userProperties.VerseNumberStyles.ITALIC){ ?>CHECKED<? } ?>><label for="VerseNumberStyles-<?!=BGET.TEXTSTYLE.ITALIC?>" title="<?!=__("ITALIC",locale)?>"><b><i><span><?!=__("I",locale)?></span></i></b></label>
<input type="checkbox" id="VerseNumberStyles-<?!=BGET.TEXTSTYLE.UNDERLINE?>" value="<?!=BGET.TEXTSTYLE.UNDERLINE?>" name="VerseNumberStyles-<?!=BGET.TEXTSTYLE.UNDERLINE?>" <? if(userProperties.VerseNumberStyles.UNDERLINE){ ?>CHECKED<? } ?>><label for="VerseNumberStyles-<?!=BGET.TEXTSTYLE.UNDERLINE?>" title="<?!=__("UNDERLINE",locale)?>"><b><u><span><?!=__("U",locale)?></span></u></b></label>
<input type="checkbox" id="VerseNumberStyles-<?!=BGET.TEXTSTYLE.STRIKETHROUGH?>" value="<?!=BGET.TEXTSTYLE.STRIKETHROUGH?>" name="VerseNumberStyles-<?!=BGET.TEXTSTYLE.STRIKETHROUGH?>" <? if (userProperties.VerseNumberStyles.STRIKETHROUGH) { ?>CHECKED<? } ?>><label for="VerseNumberStyles-<?!=BGET.TEXTSTYLE.STRIKETHROUGH?>" title="<?!=__("STRIKETHROUGH",locale)?>"><b><del><span><?!=__("S",locale)?></span></del></b></label>
</span>
<span id="versenumberalignment" class="buttonset">
<input type="radio" id="versenumber-normal" value="<?!=BGET.VALIGN.NORMAL?>" name="versenumberalignment" <? if(userProperties.VerseNumberStyles.VALIGN==BGET.VALIGN.NORMAL){ ?>CHECKED<? } ?>><label for="versenumber-normal" title="<?!=__("NORMAL",locale)?>"><span><b>X</b></span></label>
<input type="radio" id="versenumber-superscript" value="<?!=BGET.VALIGN.SUPERSCRIPT?>" name="versenumberalignment" <? if(userProperties.VerseNumberStyles.VALIGN==BGET.VALIGN.SUPERSCRIPT){ ?>CHECKED<? } ?>><label for="versenumber-superscript" title="<?!=__("SUPERSCRIPT",locale)?>"><span><b>X</b><b style="position: relative; top: -0.8em; font-size: 50%;">2</b></span></label>
<input type="radio" id="versenumber-subscript" value="<?!=BGET.VALIGN.SUBSCRIPT?>" name="versenumberalignment" <? if(userProperties.VerseNumberStyles.VALIGN==BGET.VALIGN.SUBSCRIPT){ ?>CHECKED<? } ?>><label for="versenumber-subscript" title="<?!=__("SUBSCRIPT",locale)?>"><span><b>X</b><b style="position: relative; top: 0.2em; font-size: 50%;">2</b></span></label>
</span>
<select id="versenumber-fontsize" name="versenumber-fontsize" class="fontsizes gapp-addon" title="<?!=__("FONT SIZE",locale)?>">
<? var ops=[8,9,10,11,12,14,18,24,30,36,48,60,72,96];
for(var i=0;i<ops.length;i++){ ?>
<option value=<?= ops[i] ?><? if(userProperties.VerseNumberStyles.FONT_SIZE == ops[i]){ ?> SELECTED<? } ?>><?= ops[i] ?></option>
<? } ?>
</select>
<input type="color" id="versenumber-color" value="<?!= userProperties.VerseNumberStyles.FOREGROUND_COLOR ?>" title="<?!=__("TEXT COLOR",locale)?>" />
<input type="color" id="versenumber-bgcolor" value="<?!= userProperties.VerseNumberStyles.BACKGROUND_COLOR ?>" title="<?!=__("HIGHLIGHT COLOR",locale)?>" />
</div>
</div>
<h3><b><?!=__('Verse Text Format',locale)?></b></h3>
<div class="toolbar ui-widget-header ui-corner-bottom">
<div>
<span id="versetextstyle" class="buttonset textstyles">
<input type="checkbox" id="VerseTextStyles-<?!=BGET.TEXTSTYLE.BOLD?>" value="<?!=BGET.TEXTSTYLE.BOLD?>" name="VerseTextStyles-<?!=BGET.TEXTSTYLE.BOLD?>" <? if(userProperties.VerseTextStyles.BOLD){ ?>CHECKED<? } ?>><label for="VerseTextStyles-<?!=BGET.TEXTSTYLE.BOLD?>" title="<?!=__("BOLD",locale)?>"><b><span><?!=__("B",locale)?></span></b></label>
<input type="checkbox" id="VerseTextStyles-<?!=BGET.TEXTSTYLE.ITALIC?>" value="<?!=BGET.TEXTSTYLE.ITALIC?>" name="VerseTextStyles-<?!=BGET.TEXTSTYLE.ITALIC?>" <? if(userProperties.VerseTextStyles.ITALIC){ ?>CHECKED<? } ?>><label for="VerseTextStyles-<?!=BGET.TEXTSTYLE.ITALIC?>" title="<?!=__("ITALIC",locale)?>"><b><i><span><?!=__("I",locale)?></span></i></b></label>
<input type="checkbox" id="VerseTextStyles-<?!=BGET.TEXTSTYLE.UNDERLINE?>" value="<?!=BGET.TEXTSTYLE.UNDERLINE?>" name="VerseTextStyles-<?!=BGET.TEXTSTYLE.UNDERLINE?>" <? if(userProperties.VerseTextStyles.UNDERLINE){ ?>CHECKED<? } ?>><label for="VerseTextStyles-<?!=BGET.TEXTSTYLE.UNDERLINE?>" title="<?!=__("UNDERLINE",locale)?>"><b><u><span><?!=__("U",locale)?></span></u></b></label>
<input type="checkbox" id="VerseTextStyles-<?!=BGET.TEXTSTYLE.STRIKETHROUGH?>" value="<?!=BGET.TEXTSTYLE.STRIKETHROUGH?>" name="VerseTextStyles-<?!=BGET.TEXTSTYLE.STRIKETHROUGH?>" <? if (userProperties.VerseTextStyles.STRIKETHROUGH) { ?>CHECKED<? } ?>><label for="VerseTextStyles-<?!=BGET.TEXTSTYLE.STRIKETHROUGH?>" title="<?!=__("STRIKETHROUGH",locale)?>"><b><del><span><?!=__("S",locale)?></span></del></b></label>
</span>
<span id="versetextalignment" class="buttonset">
<input type="radio" id="versetext-normal" name="versetextalignment" value="<?!=BGET.VALIGN.NORMAL?>" <? if(userProperties.VerseTextStyles.VALIGN == BGET.VALIGN.NORMAL){ ?>CHECKED<? } ?>><label for="versetext-normal" title="<?!=__("NORMAL",locale)?>"><span><b>X</b></span></label>
<input type="radio" id="versetext-superscript" name="versetextalignment" value="<?!=BGET.VALIGN.SUPERSCRIPT?>" <? if(userProperties.VerseTextStyles.VALIGN == BGET.VALIGN.SUPERSCRIPT){ ?>CHECKED<? } ?>><label for="versetext-superscript" title="<?!=__("SUPERSCRIPT",locale)?>"><span><b>X</b><b style="position: relative; top: -0.8em; font-size: 50%;">2</b></span></label>
<input type="radio" id="versetext-subscript" name="versetextalignment" value="<?!=BGET.VALIGN.SUBSCRIPT?>" <? if(userProperties.VerseTextStyles.VALIGN == BGET.VALIGN.SUBSCRIPT){ ?>CHECKED<? } ?>><label for="versetext-subscript" title="<?!=__("SUBSCRIPT",locale)?>"><span><b>X</b><b style="position: relative; top: 0.2em; font-size: 50%;">2</b></span></label>
</span>
<select id="versetext-fontsize" name="versetext-fontsize" class="fontsizes gapp-addon" title="<?!=__("FONT SIZE",locale)?>">
<? var ops=[8,9,10,11,12,14,18,24,30,36,48,60,72,96];
for(var i=0;i<ops.length;i++){ ?>
<option value=<?!= ops[i] ?><? if(userProperties.VerseTextStyles.FONT_SIZE == ops[i]){ ?> SELECTED<? } ?>><?= ops[i] ?></option>
<? } ?>
</select>
<input type="color" id="versetext-color" value="<?!= userProperties.VerseTextStyles.FOREGROUND_COLOR ?>" title="<?!=__("TEXT COLOR",locale)?>" />
<input type="color" id="versetext-bgcolor" value="<?!= userProperties.VerseTextStyles.BACKGROUND_COLOR ?>" title="<?!=__("HIGHLIGHT COLOR",locale)?>" />
</div>
</div> <!-- END TOOLBAR WIDGET -->
</div> <!-- END ACCORDION -->
<?!= PreviewBox ?>
<div class="flexcontainer" id="otherSettingsTab1">
<div class="flexitem">
<label title="<?!=__("p9",locale)?>"><input type="checkbox" id="NoVersionFormatting" name="NoVersionFormatting" <? if(userProperties.ParagraphStyles.NOVERSIONFORMATTING){ ?>CHECKED<? } ?>><?!=__("lbl1",locale)?></label>
</div>
<div class="flexitem">
<label><input type="checkbox" id="InterfaceInCM" name="InterfaceInCM" <? if(userProperties.ParagraphStyles.INTERFACEINCM){ ?>CHECKED<? } ?>><?!=__("DocInterfaceInCM",locale)?></label>
</div>
</div>
</div>
<!-- END TAB 1-->
<!-- BEGIN TAB 2-->
<div id="tab2">
<!--
SHOWBIBLEVERSION: BGET.VISIBILITY.SHOW,
BIBLEVERSIONALIGNMENT: BGET.ALIGN.LEFT,
BIBLEVERSIONPOSITION: BGET.POS.TOP,
BIBLEVERSIONWRAP: BGET.WRAP.NONE,
BOOKCHAPTERPOSITION: BGET.POS.INLINE,
BOOKCHAPTERALIGNMENT: BGET.ALIGN.LEFT,
BOOKCHAPTERWRAP: BGET.WRAP.NONE
SHOWVERSENUMBERS: BGET.VISIBILITY.SHOW,
-->
<div class="flexcontainerX">
<div class="flexcontainerV">
<div class="centered"><?!=__('Bible version',locale)?></div>
<div class="flexcontainerB">
<div class="flexitemB">
<span class="ctrlGrpLbl"><?!=__('Visibility',locale)?></span><br />
<span id="ShowBibleVersion" class="buttonset">
<label><input type="radio" name="ShowBibleVersion" value="<?!=BGET.VISIBILITY.SHOW?>" <? if(userProperties.LayoutPrefs.SHOWBIBLEVERSION == BGET.VISIBILITY.SHOW){ ?>CHECKED<? } ?> /><?!=__('Show',locale)?></label>
<label><input type="radio" name="ShowBibleVersion" value="<?!=BGET.VISIBILITY.HIDE?>" <? if(userProperties.LayoutPrefs.SHOWBIBLEVERSION == BGET.VISIBILITY.HIDE){ ?>CHECKED<? } ?> /><?!=__('Hide',locale)?></label>
</span>
</div>
<div class="flexitemB">
<span class="ctrlGrpLbl"><?!=__('Wrap',locale)?></span><br />
<span id="BibleVersionWrap" class="buttonset">
<label><input type="radio" name="BibleVersionWrap" value="<?!=BGET.WRAP.NONE?>" <? if(userProperties.LayoutPrefs.BIBLEVERSIONWRAP == BGET.WRAP.NONE){ ?>CHECKED<? } ?> /><?!=__('None',locale)?></label>
<label><input type="radio" name="BibleVersionWrap" value="<?!=BGET.WRAP.PARENTHESES?>" <? if(userProperties.LayoutPrefs.BIBLEVERSIONWRAP == BGET.WRAP.PARENTHESES){ ?>CHECKED<? } ?> /><?!=__('Parentheses',locale)?></label>
<label><input type="radio" name="BibleVersionWrap" value="<?!=BGET.WRAP.BRACKETS?>" <? if(userProperties.LayoutPrefs.BIBLEVERSIONWRAP == BGET.WRAP.BRACKETS){ ?>CHECKED<? } ?> /><?!=__('Brackets',locale)?></label>
</span>
</div>
<div class="flexitemB">
<span class="ctrlGrpLbl"><?!=__('Alignment',locale)?></span><br />
<span id="BibleVersionAlignment" class="buttonset">
<label><input type="radio" name="BibleVersionAlignment" value="<?!=BGET.ALIGN.LEFT?>" <? if(userProperties.LayoutPrefs.BIBLEVERSIONALIGNMENT == BGET.ALIGN.LEFT){ ?>CHECKED<? } ?> /><?!=__('Left',locale)?></label>
<label><input type="radio" name="BibleVersionAlignment" value="<?!=BGET.ALIGN.CENTER?>" <? if(userProperties.LayoutPrefs.BIBLEVERSIONALIGNMENT == BGET.ALIGN.CENTER){ ?>CHECKED<? } ?> /><?!=__('Center',locale)?></label>
<label><input type="radio" name="BibleVersionAlignment" value="<?!=BGET.ALIGN.RIGHT?>" <? if(userProperties.LayoutPrefs.BIBLEVERSIONALIGNMENT == BGET.ALIGN.RIGHT){ ?>CHECKED<? } ?> /><?!=__('Right',locale)?></label>
</span>
</div>
<div class="flexitemB">
<span class="ctrlGrpLbl"><?!=__('Positioning',locale)?></span><br />
<span id="BibleVersionPosition" class="buttonset">
<label><input type="radio" name="BibleVersionPosition" value="<?!=BGET.POS.TOP?>" <? if(userProperties.LayoutPrefs.BIBLEVERSIONPOSITION == BGET.POS.TOP){ ?>CHECKED<? } ?> /><?!=__('Top',locale)?></label>
<label><input type="radio" name="BibleVersionPosition" value="<?!=BGET.POS.BOTTOM?>" <? if(userProperties.LayoutPrefs.BIBLEVERSIONPOSITION == BGET.POS.BOTTOM){ ?>CHECKED<? } ?> /><?!=__('Bottom',locale)?></label>
</span>
</div>
</div><!-- flexcontainerB END -->
</div><!-- flexcontainerV END-->
<div class="flexcontainerV">
<div class="centered"><?!=__('Book and Chapter',locale)?></div>
<div class="flexcontainerB">
<div class="flexitemB">
<span class="ctrlGrpLbl"><?!=__('Format',locale)?></span><br />
<span id="BookChapterFormat" class="buttonset">
<label><input type="radio" name="BookChapterFormat" value="<?!=BGET.FORMAT.BIBLELANG?>" <? if(userProperties.LayoutPrefs.BOOKCHAPTERFORMAT == BGET.FORMAT.BIBLELANG){ ?>CHECKED<? } ?> /><?!=__('BIBLELANG',locale)?></label>
<label><input type="radio" name="BookChapterFormat" value="<?!=BGET.FORMAT.BIBLELANGABBREV?>" <? if(userProperties.LayoutPrefs.BOOKCHAPTERFORMAT == BGET.FORMAT.BIBLELANGABBREV){ ?>CHECKED<? } ?> /><?!=__('BIBLELANGABBREV',locale)?></label>
<label><input type="radio" name="BookChapterFormat" value="<?!=BGET.FORMAT.USERLANG?>" <? if(userProperties.LayoutPrefs.BOOKCHAPTERFORMAT == BGET.FORMAT.USERLANG){ ?>CHECKED<? } ?> /><?!=__('USERLANG',locale)?></label>
<label><input type="radio" name="BookChapterFormat" value="<?!=BGET.FORMAT.USERLANGABBREV?>" <? if(userProperties.LayoutPrefs.BOOKCHAPTERFORMAT == BGET.FORMAT.USERLANGABBREV){ ?>CHECKED<? } ?> /><?!=__('USERLANGABBREV',locale)?></label>
</span>
<label><input type="checkbox" id="BookChapterFullQuery" name="BookChapterFullQuery" <? if(userProperties.LayoutPrefs.BOOKCHAPTERFULLQUERY){ ?>CHECKED<? } ?> /><?!=__('Show full reference',locale)?></label>
</div>
<div class="flexitemB">
<span class="ctrlGrpLbl"><?!=__('Wrap',locale)?></span><br />
<span id="BookChapterWrap" class="buttonset">
<label><input type="radio" name="BookChapterWrap" value="<?!=BGET.WRAP.NONE?>" <? if(userProperties.LayoutPrefs.BOOKCHAPTERWRAP == BGET.WRAP.NONE){ ?>CHECKED<? } ?> /><?!=__('None',locale)?></label>
<label><input type="radio" name="BookChapterWrap" value="<?!=BGET.WRAP.PARENTHESES?>" <? if(userProperties.LayoutPrefs.BOOKCHAPTERWRAP == BGET.WRAP.PARENTHESES){ ?>CHECKED<? } ?> /><?!=__('Parentheses',locale)?></label>
<label><input type="radio" name="BookChapterWrap" value="<?!=BGET.WRAP.BRACKETS?>" <? if(userProperties.LayoutPrefs.BOOKCHAPTERWRAP == BGET.WRAP.BRACKETS){ ?>CHECKED<? } ?> /><?!=__('Brackets',locale)?></label>
</span>
</div>
<div class="flexitemB">
<span class="ctrlGrpLbl"><?!=__('Alignment',locale)?></span><br />
<span id="BookChapterAlignment" class="buttonset">
<label><input type="radio" name="BookChapterAlignment" value="<?!=BGET.ALIGN.LEFT?>" <? if(userProperties.LayoutPrefs.BOOKCHAPTERALIGNMENT == BGET.ALIGN.LEFT){ ?>CHECKED<? } ?> /><?!=__('Left',locale)?></label>
<label><input type="radio" name="BookChapterAlignment" value="<?!=BGET.ALIGN.CENTER?>" <? if(userProperties.LayoutPrefs.BOOKCHAPTERALIGNMENT == BGET.ALIGN.CENTER){ ?>CHECKED<? } ?> /><?!=__('Center',locale)?></label>
<label><input type="radio" name="BookChapterAlignment" value="<?!=BGET.ALIGN.RIGHT?>" <? if(userProperties.LayoutPrefs.BOOKCHAPTERALIGNMENT == BGET.ALIGN.RIGHT){ ?>CHECKED<? } ?> /><?!=__('Right',locale)?></label>
</span>
</div>
<div class="flexitemB">
<span class="ctrlGrpLbl"><?!=__('Positioning',locale)?></span><br />
<span id="BookChapterPosition" class="buttonset">
<label><input type="radio" name="BookChapterPosition" value="<?!=BGET.POS.TOP?>" <? if(userProperties.LayoutPrefs.BOOKCHAPTERPOSITION == BGET.POS.TOP){ ?>CHECKED<? } ?> /><?!=__('Top',locale)?></label>
<label><input type="radio" name="BookChapterPosition" value="<?!=BGET.POS.BOTTOM?>" <? if(userProperties.LayoutPrefs.BOOKCHAPTERPOSITION == BGET.POS.BOTTOM){ ?>CHECKED<? } ?> /><?!=__('Bottom',locale)?></label>
<label><input type="radio" name="BookChapterPosition" value="<?!=BGET.POS.BOTTOMINLINE?>" <? if(userProperties.LayoutPrefs.BOOKCHAPTERPOSITION == BGET.POS.BOTTOMINLINE){ ?>CHECKED<? } ?> /><?!=__('Bottom Inline',locale)?></label>
</span>
</div>
</div><!-- flexcontainerB END -->
</div><!-- flexcontainerV END -->
<div class="flexcontainerV">
<div class="centered"><?!=__('Verse number',locale)?></div>
<div class="flexcontainerB">
<div class="flexitemB">
<span class="ctrlGrpLbl"><?!=__('Visibility',locale)?></span><br />
<span id="ShowVerseNumbers" class="buttonset">
<label><input type="radio" name="ShowVerseNumbers" value="<?!=BGET.VISIBILITY.SHOW?>" <? if(userProperties.LayoutPrefs.SHOWVERSENUMBERS == BGET.VISIBILITY.SHOW){ ?>CHECKED<? } ?> /><?!=__('Show',locale)?></label>
<label><input type="radio" name="ShowVerseNumbers" value="<?!=BGET.VISIBILITY.HIDE?>" <? if(userProperties.LayoutPrefs.SHOWVERSENUMBERS == BGET.VISIBILITY.HIDE){ ?>CHECKED<? } ?> /><?!=__('Hide',locale)?></label>
</span>
</div>
</div><!-- flexcontainerB END -->
</div><!-- flexcontainerV END -->
</div><!-- flexContainerX END -->
<?!= PreviewBox ?>
<? if(CURRENTSTATE==ADDONSTATE.DEVELOPMENT){ ?>
<fieldset style="font-size:.5em;">
<legend>Debug: userProps and updateUserProps</legend>
<div style="display:flex;flex-direction: row;justify-content: space-between;">
<div>
<p><b>userPropsFromServer</b></p>
<ol id="userPropsFromServer">
</ol>
</div>
<div>
<p><b>userPropsAfterUpdate</b></p>
<ol id="userPropsAfterUpdate">
</ol>
</div>
<div>
<p><b>userPropsClientJSAfterUpdate</b></p>
<ol id="userPropsClientJSAfterUpdate">
</ol>
</div>
</div>
</fieldset>
<? } ?>
</div>
<!-- END TAB 2-->
<div id="tab3">
<p style="text-align:justify;"><?=__('p7A',locale)?> <span style="color:Blue;"><?=languages.length?></span> <?=__('p7B',locale)?> <br />
<? for(var i in languages){
if(i==0){?><i style="color:Blue;"><?=_l(languages[i],locale)?></i><?}
else{?>, <i style="color:Blue;"><?=_l(languages[i],locale)?></i><?}
}?>
</p>
<p><span style="color:Blue;"><?=Object.keys(versions).length?></span> <?=__('p8',locale)?></p>
<div id="tableContainer" class="tableContainer">
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="scrollTable">
<thead class="fixedHeader">
<tr class="alternateRow"><th><a href="#"><?=toProperCase(__('ABBREVIATION',locale))?></a></th><th><a href="#"><?=__('Full Name',locale)?></a></th><th><a href="#"><?=__('Year',locale)?></a></th></tr>
</thead>
<tbody class="scrollContent">
<?var info = []; var x=0; for(var i in versions){ info = versions[i].split("|"); ?>
<tr class="<?=x%2==0?"normalRow":"alternateRow"?>"><td><?=i?></td><td><?=info[0]?></td><td><?=info[1]?></td></tr>
<?x++;}?>
</tbody>
</table>
</div>
<div style="clear:both;text-align:center;margin-top:16px;"><button class="button" id="updatedata"><?=__('UPDATE DATA FROM BIBLEGET SERVER',locale)?></button></div>
<hr style="margin-top:16px;" />
<div style="text-align:center;margin-top:16px;"><button class="button" id="RESET_DEFAULT_USERPROPS"><?=__('RESET PREFERENCES TO DEFAULT OPTIONS',locale)?></button></div>
</div>
<!-- END TAB 3-->
</div>
<!-- -->
<?
if(CURRENTSTATE == ADDONSTATE.DEVELOPMENT){
consoleLog('body html complete, now preparing scripts in footer of document in Settings.html');
}
?>
<?!= include("FontListAutocomplete"); ?>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<?!= include("FontListCombobox"); ?>
<script type="text/javascript">
const dPR = window.devicePixelRatio;
//const ptToPx = (96 * dPR) / 72;//1.33 * dPR;
//this will be our global variable that holds the user preferences, which should be a pure JSON obj without stringified values (nostringify=true)
var userProps = {populated:false},
domopscomplete = false,
bkChptr1Sam213 = '',
bkChptrPs11412 = '';
switch('<?!=userProperties.LayoutPrefs.BOOKCHAPTERFORMAT?>'){
case '<?!=BGET.FORMAT.BIBLELANG?>':
bkChptr1Sam213 = "I Samuelis 2";
bkChptrPs11412 = "Psalmorum 114";
break;
case '<?!=BGET.FORMAT.BIBLELANGABBREV?>':
bkChptr1Sam213 = "ISam 2";
bkChptrPs11412 = "Ps 114";
break;
case '<?!=BGET.FORMAT.USERLANG?>':
bkChptr1Sam213 = '<?!=__('ISamuelis2',locale)?>';
bkChptrPs11412 = '<?!=__('Psalmorum114',locale)?>';
break;
case '<?!=BGET.FORMAT.USERLANGABBREV?>':
bkChptr1Sam213 = '<?!=__('ISam2',locale)?>';
bkChptrPs11412 = '<?!=__('Ps114',locale)?>';
break;
}
/*
Number.prototype.map = function (in_min, in_max, out_min, out_max) {
return (this - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}
*/
//We can't save the userProps obj unless we have all the user Properties in this object, this is why we need the object,
//and need it fully populated, not only available to populate one at a time
var passUserPropertiesServer2Client = function(propsobj){
userProps = propsobj;
userProps.populated = true;
<? if(CURRENTSTATE==ADDONSTATE.DEVELOPMENT){ ?>
for (let [key, value] of Object.entries(propsobj).sort() ) {
if(typeof value === 'object'){
let $li = jQuery('<li>',{text: key});
let $ol = jQuery('<ol>');
for(let [keyB, valueB] of Object.entries(value).sort()){
$ol.append('<li>'+keyB+' : '+valueB+'</li>')
}
jQuery($li).append($ol);
jQuery('#userPropsFromServer').append($li);
}
else{
jQuery('#userPropsFromServer').append('<li>'+key+' : '+value+'</li>');
}
}
<? } ?>
//spinner will disappear only when both jquery's dom manipulations are complete
//and userprops are loaded from the server
if(domopscomplete){
$('.spinner').fadeOut("fast");
// $('#tab1').append('<p>spinner was faded after properties populated</p>');
// ^^^ THIS IS ALWAYS THE CASE, PROPERTIES UPDATE TAKES LONGER THAN JQUERY DOM MANIPULATION ^^^ //
}
}
var saveUserProps = function(userprops){
$('.spinner').fadeIn("fast");
delete userProps.populated;
google.script.run.withSuccessHandler(userPropsUpdateSuccess).setUserProperties(userprops);
},
makeUnique = function(str) {
return String.prototype.concat(...new Set(str));
},
/* requires float, returns int */
inchesToPoints = function(inchVal){
if(typeof inchVal !== 'float'){
inchVal = parseFloat(inchVal);
}
return Math.round(inchVal * 72);
},
/* requires float, returns int */
centimetersToPoints = function (cmVal){
if(typeof cmVal !== 'float'){
cmVal = parseFloat(cmVal);
}
return Math.round(cmVal * 28.3464567);
},
userPropsUpdateSuccess = function(updatedProps){
//redefine userProps.populated which we deleted upon saving userProps,
//to avoid it being saved to Apps Script UserProperties
userProps.populated = true;
<? if(CURRENTSTATE==ADDONSTATE.DEVELOPMENT){ ?>
jQuery('#userPropsAfterUpdate').empty();
//updatedProps will have stringified values
for (let [key, value] of Object.entries(updatedProps).sort()) {
if(typeof value === 'string'){
value = JSON.parse(value);
}
if(typeof value === 'object'){
let $li = jQuery('<li>',{text: key});
let $ol = jQuery('<ol>');
for(let [keyB, valueB] of Object.entries(value).sort()){
$ol.append('<li>'+keyB+' : '+valueB+'</li>')
}
jQuery($li).append($ol);
jQuery('#userPropsAfterUpdate').append($li);
}
else{
jQuery('#userPropsAfterUpdate').append('<li>'+key+' : '+value+'</li>');
}
}
//now let's compare userProps with updatedPropsUnstringified, they should be the same!
jQuery('#userPropsClientJSAfterUpdate').empty();
for (let [key, value] of Object.entries(userProps).sort()) {
if(typeof value === 'object'){
let $li = jQuery('<li>',{text: key});
let $ol = jQuery('<ol>');
for(let [keyB, valueB] of Object.entries(value).sort()){
$ol.append('<li>'+keyB+' : '+valueB+'</li>')
}
jQuery($li).append($ol);
jQuery('#userPropsClientJSAfterUpdate').append($li);
}
else{
jQuery('#userPropsClientJSAfterUpdate').append('<li>'+key+' : '+value+'</li>');
}
}
<? } ?>
$('.spinner').fadeOut("fast");
},
getPixelRatioVals = function(rulerLength,convertToCM){
let inchesToCM = 2.54,
dpr = window.devicePixelRatio,
//ppi = ((96 * dpr) / 100),
//dpi = (96 * ppi),
dpi = 96 * dpr,
drawInterval = 0.125;
if(convertToCM){
//ppi /= inchesToCM;
dpi /= inchesToCM;
rulerLength *= inchesToCM;
drawInterval = 0.25;
}
return {
inchesToCM: inchesToCM,
dpr: dpr,
//ppi: ppi,
dpi: dpi,
rulerLength: rulerLength,
drawInterval: drawInterval
};
},
triangleAt = function (x,context,pixelRatioVals,initialPadding,canvasWidth){
let xPos = x*pixelRatioVals.dpi;//x.map(0,pixelRatioVals.rulerLength,0,(canvasWidth-(initialPadding*2)));
window.xVal = x;
window.xPos = xPos;
context.lineWidth = 0.5;
context.fillStyle = "#4285F4";
context.beginPath();
context.moveTo(initialPadding+xPos-6,11);
context.lineTo(initialPadding+xPos+6,11);
context.lineTo(initialPadding+xPos,18);
context.closePath();
context.stroke();
context.fill();
},
/**
* FUNCTION drawRuler
* @ rulerLen (float) in Inches (e.g. 6.25)
* @ cvtToCM (boolean) whether to convert values from inches to centimeters
* @ lftindnt (float) in Inches, to set xPos of triangle for left indent
* @ rgtindnt (float) in Inches, to set xPos of triangle for right indent
*/
drawRuler = function(rulerLen, cvtToCM, lftindnt, rgtindnt){
var pixelRatioVals = getPixelRatioVals(rulerLen,cvtToCM),