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 132 --------------------------------------------------------++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  • Diff rendering mode:
  • inline
  • side by side

alipi/ui.js

68 {68 {
69 a11ypi.showbox = data;69 a11ypi.showbox = data;
70 $('#see-narration').show();70 $('#see-narration').show();
71 $("#blog-filter").show(); a11ypi.blogFilter();
71 // $("#blog-filter").show(); a11ypi.blogFilter();
72 $("#go").show();72 $("#go").show();
73 });73 });
7474
85 if(a11ypi.fflag == '0')85 if(a11ypi.fflag == '0')
86 {86 {
87 a11ypi.fflag = 1;87 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 }
110 },117 },
111118
112 getURL: function(e) {119 getURL: function(e) {
329 // '5el</button>'+329 // '5el</button>'+
330 '<button id="see-links" class="alipi" onclick="a11ypi.showBox1();" title="See other re-narrated pages of this domain">Re-narrated Pages '+330 '<button id="see-links" class="alipi" onclick="a11ypi.showBox1();" title="See other re-narrated pages of this domain">Re-narrated Pages '+
331 '</button>'+331 '</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>'+
334 '<div id="show-box" title="Choose a narration"></div> '+334 '<div id="show-box" title="Choose a narration"></div> '+
335 '<div id="show-comment" title="Comments for"></div> '+335 '<div id="show-comment" title="Comments for"></div> '+
336 '<div id="show-links" title="List of pages narrated in this domain" class="alipi"></div> '+336 '<div id="show-links" title="List of pages narrated in this domain" class="alipi"></div> '+
734 function () {$('#show-links').title= '';}734 function () {$('#show-links').title= '';}
735 );735 );
736 },736 },
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 // },
769 go: function() {782 go: function() {
770 var a =[];783 var a =[];
771 for (var i = 0;i<d.split('&').length;i++){784 for (var i = 0;i<d.split('&').length;i++){