simplify tree generation, restore broken autoscrolling (could use some tweaking)

This commit is contained in:
Jörn Nettingsmeier 2014-02-03 02:45:21 +01:00
parent e875a677bd
commit 303ad7ff7b
4 changed files with 24 additions and 16 deletions

View File

@ -41,8 +41,8 @@ title: Panning
of these situations, but in the future will offer more.
</p>
<p>
In addition to the panners, Ardour has a stereo balance control for subtle
corrections to an existing stereo image.
In addition to the panners, Ardour has a balance control for subtle
corrections to existing stereo images.
</p>
{% children %}

View File

@ -8,12 +8,15 @@ title: Balance Control
traditional <strong>balance control</strong> by right-clicking on the
panner widget.
</p>
<img class="left" src="/images/stereo-balance.png" alt="Stereo Balance
control"/>
<p>
When the balance is centered, the incoming signals will be unaffected.
Moving it to one side will linearly attenuate the signal of the opposite
side.
</p>
<div class="well">
While it is considerably less flexible than the stereo panner, it work
with arbitrary content without the danger of comb filter artefacts.
While the balance control is considerably less flexible than the stereo
panner, it works with arbitrary content without danger of introducing
comb filter artefacts.
</div>

View File

@ -165,9 +165,9 @@ module Manual
position ? [current, position, level + 1] : [current]
end
def sanitize_NMTOKEN(s)
'ID'+s.gsub(/[^0-9A-z:_.-]/, '_')
end
# def sanitize_NMTOKEN(s)
# 'ID'+s.gsub(/[^0-9A-z:_.-]/, '_')
# end
def render(context)
@ -181,14 +181,14 @@ module Manual
current_a = current.split('/').reject(&:empty?)
tree = Manual.traverse_data(@@data_tree) do |entry|
url = entry[:url]
url_a = url.split('/').reject(&:empty?)
depth = url_a.length
is_current, position, level = *process_hierarchy(current_a, url_a)
# this massively speeds up build time by not including the whole menu tree for each page
next if depth > 1 && current_a[0] != url_a[0]
@ -205,7 +205,7 @@ module Manual
erb = ::ERB.new <<-HTML
<dt class="<%= css_classes %>">
<a id="<%= sanitize_NMTOKEN(entry[:url]) %>" href="<%= entry[:url] %>"><%= entry[:menu_title] %></a>
<a href="<%= entry[:url] %>"><%= entry[:menu_title] %></a>
</dt>
<dd class="<%= css_classes %>">
<% if entry[:children].any? %>
@ -225,7 +225,7 @@ module Manual
erb = ::ERB.new <<-HTML
<dt class="<%= css_classes %>">
<a id="<%= sanitize_NMTOKEN(entry[:url]) %>" href="<%= entry[:url] %>"><%= entry[:menu_title] %></a>
<a href="<%= entry[:url] %>"><%= entry[:menu_title] %></a>
</dt>
<dd class="<%= css_classes %>">
</dd>
@ -234,9 +234,18 @@ module Manual
erb.result(binding)
end
end
end
"<dl>#{tree.join}</dl>"
"<dl>#{tree.join}</dl>
<script type='text/javascript'><!--
offset = document.getElementsByClassName('active')[0].offsetTop;
height = document.getElementById('tree').clientHeight;
if (offset > (height * .7)) {
tree.scrollTop = offset - height * .3;
}
--></script>"
end

View File

@ -271,10 +271,6 @@
white-space:nowrap;
}
#content img {
margin: 1em 0 1em 0;
}
#content td {
padding: 0 1em 0 1em;
}