public
Description: A Gitk-like application written in RubyCocoa that looks like it belongs on a Mac. See the wiki for downloads and screenshots.
Homepage: http://alternateidea.com
Clone URL: git://github.com/Caged/gitnub.git
Search Repo:
Click here to lend your support to: gitnub and make a donation at www.pledgie.com !
Split messages into title/message so multi-line commits look better
kballard (author)
Fri Mar 21 17:55:54 -0700 2008
commit  40708baadcc146c41c9912ddb40b230710a104ee
tree    19bc74b22596e9fc82e2e864154946207142fc1b
parent  98b5ff64c13c0ff1c1822237d5468186cdb0087b
...
110
111
112
113
 
 
 
 
 
 
 
 
114
115
116
...
216
217
218
 
 
 
 
 
 
 
 
 
 
219
220
...
110
111
112
 
113
114
115
116
117
118
119
120
121
122
123
...
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
0
@@ -110,7 +110,14 @@
0
   def update_main_document
0
     diffs = []
0
     doc = @commit_details.mainFrame.DOMDocument
0
- set_html("message", active_commit.message.gsub("\n", "<br />"))
0
+ title, message = active_commit.message.split("\n", 2)
0
+ set_html("title", title.strip.gsub("\n", "<br />"))
0
+ if message
0
+ set_html("message", message.strip.gsub("\n", "<br />"))
0
+ show_element("message")
0
+ else
0
+ hide_element("message")
0
+ end
0
     set_html("hash", active_commit.id)
0
 
0
     if Time.now.day == active_commit.authored_date.day
0
@@ -216,6 +223,16 @@
0
   
0
   def set_html(element, html)
0
     @commit_details.mainFrame.DOMDocument.getElementById(element).setInnerHTML(html)
0
+ end
0
+
0
+ def show_element(element)
0
+ element = @commit_details.mainFrame.DOMDocument.getElementById(element)
0
+ element.style.removeProperty("display")
0
+ end
0
+
0
+ def hide_element(element)
0
+ element = @commit_details.mainFrame.DOMDocument.getElementById(element)
0
+ element.style.setProperty_value_priority("display", "none", nil)
0
   end
0
 end
...
232
233
234
235
 
236
237
238
...
367
368
369
370
 
371
372
373
...
232
233
234
 
235
236
237
238
...
367
368
369
 
370
371
372
373
0
@@ -232,7 +232,7 @@
0
 /* Begin PBXProject section */
0
     29B97313FDCFA39411CA2CEA /* Project object */ = {
0
       isa = PBXProject;
0
- buildConfigurationList = 4D7A7B570ABF745500C2D4C0 /* Build configuration list for PBXProject "GitNub" */;
0
+ buildConfigurationList = 4D7A7B570ABF745500C2D4C0 /* Build configuration list for PBXProject "gitnub" */;
0
       compatibilityVersion = "Xcode 2.4";
0
       hasScannedForEncodings = 0;
0
       mainGroup = 29B97314FDCFA39411CA2CEA /* GitNub */;
0
@@ -367,7 +367,7 @@
0
 /* End XCBuildConfiguration section */
0
 
0
 /* Begin XCConfigurationList section */
0
- 4D7A7B570ABF745500C2D4C0 /* Build configuration list for PBXProject "GitNub" */ = {
0
+ 4D7A7B570ABF745500C2D4C0 /* Build configuration list for PBXProject "gitnub" */ = {
0
       isa = XCConfigurationList;
0
       buildConfigurations = (
0
         4D7A7B580ABF745500C2D4C0 /* Debug */,
...
10
11
12
13
14
15
16
17
18
 
 
 
 
 
 
19
20
21
...
10
11
12
 
 
 
 
 
 
13
14
15
16
17
18
19
20
21
0
@@ -10,12 +10,12 @@
0
 
0
 <body>
0
   <div id="content">
0
- <h1 id="commit">
0
- <span id="message"></span>
0
- <span id="hash"></span>
0
- </h1>
0
- <h2 id="date"></h2>
0
-
0
+ <div id="metadata">
0
+ <h1 id="title"></h1>
0
+ <div id="message"></div>
0
+ <div id="hash"></div>
0
+ <h2 id="date"></h2>
0
+ </div>
0
     
0
     <div id="main">
0
       <ul id="files">
...
66
67
68
 
 
 
 
 
69
70
 
71
72
73
74
75
76
77
 
 
 
 
 
78
79
 
80
81
82
 
83
84
85
...
90
91
92
 
93
94
95
...
66
67
68
69
70
71
72
73
74
 
75
76
 
 
77
78
79
80
81
82
83
84
85
86
 
87
88
89
 
90
91
92
93
...
98
99
100
101
102
103
104
0
@@ -66,20 +66,28 @@
0
 /* @end */
0
 
0
 /* @group details */
0
+#metadata {
0
+ padding: 9px;
0
+ margin: 0 9px;
0
+}
0
+
0
 h1 {
0
- border-bottom: 1px solid #eee;
0
+ margin: 9px 0;
0
   font-size: 150%;
0
- padding: 9px;
0
- margin: 9px;
0
   line-height: 130%;
0
   color: #222;
0
 }
0
 
0
+#message {
0
+ margin-top: 1em;
0
+ margin-bottom: 9px;
0
+}
0
+
0
 #hash {
0
- font-size: 62%;
0
+ font-size: 93%;
0
   color: #888;
0
   font-weight: normal;
0
- display: block;
0
+ margin-bottom: 9px;
0
 }
0
 
0
 #date {
0
@@ -90,6 +98,7 @@
0
   text-align: center;
0
   padding: 6px;
0
   font-weight: normal;
0
+ border-top: 1px solid #eee;
0
   border-bottom: 1px solid #eee;
0
   margin: 0 9px;
0
 }

Comments

    No one has commented yet.