public
Description: The Git TextMate Bundle
Homepage: http://tim.theenchanter.com/
Clone URL: git://github.com/timcharper/git-tmbundle.git
DRY'd up the config pane code.  added gitnub-path option
timcharper (author)
Tue Apr 22 00:02:10 -0700 2008
commit  7957e5af9c9754d99a35f00805387d7a1147e139
tree    87e534376a5caad405b390fbabee624b12c0c6ad
parent  202ec4ffa22ba1423238911b2332a11f0ceacefb
...
1
2
 
 
3
4
5
...
1
 
2
3
4
5
6
0
@@ -1,4 +1,5 @@
0
 module ConfigHelper
0
- def config_line
0
+ def config_text_field(local_or_global, config_key, options = {})
0
+ content_tag :input, {:type => "text", :value => git.config[local_or_global, config_key], :onchange => "dispatch({controller: 'config', action: 'set', scope: 'global', key: '#{config_key}', value: $F(this)})"}.merge(options)
0
   end
0
 end
0
\ No newline at end of file
...
1
2
3
4
 
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
56
57
58
 
 
 
 
...
1
2
3
 
4
5
6
7
8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
10
11
12
13
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
 
 
40
41
42
43
44
0
@@ -1,57 +1,43 @@
0
 <h1>Git Config</h1>
0
 <p>Values are saved when the form-field loses focus.</p>
0
 <form onsubmit="return false">
0
- <table id="global-config" class="listing">
0
+ <table class="listing">
0
     <thead>
0
       <tr>
0
         <th>Global</th>
0
         <th></th>
0
- </tr>
0
- </thead>
0
- <tbody>
0
- <tr>
0
- <td>Name:</td>
0
- <td><%= content_tag :input, :type => "text", :value => git.config[:global, "user.name"], :onchange => "dispatch({controller: 'config', action: 'set', scope: 'global', key: 'user.name', value: $F(this)})", :tabindex => "1" %></td>
0
- </tr>
0
- <tr>
0
- <td>Email:</td>
0
- <td><%= content_tag :input, :type => "text", :value => git.config[:global, "user.email"], :onchange => "dispatch({controller: 'config', action: 'set', scope: 'global', key: 'user.email', value: $F(this)})", :tabindex => "2" %></td>
0
- </tr>
0
- <tr>
0
- <td>Log limit:</td>
0
- <td><%= content_tag :input, :type => "text", :value => git.config[:global, "git-tmbundle.log.limit"], :onchange => "dispatch({controller: 'config', action: 'set', scope: 'global', key: 'git-tmbundle.log.limit', value: $F(this)})", :tabindex => "3" %></td>
0
- </tr>
0
- <tr>
0
- <td>Log context lines:</td>
0
- <td><%= content_tag :input, :type => "text", :value => git.config[:global, "git-tmbundle.log.context-lines"], :onchange => "dispatch({controller: 'config', action: 'set', scope: 'global', key: 'git-tmbundle.log.context-lines', value: $F(this)})", :tabindex => "5" %></td>
0
- </tr>
0
- </tbody>
0
- </table>
0
-
0
- <table id="local-config" class="listing">
0
- <thead>
0
- <tr>
0
         <th>Local</th>
0
         <th></th>
0
       </tr>
0
     </thead>
0
     <tbody>
0
- <tr>
0
- <td>&nbsp;</td>
0
- <td></td>
0
- </tr>
0
- <tr>
0
- <td>&nbsp;</td>
0
- <td></td>
0
- </tr>
0
- <tr>
0
- <td>Log limit:</td>
0
- <td><%= content_tag :input, :type => "text", :value => git.config[:local, "git-tmbundle.log.limit"], :onchange => "dispatch({controller: 'config', action: 'set', scope: 'local', key: 'git-tmbundle.log.limit', value: $F(this)})", :tabindex => "4" %></td>
0
- </tr>
0
- <tr>
0
- <td>Log context lines:</td>
0
- <td><%= content_tag :input, :type => "text", :value => git.config[:local, "git-tmbundle.log.context-lines"], :onchange => "dispatch({controller: 'config', action: 'set', scope: 'local', key: 'git-tmbundle.log.context-lines', value: $F(this)})", :tabindex => "6" %></td>
0
- </tr>
0
+ <%
0
+ tabindex = 0
0
+ [
0
+ ["Name", "user.name", [:global]],
0
+ ["Email", "user.email", [:global]],
0
+ [],
0
+ ["Log limit", "git-tmbundle.log.limit", [:global, :local], {:style => "width: 40px"}],
0
+ ["Log context lines", "git-tmbundle.log.context-lines", [:global, :local], {:style => "width: 40px"}],
0
+ [],
0
+ ["Gitnub path", "git-tmbundle.gitnub-path", [:global], {:style => "width: 250px"}],
0
+ ].each do |label, key, scopes, input_options|
0
+ %>
0
+ <tr>
0
+ <% [:global, :local].each do |scope| %>
0
+ <% if scopes && scopes.include?(scope)
0
+ tabindex += 1 %>
0
+ <td><%= label %></td>
0
+ <td><%= config_text_field scope, key, {:tabindex => tabindex}.merge(input_options || {}) %></td>
0
+ <% else %>
0
+ <td>&nbsp;</td>
0
+ <td>&nbsp;</td>
0
+ <% end %>
0
+ <% end %>
0
+ </tr>
0
+ <% end %>
0
     </tbody>
0
- </table>
0
-</form>
0
\ No newline at end of file
0
+ </table>
0
+
0
+</form>
0
+

Comments

    No one has commented yet.