This commit is contained in:
Marcin Kurczewski 2013-10-25 09:56:55 +02:00
parent d3eaf27bdc
commit 89826a0be9
2 changed files with 17 additions and 20 deletions

View file

@ -45,6 +45,7 @@ $(function()
$('#url-handler-wrapper button').click(function(e) $('#url-handler-wrapper button').click(function(e)
{ {
var urls = $('#url-handler-wrapper textarea').val().split(/\s+/); var urls = $('#url-handler-wrapper textarea').val().split(/\s+/);
$('#url-handler-wrapper textarea').val('');
handleURLs(urls); handleURLs(urls);
}); });
@ -198,28 +199,25 @@ $(function()
function handleInputs(inputs, callback) function handleInputs(inputs, callback)
{ {
$('#upload-step1').fadeOut(function() for (var i = 0; i < inputs.length; i ++)
{ {
for (var i = 0; i < inputs.length; i ++) var input = inputs[i];
{ var postDom = $('#post-template').clone(true);
var input = inputs[i]; postDom.find('form').submit(false);
var postDom = $('#post-template').clone(true); postDom.removeAttr('id');
postDom.find('form').submit(false);
postDom.removeAttr('id');
$('.posts').append(postDom); $('.posts').append(postDom);
postDom.show(); postDom.show();
var tagItOptions = getTagItOptions(); var tagItOptions = getTagItOptions();
tagItOptions.availableTags = tags; tagItOptions.availableTags = tags;
tagItOptions.placeholderText = $('.tags input').attr('placeholder'); tagItOptions.placeholderText = $('.tags input').attr('placeholder');
$('.tags input', postDom).tagit(tagItOptions); $('.tags input', postDom).tagit(tagItOptions);
callback(postDom, input); callback(postDom, input);
} }
$('#upload-step2').fadeIn(function() $('#upload-step2').fadeIn(function()
{ {
});
}); });
} }
}); });

View file

@ -47,7 +47,7 @@
<div id="url-handler"> <div id="url-handler">
<textarea placeholder="You can also paste some URLs." name="urls"></textarea> <textarea placeholder="You can also paste some URLs." name="urls"></textarea>
</div> </div>
<button type="submit">Submit</button> <button type="submit">Add</button>
</div> </div>
</div> </div>
@ -118,7 +118,6 @@
<div id="upload-no-posts"> <div id="upload-no-posts">
<p class="alert alert-warning">Well, that&rsquo;s disappointing&hellip;</p> <p class="alert alert-warning">Well, that&rsquo;s disappointing&hellip;</p>
<p><a href="<?php echo \Chibi\UrlHelper::route('post', 'list') ?>">Back to post list</a> or <a href="<?php echo \Chibi\UrlHelper::route('post', 'upload') ?>">try uploading again</a>.</p>
</div> </div>
</div> </div>