/*! * Ext JS Library 3.2.1 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license */ Ext.onReady(function(){ // shorthand var Tree = Ext.tree; var tree = new Tree.TreePanel({ id: 'TreePanel', useArrows: true, autoScroll: true, animate: true, enableDD: true, containerScroll: true, border: false, height: 480, // auto create TreeLoader dataUrl: 'simple_build_db.php', root: { nodeType: 'async', text: 'Tracks', draggable: false, id: 'Track', iconCls: 'silk_house' }, }); var treeEditor = new Tree.TreeEditor(tree, {}, { cancelOnEsc: true, completeOnEnter: true, selectOnFocus: true, allBlank: false, }); // render the tree tree.render('tree-div'); tree.getRootNode().expand(); var source = new Tree.TreePanel({ id: 'SourcePanel', useArrows: true, autoScroll: true, animate: true, enableDD: true, containerScroll: true, border: false, height: 480, // auto create TreeLoader dataUrl: 'simple_build_db.php', root: { nodeType: 'async', text: 'Source', draggable: false, id: 'Source', iconCls: 'silk_world' } }); // render the source source.render('source-div'); source.getRootNode().expand(); }); function expandChildFolder(node) { if (!node.hasChildNodes()) return; else node.eachChild(function(mynode) { mynode.expand(true); expandChildFolder(mynode); }); } function collapsChildFolder(node) { node.eachChild(function(mynode) { mynode.collapse(true); }); } function expands() { expands.count = ++expands.count || 1; if (expands.count%2==1) { expandChildFolder(Ext.getCmp('TreePanel').getRootNode()); } else { collapsChildFolder(Ext.getCmp('TreePanel').getRootNode()); } } function checkNodeData(node) { var attr = node.attributes; if (attr.Data_Type == "SuffixBoth" || attr.Data_Type == "SuffixPage" || attr.Data_Type == "SuffixTrack") { if (attr.Genome_URL==null || attr.Genome_URL=='') return "Genome_URL"; if (attr.Organism==null || attr.Organism=='') return "Organism"; if ((attr.Author==null || attr.Author=='') && (attr.Provider_Name==null || attr.Provider_Name=='')) return "Author"; if ((attr.Email==null || attr.Email=='') && (attr.Provider_Mail==null || attr.Provider_Mail=='')) return "Email"; if (attr.Page_Title==null || attr.Page_Title=='') return "Page_Title"; } if (attr.Data_Type == "PageTrack" || attr.Data_Type == "SimpleData" || attr.Data_Type == "SimpleTrack" || attr.Data_Type == "MySQLData" || attr.Data_Type == "MySQLTrack") { if (attr.Track_Type==null || attr.Track_Type=='') return "Track_Type"; if (attr.Track_URL==null || attr.Track_URL=='') return "Track_URL"; if (attr.Icon==null || attr.Icon=='') return "Track_Icon"; } if (attr.Data_Type == "SimpleData" || attr.Data_Type == "SimpleTrack" || attr.Data_Type == "MySQLData" || attr.Data_Type == "MySQLTrack") { if (attr.Include==null || attr.Include=='') return "Include"; if (attr.Table_List==null || attr.Table_List=='') return "Table"; if (attr.Title_List==null || attr.Title_List=='') return "Title"; if (attr.Info_List==null || attr.Info_Lis=='') return "Info"; } if (attr.Data_Type == "MySQLData" || attr.Data_Type == "MySQLTrack") { if (attr.Server==null || attr.Server=='') return "Server"; } return ''; } function getNodeData(node) { var txt = ''; var attr = node.attributes; txt += "Data_Type =:= "+attr.Data_Type+" ,,, Node_Name =:= "+node.text+" ,,, Node_Path =:= "+node.path; if (attr.Data_Type == "SuffixBoth" || attr.Data_Type == "SuffixPage") { if (attr.Genome_URL==null || attr.Genome_URL=='') attr.error = "Genome_URL"; else txt += " ,,, Genome_URL =:= "+attr.Genome_URL; txt += " ,,, Author =:= "+ (attr.Author); txt += " ,,, Email =:= "+ (attr.Email); txt += " ,,, Page_Title =:= "+ (attr.Page_Title); txt += " ,,, Notes =:= "+ (attr.Notes); txt += " ,,, Citation =:= "+ (attr.Citation); txt += " ,,, Assembly =:= "+ (attr.Assembly); txt += " ,,, Position =:= "+ (attr.Position); txt += " ,,, Bases =:= "+ (attr.Bases); txt += " ,,, Pixels =:= "+ (attr.Pixels); txt += " ,,, Yaxis =:= "+ (attr.Yaxis); txt += " ,,, Multi =:= "+ (attr.Multi); txt += " ,,, Baseline =:= "+ (attr.Baseline); txt += " ,,, Display =:= "+ (attr.Display); txt += " ,,, Activate =:= "+ (attr.Activate); txt += " ,,, GlobalScale =:= "+ (attr.GlobalScale); txt += " ,,, HiC_d =:= "+ (attr.HiC_d); txt += " ,,, Priority =:= "+ (attr.Priority); if (attr.AllowCORS != null && attr.AllowCORS != '') txt += " ,,, AllowCORS =:= "+ (attr.AllowCORS); if (attr.DynamicJS != null && attr.DynamicJS != '') txt += " ,,, DynamicJS =:= "+ (attr.DynamicJS); if (attr.FinalVersion != null && attr.FinalVersion != '') txt += " ,,, FinalVersion =:= "+ (attr.FinalVersion); } if (attr.Data_Type == "SuffixBoth" || attr.Data_Type == "SuffixTrack") { txt += " ,,, Provider_Name =:= "+ (attr.Provider_Name); txt += " ,,, Provider_Mail =:= "+ (attr.Provider_Mail); txt += " ,,, Institution =:= "+ (attr.Institution); txt += " ,,, Institution_Link =:= "+ (attr.Institution_Link); txt += " ,,, Institution_Logo =:= "+ (attr.Institution_Logo); txt += " ,,, Organism =:= "+ (attr.Organism); } if (attr.Data_Type == "ActiveTrack") { txt += " ,,, Track_URL =:= "+ (attr.Track_URL); } if (attr.Data_Type == "PageTrack" || attr.Data_Type == "SimpleData" || attr.Data_Type == "SimpleTrack" || attr.Data_Type == "MySQLData" || attr.Data_Type == "MySQLTrack") { txt += " ,,, Track_Name =:= "+ attr.Track_Name; txt += " ,,, Track_Type =:= "+ attr.Track_Type; txt += " ,,, Track_Path =:= "+ attr.Track_Path; txt += " ,,, Track_URL =:= "+ attr.Track_URL; txt += " ,,, Icon =:= "+ attr.Icon; txt += " ,,, Height =:= "+ attr.Height; txt += " ,,, boxHeight =:= "+ attr.boxHeight; txt += " ,,, boxWidthMin =:= "+ attr.boxWidthMin; txt += " ,,, Scale =:= "+ attr.Scale; txt += " ,,, Single =:= "+ attr.Single; txt += " ,,, Control =:= "+ attr.Control; txt += " ,,, alignControl =:= "+ attr.alignControl; txt += " ,,, NoArrows =:= "+ attr.NoArrows; txt += " ,,, NoLabels =:= "+ attr.NoLabels; txt += " ,,, Reads =:= "+ attr.Reads; txt += " ,,, Color =:= "+ attr.Color; txt += " ,,, Include =:= "+ attr.Include; txt += " ,,, Path =:= "+ attr.Path; txt += " ,,, Table_List =:= "+ attr.Table_List; txt += " ,,, Title_List =:= "+ attr.Title_List; txt += " ,,, Info_List =:= "+ attr.Info_List; if (attr.Server != null && attr.Server != '') txt += " ,,, Server =:= "+ (attr.Server); if (attr.Options_List != null && attr.Options_List != '') txt += " ,,, Options_List =:= "+ attr.Options_List; if (attr.Append_Assembly != null) txt += " ,,, Append_Assembly =:= "+ (attr.Append_Assembly); if (attr.iBase != null && attr.iBase != '') txt += " ,,, iBase =:= "+ (attr.iBase); txt += " ,,, Force =:= "+ attr.Force; } return txt; } function getEmptyNodes(node) { var allNodes = new Array(); if (node.isLeaf()) return null; else if (!node.hasChildNodes() || !node.expanded) return node; else { node.eachChild(function(mynode) { if (getEmptyNodes(mynode)!=null) allNodes = allNodes.concat(getEmptyNodes(mynode)); }); } return allNodes; } function getAllChildNodes(node) { var allNodes = new Array(); if (node.isLeaf()) { return node; } else { node.eachChild(function(mynode) { if (node.path=='') mynode.path = mynode.text.replace(/ /gi, "_"); else mynode.path = node.path+'/'+mynode.text; allNodes = allNodes.concat(getAllChildNodes(mynode)); }); } return allNodes; } function run_order() { var root = Ext.getCmp('TreePanel').getRootNode(); root.path = ''; var allChildNodes = getAllChildNodes(root); var txt = ''; for (var i=0; i0) txt += " ;;; "; txt += getNodeData(allChildNodes[i]); } if (txt.length < 65536) document.getElementById('x_All_Track').value = txt; else if (txt.length > 650000*2) { alert("Error: Input size > 1.3M (" + txt.length + ")."); return false; } else { var txtz = new Array (40); var j=0; var k = 0; for (var m=0; m<40; m++) txtz[m] = ''; for (m=0; m<40; m++) { j = 65000*m; k = 65000*(m+1); txtz[m] = txt.substring(j, k); if (txt.length < k) break; } document.getElementById('x_All_Track').value = txtz[0]; } return false; } function pass_test() { var tree = Ext.getCmp('TreePanel'); var root = tree.getRootNode(); //expandChildFolder(root); var empyFolders = getEmptyNodes(root); if (empyFolders.length>0) { var labelText = ''; if (empyFolders.length==1) labelText = "Warning: There is an empty folder. Please expand or remove it, and then submit again!"; else labelText = "Warning: There are "+empyFolders.length+" empty folders. Please expand or remove them, and then submit again!"; alert(labelText); expandChildFolder(root); return false; } var allChildNodes = getAllChildNodes(root); var txt = ''; var k = 0; var tp; for (var i=0; i { txt = checkNodeData(allChildNodes[i]); if (txt!='') { var wn = "Warning : "+txt+" is empty in node "+allChildNodes[i].text; alert(wn); allChildNodes[i].select(); return false; } tp = allChildNodes[i].attributes['Data_Type']; if (tp == 'PageTrack' || tp == 'SimpleData' || tp == 'MySQLData' || tp == 'SimpleTrack' || tp == 'MySQLTrack') k++; } if (k==0) return false; return true; } function runv() { if (pass_test()) { var r = confirm("Page is tested & passed. Do you want to save?"); if (r==true) return run_order(); } return false; } function getNodeByText(node, text) { var an = new Array; if (node.text==text) return node; if (!node.hasChildNodes()) return; else { node.eachChild(function(mynode) { an = an.concat(getNodeByText(mynode, text)); }); } return an; } function trashNode (rmv ) { if (rmv=='Remove') { trashNode.node=null; return false; } if (trashNode.node==null) { var root = Ext.getCmp('TreePanel').getRootNode(); trashNode.node = root.findChild("text", "Trash", true); if (trashNode.node==null) { root.appendChild ({id : "x_Trash" , text : "Trash", cls : "folder", iconCls : "silk_bin", "Data_Type" : "TrashFolder"}); return false; } else trashNode.node.expand(); } if (trashNode.node!=null) { var node = trashNode.node; if (!node.hasChildNodes()) return false; var txt = ''; var k=0; node.eachChild(function(mynode) { if (k!=0) txt += " ,,, "; txt += mynode.id; k++; }); if (txt!='') { if (k>1) var lb = "Trash bin has "+k+" items. Are you sure that you want to remove them?"; else var lb = "Trash bin has "+k+" item. Are you sure that you want to remove it?"; var r = confirm(lb); if (r==true) { document.getElementById('x_Trash_Bin').value = txt; } } } return false; } function rollbackPage() { var tree = Ext.getCmp('TreePanel'); var node = tree.getSelectionModel().getSelectedNode(); if (node==null) { alert("Warning: No node selected. Please select a node first."); return false; } else { var r = confirm("Do you want to roll back old page?"); if (r==true) { document.getElementById('x_Rollback_Page').value = node.text; } } return false; } function activeNode(pick) { if (pick=='Remove') { activeNode.node=null; return false; } if (activeNode.node==null) { var root = Ext.getCmp('TreePanel').getRootNode(); activeNode.node = root.findChild("text", "Active", true); } if (activeNode.node==null) { var page = root.firstChild; if (page==null) { alert("Warning: No page exists!"); return false; } var idx = "activeFolder"; page.appendChild ({id : idx, text : "Active", cls : "folder", "Data_Type" : "ActiveFolder"}); activeNode.node = page.lastChild; page.insertBefore(activeNode.node, page.firstChild); activeNode.node.expand(); } var tree = Ext.getCmp('TreePanel'); var node = tree.getSelectionModel().getSelectedNode(); if (node==null) { alert("Warning: No node selected. Please select a node first."); return false; } else { if (activeNode.node.contains(tree.getNodeById(node.id))) alert("Warning: Node '"+node.text+"' has already been picked upto ActiveFolder."); else if (activeNode.node.findChild("text", node.text, true)!=null) alert("Warning: Node '"+node.text+"' has already been picked upto ActiveFolder."); else { var ak = "active_"+node.id; activeNode.node.appendChild({id:ak,text:node.text,cls:"file",iconCls:node.attributes.iconCls,"leaf":true,"Track_URL":node.attributes.Track_URL,"Data_Type":"ActiveTrack"}); } nextNode = node.nextSibling; //Aug. 1 H. C. if (nextNode!=null) nextNode.select(); //Aug. 1 H. C. } } function moveNode () { var dtree = Ext.getCmp('TreePanel'); var dnode = dtree.getSelectionModel().getSelectedNode(); var stree = Ext.getCmp('SourcePanel'); var snode = stree.getSelectionModel().getSelectedNode(); if (snode==null) { alert("Error: No source node selected. Please select a node first."); } else if (dnode==null) { alert("Error: No target folder selected. Please select a folder first."); } else if (dnode.isLeaf()) { alert("Error: Selected target is not a folder."); } else { dnode.expand(); nextNode = snode.nextSibling; if (nextNode!=null) nextNode.select(); dnode.appendChild(snode); } } function editNode () { var tree = Ext.getCmp('TreePanel'); var node = tree.getSelectionModel().getSelectedNode(); if (node==null) { alert("Warning: No node selected. Please select a node first."); return false; } var attr = node.attributes; text = openEditNode(); document.getElementById('x_div2').innerHTML = text; document.getElementById('x_div').style.display = ""; attr2id(); return false; } function closeDiv () { document.getElementById('x_div').style.display = "none"; } function closeDivEC () { document.getElementById('x_div_ec').style.display = "none"; } function editCitation () { var htmlCitation = openEditCitation(); document.getElementById('x_div_ec2').innerHTML = htmlCitation; document.getElementById('x_div_ec').style.display = ""; return false; } function sortText (a, b) { return ( ( a.text == b.text ) ? 0 : ( ( a.text > b.text ) ? 1 : -1 ) ); } function rsortText (a, b) { return sortText(b, a); } function sortNode () { var tree = Ext.getCmp('TreePanel'); var node = tree.getSelectionModel().getSelectedNode(); if (node==null) alert("Warning: No node selected. Please select a node first."); else { node.expand(); if (node.hasChildNodes()) { if (node==sortNode.node && sortNode.mo!=null && sortNode.mo==1) { sortNode.mo = 2; node.sort(rsortText); } else { sortNode.mo = 1; node.sort(sortText); } } else alert("Warning: No folder node selected. Please select a folder first."); } sortNode.node = node; } function removeNode () { var tree = Ext.getCmp('TreePanel'); var node = tree.getSelectionModel().getSelectedNode(); if (node==null) alert("Warning: No node selected. Please select a node first."); else if (node==tree.getRootNode()) alert("Warning: Root node can not be removed."); else { nextNode = node.nextSibling; //Aug. 1 H.C. if (nextNode!=null) nextNode.select(); //Aug. 1 H.C. if (node.attributes['Data_Type']=='ActiveFolder') activeNode('Remove'); if (node.attributes['Data_Type']=='TrashFolder') trashNode('Remove'); node.remove(); } } function addNode () { var tree = Ext.getCmp('TreePanel'); var node = tree.getSelectionModel().getSelectedNode(); if (node==null) node = tree.getRootNode(); if (!node.isLeaf()) { addNode.no = ++addNode.no || 1; var idx = "new_folder_id_"+addNode.no; node.expand(); if (node==tree.getRootNode() && !node.hasChildNodes()) { //node.appendChild({id : idx, text : "NewPage", cls : "folder", iconCls : "silk_page_red", "Data_Type" : "PageBase" }); var newNode = new Ext.tree.TreeNode({id : idx, text : "NewPage", cls : "folder", iconCls : "silk_page_red", "Data_Type" : "PageBase" }); node.appendChild(newNode); addNode.no = ++addNode.no; idx = "new_folder_id_"+addNode.no; newNode.appendChild({id : idx, text : "Annotation Models", cls : "folder" }); } else node.appendChild({id : idx, text : "New Folder", cls : "folder" }); } } function doneEditNode() { id2attr(); pass2tree(true); closeDiv(); return false; } function doneEditCitation() { var logo = document.getElementById("x_Citation_Logo").value; var url = document.getElementById("x_Citation_URL").value; var name = document.getElementById("x_Citation_Name").value; var title = document.getElementById("x_Citation_Title").value; var journal = document.getElementById("x_Citation_Journal").value; var pages = document.getElementById("x_Citation_Pages").value; var email = document.getElementById("x_Citation_Email").value; var citation = name + ' ' + title + ' '+ journal + ' ' + pages; var html = "
"; if (logo != '') { if (url != '') html += ''; if (logo.indexOf('.gif')>0 || logo.indexOf('.png')>0 || logo.indexOf('.jpg')>0) html += ''; else html += '

' + logo + '

'; if (url != '') html += '
'; html += '
'; } else if (url != '') { html += '

' + title + '


'; } else html += '

' + title + '


'; html += '
' + '' + '' + '' + '' + '' +'' + '
Author: ' + name + '
Title: ' + title + '
Journal: ' + journal + ' ' + pages + '
Contact: ' + email + '
Citation: ' + citation + '

'; document.getElementById("x_Citation").value = html; closeDivEC(); return false; } function getDataTypeNo (attr) { if (attr.Data_Type==null || attr.Data_Type=='PageBase' || attr.Data_Type=='TrackBase') return 0; if (attr.Data_Type=='ActiveFolder' || attr.Data_Type=='ActiveTrack') return 0; if (attr.Data_Type=='SuffixBoth') return 12; if (attr.Data_Type=='SuffixTrack') return 10; if (attr.Data_Type=='SuffixPage') return 2; if (attr.Data_Type=='SimpleData' || attr.Data_Type=='MySQLData' || attr.Data_Type=='SimpleTrack' || attr.Data_Type=='MySQLTrack') return 56; if (attr.Data_Type=='PageData' || attr.Data_Type=='PageTrack') return 6; if (attr.Data_Type=='SimpleFolder' || attr.Data_Type=='MySQLFolder' || attr.Data_Type=='TrackFolder') return 34; return 4; } function openEditCitation() { var html = ''; html += '

'; html += ''; html += '   Citation:'; html += '
'; html += 'Logo:  
'; html += 'URL:  
'; html += 'Author:  
'; html += 'Title:  
'; html += 'Journal:  
'; html += 'Vol/Pages:  
'; html += 'Email:  
'; html += '
'; html += '
'; html += '     CancelDone  
'; return html; } function openEditNode() { var html = ''; var bt=-3; var tree = Ext.getCmp('TreePanel'); var node = tree.getSelectionModel().getSelectedNode(); if (node==null) return alert("Warning: No node is selected!"); var attr = node.attributes; bt = getDataTypeNo (attr); html += '

'; html += ''; html += 'Node:   '+node.text+''; html += '   '; html += '
'; if (Math.floor(bt/10)==1) { html += 'Author:   '; html += 'Email: 
'; html += 'Institution:   '; html += 'Inst url:  
'; html += 'Inst Logo:  
'; html += 'Organism:    
'; } if (Math.floor(bt/10)>1) { html += 'Include:    
'; if (attr.Data_Type!='SimpleFolder' && attr.Data_Type!='SimpleTrack' && attr.Data_Type!='SimpleData') html += 'Server:    
'; //html += 'Path:  
'; } if (Math.floor(bt/10)==5) { html += 'Table:  
'; html += 'Title:  
'; html += 'Info:  
'; } if ((Math.floor(bt/10)==3 || Math.floor(bt/10)==5) && (attr.Data_Type=='MySQLFolder' || attr.Data_Type=='MySQLTrack' || attr.Data_Type=='MySQLData')) html += 'Customs:  
'; if (Math.floor(bt/10)==5 || bt%10==6) { html += 'Track url:  
'; html += 'Track name:  
'; } if (Math.floor(bt/10)==1 || bt%10==2) { html += 'Genome:    
'; } if (bt>12) { if (bt%10!=4 || attr.Data_Type=='MySQLFolder' || attr.Data_Type=='MySQLTrack' || attr.Data_Type=='MySQLData') { html += 'Setting:   '; if (attr.Data_Type=='MySQLFolder' || attr.Data_Type=='MySQLTrack' || attr.Data_Type=='MySQLData') { html += ' Append assembly'; html += ' Index zero'; } if (bt%10!=4) html += ' Force to overwrite'; html += '
'; } } if (bt%10==2) { html += '
'; html += 'Curator:   '; html += 'Email: 
'; html += 'Page title:  
'; html += 'Notes:  
'; html += 'Citation:  
'; html += 'Locations:   '; html += ' Chr: '; html += 'Pos: '; html += 'Bases: '; html += 'Pixels: '; html += '
'; } if (bt%10==4 || bt%10==6) { html += 'Track type:    
'; html += 'Track icon:    
'; html += 'Options:   '; html += 'Height: '; html += 'Scale: '; html += 'boxHeight: '; html += 'boxWidthMin:
'; html += '   '; html += 'alignCtrl: '; html += ' Single'; html += ' No Arrows'; html += ' No Labels'; html += ' ShowCtrl
'; html += ' Color:  '; html += '     read : 883333
'; } if (bt%10==2) { html += 'Settings:   '; html += ' Baseline: '; html += 'Display: '; html += 'Global Scale: '; //html += 'HiC_d: '; html += '
'; html += '  '; html += ' Yaxis: '; html += ' Multi: '; html += 'HiC_d: '; html += 'Activate:
'; html += 'Priority:   '; html += ' '; html += ' CORS '; html += ' Dynamic JS '; html += ' Final '; html += ''; } if (bt!=0 && (bt%10==4 || bt==30)) { html += '
Policy:   '; html += ' Set thru subtree'; html += ' Override'; //html += ' Normalize'; html += ''; } html += '
'; html += '
'; if (bt!=0 && (bt%10==4 || bt==30)) { html += '   Cancel   NormalizeDone   '; } else { html += '   CancelDone   '; } return html; } function id2attr() { var tree = Ext.getCmp('TreePanel'); var node = tree.getSelectionModel().getSelectedNode(); if (node==null) return; var attr = node.attributes; if (null != document.getElementById("x_Data_Type") && '' != document.getElementById("x_Data_Type").value) attr.Data_Type = document.getElementById("x_Data_Type").value; if (null != document.getElementById("x_Provider_Name") && '' != document.getElementById("x_Provider_Name").value) attr.Provider_Name = document.getElementById("x_Provider_Name").value; if (null != document.getElementById("x_Provider_Mail") && '' != document.getElementById("x_Provider_Mail").value) attr.Provider_Mail = document.getElementById("x_Provider_Mail").value; if (null != document.getElementById("x_Institution") && '' != document.getElementById("x_Institution").value) attr.Institution = document.getElementById("x_Institution").value; if (null != document.getElementById("x_Institution_Link") && '' != document.getElementById("x_Institution_Link").value) attr.Institution_Link = document.getElementById("x_Institution_Link").value; if (null != document.getElementById("x_Institution_Logo") && '' != document.getElementById("x_Institution_Logo").value) attr.Institution_Logo = document.getElementById("x_Institution_Logo").value; if (null != document.getElementById("x_Organism") && '' != document.getElementById("x_Organism").value) attr.Organism = document.getElementById("x_Organism").value; if (null != document.getElementById("x_Include") && '' != document.getElementById("x_Include").value) attr.Include = document.getElementById("x_Include").value; if (null != document.getElementById("x_Server") && '' != document.getElementById("x_Server").value) attr.Server = document.getElementById("x_Server").value; if (null != document.getElementById("x_Path") && '' != document.getElementById("x_Path").value) attr.Path = document.getElementById("x_Path").value; if (null != document.getElementById("x_Table_List") && '' != document.getElementById("x_Table_List").value) attr.Table_List = document.getElementById("x_Table_List").value; if (null != document.getElementById("x_Title_List") && '' != document.getElementById("x_Title_List").value) attr.Title_List = document.getElementById("x_Title_List").value; if (null != document.getElementById("x_Info_List") && '' != document.getElementById("x_Info_List").value) attr.Info_List = document.getElementById("x_Info_List").value; if (null != document.getElementById("x_Options_List") && '' != document.getElementById("x_Options_List").value) attr.Options_List = document.getElementById("x_Options_List").value; if (null != document.getElementById("x_Name_List") && '' != document.getElementById("x_Name_List").value) attr.Name_List = document.getElementById("x_Name_List").value; if (null != document.getElementById("x_File_List") && '' != document.getElementById("x_File_List").value) attr.File_List = document.getElementById("x_File_List").value; if (null != document.getElementById("x_Track_URL") && '' != document.getElementById("x_Track_URL").value) attr.Track_URL = document.getElementById("x_Track_URL").value; if (null != document.getElementById("x_Track_Name") && '' != document.getElementById("x_Track_Name").value) attr.Track_Name = document.getElementById("x_Track_Name").value; if (null != document.getElementById("x_Track_Path") && '' != document.getElementById("x_Track_Path").value) attr.Track_Path = document.getElementById("x_Track_Path").value; if (null != document.getElementById("x_Track_Type") && '' != document.getElementById("x_Track_Type").value) attr.Track_Type = document.getElementById("x_Track_Type").value; if (null != document.getElementById("x_Genome_URL") && '' != document.getElementById("x_Genome_URL").value) attr.Genome_URL = document.getElementById("x_Genome_URL").value; if (null != document.getElementById("x_Append_Assembly")) if (document.getElementById("x_Append_Assembly").checked) attr.Append_Assembly = true; else attr.Append_Assembly = ''; if (null != document.getElementById("x_iBase")) if (document.getElementById("x_iBase").checked) attr.iBase = true; else attr.iBase = ''; if (null != document.getElementById("x_Force_Track")) if (document.getElementById("x_Force_Track").checked) attr.Force_Track = true; else attr.Force_Track = ''; if (null != document.getElementById("x_Author") && '' != document.getElementById("x_Author").value) attr.Author = document.getElementById("x_Author").value; if (null != document.getElementById("x_Email") && '' != document.getElementById("x_Email").value) attr.Email = document.getElementById("x_Email").value; if (null != document.getElementById("x_Page_Title") && '' != document.getElementById("x_Page_Title").value) attr.Page_Title = document.getElementById("x_Page_Title").value; if (null != document.getElementById("x_Notes") && '' != document.getElementById("x_Notes").value) attr.Notes = document.getElementById("x_Notes").value; if (null != document.getElementById("x_Citation") && '' != document.getElementById("x_Citation").value) attr.Citation = document.getElementById("x_Citation").value; if (null != document.getElementById("x_Assembly") && '' != document.getElementById("x_Assembly").value) attr.Assembly = document.getElementById("x_Assembly").value; if (null != document.getElementById("x_Position") && '' != document.getElementById("x_Position").value) attr.Position = document.getElementById("x_Position").value; if (null != document.getElementById("x_Bases") && '' != document.getElementById("x_Bases").value) attr.Bases = document.getElementById("x_Bases").value; if (null != document.getElementById("x_Pixels") && '' != document.getElementById("x_Pixels").value) attr.Pixels = document.getElementById("x_Pixels").value; if (null != document.getElementById("x_Baseline") && '' != document.getElementById("x_Baseline").value) attr.Baseline = document.getElementById("x_Baseline").value; if (null != document.getElementById("x_Display") && '' != document.getElementById("x_Display").value) attr.Display = document.getElementById("x_Display").value; if (null != document.getElementById("x_GlobalScale") && '' != document.getElementById("x_GlobalScale").value) attr.GlobalScale = document.getElementById("x_GlobalScale").value; if (null != document.getElementById("x_HiC_d") && '' != document.getElementById("x_HiC_d").value) attr.HiC_d = document.getElementById("x_HiC_d").value; if (null != document.getElementById("x_Activate") && '' != document.getElementById("x_Activate").value) attr.Activate = document.getElementById("x_Activate").value; if (null != document.getElementById("x_Multi") && '' != document.getElementById("x_Multi").value) attr.Multi = document.getElementById("x_Multi").value; if (null != document.getElementById("x_Yaxis") && '' != document.getElementById("x_Yaxis").value) attr.Yaxis = document.getElementById("x_Yaxis").value; if (null != document.getElementById("x_Priority") && '' != document.getElementById("x_Priority").value) attr.Priority = document.getElementById("x_Priority").value; if (null != document.getElementById("x_AllowCORS")) if (document.getElementById("x_AllowCORS").checked) attr.AllowCORS = true; else attr.AllowCORS = ''; if (null != document.getElementById("x_DynamicJS")) if (document.getElementById("x_DynamicJS").checked) attr.DynamicJS = true; else attr.DynamicJS = ''; if (null != document.getElementById("x_FinalVersion")) if (document.getElementById("x_FinalVersion").checked) attr.FinalVersion = true; else attr.FinalVersion = ''; if (null != document.getElementById("x_Force_Page")) if (document.getElementById("x_Force_Page").checked) attr.Force_Page = true; else attr.Force_Page = ''; if (null != document.getElementById("x_Force")) if (document.getElementById("x_Force").checked) attr.Force = true; else attr.Force = ''; if (null != document.getElementById("x_Icon") && '' != document.getElementById("x_Icon").value) attr.Icon = document.getElementById("x_Icon").value; if (null != document.getElementById("x_Height") && '' != document.getElementById("x_Height").value) attr.Height = document.getElementById("x_Height").value; if (null != document.getElementById("x_Scale") && '' != document.getElementById("x_Scale").value) attr.Scale = document.getElementById("x_Scale").value; if (null != document.getElementById("x_boxHeight") && '' != document.getElementById("x_boxHeight").value) attr.boxHeight = document.getElementById("x_boxHeight").value; if (null != document.getElementById("x_boxWidthMin") && '' != document.getElementById("x_boxWidthMin").value) attr.boxWidthMin = document.getElementById("x_boxWidthMin").value; if (null != document.getElementById("x_Single")) if (document.getElementById("x_Single").checked) attr.Single = true; else attr.Single = ''; if (null != document.getElementById("x_Control")) if (document.getElementById("x_Control").checked) attr.Control = true; else attr.Control = ''; if (null != document.getElementById("x_alignControl")) if (document.getElementById("x_alignControl").checked) attr.alignControl = true; else attr.alignControl = ''; if (null != document.getElementById("x_Arrows")) if (document.getElementById("x_Arrows").checked) attr.NoArrows = true; else attr.NoArrows = ''; if (null != document.getElementById("x_Labels")) if (document.getElementById("x_Labels").checked) attr.NoLabels = true; else attr.NoLabels = ''; if (null != document.getElementById("x_Color") && '' != document.getElementById("x_Color").value) attr.Color= document.getElementById("x_Color").value; if (null != document.getElementById("x_GlobalSet")) if (document.getElementById("x_GlobalSet").checked) attr.GlobalSet = true; else attr.GlobalSet = ''; if (null != document.getElementById("x_ForceSet")) if (document.getElementById("x_ForceSet").checked) attr.ForceSet = true; else attr.ForceSet = ''; } function attr2id () { var tree = Ext.getCmp('TreePanel'); var node = tree.getSelectionModel().getSelectedNode(); if (node==null) return; var attr = node.attributes; if (attr.Data_Type != null) document.getElementById("x_Data_Type").value = attr.Data_Type; if (attr.Provider_Name != null && null != document.getElementById("x_Provider_Name")) document.getElementById("x_Provider_Name").value = attr.Provider_Name; if (attr.Provider_Mail != null && null != document.getElementById("x_Provider_Mail")) document.getElementById("x_Provider_Mail").value = attr.Provider_Mail; if (attr.Institution != null && null != document.getElementById("x_Institution")) document.getElementById("x_Institution").value = attr.Institution; if (attr.Institution_Link != null && null != document.getElementById("x_Institution_Link")) document.getElementById("x_Institution_Link").value = attr.Institution_Link; if (attr.Institution_Logo != null && null != document.getElementById("x_Institution_Logo")) document.getElementById("x_Institution_Logo").value = attr.Institution_Logo; if (attr.Organism != null && null != document.getElementById("x_Organism")) document.getElementById("x_Organism").value = attr.Organism; if (attr.Include != null && null != document.getElementById("x_Include")) document.getElementById("x_Include").value = attr.Include; if (attr.Server != null && null != document.getElementById("x_Server")) document.getElementById("x_Server").value = attr.Server; if (attr.Path != null && null != document.getElementById("x_Path")) document.getElementById("x_Path").value = attr.Path; if (attr.Table_List != null && null != document.getElementById("x_Table_List")) document.getElementById("x_Table_List").value = attr.Table_List; if (attr.Title_List != null && null != document.getElementById("x_Title_List")) document.getElementById("x_Title_List").value = attr.Title_List; if (attr.Info_List != null && null != document.getElementById("x_Info_List")) document.getElementById("x_Info_List").value = attr.Info_List; if (attr.Options_List != null && null != document.getElementById("x_Options_List")) document.getElementById("x_Options_List").value = attr.Options_List; if (attr.File_List != null && null != document.getElementById("x_File_List")) document.getElementById("x_File_List").value = attr.File_List; if (attr.Name_List != null && null != document.getElementById("x_Name_List")) document.getElementById("x_Name_List").value = attr.Name_List; if (attr.Track_URL != null && null != document.getElementById("x_Track_URL")) document.getElementById("x_Track_URL").value = attr.Track_URL; if (null != document.getElementById("x_Track_Name")) document.getElementById("x_Track_Name").value = node.text; //if (attr.Track_Name != null && null != document.getElementById("x_Track_Name")) document.getElementById("x_Track_Name").value = attr.Track_Name; if (attr.Track_Path != null && null != document.getElementById("x_Track_Path")) document.getElementById("x_Track_Path").value = attr.Track_Path; if (attr.Track_Type != null && null != document.getElementById("x_Track_Type")) document.getElementById("x_Track_Type").value = attr.Track_Type; if (attr.Append_Assembly != null && attr.Append_Assembly!='' && null != document.getElementById("x_Append_Assembly")) document.getElementById("x_Append_Assembly").checked = true; if (attr.iBase != null && attr.iBase != '' && null != document.getElementById("x_iBase")) document.getElementById("x_iBase").checked = true; if (attr.Force != null && attr.Force != '' && null != document.getElementById("x_Force")) document.getElementById("x_Force").checked = true; if (attr.Author != null && null != document.getElementById("x_Author")) document.getElementById("x_Author").value = attr.Author; if (attr.Email != null && null != document.getElementById("x_Email")) document.getElementById("x_Email").value = attr.Email; if (attr.Page_Title != null && null != document.getElementById("x_Page_Title")) document.getElementById("x_Page_Title").value = attr.Page_Title; if (attr.Notes != null && null != document.getElementById("x_Notes")) document.getElementById("x_Notes").value = attr.Notes; if (attr.Citation != null && null != document.getElementById("x_Citation")) document.getElementById("x_Citation").value = attr.Citation; if (attr.Genome_URL != null && null != document.getElementById("x_Genome_URL")) document.getElementById("x_Genome_URL").value = attr.Genome_URL; if (attr.Assembly != null && null != document.getElementById("x_Assembly")) document.getElementById("x_Assembly").value = attr.Assembly; if (attr.Position != null && null != document.getElementById("x_Position")) document.getElementById("x_Position").value = attr.Position; if (attr.Bases != null && null != document.getElementById("x_Bases")) document.getElementById("x_Bases").value = attr.Bases; if (attr.Pixels != null && null != document.getElementById("x_Pixels")) document.getElementById("x_Pixels").value = attr.Pixels; if (attr.Icon != null && null != document.getElementById("x_Icon")) document.getElementById("x_Icon").value = attr.Icon; if (attr.Height != null && null != document.getElementById("x_Height")) document.getElementById("x_Height").value = attr.Height; if (attr.Scale != null && null != document.getElementById("x_Scale")) document.getElementById("x_Scale").value = attr.Scale; if (attr.boxHeight!= null && null != document.getElementById("x_boxHeight")) document.getElementById("x_boxHeight").value = attr.boxHeight; if (attr.boxWidthMin!= null && null != document.getElementById("x_boxWidthMin")) document.getElementById("x_boxWidthMin").value = attr.boxWidthMin; if (attr.Single!=null && attr.Single!='' && null != document.getElementById("x_Single")) document.getElementById("x_Single").checked = true; if (attr.Control!=null && attr.Control!='' && null != document.getElementById("x_Control")) document.getElementById("x_Control").checked = true; if (attr.alignControl!=null && attr.alignControl!='' && null != document.getElementById("x_alignControl")) document.getElementById("x_alignControl").checked = true; if (attr.NoArrows!=null && attr.NoArrows!='' && null != document.getElementById("x_Arrows")) document.getElementById("x_Arrows").checked = true; if (attr.NoLabels!=null && attr.NoLabels!='' && null != document.getElementById("x_Labels")) document.getElementById("x_Labels").checked = true; if (attr.Yaxis != null && null != document.getElementById("x_Yaxis")) document.getElementById("x_Yaxis").value = attr.Yaxis; if (attr.Priority != null && null != document.getElementById("x_Priority")) document.getElementById("x_Priority").value = attr.Priority; if (attr.AllowCORS != null && attr.AllowCORS && null != document.getElementById("x_AllowCORS")) document.getElementById("x_AllowCORS").checked = true; if (attr.DynamicJS != null && attr.DynamicJS && null != document.getElementById("x_DynamicJS")) document.getElementById("x_DynamicJS").checked = true; if (attr.FinalVersion != null && attr.FinalVersion && null != document.getElementById("x_FinalVersion")) document.getElementById("x_FinalVersion").checked = true; if (attr.Force_Track != null && null != document.getElementById("x_Force_Track")) document.getElementById("x_Force_Track").checked = true; if (attr.Color != null && null != document.getElementById("x_Color")) document.getElementById("x_Color").value = attr.Color; if (attr.Baseline != null && null != document.getElementById("x_Baseline")) document.getElementById("x_Baseline").value = attr.Baseline; if (attr.Display != null && null != document.getElementById("x_Display")) document.getElementById("x_Display").value = attr.Display; if (attr.Activate != null && null != document.getElementById("x_Activate")) document.getElementById("x_Activate").value = attr.Activate; if (attr.HiC_d != null && null != document.getElementById("x_HiC_d")) document.getElementById("x_HiC_d").value = attr.HiC_d; if (attr.GlobalScale != null && null != document.getElementById("x_GlobalScale")) document.getElementById("x_GlobalScale").value = attr.GlobalScale; else if (null != document.getElementById("x_GlobalScale")) document.getElementById("x_GlobalScale").value = 2; if (attr.Multi != null && null != document.getElementById("x_Multi")) document.getElementById("x_Multi").value = attr.Multi; //if (attr.GlobalSet != null && null != document.getElementById("x_GlobalSet")) document.getElementById("x_GlobalSet").value = attr.GlobalSet; //if (attr.ForceSet != null && null != document.getElementById("x_ForceSet")) document.getElementById("x_ForceSet").value = attr.ForceSet; } function passThruTree (node, key, value, force) { attr = node.attributes; for (var i=0; i0) { if (readno==-1) readno = mynode.attributes.Reads; mynode.attributes.Scale = (scale*readno/mynode.attributes.Reads).toFixed(4); } }); } return true; } function pass2tree (chk) { var tree = Ext.getCmp('TreePanel'); var node = tree.getSelectionModel().getSelectedNode(); if (node==null) return alert("Warning: No node is selected. Please select a node first"); var attr = node.attributes; if (chk==true && attr.GlobalSet!=true) return ; var key = new Array; var value = new Array; var keys = Object.keys(attr); for (var i=0,k=0; i size) { w -= pace; h -= pace; self.width = w.toString(); self.height = h.toString(); } else clearInterval(myDock); }