diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/project.pbxproj
index 0b86ef1..9dc960e 100644
--- a/GitX.xcodeproj/project.pbxproj
+++ b/GitX.xcodeproj/project.pbxproj
@@ -46,7 +46,6 @@
F56CC7320E65E0E5004307B4 /* PBGraphCellInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = F56CC7310E65E0E5004307B4 /* PBGraphCellInfo.m */; };
F57240BB0E9678EA00D8EE66 /* deleted_file.png in Resources */ = {isa = PBXBuildFile; fileRef = F57240BA0E9678EA00D8EE66 /* deleted_file.png */; };
F57ABE0B0E0442DD00A088B8 /* commit.js in Resources */ = {isa = PBXBuildFile; fileRef = F57ABDDE0E0441DE00A088B8 /* commit.js */; };
- F57ABE2B0E04435100A088B8 /* prototype.js in Resources */ = {isa = PBXBuildFile; fileRef = F57ABE180E04431D00A088B8 /* prototype.js */; };
F57CC3910E05DDF2000472E2 /* PBEasyPipe.m in Sources */ = {isa = PBXBuildFile; fileRef = F57CC3900E05DDF2000472E2 /* PBEasyPipe.m */; };
F57CC4410E05E496000472E2 /* PBGitWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = F57CC4400E05E496000472E2 /* PBGitWindowController.m */; };
F580E6AE0E733276009E2D3F /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F580E6AD0E733276009E2D3F /* Sparkle.framework */; };
@@ -557,7 +556,6 @@
F56173280E056ED2001DCD79 /* diffHighlighter.js in Resources */,
F561727F0E056A11001DCD79 /* diff_style.css in Resources */,
F57ABE0B0E0442DD00A088B8 /* commit.js in Resources */,
- F57ABE2B0E04435100A088B8 /* prototype.js in Resources */,
F58A8F280E043698007E3FC0 /* commits.css in Resources */,
F561777D0E05C88E001DCD79 /* DetailView.png in Resources */,
F5B721C40E05CF7E00AF29DC /* MainMenu.xib in Resources */,
diff --git a/html/commit.html b/html/commit.html
index c0e66c0..2b76fcc 100644
--- a/html/commit.html
+++ b/html/commit.html
@@ -3,7 +3,7 @@
Details for commit
-
+
diff --git a/html/commit.js b/html/commit.js
index 8288f8a..e8d4b10 100644
--- a/html/commit.js
+++ b/html/commit.js
@@ -1,42 +1,41 @@
var commit;
-var Commit = Class.create({
- initialize: function(obj) {
- this.raw = obj.details;
- this.refs = obj.refs;
- this.object = obj;
+var Commit = function(obj) {
+ this.raw = obj.details;
+ this.refs = obj.refs;
+ this.object = obj;
- var diffStart = this.raw.indexOf("\ndiff ");
- var messageStart = this.raw.indexOf("\n\n") + 2;
+ var diffStart = this.raw.indexOf("\ndiff ");
+ var messageStart = this.raw.indexOf("\n\n") + 2;
- if (diffStart > 0) {
- this.message = this.raw.substring(messageStart, diffStart).gsub(/^ /m, "").escapeHTML();
- this.diff = this.raw.substring(diffStart);
- } else {
- this.message = this.raw.substring(messageStart).gsub(/^ /m, "").escapeHTML();
- this.diff = "";
- }
- this.header = this.raw.substring(0, messageStart);
+ if (diffStart > 0) {
+ this.message = this.raw.substring(messageStart, diffStart).replace(/^ /gm, "").escapeHTML();
+ this.diff = this.raw.substring(diffStart);
+ } else {
+ this.message = this.raw.substring(messageStart).replace(/^ /gm, "").escapeHTML();
+ this.diff = "";
+ }
+ this.header = this.raw.substring(0, messageStart);
- this.sha = this.header.match(/^commit ([0-9a-f]{40,40})/)[1];
+ this.sha = this.header.match(/^commit ([0-9a-f]{40,40})/)[1];
- var match = this.header.match(/\nauthor (.*) <(.*@.*)> ([0-9].*)/);
- this.author_name = match[1];
- if (!(match[2].match(/@[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/)))
- this.author_email = match[2];
+ var match = this.header.match(/\nauthor (.*) <(.*@.*)> ([0-9].*)/);
+ this.author_name = match[1];
+ if (!(match[2].match(/@[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/)))
+ this.author_email = match[2];
- this.author_date = new Date(parseInt(match[3]) * 1000);
+ this.author_date = new Date(parseInt(match[3]) * 1000);
- match = this.header.match(/\ncommitter (.*) <(.*@.*)> ([0-9].*)/);
- this.committer_name = match[1];
- this.committer_email = match[2];
- this.committer_date = new Date(parseInt(match[3]) * 1000);
+ match = this.header.match(/\ncommitter (.*) <(.*@.*)> ([0-9].*)/);
+ this.committer_name = match[1];
+ this.committer_email = match[2];
+ this.committer_date = new Date(parseInt(match[3]) * 1000);
- this.parents = obj.parents;
- },
- reloadRefs: function() {
+ this.parents = obj.parents;
+
+ this.reloadRefs = function() {
this.refs = CommitObject.refs;
}
-});
+};
var notify = function(text, state) {
var n = $("notification");
@@ -77,25 +76,31 @@ var gistie = function() {
parameters.private = true;
}
- new Ajax.Request("http://gist.github.com/gists", {
- method: 'post',
- parameters: parameters,
+ var params = [];
+ for (var name in parameters)
+ params.push(encodeURIComponent(name) + "=" + encodeURIComponent(parameters[name]));
+ params = params.join("&");
- onSuccess: function(t) {
+ var t = new XMLHttpRequest();
+ t.onreadystatechange = function() {
+ if (t.readyState == 4 && t.status >= 200 && t.status < 300) {
if (m = t.responseText.match(/gist: ([a-f0-9]+)/))
notify("Code uploaded to gistie #" + m[1] + "", 1);
else
notify("Pasting to Gistie failed.", -1);
- },
- onFailure: function(t) {
- notify("Pasting to Gistie failed.", -1);
- },
- onException: function(t) {
- notify("Pasting to Gistie failed.", -1);
- },
-
- });
-
+ }
+ }
+
+ t.open('POST', "http://gist.github.com/gists?" + params);
+ t.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
+ t.setRequestHeader('Accept', 'text/javascript, text/html, application/xml, text/xml, */*');
+ t.setRequestHeader('Content-type', 'application/x-www-form-urlencoded;charset=UTF-8');
+
+ try {
+ t.send(params);
+ } catch(e) {
+ notify("Pasting to Gistie failed.", -1);
+ }
}
var setGravatar = function(email, image) {
@@ -116,12 +121,11 @@ var selectCommit = function(a) {
}
var showDiffs = function() {
- $("details").hide();
-
- $("details").innerHTML = commit.diff.escapeHTML();
-
+ var details = $("details");
+ details.style.display = "none";
+ details.innerHTML = commit.diff.escapeHTML();
highlightDiffs();
- $("details").show();
+ details.style.display = "";
}
var reload = function() {
@@ -133,15 +137,16 @@ var reload = function() {
}
var showRefs = function() {
- if (commit.refs){
- $('refs').parentNode.style.display = "";
- $('refs').innerHTML = "";
- $A(commit.refs).each(function(ref) {
- curBranch = "";
- $('refs').innerHTML += '' + ref.shortName() + '';
- });
+ var refs = $("refs");
+ if (commit.refs) {
+ refs.parentNode.style.display = "";
+ refs.innerHTML = "";
+ for (var i = 0; i < commit.refs.length; i++) {
+ var ref = commit.refs[i], curBranch = "";
+ refs.innerHTML += '' + ref.shortName() + '';
+ }
} else
- $('refs').parentNode.style.display = "none";
+ refs.parentNode.style.display = "none";
}
var loadCommit = function() {
@@ -157,15 +162,18 @@ var loadCommit = function() {
$("date").innerHTML = commit.author_date;
$("subjectID").innerHTML =CommitObject.subject.escapeHTML();
-
- $A($("commit_header").rows).each(function(row) {
+
+ var commitHeader = $("commit_header");
+ for (var i = 0; i < commitHeader.rows.length; i++) {
+ var row = commitHeader.rows[i];
if (row.innerHTML.match(/Parent:/))
- row.remove();
- });
- commit.parents.each(function(parent) {
- var new_row = $("commit_header").insertRow(-1);
+ row.parentNode.removeChild(row);
+ }
+
+ for (var i = 0; i < commit.parents; i++) {
+ var parent = commit.parents[i], newRow = commitHeader.insertRow(-1);
new_row.innerHTML = "Parent: | " + parent + " | ";
- });
+ }
showRefs();
diff --git a/html/diff.html b/html/diff.html
index 41ef450..26c262a 100644
--- a/html/diff.html
+++ b/html/diff.html
@@ -17,7 +17,7 @@
else
$("diff").innerHTML = "Could not display changes";
- $("diff").show();
+ $("diff").style.display = '';
$('title').innerHTML = "New file: " + file.path;
} else {
$("diff").style.display = 'none';
diff --git a/html/prototype.js b/html/prototype.js
deleted file mode 100644
index 6385503..0000000
--- a/html/prototype.js
+++ /dev/null
@@ -1,4221 +0,0 @@
-/* Prototype JavaScript framework, version 1.6.0.2
- * (c) 2005-2008 Sam Stephenson
- *
- * Prototype is freely distributable under the terms of an MIT-style license.
- * For details, see the Prototype web site: http://www.prototypejs.org/
- *
- *--------------------------------------------------------------------------*/
-
-var Prototype = {
- Version: '1.6.0.2',
-
- Browser: {
- IE: !!(window.attachEvent && !window.opera),
- Opera: !!window.opera,
- WebKit: navigator.userAgent.indexOf('AppleWebKit/') > -1,
- Gecko: navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('KHTML') == -1,
- MobileSafari: !!navigator.userAgent.match(/Apple.*Mobile.*Safari/)
- },
-
- BrowserFeatures: {
- XPath: !!document.evaluate,
- ElementExtensions: !!window.HTMLElement,
- SpecificElementExtensions:
- document.createElement('div').__proto__ &&
- document.createElement('div').__proto__ !==
- document.createElement('form').__proto__
- },
-
- ScriptFragment: '