Hide developer directories

Fixes #1305.
This commit is contained in:
Jaifroid 2025-02-08 18:15:56 +00:00
parent 17038f96bf
commit acdaa5ffd7
2 changed files with 5 additions and 5 deletions

View File

@ -108,7 +108,7 @@ params['linkToWikimediaImageFile'] = getSetting('linkToWikimediaImageFile') == t
params['hideToolbars'] = getSetting('hideToolbars') != null ? getSetting('hideToolbars') : true; // Set default to true (hides both), 'top' (hides top only), or false (no hiding) params['hideToolbars'] = getSetting('hideToolbars') != null ? getSetting('hideToolbars') : true; // Set default to true (hides both), 'top' (hides top only), or false (no hiding)
params['rememberLastPage'] = getSetting('rememberLastPage') != null ? getSetting('rememberLastPage') : true; // Set default option to remember the last visited page between sessions params['rememberLastPage'] = getSetting('rememberLastPage') != null ? getSetting('rememberLastPage') : true; // Set default option to remember the last visited page between sessions
params['showPopoverPreviews'] = getSetting('showPopoverPreviews') !== false; // Allows popover previews of articles for Wikimedia ZIMs (defaults to true) params['showPopoverPreviews'] = getSetting('showPopoverPreviews') !== false; // Allows popover previews of articles for Wikimedia ZIMs (defaults to true)
params['assetsCache'] = getSetting('appCache') !== false; // Whether to use cache by default or not params['assetsCache'] = getSetting('appCache') !== false; // Whether to use cache by default or not (as the setting is temporary, we set it according to the appCache to avoid issues for developers)
params['appCache'] = getSetting('appCache') !== false; // Will be true by default unless explicitly set to false params['appCache'] = getSetting('appCache') !== false; // Will be true by default unless explicitly set to false
params['useMathJax'] = getSetting('useMathJax') != null ? getSetting('useMathJax') : true; // Set default to true to display math formulae with MathJax, false to use fallback SVG images only params['useMathJax'] = getSetting('useMathJax') != null ? getSetting('useMathJax') : true; // Set default to true to display math formulae with MathJax, false to use fallback SVG images only
// params['showFileSelectors'] = getCookie('showFileSelectors') != null ? getCookie('showFileSelectors') : false; //Set to true to display hidden file selectors in packaged apps // params['showFileSelectors'] = getCookie('showFileSelectors') != null ? getCookie('showFileSelectors') : false; //Set to true to display hidden file selectors in packaged apps

View File

@ -703,12 +703,12 @@ function requestXhttpData (URL, lang, subj, kiwixDate) {
// Remove unused README file // Remove unused README file
doc = doc.replace(/^<a\s+href\b[^<]+README.+$[\r\n]*/m, ''); doc = doc.replace(/^<a\s+href\b[^<]+README.+$[\r\n]*/m, '');
} }
// Add in some directories from hidden // Add in some directories for developers (other than custom_apps)
if (/wikipedia\//.test(doc)) { if (/wikipedia\//.test(doc)) {
doc = doc.replace(/^(<a\b.+gutenberg\/)(<\/a>\s\s)([^<]+)/m, '<a href="#">archive/</a> $3$1$2$3'); if (!params.appCache) doc = doc.replace(/^(<a\b.+gutenberg\/)(<\/a>\s\s)([^<]+)/m, '<a href="#">archive/</a> $3$1$2$3');
doc = doc.replace(/^(<a\b.+gutenberg\/)(<\/a>\s\s)([^<]+)/m, '<a href="#">custom_apps/</a>$3$1$2$3'); doc = doc.replace(/^(<a\b.+gutenberg\/)(<\/a>\s\s)([^<]+)/m, '<a href="#">custom_apps/</a>$3$1$2$3');
doc = doc.replace(/^(<a\b.+gutenberg\/)(<\/a>\s\s)([^<]+)/m, '<a href="#">dev/</a> $3$1$2$3'); if (!params.appCache) doc = doc.replace(/^(<a\b.+gutenberg\/)(<\/a>\s\s)([^<]+)/m, '<a href="#">dev/</a> $3$1$2$3');
doc = doc.replace(/^(<a\b.+gutenberg\/)(<\/a>)([^<]+)/m, '<a href="#">endless/$2 $3$1$2$3'); if (!params.appCache) doc = doc.replace(/^(<a\b.+gutenberg\/)(<\/a>)([^<]+)/m, '<a href="#">endless/$2 $3$1$2$3');
} }
var stDoc; // Placeholder for standardized doc to be used to get arrays var stDoc; // Placeholder for standardized doc to be used to get arrays
if (/^[^_\n\r]+_([^_\n\r]+)_.+\.zi[mp].+$/m.test(doc)) { if (/^[^_\n\r]+_([^_\n\r]+)_.+\.zi[mp].+$/m.test(doc)) {