 function displayDoc(url) { url_path = url; url = "../../htm/api/xml/"+url+".xml"; if (window.XMLHttpRequest) { xmlDoc = new XMLHttpRequest(); xmlDoc.onreadystatechange = function () { if (xmlDoc.readyState == 4) writeList() }; xmlDoc.open("GET", url, true); xmlDoc.send(null); } else if (window.ActiveXObject) { xmlDoc = new ActiveXObject("Microsoft.XMLHTTP"); xmlDoc.onreadystatechange = function () { if (xmlDoc.readyState == 4) writeList() }; xmlDoc.open("GET", url, true); xmlDoc.send(); } else { alert('Your browser can\'t handle this script'); return; } } function writeList() { url_path = "../../htm/api/help/"+url_path; createTable(word_constructor,"const",false,false,"table_const"); createTable(word_properties,"prop",true,false,"table_prop"); createTable(word_methods,"method",false,false,"table_method"); createTable(word_events,"event",false,false,"table_event"); xmlDoc = xmlDoc.responseXML; document.getElementById('documentation').style.display = ''; var labels = xmlDoc.getElementsByTagName('component'); document.getElementById("list_composant").style.display = "none"; var _summary = new Array(); _summary["const"] = new Array(); _summary["method"] = new Array(); _summary["prop"] = new Array(); _summary["event"] = new Array(); for (var i=0; i < labels.length; i++) { document.getElementById("title_compo").innerHTML =""; document.getElementById("compo_desc").innerHTML =""; document.getElementById("title_compo").appendChild(document.createTextNode(labels[i].getAttribute('name'))); document.getElementById("compo_desc").appendChild(document.createTextNode(labels[i].getAttribute('hint'))); for (var j=0; j < labels[i].childNodes.length; j++) { if(labels[i].childNodes[j].nodeType != 3){ isconstructor = false; if (labels[i].childNodes[j].nodeName == "property"){ _summary["prop"].push(labels[i].childNodes[j].getAttribute('name')); var tr = document.createElement('TR'); var td_name = document.createElement('TD'); td_name.setAttribute("vAlign", "top"); text_name = labels[i].childNodes[j].getAttribute('name'); td_name.innerHTML = "<a name='"+text_name+"'></a><span class='td_name'>"+text_name+"</span>"; var td_type = document.createElement('TD'); td_type.setAttribute("vAlign", "top"); td_type.appendChild(document.createTextNode(labels[i].childNodes[j].getAttribute('type'))); var ul_property = document.createElement('UL'); ul_property.setAttribute("class", "cust_li_blue"); ul_property.setAttribute("className", "cust_li_blue"); var li_property_hint = document.createElement('LI'); text_hint = labels[i].childNodes[j].getAttribute('hint'); li_property_hint.innerHTML = "<span class='hint'>"+text_hint+"</span>"; ul_property.appendChild(li_property_hint); var div_exemple = document.createElement('DIV'); div_exemple.id = "R"+labels[i].childNodes[j].getAttribute('name'); div_exemple.innerHTML = "<a href='javascript:getPREcode(&quot;"+url_path+".htm&quot;,&quot;"+labels[i].childNodes[j].getAttribute('name')+"&quot;);' id='A"+div_exemple.id+"'>"+word_example+"</a>"; var li_property_exemple = document.createElement('LI'); li_property_exemple.appendChild(div_exemple); ul_property.appendChild(li_property_exemple); var td_desc = document.createElement('TD'); td_desc.appendChild(ul_property); tr.appendChild(td_name); tr.appendChild(td_type); tr.appendChild(td_desc); document.getElementById('table_prop').appendChild(tr); var withProperty = true; } if (labels[i].childNodes[j].nodeName == "method"){ if (labels[i].childNodes[j].getAttribute('isconstructor') != null) _summary["const"].push(labels[i].childNodes[j].getAttribute('name')); else _summary["method"].push(labels[i].childNodes[j].getAttribute('name')); var tr = document.createElement('TR'); var td_name = document.createElement('TD'); td_name.setAttribute("vAlign", "top"); text_name = labels[i].childNodes[j].getAttribute('name'); td_name.innerHTML = "<a name='"+text_name+"'></a><span class='td_name'>"+text_name+"</span>"; var td_desc = document.createElement('TD'); var ul_method = document.createElement('UL'); ul_method.setAttribute("class", "cust_li_blue"); ul_method.setAttribute("className", "cust_li_blue"); var li_method_hint = document.createElement('LI'); text_hint = labels[i].childNodes[j].getAttribute('hint'); li_method_hint.innerHTML = "<span class='hint'>"+text_hint+"</span>"; ul_method.appendChild(li_method_hint); tr.appendChild(td_name); if (labels[i].childNodes[j].getAttribute('isconstructor') != null){ isconstructor = true; } if (labels[i].childNodes[j].hasChildNodes()){ var li_method_param = document.createElement('LI'); var k=0; var ul_method_property = document.createElement('UL'); ul_method_property.setAttribute("class", "cust_li_blue_bis"); ul_method_property.setAttribute("className", "cust_li_blue_bis"); list_param = "<span class='syntax'>"; if (isconstructor) list_param += "new "; list_param += labels[i].childNodes[j].getAttribute('name'); while(k<labels[i].childNodes[j].childNodes.length) { if (k==0){ list_param += "(<span class='syntax_param'>"; } if(labels[i].childNodes[j].childNodes[k].nodeType != 3){ list_param += labels[i].childNodes[j].childNodes[k].getAttribute('name'); var li = document.createElement('li'); str_property = "<span class='title_param'>"+labels[i].childNodes[j].childNodes[k].getAttribute('name')+" : </span>"; str_property += labels[i].childNodes[j].childNodes[k].getAttribute('hint'); li.innerHTML = str_property; ul_method_property.appendChild(li); } if (k==(labels[i].childNodes[j].childNodes.length-1)){ list_param += "</span>)"; } else { if ((labels[i].childNodes[j].childNodes[k+1].nodeType != 3)&&(k!=0)) { list_param += "<span class='syntax_virg'>,</span>"; } } k++; } list_param += "</span>"; li_method_param.innerHTML += list_param; li_method_param.appendChild(ul_method_property); ul_method.appendChild(li_method_param); var div_exemple = document.createElement('DIV'); div_exemple.id = "R"+labels[i].childNodes[j].getAttribute('name'); div_exemple.innerHTML = "<a href='javascript:getPREcode(&quot;"+url_path+".htm&quot;,&quot;"+labels[i].childNodes[j].getAttribute('name')+"&quot;)' id='A"+div_exemple.id+"'>"+word_example+"</a>"; var li_method_exemple = document.createElement('LI'); li_method_exemple.appendChild(div_exemple); ul_method.appendChild(li_method_exemple); td_desc.appendChild(ul_method); tr.appendChild(td_desc); if (!isconstructor){ document.getElementById('table_method').appendChild(tr); var withMethod = true; } else { document.getElementById('table_const').appendChild(tr); var withConst = true; } } else { var li_method_syntax = document.createElement('LI'); if (isconstructor) li_method_syntax.innerHTML += "<span class='syntax'>new "+labels[i].childNodes[j].getAttribute('name')+"()</span>"; if (!isconstructor) li_method_syntax.innerHTML += "<span class='syntax'>"+labels[i].childNodes[j].getAttribute('name')+"()</span>"; ul_method.appendChild(li_method_syntax); if (!isconstructor){ var div_exemple = document.createElement('DIV'); div_exemple.id = "R"+labels[i].childNodes[j].getAttribute('name'); div_exemple.innerHTML = "<a href='javascript:getPREcode(&quot;"+url_path+".htm&quot;,&quot;"+labels[i].childNodes[j].getAttribute('name')+"&quot;)' id='A"+div_exemple.id+"'>"+word_example+"</a>"; td_desc.appendChild(div_exemple); var li_method_exemple = document.createElement('LI'); li_method_exemple.appendChild(div_exemple); ul_method.appendChild(li_method_exemple); } td_desc.appendChild(ul_method); tr.appendChild(td_desc); if (!isconstructor){ document.getElementById('table_method').appendChild(tr); var withMethod = true; } else { document.getElementById('table_const').appendChild(tr); var withConst = true; } } } if (labels[i].childNodes[j].nodeName == "event"){ _summary["event"].push(labels[i].childNodes[j].getAttribute('name')); var tr = document.createElement('TR'); var td_name = document.createElement('TD'); td_name.setAttribute("vAlign", "top"); text_name = labels[i].childNodes[j].getAttribute('name'); td_name.innerHTML = "<a name='"+text_name+"'></a><span class='td_name'>"+text_name+"</span>"; var ul_event = document.createElement('UL'); ul_event.setAttribute("class", "cust_li_blue"); ul_event.setAttribute("className", "cust_li_blue"); var li_event_hint = document.createElement('LI'); text_hint = labels[i].childNodes[j].getAttribute('hint'); li_event_hint.innerHTML = "<span class='hint'>"+text_hint+"</span>"; ul_event.appendChild(li_event_hint); var div_exemple = document.createElement('DIV'); div_exemple.id = "R"+labels[i].childNodes[j].getAttribute('name'); div_exemple.innerHTML = "<a href='javascript:getPREcode(&quot;"+url_path+".htm&quot;,&quot;"+labels[i].childNodes[j].getAttribute('name')+"&quot;)' id='A"+div_exemple.id+"'>"+word_example+"</a>"; var li_event_exemple = document.createElement('LI'); li_event_exemple.appendChild(div_exemple); ul_event.appendChild(li_event_exemple); var td_desc = document.createElement('TD'); td_desc.appendChild(ul_event); tr.appendChild(td_name); tr.appendChild(td_desc); document.getElementById('table_event').appendChild(tr); var withEvent = true; } } } } location.href= "#DocContent"; if (!withEvent) document.getElementById("event").style.display = "none"; if (!withMethod) document.getElementById("method").style.display = "none"; if (!withProperty) document.getElementById("prop").style.display = "none"; if (!withConst) document.getElementById("const").style.display = "none"; _summary["const"].sort(); _summary["method"].sort(); _summary["prop"].sort(); _summary["event"].sort(); var sumHTML = ""; if (_summary["const"].length > 0) { sumHTML += "<h3 style='margin-left:10px;clear: both;'>"+word_constructor+"</h3>"; sumHTML += "<ul style='clear: both;'>"; for (var i=0; i<_summary["const"].length;i++) sumHTML += "<li><a href='#"+_summary["const"][i]+"'>"+_summary["const"][i]+"</a></li>"; sumHTML += "</ul><br>"; } if (_summary["prop"].length > 0) { sumHTML += "<h3 style='margin-left:10px;clear: both;'>"+word_properties+"</h3>"; sumHTML += "<ul style='clear: both;'>"; for (var i=0; i<_summary["prop"].length;i++) sumHTML += "<li><a href='#"+_summary["prop"][i]+"'>"+_summary["prop"][i]+"</a></li>"; sumHTML += "</ul><br>"; } if (_summary["method"].length > 0) { sumHTML += "<h3 style='margin-left:10px;clear: both;'>"+word_methods+"</h3>"; sumHTML += "<ul style='clear: both;'>"; for (var i=0; i<_summary["method"].length;i++) sumHTML += "<li><a href='#"+_summary["method"][i]+"'>"+_summary["method"][i]+"</a></li>"; sumHTML += "</ul><br>"; } if (_summary["event"].length > 0) { sumHTML += "<h3 style='margin-left:10px;clear: both;'>"+word_events+"</h3>"; sumHTML += "<ul style='clear: both;'>"; for (var i=0; i<_summary["event"].length;i++) sumHTML += "<li><a href='#"+_summary["event"][i]+"'>"+_summary["event"][i]+"</a></li>"; sumHTML += "</ul><br>"; } if (sumHTML != "") { document.getElementById("list_composant_sum").innerHTML = sumHTML; document.getElementById("list_composant").style.display = ""; } } function createTable(nom,div_id,withtype,withvalue,tbody_id){ document.getElementById(div_id).innerHTML = ""; document.getElementById(div_id).style.display = ""; var h3 = document.createElement('H3'); var table = document.createElement('TABLE'); table.setAttribute("width", "540"); table.setAttribute("style", "width:540px"); var tbody = document.createElement('TBODY'); tbody.id = tbody_id; var tr = document.createElement('TR'); var th1 = document.createElement('TH'); if (withtype){ var th2 = document.createElement('TH'); } if (withvalue){ var th3 = document.createElement('TH'); } var th4 = document.createElement('TH'); h3.appendChild(document.createTextNode(nom)); th1.appendChild(document.createTextNode(word_name)); if (withtype){ th2.appendChild(document.createTextNode(word_type)); } if (withvalue){ th3.appendChild(document.createTextNode(word_value)); } th4.appendChild(document.createTextNode(word_description)); tr.appendChild(th1); if (withtype){ tr.appendChild(th2); } if (withvalue){ tr.appendChild(th3); } tr.appendChild(th4); tbody.appendChild(tr); table.appendChild(tbody); document.getElementById(div_id).appendChild(h3); document.getElementById(div_id).appendChild(table); } function createXHR() { var request = false; try { request = new ActiveXObject('Msxml2.XMLHTTP'); } catch (err2) { try { request = new ActiveXObject('Microsoft.XMLHTTP'); } catch (err3) { try { request = new XMLHttpRequest(); } catch (err1) { request = false; } } } return request; } function getBody(content) { var x = content.indexOf("<body"); if(x == -1) return ""; x = content.indexOf(">", x); if(x == -1) return ""; var y = content.lastIndexOf("</body>"); if(y == -1) return ""; var z = content.slice(x + 1, y); return z; } function loadHTML(url, fun, storage, exemple_id) { var xhr = createXHR(); xhr.onreadystatechange=function() { if(xhr.readyState == 4) { storage.innerHTML = getBody(xhr.responseText); fun(storage, exemple_id, url); } }; xhr.open("GET", url , true); xhr.send(null); } function processByDOM(responseHTML, exemple_id, url) { var message = responseHTML.getElementsByTagName("pre"); for (var i=0; i < message.length ; i++) { if (message[i].getAttribute("id") == exemple_id) { largeur = document.getElementById("R"+exemple_id).offsetWidth; document.getElementById("R"+exemple_id).innerHTML = "<div style='width:"+largeur+"; overflow: auto;background-color:#E6ECFB;' id='cont"+exemple_id+"'><pre class='cust_code2' id='pre"+exemple_id+"'>"+message[i].innerHTML+"</pre></div>"; document.getElementById("R"+exemple_id).innerHTML += "<div style='text-align: right;'><a href='javascript:popUp(\""+url+"#"+exemple_id+"\")'>"+word_see_example+"</a></div>"; document.getElementById("cont"+exemple_id).style.height = document.getElementById("pre"+exemple_id).offsetHeight+20; document.getElementById("cont"+exemple_id).style.width = largeur+"px"; } else { } } } function getPREcode(url,exemple_id) { if (typeof(url_stock)=="undefined") { url_stock = ""; } if (url_stock != url){ url_stock = url; var responseHTML = document.getElementById("storage"); loadHTML(url, processByDOM, responseHTML, exemple_id); } else { processByDOM(document.getElementById('storage'), exemple_id, url); } } function popUp(page) { window.open(page, '', 'resizable=no, location=no, width=1000, height=580, menubar=no, status=no, scrollbars=no, menubar=no'); } 