Commit 3fa1cd5db3c225b2c21a4b831835f110203fd16a

  • avatar
  • arvind
  • Fri Jul 05 14:15:18 IST 2013
UI changes
  - Fixing calls to /domain and showing of re-narrated pages in a domain
  • Diff rendering mode:
  • inline
  • side by side

alipi/alipi.py

470470
471 string=''471 string=''
472 if len(query)==0:472 if len(query)==0:
473 return 'empty'
473 return jsonify({'0':'empty'})
474 else:474 else:
475 otherlist = []
475 otherlist = {}
476 cntr = -1
476 mylist = query[0]['narration']477 mylist = query[0]['narration']
477 for i in mylist:478 for i in mylist:
478 if i in otherlist:479 if i in otherlist:
479 pass480 pass
480 else:481 else:
481 otherlist.append(str(i))
482 return json.dumps(otherlist)
482 cntr += 1
483 otherlist[cntr] = str(i)
484 return jsonify(otherlist)
483485
484486
485import logging,os487import logging,os

alipi/ui.js

737 // xhr.send('url='+a['foruri'])737 // xhr.send('url='+a['foruri'])
738738
739 $.get(config.deploy+"/domain", {"url":a['foruri']}, function(data){739 $.get(config.deploy+"/domain", {"url":a['foruri']}, function(data){
740 a11ypi.showlinks = JSON.parse(data);
740 if(data[0] != 'empty')
741 {
742 a11ypi.showlinks = data;
743 $('#see-links').show();
744 }
741 });745 });
742 },746 },
743 showBox1: function() {747 showBox1: function() {
763 createDomainMenu: function() {763 createDomainMenu: function() {
764 var xyz = $("#show-links");764 var xyz = $("#show-links");
765 xyz.html('');765 xyz.html('');
766 menu_list = a11ypi.showlinks;
767 for(var i=0; i<menu_list.length;i++)
766 for(var i in a11ypi.showlinks)
768 {767 {
769 var para = document.createElement("p");768 var para = document.createElement("p");
770 var newel = document.createElement("a");769 var newel = document.createElement("a");
771 newel.textContent = menu_list[i];
772 newel.setAttribute("href", config.deploy+"/?foruri="+encodeURIComponent(menu_list[i]));
770 newel.textContent = a11ypi.showlinks[i];
771 newel.setAttribute("href", config.deploy+"/?foruri="+encodeURIComponent(a11ypi.showlinks[i]));
773 newel.setAttribute("class","alipiShowLink");772 newel.setAttribute("class","alipiShowLink");
774 para.appendChild(newel);773 para.appendChild(newel);
775 xyz.append(para);774 xyz.append(para);