Commit f7e74a732f711e2d3f885d513080ad90936ec976
- Diff rendering mode:
- inline
- side by side
alipi/ui.js
(76 / 56)
  | |||
68 | 68 | { | |
69 | 69 | a11ypi.showbox = data; | |
70 | 70 | $('#see-narration').show(); | |
71 | $("#blog-filter").show(); a11ypi.blogFilter(); | ||
71 | // $("#blog-filter").show(); a11ypi.blogFilter(); | ||
72 | 72 | $("#go").show(); | |
73 | 73 | }); | |
74 | 74 | ||
… | … | ||
85 | 85 | if(a11ypi.fflag == '0') | |
86 | 86 | { | |
87 | 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)); | ||
109 | 114 | ||
115 | }); | ||
116 | } | ||
110 | 117 | }, | |
111 | 118 | ||
112 | 119 | getURL: function(e) { | |
… | … | ||
329 | 329 | // '5el</button>'+ | |
330 | 330 | '<button id="see-links" class="alipi" onclick="a11ypi.showBox1();" title="See other re-narrated pages of this domain">Re-narrated Pages '+ | |
331 | 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 | 334 | '<div id="show-box" title="Choose a narration"></div> '+ | |
335 | 335 | '<div id="show-comment" title="Comments for"></div> '+ | |
336 | 336 | '<div id="show-links" title="List of pages narrated in this domain" class="alipi"></div> '+ | |
… | … | ||
734 | 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 | 782 | go: function() { | |
770 | 783 | var a =[]; | |
771 | 784 | for (var i = 0;i<d.split('&').length;i++){ |