Vergleich jscripts/thread.js - 1.8.3 - 1.8.15

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 5Zeile 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 20Zeile 20

$.each(post_ids, function(key, value) {
var mquote_a = $("#multiquote_"+value).closest('a');


$.each(post_ids, function(key, value) {
var mquote_a = $("#multiquote_"+value).closest('a');

				if(mquote_a)

				if(mquote_a.length)

				{
mquote_a.removeClass('postbit_multiquote').addClass('postbit_multiquote_on');
}
});

var mquote_quick = $('#quickreply_multiquote');

				{
mquote_a.removeClass('postbit_multiquote').addClass('postbit_multiquote_on');
}
});

var mquote_quick = $('#quickreply_multiquote');

			if(mquote_quick)

			if(mquote_quick.length)

			{
mquote_quick.show();
}

			{
mquote_quick.show();
}

		}

		}

		return true;
},


		return true;
},


Zeile 46Zeile 46

$.each(post_ids, function(key, post_id) {
if(post_id != pid && post_id != '')


$.each(post_ids, function(key, post_id) {
if(post_id != pid && post_id != '')

				{

				{

					new_post_ids[new_post_ids.length] = post_id;

					new_post_ids[new_post_ids.length] = post_id;

				}

				}

				else if(post_id == pid)
{
is_new = false;
}
});

				else if(post_id == pid)
{
is_new = false;
}
});

		}


		}


		var mquote_a = $("#multiquote_"+pid).closest('a')
