Vergleich jscripts/general.js - 1.8.4 - 1.8.21

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 15Zeile 15

/* Create the Check All feature */
$('[name="allbox"]').each(function(key, value) {


/* Create the Check All feature */
$('[name="allbox"]').each(function(key, value) {

			$(this).change(function() {
var checkboxes = $(this).closest('form').find(':checkbox');
if($(this).is(':checked')) {
checkboxes.prop('checked', true);
} else {
checkboxes.removeAttr('checked');


















			var allbox = this;
var checked = $(this).is(':checked');
var checkboxes = $(this).closest('form').find(':checkbox').not('[name="allbox"]');

checkboxes.on('change', function() {
if(checked && !$(this).prop('checked'))
{
checked = false;
$(allbox).trigger('change', ['item']);
}
});

$(this).on('change', function(event, origin) {
checked = $(this).is(':checked');

if(typeof(origin) == "undefined")
{
checkboxes.each(function() {
if(checked != $(this).is(':checked'))
{
$(this).prop('checked', checked).trigger('change');
}
});

				}
});
});

				}
});
});

Zeile 28Zeile 45
		// Initialise "initial focus" field if we have one
var initialfocus = $(".initial_focus");
if(initialfocus.length)

		// Initialise "initial focus" field if we have one
var initialfocus = $(".initial_focus");
if(initialfocus.length)

		{
initialfocus.focus();
}


		{
initialfocus.trigger('focus');
}


		if(typeof(use_xmlhttprequest) != "undefined" && use_xmlhttprequest == 1)
{
mark_read_imgs = $(".ajax_mark_read");
mark_read_imgs.each(function()
{
var element = $(this);

		if(typeof(use_xmlhttprequest) != "undefined" && use_xmlhttprequest == 1)
{
mark_read_imgs = $(".ajax_mark_read");
mark_read_imgs.each(function()
{
var element = $(this);

				if(element.hasClass('forum_off') || element.hasClass('forum_offlock') || element.hasClass('forum_offlink') || element.hasClass('subforum_minioff') || element.hasClass('subforum_miniofflock') || element.hasClass('subforum_miniofflink') || (element.attr("title") && element.attr("title") == lang.no_new_posts)) return;

				if(element.hasClass('forum_off') || element.hasClass('forum_offclose') || element.hasClass('forum_offlink') || element.hasClass('subforum_minioff') || element.hasClass('subforum_minioffclose') || element.hasClass('subforum_miniofflink') || (element.attr("title") && element.attr("title") == lang.no_new_posts)) return;





				element.click(function()

				element.on('click', function()

				{
MyBB.markForumRead(this);
});

				{
MyBB.markForumRead(this);
});

Zeile 51Zeile 68
					element.attr("title", element.attr("title") + " - ");
}
element.attr("title", element.attr("title") + lang.click_mark_read);

					element.attr("title", element.attr("title") + " - ");
}
element.attr("title", element.attr("title") + lang.click_mark_read);

			});

			});

		}

if(typeof $.modal !== "undefined")

		}

if(typeof $.modal !== "undefined")

Zeile 60Zeile 77
				$("body").css("overflow", "hidden");
if(initialfocus.length > 0)
{

				$("body").css("overflow", "hidden");
if(initialfocus.length > 0)
{

					initialfocus.focus();

					initialfocus.trigger('focus');

				}
});

$(document).on($.modal.CLOSE, function(event, modal) {
$("body").css("overflow", "auto");

				}
});

$(document).on($.modal.CLOSE, function(event, modal) {
$("body").css("overflow", "auto");

 
			});
}

$("a.referralLink").on('click', MyBB.showReferrals);

if($('.author_avatar').length)
{
$(".author_avatar img").on('error', function () {
$(this).unbind("error").closest('.author_avatar').remove();

			});
}
},

popupWindow: function(url, options, root)

			});
}
},

