4 <link rel=
"stylesheet" href=
"css/GitX.css" type=
"text/css" media=
"screen" title=
"no title" charset=
"utf-8">
5 <link rel=
"stylesheet" href=
"css/diff.css" type=
"text/css" media=
"screen" title=
"no title" charset=
"utf-8">
6 <script src=
"lib/GitX.js" type=
"text/javascript" charset=
"utf-8"></script>
7 <script src=
"lib/diffHighlighter.js" type=
"text/javascript" charset=
"utf-8"></script>
9 <style type=
"text/css" media=
"screen">
16 background-color: #B5D5FE !important;
17 -webkit-border-radius:
3px;
18 -webkit-box-sizing: border-box;
20 /* border:
1px solid red;*/
21 padding-left:
3px !important;
22 padding-right:
3px !important;
23 /* margin-left: -
3px !important;
24 margin-right: -
3px !important;
28 background-color: #B5D5FE;
37 -webkit-border-radius:
4px;
38 background-color: white !important;
39 border:
1px solid blue;
46 <script type=
"text/javascript" charset=
"utf-8">
47 var nodeIndex = function(list, element)
49 for (i =
0; i < list.childNodes.length; ++i)
50 if (list.childNodes[i] == element)
55 var deselect = function()
57 var selection = document.getElementById(
"selected");
59 while (selection.childNodes[
1])
60 selection.parentNode.insertBefore(selection.childNodes[
1], selection);
61 selection.parentNode.removeChild(selection);
65 var showSelection = function(list, from, to)
68 var startIndex = nodeIndex(list, from);
69 var endIndex = nodeIndex(list, to);
71 if (startIndex == -
1 || endIndex == -
1)
74 if (startIndex
> endIndex)
77 endIndex = startIndex;
84 // new Array().slice() doesn't work with elementnodes :(
85 // So we create an array ourselves
87 for (i = startIndex; i <= endIndex; ++i)
88 elementList.push(from.parentNode.childNodes[i]);
90 var selection = document.createElement(
"div");
91 selection.setAttribute(
"id",
"selected");
92 var button = document.createElement(
"div");
93 button.setAttribute(
"id",
"stageButton");
94 button.appendChild(document.createTextNode(
"Stage lines"));
95 button.onmousedown = function() {
96 while (selection.firstChild)
97 selection.removeChild(selection.firstChild);
100 selection.appendChild(button);
101 list.insertBefore(selection, from);
104 for (i =
0; i < elementList.length; i++)
105 selection.appendChild(elementList[i]);
108 var load = function()
110 document.onmousedown = function(event) {
111 var cur = event.target;
113 if (cur.getAttribute && cur.getAttribute(
"class") && cur.getAttribute(
"class").indexOf(
"lines") != -
1)
115 cur = cur.parentNode;
120 highlightDiff($(
"orig_diff").value,
125 var list = document.getElementsByClassName(
"lines");
127 for (i =
0; i < list.length; ++i) {
129 file.onmousedown = function(event) {
130 file.onmouseover = function(event2) {
131 showSelection(file, event.srcElement, event2.target);
135 file.onmouseup = function(event2) {
136 file.onmouseover = null;
137 file.onmouseup = null;
140 showSelection(file, event.srcElement, event.srcElement);
147 <body onload=
"load()">
148 <textarea style='display:none'
id=
"orig_diff" rows=
"8" cols=
"40">
149 diff --git a/.gitignore b/.gitignore
150 index b89b7b7.
.3367a4e
100644
156 *.xcodeproj/*.pbxuser
157 *.xcodeproj/*.perspectivev3
158 *.xcodeproj/*.mode1v3
159 diff --git a/ApplicationController.m b/ApplicationController.m
160 index
86252cd.
.3a86d38
100644
161 --- a/ApplicationController.m
162 +++ b/ApplicationController.m
163 @@ -
21,
7 +
21,
7 @@ @implementation ApplicationController
165 - (ApplicationController*)init
169 [NSApp activateIgnoringOtherApps:YES];
172 @@ -
92,
12 +
92,
16 @@ - (IBAction)openPreferencesWindow:(id)sender
173 - (IBAction)installCliTool:(id)sender;
176 - NSString* installationPath = @
"/usr/local/bin/gitx";
177 + NSString* installationPath = @
"/usr/local/bin/";
178 + NSString* installationName = @
"gitx";
179 NSString* toolPath = [[NSBundle mainBundle] pathForResource:@
"gitx" ofType:@
""];
181 AuthorizationRef auth;
182 if (AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment, kAuthorizationFlagDefaults, &auth) == errAuthorizationSuccess) {
183 - char const* arguments[] = {
"-f",
"-s", [toolPath UTF8String], [installationPath UTF8String], NULL };
184 + char const* mkdir_arg[] = {
"-p", [installationPath UTF8String], NULL};
185 + char const* mkdir =
"/bin/mkdir";
186 + AuthorizationExecuteWithPrivileges(auth, mkdir, kAuthorizationFlagDefaults, (char**)mkdir_arg, NULL);
187 + char const* arguments[] = {
"-f",
"-s", [toolPath UTF8String], [[installationPath stringByAppendingString: installationName] UTF8String], NULL };
188 char const* helperTool =
"/bin/ln";
189 if (AuthorizationExecuteWithPrivileges(auth, helperTool, kAuthorizationFlagDefaults, (char**)arguments, NULL) == errAuthorizationSuccess) {
192 <div id='lijstmetdingen'
></div>