Vergleich jscripts/general.js - 1.8.9 - 1.8.20

  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.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).change();
}
});

				}
});
});

				}
});
});

Zeile 38Zeile 55
			mark_read_imgs.each(function()
{
var element = $(this);

			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()
{
MyBB.markForumRead(this);

				element.click(function()
{
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 66Zeile 83

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


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

			});
}
},











			});
}

$("a.referralLink").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)
{
if(!options) options = { fadeDuration: 250, zIndex: (typeof modal_zindex !== 'undefined' ? modal_zindex : 9999) }
if(root != true)
url = rootpath + url;

	popupWindow: function(url, options, root)
{
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.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].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 105Zeile 166
							name: "action",
type: "hidden",
value: "do_deleteevent"

							name: "action",
type: "hidden",
value: "do_deleteevent"

						})
);

if(my_post_key)
{
form.append(
$("<input />",
{
name: "my_post_key",
type: "hidden",
value: my_post_key
})
);
}

						})
);

if(my_post_key)
{
form.append(
$("<input />",
{
name: "my_post_key",
type: "hidden",
value: my_post_key
})
);
}


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


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

							type: "hidden",

							type: "hidden",

							value: eid
})
);

							value: eid
})
);

Zeile 153Zeile 214
		}

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

		}

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+"&modal=1");

		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, {
buttons:[
{title: yes_confirm, value: true},
{title: no_confirm, value: false}
],
submit: function(e,v,m,f){

	{
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)
{
var form = $("<form />",

				if(v == true)
{
var form = $("<form />",

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 />",
{

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

							})
);
}





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

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

Zeile 209Zeile 280

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


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

				}
}
});

return false;
},

whoPosted: function(tid)

				}
}
});

return false;
},

whoPosted: function(tid, sortby)

	{

	{

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


































		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)

	},

markForumRead: function(event)

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 409Zeile 513
		});

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 477Zeile 603
	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 495Zeile 621
			expires: expire,
path: cookiePath,
domain: cookieDomain,

			expires: expire,
path: cookiePath,
domain: cookieDomain,

			secure: cookieSecureFlag,

			secure: cookieSecureFlag == true,

		};


		};


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

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

	},

unset: function(name)

	},

unset: function(name)

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

			path: cookiePath,
domain: cookieDomain
};

		return $.removeCookie(name, options);

		return Cookies.remove(name, options);

	}
};


	}
};