• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

allura


コミットメタ情報

リビジョン36d244b5f30ad984d400ee22d52d143ad4fde286 (tree)
日時2012-05-15 00:09:11
作者Dave Brondsema <dbrondsema@geek...>
コミッターYaroslav Luzin

ログメッセージ

[#4115] update highlighting if the hash changes

変更サマリ

差分

--- a/Allura/allura/templates/repo/file.html
+++ b/Allura/allura/templates/repo/file.html
@@ -21,10 +21,15 @@
2121 {% block extra_js %}
2222 {{ super() }}
2323 <script type="text/javascript">(function() {
24- var hash = window.location.hash.substring(1);
25- if (hash != '' && hash.substring(0, 1) == 'l' && !isNaN(hash.substring(1))) {
26- $('#' + hash).css('background-color', '#ffff99');
27- }
24+ $(window).bind('hashchange', function(e) {
25+ var hash = window.location.hash.substring(1);
26+ if ('originalEvent' in e && 'oldURL' in e.originalEvent) {
27+ $('#' + e.originalEvent.oldURL.split('#')[1]).css('background-color', 'transparent');
28+ }
29+ if (hash != '' && hash.substring(0, 1) == 'l' && !isNaN(hash.substring(1))) {
30+ $('#' + hash).css('background-color', '#ffff99');
31+ }
32+ }).trigger('hashchange');
2833
2934 $('.code_block').each(function(index, element) {
3035 $(element).bind('click', function() {
@@ -69,7 +74,7 @@
6974 <div class="clip grid-19">
7075 <h3><span class="ico-l"><b data-icon="{{g.icons['table'].char}}" class="ico {{g.icons['table'].css}}"></b> {{h.really_unicode(blob.name)}}</span></h3>
7176 {% if blob.has_pypeline_view %}
72- {{h.render_any_markup(blob.name, blob.text, True)}}
77+ {{h.render_any_markup(blob.name, blob.text, code_mode=True)}}
7378 {% else %}
7479 {{g.highlight(blob.text, filename=blob.name)}}
7580 {% endif %}