Various JS optimizations

This commit is contained in:
Marcin Kurczewski 2013-11-24 23:30:06 +01:00
parent 20022ea4ab
commit aa37ee66ff
7 changed files with 14 additions and 15 deletions

View file

@ -206,7 +206,7 @@ function extractLast(term)
$(function()
{
$('[data-autocomplete-url]').each(function()
$('.autocomplete').each(function()
{
var searchInput = $(this);
searchInput
@ -288,9 +288,3 @@ $(function()
Mousetrap.bind('d', function() { var url = $('.paginator:visible .next:not(.disabled) a').attr('href'); if (typeof url !== 'undefined') window.location.href = url; }, 'keyup');
Mousetrap.bind('p', function() { $('.post a').eq(0).focus(); return false; }, 'keyup');
});
$(function()
{
$('body').trigger('dom-update');
});

View file

@ -34,5 +34,4 @@ $(function()
});
});
});
$('body').trigger('dom-update');
});

View file

@ -52,7 +52,6 @@ function onDomUpdate()
$(function()
{
$('body').bind('dom-update', onDomUpdate);
onDomUpdate();
$('form.edit-post').submit(function(e)
{

View file

@ -87,7 +87,7 @@
<li class="search">
<form name="search" action="<?php echo \Chibi\UrlHelper::route('post', 'list') ?>" method="get">
<input type="search" name="query" placeholder="Search&hellip;" value="<?php echo isset($this->context->transport->searchQuery) ? htmlspecialchars($this->context->transport->searchQuery) : '' ?>" data-autocomplete-url="<?php echo \Chibi\UrlHelper::route('tag', 'list') ?>"/>
<input class="autocomplete" type="search" name="query" placeholder="Search&hellip;" value="<?php echo isset($this->context->transport->searchQuery) ? htmlspecialchars($this->context->transport->searchQuery) : '' ?>" data-autocomplete-url="<?php echo \Chibi\UrlHelper::route('tag', 'list') ?>"/>
</form>
</li>
@ -121,5 +121,12 @@
<?php endif ?>
</div>
</footer>
<script type="text/javascript">
$(function()
{
$('body').trigger('dom-update');
});
</script>
</body>
</html>

View file

@ -3,12 +3,12 @@
<h1>mass tag</h1>
<div>
<label class="left" for="mass-tag-query">Search query:</label>
<div class="input-wrapper"><input type="text" name="query" id="mass-tag-query" value="<?php echo isset($this->context->massTagQuery) ? $this->context->massTagQuery : '' ?>" data-autocomplete-url="<?php echo \Chibi\UrlHelper::route('tag', 'list') ?>"/></div>
<div class="input-wrapper"><input class="autocomplete" type="text" type="text" name="query" id="mass-tag-query" value="<?php echo isset($this->context->massTagQuery) ? $this->context->massTagQuery : '' ?>" data-autocomplete-url="<?php echo \Chibi\UrlHelper::route('tag', 'list') ?>"/></div>
</div>
<div>
<label class="left" for="mass-tag-tag">Tag:</label>
<div class="input-wrapper"><input type="text" name="tag" id="mass-tag-tag" value="<?php echo isset($this->context->massTagTag) ? $this->context->massTagTag : '' ?>" data-autocomplete-url="<?php echo \Chibi\UrlHelper::route('tag', 'list') ?>"/></div>
<div class="input-wrapper"><input class="autocomplete" type="text" type="text" name="tag" id="mass-tag-tag" value="<?php echo isset($this->context->massTagTag) ? $this->context->massTagTag : '' ?>" data-autocomplete-url="<?php echo \Chibi\UrlHelper::route('tag', 'list') ?>"/></div>
</div>
<input type="hidden" name="submit" value="1"/>

View file

@ -3,12 +3,12 @@
<h1>merge tags</h1>
<div>
<label class="left" for="merge-source-tag">Source tag:</label>
<div class="input-wrapper"><input type="text" name="source-tag" id="merge-source-tag" data-autocomplete-url="<?php echo \Chibi\UrlHelper::route('tag', 'list') ?>"/></div>
<div class="input-wrapper"><input class="autocomplete" type="text" type="text" name="source-tag" id="merge-source-tag" data-autocomplete-url="<?php echo \Chibi\UrlHelper::route('tag', 'list') ?>"/></div>
</div>
<div>
<label class="left" for="merge-target-tag">Target tag:</label>
<div class="input-wrapper"><input type="text" name="target-tag" id="merge-target-tag" data-autocomplete-url="<?php echo \Chibi\UrlHelper::route('tag', 'list') ?>"/></div>
<div class="input-wrapper"><input class="autocomplete" type="text" name="target-tag" id="merge-target-tag" data-autocomplete-url="<?php echo \Chibi\UrlHelper::route('tag', 'list') ?>"/></div>
</div>
<input type="hidden" name="submit" value="1"/>

View file

@ -3,7 +3,7 @@
<h1>rename tags</h1>
<div>
<label class="left" for="rename-source-tag">Source tag:</label>
<div class="input-wrapper"><input type="text" name="source-tag" id="rename-source-tag" data-autocomplete-url="<?php echo \Chibi\UrlHelper::route('tag', 'list') ?>"/></div>
<div class="input-wrapper"><input class="autocomplete" type="text" type="text" name="source-tag" id="rename-source-tag" data-autocomplete-url="<?php echo \Chibi\UrlHelper::route('tag', 'list') ?>"/></div>
</div>
<div>