Zeile 5 | Zeile 5 |
---|
Thread.quickEdit(); Thread.initQuickReply(); Thread.initMultiQuote();
|
Thread.quickEdit(); Thread.initQuickReply(); Thread.initMultiQuote();
|
|
|
// Set spinner image $('#quickreply_spinner img').attr('src', spinner_image); });
| // Set spinner image $('#quickreply_spinner img').attr('src', spinner_image); });
|
Zeile 34 | Zeile 34 |
---|
} return true; },
|
} return true; },
|
|
|
multiQuote: function(pid) { var new_post_ids = new Array(); var quoted = Cookie.get("multiquote"); var is_new = true;
|
multiQuote: function(pid) { var new_post_ids = new Array(); var quoted = Cookie.get("multiquote"); var is_new = true;
|
if(quoted)
| var deleted = false; if($("#pid" + pid).next("div.post").hasClass('deleted_post')) { $.jGrowl(lang.post_deleted_error, {theme:'jgrowl_error'}); deleted = true; }
if(quoted && !deleted)
|
{ var post_ids = quoted.split("|");
| { var post_ids = quoted.split("|");
|
Zeile 55 | Zeile 62 |
---|
} }); }
|
} }); }
|
|
|
var mquote_a = $("#multiquote_"+pid).closest('a')
|
var mquote_a = $("#multiquote_"+pid).closest('a')
|
if(is_new == true) {
| if(is_new == true && !deleted) {
|
new_post_ids[new_post_ids.length] = pid; mquote_a.removeClass('postbit_multiquote').addClass('postbit_multiquote_on');
|
new_post_ids[new_post_ids.length] = pid; mquote_a.removeClass('postbit_multiquote').addClass('postbit_multiquote_on');
|
}
| }
|
else { mquote_a.removeClass('postbit_multiquote_on').addClass('postbit_multiquote'); }
|
else { mquote_a.removeClass('postbit_multiquote_on').addClass('postbit_multiquote'); }
|
|
|
var mquote_quick = $('#quickreply_multiquote'); if(mquote_quick.length) {
| var mquote_quick = $('#quickreply_multiquote'); if(mquote_quick.length) {
|
Zeile 97 | Zeile 104 |
---|
complete: function (request, status) { Thread.multiQuotedLoaded(request, status);
|
complete: function (request, status) { Thread.multiQuotedLoaded(request, status);
|
|
|
// Get rid of spinner mquote_spinner.hide(); }
| // Get rid of spinner mquote_spinner.hide(); }
|
Zeile 120 | Zeile 127 |
---|
{ $.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; }
|
Zeile 191 | Zeile 198 |
---|
{ id = $(this).attr('id'); pid = id.replace( /[^\d.]/g, '');
|
{ id = $(this).attr('id'); pid = id.replace( /[^\d.]/g, '');
|
| $("#quickedit_" + pid + "_editreason_original").val($("#quickedit_" + pid + "_editreason").val());
|
return { editreason: $("#quickedit_" + pid + "_editreason").val() }
| return { editreason: $("#quickedit_" + pid + "_editreason").val() }
|
Zeile 199 | Zeile 207 |
---|
{ id = $(this).attr('id'); pid = id.replace( /[^\d.]/g, '');
|
{ id = $(this).attr('id'); pid = id.replace( /[^\d.]/g, '');
|
|
|
var json = $.parseJSON(values); if(typeof json == 'object') {
| var json = $.parseJSON(values); if(typeof json == 'object') {
|
Zeile 209 | Zeile 217 |
---|
$.each(json.errors, function(i, message) {
|
$.each(json.errors, function(i, message) {
|
$.jGrowl(lang.quick_edit_update_error + ' ' + message);
| $.jGrowl(lang.quick_edit_update_error + ' ' + message, {theme:'jgrowl_error'});
|
}); $(this).html($('#pid_' + pid + '_temp').html()); }
| }); $(this).html($('#pid_' + pid + '_temp').html()); }
|
Zeile 227 | Zeile 235 |
---|
} else {
|
} else {
|
$.jGrowl(json.moderation_post);
| $.jGrowl(json.moderation_post, {theme:'jgrowl_success'});
|
$('#post_' + pid).slideToggle(); } }
| $('#post_' + pid).slideToggle(); } }
|
Zeile 236 | Zeile 244 |
---|
$(".jGrowl").jGrowl("close");
$(this).html(json.message);
|
$(".jGrowl").jGrowl("close");
$(this).html(json.message);
|
|
|
alert(json.moderation_thread);
|
alert(json.moderation_thread);
|
|
|
// Redirect user to forum window.location = json.url;
|
// Redirect user to forum window.location = json.url;
|
}
| }
|
else { // Change html content
| else { // Change html content
|
Zeile 269 | Zeile 277 |
---|
// Take pid out of the id attribute id = $(this).attr('id'); pid = id.replace( /[^\d.]/g, '');
|
// Take pid out of the id attribute id = $(this).attr('id'); pid = id.replace( /[^\d.]/g, '');
|
| if($("#pid" + pid).next("div.post").hasClass('deleted_post')) { $.jGrowl(lang.post_deleted_error, {theme:'jgrowl_error'}); return false; }
|
// Create a copy of the post if($('#pid_' + pid + '_temp').length == 0) {
| // Create a copy of the post if($('#pid_' + pid + '_temp').length == 0) {
|
Zeile 283 | Zeile 296 |
---|
$('#pid_' + pid + ' textarea').attr('id', 'quickedit_' + pid); if(allowEditReason == 1 && $('#quickedit_' + pid + '_editreason').length == 0) {
|
$('#pid_' + pid + ' textarea').attr('id', 'quickedit_' + pid); if(allowEditReason == 1 && $('#quickedit_' + pid + '_editreason').length == 0) {
|
$('#quickedit_' + pid).after('<label for="editreason">' + lang.editreason + ':</label> <input type="text" class="textbox" style="margin: 6px 0;" name="editreason" size="40" maxlength="150" id="quickedit_' + pid + '_editreason" /><br />');
| edit_el = $('#editreason_' + pid + '_original').clone().attr('id','editreason_' + pid); edit_el.children('#quickedit_' + pid + '_editreason_original').attr('id','quickedit_' + pid + '_editreason'); edit_el.insertAfter('#quickedit_' + pid).show();
|
} }); });
| } }); });
|
Zeile 294 | Zeile 309 |
---|
initQuickReply: function() { if($('#quick_reply_form').length && use_xmlhttprequest == 1)
|
initQuickReply: function() { if($('#quick_reply_form').length && use_xmlhttprequest == 1)
|
{
| {
|
// Bind closing event to our popup menu $('#quick_reply_submit').bind('click', function(e) { return Thread.quickReply(e);
| // Bind closing event to our popup menu $('#quick_reply_submit').bind('click', function(e) { return Thread.quickReply(e);
|
Zeile 310 | Zeile 325 |
---|
{ return false; }
|
{ return false; }
|
|
|
this.quick_replying = 1; var post_body = $('#quick_reply_form').serialize();
|
this.quick_replying = 1; var post_body = $('#quick_reply_form').serialize();
|
|
|
// Spinner! var qreply_spinner = $('#quickreply_spinner'); qreply_spinner.show();
| // Spinner! var qreply_spinner = $('#quickreply_spinner'); qreply_spinner.show();
|
Zeile 327 | Zeile 342 |
---|
complete: function (request, status) { Thread.quickReplyDone(request, status);
|
complete: function (request, status) { Thread.quickReplyDone(request, status);
|
|
|
// Get rid of spinner qreply_spinner.hide(); }
|
// Get rid of spinner qreply_spinner.hide(); }
|
});
return false; },
| });
return false; },
|
quickReplyDone: function(request, status) { this.quick_replying = 0;
| quickReplyDone: function(request, status) { this.quick_replying = 0;
|
Zeile 349 | Zeile 364 |
---|
$.each(json.errors, function(i, message) {
|
$.each(json.errors, function(i, message) {
|
$.jGrowl(lang.quick_reply_post_error + ' ' + message);
| $.jGrowl(lang.quick_reply_post_error + ' ' + message, {theme:'jgrowl_error'});
|
}); $('#quickreply_spinner').hide();
|
}); $('#quickreply_spinner').hide();
|
}
| }
|
}
if($('#captcha_trow').length)
| }
if($('#captcha_trow').length)
|
Zeile 362 | Zeile 377 |
---|
{ json.data = json.data.replace(/^<captcha>(.*)<\/captcha>/, '');
|
{ json.data = json.data.replace(/^<captcha>(.*)<\/captcha>/, '');
|
if(cap[1] == "reload") { Recaptcha.reload(); } else if($("#captcha_img").length)
| if($("#captcha_img").length)
|
{ if(cap[1]) {
| { if(cap[1]) {
|
Zeile 388 | Zeile 399 |
---|
} } }
|
} } }
|
|
|
if(json.hasOwnProperty("errors")) return false;
| if(json.hasOwnProperty("errors")) return false;
|
Zeile 396 | Zeile 407 |
---|
{ var pid = json.data.match(/id="post_([0-9]+)"/)[1]; var post = document.createElement("div");
|
{ var pid = json.data.match(/id="post_([0-9]+)"/)[1]; var post = document.createElement("div");
|
|
|
$('#posts').append(json.data);
|
$('#posts').append(json.data);
|
|
|
if (typeof inlineModeration != "undefined") // Guests don't have this object defined $("#inlinemod_" + pid).on('change', inlineModeration.checkItem);
|
if (typeof inlineModeration != "undefined") // Guests don't have this object defined $("#inlinemod_" + pid).on('change', inlineModeration.checkItem);
|
Thread.quickEdit("#pid_" + pid);
| |
|
|
// Eval javascript $(json.data).filter("script").each(function(e) {
| Thread.quickEdit("#pid_" + pid);
// Eval javascript $(json.data).filter("script").each(function(e) {
|
eval($(this).text()); });
| eval($(this).text()); });
|
Zeile 429 | Zeile 440 |
---|
},
showIgnoredPost: function(pid)
|
},
showIgnoredPost: function(pid)
|
{
| {
|
$('#ignored_post_'+pid).slideToggle("slow");
|
$('#ignored_post_'+pid).slideToggle("slow");
|
| $('#post_'+pid).slideToggle("slow"); },
showDeletedPost: function(pid) { $('#deleted_post_'+pid).slideToggle("slow");
|
$('#post_'+pid).slideToggle("slow"); },
| $('#post_'+pid).slideToggle("slow"); },
|
Zeile 455 | Zeile 472 |
---|
{ $.each(json.errors, function(i, message) {
|
{ $.each(json.errors, function(i, message) {
|
$.jGrowl(lang.quick_delete_error + ' ' + message);
| $.jGrowl(lang.quick_delete_error + ' ' + message, {theme:'jgrowl_error'});
|
}); } else if(json.hasOwnProperty("data"))
| }); } else if(json.hasOwnProperty("data"))
|
Zeile 465 | Zeile 482 |
---|
{ // Change CSS class of div 'post_[pid]' $("#post_"+pid).addClass("unapproved_post deleted_post");
|
{ // Change CSS class of div 'post_[pid]' $("#post_"+pid).addClass("unapproved_post deleted_post");
|
$("#quick_delete_" + pid).hide(); $("#quick_restore_" + pid).show();
$.jGrowl(lang.quick_delete_success); } else if(json.data == 2) {
| if(json.first == 1) { $("#quick_reply_form, .thread_tools, .new_reply_button, .inline_rating").hide(); $("#moderator_options_selector option.option_mirage").attr("disabled","disabled"); $("#moderator_options_selector option[value='softdeletethread']").val("restorethread").text(lang.restore_thread); }
$.jGrowl(lang.quick_delete_success, {theme:'jgrowl_success'}); } else if(json.data == 2) {
|
// Actually deleted $('#post_'+pid).slideToggle("slow");
|
// Actually deleted $('#post_'+pid).slideToggle("slow");
|
$.jGrowl(lang.quick_delete_success); } else if(json.data == 3)
| $.jGrowl(lang.quick_delete_success, {theme:'jgrowl_success'}); } else if(json.data == 3)
|
{ // deleted thread --> redirect
|
{ // deleted thread --> redirect
|
if(!json.hasOwnProperty("url"))
| if(!json.hasOwnProperty("url"))
|
{
|
{
|
$.jGrowl(lang.unknown_error);
| $.jGrowl(lang.unknown_error, {theme:'jgrowl_error'});
|
}
|
}
|
|
|
// set timeout for redirect
|
// set timeout for redirect
|
window.setTimeout(function()
| window.setTimeout(function()
|
{ window.location = json.url; }, 3000);
|
{ window.location = json.url; }, 3000);
|
|
|
// print success message
|
// print success message
|
$.jGrowl(lang.quick_delete_thread_success); } } else { $.jGrowl(lang.unknown_error); }
| $.jGrowl(lang.quick_delete_thread_success, {theme:'jgrowl_success'}); } } else { $.jGrowl(lang.unknown_error, {theme:'jgrowl_error'}); }
|
} }); } } });
|
} }); } } });
|
|
|
return false; },
|
return false; },
|
|
|
restorePost: function(pid) { $.prompt(quickrestore_confirm, {
| restorePost: function(pid) { $.prompt(quickrestore_confirm, {
|
Zeile 531 | Zeile 551 |
---|
{ $.each(json.errors, function(i, message) {
|
{ $.each(json.errors, function(i, message) {
|
$.jGrowl(lang.quick_restore_error + ' ' + message);
| $.jGrowl(lang.quick_restore_error + ' ' + message, {theme:'jgrowl_error'});
|
});
|
});
|
}
| }
|
else if(json.hasOwnProperty("data")) { // Change CSS class of div 'post_[pid]' $("#post_"+pid).removeClass("unapproved_post deleted_post");
|
else if(json.hasOwnProperty("data")) { // Change CSS class of div 'post_[pid]' $("#post_"+pid).removeClass("unapproved_post deleted_post");
|
| if(json.first == 1) { $("#quick_reply_form, .thread_tools, .new_reply_button, .inline_rating").show(); $("#moderator_options_selector option.option_mirage").removeAttr("disabled"); $("#moderator_options_selector option[value='restorethread']").val("softdeletethread").text(lang.softdelete_thread); }
|
|
|
$("#quick_delete_" + pid).show(); $("#quick_restore_" + pid).hide();
$.jGrowl(lang.quick_restore_success);
| $.jGrowl(lang.quick_restore_success, {theme:'jgrowl_success'});
|
} else {
|
} else {
|
$.jGrowl(lang.unknown_error);
| $.jGrowl(lang.unknown_error, {theme:'jgrowl_error'});
|
} } }); } } });
|
} } }); } } });
|
|
|
return false; },
| return false; },
|