Commit f7e74a732f711e2d3f885d513080ad90936ec976

  • avatar
  • Arvind <arvinkhadri @gm…l.com>
  • Thu Jun 27 17:44:23 IST 2013
Removing choose blog option from the UI
alipi/ui.js
(76 / 56)
  
6868 {
6969 a11ypi.showbox = data;
7070 $('#see-narration').show();
71 $("#blog-filter").show(); a11ypi.blogFilter();
71 // $("#blog-filter").show(); a11ypi.blogFilter();
7272 $("#go").show();
7373 });
7474
8585 if(a11ypi.fflag == '0')
8686 {
8787 a11ypi.fflag = 1;
88 var xhr = new XMLHttpRequest();
89 xhr.onreadystatechange = function()
90 {
91 if(xhr.readyState == 4)
92 {
93 if(xhr.responseText == "empty")
94 {
95 // a11ypi.clearMenu();
96 }
97 else
98 {
99 a11ypi.createMenuFilter(JSON.parse(xhr.responseText));
100 }
101 }
102 }
103 xhr.open("POST",config.root+"/menu",true);
104 xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded");
105 a = a11ypi.getParams();
106 data = 'url='+a['foruri']+'&option='+a['blog'];
107 xhr.send(data) ;
108 }
88 // var xhr = new XMLHttpRequest();
89 // xhr.onreadystatechange = function()
90 // {
91 // if(xhr.readyState == 4)
92 // {
93 // if(xhr.responseText == "empty")
94 // {
95 // // a11ypi.clearMenu();
96 // }
97 // else
98 // {
99 // a11ypi.createMenuFilter(JSON.parse(xhr.responseText));
100 // }
101 // }
102 // }
103 // xhr.open("POST",config.deploy+"/menu",true);
104 // xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded");
105 // a = a11ypi.getParams();
106 // data = 'url='+a['foruri']+'&option='+a['blog'];
107 // xhr.send(data) ;
108 // }
109 var request = {};
110 request['url'] = a['foruri'];
111 request['option'] = a['blog'];
112 $.get(config.deploy+"/menu", {"url":a["foruri"], "option":a['blog']}, function(data){
113 a11ypi.createMenuFilter(JSON.parse(data));
109114
115 });
116 }
110117 },
111118
112119 getURL: function(e) {
329329 // '5el</button>'+
330330 '<button id="see-links" class="alipi" onclick="a11ypi.showBox1();" title="See other re-narrated pages of this domain">Re-narrated Pages '+
331331 '</button>'+
332 '<select id="blog-filter" class="alipi" onChange="a11ypi.checkSelect();" title="Select one of the blog name"></select>'+
333 '<button id="go" class="alipi ui-icon-circle-arrow-e" onclick="a11ypi.go();" title="Filter by blog" >|Y|</button>'+
332 // '<select id="blog-filter" class="alipi" onChange="a11ypi.checkSelect();" title="Select one of the blog name"></select>'+
333 // '<button id="go" class="alipi ui-icon-circle-arrow-e" onclick="a11ypi.go();" title="Filter by blog" >|Y|</button>'+
334334 '<div id="show-box" title="Choose a narration"></div> '+
335335 '<div id="show-comment" title="Comments for"></div> '+
336336 '<div id="show-links" title="List of pages narrated in this domain" class="alipi"></div> '+
734734 function () {$('#show-links').title= '';}
735735 );
736736 },
737 blogFilter: function() {
738 if (a11ypi.blog_flag == false) {
739 a11ypi.blog_flag = true;
740 var xhr = new XMLHttpRequest();
741 xhr.onreadystatechange = function()
742 {
743 if(xhr.readyState == 4)
744 {
745 if(xhr.responseText == "empty")
746 { }
747 else
748 {
749 var sel = $("#blog-filter");
750 var menu_list = JSON.parse(xhr.responseText);
751 opt = document.createElement("option");
752 opt.textContent = "Choose a blog";
753 sel.append(opt);
754 for (var i=0; i < menu_list.length; i++)
755 {
756 opt = document.createElement("option");
757 opt.textContent = menu_list[i];
758 sel.append(opt);
759 }
760 }
761 }
762 }
763 xhr.open("POST",config.root+"/blog",true);
764 xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded");
765 a = a11ypi.getParams();
766 xhr.send('url='+a['foruri']);
767 }
768 },
737 // blogFilter: function() {
738 // if (a11ypi.blog_flag == false) {
739 // a11ypi.blog_flag = true;
740 // // var xhr = new XMLHttpRequest();
741 // // xhr.onreadystatechange = function()
742 // // {
743 // // if(xhr.readyState == 4)
744 // // {
745 // // if(xhr.responseText == "empty")
746 // // { }
747 // // else
748 // // {
749 // // var sel = $("#blog-filter");
750 // // var menu_list = JSON.parse(xhr.responseText);
751 // // opt = document.createElement("option");
752 // // opt.textContent = "Choose a blog";
753 // // sel.append(opt);
754 // // for (var i=0; i < menu_list.length; i++)
755 // // {
756 // // opt = document.createElement("option");
757 // // opt.textContent = menu_list[i];
758 // // sel.append(opt);
759 // // }
760 // // }
761 // // }
762 // // }
763 // // xhr.open("POST",config.deploy+"/blog",true);
764 // // xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded");
765 // // a = a11ypi.getParams();
766 // // xhr.send('url='+a['foruri']);
767 // $.get(config.deploy+"/blog", {"url":a['foruri']}, function(data){
768 // var sel = $("#blog-filter");
769 // var menu_list = JSON.parse(data);
770 // opt = document.createElement("option");
771 // opt.textContent = "Choose a blog";
772 // sel.append(opt);
773 // for (var i=0; i < menu_list.length; i++)
774 // {
775 // opt = document.createElement("option");
776 // opt.textContent = menu_list[i];
777 // sel.append(opt);
778 // }
779 // });
780 // }
781 // },
769782 go: function() {
770783 var a =[];
771784 for (var i = 0;i<d.split('&').length;i++){