1 //<script type="text/javascript">
2 /* -- IE kludge as usual! */
3 if (!Array.prototype.indexOf)
5 Array.prototype.indexOf = function(elt /*, from*/)
9 var from = Number(arguments[1]) || 0;
16 for (; from < len; from++)
30 var ua = navigator.userAgent.toLowerCase();
31 return ua.indexOf("msie") > -1;
38 //console.log("loading");
40 this.addEvent(document,'click', function(e) {
41 var ev = e || window.event;
42 var t = ev.target || ev.srcElement;
44 return RooDocsPage.clicked(t);
51 addEvent: function(el, eventName, fn)
54 if (window.addEventListener) {
56 el.addEventListener(eventName, fn, (capture));
59 if (window.attachEvent) {
60 el.attachEvent("on" + eventName, fn);
69 var classAr = t.className.split(' ');
70 //console.log(classAr)
71 if ((t.nodeName == 'a') && (classAr.indexOf('exi') < 0) && (classAr.indexOf('micon') < 0)) {
80 if (classAr.indexOf('exi') > -1 || classAr.indexOf('micon') > -1) {
83 //console.log(tr.parentNode);
84 while (tr.parentNode) {
85 ///console.log(tr.nodeName);
86 if (tr.nodeName.toUpperCase() =='TR') {
91 if (tr.nodeName.toUpperCase() != 'TR') { // no tr!
94 //console.log(tr.className)
95 if (tr.className.match(/expandable/)) {
97 if (!/expanded/.test(tr.className)) {
99 tr.className += " expanded";
101 //this.loadComments(tr);
103 // console.log("ADDED:"+ tr.className);
105 tr.className = tr.className.replace(/ expanded/,'');
106 //console.log("REMOVED:"+ tr.className);
117 getAttributeNS : function(d,ns,name) {
119 // ie uses attribute stuff...
120 var type = typeof d[ns+":"+name];
121 if(type != 'undefined' && type != 'unknown'){
122 return d[ns+":"+name];
127 return d.getAttributeNS(ns, name) || d.getAttribute(ns+":"+name) || d.getAttribute(name) || d[name];
131 toggle : function () {
132 this.display = (this.display == 'none' ) ? '': 'none';
133 var display = this.display;
135 Array.prototype.slice.call(
136 document.getElementsByTagName('tr')
137 ).forEach(function(tr) {
138 tr.style.display = '';
139 if (tr.className.match(/notInherited/)) return;
140 if (!tr.className.match(/expandable/)) return;
141 tr.style.display = display;
147 this.preview.getEl().on('click', function(e, target)
149 //console.log("click pressed?");
151 if(target = e.getTarget('a:not(.exi)', 3)) {
152 var cls = Ext.fly(target).getAttributeNS('roo', 'cls');
155 var member = Ext.fly(target).getAttributeNS('roo', 'member');
156 //this.loadClass(target.href, cls, member);
158 if (/^src\//.test(cls)) {
159 cls = cls.replace(/.js$/, ''); // get rid of .js for source links..
163 MainBody.loadPage("symbols/"+ cls +".html");
166 if(target.className == 'inner-link'){ // go to #
167 this.getActiveTab().scrollToSection(target.href.split('#')[1]);
170 window.open(target.href);
172 return; // no more...
174 if(target = e.getTarget('.micon', 2)){
177 var tr = Ext.fly(target.parentNode);
178 if(tr.hasClass('expandable')){
179 tr.toggleClass('expanded');