popupWindow: function(url, options, root)

	{

	{

		if(!options) options = { fadeDuration: 250, zIndex: (typeof modal_zindex !== 'undefined' ? modal_zindex : 9999) }
if(root != true)
url = rootpath + url;

		if(!options) options = { fadeDuration: 250, zIndex: (typeof modal_zindex !== 'undefined' ? modal_zindex : 9999) }
if(root != true)
url = rootpath + url;





		$.get(url, function(html)

		$.get(url, function(html)

		{

		{

			$(html).appendTo('body').modal(options);
});

			$(html).appendTo('body').modal(options);
});

 
	},

prompt: function(message, options)
{
var defaults = { fadeDuration: 250, zIndex: (typeof modal_zindex !== 'undefined' ? modal_zindex : 9999) };
var buttonsText = '';

for (var i in options.buttons)
{
buttonsText += templates.modal_button.replace('__title__', options.buttons[i].title);
}

var html = templates.modal.replace('__buttons__', buttonsText).replace('__message__', message);
var modal = $(html);
modal.modal($.extend(defaults, options));
var buttons = modal.find('.modal_buttons > .button');
buttons.on('click', function(e)
{
e.preventDefault();
var index = $(this).index();
if (options.submit(e, options.buttons[index].value) == false)
return;

$.modal.close();
});

if (buttons[0])
{
modal.on($.modal.OPEN, function()
{
$(buttons[0]).trigger('focus');
});
}

return modal;

	},

deleteEvent: function(eid)
{

	},

deleteEvent: function(eid)
{

		$.prompt(deleteevent_confirm, {

		MyBB.prompt(deleteevent_confirm, {

			buttons:[
{title: yes_confirm, value: true},
{title: no_confirm, value: false}

			buttons:[
{title: yes_confirm, value: true},
{title: no_confirm, value: false}

Zeile 98Zeile 159
									action: "calendar.php",
style: "display: none;"
});

									action: "calendar.php",
style: "display: none;"
});


form.append(


form.append(

						$("<input />",
{
name: "action",
type: "hidden",

						$("<input />",
{
name: "action",
type: "hidden",

							value: "do_editevent"

							value: "do_deleteevent"

						})
);


						})
);


Zeile 119Zeile 180
							})
);
}

							})
);
}





					form.append(
$("<input />",
{
name: "eid",
type: "hidden",
value: eid

					form.append(
$("<input />",
{
name: "eid",
type: "hidden",
value: eid

						})
);


						})
);


					form.append(
$("<input />",
{

					form.append(
$("<input />",
{

Zeile 137Zeile 198
							value: 1
})
);

							value: 1
})
);





					$("body").append(form);

					$("body").append(form);

					form.submit();

					form.trigger('submit');

				}
}
});

				}
}
});

Zeile 158Zeile 219
	viewNotes: function(uid)
{
MyBB.popupWindow("/member.php?action=viewnotes&uid="+uid+"&modal=1");

	viewNotes: function(uid)
{
MyBB.popupWindow("/member.php?action=viewnotes&uid="+uid+"&modal=1");

 
	},

getIP: function(pid)
{
MyBB.popupWindow("/moderation.php?action=getip&pid="+pid+"&modal=1");
},

getPMIP: function(pmid)
{
MyBB.popupWindow("/moderation.php?action=getpmip&pmid="+pmid+"&modal=1");

	},

deleteReputation: function(uid, rid)
{

	},

deleteReputation: function(uid, rid)
{

		$.prompt(delete_reputation_confirm, {

		MyBB.prompt(delete_reputation_confirm, {

			buttons:[
{title: yes_confirm, value: true},
{title: no_confirm, value: false}

			buttons:[
{title: yes_confirm, value: true},
{title: no_confirm, value: false}

Zeile 176Zeile 247
						action: "reputation.php?action=delete",
style: "display: none;"
});

						action: "reputation.php?action=delete",
style: "display: none;"
});





					form.append(
$("<input />",
{

					form.append(
$("<input />",
{

Zeile 208Zeile 279
					);

$("body").append(form);

					);

$("body").append(form);

					form.submit();

					form.trigger('submit');

				}
}
});

return false;
},

				}
}
});

return false;
},


