Zeile 1 | Zeile 1 |
---|
var Post = { init: function() {
|
var Post = { init: function() {
|
$(document).ready(function()
| $(function()
|
{ Post.initAttachments(); });
| { Post.initAttachments(); });
|
Zeile 55 | Zeile 55 |
---|
multiQuotedLoaded: function(request) {
|
multiQuotedLoaded: function(request) {
|
var json = $.parseJSON(request.responseText);
| var json = JSON.parse(request.responseText);
|
if(typeof response == 'object') { if(json.hasOwnProperty("errors"))
| if(typeof response == 'object') { if(json.hasOwnProperty("errors"))
|
Zeile 69 | Zeile 69 |
---|
}
var id = 'message';
|
}
var id = 'message';
|
if(typeof $('textarea').sceditor != 'undefined')
| if(typeof MyBBEditor !== 'undefined' && MyBBEditor !== null)
|
{
|
{
|
$('textarea').sceditor('instance').insert(json.message);
| MyBBEditor.insert(json.message);
|
} else {
| } else {
|
Zeile 94 | 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 105 | Zeile 105 |
---|
document.input.attachmentaid.value = aid; document.input.attachmentact.value = "remove";
|
document.input.attachmentaid.value = aid; document.input.attachmentact.value = "remove";
|
$("input[name=rem]").parents('form').append('<input type="submit" id="rem_submit" class="hidden" />'); $('#rem_submit').click();
| var form = $('input[name^=\'rem\']').parents('form');
if(use_xmlhttprequest != 1) { form.append('<input type="submit" id="rem_submit" class="hidden" />'); $('#rem_submit').trigger('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() { var instance = MyBBEditor; if(typeof MyBBEditor === 'undefined') { instance = $('#message').sceditor('instance'); }
if(instance.sourceMode()) { instance.setSourceEditorValue(instance.getSourceEditorValue(false).split('[attachment=' + aid + ']').join('')); } else { instance.setWysiwygEditorValue(instance.getWysiwygEditorValue(false).split('[attachment=' + aid + ']').join('')); }
$(this).remove(); }); } document.input.attachmentaid.value = ''; document.input.attachmentact.value = ''; } });
|
} } });
| } } });
|