Zeile 1 | Zeile 1 |
---|
var Post = { init: function() {
|
var Post = { init: function() {
|
$(document).ready(function(){
| $(function() { Post.initAttachments();
|
}); },
| }); },
|
Zeile 14 | Zeile 16 |
---|
$.ajax( { url: 'xmlhttp.php?action=get_multiquoted&tid='+tid,
|
$.ajax( { url: 'xmlhttp.php?action=get_multiquoted&tid='+tid,
|
type: 'get', complete: function (request, status)
| type: 'get', complete: function (request, status)
|
{ Post.multiQuotedLoaded(request, status); }
| { Post.multiQuotedLoaded(request, status); }
|
Zeile 43 | Zeile 45 |
---|
} });
|
} });
|
return false;
| return false;
|
} else {
| } else {
|
Zeile 57 | Zeile 59 |
---|
if(typeof response == 'object') { if(json.hasOwnProperty("errors"))
|
if(typeof response == 'object') { if(json.hasOwnProperty("errors"))
|
{
| {
|
$.each(json.errors, function(i, message) {
|
$.each(json.errors, function(i, message) {
|
$.jGrowl(lang.post_fetch_error + ' ' + message);
| $.jGrowl(lang.post_fetch_error + ' ' + message, {theme:'jgrowl_error'});
|
}); return false; }
|
}); return false; }
|
}
| }
|
var id = 'message'; if(typeof $('textarea').sceditor != 'undefined')
| var id = 'message'; if(typeof $('textarea').sceditor != 'undefined')
|
Zeile 72 | Zeile 74 |
---|
$('textarea').sceditor('instance').insert(json.message); } else
|
$('textarea').sceditor('instance').insert(json.message); } else
|
{
| {
|
if($('#' + id).value) { $('#' + id).value += "\n";
| if($('#' + id).value) { $('#' + id).value += "\n";
|
Zeile 92 | Zeile 94 |
---|
removeAttachment: function(aid) {
|
removeAttachment: function(aid) {
|
$.prompt(removeattach_confirm, {
| MyBB.prompt(removeattach_confirm, {
|
buttons:[ {title: yes_confirm, value: true}, {title: no_confirm, value: false}
| buttons:[ {title: yes_confirm, value: true}, {title: no_confirm, value: false}
|
Zeile 103 | Zeile 105 |
---|
document.input.attachmentaid.value = aid; document.input.attachmentact.value = "remove";
|
document.input.attachmentaid.value = aid; document.input.attachmentact.value = "remove";
|
$("form#editpost").submit();
| var form = $('input[name=rem]').parents('form');
if(use_xmlhttprequest != 1) { form.append('<input type="submit" id="rem_submit" class="hidden" />'); $('#rem_submit').click(); return false; }
$.ajax({ type: 'POST', url: form.attr('action') + '&ajax=1', data: form.serialize(), success: function(data) { if(data.hasOwnProperty("errors")) { $.each(data.errors, function(i, message) { $.jGrowl(lang.post_fetch_error + ' ' + message, {theme:'jgrowl_error'}); }); return false; } else if (data.success) { $('#attachment_'+aid).hide(500, function() { $(this).remove(); }); } } });
|
}
|
}
|
else { document.input.attachmentaid.value = 0; document.input.attachmentact.value = ""; } } });
| } });
|
return false;
|
return false;
|
},
| },
|
attachmentAction: function(aid,action) { document.input.attachmentaid.value = aid; document.input.attachmentact.value = action;
|
attachmentAction: function(aid,action) { document.input.attachmentaid.value = aid; document.input.attachmentact.value = action;
|
| },
initAttachments: function() { $('form').on('submit', Post.checkAttachments); },
checkAttachments: function() { var files = $("input[type='file']"); var file = files.get(0); if (!file) { return true; }
if (file.files.length > php_max_file_uploads && php_max_file_uploads != 0) { alert(lang.attachment_too_many_files.replace('{1}', php_max_file_uploads)); file.value=""; return false; }
var totalSize = 0; files.each(function() { for (var i = 0; i < this.files.length; i++) { totalSize += this.files[i].size; } });
if (totalSize > php_max_upload_size && php_max_upload_size > 0) { var php_max_upload_size_pretty = Math.round(php_max_upload_size / 1e4) / 1e2; alert(lang.attachment_too_big_upload.replace('{1}', php_max_upload_size_pretty)); file.value=""; return false; }
return true;
|
} };
| } };
|