"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Upload/jscripts/general.js" between
mybb_1819.zip and mybb_1820.zip

About: MyBB is a multilingual, standards-compliant and free forum (discussion board) software.

general.js  (mybb_1819):general.js  (mybb_1820)
skipping to change at line 20 skipping to change at line 20
}, },
pageLoaded: function() pageLoaded: function()
{ {
expandables.init(); expandables.init();
/* Create the Check All feature */ /* Create the Check All feature */
$('[name="allbox"]').each(function(key, value) { $('[name="allbox"]').each(function(key, value) {
var allbox = this; var allbox = this;
var checked = $(this).is(':checked'); var checked = $(this).is(':checked');
var checkboxes = $(this).closest('form').find(':checkbox' var checkboxes = $(this).closest('form').find(':checkbox'
); ).not('[name="allbox"]');
checkboxes.change(function() { checkboxes.change(function() {
if(checked && !$(this).prop('checked')) if(checked && !$(this).prop('checked'))
{ {
checked = false; checked = false;
$(allbox).prop('checked', checked); $(allbox).trigger('change', ['item']);
} }
}); });
$(this).change(function() {
$(this).on('change', function(event, origin) {
checked = $(this).is(':checked'); checked = $(this).is(':checked');
checkboxes.prop('checked', checked);
if(typeof(origin) == "undefined")
{
checkboxes.each(function() {
if(checked != $(this).is(':checke
d'))
{
$(this).prop('checked', c
hecked).change();
}
});
}
}); });
}); });
// Initialise "initial focus" field if we have one // Initialise "initial focus" field if we have one
var initialfocus = $(".initial_focus"); var initialfocus = $(".initial_focus");
if(initialfocus.length) if(initialfocus.length)
{ {
initialfocus.focus(); initialfocus.focus();
} }
skipping to change at line 77 skipping to change at line 88
if(initialfocus.length > 0) if(initialfocus.length > 0)
{ {
initialfocus.focus(); initialfocus.focus();
} }
}); });
$(document).on($.modal.CLOSE, function(event, modal) { $(document).on($.modal.CLOSE, function(event, modal) {
$("body").css("overflow", "auto"); $("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) popupWindow: function(url, options, root)
{ {
if(!options) options = { fadeDuration: 250, zIndex: (typeof modal _zindex !== 'undefined' ? modal_zindex : 9999) } if(!options) options = { fadeDuration: 250, zIndex: (typeof modal _zindex !== 'undefined' ? modal_zindex : 9999) }
if(root != true) if(root != true)
url = rootpath + url; 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).re
place('__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) == fa
lse)
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:[ buttons:[
{title: yes_confirm, value: true}, {title: yes_confirm, value: true},
{title: no_confirm, value: false} {title: no_confirm, value: false}
], ],
submit: function(e,v,m,f){ submit: function(e,v,m,f){
if(v == true) if(v == true)
{ {
var form = $("<form />", var form = $("<form />",
{ {
method: " post", method: " post",
skipping to change at line 181 skipping to change at line 236
MyBB.popupWindow("/moderation.php?action=getip&pid="+pid+"&modal= 1"); MyBB.popupWindow("/moderation.php?action=getip&pid="+pid+"&modal= 1");
}, },
getPMIP: function(pmid) getPMIP: function(pmid)
{ {
MyBB.popupWindow("/moderation.php?action=getpmip&pmid="+pmid+"&mo dal=1"); MyBB.popupWindow("/moderation.php?action=getpmip&pmid="+pmid+"&mo dal=1");
}, },
deleteReputation: function(uid, rid) deleteReputation: function(uid, rid)
{ {
$.prompt(delete_reputation_confirm, { MyBB.prompt(delete_reputation_confirm, {
buttons:[ buttons:[
{title: yes_confirm, value: true}, {title: yes_confirm, value: true},
{title: no_confirm, value: false} {title: no_confirm, value: false}
], ],
submit: function(e,v,m,f){ submit: function(e,v,m,f){
if(v == true) if(v == true)
{ {
var form = $("<form />", var form = $("<form />",
{ {
method: "post", method: "post",
skipping to change at line 447 skipping to change at line 502
error: function(){ error: function(){
alert(lang.unknown_error); alert(lang.unknown_error);
} }
}); });
return false; return false;
}, },
deleteAnnouncement: function(data) deleteAnnouncement: function(data)
{ {
$.prompt(announcement_quickdelete_confirm, { MyBB.prompt(announcement_quickdelete_confirm, {
buttons:[ buttons:[
{title: yes_confirm, value: true}, {title: yes_confirm, value: true},
{title: no_confirm, value: false} {title: no_confirm, value: false}
], ],
submit: function(e,v,m,f){ submit: function(e,v,m,f){
if(v == true) if(v == true)
{ {
window.location=data.href.replace('action =delete_announcement','action=do_delete_announcement'); 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
select2: function() select2: function()
{ {
if(typeof $.fn.select2 !== "undefined") if(typeof $.fn.select2 !== "undefined")
{ {
$.extend($.fn.select2.defaults, { $.extend($.fn.select2.defaults, {
formatMatches: function (matches) { formatMatches: function (matches) {
if(matches == 1) if(matches == 1)
{ {
return lang.select2_match; return lang.select2_match;
 End of changes. 10 change blocks. 
8 lines changed or deleted 92 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)