if(is_new == true)
{

		var mquote_a = $("#multiquote_"+pid).closest('a')
if(is_new == true)
{

Zeile 63Zeile 63
			mquote_a.removeClass('postbit_multiquote').addClass('postbit_multiquote_on');
}
else

			mquote_a.removeClass('postbit_multiquote').addClass('postbit_multiquote_on');
}
else

		{

		{

			mquote_a.removeClass('postbit_multiquote_on').addClass('postbit_multiquote');
}

			mquote_a.removeClass('postbit_multiquote_on').addClass('postbit_multiquote');
}

		



		var mquote_quick = $('#quickreply_multiquote');

		var mquote_quick = $('#quickreply_multiquote');

		if(mquote_quick)

		if(mquote_quick.length)

		{

		{

			if(new_post_ids.length > 0)

			if(new_post_ids.length)

			{
mquote_quick.show();

			{
mquote_quick.show();

			}

			}

			else
{
mquote_quick.hide();

			else
{
mquote_quick.hide();

Zeile 97Zeile 97
				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 120Zeile 120
			{
$.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 157Zeile 157

$.each(post_ids, function(key, post_id) {
var mquote_a = $("#multiquote_"+post_id).closest('a');


$.each(post_ids, function(key, post_id) {
var mquote_a = $("#multiquote_"+post_id).closest('a');

				if(mquote_a)

				if(mquote_a.length)

				{
mquote_a.removeClass('postbit_multiquote_on').addClass('postbit_multiquote');
}

				{
mquote_a.removeClass('postbit_multiquote_on').addClass('postbit_multiquote');
}

Zeile 168Zeile 168

quickEdit: function(el)
{


quickEdit: function(el)
{

		if(!el) el = '.post_body';

		if(typeof el === 'undefined' || !el.length) el = '.post_body';


$(el).each(function()
{


$(el).each(function()
{

Zeile 191Zeile 191
				{
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 199Zeile 200
				{
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')

					{

					{

						if(json.hasOwnProperty("errors"))
{
$(".jGrowl").jGrowl("close");

$.each(json.errors, function(i, message)
{

						if(json.hasOwnProperty("errors"))
{
$(".jGrowl").jGrowl("close");

$.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 227Zeile 228
							}
else
{

							}
else
{

								$.jGrowl(json.moderation_post);

								$.jGrowl(json.moderation_post, {theme:'jgrowl_success'});

								$('#post_' + pid).slideToggle();
}
}
else if(json.hasOwnProperty("moderation_thread"))
{
$(".jGrowl").jGrowl("close");

								$('#post_' + pid).slideToggle();
}
}
else if(json.hasOwnProperty("moderation_thread"))
{
$(".jGrowl").jGrowl("close");


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



$(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 262Zeile 263

$('.quick_edit_button').each(function()
{


$('.quick_edit_button').each(function()
{

			$(this).bind("click", function(e)

			$(this).on("click", function(e)

			{
e.preventDefault();

// Take pid out of the id attribute
id = $(this).attr('id');
pid = id.replace( /[^\d.]/g, '');

			{
e.preventDefault();

// Take pid out of the id attribute
id = $(this).attr('id');
pid = id.replace( /[^\d.]/g, '');





				// Create a copy of the post
if($('#pid_' + pid + '_temp').length == 0)
{

				// Create a copy of the post
if($('#pid_' + pid + '_temp').length == 0)
{

					$('#pid_' + pid).clone().attr('id','pid_' + pid + '_temp').css('display','none').appendTo("body");

					$('#pid_' + pid).clone().attr('id','pid_' + pid + '_temp').appendTo("body").hide();

				}

// Trigger the edit event

				}

// Trigger the edit event

				$('#pid_' + pid).trigger("edit" + pid);

				$('#pid_' + pid).trigger("edit" + pid);


// Edit Reason
$('#pid_' + pid + ' textarea').attr('id', 'quickedit_' + pid);
if(allowEditReason == 1 && $('#quickedit_' + pid + '_editreason').length == 0)
{


// Edit Reason
$('#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();

				}

				}

			});

			});

        });

return false;

        });

return false;

Zeile 293Zeile 296

initQuickReply: function()
{


initQuickReply: function()
{

		if($('#quick_reply_form') && use_xmlhttprequest == 1)

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

		}

		}

	},

quickReply: function(e)

	},

quickReply: function(e)

Zeile 313Zeile 316

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 327Zeile 330
        	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();
}

Zeile 349Zeile 352

$.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'))

		if($('#captcha_trow').length)

		{
cap = json.data.match(/^<captcha>([0-9a-zA-Z]+)(\|([0-9a-zA-Z]+)|)<\/captcha>/);
if(cap)

		{
cap = json.data.match(/^<captcha>([0-9a-zA-Z]+)(\|([0-9a-zA-Z]+)|)<\/captcha>/);
if(cap)

Zeile 366Zeile 369
				{
Recaptcha.reload();
}

				{
Recaptcha.reload();
}

				else if($("#captcha_img"))

				else if($("#captcha_img").length)

				{
if(cap[1])
{

				{
if(cap[1])
{

Zeile 376Zeile 379
						{
$('#imagestring').attr('type', 'hidden').val(cap[3]);
// hide the captcha

						{
$('#imagestring').attr('type', 'hidden').val(cap[3]);
// hide the captcha

							$('#captcha_trow').css('display', 'none');

							$('#captcha_trow').hide();

						}
else
{
$('#captcha_img').attr('src', "captcha.php?action=regimage&imagehash="+imghash);
$('#imagestring').attr('type', 'text').val('');

						}
else
{
$('#captcha_img').attr('src', "captcha.php?action=regimage&imagehash="+imghash);
$('#imagestring').attr('type', 'text').val('');

							$('#captcha_trow').css('display', '');

							$('#captcha_trow').show();

						}
}
}
}
}

						}
}
}
}
}

		



		if(json.hasOwnProperty("errors"))
return false;


		if(json.hasOwnProperty("errors"))
return false;


Zeile 398Zeile 401
			var post = document.createElement("div");

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

			var post = document.createElement("div");

$('#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);


			Thread.quickEdit("#pid_" + pid);


			/*if(MyBB.browser == "ie" || MyBB.browser == "opera" || MyBB.browser == "safari" || MyBB.browser == "chrome")
{*/
// Eval javascript
$(json.data).filter("script").each(function(e) {
eval($(this).text());
});
//}

			// Eval javascript
$(json.data).filter("script").each(function(e) {
eval($(this).text());
});





$('#quick_reply_form')[0].reset();

var lastpid = $('#lastpid');


$('#quick_reply_form')[0].reset();

var lastpid = $('#lastpid');

			if(lastpid)

			if(lastpid.length)

			{
lastpid.val(pid);
}

			{
lastpid.val(pid);
}

Zeile 434Zeile 434
	showIgnoredPost: function(pid)
{
$('#ignored_post_'+pid).slideToggle("slow");

	showIgnoredPost: function(pid)
{
$('#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 455Zeile 461
						{
var json = $.parseJSON(request.responseText);
if(json.hasOwnProperty("errors"))

						{
var json = $.parseJSON(request.responseText);
if(json.hasOwnProperty("errors"))

							{

							{

								$.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 467Zeile 473
								if(json.data == 1)
{
// Change CSS class of div 'post_[pid]'

								if(json.data == 1)
{
// Change CSS class of div 'post_[pid]'

									$("#post_"+pid).addClass("unapproved_post").addClass("deleted_post");

									$("#post_"+pid).addClass("unapproved_post deleted_post");


$("#quick_delete_" + pid).hide();
$("#quick_restore_" + pid).show();



$("#quick_delete_" + pid).hide();
$("#quick_restore_" + pid).show();


									$.jGrowl(lang.quick_delete_success);

									$.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");

									
$.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"))
{
$.jGrowl(lang.unknown_error);


if(!json.hasOwnProperty("url"))
{
$.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);

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

								}

								}

							}
else
{
$.jGrowl(lang.unknown_error);
}
}
});
}

							}
else
{
$.jGrowl(lang.unknown_error, {theme:'jgrowl_error'});
}
}
});
}

			}
});

			}
});

		



		return false;
},


		return false;
},


Zeile 534Zeile 540
							{
$.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]'

								});
}
else if(json.hasOwnProperty("data"))
{
// Change CSS class of div 'post_[pid]'

								$("#post_"+pid).removeClass("unapproved_post").removeClass("deleted_post");

								$("#post_"+pid).removeClass("unapproved_post deleted_post");


$("#quick_delete_" + pid).show();
$("#quick_restore_" + pid).hide();



$("#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;
},

viewNotes: function(tid)
{

		return false;
},

viewNotes: function(tid)
{

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

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

	}
};


	}
};