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++)
31 var ua = navigator.userAgent.toLowerCase();
32 return ua.indexOf("msie") > -1;
39 //console.log("loading");
41 this.addEvent(document,'click', function(e) {
42 var ev = e || window.event;
43 var t = ev.target || ev.srcElement;
45 return RooDocsPage.clicked(t);
52 addEvent: function(el, eventName, fn)
55 if (window.addEventListener) {
57 el.addEventListener(eventName, fn, (capture));
60 if (window.attachEvent) {
61 el.attachEvent("on" + eventName, fn);
70 var classAr = t.className.split(' ');
71 //console.log(classAr)
72 if ((t.nodeName == 'a') && (classAr.indexOf('exi') < 0) && (classAr.indexOf('micon') < 0)) {
81 if (classAr.indexOf('exi') > -1 || classAr.indexOf('micon') > -1) {
84 //console.log(tr.parentNode);
85 while (tr.parentNode) {
86 ///console.log(tr.nodeName);
87 if (tr.nodeName.toUpperCase() =='TR') {
92 if (tr.nodeName.toUpperCase() != 'TR') { // no tr!
95 //console.log(tr.className)
96 if (tr.className.match(/expandable/)) {
98 if (!/expanded/.test(tr.className)) {
100 tr.className += " expanded";
102 //this.loadComments(tr);
104 // console.log("ADDED:"+ tr.className);
106 tr.className = tr.className.replace(/ expanded/,'');
107 //console.log("REMOVED:"+ tr.className);
118 getAttributeNS : function(d,ns,name) {
120 // ie uses attribute stuff...
121 var type = typeof d[ns+":"+name];
122 if(type != 'undefined' && type != 'unknown'){
123 return d[ns+":"+name];
128 return d.getAttributeNS(ns, name) || d.getAttribute(ns+":"+name) || d.getAttribute(name) || d[name];
133 this.vis = this.vis == '' ? 'none : '';
135 Array.prototype.slice.call(
136 document.getElementsByClassName('expandable')
137 ).forEach(function(e) {
138 if (!e.className.match(/notInherited/)) { e.style.display= vis; }}
145 this.preview.getEl().on('click', function(e, target)
147 //console.log("click pressed?");
149 if(target = e.getTarget('a:not(.exi)', 3)) {
150 var cls = Ext.fly(target).getAttributeNS('roo', 'cls');
153 var member = Ext.fly(target).getAttributeNS('roo', 'member');
154 //this.loadClass(target.href, cls, member);
156 if (/^src\//.test(cls)) {
157 cls = cls.replace(/.js$/, ''); // get rid of .js for source links..
161 MainBody.loadPage("symbols/"+ cls +".html");
164 if(target.className == 'inner-link'){ // go to #
165 this.getActiveTab().scrollToSection(target.href.split('#')[1]);
168 window.open(target.href);
170 return; // no more...
172 if(target = e.getTarget('.micon', 2)){
175 var tr = Ext.fly(target.parentNode);
176 if(tr.hasClass('expandable')){
177 tr.toggleClass('expanded');