Zeile 1 | Zeile 1 |
---|
var Thread = { init: function() {
|
var Thread = { init: function() {
|
$(document).ready(function(){
| $(function(){
|
Thread.quickEdit(); Thread.initQuickReply(); Thread.initMultiQuote();
| Thread.quickEdit(); Thread.initQuickReply(); Thread.initMultiQuote();
|
Zeile 40 | Zeile 40 |
---|
var new_post_ids = new Array(); var quoted = Cookie.get("multiquote"); var is_new = true;
|
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 52 | Zeile 59 |
---|
else if(post_id == pid) { is_new = false;
|
else if(post_id == pid) { is_new = false;
|
} });
| } });
|
}
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
|
else
|
{
| {
|
mquote_a.removeClass('postbit_multiquote_on').addClass('postbit_multiquote'); }
var mquote_quick = $('#quickreply_multiquote'); if(mquote_quick.length)
|
mquote_a.removeClass('postbit_multiquote_on').addClass('postbit_multiquote'); }
var mquote_quick = $('#quickreply_multiquote'); if(mquote_quick.length)
|
{
| {
|
if(new_post_ids.length) { mquote_quick.show();
| if(new_post_ids.length) { mquote_quick.show();
|
Zeile 100 | Zeile 107 |
---|
// Get rid of spinner mquote_spinner.hide();
|
// Get rid of spinner mquote_spinner.hide();
|
} });
| } });
|
return false; } else { return true;
|
return false; } else { return true;
|
} },
| } },
|
multiQuotedLoaded: function(request) {
|
multiQuotedLoaded: function(request) {
|
var json = $.parseJSON(request.responseText);
| var json = JSON.parse(request.responseText);
|
if(typeof json == 'object') { if(json.hasOwnProperty("errors")) { $.each(json.errors, function(i, message)
|
if(typeof json == 'object') { if(json.hasOwnProperty("errors")) { $.each(json.errors, function(i, message)
|
{
| {
|
$.jGrowl(lang.post_fetch_error + ' ' + message, {theme:'jgrowl_error'}); }); return false;
|
$.jGrowl(lang.post_fetch_error + ' ' + message, {theme:'jgrowl_error'}); }); return false;
|
} }
if(typeof $('textarea').sceditor != 'undefined') { $('textarea').sceditor('instance').insert(json.message);
| } }
if(typeof MyBBEditor !== 'undefined' && MyBBEditor !== null) { MyBBEditor.insert(json.message);
|
} else {
| } else {
|
Zeile 144 | Zeile 151 |
---|
$('#quickreply_multiquote').hide(); $('#quoted_ids').val('all');
|
$('#quickreply_multiquote').hide(); $('#quoted_ids').val('all');
|
$('#message').focus(); },
| $('#message').trigger('focus'); },
|
clearMultiQuoted: function() { $('#quickreply_multiquote').hide();
| clearMultiQuoted: function() { $('#quickreply_multiquote').hide();
|
Zeile 167 | Zeile 174 |
---|
},
quickEdit: function(el)
|
},
quickEdit: function(el)
|
{
| {
|
if(typeof el === 'undefined' || !el.length) el = '.post_body';
$(el).each(function()
| if(typeof el === 'undefined' || !el.length) el = '.post_body';
$(el).each(function()
|
Zeile 175 | Zeile 182 |
---|
// 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, '');
|
|
|
$('#pid_' + pid).editable("xmlhttp.php?action=edit_post&do=update_post&pid=" + pid + '&my_post_key=' + my_post_key, { indicator: spinner,
| $('#pid_' + pid).editable("xmlhttp.php?action=edit_post&do=update_post&pid=" + pid + '&my_post_key=' + my_post_key, { indicator: spinner,
|
Zeile 184 | Zeile 191 |
---|
rows: 12, submit: lang.save_changes, cancel: lang.cancel_edit,
|
rows: 12, submit: lang.save_changes, cancel: lang.cancel_edit,
|
| placeholder: "",
|
event: "edit" + pid, // Triggered by the event "edit_[pid]", onblur: "ignore", dataType: "json",
| event: "edit" + pid, // Triggered by the event "edit_[pid]", onblur: "ignore", dataType: "json",
|
Zeile 201 | Zeile 209 |
---|
id = $(this).attr('id'); pid = id.replace( /[^\d.]/g, '');
|
id = $(this).attr('id'); pid = id.replace( /[^\d.]/g, '');
|
var json = $.parseJSON(values);
| var json = JSON.parse(values);
|
if(typeof json == 'object') { if(json.hasOwnProperty("errors"))
|
if(typeof json == 'object') { if(json.hasOwnProperty("errors"))
|
{ $(".jGrowl").jGrowl("close");
| { $(".jGrowl").jGrowl("close");
|
$.each(json.errors, function(i, message) { $.jGrowl(lang.quick_edit_update_error + ' ' + message, {theme:'jgrowl_error'});
| $.each(json.errors, function(i, message) { $.jGrowl(lang.quick_edit_update_error + ' ' + message, {theme:'jgrowl_error'});
|
Zeile 230 | Zeile 238 |
---|
{ $.jGrowl(json.moderation_post, {theme:'jgrowl_success'}); $('#post_' + pid).slideToggle();
|
{ $.jGrowl(json.moderation_post, {theme:'jgrowl_success'}); $('#post_' + pid).slideToggle();
|
}
| }
|
} else if(json.hasOwnProperty("moderation_thread")) { $(".jGrowl").jGrowl("close");
|
} else if(json.hasOwnProperty("moderation_thread")) { $(".jGrowl").jGrowl("close");
|
$(this).html(json.message);
alert(json.moderation_thread);
| $(this).html(json.message);
alert(json.moderation_thread);
|
// Redirect user to forum window.location = json.url; }
| // Redirect user to forum window.location = json.url; }
|
Zeile 270 | Zeile 278 |
---|
// 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) { $('#pid_' + pid).clone().attr('id','pid_' + pid + '_temp').appendTo("body").hide();
|
// Create a copy of the post if($('#pid_' + pid + '_temp').length == 0) { $('#pid_' + pid).clone().attr('id','pid_' + pid + '_temp').appendTo("body").hide();
|
}
| }
|
// Trigger the edit event $('#pid_' + pid).trigger("edit" + pid);
| // Trigger the edit event $('#pid_' + pid).trigger("edit" + pid);
|
Zeile 290 | Zeile 303 |
---|
} }); });
|
} }); });
|
return false;
| return false;
|
},
initQuickReply: function()
| },
initQuickReply: function()
|
Zeile 299 | Zeile 312 |
---|
if($('#quick_reply_form').length && use_xmlhttprequest == 1) { // Bind closing event to our popup menu
|
if($('#quick_reply_form').length && use_xmlhttprequest == 1) { // Bind closing event to our popup menu
|
$('#quick_reply_submit').bind('click', function(e) {
| $('#quick_reply_submit').on('click', function(e) {
|
return Thread.quickReply(e); }); }
| return Thread.quickReply(e); }); }
|
Zeile 343 | Zeile 356 |
---|
{ this.quick_replying = 0;
|
{ this.quick_replying = 0;
|
var json = $.parseJSON(request.responseText);
| var json = JSON.parse(request.responseText);
|
if(typeof json == 'object') { if(json.hasOwnProperty("errors"))
| if(typeof json == 'object') { if(json.hasOwnProperty("errors"))
|
Zeile 365 | Zeile 378 |
---|
{ 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]) { imghash = cap[1]; $('#imagehash').val(imghash); if(cap[3])
|
{ if(cap[1]) { imghash = cap[1]; $('#imagehash').val(imghash); if(cap[3])
|
{
| {
|
$('#imagestring').attr('type', 'hidden').val(cap[3]); // hide the captcha $('#captcha_trow').hide();
| $('#imagestring').attr('type', 'hidden').val(cap[3]); // hide the captcha $('#captcha_trow').hide();
|
Zeile 394 | Zeile 403 |
---|
if(json.hasOwnProperty("errors")) return false;
|
if(json.hasOwnProperty("errors")) return false;
|
|
|
if(json.data.match(/id="post_([0-9]+)"/)) { var pid = json.data.match(/id="post_([0-9]+)"/)[1];
| if(json.data.match(/id="post_([0-9]+)"/)) { var pid = json.data.match(/id="post_([0-9]+)"/)[1];
|
Zeile 406 | Zeile 415 |
---|
$("#inlinemod_" + pid).on('change', inlineModeration.checkItem);
Thread.quickEdit("#pid_" + pid);
|
$("#inlinemod_" + pid).on('change', inlineModeration.checkItem);
Thread.quickEdit("#pid_" + pid);
|
|
|
// Eval javascript $(json.data).filter("script").each(function(e) { eval($(this).text());
| // Eval javascript $(json.data).filter("script").each(function(e) { eval($(this).text());
|
Zeile 418 | Zeile 427 |
---|
if(lastpid.length) { lastpid.val(pid);
|
if(lastpid.length) { lastpid.val(pid);
|
} }
| } }
|
else { // Eval javascript
| else { // Eval javascript
|
Zeile 427 | Zeile 436 |
---|
eval($(this).text()); }); }
|
eval($(this).text()); }); }
|
|
|
$(".jGrowl").jGrowl("close");
|
$(".jGrowl").jGrowl("close");
|
},
| },
|
showIgnoredPost: function(pid) { $('#ignored_post_'+pid).slideToggle("slow");
|
showIgnoredPost: function(pid) { $('#ignored_post_'+pid).slideToggle("slow");
|
$('#post_'+pid).slideToggle("slow"); },
| $('#post_'+pid).slideToggle("slow"); },
|
showDeletedPost: function(pid) { $('#deleted_post_'+pid).slideToggle("slow"); $('#post_'+pid).slideToggle("slow"); },
|
showDeletedPost: function(pid) { $('#deleted_post_'+pid).slideToggle("slow"); $('#post_'+pid).slideToggle("slow"); },
|
|
|
deletePost: function(pid) {
|
deletePost: function(pid) {
|
$.prompt(quickdelete_confirm, {
| MyBB.prompt(quickdelete_confirm, {
|
buttons:[ {title: yes_confirm, value: true}, {title: no_confirm, value: false}
| buttons:[ {title: yes_confirm, value: true}, {title: no_confirm, value: false}
|
Zeile 459 | Zeile 468 |
---|
type: 'post', complete: function (request, status) {
|
type: 'post', complete: function (request, status) {
|
var json = $.parseJSON(request.responseText);
| var json = JSON.parse(request.responseText);
|
if(json.hasOwnProperty("errors")) { $.each(json.errors, function(i, message)
| if(json.hasOwnProperty("errors")) { $.each(json.errors, function(i, message)
|
Zeile 474 | Zeile 483 |
---|
{ // 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();
| 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'}); }
| $.jGrowl(lang.quick_delete_success, {theme:'jgrowl_success'}); }
|
Zeile 484 | Zeile 496 |
---|
{ // Actually deleted $('#post_'+pid).slideToggle("slow");
|
{ // Actually deleted $('#post_'+pid).slideToggle("slow");
|
|
|
$.jGrowl(lang.quick_delete_success, {theme:'jgrowl_success'}); } else if(json.data == 3) {
| $.jGrowl(lang.quick_delete_success, {theme:'jgrowl_success'}); } else if(json.data == 3) {
|
Zeile 500 | Zeile 512 |
---|
{ window.location = json.url; }, 3000);
|
{ window.location = json.url; }, 3000);
|
|
|
// print success message $.jGrowl(lang.quick_delete_thread_success, {theme:'jgrowl_success'}); }
| // print success message $.jGrowl(lang.quick_delete_thread_success, {theme:'jgrowl_success'}); }
|
Zeile 521 | Zeile 533 |
---|
restorePost: function(pid) {
|
restorePost: function(pid) {
|
$.prompt(quickrestore_confirm, {
| MyBB.prompt(quickrestore_confirm, {
|
buttons:[ {title: yes_confirm, value: true}, {title: no_confirm, value: false}
| buttons:[ {title: yes_confirm, value: true}, {title: no_confirm, value: false}
|
Zeile 535 | Zeile 547 |
---|
type: 'post', complete: function (request, status) {
|
type: 'post', complete: function (request, status) {
|
var json = $.parseJSON(request.responseText);
| var json = JSON.parse(request.responseText);
|
if(json.hasOwnProperty("errors")) { $.each(json.errors, function(i, message)
| if(json.hasOwnProperty("errors")) { $.each(json.errors, function(i, message)
|
Zeile 547 | Zeile 559 |
---|
{ // Change CSS class of div 'post_[pid]' $("#post_"+pid).removeClass("unapproved_post deleted_post");
|
{ // Change CSS class of div 'post_[pid]' $("#post_"+pid).removeClass("unapproved_post deleted_post");
|
$("#quick_delete_" + pid).show(); $("#quick_restore_" + pid).hide();
| if(json.first == 1) { $("#quick_reply_form, .thread_tools, .new_reply_button, .inline_rating").show(); $("#moderator_options_selector option.option_mirage").prop("disabled", false); $("#moderator_options_selector option[value='restorethread']").val("softdeletethread").text(lang.softdelete_thread); }
|
$.jGrowl(lang.quick_restore_success, {theme:'jgrowl_success'}); }
| $.jGrowl(lang.quick_restore_success, {theme:'jgrowl_success'}); }
|