rsyntaxtree 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,433 @@
1
+ #!/usr/bin/env ruby
2
+ # -*- coding: utf-8 -*-
3
+
4
+ #==========================
5
+ # tree_graph.rb
6
+ #==========================
7
+ #
8
+ # Parses an element list into a (non-SVG) graphical tree.
9
+ #
10
+ # This file is part of RSyntaxTree, which is a ruby port of Andre Eisenbach's
11
+ # excellent program phpSyntaxTree.
12
+ #
13
+ # Copyright (c) 2007-2009 Yoichiro Hasebe <yohasebe@gmail.com>
14
+ # Copyright (c) 2003-2004 Andre Eisenbach <andre@ironcreek.net>
15
+ #
16
+ # This program is free software; you can redistribute it and/or modify
17
+ # it under the terms of the GNU General Public License as published by
18
+ # the Free Software Foundation; either version 2 of the License, or
19
+ # (at your option) any later version.
20
+ #
21
+ # This program is distributed in the hope that it will be useful,
22
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
23
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24
+ # GNU General Public License for more details.
25
+ #
26
+ # You should have received a copy of the GNU General Public License
27
+ # along with this program; if not, write to the Free Software
28
+ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29
+
30
+ require 'imgutils'
31
+ require 'elementlist'
32
+ require 'rubygems'
33
+ require 'RMagick'
34
+ include Magick
35
+
36
+ E_WIDTH = 60 # Element width
37
+ E_PADD = 7 # Element height padding
38
+ V_SPACE = 20
39
+ H_SPACE = 10
40
+ B_SIDE = 5
41
+ B_TOPBOT = 5
42
+
43
+ class TreeGraph
44
+
45
+ def initialize(e_list, symmetrize = true, color = true, terminal = "triangle",
46
+ font = "Helvetica", font_size = 10, simple = false)
47
+
48
+ # Store parameters
49
+ @e_list = e_list
50
+ @font = font
51
+ @font_size = font_size
52
+ @terminal = terminal
53
+ @symmetrize = symmetrize
54
+ @simple = simple
55
+
56
+ # Element dimensions
57
+ @e_width = E_WIDTH
58
+
59
+ # Calculate image dimensions
60
+ @e_height = @font_size + E_PADD * 2
61
+ h = @e_list.get_level_height
62
+ w = calc_level_width(0)
63
+ w_px = w + B_SIDE * 2
64
+ h_px = h * @e_height + (h-1) * (V_SPACE + @font_size) + B_TOPBOT * 2
65
+ @height = h_px
66
+ @width = w_px
67
+
68
+ # Initialize the image and colors
69
+ @im = Image.new(w_px, h_px)
70
+ @gc = Draw.new
71
+ @gc.font = @font
72
+ @gc.pointsize(@font_size)
73
+
74
+ @col_bg = "none"
75
+ @col_fg = "black"
76
+ @col_line = "black"
77
+
78
+ if color
79
+ @col_node = "blue"
80
+ @col_leaf = "green"
81
+ @col_trace = "red"
82
+ else
83
+ @col_node = "black"
84
+ @col_leaf = "black"
85
+ @col_trace = "black"
86
+ end
87
+ end
88
+
89
+ def destroy
90
+ @im.destroy!
91
+ end
92
+
93
+ def draw
94
+ parse_list
95
+ @gc.draw(@im)
96
+ end
97
+
98
+ def save(filename)
99
+ draw
100
+ @im.write(filename)
101
+ end
102
+
103
+ # inspired by the implementation of Gruff
104
+ # by Geoffrey Grosenbach
105
+ def to_blob(fileformat='PNG')
106
+ draw
107
+ return @im.to_blob do
108
+ self.format = fileformat
109
+ end
110
+ end
111
+
112
+ :private
113
+
114
+ # Add the element into the tree (draw it)
115
+ def draw_element(x, y, w, string, type)
116
+
117
+ # Calculate element dimensions and position
118
+ if (type == ETYPE_LEAF) and @terminal == "nothing"
119
+ top = row2px(y - 1) + (@font_size * 1.5)
120
+ else
121
+ top = row2px(y)
122
+ end
123
+ left = x + B_SIDE
124
+ bottom = top + @e_height
125
+ right = left + w
126
+
127
+ # Split the string into the main part and the
128
+ # subscript part of the element (if any)
129
+ main = string
130
+ sub = ""
131
+
132
+ sub_size = (@font_size * 0.7 )
133
+ parts = string.split("_", 2)
134
+
135
+ if(parts.length > 1 )
136
+ main = parts[0]
137
+ sub = parts[1].gsub(/_/, " ")
138
+ end
139
+
140
+ # Calculate text size for the main and the
141
+ # subscript part of the element
142
+ main_width = img_get_txt_width(main, @font, @font_size)
143
+
144
+ if sub != ""
145
+ sub_width = img_get_txt_width(sub.to_s, @font, sub_size)
146
+ else
147
+ sub_width = 0
148
+ end
149
+
150
+ # Center text in the element
151
+ txt_width = main_width + sub_width
152
+
153
+ txt_pos = left + (right - left) / 2 - txt_width / 2
154
+
155
+ # Select apropriate color
156
+ if(type == ETYPE_LEAF)
157
+ col = @col_leaf
158
+ else
159
+ col = @col_node
160
+ end
161
+
162
+ if(main[0].chr == "<" && main[-1].chr == ">")
163
+ col = @col_trace
164
+ end
165
+
166
+ @gc.stroke("none")
167
+ @gc.fill(col)
168
+
169
+ # Draw main text
170
+ @gc.pointsize(@font_size)
171
+ main_x = txt_pos
172
+ main_y = top + @e_height - E_PADD
173
+ @gc.text(main_x.ceil, main_y.ceil, main)
174
+
175
+ # Draw subscript text
176
+ if (sub.length > 0 )
177
+ @gc.pointsize(sub_size)
178
+ sub_x = txt_pos + main_width + (sub_size/8)
179
+ sub_y = top + (@e_height - E_PADD + sub_size / 2)
180
+ @gc.text(sub_x.ceil, sub_y.ceil, sub)
181
+ end
182
+
183
+ end
184
+
185
+ # Draw a line between child/parent elements
186
+ def line_to_parent(fromX, fromY, fromW, toX, toW)
187
+
188
+ if (fromY == 0 )
189
+ return
190
+ end
191
+
192
+ fromTop = row2px(fromY)
193
+ fromLeft = (fromX + fromW / 2 + B_SIDE)
194
+ toBot = (row2px(fromY - 1 ) + @e_height)
195
+ toLeft = (toX + toW / 2 + B_SIDE)
196
+
197
+ @gc.fill("none")
198
+ @gc.stroke @col_line
199
+ @gc.stroke_width 1
200
+ @gc.line(fromLeft.ceil, fromTop.ceil, toLeft.ceil, toBot.ceil)
201
+ end
202
+
203
+ # Draw a triangle between child/parent elements
204
+ def triangle_to_parent(fromX, fromY, fromW, toX, textW)
205
+ if (fromY == 0)
206
+ return
207
+ end
208
+
209
+ toX = fromX
210
+ fromCenter = (fromX + fromW / 2 + B_SIDE)
211
+
212
+ fromTop = row2px(fromY).ceil
213
+ fromLeft1 = (fromCenter + textW / 2).ceil
214
+ fromLeft2 = (fromCenter - textW / 2).ceil
215
+ toBot = (row2px(fromY - 1) + @e_height)
216
+ toLeft = (toX + textW / 2 + B_SIDE * 2)
217
+
218
+ @gc.fill("none")
219
+ @gc.stroke @col_line
220
+ @gc.stroke_width 1
221
+ @gc.line(fromLeft1, fromTop, toLeft, toBot)
222
+ @gc.line(fromLeft2, fromTop, toLeft, toBot)
223
+ @gc.line(fromLeft1, fromTop, fromLeft2, fromTop)
224
+ end
225
+
226
+ # If a node element text is wider than the sum of it's
227
+ # child elements, then the child elements need to
228
+ # be resized to even out the space. This function
229
+ # recurses down the a child tree and sizes the
230
+ # children appropriately.
231
+ def fix_child_size(id, current, target)
232
+ children = @e_list.get_children(id)
233
+ @e_list.set_element_width(id, target)
234
+
235
+ if(children.length > 0 )
236
+ delta = target - current
237
+ target_delta = delta / children.length
238
+
239
+ children.each do |child|
240
+ child_width = @e_list.get_element_width(child)
241
+ fix_child_size(child, child_width, child_width + target_delta)
242
+ end
243
+ end
244
+ end
245
+
246
+ # Calculate the width of the element. If the element is
247
+ # a node, the calculation will be performed recursively
248
+ # for all child elements.
249
+ def calc_element_width(e)
250
+ w = 0
251
+
252
+ children = @e_list.get_children(e.id)
253
+
254
+ if(children.length == 0)
255
+ w = img_get_txt_width(e.content, @font, @font_size) + @font_size
256
+ else
257
+ children.each do |child|
258
+ child_e = @e_list.get_id(child)
259
+ w += calc_element_width(child_e)
260
+ end
261
+
262
+ tw = img_get_txt_width(e.content, @font, @font_size) + @font_size
263
+ if(tw > w)
264
+ fix_child_size(e.id, w, tw)
265
+ w = tw
266
+ end
267
+ end
268
+
269
+ @e_list.set_element_width(e.id, w)
270
+ return w
271
+ end
272
+
273
+ # Calculate the width of all elements in a certain level
274
+ def calc_level_width(l)
275
+ w = 0
276
+ e = @e_list.get_first
277
+ while e
278
+ if(e.level == l)
279
+ w += calc_element_width(e)
280
+ end
281
+ e = @e_list.get_next
282
+ end
283
+
284
+ return w
285
+ end
286
+
287
+ def calc_children_width(id)
288
+ left = 0
289
+ right = 0
290
+ c_list = @e_list.get_children(id)
291
+ return nil if c_list.empty?
292
+
293
+ c_list.each do |c|
294
+ left = c.indent if indent == 0 or left > c.indent
295
+ end
296
+ c_list.each do |c|
297
+ right = c.indent + e.width if c.indent + c.width > right
298
+ end
299
+ return [left, right]
300
+ end
301
+
302
+ def get_children_indent(id)
303
+ calc_children_width(id)[0]
304
+ end
305
+
306
+ def get_children_width(id)
307
+ calc_children_width(id)[1] - get_children_indent(id)
308
+ end
309
+
310
+ # Parse the elements in the list top to bottom and
311
+ # draw the elements into the image.
312
+ # As we it iterate through the levels, the element
313
+ # indentation is calculated.
314
+ def parse_list
315
+
316
+ # Calc element list recursively....
317
+ e_arr = @e_list.get_elements
318
+
319
+ h = @e_list.get_level_height
320
+ h.times do |i|
321
+ x = 0
322
+ e_arr.each do |j|
323
+
324
+ if (j.level == i)
325
+ cw = @e_list.get_element_width(j.id)
326
+ parent_indent = @e_list.get_indent(j.parent)
327
+ if (x < parent_indent)
328
+ x = parent_indent
329
+ end
330
+ @e_list.set_indent(j.id, x)
331
+
332
+ if !@symmetrize
333
+ draw_element(x, i, cw, j.content, j.type)
334
+ if(j.parent != 0 )
335
+ words = j.content.split(" ")
336
+ unless @terminal == "nothing" && ETYPE_LEAF == j.type
337
+ if (@terminal == "triangle" && ETYPE_LEAF == j.type && x == parent_indent && words.length > 1)
338
+ txt_width = img_get_txt_width(j.content, @font, @font_size)
339
+ triangle_to_parent(x, i, cw, @e_list.get_element_width(j.parent), txt_width)
340
+ else
341
+ line_to_parent(x, i, cw, @e_list.get_indent(j.parent), @e_list.get_element_width(j.parent))
342
+ end
343
+ end
344
+ end
345
+ end
346
+
347
+ x += cw
348
+ end
349
+ end
350
+ end
351
+ return true if !@symmetrize
352
+ h.times do |i|
353
+ curlevel = h - i - 1
354
+ indent = 0
355
+ e_arr.each_with_index do |j, idx|
356
+ if (j.level == curlevel)
357
+ # Draw a line to the parent element
358
+ children = @e_list.get_children(j.id)
359
+
360
+ tw = img_get_txt_width(j.content, @font, @font_size)
361
+ if children.length > 1
362
+ left, right = -1, -1
363
+ children.each do |child|
364
+ k = @e_list.get_id(child)
365
+ kw = img_get_txt_width(k.content, @font, @font_size)
366
+ left = k.indent + kw / 2 if k.indent + kw / 2 < left or left == -1
367
+ right = k.indent + kw / 2 if k.indent + kw / 2 > right
368
+ end
369
+ draw_element(left, curlevel, right - left, j.content, j.type)
370
+ @e_list.set_indent(j.id, left + (right - left) / 2 - tw / 2)
371
+
372
+ children.each do |child|
373
+ k = @e_list.get_id(child)
374
+ words = k.content.split(" ")
375
+ dw = img_get_txt_width(k.content, @font, @font_size)
376
+ unless @terminal == "nothing" && ETYPE_LEAF == k.type
377
+ if (@terminal == "triangle" && ETYPE_LEAF == k.type && k.indent == j.indent && words.length > 1)
378
+ txt_width = img_get_txt_width(k.content, @font, @font_size)
379
+ triangle_to_parent(k.indent, curlevel + 1, dw, tw, txt_width)
380
+ else
381
+ line_to_parent(k.indent, curlevel + 1, dw, j.indent, tw)
382
+ end
383
+ end
384
+ end
385
+
386
+ else
387
+ unless children.empty?
388
+ k = @e_list.get_id(children[0])
389
+ kw = img_get_txt_width(k.content, @font, @font_size)
390
+ left = k.indent
391
+ right = k.indent + kw
392
+ draw_element(left, curlevel, right - left, j.content, j.type)
393
+ @e_list.set_indent(j.id, left + (right - left) / 2 - tw / 2)
394
+ else
395
+ parent = @e_list.get_id(j.parent)
396
+ pw = img_get_txt_width(parent.content, @font, @font_size)
397
+ pleft = parent.indent
398
+ pright = pleft + pw
399
+ left = j.indent
400
+ right = left + tw
401
+ if pw > tw
402
+ left = pleft
403
+ right = pright
404
+ end
405
+ draw_element(left, curlevel, right - left, j.content, j.type)
406
+ @e_list.set_indent(j.id, left + (right - left) / 2 - tw / 2)
407
+ end
408
+
409
+ unless children.empty?
410
+ k = @e_list.get_id(children[0])
411
+ words = k.content.split(" ")
412
+ dw = img_get_txt_width(k.content, @font, @font_size)
413
+ unless @terminal == "nothing" && ETYPE_LEAF == k.type
414
+ if (@terminal == "triangle" && ETYPE_LEAF == k.type && words.length > 1)
415
+ txt_width = img_get_txt_width(k.content, @font, @font_size)
416
+ triangle_to_parent(k.indent, curlevel + 1, dw,
417
+ @e_list.get_element_width(k.parent), txt_width)
418
+ else
419
+ line_to_parent(k.indent, curlevel + 1, dw, j.indent, tw)
420
+ end
421
+ end
422
+ end
423
+ end
424
+ end
425
+ end
426
+ end
427
+ end
428
+
429
+ def row2px(row)
430
+ B_TOPBOT + @e_height * row + (V_SPACE + @font_size) * row
431
+ end
432
+
433
+ end
@@ -0,0 +1,4 @@
1
+ module RSyntaxTree
2
+ VERSION = "0.5.0"
3
+ end
4
+
@@ -0,0 +1,581 @@
1
+ /*!
2
+ * Bootstrap Responsive v2.0.1
3
+ *
4
+ * Copyright 2012 Twitter, Inc
5
+ * Licensed under the Apache License v2.0
6
+ * http://www.apache.org/licenses/LICENSE-2.0
7
+ *
8
+ * Designed and built with all the love in the world @twitter by @mdo and @fat.
9
+ */
10
+ .clearfix {
11
+ *zoom: 1;
12
+ }
13
+ .clearfix:before, .clearfix:after {
14
+ display: table;
15
+ content: "";
16
+ }
17
+ .clearfix:after {
18
+ clear: both;
19
+ }
20
+ .hidden {
21
+ display: none;
22
+ visibility: hidden;
23
+ }
24
+ @media (max-width: 480px) {
25
+ .nav-collapse {
26
+ -webkit-transform: translate3d(0, 0, 0);
27
+ }
28
+ .page-header h1 small {
29
+ display: block;
30
+ line-height: 18px;
31
+ }
32
+ input[class*="span"],
33
+ select[class*="span"],
34
+ textarea[class*="span"],
35
+ .uneditable-input {
36
+ display: block;
37
+ width: 100%;
38
+ min-height: 28px;
39
+ /* Make inputs at least the height of their button counterpart */
40
+
41
+ /* Makes inputs behave like true block-level elements */
42
+
43
+ -webkit-box-sizing: border-box;
44
+ /* Older Webkit */
45
+
46
+ -moz-box-sizing: border-box;
47
+ /* Older FF */
48
+
49
+ -ms-box-sizing: border-box;
50
+ /* IE8 */
51
+
52
+ box-sizing: border-box;
53
+ /* CSS3 spec*/
54
+
55
+ }
56
+ .input-prepend input[class*="span"], .input-append input[class*="span"] {
57
+ width: auto;
58
+ }
59
+ input[type="checkbox"], input[type="radio"] {
60
+ border: 1px solid #ccc;
61
+ }
62
+ .form-horizontal .control-group > label {
63
+ float: none;
64
+ width: auto;
65
+ padding-top: 0;
66
+ text-align: left;
67
+ }
68
+ .form-horizontal .controls {
69
+ margin-left: 0;
70
+ }
71
+ .form-horizontal .control-list {
72
+ padding-top: 0;
73
+ }
74
+ .form-horizontal .form-actions {
75
+ padding-left: 10px;
76
+ padding-right: 10px;
77
+ }
78
+ .modal {
79
+ position: absolute;
80
+ top: 10px;
81
+ left: 10px;
82
+ right: 10px;
83
+ width: auto;
84
+ margin: 0;
85
+ }
86
+ .modal.fade.in {
87
+ top: auto;
88
+ }
89
+ .modal-header .close {
90
+ padding: 10px;
91
+ margin: -10px;
92
+ }
93
+ .carousel-caption {
94
+ position: static;
95
+ }
96
+ }
97
+ @media (max-width: 767px) {
98
+ .container {
99
+ width: auto;
100
+ padding: 0 20px;
101
+ }
102
+ .row-fluid {
103
+ width: 100%;
104
+ }
105
+ .row {
106
+ margin-left: 0;
107
+ }
108
+ .row > [class*="span"], .row-fluid > [class*="span"] {
109
+ float: none;
110
+ display: block;
111
+ width: auto;
112
+ margin: 0;
113
+ }
114
+ }
115
+ @media (min-width: 768px) and (max-width: 979px) {
116
+ .row {
117
+ margin-left: -20px;
118
+ *zoom: 1;
119
+ }
120
+ .row:before, .row:after {
121
+ display: table;
122
+ content: "";
123
+ }
124
+ .row:after {
125
+ clear: both;
126
+ }
127
+ [class*="span"] {
128
+ float: left;
129
+ margin-left: 20px;
130
+ }
131
+ .span1 {
132
+ width: 42px;
133
+ }
134
+ .span2 {
135
+ width: 104px;
136
+ }
137
+ .span3 {
138
+ width: 166px;
139
+ }
140
+ .span4 {
141
+ width: 228px;
142
+ }
143
+ .span5 {
144
+ width: 290px;
145
+ }
146
+ .span6 {
147
+ width: 352px;
148
+ }
149
+ .span7 {
150
+ width: 414px;
151
+ }
152
+ .span8 {
153
+ width: 476px;
154
+ }
155
+ .span9 {
156
+ width: 538px;
157
+ }
158
+ .span10 {
159
+ width: 600px;
160
+ }
161
+ .span11 {
162
+ width: 662px;
163
+ }
164
+ .span12, .container {
165
+ width: 724px;
166
+ }
167
+ .offset1 {
168
+ margin-left: 82px;
169
+ }
170
+ .offset2 {
171
+ margin-left: 144px;
172
+ }
173
+ .offset3 {
174
+ margin-left: 206px;
175
+ }
176
+ .offset4 {
177
+ margin-left: 268px;
178
+ }
179
+ .offset5 {
180
+ margin-left: 330px;
181
+ }
182
+ .offset6 {
183
+ margin-left: 392px;
184
+ }
185
+ .offset7 {
186
+ margin-left: 454px;
187
+ }
188
+ .offset8 {
189
+ margin-left: 516px;
190
+ }
191
+ .offset9 {
192
+ margin-left: 578px;
193
+ }
194
+ .offset10 {
195
+ margin-left: 640px;
196
+ }
197
+ .offset11 {
198
+ margin-left: 702px;
199
+ }
200
+ .row-fluid {
201
+ width: 100%;
202
+ *zoom: 1;
203
+ }
204
+ .row-fluid:before, .row-fluid:after {
205
+ display: table;
206
+ content: "";
207
+ }
208
+ .row-fluid:after {
209
+ clear: both;
210
+ }
211
+ .row-fluid > [class*="span"] {
212
+ float: left;
213
+ margin-left: 2.762430939%;
214
+ }
215
+ .row-fluid > [class*="span"]:first-child {
216
+ margin-left: 0;
217
+ }
218
+ .row-fluid > .span1 {
219
+ width: 5.801104972%;
220
+ }
221
+ .row-fluid > .span2 {
222
+ width: 14.364640883%;
223
+ }
224
+ .row-fluid > .span3 {
225
+ width: 22.928176794%;
226
+ }
227
+ .row-fluid > .span4 {
228
+ width: 31.491712705%;
229
+ }
230
+ .row-fluid > .span5 {
231
+ width: 40.055248616%;
232
+ }
233
+ .row-fluid > .span6 {
234
+ width: 48.618784527%;
235
+ }
236
+ .row-fluid > .span7 {
237
+ width: 57.182320438000005%;
238
+ }
239
+ .row-fluid > .span8 {
240
+ width: 65.74585634900001%;
241
+ }
242
+ .row-fluid > .span9 {
243
+ width: 74.30939226%;
244
+ }
245
+ .row-fluid > .span10 {
246
+ width: 82.87292817100001%;
247
+ }
248
+ .row-fluid > .span11 {
249
+ width: 91.436464082%;
250
+ }
251
+ .row-fluid > .span12 {
252
+ width: 99.999999993%;
253
+ }
254
+ input.span1, textarea.span1, .uneditable-input.span1 {
255
+ width: 32px;
256
+ }
257
+ input.span2, textarea.span2, .uneditable-input.span2 {
258
+ width: 94px;
259
+ }
260
+ input.span3, textarea.span3, .uneditable-input.span3 {
261
+ width: 156px;
262
+ }
263
+ input.span4, textarea.span4, .uneditable-input.span4 {
264
+ width: 218px;
265
+ }
266
+ input.span5, textarea.span5, .uneditable-input.span5 {
267
+ width: 280px;
268
+ }
269
+ input.span6, textarea.span6, .uneditable-input.span6 {
270
+ width: 342px;
271
+ }
272
+ input.span7, textarea.span7, .uneditable-input.span7 {
273
+ width: 404px;
274
+ }
275
+ input.span8, textarea.span8, .uneditable-input.span8 {
276
+ width: 466px;
277
+ }
278
+ input.span9, textarea.span9, .uneditable-input.span9 {
279
+ width: 528px;
280
+ }
281
+ input.span10, textarea.span10, .uneditable-input.span10 {
282
+ width: 590px;
283
+ }
284
+ input.span11, textarea.span11, .uneditable-input.span11 {
285
+ width: 652px;
286
+ }
287
+ input.span12, textarea.span12, .uneditable-input.span12 {
288
+ width: 714px;
289
+ }
290
+ }
291
+ @media (max-width: 979px) {
292
+ body {
293
+ padding-top: 0;
294
+ }
295
+ .navbar-fixed-top {
296
+ position: static;
297
+ margin-bottom: 18px;
298
+ }
299
+ .navbar-fixed-top .navbar-inner {
300
+ padding: 5px;
301
+ }
302
+ .navbar .container {
303
+ width: auto;
304
+ padding: 0;
305
+ }
306
+ .navbar .brand {
307
+ padding-left: 10px;
308
+ padding-right: 10px;
309
+ margin: 0 0 0 -5px;
310
+ }
311
+ .navbar .nav-collapse {
312
+ clear: left;
313
+ }
314
+ .navbar .nav {
315
+ float: none;
316
+ margin: 0 0 9px;
317
+ }
318
+ .navbar .nav > li {
319
+ float: none;
320
+ }
321
+ .navbar .nav > li > a {
322
+ margin-bottom: 2px;
323
+ }
324
+ .navbar .nav > .divider-vertical {
325
+ display: none;
326
+ }
327
+ .navbar .nav .nav-header {
328
+ color: #999999;
329
+ text-shadow: none;
330
+ }
331
+ .navbar .nav > li > a, .navbar .dropdown-menu a {
332
+ padding: 6px 15px;
333
+ font-weight: bold;
334
+ color: #999999;
335
+ -webkit-border-radius: 3px;
336
+ -moz-border-radius: 3px;
337
+ border-radius: 3px;
338
+ }
339
+ .navbar .dropdown-menu li + li a {
340
+ margin-bottom: 2px;
341
+ }
342
+ .navbar .nav > li > a:hover, .navbar .dropdown-menu a:hover {
343
+ background-color: #222222;
344
+ }
345
+ .navbar .dropdown-menu {
346
+ position: static;
347
+ top: auto;
348
+ left: auto;
349
+ float: none;
350
+ display: block;
351
+ max-width: none;
352
+ margin: 0 15px;
353
+ padding: 0;
354
+ background-color: transparent;
355
+ border: none;
356
+ -webkit-border-radius: 0;
357
+ -moz-border-radius: 0;
358
+ border-radius: 0;
359
+ -webkit-box-shadow: none;
360
+ -moz-box-shadow: none;
361
+ box-shadow: none;
362
+ }
363
+ .navbar .dropdown-menu:before, .navbar .dropdown-menu:after {
364
+ display: none;
365
+ }
366
+ .navbar .dropdown-menu .divider {
367
+ display: none;
368
+ }
369
+ .navbar-form, .navbar-search {
370
+ float: none;
371
+ padding: 9px 15px;
372
+ margin: 9px 0;
373
+ border-top: 1px solid #222222;
374
+ border-bottom: 1px solid #222222;
375
+ -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
376
+ -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
377
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
378
+ }
379
+ .navbar .nav.pull-right {
380
+ float: none;
381
+ margin-left: 0;
382
+ }
383
+ .navbar-static .navbar-inner {
384
+ padding-left: 10px;
385
+ padding-right: 10px;
386
+ }
387
+ .btn-navbar {
388
+ display: block;
389
+ }
390
+ .nav-collapse {
391
+ overflow: hidden;
392
+ height: 0;
393
+ }
394
+ }
395
+ @media (min-width: 980px) {
396
+ .nav-collapse.collapse {
397
+ height: auto !important;
398
+ }
399
+ }
400
+ @media (min-width: 1200px) {
401
+ .row {
402
+ margin-left: -30px;
403
+ *zoom: 1;
404
+ }
405
+ .row:before, .row:after {
406
+ display: table;
407
+ content: "";
408
+ }
409
+ .row:after {
410
+ clear: both;
411
+ }
412
+ [class*="span"] {
413
+ float: left;
414
+ margin-left: 30px;
415
+ }
416
+ .span1 {
417
+ width: 70px;
418
+ }
419
+ .span2 {
420
+ width: 170px;
421
+ }
422
+ .span3 {
423
+ width: 270px;
424
+ }
425
+ .span4 {
426
+ width: 370px;
427
+ }
428
+ .span5 {
429
+ width: 470px;
430
+ }
431
+ .span6 {
432
+ width: 570px;
433
+ }
434
+ .span7 {
435
+ width: 670px;
436
+ }
437
+ .span8 {
438
+ width: 770px;
439
+ }
440
+ .span9 {
441
+ width: 870px;
442
+ }
443
+ .span10 {
444
+ width: 970px;
445
+ }
446
+ .span11 {
447
+ width: 1070px;
448
+ }
449
+ .span12, .container {
450
+ width: 1170px;
451
+ }
452
+ .offset1 {
453
+ margin-left: 130px;
454
+ }
455
+ .offset2 {
456
+ margin-left: 230px;
457
+ }
458
+ .offset3 {
459
+ margin-left: 330px;
460
+ }
461
+ .offset4 {
462
+ margin-left: 430px;
463
+ }
464
+ .offset5 {
465
+ margin-left: 530px;
466
+ }
467
+ .offset6 {
468
+ margin-left: 630px;
469
+ }
470
+ .offset7 {
471
+ margin-left: 730px;
472
+ }
473
+ .offset8 {
474
+ margin-left: 830px;
475
+ }
476
+ .offset9 {
477
+ margin-left: 930px;
478
+ }
479
+ .offset10 {
480
+ margin-left: 1030px;
481
+ }
482
+ .offset11 {
483
+ margin-left: 1130px;
484
+ }
485
+ .row-fluid {
486
+ width: 100%;
487
+ *zoom: 1;
488
+ }
489
+ .row-fluid:before, .row-fluid:after {
490
+ display: table;
491
+ content: "";
492
+ }
493
+ .row-fluid:after {
494
+ clear: both;
495
+ }
496
+ .row-fluid > [class*="span"] {
497
+ float: left;
498
+ margin-left: 2.564102564%;
499
+ }
500
+ .row-fluid > [class*="span"]:first-child {
501
+ margin-left: 0;
502
+ }
503
+ .row-fluid > .span1 {
504
+ width: 5.982905983%;
505
+ }
506
+ .row-fluid > .span2 {
507
+ width: 14.529914530000001%;
508
+ }
509
+ .row-fluid > .span3 {
510
+ width: 23.076923077%;
511
+ }
512
+ .row-fluid > .span4 {
513
+ width: 31.623931624%;
514
+ }
515
+ .row-fluid > .span5 {
516
+ width: 40.170940171000005%;
517
+ }
518
+ .row-fluid > .span6 {
519
+ width: 48.717948718%;
520
+ }
521
+ .row-fluid > .span7 {
522
+ width: 57.264957265%;
523
+ }
524
+ .row-fluid > .span8 {
525
+ width: 65.81196581200001%;
526
+ }
527
+ .row-fluid > .span9 {
528
+ width: 74.358974359%;
529
+ }
530
+ .row-fluid > .span10 {
531
+ width: 82.905982906%;
532
+ }
533
+ .row-fluid > .span11 {
534
+ width: 91.45299145300001%;
535
+ }
536
+ .row-fluid > .span12 {
537
+ width: 100%;
538
+ }
539
+ input.span1, textarea.span1, .uneditable-input.span1 {
540
+ width: 60px;
541
+ }
542
+ input.span2, textarea.span2, .uneditable-input.span2 {
543
+ width: 160px;
544
+ }
545
+ input.span3, textarea.span3, .uneditable-input.span3 {
546
+ width: 260px;
547
+ }
548
+ input.span4, textarea.span4, .uneditable-input.span4 {
549
+ width: 360px;
550
+ }
551
+ input.span5, textarea.span5, .uneditable-input.span5 {
552
+ width: 460px;
553
+ }
554
+ input.span6, textarea.span6, .uneditable-input.span6 {
555
+ width: 560px;
556
+ }
557
+ input.span7, textarea.span7, .uneditable-input.span7 {
558
+ width: 660px;
559
+ }
560
+ input.span8, textarea.span8, .uneditable-input.span8 {
561
+ width: 760px;
562
+ }
563
+ input.span9, textarea.span9, .uneditable-input.span9 {
564
+ width: 860px;
565
+ }
566
+ input.span10, textarea.span10, .uneditable-input.span10 {
567
+ width: 960px;
568
+ }
569
+ input.span11, textarea.span11, .uneditable-input.span11 {
570
+ width: 1060px;
571
+ }
572
+ input.span12, textarea.span12, .uneditable-input.span12 {
573
+ width: 1160px;
574
+ }
575
+ .thumbnails {
576
+ margin-left: -30px;
577
+ }
578
+ .thumbnails > li {
579
+ margin-left: 30px;
580
+ }
581
+ }