dolt 0.29.0 → 0.30.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. data/dolt.gemspec +1 -1
  2. data/lib/dolt/sinatra/multi_repo_browser.rb +11 -31
  3. data/lib/dolt/sinatra/repo_browser.rb +47 -0
  4. data/lib/dolt/sinatra/single_repo_browser.rb +15 -29
  5. metadata +4 -75
  6. data/vendor/ui/.gitignore +0 -4
  7. data/vendor/ui/.gitmodules +0 -39
  8. data/vendor/ui/Makefile +0 -48
  9. data/vendor/ui/autolint.js +0 -13
  10. data/vendor/ui/buster.js +0 -31
  11. data/vendor/ui/css/gitorious.css +0 -660
  12. data/vendor/ui/css/syntax-highlight.css +0 -140
  13. data/vendor/ui/dist/gitorious3-capillary.min.js +0 -12
  14. data/vendor/ui/dist/gitorious3.min.css +0 -1
  15. data/vendor/ui/dist/gitorious3.min.js +0 -3
  16. data/vendor/ui/favicon.ico +0 -0
  17. data/vendor/ui/iconic/lock_stroke.svg +0 -17
  18. data/vendor/ui/images/f5f5f5-980x1.png +0 -0
  19. data/vendor/ui/images/gitorious.png +0 -0
  20. data/vendor/ui/images/gitorious2013.png +0 -0
  21. data/vendor/ui/images/powered-by.png +0 -0
  22. data/vendor/ui/images/white-980x1.png +0 -0
  23. data/vendor/ui/js/src/app.js +0 -20
  24. data/vendor/ui/js/src/cache.js +0 -27
  25. data/vendor/ui/js/src/capillary.js +0 -7
  26. data/vendor/ui/js/src/components/abbrev.js +0 -24
  27. data/vendor/ui/js/src/components/blob.js +0 -154
  28. data/vendor/ui/js/src/components/capillary.js +0 -51
  29. data/vendor/ui/js/src/components/clone-name-suggestion.js +0 -38
  30. data/vendor/ui/js/src/components/clone-url-selection.js +0 -35
  31. data/vendor/ui/js/src/components/collapse.js +0 -17
  32. data/vendor/ui/js/src/components/comments.js +0 -111
  33. data/vendor/ui/js/src/components/commit-linker.js +0 -26
  34. data/vendor/ui/js/src/components/dropdown.js +0 -74
  35. data/vendor/ui/js/src/components/ganalytics.js +0 -19
  36. data/vendor/ui/js/src/components/live-markdown-preview.js +0 -35
  37. data/vendor/ui/js/src/components/loading.js +0 -33
  38. data/vendor/ui/js/src/components/oid-ref-interpolator.js +0 -9
  39. data/vendor/ui/js/src/components/profile-menu.js +0 -36
  40. data/vendor/ui/js/src/components/rails-links.js +0 -24
  41. data/vendor/ui/js/src/components/ref-selector.js +0 -116
  42. data/vendor/ui/js/src/components/repository.js +0 -162
  43. data/vendor/ui/js/src/components/select-details.js +0 -20
  44. data/vendor/ui/js/src/components/slugify.js +0 -32
  45. data/vendor/ui/js/src/components/timeago.js +0 -38
  46. data/vendor/ui/js/src/components/tree-history.js +0 -140
  47. data/vendor/ui/js/src/components/url.js +0 -65
  48. data/vendor/ui/js/src/components/user-repo-view-state.js +0 -4
  49. data/vendor/ui/js/src/gitorious.js +0 -171
  50. data/vendor/ui/js/src/json-request.js +0 -6
  51. data/vendor/ui/js/src/logger.js +0 -84
  52. data/vendor/ui/js/src/spacer.js +0 -5
  53. data/vendor/ui/js/test-libs/jquery-1.9.1.min.js +0 -5
  54. data/vendor/ui/js/test/cache-test.js +0 -47
  55. data/vendor/ui/js/test/components/abbrev-test.js +0 -22
  56. data/vendor/ui/js/test/components/blob-test.js +0 -90
  57. data/vendor/ui/js/test/components/clone-name-suggestion-test.js +0 -37
  58. data/vendor/ui/js/test/components/clone-url-selection-test.js +0 -25
  59. data/vendor/ui/js/test/components/comments-test.js +0 -139
  60. data/vendor/ui/js/test/components/commit-linker-test.js +0 -46
  61. data/vendor/ui/js/test/components/live-markdown-preview-test.js +0 -37
  62. data/vendor/ui/js/test/components/profile-menu-test.js +0 -46
  63. data/vendor/ui/js/test/components/ref-selector-test.js +0 -140
  64. data/vendor/ui/js/test/components/repository-admin-test.js +0 -37
  65. data/vendor/ui/js/test/components/repository-watching-test.js +0 -74
  66. data/vendor/ui/js/test/components/timeago-test.js +0 -74
  67. data/vendor/ui/js/test/components/tree-history-test.js +0 -324
  68. data/vendor/ui/js/test/components/url-template-test.js +0 -65
  69. data/vendor/ui/js/test/test-helper.js +0 -2
  70. data/vendor/ui/lib/bootstrap/css/bootstrap-responsive.min.css +0 -9
  71. data/vendor/ui/lib/bootstrap/css/bootstrap.min.css +0 -9
  72. data/vendor/ui/lib/bootstrap/img/glyphicons-halflings-white.png +0 -0
  73. data/vendor/ui/lib/bootstrap/img/glyphicons-halflings.png +0 -0
  74. data/vendor/ui/lib/bootstrap/js/bootstrap.min.js +0 -6
  75. data/vendor/ui/package.json +0 -21
  76. data/vendor/ui/todo.org +0 -4
