Sha256: 4776f972c9c1dd8596f54d0f5d5847779f507d26f922e9c46729fe4cbe334703

Contents?: true

Size: 1.29 KB

Versions: 44

Compression:

Stored size: 1.29 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://github.com/manveru/ramaze/tree/master'+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

44 entries across 44 versions & 5 rubygems

Version Path
ramaze-2009.04 examples/app/sourceview/public/sourceview.js
ramaze-2009.06 examples/app/sourceview/public/sourceview.js
ramaze-2009.06.04 examples/app/sourceview/public/sourceview.js
ramaze-2009.06.12 examples/app/sourceview/public/sourceview.js