Vergleich jscripts/general.js - 1.8.14 - 1.8.33

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 17Zeile 17
		$('[name="allbox"]').each(function(key, value) {
var allbox = this;
var checked = $(this).is(':checked');

		$('[name="allbox"]').each(function(key, value) {
var allbox = this;
var checked = $(this).is(':checked');

			var checkboxes = $(this).closest('form').find(':checkbox');
checkboxes.change(function() {


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

checkboxes.on('change', function() {

				if(checked && !$(this).prop('checked'))
{
checked = false;

				if(checked && !$(this).prop('checked'))
{
checked = false;

					$(allbox).prop('checked', checked);
}
});
$(this).change(function() {
checked = $(this).is(':checked');
checkboxes.prop('checked', checked);
});
});











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


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

element.click(function()
{

				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.on('click', function()
{

					MyBB.markForumRead(this);
});


					MyBB.markForumRead(this);
});


Zeile 66Zeile 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();

			});
}
},

			});
}
},

Zeile 86Zeile 106
		{
$(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 = '', title = '';

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

// Support passing custom title
if ($.isArray(message)) {
title = message[0];
message = message[1];
} else {
title = lang.confirm_title;
}

var html = templates.modal.replace('__buttons__', buttonsText).replace('__message__', message).replace('__title__', title);
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 145Zeile 208
					);

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

					);

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

					form.submit();

					form.trigger('submit');

				}
}
});

				}
}
});

Zeile 164Zeile 227
	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 214Zeile 287
					);

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

					);

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

					form.submit();

					form.trigger('submit');

				}
}
});

				}
}
});

Zeile 323Zeile 396
	changeLanguage: function()
{
form = $("#lang_select");

	changeLanguage: function()
{
form = $("#lang_select");

		if(!form.length)
{

		if(!form.length)
{

			return false;
}

			return false;
}

		form.submit();

		form.trigger('submit');

	},

changeTheme: function()
{
form = $("#theme_select");
if(!form.length)

	},

changeTheme: function()
{
form = $("#theme_select");
if(!form.length)

		{
return false;

		{
return false;

		}

		}

		form.submit();

		form.trigger('submit');

	},

detectDSTChange: function(timezone_with_dst)

	},

detectDSTChange: function(timezone_with_dst)

Zeile 345Zeile 418
		var date = new Date();
var local_offset = date.getTimezoneOffset() / 60;
if(Math.abs(parseInt(timezone_with_dst) + local_offset) == 1)

		var date = new Date();
var local_offset = date.getTimezoneOffset() / 60;
if(Math.abs(parseInt(timezone_with_dst) + local_offset) == 1)

		{

		{

			$.ajax(
{
url: 'misc.php?action=dstswitch&ajax=1',

			$.ajax(
{
url: 'misc.php?action=dstswitch&ajax=1',

Zeile 372Zeile 445
						);

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

						);

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

						form.submit();

						form.trigger('submit');

	                }
}
});

	                }
}
});

Zeile 383Zeile 456
	{
var pm_notice = $("#pm_notice");
if(!pm_notice.length)

	{
var pm_notice = $("#pm_notice");
if(!pm_notice.length)

		{

		{

			return false;
}


			return false;
}


Zeile 400Zeile 473
			async: true
});
pm_notice.remove();

			async: true
});
pm_notice.remove();

		return false;
},

		return false;
},


submitReputation: function(uid, pid, del)
{


submitReputation: function(uid, pid, del)
{

Zeile 426Zeile 499
			},
error: function(){
alert(lang.unknown_error);

			},
error: function(){
alert(lang.unknown_error);

			}
});

return false;

			}
});

return false;

	},

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 448Zeile 521
		});

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 458Zeile 553
			$.extend($.fn.select2.defaults, {
formatMatches: function (matches) {
if(matches == 1)

			$.extend($.fn.select2.defaults, {
formatMatches: function (matches) {
if(matches == 1)

					{

					{

						return lang.select2_match;
}
else

						return lang.select2_match;
}
else

Zeile 474Zeile 569
					if( n == 1)
{
return lang.select2_inputtooshort_single;

					if( n == 1)
{
return lang.select2_inputtooshort_single;

					}
else
{

					}
else
{

						return lang.select2_inputtooshort_plural.replace('{1}', n);
}
},

						return lang.select2_inputtooshort_plural.replace('{1}', n);
}
},

Zeile 553Zeile 648
};

var expandables = {

};

var expandables = {



 
	init: function()
{
var expanders = $(".expcolimage .expander");
if(expanders.length)
{
expanders.each(function()

	init: function()
{
var expanders = $(".expcolimage .expander");
if(expanders.length)
{
expanders.each(function()

			{

			{

        		var expander = $(this);

        		var expander = $(this);

				if(expander.attr("id") == false)
{

				if(!expander || expander.attr("id") == false)
{

					return;

					return;

				}

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

if(MyBB.browser == "ie")
{
expander.css("cursor", "hand");
}
else
{
expander.css("cursor", "pointer");
}
});
}
},

expandCollapse: function(e, controls)
{
element = $(e);

if(!element || controls == false)
{
return false;
}
var expandedItem = $("#"+controls+"_e");
var collapsedItem = $("#"+controls+"_c");

				}

expander.on('click', function()
{
expandables.expandCollapse($(this));
});

expander.css("cursor", MyBB.browser == "ie" ? "hand" : "pointer");
});
}
},

expandCollapse: function(element)
{
var controls = element.attr("id").replace("_img", ""),
expandedItem = $("#"+controls+"_e");

if(expandedItem.length)
{
var expState = + !expandedItem.is(":hidden"),
expcolImg = element.attr("src"),
expText = [lang.expcol_collapse, lang.expcol_expand];













		if(expandedItem.length && collapsedItem.length)
{
// 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);
}
}
else if(expandedItem.length && !collapsedItem.length)
{
// 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", "[-]")
.attr("title", "[-]");
element.parent().parent('td').removeClass('tcat_collapse_collapsed');
element.parent().parent('.thead').removeClass('thead_collapsed');
this.saveCollapsed(controls);
}
// Collapsing
else
{
expandedItem.toggle("fast");
element.attr("src", element.attr("src").replace(/collapse\.(gif|jpg|jpeg|bmp|png)$/i, "collapse_collapsed.$1"))
.attr("alt", "[+]")
.attr("title", "[+]");
element.parent().parent('td').addClass('tcat_collapse_collapsed');
element.parent().parent('.thead').addClass('thead_collapsed');
this.saveCollapsed(controls, 1);
}

			expandedItem.toggle("fast", this.expCallback(controls, expState));

element.attr({
"alt": expText[expState],
"title": expText[expState],
"src": expState ? expcolImg.replace('collapse.', 'collapse_collapsed.') : expcolImg.replace('collapse_collapsed.', 'collapse.')
})
.parents(':eq(1)').toggleClass(element.parents(':eq(1)').hasClass('thead') ? 'thead_collapsed' : 'tcat_collapse_collapsed');
this.saveCollapsed(controls, expState);

































		}
return true;

		}
return true;

	},


	},


	saveCollapsed: function(id, add)
{
var saved = [];

	saveCollapsed: function(id, add)
{
var saved = [];

Zeile 665Zeile 719
			newCollapsed[newCollapsed.length] = id;
}
Cookie.set('collapsed', newCollapsed.join("|"));

			newCollapsed[newCollapsed.length] = id;
}
Cookie.set('collapsed', newCollapsed.join("|"));

 
	},

// Dummy callback function to override by theme developers
expCallback: function(id, state)
{
//console.log("id:"+id+" state:"+state);

	}
};


	}
};