--- a/server/ui.js +++ b/server/ui.js @@ -4,298 +4,296 @@ elementTagName: " ", elementId: " ", flag : 0, - showlinks : 0, - showbox : 0, - blog_flag : false, testContext : function() { - $(document).ready(function(){$('body *').contents().filter(function() -{ - try{ - if(this.nodeType == 3) - { - return (this.nodeType == 3) && this.nodeValue.match(/\S/);}} - catch(err) - { - }}).wrap('')}); + $(document).ready(function(){$('body *').contents().filter(function() + { + //console.log(this.nodeName); + try{ + if(this.nodeType == 3) + { + return (this.nodeType == 3) && this.nodeValue.match(/\S/);}} + catch(err) + { +// console.log(err.message); +// console.log(this); + }}).wrap('')}); vimg = document.getElementsByTagName('img'); for(i=0; i'; + $(result).before(audio); + } + else{ + result.textContent = newContent; + } + result=nodes.iterateNext(); + } + } + catch (e) + { + dump( 'error: Document tree modified during iteration ' + e ); + } }, - - showBox: function() { - $(function() { - $( "#show-box" ).dialog( "destroy" ); - - $( "#show-box" ).dialog({ - width: 300, - height: 300, - modal: true - }); - }); - a11ypi.createMenu(a11ypi.showbox); + close: function() { + document.getElementById('ren_overlay').style.display = 'none'; }, - - showBox1: function() { - $(function() { - $( "#show-links" ).dialog( "destroy" ); - - $( "#show-links" ).dialog({ - width: 500, - height: 300, - modal: true - }); - }); - a11ypi.createDomainMenu(); - }, - - blogFilter: function() { - if (a11ypi.blog_flag == false) { - a11ypi.blog_flag = true; + filter: function() + { var xhr = new XMLHttpRequest(); xhr.onreadystatechange = function() { if(xhr.readyState == 4) + { + if(xhr.responseText =='empty') { - if(xhr.responseText == "empty") - { } + a11ypi.clearMenu(); + alert("An internal server error occured, please try later."); + } else - { - var sel = document.getElementById("blog-filter"); - var menu_list = JSON.parse(xhr.responseText); - blogArray = []; - for (var i=0; i< menu_list.length; i++) - { - blogArray[i] = menu_list[i].split("http://")[1].split(".com")[0] + ".com"; - } - blogArray.sort(); - for (var i=0; i < blogArray.length; i++) - { - if ( i == 0 ) - { - opt = document.createElement("option"); - opt.textContent = blogArray[0]; - sel.appendChild(opt); - } - else if(blogArray[i] == blogArray[i-1]) - { } - else - { - opt = document.createElement("option"); - opt.textContent = blogArray[i]; - sel.appendChild(opt); - } - } + { + + d ={}; + var response=xhr.responseText.substring(3).split('###'); + for (var j= 0; j< response.length ; j++){ + chunk = response[j].substring(1).split('&'); + + for (var i= 0; i< chunk.length ; i++){ + pair =chunk[i].split("::"); + key = pair[0]; + value = pair[1]; + d[key] = value; } + path = d['xpath']; + newContent = d['data']; + a11ypi.evaluate(path,newContent); + } } + } } - xhr.open("POST","http://y.a11y.in/blog",true); + d = window.location.search.split('?')[1]; + var a =[]; + for (var i = 0;i