Vergleich jscripts/thread.js - 1.8.16 - 1.8.38

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 1Zeile 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();


 
			if(thread_deleted == "1")
{
$("#quick_reply_form, .new_reply_button, .thread_tools, .inline_rating").hide();
$("#moderator_options_selector option.option_mirage").attr("disabled","disabled");
}

visible_replies = parseInt(visible_replies, 10);
Thread.splitToolHandler();

if($("#moderator_options_selector").length !== 0) {
$("#moderator_options_selector").on('change', function() {
$("#moderator_options").trigger('submit');
});

$("#moderator_options").on('submit', function(){
if($("#moderator_options_selector").val() == "") {
$.jGrowl(lang.select_tool, {theme:'jgrowl_error'});
return false;
}
});
}


			// Set spinner image
$('#quickreply_spinner img').attr('src', spinner_image);
});

			// Set spinner image
$('#quickreply_spinner img').attr('src', spinner_image);
});

	},


	},


	initMultiQuote: function()
{
var quoted = Cookie.get('multiquote');

	initMultiQuote: function()
{
var quoted = Cookie.get('multiquote');

Zeile 40Zeile 62
		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 57Zeile 86
		}

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');

Zeile 113Zeile 142

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"))

		if(typeof json == 'object')
{
if(json.hasOwnProperty("errors"))

Zeile 126Zeile 155
			}
}


			}
}


		if(typeof $('textarea').sceditor != 'undefined')

		if(typeof MyBBEditor !== 'undefined' && MyBBEditor !== null)

		{

		{

			$('textarea').sceditor('instance').insert(json.message);

			MyBBEditor.insert(json.message);

		}
else
{

		}
else
{

Zeile 143Zeile 172
		Thread.clearMultiQuoted();
$('#quickreply_multiquote').hide();
$('#quoted_ids').val('all');

		Thread.clearMultiQuoted();
$('#quickreply_multiquote').hide();
$('#quoted_ids').val('all');


$('#message').focus();
},



$('#message').trigger('focus');
},


	clearMultiQuoted: function()
{
$('#quickreply_multiquote').hide();

	clearMultiQuoted: function()
{
$('#quickreply_multiquote').hide();

Zeile 184Zeile 213
				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",
submitdata: function (values, settings)

				event: "edit" + pid, // Triggered by the event "edit_[pid]",
onblur: "ignore",
dataType: "json",
submitdata: function (values, settings)

				{
id = $(this).attr('id');

				{
id = $(this).attr('id');

					pid = id.replace( /[^\d.]/g, '');
$("#quickedit_" + pid + "_editreason_original").val($("#quickedit_" + pid + "_editreason").val());
return {

					pid = id.replace( /[^\d.]/g, '');
$("#quickedit_" + pid + "_editreason_original").val($("#quickedit_" + pid + "_editreason").val());
return {

Zeile 201Zeile 231
					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"))

Zeile 215Zeile 245
							$(this).html($('#pid_' + pid + '_temp').html());
}
else if(json.hasOwnProperty("moderation_post"))

							$(this).html($('#pid_' + pid + '_temp').html());
}
else if(json.hasOwnProperty("moderation_post"))

						{

						{

							$(".jGrowl").jGrowl("close");

							$(".jGrowl").jGrowl("close");





							$(this).html(json.message);

// No more posts on this page? (testing for "1" as the last post would be removed here)
if($('.post').length == 1)

							$(this).html(json.message);

// No more posts on this page? (testing for "1" as the last post would be removed here)
if($('.post').length == 1)

							{

							{

								alert(json.moderation_post);
window.location = json.url;
}

								alert(json.moderation_post);
window.location = json.url;
}

Zeile 236Zeile 266
						{
$(".jGrowl").jGrowl("close");


						{
$(".jGrowl").jGrowl("close");


							$(this).html(json.message);


							$(this).html(json.message);


							alert(json.moderation_thread);

// Redirect user to forum
window.location = json.url;

							alert(json.moderation_thread);

// Redirect user to forum
window.location = json.url;

						}

						}

						else
{
// Change html content
$(this).html(json.message);
$('#edited_by_' + pid).html(json.editedmsg);
}

						else
{
// Change html content
$(this).html(json.message);
$('#edited_by_' + pid).html(json.editedmsg);
}

					}

					}

					else
{
// Change html content

					else
{
// Change html content

Zeile 270Zeile 300
				// 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 299Zeile 334
		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 343Zeile 378
	{
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 398Zeile 433

$('#posts').append(json.data);



$('#posts').append(json.data);


 
			++visible_replies;
Thread.splitToolHandler();


			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);


Zeile 441Zeile 479

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 455Zeile 493
						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 470Zeile 508
								{
// 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, {theme:'jgrowl_success'});
}




									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);
thread_deleted = "1";
}
$.jGrowl(lang.quick_delete_success, {theme:'jgrowl_success'});
}

								else if(json.data == 2)
{
// Actually deleted
$('#post_'+pid).slideToggle("slow");


								else if(json.data == 2)
{
// Actually deleted
$('#post_'+pid).slideToggle("slow");


 
									--visible_replies;
Thread.splitToolHandler();

									$.jGrowl(lang.quick_delete_success, {theme:'jgrowl_success'});

									$.jGrowl(lang.quick_delete_success, {theme:'jgrowl_success'});

								} else if(json.data == 3)


								}
else if(json.data == 3)

								{
// deleted thread --> redirect


								{
// deleted thread --> redirect


Zeile 517Zeile 561

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 531Zeile 575
						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 543Zeile 587
							{
// 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);
thread_deleted = "";
}


$.jGrowl(lang.quick_restore_success, {theme:'jgrowl_success'});
}


$.jGrowl(lang.quick_restore_success, {theme:'jgrowl_success'});
}

Zeile 564Zeile 612

viewNotes: function(tid)
{


viewNotes: function(tid)
{

		MyBB.popupWindow("/moderation.php?action=viewthreadnotes&tid="+tid+"&modal=1");













		MyBB.popupWindow("/moderation.php?action=viewthreadnotes&tid="+tid+"&modal=1");
},

splitToolHandler: function()
{
if($(thread_deleted !== "1" && "#moderator_options_selector").length !== 0){
var splitTool = $("#moderator_options_selector").find("option[value=split]");
if(visible_replies > 0) {
splitTool.prop("disabled", false);
} else {
splitTool.attr("disabled","disabled");
}
}

	}
};


	}
};