dolt 0.13.0 → 0.14.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +3 -3
- data/Readme.org +161 -0
- data/bin/dolt +23 -3
- data/dolt.gemspec +1 -1
- data/vendor/ui/.gitignore +3 -1
- data/vendor/ui/.gitmodules +21 -18
- data/vendor/ui/build +18 -19
- data/vendor/ui/buster.js +20 -5
- data/vendor/ui/css/gitorious.css +19 -3
- data/vendor/ui/dist/gts-ui-deps.js +1 -27
- data/vendor/ui/images/gitorious.png +0 -0
- data/vendor/ui/js/src/app.js +345 -0
- data/vendor/ui/js/src/components/abbrev.js +25 -0
- data/vendor/ui/js/src/components/commit-linker.js +26 -0
- data/vendor/ui/js/src/components/profile-menu.js +34 -0
- data/vendor/ui/js/{components → src/components}/ref-selector.js +32 -4
- data/vendor/ui/js/src/components/tree-history.js +138 -0
- data/vendor/ui/js/src/components/url.js +64 -0
- data/vendor/ui/js/{gitorious.js → src/gitorious.js} +19 -0
- data/vendor/ui/js/test-libs/jquery-1.9.1.min.js +5 -0
- data/vendor/ui/js/test/app-test.js +386 -0
- data/vendor/ui/{test → js/test/components}/abbrev-test.js +0 -0
- data/vendor/ui/js/test/components/commit-linker-test.js +41 -0
- data/vendor/ui/js/test/components/profile-menu-test.js +46 -0
- data/vendor/ui/{test → js/test/components}/ref-selector-test.js +4 -1
- data/vendor/ui/{test → js/test/components}/tree-history-test.js +0 -0
- data/vendor/ui/{test → js/test/components}/url-template-test.js +9 -0
- data/vendor/ui/todo.org +4 -0
- metadata +38 -30
- data/Readme.md +0 -97
- data/vendor/ui/js/components/abbrev.js +0 -17
- data/vendor/ui/js/components/tree-history.js +0 -79
- data/vendor/ui/js/components/url.js +0 -31
@@ -1,17 +0,0 @@
|
|
1
|
-
var gts = this.gts || {};
|
2
|
-
|
3
|
-
gts.abbrev = function (sentence, width, padding) {
|
4
|
-
if (sentence.length <= width) { return sentence; }
|
5
|
-
padding = padding || "";
|
6
|
-
var words = sentence.split(" ");
|
7
|
-
var result = [];
|
8
|
-
var len;
|
9
|
-
|
10
|
-
for (var i = 0, l = words.length; i < l; ++i) {
|
11
|
-
len = result.join(" ").length + words[i].length + padding.length;
|
12
|
-
if (len > width) { break; }
|
13
|
-
result.push(words[i]);
|
14
|
-
}
|
15
|
-
|
16
|
-
return result.join(" ") + padding;
|
17
|
-
};
|
@@ -1,79 +0,0 @@
|
|
1
|
-
/*global cull, Spinner*/
|
2
|
-
this.gts = this.gts || {};
|
3
|
-
|
4
|
-
this.gts.treeHistory = (function (c, $) {
|
5
|
-
var th = function (table, url) {
|
6
|
-
var cell = $(table).find("tbody tr:first td")[2];
|
7
|
-
var spinner = new Spinner({
|
8
|
-
lines: 13,
|
9
|
-
length: 1,
|
10
|
-
width: 2,
|
11
|
-
radius: 6,
|
12
|
-
corners: 1,
|
13
|
-
rotate: 0,
|
14
|
-
color: "#000",
|
15
|
-
speed: 1,
|
16
|
-
trail: 60,
|
17
|
-
shadow: false,
|
18
|
-
hwaccel: true,
|
19
|
-
className: "spinner",
|
20
|
-
zIndex: 2e9,
|
21
|
-
top: "auto",
|
22
|
-
left: "auto"
|
23
|
-
}).spin(cell);
|
24
|
-
$.ajax({
|
25
|
-
url: url,
|
26
|
-
success: function (tree) {
|
27
|
-
spinner.stop();
|
28
|
-
th.annotate(table, tree);
|
29
|
-
}
|
30
|
-
});
|
31
|
-
};
|
32
|
-
|
33
|
-
var months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun",
|
34
|
-
"Jul", "Aug", "Sep", "Oct", "Nov", "Dev"];
|
35
|
-
|
36
|
-
function getFileMeta(fileName, tree) {
|
37
|
-
return c.select(function (e) {
|
38
|
-
return e.name === fileName;
|
39
|
-
}, tree)[0];
|
40
|
-
}
|
41
|
-
|
42
|
-
function formatDate(dateStr) {
|
43
|
-
if (!Date.parse) { return ""; }
|
44
|
-
var d = new Date(Date.parse(dateStr));
|
45
|
-
return months[d.getMonth()] + " " + d.getDate() + " " + d.getFullYear();
|
46
|
-
}
|
47
|
-
|
48
|
-
function getTreeIndent(cells) {
|
49
|
-
for (var i = 0, l = cells.length; i < l; ++i) {
|
50
|
-
if (c.dom.hasClassName("gts-name", cells[i])) {
|
51
|
-
return i;
|
52
|
-
}
|
53
|
-
}
|
54
|
-
|
55
|
-
return i;
|
56
|
-
}
|
57
|
-
|
58
|
-
th.annotateRow = function (tree, row) {
|
59
|
-
var tds = row.getElementsByTagName("td");
|
60
|
-
var offset = getTreeIndent(tds);
|
61
|
-
var entry = getFileMeta($.trim($(tds[offset]).text()), tree);
|
62
|
-
if (!entry) { return; }
|
63
|
-
var commit = entry.history[0];
|
64
|
-
tds[offset + 1].innerHTML = formatDate(commit.date);
|
65
|
-
$(tds[offset + 2]).attr("data-gts-commit-oid", commit.oid);
|
66
|
-
tds[offset + 2].innerHTML = "#" + commit.oid.slice(0, 7);
|
67
|
-
tds[offset + 3].innerHTML = gts.abbrev(commit.summary, 50, " [...]") +
|
68
|
-
" (" + commit.author.name + ")";
|
69
|
-
};
|
70
|
-
|
71
|
-
th.annotate = function (table, tree) {
|
72
|
-
var rows = $(table).find("tbody tr");
|
73
|
-
c.doall(c.partial(function (tree, row) {
|
74
|
-
th.annotateRow(tree, row);
|
75
|
-
}, tree), rows);
|
76
|
-
};
|
77
|
-
|
78
|
-
return th;
|
79
|
-
}(cull, jQuery));
|
@@ -1,31 +0,0 @@
|
|
1
|
-
this.gts = this.gts || {};
|
2
|
-
|
3
|
-
this.gts.url = (function () {
|
4
|
-
function path(url) {
|
5
|
-
var pieces = url.split("/");
|
6
|
-
pieces.shift();
|
7
|
-
pieces.shift();
|
8
|
-
pieces.shift();
|
9
|
-
return "/" + pieces.join("/");
|
10
|
-
}
|
11
|
-
|
12
|
-
function templatize(url, values) {
|
13
|
-
var newUrl = path(url);
|
14
|
-
|
15
|
-
for (var n in values) {
|
16
|
-
newUrl = newUrl.replace(new RegExp(values[n], "g"), "#{" + n + "}");
|
17
|
-
}
|
18
|
-
|
19
|
-
return newUrl;
|
20
|
-
}
|
21
|
-
|
22
|
-
function currentRef(url) {
|
23
|
-
var refPath = url.split(/(blame|blob|tree|history|raw|source|readme)\//)[2];
|
24
|
-
return refPath && refPath.split(":")[0] || null;
|
25
|
-
}
|
26
|
-
|
27
|
-
return {
|
28
|
-
templatize: templatize,
|
29
|
-
currentRef: currentRef
|
30
|
-
};
|
31
|
-
}());
|