Difference between revisions of "Team:William and Mary/Outreach DB/Fuzzy Search"

(Created page with "{{Team:William_and_Mary/CSS_RESET}} {{Team:William_and_Mary/CSS_FIX}} {{Team:William_and_Mary/SOURCE}} {{Team:William_and_Mary/HEADER2}} <html lang="en"> <head> <meta char...")
 
Line 20: Line 20:
 
     }
 
     }
  
     .tag-label{
+
     .tag-label {
 
       margin-left: 15px;
 
       margin-left: 15px;
 
       vertical-align: top;
 
       vertical-align: top;
Line 27: Line 27:
 
     }
 
     }
  
     .tag{
+
     .tag {
 
       display: inline-block;
 
       display: inline-block;
 
     }
 
     }
 
 
 
   </style>
 
   </style>
 
   <script src="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/4.0.10/handlebars.min.js"></script>
 
   <script src="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/4.0.10/handlebars.min.js"></script>
Line 38: Line 36:
 
   <script src="http://cdn.jsdelivr.net/alasql/0.3/alasql.min.js"></script>
 
   <script src="http://cdn.jsdelivr.net/alasql/0.3/alasql.min.js"></script>
 
   <script src='https://2017.igem.org/Team:William_and_Mary/outreach_db_js?action=raw&ctype=text/javascript' type='text/javascript'></script>
 
   <script src='https://2017.igem.org/Team:William_and_Mary/outreach_db_js?action=raw&ctype=text/javascript' type='text/javascript'></script>
 +
  <script src='https://cdnjs.cloudflare.com/ajax/libs/fuse.js/3.0.4/fuse.min.js'></script>
 
   <!--script src='outreach_db.js'></script-->
 
   <!--script src='outreach_db.js'></script-->
  
Line 50: Line 49:
 
         {{#each this}}
 
         {{#each this}}
 
         <li class='tag'>
 
         <li class='tag'>
           <input type='checkbox' name='{{@../key}}' value='{{this}}' class='tag-checkbox'/><label class='tag-label'>{{this}}</label>
+
           <input type='checkbox' name='{{@../key}}' value='{{this}}' class='tag-checkbox' /><label class='tag-label'>{{this}}</label>
 
         </li>
 
         </li>
 
         <br> {{/each}}
 
         <br> {{/each}}
Line 148: Line 147:
 
             $(this).parent().find(".tag-type").toggle();
 
             $(this).parent().find(".tag-type").toggle();
 
           });
 
           });
 +
 +
          fusedata = alasql('select * from outreach')
 +
          var options = {
 +
            shouldSort: true,
 +
            threshold: 0.6,
 +
            location: 0,
 +
            distance: 100,
 +
            maxPatternLength: 32,
 +
            minMatchCharLength: 1,
 +
            keys: [
 +
              "title",
 +
              "author.firstName"
 +
            ]
 +
          };
 +
          fuse = new Fuse(outreach, options); // "list" is the item array
 +
          var result = fuse.search("aachen");
 +
          console.log(result)
 
         }
 
         }
 
       );
 
       );
Line 222: Line 238:
 
<body>
 
<body>
 
   <br></br>
 
   <br></br>
<br></br>
+
  <br></br>
  
 
   <center><img src="https://static.igem.org/mediawiki/2017/4/41/T--William_and_Mary--Database383.jpeg" width=360/></center>
 
   <center><img src="https://static.igem.org/mediawiki/2017/4/41/T--William_and_Mary--Database383.jpeg" width=360/></center>
Line 228: Line 244:
  
  
<div class="row">
+
  <div class="row">
  <div class="col-sm-1"></div>
+
    <div class="col-sm-1"></div>
 
     <div class="col-sm-11" style='padding: top: 50px;font-size: 16px;'>
 
     <div class="col-sm-11" style='padding: top: 50px;font-size: 16px;'>
 
       <form onsubmit="show_details(parseInt(document.getElementById('input-id').value, 10).toString())">
 
       <form onsubmit="show_details(parseInt(document.getElementById('input-id').value, 10).toString())">
Line 236: Line 252:
 
       </form>
 
       </form>
 
     </div>
 
     </div>
</div>
+
  </div>
  
  

Revision as of 00:16, 2 November 2017

Outreach Database: select tags for search





Quick ID Jump: