-
Notifications
You must be signed in to change notification settings - Fork 14
/
index.html
146 lines (133 loc) · 4.47 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
<!doctype html>
<html>
<head lang="en">
<title>VisualGit</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.min.css" crossorigin="anonymous">
<link rel="stylesheet" href="node_modules/font-awesome/css/font-awesome.css" type="text/css">
<link rel="stylesheet" href="node_modules/jquery-contextmenu/dist/jquery.contextMenu.min.css" type="text/css">
<link rel="stylesheet" href="stylesheets/styles.css">
<script>if (typeof module === 'object') {window.module = module; module = undefined;}</script>
<script src="app/misc/checkbox.js"></script>
<script src="app/misc/gitCommands.js"></script>
<script src="app/misc/git.js"></script>
<script src="app/misc/graphing.js"></script>
<script src="app/misc/images.js"></script>
<script src="app/misc/repo.js"></script>
<script src="app/misc/graphSetup.js"></script>
<script src="app/misc/router.js"></script>
<script src="app/misc/authenticate.js"></script>
<script src="app/misc/color.js"></script>
<link href="node_modules/vis/dist/vis.min.css" rel="stylesheet" type="text/css">
<script src="node_modules/jquery/dist/jquery.js"></script>
<script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="node_modules/core-js/client/shim.min.js"></script>
<script src="node_modules/zone.js/dist/zone.js"></script>
<script src="node_modules/reflect-metadata/Reflect.js"></script>
<script src="node_modules/systemjs/dist/system.src.js"></script>
<script src="node_modules/jquery-contextmenu/dist/jquery.contextMenu.min.js"></script>
<script src="node_modules/jquery-contextmenu/dist/jquery.ui.position.min.js"></script>
<script>if (window.module) module = window.module;</script>
<script src="systemjs.config.js"></script>
<script>
System.import('app').catch(function(error) {
console.error(error);
});
</script>
</head>
<body>
<my-app></my-app>
</body>
</html>
<script>
document.addEventListener('DOMContentLoaded', function() {
setTimeout(function() {
// Add click event to Commit button
document.getElementById('commit-button').addEventListener("click", function() {
console.log("clicked");
addAndCommit();
});
}, 2000);
// Update modified files on left file panel every X seconds
setInterval(function() {
displayModifiedFiles();
}, 3000);
}, false);
$('#repo-modal').on('hidden.bs.modal', function (e) {
console.log(e);
var butt = document.getElementById("cloneButton");
butt.innerHTML = 'Clone';
butt.setAttribute('class', 'btn btn-primary disabled');
});
$.contextMenu({
selector: ".file",
build: function($trigger) {
let branch;
var options = {
items: {
"edit": {
name: "Edit",
icon: "edit",
callback: function(itemKey, opt) {
let content = $trigger.text();
console.log(repoFullPath + "/" + content);
opn(repoFullPath + "/" + content);
}
}
}
}
return options;
}
});
$.contextMenu({
selector: ".network",
build: function($trigger) {
let branch;
var options = {
callback: function(key, options) {
var m = "clicked: " + key;
console.log(m + "??????");
},
items: {
"checkout this branch": {
name: "checkout this branch",
callback: function(itemKey, opt) {
checkoutLocalBranch(branch);
return true;
}
},
"merge to HEAD": {
name: "merge to HEAD"
},
"revert to previous": {
name: "revert to previous",
callback: function(itemKey, opt) {
revertCommit("refs/heads/" + branch);
}
},
"reset commit": {
name: "reset commit",
callback: function(itemKey, opt) {
resetCommit("refs/heads/" + branch);
}
}
}
};
if (toNode !== undefined) {
branch = toNode['label'];
if (branch.substring(0, 1) === '*') {
branch = branch.substring(1, branch.length);
}
options.items['merge to HEAD'].callback = function(itemKey, opt) {
console.log("lolololol");
mergeInMenu(branch);
};
} else {
$('.network').data('contextMenuRoot').$('trigger').contextMenu('hide')
}
toNode = undefined;
return options;
}
});
</script>