diff ismi-python-neo4jrestclient/static/commentaries_authors2.html @ 31:a6b2a09ea413

fix commentary chain visualisation author name display and search by clicking author name.
author casties
date Fri, 11 Dec 2015 17:06:26 -0500
parents cccbcc845d54
children
line wrap: on
line diff
--- a/ismi-python-neo4jrestclient/static/commentaries_authors2.html	Fri Dec 11 13:03:04 2015 -0500
+++ b/ismi-python-neo4jrestclient/static/commentaries_authors2.html	Fri Dec 11 17:06:26 2015 -0500
@@ -16,7 +16,7 @@
                             <div class="form-group">
                                 <input type="text" value="jaghmini" placeholder="Search for person name" class="form-control" name="search">
                             </div>
-                            <button class="btn btn-default" type="submit">Search for author name</button>
+                            <button class="btn btn-default" type="submit">Search for author id</button>
                         </form>
                     </li>
                 </ul>
@@ -124,8 +124,9 @@
                         if (!data) return;
                         $("#title").text("Title: "+data.title);
                         var $list = $("#info").empty();
-                        $list.append($("<li> author: " + data.author + "</li>"));
+                        $list.append($("<li> author: " + data.author.label + "</li>"));
                         for (var key in data.attrs) {
+                            if (key[0] === "_") continue;
                             var val = data.attrs[key];
                             if (key === "link") {
                                 val = "<a href=\"" + val + "\" target=\"_blank\">" + val + "</a>";
@@ -158,6 +159,7 @@
                         if (!data || data.length == 0) return;
                         // clear all marks
                         $("#graph .marked").each(function(){this.classList.remove("marked")});
+                        // fill list of texts
                         data.forEach(function (row) {
                             var text = row.text;
                             var author = row.author;
@@ -170,6 +172,7 @@
                             // set mark
                             $("#graph .ismi-"+text.ismi_id).each(function(){this.classList.add("marked")});
                         });
+                        // show details of the first text
                         showText(data[0].text.ismi_id);
                     }, "json");
             return false;