This repository has been archived by the owner on Jan 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.html
456 lines (427 loc) · 24.2 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="author" content="jspenguin2017" />
<title>Simple Git GUI</title>
<link rel="stylesheet" href="vendor/bootstrap/css/bootstrap-3.3.7.min.css" />
<style>
/* Main panel */
html, body {
height: 100%;
}
.column {
height: 100%;
float: left;
}
.input-group-addon {
min-width: 100px;
}
/* Code coloring */
span.code-add {
color: green;
font-weight: bold;
}
span.code-remove {
color: red;
font-weight: bold;
}
span.code-section {
color: blue;
}
/* Modals */
.modal-dialog {
width: 80%;
}
/* Native style overrides */
:focus {
outline: none !important;
}
</style>
<script src="vendor/jquery.factory-3.2.1.min.js" charset="utf-8"></script>
<script>jQueryFactory(window);</script>
<script src="vendor/bootstrap/js/bootstrap-3.3.7.min.js"></script>
<script src="renderer/ui.js" charset="utf-8"></script>
</head>
<body>
<!-- Menu -->
<nav class="navbar navbar-default navbar-static-top">
<div class="container">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar">
<span class="sr-only">Show Menu</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li><button type="button" class="btn btn-danger navbar-btn btn-management" id="btn-menu-hard-reset"><span class="glyphicon glyphicon-arrow-down"></span> H.Reset</button></li>
<li><button type="button" class="btn btn-warning navbar-btn btn-action" id="btn-menu-pull"><span class="glyphicon glyphicon-chevron-down"></span> Pull</button></li>
<li><button type="button" class="btn btn-success navbar-btn btn-action" id="btn-menu-sync"><span class="glyphicon glyphicon-sort"></span> Sync</button></li>
<li><button type="button" class="btn btn-success navbar-btn btn-action" id="btn-menu-commit"><span class="glyphicon glyphicon-ok"></span> Commit</button></li>
<li><button type="button" class="btn btn-warning navbar-btn btn-action" id="btn-menu-push"><span class="glyphicon glyphicon-chevron-up"></span> Push</button></li>
<li><button type="button" class="btn btn-warning navbar-btn btn-action" id="btn-menu-revert"><span class="glyphicon glyphicon-backward"></span> Revert</button></li>
<li><button type="button" class="btn btn-danger navbar-btn btn-action" id="btn-menu-force-push"><span class="glyphicon glyphicon-arrow-up"></span> F.Push</button></li>
<li><button type="button" class="btn btn-info navbar-btn btn-management" id="btn-menu-refresh"><span class="glyphicon glyphicon-refresh"></span> Refresh</button></li>
<li><button type="button" class="btn btn-primary navbar-btn btn-action" id="btn-menu-repo-status"><span class="glyphicon glyphicon-list-alt"></span> Status</button></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><button type="button" class="btn btn-success navbar-btn" id="btn-menu-import"><span class="glyphicon glyphicon-download-alt"></span> Import</button></li>
<li><button type="button" class="btn btn-success navbar-btn" id="btn-menu-clone"><span class="glyphicon glyphicon-plus"></span> Clone</button></li>
<li><button type="button" class="btn btn-danger navbar-btn btn-management" id="btn-menu-delete-repo"><span class="glyphicon glyphicon-remove"></span> Delete</button></li>
<li><button type="button" class="btn btn-info navbar-btn" style="margin-right:12px;" id="btn-menu-config"><span class="glyphicon glyphicon-cog"></span> Config</button></li>
</ul>
</div>
</div>
</nav>
<!-- Main panel -->
<div class="container" id="div-main-container">
<!-- Repositories and branches list (right side) -->
<div class="column" style="width:25%;">
<div class="list-group" style="height:65%; margin-bottom:0px; overflow-y:scroll;" id="div-repos-list"></div>
<div class="list-group" style="height:35%; margin-bottom:0px; border-top:2px solid grey; overflow-y:scroll;" id="div-branches-list"></div>
</div>
<!-- Changed files list (left side) -->
<div class="column" style="width:75%; border-left:2px solid grey;">
<div style="height:100%; overflow-y:scroll;">
<table class="table table-hover table-fixed">
<thead>
<tr>
<th>File Name</th>
<th>Directory</th>
<th>Remote</th>
<th>Local</th>
<th>Actions</th>
</tr>
</thead>
<tbody id="tbody-diff-table"></tbody>
</table>
</div>
</div>
</div>
<!-- General purpose dialog modal -->
<div id="modal-dialog" class="modal fade" tabindex="-1" role="dialog" data-backdrop="static" data-keyboard="false" style="z-index:900000;">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="modal-dialog-title"></h4>
</div>
<div class="modal-body" id="modal-dialog-body"></div>
<div class="modal-footer">
<button type="button" class="btn btn-primary btn-lg" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- Processing screen modal -->
<div id="modal-processing-screen" class="modal fade in" tabindex="-1" role="dialog" data-backdrop="static" data-keyboard="false" style="z-index:800000;">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Processing...</h4>
</div>
<div class="modal-body" style="text-align:center;">
<p>This won't take long...</p>
<img alt="Processing SVG" src="images/processing1.svg" id="modal-processing-screen-img-1" />
<img alt="Processing SVG" src="images/processing2.svg" style="display:none;" id="modal-processing-screen-img-2" />
</div>
</div>
</div>
</div>
<!-- Force pull confirm modal -->
<div id="modal-hard-reset" class="modal fade" tabindex="-1" role="dialog" data-backdrop="static" data-keyboard="false" style="z-index:100000;">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Hard Reset</h4>
</div>
<div class="modal-body">
<p>This will delete your local repository and clone the remote repository again, please close any software that may be locking those files.</p>
<p style="color:red;"><strong>You will lose all your work that are not pushed, ignored files will be removed.</strong></p>
<p>This exact line below will be used to delete your local repository, please review it:</p>
<pre id="modal-hard-reset-pre-rm-code"></pre>
<p>If you are sure and certain that this is what you want, type "confirm" below:</p>
<div class="input-group">
<input type="text" class="form-control" placeholder="" id="modal-hard-reset-input-confirm" />
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success btn-lg" data-dismiss="modal"
onclick="$('#modal-hard-reset-input-confirm').val(''); $('#modal-hard-reset-pre-rm-code').text('');">
Cancel
</button>
</div>
</div>
</div>
</div>
<!-- Pull modal -->
<div id="modal-pull" class="modal fade" tabindex="-1" role="dialog" data-backdrop="static" data-keyboard="false" style="z-index:100000;">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Pull</h4>
</div>
<div class="modal-body">
<p>Be aware that if you have uncommitted changes, pull may fail. Also, be ready to handle conflicts.</p>
<p>Remote branches that are already deleted will be pruned before pulling.</p>
<p>Pull is done in rebase mode.</p>
<p>Ready to pull?</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success btn-lg" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-warning btn-lg" data-dismiss="modal" id="modal-pull-btn-pull">Pull</button>
</div>
</div>
</div>
</div>
<!-- Synchronize modal -->
<div id="modal-sync" class="modal fade" tabindex="-1" role="dialog" data-backdrop="static" data-keyboard="false" style="z-index:100000;">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Synchronize</h4>
</div>
<div class="modal-body">
<p>Synchronize will do pull then push for you, things that can go wrong with pull and push both apply.</p>
<p>Ready to synchronize?</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success btn-lg" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-warning btn-lg" data-dismiss="modal" id="modal-sync-btn-sync">Sync</button>
</div>
</div>
</div>
</div>
<!-- Commit modal -->
<div id="modal-commit" class="modal fade" tabindex="-1" role="dialog" data-backdrop="static" data-keyboard="false" style="z-index:100000;">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Commit</h4>
</div>
<div class="modal-body">
<div class="input-group" style="width:100%;">
<p style="color:red;" id="modal-commit-spellcheck-load-state">Loading spellcheck dictionary...</p>
<p>Be aware that changes you made between last refresh and now will also be committed. Refresh is done automatically each time this software gains focus while not being busy.</p>
<p>Also be aware that commit will fail if there is no changed file.</p>
<div class="form-group">
<label>Commit message:</label>
<textarea class="form-control" rows="4" style="resize:vertical;" id="modal-commit-input-commit-message"></textarea>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success btn-lg" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-warning btn-lg" data-dismiss="modal" id="modal-commit-btn-commit">Commit</button>
<button type="button" class="btn btn-warning btn-lg" data-dismiss="modal" id="modal-commit-btn-commit-push">Commit then Push</button>
</div>
</div>
</div>
</div>
<!-- Revert modal -->
<div id="modal-revert" class="modal fade" tabindex="-1" role="dialog" data-backdrop="static" data-keyboard="false" style="z-index:100000;">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Revert</h4>
</div>
<div class="modal-body">
<p>Be aware that revert can cause conflicts, be ready to handle them.</p>
<p>This will not automatically push the revert to remote repository.</p>
<p>Enter the hash of the commit to revert:</p>
<div class="input-group" style="width:100%;">
<input type="text" class="form-control" placeholder="" id="modal-revert-input-commit" />
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success btn-lg" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-warning btn-lg" data-dismiss="modal" id="modal-revert-btn-revert">Revert</button>
</div>
</div>
</div>
</div>
<!-- Force push modal -->
<div id="modal-force-push" class="modal fade" tabindex="-1" role="dialog" data-backdrop="static" data-keyboard="false" style="z-index:100000;">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Force Push</h4>
</div>
<div class="modal-body">
<p>Force push will override remote branch with your local one, rewrite history, and set it exactly like what you have locally since last commit.</p>
<p>This may erase other people's work and may cause them to run into problems when they pull.</p>
<p>This will only push changes that you have already committed, ignored files are still ignored.</p>
<p style="color:red;"><strong>Please think twice before doing this.</strong></p>
<p>If you are sure and certain that this is what you want, type "confirm" below:</p>
<div class="input-group">
<input type="text" class="form-control" placeholder="" id="modal-force-push-input-confirm" />
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success btn-lg" data-dismiss="modal" onclick="$('#modal-force-push-input-confirm').val('');">Cancel</button>
</div>
</div>
</div>
</div>
<!-- Import modal -->
<div id="modal-import" class="modal fade" tabindex="-1" role="dialog" data-backdrop="static" data-keyboard="false" style="z-index:100000;">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Import</h4>
</div>
<div class="modal-body">
<div class="input-group">
<span class="input-group-addon">Remote:</span>
<input type="text" class="form-control" placeholder="git://" id="modal-import-input-address" />
</div>
<div class="input-group">
<span class="input-group-addon">Local:</span>
<input type="text" class="form-control" placeholder="" id="modal-import-input-directory" />
</div>
<br />
<p>Inputs will not be validated before adding to configuration database.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger btn-lg" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-success btn-lg" data-dismiss="modal" id="modal-import-btn-import">Import</button>
</div>
</div>
</div>
</div>
<!-- Clone modal -->
<div id="modal-clone" class="modal fade" tabindex="-1" role="dialog" data-backdrop="static" data-keyboard="false" style="z-index:100000;">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Clone</h4>
</div>
<div class="modal-body">
<div class="input-group">
<span class="input-group-addon">Address:</span>
<input type="text" class="form-control" placeholder="git://" id="modal-clone-input-address" />
</div>
<div class="input-group">
<span class="input-group-addon">Directory:</span>
<input type="text" class="form-control" placeholder="" id="modal-clone-input-directory" />
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger btn-lg" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-success btn-lg" data-dismiss="modal" id="modal-clone-btn-clone">Clone</button>
</div>
</div>
</div>
</div>
<!-- Delete repository modal -->
<div id="modal-delete-repo" class="modal fade" tabindex="-1" role="dialog" data-backdrop="static" data-keyboard="false" style="z-index:100000;">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Delete</h4>
</div>
<div class="modal-body">
<p>This will not delete your local repository, only remove the repository from the list, continue?</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success btn-lg" data-dismiss="modal">No</button>
<button type="button" class="btn btn-danger btn-lg" data-dismiss="modal" id="modal-delete-repo-btn-confirm">Yes</button>
</div>
</div>
</div>
</div>
<!-- Configuration modal -->
<div id="modal-config" class="modal fade" tabindex="-1" role="dialog" data-backdrop="static" data-keyboard="false" style="z-index:100000;">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Configuration</h4>
</div>
<div class="modal-body" style="text-align:center;">
<div class="input-group">
<span class="input-group-addon">Name:</span>
<input type="text" class="form-control" placeholder="Alpha" id="modal-config-input-name" />
</div>
<div class="input-group">
<span class="input-group-addon">Email:</span>
<input type="text" class="form-control" placeholder="[email protected]" id="modal-config-input-email" />
</div>
<br />
<div class="checkbox">
<label><input type="checkbox" value="" id="modal-config-input-savePW">Keep me signed in</label>
</div>
<br />
<p><strong>By jspenguin2017</strong></p>
<p>Project page: <a href="javascript:openProjectPage();">https://github.com/jspenguin2017/SimpleGitGUI</a></p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger btn-lg" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-success btn-lg" data-dismiss="modal" id="modal-config-btn-save">Save</button>
</div>
</div>
</div>
</div>
<!-- Switch branch modal -->
<div id="modal-switch-branch" class="modal fade" tabindex="-1" role="dialog" data-backdrop="static" data-keyboard="false" style="z-index:100000;">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Switch branch</h4>
</div>
<div class="modal-body">
<p>Your uncommitted changes will be moved the branch you selected.</p>
<p>Be aware that this will fail if your uncommitted changes has conflicts with that branch.</p>
<p>If you chose a remote branch that exists locally, this branch switching functionality will switch to the local copy instead.Use pull and push to interact with the remote branch.</p>
<p>Your current working branch will be changed to this:</p>
<pre id="modal-switch-branch-pre-branch"></pre>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success btn-lg" data-dismiss="modal" onclick="$('#modal-switch-branch-pre-branch').text('');">Cancel</button>
<button type="button" class="btn btn-danger btn-lg" data-dismiss="modal" id="modal-switch-branch-btn-delete">Delete</button>
<button type="button" class="btn btn-warning btn-lg" data-dismiss="modal" id="modal-switch-branch-btn-switch">Switch</button>
</div>
</div>
</div>
</div>
<!-- Delete branch modal -->
<div id="modal-delete-branch" class="modal fade" tabindex="-1" role="dialog" data-backdrop="static" data-keyboard="false" style="z-index:100000;">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Delete branch</h4>
</div>
<div class="modal-body">
<p>This will delete the local branch, the remote branch, if exists, will not be touched, continue?</p>
<pre id="modal-delete-branch-pre-branch"></pre>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success btn-lg" data-dismiss="modal" onclick="$('#modal-delete-branch-pre-branch').text('');">No</button>
<button type="button" class="btn btn-danger btn-lg" data-dismiss="modal" id="modal-delete-branch-btn-confirm">Yes</button>
</div>
</div>
</div>
</div>
<!-- File rollback modal -->
<div id="modal-rollback" class="modal fade" tabindex="-1" role="dialog" data-backdrop="static" data-keyboard="false" style="z-index:100000;">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Rollback</h4>
</div>
<div class="modal-body">
<p>This will set this file back to the state when you last committed it:</p>
<pre id="modal-rollback-pre-file-name"></pre>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success btn-lg" data-dismiss="modal" onclick="$('#modal-rollback-pre-file-name').text('');">Cancel</button>
<button type="button" class="btn btn-danger btn-lg" data-dismiss="modal" id="modal-rollback-btn-rollback">Rollback</button>
</div>
</div>
</div>
</div>
<script>
require("./renderer/main.js");
</script>
</body>
</html>