diff --git a/www/js/app.js b/www/js/app.js index 8a84bc0f..d15dd8cc 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -354,7 +354,6 @@ define(['jquery', 'zimArchiveLoader', 'util', 'uiUtil', 'cookies', 'q', 'module' }); // Top menu : $('#btnHome').on('click', function (e) { - //setHomeTab(); // Give the focus to the search field, and clean up the page contents if (!firstRun) { $('#prefix').focus(); @@ -363,6 +362,9 @@ define(['jquery', 'zimArchiveLoader', 'util', 'uiUtil', 'cookies', 'q', 'module' $("#articleContent").hide(); $("#articleContent").contents().empty(); $('#searchingForArticles').hide(); + $("#welcomeText").show(); + $('#articleList').show(); + $('#articleListHeaderMessage').show(); if (selectedArchive !== null && selectedArchive.isReady()) { $("#welcomeText").hide(); goToMainArticle(); @@ -395,14 +397,15 @@ define(['jquery', 'zimArchiveLoader', 'util', 'uiUtil', 'cookies', 'q', 'module' $('#about').hide(); $('#configuration').hide(); $('#formArticleSearch').show(); - $("#welcomeText").show(); - $('#articleList').show(); - $('#articleListHeaderMessage').show(); $('#articleContent').show(); $("#prefix").val(""); $("#articleList").empty(); + $('#articleList').hide(); $('#articleListHeaderMessage').empty(); $("#readingArticle").hide(); + $("#welcomeText").hide(); + // Scroll the iframe to its top + $("#articleContent").contents().scrollTop(0); } $('#btnConfigure').on('click', function (e) { @@ -1489,8 +1492,6 @@ define(['jquery', 'zimArchiveLoader', 'util', 'uiUtil', 'cookies', 'q', 'module' selectedArchive.resolveRedirect(dirEntry, readArticle); } else { - setHomeTab(); - //TESTING// console.log("Initiating HTML load..."); console.time("Time to HTML load"); @@ -1601,8 +1602,6 @@ define(['jquery', 'zimArchiveLoader', 'util', 'uiUtil', 'cookies', 'q', 'module' console.time("Time to First Paint"); //return; - $('#articleList').hide(); - //Some documents (e.g. Ray Charles Index) can't be scrolled to the very end, as some content remains benath the footer //so add some whitespace at the end of the document htmlArticle = htmlArticle.replace(/(dditional terms may apply for the media files[^<]+<\/div>\s*)/i, "$1\r\n
\r\n"); @@ -1791,13 +1790,6 @@ define(['jquery', 'zimArchiveLoader', 'util', 'uiUtil', 'cookies', 'q', 'module' function injectHTML() { - //Void progress message - uiUtil.clear(); //Void progress messages - $("#readingArticle").hide(); - $("#articleContent").show(); - // Scroll the iframe to its top - $("#articleContent").contents().scrollTop(0); - //Adapt German Wikivoyage POI data format var regexpGeoLocationDE = /([^<]+)[\s\S]+?longitude">([^<]+)<[\s\S]+?(]+listing-name[^>]+>([^<]+)<\/span>)/ig; htmlArticle = htmlArticle.replace(regexpGeoLocationDE, function (match, latitude, longitude, href, id) { @@ -1825,6 +1817,8 @@ define(['jquery', 'zimArchiveLoader', 'util', 'uiUtil', 'cookies', 'q', 'module' }); //Inject htmlArticle into iframe + uiUtil.clear(); //Void progress messages + setHomeTab(); $('#articleContent').contents().find('body').html(htmlArticle); setupTableOfContents(); @@ -1934,7 +1928,7 @@ define(['jquery', 'zimArchiveLoader', 'util', 'uiUtil', 'cookies', 'q', 'module' //DEV: Set this to the number of images you want to prefetch after the on-screen images have been fetched var prefetchSliceSize = 20; //DEV: SVG images are currently very taxing: keep this number at 5 or below and test on your system with Sine.html - var svgSliceSize = 2; + var svgSliceSize = 1; var visibleSlice = []; var svgSlice = []; var svgGroup1 = []; diff --git a/www/js/lib/uiUtil.js b/www/js/lib/uiUtil.js index f957d797..b406a72d 100644 --- a/www/js/lib/uiUtil.js +++ b/www/js/lib/uiUtil.js @@ -95,7 +95,7 @@ define([], function() { var shortTitle = title.substring(0, 25); shortTitle = shortTitle == title ? shortTitle : shortTitle + "..."; var link = '