Browse Source

Fix issue #57

pull/40/head
8chan 10 years ago
committed by Fredrick Brennan
parent
commit
91570ef083
  1. 3
      js/multi-image.js
  2. 10
      js/upload-selection.js

3
js/multi-image.js

@ -14,12 +14,11 @@ function multi_image() {
$(document).on('click', 'a.add_image', function(e) {
e.preventDefault();
$('#upload_url').remove();
var images_len = $('form:not([id="quick-reply"]) [type=file]').length;
if (!(images_len >= max_images)) {
$('.add_image').after('<br/><input type="file" name="file'+(images_len+1)+'" id="upload_file'+(images_len+1)+'">');
$('.add_image').after('<br class="file_separator"/><input type="file" name="file'+(images_len+1)+'" id="upload_file'+(images_len+1)+'">');
if (typeof setup_form !== 'undefined') setup_form($('form[name="post"]'));
}
})

10
js/upload-selection.js

@ -20,11 +20,16 @@ $(function(){
var disable_all = function() {
$("#upload").hide();
$("#upload_file").hide();
$("[id^=upload_file]").hide();
$(".file_separator").hide();
$("#upload_url").hide();
$("#upload_embed").hide();
$(".add_image").hide();
$('[id^=upload_file]').each(function(i, v) {
$(v).val('');
});
if (enabled_oekaki) {
if (window.oekaki.initialized) {
window.oekaki.deinit();
@ -35,7 +40,8 @@ $(function(){
enable_file = function() {
disable_all();
$("#upload").show();
$("#upload_file").show();
$(".file_separator").show();
$("[id^=upload_file]").show();
$(".add_image").show();
};

Loading…
Cancel
Save