Sha256: 644ef9a132126879730ba6bce84ec28047247874e9cf09f21454f965711eeee3

Contents?: true

Size: 1.28 KB

Versions: 8

Compression:

Stored size: 1.28 KB

Contents

var curfile = null;
var processing = false;

function setup() {
  $('ul.filetree').treeview({
    persist: 'location',
    animated: 'fast',
    unique: true
  });

  $("span.file").click(function(){
    processing = true;
    file = $('a:eq(0)', this).attr('href').substr(1);
    if (curfile != file) {
      curfile = file;
      $('a.selected').removeClass('selected');
      $('#file_contents').load('/source'+curfile, {}, function(){ processing = false; });
      $('a',this).eq(0).addClass('selected');
    } else {
      processing = false;
    }

    if (curfile) {
      $('#repourl').empty().append(
        $('<a/>').attr('href', 'http://darcs.ramaze.net/ramaze'+curfile)
                 .text('download '+curfile.substr(1))
      );
      urchinTracker(curfile);
    }
  });

  $('a.selected').parent('span.file').click();

  setInterval(function(){
    if (processing) return;

    curhash = document.location.hash.substr(1);
    if(curfile != curhash) {
      $("a[href='#"+curhash+"']").parents('ul, li').show().end()
                                 .parent('span.file').click();
    }
  }, 100);
}

$(function(){
  if (document.location.hash != '') {
    curfile = document.location.hash.substr(1);
    $('#file_contents').load('/source'+curfile, {}, setup);
  } else {
    setup();
  }
});

Version data entries

8 entries across 8 versions & 3 rubygems

Version Path
clivecrous-ramaze-0.3.9.5 examples/sourceview/public/sourceview.js
manveru-ramaze-2008.07 examples/app/sourceview/public/sourceview.js
ramaze-0.3.5 examples/sourceview/public/sourceview.js
ramaze-0.2.1 examples/sourceview/public/sourceview.js
ramaze-0.3.0 examples/sourceview/public/sourceview.js
ramaze-2008.06 examples/app/sourceview/public/sourceview.js
ramaze-0.3.9.1 examples/sourceview/public/sourceview.js
ramaze-0.3.9 examples/sourceview/public/sourceview.js