Commit 3fa1cd5db3c225b2c21a4b831835f110203fd16a
- Diff rendering mode:
- inline
- side by side
alipi/alipi.py
(6 / 4)
  | |||
470 | 470 | ||
471 | 471 | string='' | |
472 | 472 | if len(query)==0: | |
473 | return 'empty' | ||
473 | return jsonify({'0':'empty'}) | ||
474 | 474 | else: | |
475 | otherlist = [] | ||
475 | otherlist = {} | ||
476 | cntr = -1 | ||
476 | 477 | mylist = query[0]['narration'] | |
477 | 478 | for i in mylist: | |
478 | 479 | if i in otherlist: | |
479 | 480 | pass | |
480 | 481 | else: | |
481 | otherlist.append(str(i)) | ||
482 | return json.dumps(otherlist) | ||
482 | cntr += 1 | ||
483 | otherlist[cntr] = str(i) | ||
484 | return jsonify(otherlist) | ||
483 | 485 | ||
484 | 486 | ||
485 | 487 | import logging,os |
alipi/ui.js
(8 / 5)
  | |||
737 | 737 | // xhr.send('url='+a['foruri']) | |
738 | 738 | ||
739 | 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 | 747 | showBox1: function() { | |
… | … | ||
763 | 763 | createDomainMenu: function() { | |
764 | 764 | var xyz = $("#show-links"); | |
765 | 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 | 768 | var para = document.createElement("p"); | |
770 | 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 | 772 | newel.setAttribute("class","alipiShowLink"); | |
774 | 773 | para.appendChild(newel); | |
775 | 774 | xyz.append(para); |