Update `index.js` to not use jquery anymore.

This commit is contained in:
Matthieu Gautier 2021-11-17 15:23:36 +01:00 committed by Nikhil Tanwar
parent 98bcf8acd6
commit 4f3ec817db
3 changed files with 4 additions and 26 deletions

View File

@ -1,5 +1,5 @@
(function() {
const root = $(`link[type='root']`).attr('href');
const root = document.querySelector(`link[type='root']`).getAttribute('href');
const incrementalLoadingParams = {
start: 0,
count: viewPortToCount()
@ -320,7 +320,7 @@
const booksToFilter = new Set();
const booksToDelete = new Set();
iso.arrange({
filter: function (idx, elem) {
filter: function (elem) {
const id = elem.getAttribute('data-id');
const retVal = bookOrderMap.has(id);
if (retVal) {

View File

@ -4,24 +4,6 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>Welcome to Kiwix Server</title>
<script
type="text/javascript"
src="{{root}}/skin/jquery-ui/external/jquery/jquery.js?KIWIXCACHEID"
></script>
<script
type="text/javascript"
src="{{root}}/skin/jquery-ui/jquery-ui.min.js?KIWIXCACHEID"
></script>
<link
type="text/css"
href="{{root}}/skin/jquery-ui/jquery-ui.min.css?KIWIXCACHEID"
rel="Stylesheet"
/>
<link
type="text/css"
href="{{root}}/skin/jquery-ui/jquery-ui.theme.min.css?KIWIXCACHEID"
rel="Stylesheet"
/>
<link
type="text/css"
href="{{root}}/skin/index.css?KIWIXCACHEID"

View File

@ -175,16 +175,12 @@ TEST_F(ServerTest, CacheIdsOfStaticResources)
const std::vector<UrlAndExpectedResult> testData{
{
/* url */ "/ROOT/",
R"EXPECTEDRESULT( src="/ROOT/skin/jquery-ui/external/jquery/jquery.js?cacheid=1d85f0f3"
src="/ROOT/skin/jquery-ui/jquery-ui.min.js?cacheid=d927c2ff"
href="/ROOT/skin/jquery-ui/jquery-ui.min.css?cacheid=e1de77b3"
href="/ROOT/skin/jquery-ui/jquery-ui.theme.min.css?cacheid=2a5841f9"
href="/ROOT/skin/index.css?cacheid=56e818cd"
R"EXPECTEDRESULT( href="/ROOT/skin/index.css?cacheid=56e818cd"
src: url("/ROOT/skin/fonts/Poppins.ttf?cacheid=af705837") format("truetype");
src: url("/ROOT/skin/fonts/Roboto.ttf?cacheid=84d10248") format("truetype");
<script src="/ROOT/skin/isotope.pkgd.min.js?cacheid=2e48d392" defer></script>
<script src="/ROOT/skin/iso6391To3.js?cacheid=ecde2bb3"></script>
<script type="text/javascript" src="/ROOT/skin/index.js?cacheid=a0307d03" defer></script>
<script type="text/javascript" src="/ROOT/skin/index.js?cacheid=76440e7a" defer></script>
)EXPECTEDRESULT"
},
{