@@ -1,37 +0,0 @@
1
- /*global buster, dome, gts*/
2
-
3
- buster.testCase("Clone name suggestion", {
4
- setUp: function () {
5
- this.form = dome.el("form", {
6
- "data": { "gts-repository-to-clone": "gitorious" }
7
- }, [
8
- dome.el("input", {
9
- checked: "checked",
10
- id: "repository_owner_type_user",
11
- name: "repository[owner_type]",
12
- value: "User",
13
- type: "radio",
14
- data: { "gts-owner": "christian" }
15
- }),
16
-
17
- dome.el("input", {
18
- id: "repository_owner_type_group",
19
- name: "repository[owner_type]",
20
- type: "radio",
21
- value: "Group"
22
- }),
23
-
24
- dome.el("select", {
25
- id: "repository_owner_id_group_select",
26
- name: "repository[owner_id]"
27
- }, [
28
- dome.el("option", { value: 1 }, "gitorians"),
29
- dome.el("option", { value: 2 }, "blargians")
30
- ])
31
- ]);
32
- },
33
-
34
- "//suggests username-scoped clone name": function () {
35
-
36
- }
37
- });
@@ -1,25 +0,0 @@
1
- /*global buster, assert, jQuery, gts*/
2
-
3
- buster.testCase("Clone URL selection", {
4
- setUp: function () {
5
- /*:DOC element = <div class="btn-group gts-repo-urls">
6
- <a class="btn gts-repo-url" href="git://gitorious.org/gitorious/mainline.git">Git</a>
7
- <a class="btn gts-repo-url" href="http://git.gitorious.org/gitorious/mainline.git">HTTP</a>
8
- <a class="active btn gts-repo-url" href="ssh://git@gitorious.org:gitorious/mainline.git">SSH</a>
9
- <input class="span4 gts-current-repo-url gts-select-onfocus" type="url" value="git@gitorious.org:gitorious/mainline.git">
10
- <button data-toggle="collapse" data-target="#repo-url-help" class="gts-repo-url-help btn">?</button>
11
- </div>*/
12
- this.input = this.element.getElementsByTagName("input")[0];
13
- this.buttons = this.element.getElementsByTagName("a");
14
- },
15
-
16
- "copies git:// href to input": function () {
17
- gts.cloneUrlSelection.select(this.element, this.buttons[0]);
18
- assert.equals(this.input.value, "git://gitorious.org/gitorious/mainline.git");
19
- },
20
-
21
- "copies ssh:// href to input": function () {
22
- gts.cloneUrlSelection.select(this.element, this.buttons[2]);
23
- assert.equals(this.input.value, "git@gitorious.org:gitorious/mainline.git");
24
- }
25
- });
@@ -1,139 +0,0 @@
1
- /*global buster, assert, dome, gts*/
2
- buster.testCase("Comments", {
3
- "renderForm": {
4
- "renders comment div": function () {
5
- var div = gts.comments.renderComment({
6
- body: "<h2>Hey</h2>",
7
- createdAt: "2013-01-01T23:10:15+02:00",
8
- updatedAt: "2013-01-01T23:10:15+02:00",
9
- author: {
10
- avatarPath: "/some/avatar.png",
11
- profilePath: "/~cjohansen",
12
- name: "Christian Johansen",
13
- login: "cjohansen"
14
- }
15
- });
16
-
17
- assert.tagName(div, "div");
18
- assert.className(div, "gts-comment");
19
- assert.equals(div.firstChild.firstChild.innerHTML, "Hey");
20
- assert.match(div.innerHTML, "/some/avatar.png");
21
- assert.match(div.innerHTML, "href=\"/~cjohansen\">Christian Johansen");
22
- assert.match(div.innerHTML, "2013");
23
- refute.match(div.innerHTML, "Edit comment");
24
- refute.match(div.innerHTML, "edited");
25
- },
26
-
27
- "renders editable comment": function () {
28
- var div = gts.comments.renderComment({
29
- body: "<h2>Hey</h2>",
30
- createdAt: "2013-01-01T23:10:15+02:00",
31
- updatedAt: "2013-01-01T23:10:15+02:00",
32
- editPath: "/comments/123456789/edit",
33
- author: {
34
- avatarPath: "/some/avatar.png",
35
- profilePath: "/~cjohansen",
36
- name: "Christian Johansen",
37
- login: "cjohansen"
38
- }
39
- });
40
-
41
- assert.match(div.innerHTML, "/comments/123456789/edit");
42
- assert.match(div.innerHTML, "Edit comment");
43
- },
44
-
45
- "renders edited comment": function () {
46
- var div = gts.comments.renderComment({
47
- body: "<h2>Hey</h2>",
48
- createdAt: "2013-01-01T23:10:15+02:00",
49
- updatedAt: "2013-01-01T23:25:15+02:00",
50
- editPath: "/comments/123456789/edit",
51
- author: {
52
- avatarPath: "/some/avatar.png",
53
- profilePath: "/~cjohansen",
54
- name: "Christian Johansen",
55
- login: "cjohansen"
56
- }
57
- });
58
-
59
- assert.match(div.innerHTML, "edited");
60
- }
61
- },
62
-
63
- "personalizeForm": {
64
- setUp: function () {
65
- this.form = dome.el("form", {
66
- style: { display: "none" }
67
- }, dome.el("div", { className: "gts-comment-author-ph" }));
68
- },
69
-
70
- "displays form": function () {
71
- gts.comments.personalizeForm({}, this.form);
72
-
73
- assert.equals(this.form.style.display, "block");
74
- },
75
-
76
- "renders user in placeholder": function () {
77
- this.useFakeTimers(new Date(2013, 0, 1, 12, 0, 0).getTime());
78
-
79
- gts.comments.personalizeForm({
80
- login: "cjohansen",
81
- name: "Christian Johansen",
82
- avatarPath: "/some/avatar.png",
83
- profilePath: "/~cjohansen"
84
- }, this.form);
85
-
86
- assert.tagName(this.form.firstChild, "p");
87
- var markup = this.form.firstChild.innerHTML;
88
- assert.match(markup, "<img");
89
- assert.match(markup, "/some/avatar.png");
90
- assert.match(markup, "/~cjohansen");
91
- assert.match(markup, "Christian Johansen");
92
- assert.match(markup, "12:00");
93
- }
94
- },
95
-
96
- "renderComments": {
97
- "displays container": function () {
98
- var container = dome.el("div", { style: { display: "none" } });
99
- gts.comments.renderComments([{ author: {} }], container);
100
-
101
- assert.equals(container.style.display, "block");
102
- },
103
-
104
- "does not display container when no comments": function () {
105
- var container = dome.el("div", { style: { display: "none" } });
106
- gts.comments.renderComments([], container);
107
-
108
- assert.equals(container.style.display, "none");
109
- },
110
-
111
- "renders all comments": function () {
112
- var container = dome.el("div", { style: { display: "none" } });
113
- gts.comments.renderComments([{
114
- body: "One",
115
- createdAt: "2013-01-01T23:10:15+02:00",
116
- updatedAt: "2013-01-01T23:10:15+02:00",
117
- author: {
118
- avatarPath: "/some/avatar.png",
119
- profilePath: "/~cjohansen",
120
- name: "Christian Johansen",
121
- login: "cjohansen"
122
- }
123
- }, {
124
- body: "Two",
125
- createdAt: "2013-01-01T23:10:15+02:00",
126
- updatedAt: "2013-01-01T23:10:15+02:00",
127
- author: {
128
- avatarPath: "/some/avatar.png",
129
- profilePath: "/~cjohansen",
130
- name: "Christian Johansen",
131
- login: "cjohansen"
132
- }
133
- }], container);
134
-
135
- assert.match(container.innerHTML, "One");
136
- assert.match(container.innerHTML, "Two");
137
- }
138
- }
139
- });
@@ -1,46 +0,0 @@
1
- /*global buster, assert, refute, jQuery, gts*/
2
- buster.testCase("Commit linker", {
3
- setUp: function () {
4
- this.el = document.createElement("div");
5
- // Required for even triggering to work properly
6
- document.body.appendChild(this.el);
7
- },
8
-
9
- "triggers handler for gts-commit-oid link": function () {
10
- var cb = this.spy();
11
- this.el.innerHTML = "<span class=\"gts-commit-oid\" " +
12
- "data-gts-commit-oid=\"master\">master</span>";
13
-
14
- gts.commitLinker(this.el, "/gitorious/mainline/commit/#{oid}", cb);
15
- jQuery(this.el.firstChild).trigger("click");
16
-
17
- assert.calledOnceWith(cb, "/gitorious/mainline/commit/master");
18
- },
19
-
20
- "does not trigger handler for regular link": function () {
21
- var cb = this.spy();
22
- this.el.innerHTML = "<span>master</span>";
23
-
24
- gts.commitLinker(this.el, "/gitorious/mainline/commit/#{oid}", cb);
25
- jQuery(this.el.firstChild).trigger("click");
26
-
27
- refute.called(cb);
28
- },
29
-
30
- "triggers handler for link added later": function () {
31
- var cb = this.spy();
32
-
33
- gts.commitLinker(this.el, "/gitorious/mainline/commit/#{oid}", cb);
34
- this.el.innerHTML = "<span class=\"gts-commit-oid\" " +
35
- "data-gts-commit-oid=\"master\">master</span>";
36
- jQuery(this.el.firstChild).trigger("click");
37
-
38
- assert.calledOnce(cb);
39
- },
40
-
41
- "adds class name to root element": function () {
42
- gts.commitLinker(this.el, "/gitorious/mainline/commit/#{oid}");
43
-
44
- assert.className(this.el, "gts-commit-linker");
45
- }
46
- });
@@ -1,37 +0,0 @@
1
- /*global buster, assert, dome, gts*/
2
-
3
- buster.testCase("Live markdown preview", {
4
- setUp: function () {
5
- var el = dome.el("div", [
6
- dome.el("textarea"),
7
- dome.el("div", { id: "target" }, [dome.el("div")])
8
- ]);
9
-
10
- document.body.appendChild(el);
11
- this.textarea = el.firstChild;
12
- this.textarea.setAttribute("data-gts-preview-target", "target");
13
- this.target = el.lastChild.firstChild;
14
- this.clock = this.useFakeTimers();
15
- },
16
-
17
- "renders markdown as html in div": function () {
18
- gts.liveMarkdownPreview(this.textarea);
19
- this.textarea.innerHTML = "*hey*";
20
-
21
- this.clock.tick(50);
22
-
23
- assert.match(this.target.innerHTML, "<em>hey</em>");
24
- },
25
-
26
- "updates rendered html": function () {
27
- gts.liveMarkdownPreview(this.textarea);
28
- this.textarea.innerHTML = "*hey*";
29
- this.clock.tick(50);
30
-
31
- this.textarea.innerHTML = "# OH!";
32
- this.clock.tick(50);
33
-
34
- refute.match(this.target.innerHTML, "<em>hey</em>");
35
- assert.match(this.target.innerHTML, /<h1.*>OH!<\/h1>/);
36
- }
37
- });
@@ -1,46 +0,0 @@
1
- /*global buster, assert, gts*/
2
-
3
- buster.testCase("Profile menu", {
4
- "does nothing when no user": function () {
5
- var el = document.createElement("div");
6
- gts.profileMenu(el, null);
7
-
8
- assert.equals(el.innerHTML, "");
9
- },
10
-
11
- "with user": {
12
- setUp: function () {
13
- this.el = document.createElement("div");
14
- var user = {
15
- dashboardPath: "/dashboard",
16
- login: "cjohansen",
17
- editPath: "/user/edit",
18
- messagesPath: "/messages",
19
- profilePath: "/~cjohansen",
20
- logoutPath: "/logout"
21
- };
22
-
23
- gts.profileMenu(this.el, user);
24
- },
25
-
26
- "adds button linking to dashboard": function () {
27
- assert.match(this.el.innerHTML, "href=\"/dashboard\">");
28
- assert.match(this.el.innerHTML, "cjohansen");
29
- },
30
-
31
- "adds dropdown button": function () {
32
- assert.match(this.el.innerHTML, "btn-inverse dropdown-toggle");
33
- assert.match(this.el.innerHTML, "span class=\"caret\"");
34
- },
35
-
36
- "adds dropdown menu": function () {
37
- var ul = this.el.getElementsByTagName("ul")[0];
38
- assert.className(ul, "dropdown-menu");
39
- assert.match(ul.innerHTML, "Edit");
40
- assert.match(ul.innerHTML, "Messages");
41
- assert.match(ul.innerHTML, "Dashboard");
42
- assert.match(ul.innerHTML, "Public profile");
43
- assert.match(ul.innerHTML, "Log out");
44
- }
45
- }
46
- });
@@ -1,140 +0,0 @@
1
- /*global buster, assert, refute, jQuery, gts*/
2
- buster.testCase("Ref selector", {
3
- "returns div": function () {
4
- var element = gts.refSelector.build({});
5
-
6
- assert.tagName(element, "div");
7
- assert.className(element, "dropdown");
8
- assert.className(element, "gts-branch-selector");
9
- },
10
-
11
- "includes link to current branch by ref": function () {
12
- var element = gts.refSelector.build({
13
- heads: [["master", "0123456"]]
14
- }, "0123456");
15
- var a = element.firstChild;
16
-
17
- assert.tagName(a, "a");
18
- assert.className(a, "dropdown-toggle");
19
- assert.match(a.innerHTML, "caret");
20
- assert.match(a.innerHTML, "branch:");
21
- assert.match(a.innerHTML, "master");
22
- },
23
-
24
- "includes link to current branch by name": function () {
25
- var element = gts.refSelector.build({
26
- heads: [["master", "0123456"]]
27
- }, "master");
28
- var a = element.firstChild;
29
-
30
- assert.tagName(a, "a");
31
- assert.className(a, "dropdown-toggle");
32
- assert.match(a.innerHTML, "caret");
33
- assert.match(a.innerHTML, "branch:");
34
- assert.match(a.innerHTML, "master");
35
- },
36
-
37
- "includes link to current tag": function () {
38
- var element = gts.refSelector.build({
39
- tags: [["v2.1.0", "1234567"]]
40
- }, "1234567");
41
-
42
- assert.match(element.firstChild.innerHTML, "tag:");
43
- },
44
-
45
- "includes link to current ref": function () {
46
- var element = gts.refSelector.build({
47
- tags: [["v2.1.0", "1234567"]]
48
- }, "aabbcc4");
49
-
50
- assert.match(element.firstChild.innerHTML, "ref:");
51
- },
52
-
53
- "includes list of refs": function () {
54
- var element = gts.refSelector.build({});
55
-
56
- assert.tagName(element.childNodes[1], "ul");
57
- assert.className(element.childNodes[1], "dropdown-menu");
58
- },
59
-
60
- "includes ref input": function () {
61
- var list = gts.refSelector.build({}).childNodes[1];
62
-
63
- assert.className(list.firstChild, "gts-dropdown-input");
64
- assert.match(list.firstChild.innerHTML, "Enter ref:");
65
- },
66
-
67
- "links all heads": function () {
68
- var element = gts.refSelector.build({
69
- heads: [["libgit2", "1234567"], ["master", "2345678"]],
70
- tags: [["v2.1.0", "34565789"], ["v2.1.1", "45657890"]]
71
- }, "2345678");
72
-
73
- var list = element.childNodes[1];
74
- assert.className(list.childNodes[1], "dropdown-label");
75
- assert.match(list.childNodes[1].innerHTML, "Branches");
76
- assert.match(list.childNodes[2].innerHTML, "libgit2");
77
- assert.match(list.childNodes[3].innerHTML, "master");
78
- },
79
-
80
- "links all tags": function () {
81
- var element = gts.refSelector.build({
82
- heads: ["libgit2", "master"],
83
- tags: [["v2.1.0", "1234567"], ["v2.1.1", "2345678"]]
84
- }, "2345678");
85
-
86
- var list = element.childNodes[1];
87
- assert.className(list.childNodes[4], "dropdown-label");
88
- assert.match(list.childNodes[4].innerHTML, "Tags");
89
- assert.match(list.childNodes[5].innerHTML, "v2.1.0");
90
- assert.match(list.childNodes[6].innerHTML, "v2.1.1");
91
- },
92
-
93
- "sorts refs alpha-numerically": function () {
94
- var element = gts.refSelector.build({
95
- "heads": [["feature-B", "1234567"],
96
- ["master", "2345678"],
97
- ["feature-A", "3456789"]],
98
- "tags": [["0.7.0", "4567890"],
99
- ["0.7.1", "5678901"],
100
- ["1.3.1", "6789012"],
101
- ["1.0.0", "7890123"]]
102
- });
103
-
104
- var list = element.childNodes[1];
105
- assert.match(list.childNodes[2].innerHTML, "feature-A");
106
- assert.match(list.childNodes[3].innerHTML, "feature-B");
107
- assert.match(list.childNodes[4].innerHTML, "master");
108
- assert.match(list.childNodes[6].innerHTML, "0.7.0");
109
- assert.match(list.childNodes[7].innerHTML, "0.7.1");
110
- assert.match(list.childNodes[8].innerHTML, "1.0.0");
111
- assert.match(list.childNodes[9].innerHTML, "1.3.1");
112
- },
113
-
114
- "// does not propagate clicks on input": function () {
115
- // Since switching from jQuery to Dome, this test no longer works,
116
- // as it's not possible(?) to fake the stopPropagation method.
117
- // Not sure how to solve
118
- var element = gts.refSelector.build({
119
- heads: [["libgit2", "1234567"], ["master", "2345678"]],
120
- tags: [["v2.1.0", "34565789"], ["v2.1.1", "45657890"]]
121
- }, "2345678");
122
-
123
- var event = jQuery.Event("click");
124
- event.stopPropagation = this.spy();
125
- jQuery(element).find("input[type=text]").trigger(event);
126
-
127
- assert.calledOnce(event.stopPropagation);
128
- },
129
-
130
- "uses URL template to generate links": function () {
131
- var element = gts.refSelector.build({
132
- heads: [["libgit2", "1234567"], ["master", "2345678"]],
133
- tags: [["v2.1.0", "34565789"], ["v2.1.1", "45657890"]]
134
- }, "2345678", "/dolt/#{ref}:");
135
-
136
- var list = element.childNodes[1];
137
- assert.match(list.childNodes[2].firstChild.href, "/dolt/1234567:");
138
- assert.equals(list.childNodes[2].firstChild.innerHTML, "libgit2");
139
- }
140
- });