| 1 |
<form method="POST" name="tools-cache-ngram" action="{toolsNgramCacheFormActionLink}" style="display:inline-block; margin-right: 10px;" id="abj404-ngram-rebuild-form"> |
| 2 |
<input type="hidden" name="action" value="rebuildNgramCache"> |
| 3 |
<p> |
| 4 |
<strong>{N-gram Cache}</strong> |
| 5 |
</p> |
| 6 |
{Rebuild the N-gram spell checker cache. This optimizes 404 URL matching performance. May take several minutes on large sites.} |
| 7 |
<BR/> |
| 8 |
<input type="submit" value="{Rebuild N-gram Cache}" class="button-secondary" id="abj404-rebuild-ngram-btn"> |
| 9 |
</form> |
| 10 |
|
| 11 |
<script type="text/javascript"> |
| 12 |
(function($) { |
| 13 |
$(document).ready(function() { |
| 14 |
$('#abj404-ngram-rebuild-form').on('submit', function(e) { |
| 15 |
var btn = $('#abj404-rebuild-ngram-btn'); |
| 16 |
var originalText = btn.val(); |
| 17 |
var countdown = 5; |
| 18 |
|
| 19 |
// Disable button immediately |
| 20 |
btn.prop('disabled', true); |
| 21 |
btn.val('{Rebuilding...} (' + countdown + 's)'); |
| 22 |
|
| 23 |
// Countdown timer |
| 24 |
var interval = setInterval(function() { |
| 25 |
countdown--; |
| 26 |
if (countdown > 0) { |
| 27 |
btn.val('{Rebuilding...} (' + countdown + 's)'); |
| 28 |
} else { |
| 29 |
clearInterval(interval); |
| 30 |
btn.prop('disabled', false); |
| 31 |
btn.val(originalText); |
| 32 |
} |
| 33 |
}, 1000); |
| 34 |
|
| 35 |
// Let the form submit normally |
| 36 |
}); |
| 37 |
}); |
| 38 |
})(jQuery); |
| 39 |
</script> |
| 40 |
|
| 41 |
<form method="POST" name="tools-cache-spelling" action="{toolsSpellingCacheFormActionLink}" style="display:inline-block;"> |
| 42 |
<input type="hidden" name="action" value="clearSpellingCache"> |
| 43 |
<p> |
| 44 |
<strong>{Spelling Cache}</strong> |
| 45 |
</p> |
| 46 |
{Clear the spelling cache to force recalculation of URL matches. Useful after making significant content changes.} |
| 47 |
<BR/> |
| 48 |
<input type="submit" value="{Clear Spelling Cache}" class="button-secondary"> |
| 49 |
</form> |
| 50 |
|