Vergleich jscripts/general.js - 1.8.0 - 1.8.30

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

				}
});
});

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

				}
});
});

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

		if(initialfocus.length > 0)
{
initialfocus.focus();

		if(initialfocus.length)
{
initialfocus.trigger('focus');

		}

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

		}

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

			{

			{

				var element = $(this);

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





				element.css("cursor", "pointer");
if(element.attr("title"))
{
element.attr("title", element.attr("title") + " - ");
}
element.attr("title", element.attr("title") + lang.click_mark_read);

				element.css("cursor", "pointer");
if(element.attr("title"))
{
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: 5 }

		if(!options) options = { fadeDuration: 250, zIndex: (typeof modal_zindex !== 'undefined' ? modal_zindex : 9999) }

		if(root != true)
url = rootpath + url;


		if(root != true)
url = rootpath + url;


Zeile 80Zeile 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 104Zeile 173
						{
name: "action",
type: "hidden",

						{
name: "action",
type: "hidden",

							value: "do_editevent"

							value: "do_deleteevent"

						})
);


						})
);


Zeile 139Zeile 208
					);

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

					);

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

					form.submit();

					form.trigger('submit');

				}
}
});

				}
}
});

Zeile 152Zeile 221
			var pid = 0;
}


			var pid = 0;
}


		MyBB.popupWindow("/reputation.php?action=add&uid="+uid+"&pid="+pid);

		MyBB.popupWindow("/reputation.php?action=add&uid="+uid+"&pid="+pid+"&modal=1");

	},

viewNotes: function(uid)
{

	},

viewNotes: function(uid)
{

		MyBB.popupWindow("/member.php?action=viewnotes&uid="+uid);

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

	},


	},


	deleteReputation: function(uid, rid)

	getIP: function(pid)

	{

	{

		$.prompt(delete_reputation_confirm, {
buttons:[
{title: yes_confirm, value: true},
{title: no_confirm, value: false}
],











		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)
{
MyBB.prompt(delete_reputation_confirm, {
buttons:[
{title: yes_confirm, value: true},
{title: no_confirm, value: false}
],

			submit: function(e,v,m,f){
if(v == true)
{

			submit: function(e,v,m,f){
if(v == true)
{

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

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


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


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

							name: "rid",
type: "hidden",
value: rid

							name: "rid",
type: "hidden",
value: rid

						})
);


						})
);


					if(my_post_key)
{
form.append(

					if(my_post_key)
{
form.append(

Zeile 197Zeile 276
							})
);
}

							})
);
}





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

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

Zeile 208Zeile 287
					);

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

					);

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

					form.submit();

					form.trigger('submit');

				}

				}

			}

			}

		});

		});





		return false;
},

		return false;
},


whoPosted: function(tid)


whoPosted: function(tid, sortby)

	{

	{

		MyBB.popupWindow("/misc.php?action=whoposted&tid="+tid);


































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

	},

markForumRead: function(event)
{
var element = $(event);

		if(!element)

		if(!element.length)

		{
return false;
}

		{
return false;
}

Zeile 249Zeile 361
	{
if(request == 1)
{

	{
if(request == 1)
{

			if($("#mark_read_"+fid).hasClass('subforum_minion'))


			var markreadfid = $("#mark_read_"+fid);
if(markreadfid.hasClass('subforum_minion'))

			{

			{

				$("#mark_read_"+fid).removeClass('subforum_minion').addClass('subforum_minioff');

				markreadfid.removeClass('subforum_minion').addClass('subforum_minioff');

			}
else
{

			}
else
{

				$("#mark_read_"+fid).removeClass('forum_on').addClass('forum_off');

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

			}

			}

			$("#mark_read_"+fid).css("cursor", "default").attr("title", lang.no_new_posts);

			markreadfid.css("cursor", "default").attr("title", lang.no_new_posts);

		}
},


		}
},


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

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

		if(!form)

		if(!form.length)

		{
return false;
}

		{
return false;
}

		form.submit();

		form.trigger('submit');

	},

changeTheme: function()
{
form = $("#theme_select");

	},

changeTheme: function()
{
form = $("#theme_select");

		if(!form)

		if(!form.length)

		{
return false;
}

		{
return false;
}

		form.submit();

		form.trigger('submit');

	},

detectDSTChange: function(timezone_with_dst)

	},

detectDSTChange: function(timezone_with_dst)

Zeile 332Zeile 445
						);

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

						);

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

						form.submit();

						form.trigger('submit');

	                }
}
});

	                }
}
});

Zeile 341Zeile 454

dismissPMNotice: function(bburl)
{


dismissPMNotice: function(bburl)
{

		var pm_notice = $("#content").find("#pm_notice");
if(!pm_notice)

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

		{
return false;
}

		{
return false;
}

Zeile 373Zeile 486

$.ajax({
type: "POST",


$.ajax({
type: "POST",

			url: "reputation.php",

			url: "reputation.php?modal=1",

			data: datastring,
dataType: "html",
success: function(data) {

			data: datastring,
dataType: "html",
success: function(data) {

Zeile 381Zeile 494
				$(".modal_"+uid+"_"+pid).fadeOut('slow', function() {
$(".modal_"+uid+"_"+pid).html(data);
$(".modal_"+uid+"_"+pid).fadeIn('slow');

				$(".modal_"+uid+"_"+pid).fadeOut('slow', function() {
$(".modal_"+uid+"_"+pid).html(data);
$(".modal_"+uid+"_"+pid).fadeIn('slow');

 
					$(".modal").fadeIn('slow');

				});
},
error: function(){

				});
},
error: function(){

Zeile 393Zeile 507

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 407Zeile 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 475Zeile 611
	get: function(name)
{
name = cookiePrefix + name;

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

		return $.cookie(name);

		return Cookies.get(name);

	},

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

	},

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

		if(!expires) 

		if(!expires)

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

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

Zeile 492Zeile 628
		options = {
expires: expire,
path: cookiePath,

		options = {
expires: expire,
path: cookiePath,

			domain: cookieDomain
};

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



			domain: cookieDomain,
secure: cookieSecureFlag == true,
};

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


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

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

Zeile 506Zeile 643
			path: cookiePath,
domain: cookieDomain
};

			path: cookiePath,
domain: cookieDomain
};

		return $.removeCookie(name, options);

		return Cookies.remove(name, options);

	}
};

var expandables = {

	}
};

var expandables = {



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

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

Zeile 520Zeile 656
			expanders.each(function()
{
var expander = $(this);

			expanders.each(function()
{
var expander = $(this);

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

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

				{
return;

				{
return;

				}











				}

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

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





				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)

	expandCollapse: function(element)



















	{

	{

		element = $(e);


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





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

if(expandedItem.length && collapsedItem.length)

		if(expandedItem.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.png", "collapse.png"))
.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.png", "collapse_collapsed.png"))
.attr("alt", "[+]")
.attr("title", "[+]");
element.parent().parent('td').addClass('tcat_collapse_collapsed');
element.parent().parent('.thead').addClass('thead_collapsed');
this.saveCollapsed(controls, 1);
}

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

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

Zeile 604Zeile 700
		var saved = [];
var newCollapsed = [];
var collapsed = Cookie.get('collapsed');

		var saved = [];
var newCollapsed = [];
var collapsed = Cookie.get('collapsed');





		if(collapsed)
{
saved = collapsed.split("|");

		if(collapsed)
{
saved = collapsed.split("|");

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

	}

	}

};


};


/* Lang this! */
var lang = {

/* Lang this! */
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();