whoPosted: function(tid)
{
MyBB.popupWindow("/misc.php?action=whoposted&tid="+tid+"&modal=1");
},



































whoPosted: function(tid, sortby)
{
var sort = "", url, body;

if(typeof sortby === "undefined")
{
sortby = "";
}

if(sortby == "username")
{
sort = "&sort=" + sortby;
}
url = "/misc.php?action=whoposted&tid="+tid+sort+"&modal=1";

// if the modal is already open just replace the contents
if($.modal.isActive())
{
// don't waste a query if we are already sorted correctly
if(sortby == MyBB.whoPostedSort)
{
return;
}

MyBB.whoPostedSort = sortby;

$.get(rootpath + url, function(html)
{
// just replace the inner div
body = $(html).children("div");
$("div.modal").children("div").replaceWith(body);
});
return;
}
MyBB.whoPostedSort = "";
MyBB.popupWindow(url);
},


markForumRead: function(event)
{
var element = $(event);
if(!element.length)


markForumRead: function(event)
{
var element = $(event);
if(!element.length)

		{
return false;

		{
return false;

		}
var fid = element.attr("id").replace("mark_read_", "");
if(!fid)

		}
var fid = element.attr("id").replace("mark_read_", "");
if(!fid)

Zeile 235Zeile 339
		}

$.ajax(

		}

$.ajax(

		{

		{

			url: 'misc.php?action=markread&fid=' + fid + '&ajax=1&my_post_key=' + my_post_key,
async: true,
success: function (request)

			url: 'misc.php?action=markread&fid=' + fid + '&ajax=1&my_post_key=' + my_post_key,
async: true,
success: function (request)

Zeile 253Zeile 357
			if(markreadfid.hasClass('subforum_minion'))
{
markreadfid.removeClass('subforum_minion').addClass('subforum_minioff');

			if(markreadfid.hasClass('subforum_minion'))
{
markreadfid.removeClass('subforum_minion').addClass('subforum_minioff');

			}

			}

			else
{
markreadfid.removeClass('forum_on').addClass('forum_off');

			else
{
markreadfid.removeClass('forum_on').addClass('forum_off');

Zeile 288Zeile 392
		{
return false;
}

		{
return false;
}

		form.submit();

		form.trigger('submit');

	},

changeTheme: function()

	},

changeTheme: function()

Zeile 298Zeile 402
		{
return false;
}

		{
return false;
}

		form.submit();

		form.trigger('submit');

	},

detectDSTChange: function(timezone_with_dst)

	},

detectDSTChange: function(timezone_with_dst)

Zeile 333Zeile 437
						);

$("body").append(form);

						);

$("body").append(form);

						form.submit();

						form.trigger('submit');

	                }
}
});

	                }
}
});

Zeile 395Zeile 499

deleteAnnouncement: function(data)
{


deleteAnnouncement: function(data)
{

		$.prompt(announcement_quickdelete_confirm, {

		MyBB.prompt(announcement_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 404Zeile 508
				if(v == true)
{
window.location=data.href.replace('action=delete_announcement','action=do_delete_announcement');

				if(v == true)
{
window.location=data.href.replace('action=delete_announcement','action=do_delete_announcement');

				}
}

				}
}

		});

		});





		return false;

		return false;

 
	},

showReferrals: function(e)
{
var idPieces, uid;

e.preventDefault();

if(typeof this.id == "undefined")
{
return false;
}

idPieces = this.id.split("_");
uid = parseInt(idPieces[idPieces.length - 1], 10);

if(uid <= 0)
{
return false;
}

MyBB.popupWindow("/xmlhttp.php?action=get_referrals&uid="+uid);

	},

// Fixes https://github.com/mybb/mybb/issues/1232

	},

// Fixes https://github.com/mybb/mybb/issues/1232

Zeile 432Zeile 558
				},
formatInputTooShort: function (input, min) {
var n = min - input.length;

				},
