Node.js based forum software built for the modern web
don't download the acp search index on mobile
psychobunny587f805763ee
diff --git a/public/src/forum/admin/footer.js b/public/src/forum/admin/footer.jsindex a1f51d842a..44f1766c98 100644--- a/public/src/forum/admin/footer.js+++ b/public/src/forum/admin/footer.js@@ -5,23 +5,9 @@ define('forum/admin/footer', ['forum/admin/settings'], function(Settings) {var acpIndex;$(document).ready(function() {- $.getJSON(RELATIVE_PATH + '/templates/indexed.json', function (data) {- acpIndex = data;- for (var file in acpIndex) {- if (acpIndex.hasOwnProperty(file)) {- acpIndex[file] = acpIndex[file].replace(/<img/g, '<none'); // can't think of a better solution, see #2153- acpIndex[file] = $('<div class="search-container">' + acpIndex[file] + '</div>');- acpIndex[file].find('ul.nav, script').remove();-- acpIndex[file] = acpIndex[file].text().toLowerCase().replace(/[ |\r|\n]+/g, ' ');- }- }-- delete acpIndex['/admin/header.tpl'];- delete acpIndex['/admin/footer.tpl'];-- setupACPSearch();- });+ if(!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {+ getSearchIndex();+ }$(window).on('action:ajaxify.end', function(ev, data) {var url = data.url;@@ -66,6 +52,26 @@ define('forum/admin/footer', ['forum/admin/settings'], function(Settings) {$('#breadcrumbs').html(caret + Array.prototype.slice.call(arguments).join(caret));}++ function getSearchIndex() {+ $.getJSON(RELATIVE_PATH + '/templates/indexed.json', function (data) {+ acpIndex = data;+ for (var file in acpIndex) {+ if (acpIndex.hasOwnProperty(file)) {+ acpIndex[file] = acpIndex[file].replace(/<img/g, '<none'); // can't think of a better solution, see #2153+ acpIndex[file] = $('<div class="search-container">' + acpIndex[file] + '</div>');+ acpIndex[file].find('ul.nav, script').remove();++ acpIndex[file] = acpIndex[file].text().toLowerCase().replace(/[ |\r|\n]+/g, ' ');+ }+ }++ delete acpIndex['/admin/header.tpl'];+ delete acpIndex['/admin/footer.tpl'];++ setupACPSearch();+ });+ }function setupACPSearch() {var menu = $('#acp-search .dropdown-menu');diff --git a/src/views/admin/header.tpl b/src/views/admin/header.tplindex 0e5d77e08b..c6521d75e7 100644--- a/src/views/admin/header.tpl+++ b/src/views/admin/header.tpl@@ -64,7 +64,7 @@</li></ul>- <ul id="logged-in-menu" class="nav navbar-nav navbar-right">+ <ul id="logged-in-menu" class="nav navbar-nav navbar-right hidden-xs"><form class="navbar-form navbar-left" role="search"><div class="form-group" id="acp-search" ><div class="dropdown" >