From d21a63ca533fa3554fd1b5eec3ce6b77c9fb386e Mon Sep 17 00:00:00 2001 From: Henry Gabryjelski Date: Fri, 2 Apr 2021 19:57:35 -0700 Subject: [PATCH] Update README and enable "search builder" (#57) --- README.md | 2 +- index.html | 24 +++++++++++++++--------- js/main.js | 7 +++++++ 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index da5a1cc..1cfae2a 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Any time you're on a Github repo you can click the bookmarklet and it'll bring up the Active Forks of that repo. ```javascript -javascript:thing=document.URL.match(/github.com\/([A-z][\w\-]*\/[A-z][\w\-]*)/);if (thing){var newPage = 'https://techgaun.github.io/active-forks/index.html#'+thing[1];open(newPage%20,'targetname')%20}%20else%20{window.alert("Not%20a%20valid%20GitHub%20page");} +javascript:!function(){if(title=document.title,title)if(thing=title.split(/(GitHub\s-\s)*([^:]*)/)[2],thing){var t="https://techgaun.github.io/active-forks/index.html#"+thing;window.open(t)}else window.alert("Not%20a%20valid%20GitHub%20page")}(); ``` ![Screenshot](screenshot.png "Active Forks in Action") diff --git a/index.html b/index.html index 8215fbc..01dc080 100644 --- a/index.html +++ b/index.html @@ -3,18 +3,24 @@ Active GitHub Forks + - + + - - - - - - - - + + + + + + + + + + + + diff --git a/js/main.js b/js/main.js index c3f28b3..84f6140 100644 --- a/js/main.js +++ b/js/main.js @@ -98,7 +98,14 @@ function initDT() { }; }), order: [[sortColumnIdx, 'desc']], + // paging: false, + searchBuilder:{ + // all options at default + } }); + let table = window.forkTable; + new $.fn.dataTable.SearchBuilder(table, {}); + table.searchBuilder.container().prependTo(table.table().container()); } function fetchAndShow(repo) {