formatInputTooShort: function (input, min) {
var n = min - input.length;

					if( n == 1)
{

					if( n == 1)
{

						return lang.select2_inputtooshort_single;
}
else

						return lang.select2_inputtooshort_single;
}
else

Zeile 461Zeile 587
					{
return lang.select2_selectiontoobig_plural.replace('{1}', limit);
}

					{
return lang.select2_selectiontoobig_plural.replace('{1}', limit);
}

				},

				},

				formatLoadMore: function (pageNumber) {
return lang.select2_loadmore;
},

				formatLoadMore: function (pageNumber) {
return lang.select2_loadmore;
},

Zeile 477Zeile 603
	get: function(name)
{
name = cookiePrefix + name;

	get: function(name)
{
name = cookiePrefix + name;

		return $.cookie(name);
},

set: function(name, value, expires)
{
name = cookiePrefix + name;
if(!expires)

		return Cookies.get(name);
},

set: function(name, value, expires)
{
name = cookiePrefix + name;
if(!expires)

		{
expires = 315360000; // 10*365*24*60*60 => 10 years
}

		{
expires = 315360000; // 10*365*24*60*60 => 10 years
}

Zeile 494Zeile 620
		options = {
expires: expire,
path: cookiePath,

		options = {
expires: expire,
path: cookiePath,

			domain: cookieDomain


			domain: cookieDomain,
secure: cookieSecureFlag == true,

		};


		};


		return $.cookie(name, value, options);

		return Cookies.set(name, value, options);

	},

unset: function(name)

	},

unset: function(name)

Zeile 508Zeile 635
			path: cookiePath,
domain: cookieDomain
};

			path: cookiePath,
domain: cookieDomain
};

		return $.removeCookie(name, options);

		return Cookies.remove(name, options);

	}
};


	}
};


Zeile 527Zeile 654
					return;
}


					return;
}


				expander.click(function()

				expander.on('click', function()

				{
controls = expander.attr("id").replace("_img", "");
expandables.expandCollapse(this, controls);

				{
controls = expander.attr("id").replace("_img", "");
expandables.expandCollapse(this, controls);

Zeile 557Zeile 684
		var collapsedItem = $("#"+controls+"_c");

if(expandedItem.length && collapsedItem.length)

		var collapsedItem = $("#"+controls+"_c");

if(expandedItem.length && collapsedItem.length)

		{
// Expanding
if(expandedItem.is(":hidden"))
{
expandedItem.toggle("fast");
collapsedItem.toggle("fast");
this.saveCollapsed(controls);
}
// Collapsing
else
{
expandedItem.toggle("fast");

		{
// Expanding
if(expandedItem.is(":hidden"))
{
expandedItem.toggle("fast");
collapsedItem.toggle("fast");
this.saveCollapsed(controls);
}
// Collapsing
else
{
expandedItem.toggle("fast");

				collapsedItem.toggle("fast");
this.saveCollapsed(controls, 1);
}

				collapsedItem.toggle("fast");
this.saveCollapsed(controls, 1);
}

Zeile 577Zeile 704
		{
// Expanding
if(expandedItem.is(":hidden"))

		{
// Expanding
if(expandedItem.is(":hidden"))

			{

			{

				expandedItem.toggle("fast");
element.attr("src", element.attr("src").replace(/collapse_collapsed\.(gif|jpg|jpeg|bmp|png)$/i, "collapse.$1"))
.attr("alt", "[-]")

				expandedItem.toggle("fast");
element.attr("src", element.attr("src").replace(/collapse_collapsed\.(gif|jpg|jpeg|bmp|png)$/i, "collapse.$1"))
.attr("alt", "[-]")

Zeile 632Zeile 759
var lang = {

};

var lang = {

};

 

/* add keepelement to jquery-modal plugin */
(function($) {
if(typeof $.modal != 'undefined')
{
$.modal.defaults.keepelement = false;

$.modal.prototype.oldCloseFunction = $.modal.prototype.close;
$.modal.prototype.close = function()
{
this.oldCloseFunction();

// Deletes the element (multi-modal feature: e.g. when you click on multiple report buttons, you will want to see different content for each)
if(!this.options.keepelement)
{
this.$elm.remove();
}
};
}
})(jQuery);



MyBB.init();


MyBB.init();