Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Better placeholder for blame view

  • Loading branch information...
commit 64cefa238db1d5ad62f0560378ddd9cdbfbbfe16 1 parent f1c2cee
@Caged authored
View
8 assets/blame.html
@@ -8,8 +8,10 @@
<link rel="stylesheet" href="style.css" type="text/css" charset="utf-8" />
</head>
-<body>
- <div id="content">
+<body id="blame-view">
+ <h2 id="place-holder">Select a file</h2>
+
+ <div id="content" style="display:none">
<div id="metadata">
<h1 id="title"></h1>
<p id="hash"></p>
@@ -19,7 +21,7 @@ <h2 id="date"></h2>
<div id="main">
<div id="blame">
- <h2 id="place-holder">Select a file</h2>
+
</div>
</div>
</div>
View
23 assets/style.css
@@ -182,6 +182,21 @@ pre code {
/*------------------------------------------------------------------------------------
@group blame
------------------------------------------------------------------------------------*/
+#content {
+ width: 100%;
+ position: relative;
+ background: #fff;
+ color: #000;
+ bottom: 0;
+ top: 0;
+ height: 100%;
+}
+
+#blame-view {
+ background: #656565;
+ color: #ccc;
+}
+
#loading {
font-size: 120%;
font-family: "Lucida Grande", sans-serif;
@@ -196,11 +211,11 @@ pre code {
}
h2#place-holder {
- font-size: 400%;
- color: #eee;
- text-shadow: -1px -1px #ddd;
+ margin-top: 30%;
+ font-size: 120%;
+ color: #000;
+ text-shadow: 1px 1px #777;
text-align: center;
- text-transform: uppercase;
}
#blame-list li {
View
12 controllers/TreeController.rb
@@ -14,8 +14,11 @@
class TreeController < OSX::NSObject
IMAGE_MIMES = ["image/png", "img/jpeg", "image/jpg", "image/gif", "img/bmp"]
ELEMENTS = {
- :blame => 'blame',
- :list => 'blame-list'
+ :blame => 'blame',
+ :list => 'blame-list',
+ :wrapper => 'blame-view',
+ :content => 'content',
+ :placeholder => 'place-holder'
}
ib_outlet :tree_outline
@@ -54,6 +57,10 @@ def item_was_selected(notification)
commit = app.repo.commit(branch)
blob = commit.tree/file
+ doc.getElementById(ELEMENTS[:wrapper]).setAttribute__('style', 'background:#fff')
+ doc.getElementById(ELEMENTS[:placeholder]).setAttribute__('style', 'display:none')
+ content = doc.getElementById(ELEMENTS[:content])
+ content.setAttribute__('style', 'display:block')
set_html('title', File.basename(file))
element = doc.getElementById(ELEMENTS[:blame])
element.setInnerHTML("")
@@ -91,6 +98,7 @@ def item_was_selected(notification)
element.setInnerHTML("")
element.appendChild(blame_list)
else
+ element.setInnerHTML("")
set_html('hash', 'Untracked or ignored file')
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.