Sha256: 766b0ee4e88b50033ca8e60a951f85f592f363986e5dd1e4e18b4358e0a9a572

Contents?: true

Size: 1.78 KB

Versions: 67

Compression:

Stored size: 1.78 KB

Contents

= serve_js

:javascript
  $('.offcanvas').click(function(e){ 
    if( e.target !== this ) 
      return;
    $(this).toggleClass('show') 
  })

  start_deferred()

  var known_types = #{Entity::REST::REST_ENTITIES.collect{|m| m.to_s}.to_json}

-#
  function gene_name(name){
    return new Entity({type: "Gene", id: name, name: name, format: "Associated Gene Name", info: { organism: "Hsa/feb2014" }})
  }

  function entity_link(entity){
    return m('a', {href: entity.url()}, entity.name)
  }

  function entity_item(entity){
    return m('li', entity_link(entity))
  }

  function entity_list(list){
    return m('ul.entity_list', list.map(entity_item))
  }

  function draw_entity_list(list){
    var content_elem = $('#content')[0]
    var content = [m("p", {style: 'padding: 3em'}, entity_list(list))]
    return m.render(content_elem, content)
  }

  function debug(name){
    gene = gene_name(name)
    gene.children("tfacts@genomics").then(draw_entity_list)
    gene.parents("tfacts@genomics").then(draw_entity_list)
  }


- if @reload_page 
  :javascript
    var wait_timeout = 2000;
    var url = main_url

    function reload(){

      $.ajax({url: add_parameters(main_url, '_layout=false'), cache:false, 
      success: function(data, stat, req){
        if (req.status == 202){
          $('#content').html(data)
          update_rbbt()
          window.setTimeout(reload, wait_timeout);
        }else{
          window.location = main_url;
        }
      },

      error:function(jqXHR, status, thrownError){
        if (undefined === jqXHR.responseText || jqXHR.responseText == ''){
          $('#content').html('No response. Server down?')
        }else{
          $('#content').html(jqXHR.responseText)
        }
        update_rbbt()
      }})
    }

    window.setTimeout(reload, wait_timeout);

Version data entries

67 entries across 67 versions & 1 rubygems

Version Path
rbbt-rest-1.8.49 share/views/layout/coda.haml
rbbt-rest-1.8.48 share/views/layout/coda.haml
rbbt-rest-1.8.47 share/views/layout/coda.haml
rbbt-rest-1.8.46 share/views/layout/coda.haml
rbbt-rest-1.8.45 share/views/layout/coda.haml
rbbt-rest-1.8.44 share/views/layout/coda.haml
rbbt-rest-1.8.43 share/views/layout/coda.haml
rbbt-rest-1.8.42 share/views/layout/coda.haml
rbbt-rest-1.8.41 share/views/layout/coda.haml
rbbt-rest-1.8.40 share/views/layout/coda.haml
rbbt-rest-1.8.38 share/views/layout/coda.haml
rbbt-rest-1.8.37 share/views/layout/coda.haml
rbbt-rest-1.8.36 share/views/layout/coda.haml
rbbt-rest-1.8.35 share/views/layout/coda.haml
rbbt-rest-1.8.34 share/views/layout/coda.haml
rbbt-rest-1.8.32 share/views/layout/coda.haml
rbbt-rest-1.8.31 share/views/layout/coda.haml
rbbt-rest-1.8.30 share/views/layout/coda.haml
rbbt-rest-1.8.29 share/views/layout/coda.haml
rbbt-rest-1.8.28 share/views/layout/coda.haml