diff --git a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/config/Profile.js b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/config/Profile.js index 9a02e973bcd6bfd85cabaeb39d9fa79f7031eb07..a0fac769149f3d50666b8ecdaf4e5a7993284644 100644 --- a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/config/Profile.js +++ b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/config/Profile.js @@ -242,16 +242,77 @@ $.extend(DefaultProfile.prototype, { * Used by Inspector */ this.inspectorContentTransformer = function(sample, propertyCode, propertyContent) { - return { + + if(propertyContent.indexOf("<root>") != -1) { + return { + "isSingleColumn" : true, + "content" : this.getHTMLTableFromManagePropertyXML(propertyContent) + }; + } else { + if(propertyContent === "<root/>\n") { //To clean empty XMLs and don't show them. + propertyContent = ""; + } + return { "isSingleColumn" : false, "content" : propertyContent - }; + }; + } } this.inspectorContentExtra = function(sample, propertyContent) { return ""; } + this.getHTMLTableFromManagePropertyXML = function(xmlDocument) { + var table_head = null; + var table_body = ""; + var dom; + + if (window.DOMParser) { + parser = new DOMParser(); + dom = parser.parseFromString(xmlDocument,"text/xml"); + } else {// Internet Explorer + dom = new ActiveXObject("Microsoft.XMLDOM"); + dom.async = false; + dom.loadXML(xmlDocument); + } + + var html = null; + var root = dom.childNodes[0]; + var children = root.childNodes; + for(var i = 0; i < children.length; i++) { + var child = children[i]; + if (child.localName != null) { + var keys = child.attributes; + if (table_head == null) { + table_head = "<tr>"; + var key = null; + for (var j = 0; j < keys.length; j++) { + key = keys[j]; + if(key.localName != "permId") { + table_head += "<th style='text-align:left; width:" + (100/(keys.length-1)) + "%;'>"+ key.localName + "</th>"; + } + } + table_head += "</tr>"; + } + table_body += "<tr>"; + for (var j = 0; j < keys.length; j++) { + key = keys[j]; + if(key.localName != "permId") { + if(key.localName == "date") { + table_body += "<td style='text-align:left; width:" + (100/(keys.length-1)) + "%;'>" + key.value + "</td>"; + } else { + table_body += "<td style='text-align:left; width:" + (100/(keys.length-1)) + "%;'>" + key.value + "</td>"; + } + } + } + table_body += "</tr>"; + } + } + html = "<table style='font-family:helvetica; font-size:90%; width: 100%;'><thead>" + table_head + "</thead><tbody>"+ table_body + "</tbody></table>"; + return html; + } + /* * Returns a Jquery component that is appended at the end of the form before the data set viewer */ diff --git a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/config/YeastLabProfile.js b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/config/YeastLabProfile.js index ef2bbaba5fbed53c4961160ec271af4d080fa413..6ca3e8d85bf80a6f64140439ca8edf4b9eeba3aa 100644 --- a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/config/YeastLabProfile.js +++ b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/config/YeastLabProfile.js @@ -165,74 +165,6 @@ $.extend(YeastLabProfile.prototype, DefaultProfile.prototype, { } } - this.getHTMLTableFromXML = function(xmlDocument) { - var table_head = null; - var table_body = ""; - var dom; - - if (window.DOMParser) { - parser = new DOMParser(); - dom = parser.parseFromString(xmlDocument,"text/xml"); - } else {// Internet Explorer - dom = new ActiveXObject("Microsoft.XMLDOM"); - dom.async = false; - dom.loadXML(xmlDocument); - } - - var html = null; - var root = dom.childNodes[0]; - var children = root.childNodes; - for(var i = 0; i < children.length; i++) { - var child = children[i]; - if (child.localName != null) { - var keys = child.attributes; - if (table_head == null) { - table_head = "<tr>"; - var key = null; - for (var j = 0; j < keys.length; j++) { - key = keys[j]; - if(key.localName != "permId") { - table_head += "<th style='text-align:left; width:" + (100/(keys.length-1)) + "%;'>"+ key.localName + "</th>"; - } - } - table_head += "</tr>"; - } - table_body += "<tr>"; - for (var j = 0; j < keys.length; j++) { - key = keys[j]; - if(key.localName != "permId") { - if(key.localName == "date") { - table_body += "<td style='text-align:left; width:" + (100/(keys.length-1)) + "%;'>" + key.value + "</td>"; - } else { - table_body += "<td style='text-align:left; width:" + (100/(keys.length-1)) + "%;'>" + key.value + "</td>"; - } - } - } - table_body += "</tr>"; - } - } - html = "<table style='font-family:helvetica; font-size:90%; width: 100%;'><thead>" + table_head + "</thead><tbody>"+ table_body + "</tbody></table>"; - return html; - } - - this.inspectorContentTransformer = function(sample, propertyCode, propertyContent) { - - if(propertyContent.indexOf("<root>") != -1) { - return { - "isSingleColumn" : true, - "content" : this.getHTMLTableFromXML(propertyContent) - }; - } else { - if(propertyContent === "<root/>\n") { //To clean empty XMLs and don't show them. - propertyContent = ""; - } - return { - "isSingleColumn" : false, - "content" : propertyContent - }; - } - } - this.searchSorter = function(searchResults) { var getChars = function(code) {