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