/
app.html
885 lines (647 loc) · 41.2 KB
/
app.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
<html>
<head>
<title>Pragma-git</title>
<link rel="stylesheet" type="text/css" href="color_styles.css" />
<link rel="stylesheet" type="text/css" href="style.css" />
<link rel="stylesheet" type="text/css" href="slider_switch.css" />
<link rel="stylesheet" href="lib/css-tooltip.css" />
<script src="app.js"></script>
<!-- Border for dropping folder-->
<style>
#message {
border-style: solid;
border-width: thin;
}
#message.hover {
border-style: dashed;
border-width: medium;
}
</style>
</head>
<body id='body' class='light'>
<!-- Dark mode on/off -->
<script>
if (localState.dark){
document.body.classList.remove('light');
document.body.classList.add('dark');
}
</script>
<!-- Tooltip on/off -->
<script>
if (state.displayToolTip){
document.body.classList.add('display_tooltip');
}
</script>
<div id="grid-container" style="
height: 100%;
display: grid;
grid-template-columns: 31px 1fr auto;
grid-template-rows: 33px auto 0px 33px;
align-items: center;
text-align: center;
background-color: var(--middle-background)"
>
<!-- Top titlebar -->
<div id="top-titlebar" class="top-titlebar" style="background-color: rgb(122, 124, 124);" style="grid-column-start: 1; grid-column-end: 4;">
<!-- Icon About -->
<div class="about-icon">
<img id="about-icon" height="17" width="17"
onclick="updateImageUrl('about-icon', 'images/questionmark.png');
_callback('clicked-about');"
onmouseover="updateImageUrl('about-icon', 'images/questionmark_hover.png');"
onmouseout= "updateImageUrl('about-icon', 'images/questionmark.png');"
src="images/questionmark.png">
</div>
<div id="top-titlebar-text" class="top-titlebar-text">
<!-- Text Repo -->
<div class="tooltip-bottom-left" data-tooltip="Repositories" style="font-size: var(--tooltip_font_size); position: relative;"> <!-- extra div to allow different font-size in tooltip-->
<div class="top-titlebar-repo-text">
<img id="top-titlebar-repo-arrow"
onclick="updateImageUrl('top-titlebar-repo-arrow', 'images/dropdown-arrow_hover.png');
_callback('clicked-repo', 'menu')"
onmouseover="updateImageUrl('top-titlebar-repo-arrow', 'images/dropdown-arrow_hover.png');"
onmouseout= "updateImageUrl('top-titlebar-repo-arrow', 'images/dropdown-arrow.png');"
src="images/dropdown-arrow.png">
</div>
<div id="top-titlebar-repo-text" class="top-titlebar-repo-text"
onclick="document.getElementById('top-titlebar-repo-text').setAttribute('style','color: #ffffff');_callback('clicked-repo', 'cycle')"
onmouseover="document.getElementById('top-titlebar-repo-text').setAttribute('style','color: #aaaaaa');"
onmouseout="document.getElementById('top-titlebar-repo-text').setAttribute('style','color: #ffffff');" >
</div>
</div>
<!-- Text Branch -->
(
<div class="tooltip-bottom-left" data-tooltip="Branches" style="font-size: var(--tooltip_font_size); position: relative;"> <!-- extra div to allow different font-size in tooltip-->
<div class="top-titlebar-branch-text">
<img id="top-titlebar-branch-arrow"
onclick="updateImageUrl('top-titlebar-branch-arrow', 'images/dropdown-arrow_hover.png');
_callback('clicked-branch', 'menu')"
onmouseover="updateImageUrl('top-titlebar-branch-arrow', 'images/dropdown-arrow_hover.png');"
onmouseout= "updateImageUrl('top-titlebar-branch-arrow', 'images/dropdown-arrow.png');"
src="images/dropdown-arrow.png">
</div>
<div id="top-titlebar-branch-text" class="top-titlebar-branch-text"
onclick="document.getElementById('top-titlebar-branch-text').setAttribute('style','color: #ffffff');
_callback('clicked-branch', 'cycle')"
onmouseover="document.getElementById('top-titlebar-branch-text').setAttribute('style','color: #aaaaaa');"
onmouseout="document.getElementById('top-titlebar-branch-text').setAttribute('style','color: #ffffff');" >
</div>
</div>
)
<!-- Icon Notes -->
<div class="top-titlebar-notes-icon tooltip-bottom " data-tooltip="Personal notes">
<img id="top-titlebar-notes-icon" height="17" width="17"
onclick="updateImageUrl('top-titlebar-notes-icon', 'images/notes.png');
_callback('clicked-notes')"
onmouseover="updateImageUrl('top-titlebar-notes-icon', 'images/notes_hover.png');"
onmouseout= "updateImageUrl('top-titlebar-notes-icon', 'images/notes.png');"
src="images/notes.png">
</div>
</div>
<!-- NOTE : set absolute positions in style.css -->
<!-- Icon Branch -->
<div class="top-titlebar-branch-icon tooltip-bottom " data-tooltip="Create branch">
<img id="top-titlebar-branch-icon" height="17" width="17"
onclick="updateImageUrl('top-titlebar-branch-icon', 'images/branch.png');
document.getElementById('branchNameInputDialog').showModal();"
onmouseover="updateImageUrl('top-titlebar-branch-icon', 'images/branch_hover.png');"
onmouseout= "updateImageUrl('top-titlebar-branch-icon', 'images/branch.png');"
src="images/branch.png">
</div>
<!-- Icon Merge -->
<div class="top-titlebar-merge-icon tooltip-bottom " data-tooltip="Merge">
<img id="top-titlebar-merge-icon" height="17" width="17"
onclick="updateImageUrl('top-titlebar-merge-icon', 'images/merge.png');
_callback('clicked-merge-button')"
onmouseover="updateImageUrl('top-titlebar-merge-icon', 'images/merge_hover.png');"
onmouseout= "updateImageUrl('top-titlebar-merge-icon', 'images/merge.png');"
src="images/merge.png">
</div>
<!-- Icon Pull -->
<div class="top-titlebar-pull-icon tooltip-bottom-right " data-tooltip="Pull from remote">
<img id="top-titlebar-pull-icon" height="17" width="17"
onclick="_callback('clicked-pull-button')"
onmouseover="updateImageUrl('top-titlebar-pull-icon', 'images/pull_hover.png');"
onmouseout= "updateImageUrl('top-titlebar-pull-icon', 'images/pull.png');"
src="images/pull.png">
</div>
<!-- Icon Push -->
<div class="top-titlebar-push-icon tooltip-bottom-right " data-tooltip="Push to remote">
<img id="top-titlebar-push-icon" height="17" width="17"
onclick="updateImageUrl('top-titlebar-push-icon', 'images/push.png');
_callback('clicked-push-button')"
onmouseover="updateImageUrl('top-titlebar-push-icon', 'images/push_hover.png');"
onmouseout= "updateImageUrl('top-titlebar-push-icon', 'images/push.png');"
src="images/push.png">
</div>
<!-- Icon Tag -->
<div class="top-titlebar-tag-icon tooltip-bottom-right " data-tooltip="Tag">
<img id="top-titlebar-tag-icon" height="17" width="auto"
onclick="updateImageUrl('top-titlebar-tag-icon', 'images/tag.png');
_callback('clicked-tag-button');"
onmouseover="updateImageUrl('top-titlebar-tag-icon', 'images/tag_hover.png');"
onmouseout= "updateImageUrl('top-titlebar-tag-icon', 'images/tag.png');"
src="images/tag.png">
</div>
<!-- Top right icons -->
<div class="top-titlebar-close-field">
<!-- Icon Minimize -->
<img id="top-titlebar-minimize-icon" height="17" width="17"
onclick="_callback('clicked-minimize-button')"
onmouseover="updateImageUrl('top-titlebar-minimize-icon', 'images/minimize_hover.png');"
onmouseout= "updateImageUrl('top-titlebar-minimize-icon', 'images/minimize.png');"
src="images/minimize.png">
<!-- Icon Close -->
<img id="top-titlebar-close-icon"
onclick="_callback('clicked-close-button')"
onmouseover="updateImageUrl('top-titlebar-close-icon', 'images/button_close_hover.png');"
onmouseout= "updateImageUrl('top-titlebar-close-icon', 'images/button_close.png');"
src="images/button_close.png">
</div>
<div class="top-titlebar-divider"></div>
</div>
<!-- Content -->
<div style="grid-row: 2 ; grid-column: 1; height: 100%; position:relative;"> <!-- Left -->
<img id="up-arrow" height="17" width="17"
onclick="_callback( 'clicked-up-arrow')"
onmouseover="updateImageUrl('up-arrow', 'images/up-arrow_hover.png');"
onmouseout="updateImageUrl('up-arrow', 'images/up-arrow_black.png');"
src="images/up-arrow_black.png">
<img id="down-arrow" height="17" width="17"
onclick="_callback( 'clicked-down-arrow')"
onmouseover="updateImageUrl('down-arrow', 'images/down-arrow_hover.png');"
onmouseout="updateImageUrl('down-arrow', 'images/down-arrow_black.png');"
src="images/down-arrow_black.png">
<img id="bottom-titlebar-find-icon" height="15" width="15"
onclick="updateImageUrl('bottom-titlebar-find-icon', 'images/find.png');
_callback('clicked-find');updateContentStyle();"
onmouseover="updateImageUrl('bottom-titlebar-find-icon', 'images/find_hover.png');"
onmouseout= "updateImageUrl('bottom-titlebar-find-icon', 'images/find_black.png');"
src="images/find_black.png">
</div>
<div style="grid-row: 2 ; grid-column: 2; position:relative"> <!-- Middle -->
<!-- Message Textarea -->
<textarea style="resize: none;" class="message" id="message" onkeyup="_callback( 'message_key_up');"
placeholder=""Fix issue #5 (https://github.com/pragma-git/pragma-git/issues/5)"" readonly=""></textarea>
<!-- Textarea pop-up for amend -->
<div id="amend_commit_div" class="tooltip-top-right ">
<div>
<input type="checkbox" id="amend_commit_checkbox" data-tooltip="Amend to last commit"
onClick="
if ( document.getElementById('amend_commit_checkbox').checked == true ) {
document.getElementById('store-button').disabled = false; // Enable Store button
// Show dialog if remote defined
let remoteDefined = state.repos[state.repoNumber].remoteURL.includes('http');
if (remoteDefined){
document.getElementById('amendDialog').showModal(); // Only show when click to check the box
}
}else{
document.getElementById('store-button').disabled = true; // Disable Store button
}"
>
<label for="amend_commit_checkbox" style="display: inline; vertical-align: middle">Store in same </label>
</div>
</div>
</div>
<div style="grid-row: 2; grid-column: 3; padding: 0px"> <!-- Right -->
<button id="store-button" onclick="_callback('clicked-store-button')" style="margin: 6px;" disabled >Store</button>
</div>
<!-- Foldable search-Content -->
<div id="output_row" class="message_column" style="grid-row: 3; grid-column: 2 ; margin: 2px; visibility:collapse">
<div id="output_text" >
<div class="group">
<label for="findTextInput"> <span id="mess_text" style="color: var(--text);">message</span>
<label class="switch">
<input id="message_code_switch" type="checkbox" class="slider round" onclick="colorSwitchTexts();find_button.click()">
<span class="slider round"></span>
</label>
<span id="code_text" style="color: var(--dim-text);">code-change</span>
</label>
<input id="findTextInput" type="text" placeholder="text" size="25" onkeydown="clickFind()"/>
</div>
<div class="group">
<label for="findFileInput"> file</label>
<input id="findFileInput" type="text" placeholder="file name" size="25" onkeydown="clickFind()"/>
</div>
<div class="group">
<label for="findDateInputAfter"> since (oldest)</label>
<input id="findDateInputAfter" type="text" placeholder="YYYY-MM-DD" size="12" onkeydown="clickFind()"/>
</div>
<div class="group">
-
</div>
<div class="group">
<label for="findDateInputBefore"> until (newest)</label>
<input id="findDateInputBefore" type="text" placeholder="YYYY-MM-DD" value="0 days" size="12" onkeydown="clickFind()"/>
</div>
<img id="about-icon-find" height="17" width="17" style="float: right; padding-top: 15px; padding-right: 15px;"
onclick="_callback('help-on-find')"
onmouseover="updateImageUrl('about-icon-find', 'images/questionmark_hover.png');"
onmouseout= "updateImageUrl('about-icon-find', 'images/questionmark_black.png');"
src="images/questionmark_black.png">
</div>
</div>
<div id="find_button_div" style="text-align:center; grid-row: 3; grid-column: 3; visibility:collapse">
<button id="find_button" style='vertical-align:bottom;' onclick="_callback('clicked-find-button')" >Find</button>
</div>
<script>
function clickFind() {
if (event.keyCode == 13) {
find_button.click();
}
}
function colorSwitchTexts(){
if ( document.getElementById("message_code_switch").checked ){
document.getElementById('code_text').setAttribute('style','color: var(--text)');
document.getElementById('mess_text').setAttribute('style','color: var(--dim-text)');
}else{
document.getElementById('code_text').setAttribute('style','color: var(--dim-text)');
document.getElementById('mess_text').setAttribute('style','color: var(--text)');
}
}
</script>
</div>
<!-- Bottom titlebar -->
<div id="bottom-titlebar" class="bottom-titlebar" style="background-color: rgb(122, 124, 124); grid-row: 4; grid-column: 1/3">
<!-- Icon Folder -->
<div class="bottom-titlebar-folder-icon tooltip-top-left " data-tooltip="Repository folder">
<img id="bottom-titlebar-folder-icon" height="17" width="17"
onclick="updateImageUrl('bottom-titlebar-folder-icon', 'images/folder.png');
_callback('clicked-folder')"
onmouseover="updateImageUrl('bottom-titlebar-folder-icon', 'images/folder_hover.png');"
onmouseout="updateImageUrl('bottom-titlebar-folder-icon', 'images/folder.png');"
src="images/folder.png">
</div>
<!-- Icon Terminal -->
<div class="bottom-titlebar-terminal-icon tooltip-top-left " data-tooltip="Command line">
<img id="bottom-titlebar-terminal-icon" height="17" width="17"
onclick="updateImageUrl('bottom-titlebar-terminal-icon', 'images/terminal.png');
_callback('clicked-terminal')"
onmouseover="updateImageUrl('bottom-titlebar-terminal-icon', 'images/terminal_hover.png');"
onmouseout="updateImageUrl('bottom-titlebar-terminal-icon', 'images/terminal.png');"
src="images/terminal.png">
</div>
<!-- Text Status and pinned icon -->
<div id="bottom-titlebar-div" class="bottom-titlebar-text">
<!-- Text status -->
<div class="tooltip-top-left" data-tooltip="Modified files (click for tools)" style="font-size: var(--tooltip_font_size); position: relative;"
onclick="document.getElementById('bottom-titlebar-text').setAttribute('style','color: #ffffff');
_callback('clicked-status-text')"
onmouseover="document.getElementById('bottom-titlebar-text').setAttribute('style','color: #aaaaaa');"
onmouseout="document.getElementById('bottom-titlebar-text').setAttribute('style','color: #ffffff');" >
<div id="bottom-titlebar-text" class="bottom-titlebar-status-text" >
</div>
</div>
<!-- Icon Graph -->
<div class="bottom-titlebar-more-icon tooltip-top-left " data-tooltip="Commit graph" >
<img id="more" style="vertical-align:middle;" height="17" width="17"
onclick="_callback( 'clicked-graph')"
onmouseover="updateImageUrl('more', 'images/more_hover.png');"
onmouseout="updateImageUrl('more', 'images/more.png');"
src="images/more.png">
</div>
<!-- Icon Pinned -->
<div class="top-titlebar-pinned-icon tooltip-top-left " data-tooltip="Fixed commit to compare with">
<img id="top-titlebar-pinned-icon" height="17" width="17"
onclick=" wasPinned = (localState.pinnedCommit !== '');
isPinned = !wasPinned;
_callback('clicked-pinned-icon',isPinned)"
onmouseover="if (localState.pinnedCommit === ''){
updateImageUrl('top-titlebar-pinned-icon', 'images/pinned_disabled_hover.png');
} else {
updateImageUrl('top-titlebar-pinned-icon', 'images/pinned_enabled_hover.png');
}"
onmouseout="if (localState.pinnedCommit === ''){
updateImageUrl('top-titlebar-pinned-icon', 'images/pinned_disabled.png');
} else {
updateImageUrl('top-titlebar-pinned-icon', 'images/pinned_enabled.png');
}"
src="images/pinned_disabled.png">
</div>
<!-- Text status (used in HISTORY mode, to show pinned-commit or hash) -->
<!-- Note : tooltip changes in app/drawPinImage depending of pin checkbox -->
<div class="tooltip-top-left" id="commit_tool_tip" data-tooltip="Commit hash, click to copy" style="font-size: var(--tooltip_font_size); position: relative;"> <!-- extra div to allow different font-size in tooltip-->
<div id="bottom-titlebar-pinned-text" class="bottom-titlebar-status-text"
onclick="if (localState.pinnedCommit !== ''){
document.getElementById('bottom-titlebar-pinned-text').setAttribute('style','color: #ffffff');
_callback('clicked-pinned-hash');
}else{
// Only copy when showing hash ( that is, not when showing 'compared to xxxx', which is does when a pinned commit)
navigator.clipboard.writeText(localState.historyHash);
}"
onmouseover="document.getElementById('bottom-titlebar-pinned-text').setAttribute('style','color: #aaaaaa');"
onmouseout="document.getElementById('bottom-titlebar-pinned-text').setAttribute('style','color: #ffffff');" >
</div>
</div>
</div>
<!-- Icon Revert -->
<div class="bottom-titlebar-revert-icon tooltip-top-right " data-tooltip="Revert (undo) changes in this commit">
<img id="bottom-titlebar-revert-icon" height="17" width="auto"
onclick="updateImageUrl('bottom-titlebar-revert-icon', 'images/revert.png');
_callback('clicked-revert-button')"
onmouseover="updateImageUrl('bottom-titlebar-revert-icon', 'images/revert_hover.png');"
onmouseout= "updateImageUrl('bottom-titlebar-revert-icon', 'images/revert.png');"
src="images/revert.png">
</div>
<!-- Icon Cherry-pick -->
<div class="bottom-titlebar-cherry-pick-icon tooltip-top-right " data-tooltip="cherry-pick this commit (to other branch)">
<img id="bottom-titlebar-cherry-pick-icon" height="17" width="auto"
onclick="updateImageUrl('bottom-titlebar-cherry-pick-icon', 'images/cherry-pick.png');
_callback('clicked-cherry-pick-button')"
onmouseover="updateImageUrl('bottom-titlebar-cherry-pick-icon', 'images/cherry-pick_hover.png');"
onmouseout= "updateImageUrl('bottom-titlebar-cherry-pick-icon', 'images/cherry-pick.png');"
src="images/cherry-pick.png">
</div>
<!-- Icon Stash -->
<div class="bottom-titlebar-stash-icon tooltip-top-right " data-tooltip="Stash uncommitted">
<img id="bottom-titlebar-stash-icon" height="17" width="auto"
onclick="updateImageUrl('bottom-titlebar-stash-icon', 'images/stash.png');
_callback('clicked-stash-button')"
onmouseover="updateImageUrl('bottom-titlebar-stash-icon', 'images/stash_hover.png');"
onmouseout= "updateImageUrl('bottom-titlebar-stash-icon', 'images/stash.png');"
src="images/stash.png">
</div>
<!-- Icon Stash pop -->
<div class="bottom-titlebar-stash_pop-icon tooltip-top-right " data-tooltip="Retrieve latest stash">
<img id="bottom-titlebar-stash_pop-icon" height="17" width="auto"
onclick="updateImageUrl('bottom-titlebar-stash_pop-icon', 'images/stash_pop.png');
_callback('clicked-stash_pop-button')"
onmouseover="updateImageUrl('bottom-titlebar-stash_pop-icon', 'images/stash_pop_hover.png');"
onmouseout= "updateImageUrl('bottom-titlebar-stash_pop-icon', 'images/stash_pop.png');"
src="images/stash_pop.png">
</div>
<!-- Icon Settings -->
<div class="bottom-titlebar-settings-field tooltip-top-right " data-tooltip="Settings">
<img id="bottom-titlebar-settings-icon" height="17" width="17"
onclick="updateImageUrl('bottom-titlebar-settings-icon', 'images/settings.png');
_callback('clicked-settings')"
onmouseover="updateImageUrl('bottom-titlebar-settings-icon', 'images/settings_hover.png');"
onmouseout="updateImageUrl('bottom-titlebar-settings-icon', 'images/settings.png');"
src="images/settings.png">
</div>
<div class="bottom-titlebar-divider"></div>
</div>
</div>
<!-- -->
<!-- Dialogs -->
<!-- -->
<!-- General alert dialog -->
<dialog id="alertDialog" class="warning">
<b><div id='alertTitle'></div></b><br>
<div >
<span id='alertMessage'></span>
<button id="no", style="float:right"
onclick="document.getElementById('alertDialog').close();selectedBranch='';">
OK
</button>
</div>
</dialog>
<!-- Amend alert dialog -->
<dialog id="amendDialog" class="warning">
<b><div id='amendAlertTitle'></div>Warning! -- this will modify remote</b><br>
<br>
<div >
<span id='amendAlertMessage'>
The commit history will change for other developers, and may cause confusion.<br>
This is fine if you are a single developer
</span>
<br>
<button id="no" style="float:right"
onclick="document.getElementById('amendDialog').close('OK');
document.getElementById('store-button').disabled = false; // Enable Store button"
>
OK
</button>
<button id="no" style="float:right; margin-right: 5;"
onclick="document.getElementById('amendDialog').close('Cancel'); document.getElementById('amend_commit_checkbox').checked = false">
Cancel
</button>
</div>
</dialog>
<!--Download new version -->
<dialog id="newVersionDetectedInputDialog" style="max-height: " class="warning">
<b>A new release is available</b>
<a href='https://github.com/pragma-git/pragma-git/releases/latest'
onclick="require('nw.gui').Shell.openExternal( this.href );return false;"
style="float:right; cursor: pointer;">
(release notes)
</a>
<p>
Your current version is <code id='currentVersion'> </code>. Download the new <code id='newVersion'> </code> installer!
</p>
<button id="downloadButton"
onclick="_callback('downloadRelease', 'Download' );" tabindex="0">
Download
</button>
<button id="waitButton"
onclick="_callback('downloadRelease', 'Wait' );">
Ignore now
</button>
<label for="ignoreThisVersion" style="float: right;">
<input type="checkbox" id="ignoreThisVersion" style="vertical-align: middle;"
onchange = "
if ( this.checked){
document.getElementById('waitButton').innerText = 'Skip this version';
}else{
document.getElementById('waitButton').innerText = 'Ignore now';
}
"
/>
Skip version <code id='newVersion2'> </code>
</label>
</dialog>
<!-- Tag creation -->
<dialog id="tagNameInputDialog" class="warning">
<b>Create tag at this commit</b><br>
<br>
<textarea id="tagNameTextarea"
rows="2"
cols="30"
placeholder="name of new tag"
onkeyup= "_callback('newTagNameKeyUp', this);"></textarea>
<br>
<br>
<button id="newTagNameEntered"
onclick="document.getElementById('tagNameInputDialog').close();_callback('addTagButtonPressed', this.value);document.getElementById('tagNameTextarea').value='';">
OK
</button>
<button id="cancelTagNameInputDialog"
onclick="document.getElementById('tagNameInputDialog').close();document.getElementById('tagNameTextarea').value='';">
Cancel
</button>
</dialog>
<!-- Branch creation -->
<dialog id="branchNameInputDialog" class="warning">
<b>Create branch from this commit</b><br>
<br>
<textarea id="branchNameTextarea"
rows="2"
cols="30"
placeholder="name of new branch"
onkeyup= "_callback('newBranchNameKeyUp', this);"></textarea>
<br>
<br>
<div>
<button id="newBranchNameEntered"
onclick="document.getElementById('branchNameInputDialog').close();
_callback('addBranchButtonPressed', this.value);
document.getElementById('branchNameTextarea').value='';
document.getElementById('gitflow').value='none';">
OK
</button>
<button id="cancelBranchNameInputDialog"
onclick="document.getElementById('branchNameInputDialog').close();
document.getElementById('branchNameTextarea').value='';
document.getElementById('gitflow').value='none';">
Cancel
</button>
<select id="gitflow" name="gitflow" style="float: right;">
<option value="none">none</option>
<option value="feature">feature/</option>
<option value="release">release/</option>
<option value="hotfix">hotfix/</option>
</select>
<label for="gitflow" style="float: right;">Prefix:</label>
</div>
</dialog>
<!-- Git not installed alert -->
<dialog id="gitNotInstalledAlert" class="error">
<b>ERROR -- Cannot find "git" </b><br>
<br>
Download and install "git" from :
<a href="https://git-scm.com/downloads" onclick="require('nw.gui').Shell.openExternal( this.href );return false;">https://git-scm.com/downloads</a>
<br>
<br>
<button
onclick="document.getElementById('gitNotInstalledAlert').close(); win.close()">
Close Pragma-git
</button>
</dialog>
<!-- Simple Detached head dialog (unsaved work)-->
<!-- Icon Stash -->
<div class="bottom-titlebar-stash-icon tooltip-top-right " data-tooltip="Stash uncommitted">
<img id="bottom-titlebar-stash-icon" height="17" width="auto"
onclick="updateImageUrl('bottom-titlebar-stash-icon', 'images/stash.png');
_callback('clicked-stash-button')"
onmouseover="updateImageUrl('bottom-titlebar-stash-icon', 'images/stash_hover.png');"
onmouseout= "updateImageUrl('bottom-titlebar-stash-icon', 'images/stash.png');"
src="images/stash.png">
</div>
<!-- Icon Stash pop -->
<div class="bottom-titlebar-stash_pop-icon tooltip-top-right " data-tooltip="Retrieve latest stash">
<img id="bottom-titlebar-stash_pop-icon" height="17" width="auto"
onclick="updateImageUrl('bottom-titlebar-stash_pop-icon', 'images/stash_pop.png');
_callback('clicked-stash_pop-button')"
onmouseover="updateImageUrl('bottom-titlebar-stash_pop-icon', 'images/stash_pop_hover.png');"
onmouseout= "updateImageUrl('bottom-titlebar-stash_pop-icon', 'images/stash_pop.png');"
src="images/stash_pop.png">
</div>
<!-- Detached head dialog (stored work) -->
<dialog id="detachedHeadDialog" class="error" style="overflow: unset">
<!-- Make it easier to hit buttons -->
<style>
.ur-small-element {
position:relative;
}
.ur-small-element:after {
content:'';
position:absolute;
top:-3px; bottom:-3px;
left:-8px; right:-8px;
}
</style>
<!-- Warning text -->
<b>WARNING -- detached HEAD !</b><br>
You've stored new work beginning at an old commit (detached HEAD) <br>
<label for="tempBranch">
<input type="radio" id="tempBranch" name="detachedBranchRadiobuttonGroup" onmousedown="document.getElementById('tempBranch').checked = true;" onmouseup="_callback('updateDetachedBranchDialog)" value="Temp Branch" checked>
Temp branch : move work to a temporary branch
</label>
<!-- Radio-buttons -->
<label for="mergeWithBranch">
<input type="radio" id="mergeWithBranch" name="detachedBranchRadiobuttonGroup" onmousedown="document.getElementById('mergeWithBranch').checked = true;" onmouseup="_callback('updateDetachedBranchDialog')" value="Merge">
Merge : merge work into branch
<!-- This select is just used to indicate that it is a drop-down -- menu is displayed another way (so therefore mouse-down is disabled) -->
<select name="mergeWithDetachedBranchLink" id="mergeWithDetachedBranchLink" onmousedown="_callback('clicked-detachedMergeSelectBranch-button')" onmouseup="(function(e){ e.preventDefault();})(event, this)">
<option id="detachedBranchDialogMergeWith" value="anything">select branch</option>
</select>
</label>
<label for="deleteDetachedHead">
<input type="radio" id="deleteDetachedHead" name="detachedBranchRadiobuttonGroup" onmousedown="document.getElementById('deleteDetachedHead').checked = true;" onmouseup="_callback('updateDetachedBranchDialog')" value="Delete">
Delete : discard work saved to detached HEAD
</label>
<!-- help -->
<img id="about-icon" style="float:right;" height="17" width="17"
onclick="let evt = {}; evt.name='Stored Detached HEAD';parent.window._callback('help',evt);"
onmouseover="updateImageUrl('about-icon', 'images/questionmark_hover.png');"
onmouseout= "updateImageUrl('about-icon', 'images/questionmark.png');"
src="images/questionmark.png">
<!-- OK / Cancel buttons-->
<br style = "line-height: 0.4em;">
<button id="detachedBranchDialogOK" value="OK" class="ur-small-element"
onclick="
document.getElementById('detachedHeadDialog').close();
let selectedRadioButton = document.querySelector('input[name=\'detachedBranchRadiobuttonGroup\']:checked').value;
_callback('detachedHeadDialog', selectedRadioButton );
"> <!-- Call html-dialog for branch selection -->
OK
</button>
<button id="cancelDetachedDialog" value="Cancel" class="ur-small-element"
onclick="document.getElementById('detachedHeadDialog').close();_callback('detachedHeadDialog', this.value);">
Cancel
</button>
</dialog>
<!-- Dropped file is not a repo -->
<dialog id="doYouWantToInitializeRepoDialog" class="warning">
<b>WARNING</b> -- Do you want to initialize this folder as a git repository ?
<br>
<br>
Start working in branch
<select id="firstBranchToWorkOn" name="firstBranchToWorkOn" >
<option id="defaultBranchName" value="master">master_</option>
<option value="develop" selected>develop</option>
</select> <br>
<br>
<button id="initializeRepoDialogOK"
onclick="document.getElementById('doYouWantToInitializeRepoDialog').close();_callback('initializeRepoOK', {firstBranch : document.getElementById('firstBranchToWorkOn').value });">
Initialize
</button>
<button id="initializeRepoDialogCancel"
onclick="document.getElementById('doYouWantToInitializeRepoDialog').close();localState.droppedRepoFolder=''; "> <!-- Forget dropped folder -->
Cancel
</button>
</dialog>
</body>
<!-- Drop folder initiate script-->
<script>
//Same as $(document).ready();
function ready(fn) {
if (document.readyState != 'loading'){
fn();
} else {
document.addEventListener('DOMContentLoaded', fn);
}
}
//When the page has loaded, run this code
ready( function(){
// prevent default behavior from changing page on dropped file
window.ondragover = function(e) { e.preventDefault(); return false };
// NOTE: ondrop events WILL NOT WORK if you do not "preventDefault" in the ondragover event!!
window.ondrop = function(e) { e.preventDefault(); return false };
const holder = document.getElementById('message');
holder.ondragover = function () { document.getElementById('message').classList.add('hover'); return false; };
holder.ondragleave = function () { document.getElementById('message').classList.remove('hover'); return false; };
holder.ondrop = function(e) { _callback('file-dropped', e); return false }; // See app.js
// Set default branch-name
registerDefaultBranch(document);
});
</script>
</html>