2017-02-16, 11:12 PM
Hi i had issues with general.js such as moderation line,checkbox wasnt working but now everythings work exept
my user_menu dont dropdown.
user_menu dropdown workinggeneral.js)
user_menu not workind but all rest do
Help pls.
i get in inspect element
Uncaught ReferenceError: PopupMenu is not defined
at member.php?action=profile:367
onclick
my user_menu dont dropdown.
user_menu dropdown workinggeneral.js)
var MyBB = {
init: function()
{
this.detectBrowser();
Event.observe(document, "dom:loaded", MyBB.pageLoaded);
return true;
},
pageLoaded: function()
{
MyBB.page_loaded = 1;
expandables.init();
// Initialise check all boxes
checkall = $$('input.checkall');
checkall.each(function(element) {
Event.observe(element, "click", MyBB.checkAll.bindAsEventListener(this));
});
// Initialise "initial focus" field if we have one
initialfocus = $$('input.initial_focus');
if(initialfocus[0])
{
initialfocus[0].focus();
}
if(typeof(use_xmlhttprequest) != "undefined" && use_xmlhttprequest == 1)
{
mark_read_imgs = $$('img.ajax_mark_read');
mark_read_imgs.each(function(element) {
if(element.src.match("off.gif") || element.src.match("offlock.gif") || (element.title && element.title == lang.no_new_posts)) return;
Event.observe(element, "click", MyBB.markForumRead.bindAsEventListener(this));
element.style.cursor = 'pointer';
if(element.title)
{
element.title += " - ";
}
element.title += lang.click_mark_read;
});
}
},
detectBrowser: function()
{
this.useragent = navigator.userAgent.toLowerCase();
this.useragent_version = parseInt(navigator.appVersion);
if(navigator.product == "Gecko" && navigator.vendor.indexOf("Apple Computer") != -1)
{
this.browser = "safari";
}
else if(this.useragent.indexOf("chrome") != -1)
{
this.browser = "chrome";
}
else if(navigator.product == "Gecko")
{
this.browser = "mozilla";
}
else if(this.useragent.indexOf("opera") != -1)
{
this.browser = "opera";
}
else if(this.useragent.indexOf("konqueror") != -1)
{
this.browser = "konqueror";
}
else if(this.useragent.indexOf("msie") != -1)
{
this.browser = "ie";
}
else if(this.useragent.indexOf("compatible") == -1 && this.useragent.indexOf("mozilla") != -1)
{
this.browser = "netscape";
}
if(this.useragent.indexOf("win") != -1)
{
this.os = "win";
}
else if(this.useragent.indexOf("mac") != -1)
{
this.os = "mac";
}
},
popupWindow: function(url, name, width, height)
{
settings = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes";
if(width)
{
settings = settings+",width="+width;
}
if(height)
{
settings = settings+",height="+height;
}
window.open(url, name, settings);
},
deleteEvent: function(eid)
{
confirmReturn = confirm(deleteevent_confirm);
if(confirmReturn == true)
{
var form = new Element("form", { method: "post", action: "calendar.php", style: "display: none;" });
form.insert({ bottom: new Element("input",
{
name: "action",
type: "hidden",
value: "do_editevent"
})
});
if(my_post_key)
{
form.insert({ bottom: new Element("input",
{
name: "my_post_key",
type: "hidden",
value: my_post_key
})
});
}
form.insert({ bottom: new Element("input",
{
name: "eid",
type: "hidden",
value: eid
})
});
form.insert({ bottom: new Element("input",
{
name: "delete",
type: "hidden",
value: 1
})
});
$$("body")[0].insert({ bottom: form });
form.submit();
}
},
checkAll: function(e)
{
var allbox = Event.element(e);
var form = Event.findElement(e, 'FORM');
if(!form)
{
return false;
}
form.getElements().each(function(element) {
if(!element.hasClassName("checkall") && element.type == "checkbox")
{
element.checked = allbox.checked;
}
});
},
reputation: function(uid, pid)
{
if(!pid)
{
var pid = 0;
}
MyBB.popupWindow("reputation.php?action=add&uid="+uid+"&pid="+pid, "reputation", 400, 350)
},
deleteReputation: function(uid, rid)
{
confirmReturn = confirm(delete_reputation_confirm);
if(confirmReturn == true)
{
var form = new Element("form", { method: "post", action: "reputation.php?action=delete", style: "display: none;" });
form.insert({ bottom: new Element("input",
{
name: "rid",
type: "hidden",
value: rid
})
});
if(my_post_key)
{
form.insert({ bottom: new Element("input",
{
name: "my_post_key",
type: "hidden",
value: my_post_key
})
});
}
form.insert({ bottom: new Element("input",
{
name: "uid",
type: "hidden",
value: uid
})
});
$$("body")[0].insert({ bottom: form });
form.submit();
}
},
whoPosted: function(tid)
{
MyBB.popupWindow("misc.php?action=whoposted&tid=" + tid, "whoPosted", 230, 300)
},
hopPage: function(tid, page, pages)
{
if(pages > 1)
{
defpage = page + 1;
}
else
{
defpage = 1;
}
promptres = prompt("Quick Page Jump\nPlease enter a page number between 1 and "+pages+" to jump to.", defpage);
if((promptres != null) && (promptres != "") && (promptres > 1) && (promptres <= pages))
{
window.location = "showthread.php?tid="+tid+"&page"+promotres;
}
},
markForumRead: function(event)
{
element = Event.element(event);
if(!element)
{
return false;
}
var fid = element.id.replace("mark_read_", "");
if(!fid)
{
return false;
}
new Ajax.Request('misc.php?action=markread&fid='+fid+'&ajax=1&my_post_key='+my_post_key, {method: 'get', onComplete: function(request) {MyBB.forumMarkedRead(fid, request); }});
},
forumMarkedRead: function(fid, request)
{
if(request.responseText == 1)
{
$('mark_read_'+fid).src = $('mark_read_'+fid).src.replace("on.gif", "off.gif");
Event.stopObserving($('mark_read_'+fid), "click", MyBB.markForumRead.bindAsEventListener(this));
$('mark_read_'+fid).style.cursor = 'default';
$('mark_read_'+fid).title = lang.no_new_posts;
}
},
detectDSTChange: function(timezone_with_dst)
{
var date = new Date();
var local_offset = date.getTimezoneOffset() / 60;
if(Math.abs(parseInt(timezone_with_dst) + local_offset) == 1)
{
if(use_xmlhttprequest != 1 || !new Ajax.Request('misc.php?action=dstswitch&ajax=1', {method: 'post'})) // Ajax update failed? (No ajax support) Fake it
{
var form = new Element("form", { method: "post", action: "misc.php", style: "display: none;" });
form.insert({ bottom: new Element("input",
{
name: "action",
type: "hidden",
value: "dstswitch"
})
});
$$("body")[0].insert({ bottom: form });
form.submit();
}
}
},
dismissPMNotice: function()
{
if(!$('pm_notice'))
{
return false;
}
if(use_xmlhttprequest != 1)
{
return true;
}
new Ajax.Request('private.php?action=dismiss_notice', {method: 'post', postBody: 'ajax=1&my_post_key='+my_post_key});
Element.remove('pm_notice');
return false;
},
unHTMLchars: function(text)
{
text = text.replace(/</g, "<");
text = text.replace(/>/g, ">");
text = text.replace(/ /g, " ");
text = text.replace(/"/g, "\"");
text = text.replace(/&/g, "&");
return text;
},
HTMLchars: function(text)
{
text = text.replace(new RegExp("&(?!#[0-9]+;)", "g"), "&");
text = text.replace(/</g, "<");
text = text.replace(/>/g, ">");
text = text.replace(/"/g, """);
return text;
},
changeLanguage: function()
{
form = $('lang_select');
if(!form)
{
return false;
}
form.submit();
},
quickLogin: function()
{
if($("quick_login"))
{
var form = new Element("form", { method: "post", action: "member.php" });
form.insert({ bottom: new Element("input",
{
name: "action",
type: "hidden",
value: "do_login"
})
});
if(document.location.href)
{
form.insert({ bottom: new Element("input",
{
name: "url",
type: "hidden",
value: this.HTMLchars(document.location.href)
})
});
}
form.insert({ bottom: new Element("input",
{
name: "quick_login",
type: "hidden",
value: "1"
})
});
form.insert({ bottom: new Element("input",
{
name: "quick_username",
id: "quick_login_username",
type: "text",
value: lang.username,
"class": "textbox",
onfocus: "if(this.value == '"+lang.username+"') { this.value=''; }",
onblur: "if(this.value == '') { this.value='"+lang.username+"'; }"
})
}).insert({ bottom: " " });
form.insert({ bottom: new Element("input",
{
name: "quick_password",
id: "quick_login_password",
type: "password",
value: lang.password,
"class": "textbox",
onfocus: "if(this.value == '"+lang.password+"') { this.value=''; }",
onblur: "if(this.value == '') { this.value='"+lang.password+"'; }"
})
}).insert({ bottom: " " });
form.insert({ bottom: new Element("input",
{
name: "submit",
type: "submit",
value: lang.login,
"class": "button"
})
});
var span = new Element("span", { "class": "remember_me" }).insert({ bottom: new Element("input",
{
name: "quick_remember",
id: "quick_login_remember",
type: "checkbox",
value: "yes",
"class": "checkbox"
})
});
span.innerHTML += "<label for=\"quick_login_remember\"> "+lang.remember_me+"</label>";
form.insert({ bottom: span });
form.innerHTML += lang.lost_password+lang.register_url;
$("quick_login").innerHTML = "";
$("quick_login").insert({ before: form });
$("quick_login_remember").setAttribute("checked", "checked");
$('quick_login_username').focus();
}
return false;
}
};
var Cookie = {
get: function(name)
{
cookies = document.cookie;
name = cookiePrefix+name+"=";
cookiePos = cookies.indexOf(name);
if(cookiePos != -1)
{
cookieStart = cookiePos+name.length;
cookieEnd = cookies.indexOf(";", cookieStart);
if(cookieEnd == -1)
{
cookieEnd = cookies.length;
}
return unescape(cookies.substring(cookieStart, cookieEnd));
}
},
set: function(name, value, expires)
{
if(!expires)
{
expires = "; expires=Wed, 1 Jan 2020 00:00:00 GMT;"
}
else
{
expire = new Date();
expire.setTime(expire.getTime()+(expires*1000));
expires = "; expires="+expire.toGMTString();
}
if(cookieDomain)
{
domain = "; domain="+cookieDomain;
}
else
{
domain = "";
}
if(cookiePath != "")
{
path = cookiePath;
}
else
{
path = "";
}
document.cookie = cookiePrefix+name+"="+escape(value)+"; path="+path+domain+expires;
},
unset: function(name)
{
Cookie.set(name, 0, -1);
}
};
var DomLib = {
// This function is from quirksmode.org
// Modified for use in MyBB
getPageScroll: function()
{
var yScroll;
if(self.pageYOffset)
{
yScroll = self.pageYOffset;
}
else if(document.documentElement && document.documentElement.scrollTop) // Explorer 6 Strict
{
yScroll = document.documentElement.scrollTop;
}
else if(document.body) // all other Explorers
{
yScroll = document.body.scrollTop;
}
arrayPageScroll = new Array('',yScroll);
return arrayPageScroll;
},
// This function is from quirksmode.org
// Modified for use in MyBB
getPageSize: function()
{
var xScroll, yScroll;
if(window.innerHeight && window.scrollMaxY)
{
xScroll = document.body.scrollWidth;
yScroll = window.innerHeight + window.scrollMaxY;
}
else if(document.body.scrollHeight > document.body.offsetHeight) // All but Explorer Mac
{
xScroll = document.body.scrollWidth;
yScroll = document.body.scrollHeight;
}
else // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
{
xScroll = document.body.offsetWidth;
yScroll = document.body.offsetHeight;
}
var windowWidth, windowHeight;
if(self.innerHeight) // all except Explorer
{
windowWidth = self.innerWidth;
windowHeight = self.innerHeight;
}
else if(document.documentElement && document.documentElement.clientHeight) // Explorer 6 Strict Mode
{
windowWidth = document.documentElement.clientWidth;
windowHeight = document.documentElement.clientHeight;
}
else if (document.body) // other Explorers
{
windowWidth = document.body.clientWidth;
windowHeight = document.body.clientHeight;
}
var pageHeight, pageWidth;
// For small pages with total height less then height of the viewport
if(yScroll < windowHeight)
{
pageHeight = windowHeight;
}
else
{
pageHeight = yScroll;
}
// For small pages with total width less then width of the viewport
if(xScroll < windowWidth)
{
pageWidth = windowWidth;
}
else
{
pageWidth = xScroll;
}
var arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight);
return arrayPageSize;
}
};
var expandables = {
init: function()
{
expanders = $$('img.expander');
if(expanders.length > 0)
{
expanders.each(function(expander) {
if(!expander.id)
{
return;
}
Event.observe(expander, "click", this.expandCollapse.bindAsEventListener(this));
if(MyBB.browser == "ie")
{
expander.style.cursor = "hand";
}
else
{
expander.style.cursor = "pointer";
}
expander.controls = expander.id.replace("_img", "");
var row = $(expander.controls);
if(row)
{
Event.observe(row, "dblclick", this.expandCollapse.bindAsEventListener(this));
row.controls = expander.id.replace("_img", "");
}
}.bind(this));
}
},
expandCollapse: function(e)
{
element = Event.element(e)
if(!element || !element.controls)
{
return false;
}
var expandedItem = $(element.controls+"_e");
var collapsedItem = $(element.controls+"_c");
if(expandedItem && collapsedItem)
{
if(expandedItem.style.display == "none")
{
expandedItem.show();
collapsedItem.hide();
this.saveCollapsed(element.controls);
}
else
{
expandedItem.hide();
collapsedItem.show();
this.saveCollapsed(element.controls, 1);
}
}
else if(expandedItem && !collapsedItem)
{
if(expandedItem.style.display == "none")
{
expandedItem.show();
element.src = element.src.replace("collapse_collapsed.gif", "collapse.gif");
element.alt = "[-]";
element.title = "[-]";
this.saveCollapsed(element.controls);
}
else
{
expandedItem.hide();
element.src = element.src.replace("collapse.gif", "collapse_collapsed.gif");
element.alt = "[+]";
element.title = "[+]";
this.saveCollapsed(element.controls, 1);
}
}
return true;
},
saveCollapsed: function(id, add)
{
var saved = new Array();
var newCollapsed = new Array();
var collapsed = Cookie.get("collapsed");
if(collapsed)
{
saved = collapsed.split("|");
saved.each(function(item) {
if(item != id && item != "")
{
newCollapsed[newCollapsed.length] = item;
}
});
}
if(add == 1)
{
newCollapsed[newCollapsed.length] = id;
}
Cookie.set("collapsed", newCollapsed.join("|"));
}
};
var ActivityIndicator = Class.create();
ActivityIndicator.prototype = {
initialize: function(owner, options)
{
var image;
if(options && options.image)
{
image = "<img src=\""+options.image+"\" alt=\"\" />";
}
else
{
image = "";
}
this.height = options.height || 150;
this.width = options.width || 150;
if(owner == "body")
{
arrayPageSize = DomLib.getPageSize();
arrayPageScroll = DomLib.getPageScroll();
var top = arrayPageScroll[1] + ((arrayPageSize[3] - 35 - this.height) / 2);
var left = ((arrayPageSize[0] - 20 - this.width) / 2);
owner = document.getElementsByTagName("body").item(0);
}
else
{
if($(owner))
{
owner = $(owner);
}
var offset = Position.positionedOffset(owner);
left = offset[0];
top = offset[1];
}
this.spinner = document.createElement("div");
this.spinner.style.border = "1px solid #0C587C";
this.spinner.style.background = "#127BAC";
this.spinner.style.color = "#FFF";
this.spinner.style.position = "absolute";
this.spinner.style.zIndex = 1000;
this.spinner.style.textAlign = "center";
this.spinner.style.verticalAlign = "middle";
this.spinner.style.fontSize = "13px";
this.spinner.innerHTML = "<br />"+image+"<br /><br /><strong>"+loading_text+"</strong>";
this.spinner.style.width = this.width + "px";
this.spinner.style.height = this.height + "px";
this.spinner.style.top = top + "px";
this.spinner.style.left = left + "px";
this.spinner.id = "spinner";
owner.insertBefore(this.spinner, owner.firstChild);
},
destroy: function()
{
Element.remove(this.spinner);
}
};
/* Lang this! */
var lang = {
};
/* additions for IE5 compatibility */
if(!Array.prototype.shift) {
Array.prototype.shift = function()
{
firstElement = this[0];
this.reverse();
this.length = Math.max(this.length-1,0);
this.reverse();
return firstElement;
}
}
if(!Array.prototype.unshift) {
Array.prototype.unshift = function()
{
this.reverse();
for(var i=arguments.length-1;i>=0;i--) {
this[this.length]=arguments[i]
}
this.reverse();
return this.length
}
}
if(!Array.prototype.push) {
Array.prototype.push = function()
{
for(var i=0;i<arguments.length;i++){
this[this.length]=arguments[i]
};
return this.length;
}
}
if(!Array.prototype.pop) {
Array.prototype.pop = function() {
lastElement = this[this.length-1];
this.length = Math.max(this.length-1,0);
return lastElement;
}
}
if (!Function.prototype.apply) {
Function.prototype.apply = function(oScope, args) {
var sarg = [];
var rtrn, call;
if (!oScope) oScope = window;
if (!args) args = [];
for (var i = 0; i < args.length; i++) {
sarg[i] = "args["+i+"]";
}
call = "oScope.__applyTemp__(" + sarg.join(",") + ");";
oScope.__applyTemp__ = this;
rtrn = eval(call);
//delete oScope.__applyTemp__;
return rtrn;
}
}
if(!Function.prototype.call) {
Function.prototype.call = function(obj, param) {
obj.base = this;
obj.base(param);
}
}
MyBB.init();
user_menu not workind but all rest do
var MyBB = {
init: function()
{
$(function()
{
MyBB.pageLoaded();
});
return true;
},
pageLoaded: function()
{
expandables.init();
/* 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');
}
});
});
// Initialise "initial focus" field if we have one
var initialfocus = $(".initial_focus");
if(initialfocus.length)
{
initialfocus.focus();
}
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()
{
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);
});
}
if(typeof $.modal !== "undefined")
{
$(document).on($.modal.OPEN, function(event, modal) {
$("body").css("overflow", "hidden");
if(initialfocus.length > 0)
{
initialfocus.focus();
}
});
$(document).on($.modal.CLOSE, function(event, modal) {
$("body").css("overflow", "auto");
});
}
},
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)
{
$(html).appendTo('body').modal(options);
});
},
deleteEvent: function(eid)
{
$.prompt(deleteevent_confirm, {
buttons:[
{title: yes_confirm, value: true},
{title: no_confirm, value: false}
],
submit: function(e,v,m,f){
if(v == true)
{
var form = $("<form />",
{
method: "post",
action: "calendar.php",
style: "display: none;"
});
form.append(
$("<input />",
{
name: "action",
type: "hidden",
value: "do_deleteevent"
})
);
if(my_post_key)
{
form.append(
$("<input />",
{
name: "my_post_key",
type: "hidden",
value: my_post_key
})
);
}
form.append(
$("<input />",
{
name: "eid",
type: "hidden",
value: eid
})
);
form.append(
$("<input />",
{
name: "delete",
type: "hidden",
value: 1
})
);
$("body").append(form);
form.submit();
}
}
});
},
reputation: function(uid, pid)
{
if(!pid)
{
var pid = 0;
}
MyBB.popupWindow("/reputation.php?action=add&uid="+uid+"&pid="+pid+"&modal=1");
},
viewNotes: function(uid)
{
MyBB.popupWindow("/member.php?action=viewnotes&uid="+uid+"&modal=1");
},
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){
if(v == true)
{
var form = $("<form />",
{
method: "post",
action: "reputation.php?action=delete",
style: "display: none;"
});
form.append(
$("<input />",
{
name: "rid",
type: "hidden",
value: rid
})
);
if(my_post_key)
{
form.append(
$("<input />",
{
name: "my_post_key",
type: "hidden",
value: my_post_key
})
);
}
form.append(
$("<input />",
{
name: "uid",
type: "hidden",
value: uid
})
);
$("body").append(form);
form.submit();
}
}
});
return false;
},
whoPosted: function(tid)
{
MyBB.popupWindow("/misc.php?action=whoposted&tid="+tid+"&modal=1");
},
markForumRead: function(event)
{
var element = $(event);
if(!element.length)
{
return false;
}
var fid = element.attr("id").replace("mark_read_", "");
if(!fid)
{
return false;
}
$.ajax(
{
url: 'misc.php?action=markread&fid=' + fid + '&ajax=1&my_post_key=' + my_post_key,
async: true,
success: function (request)
{
MyBB.forumMarkedRead(fid, request);
}
});
},
forumMarkedRead: function(fid, request)
{
if(request == 1)
{
var markreadfid = $("#mark_read_"+fid);
if(markreadfid.hasClass('subforum_minion'))
{
markreadfid.removeClass('subforum_minion').addClass('subforum_minioff');
}
else
{
markreadfid.removeClass('forum_on').addClass('forum_off');
}
markreadfid.css("cursor", "default").attr("title", lang.no_new_posts);
}
},
unHTMLchars: function(text)
{
text = text.replace(/</g, "<");
text = text.replace(/>/g, ">");
text = text.replace(/ /g, " ");
text = text.replace(/"/g, "\"");
text = text.replace(/&/g, "&");
return text;
},
HTMLchars: function(text)
{
text = text.replace(new RegExp("&(?!#[0-9]+;)", "g"), "&");
text = text.replace(/</g, "<");
text = text.replace(/>/g, ">");
text = text.replace(/"/g, """);
return text;
},
changeLanguage: function()
{
form = $("#lang_select");
if(!form.length)
{
return false;
}
form.submit();
},
changeTheme: function()
{
form = $("#theme_select");
if(!form.length)
{
return false;
}
form.submit();
},
detectDSTChange: function(timezone_with_dst)
{
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',
async: true,
method: 'post',
error: function (request)
{
if(use_xmlhttprequest != 1)
{
var form = $("<form />",
{
method: "post",
action: "misc.php",
style: "display: none;"
});
form.append(
$("<input />",
{
name: "action",
type: "hidden",
value: "dstswitch"
})
);
$("body").append(form);
form.submit();
}
}
});
}
},
dismissPMNotice: function(bburl)
{
var pm_notice = $("#pm_notice");
if(!pm_notice.length)
{
return false;
}
if(use_xmlhttprequest != 1)
{
return true;
}
$.ajax(
{
type: 'post',
url: bburl + 'private.php?action=dismiss_notice',
data: { ajax: 1, my_post_key: my_post_key },
async: true
});
pm_notice.remove();
return false;
},
submitReputation: function(uid, pid, del)
{
// Get form, serialize it and send it
var datastring = $(".reputation_"+uid+"_"+pid).serialize();
if(del == 1)
datastring = datastring + '&delete=1';
$.ajax({
type: "POST",
url: "reputation.php?modal=1",
data: datastring,
dataType: "html",
success: function(data) {
// Replace modal HTML (we have to access by class because the modals are appended to the end of the body, and when we get by class we get the last element of that class - which is what we want)
$(".modal_"+uid+"_"+pid).fadeOut('slow', function() {
$(".modal_"+uid+"_"+pid).html(data);
$(".modal_"+uid+"_"+pid).fadeIn('slow');
$(".modal").fadeIn('slow');
});
},
error: function(){
alert(lang.unknown_error);
}
});
return false;
},
deleteAnnouncement: function(data)
{
$.prompt(announcement_quickdelete_confirm, {
buttons:[
{title: yes_confirm, value: true},
{title: no_confirm, value: false}
],
submit: function(e,v,m,f){
if(v == true)
{
window.location=data.href.replace('action=delete_announcement','action=do_delete_announcement');
}
}
});
return false;
},
// Fixes https://github.com/mybb/mybb/issues/1232
select2: function()
{
if(typeof $.fn.select2 !== "undefined")
{
$.extend($.fn.select2.defaults, {
formatMatches: function (matches) {
if(matches == 1)
{
return lang.select2_match;
}
else
{
return lang.select2_matches.replace('{1}',matches);
}
},
formatNoMatches: function () {
return lang.select2_nomatches;
},
formatInputTooShort: function (input, min) {
var n = min - input.length;
if( n == 1)
{
return lang.select2_inputtooshort_single;
}
else
{
return lang.select2_inputtooshort_plural.replace('{1}', n);
}
},
formatInputTooLong: function (input, max) {
var n = input.length - max;
if( n == 1)
{
return lang.select2_inputtoolong_single;
}
else
{
return lang.select2_inputtoolong_plural.replace('{1}', n);
}
},
formatSelectionTooBig: function (limit) {
if( limit == 1)
{
return lang.select2_selectiontoobig_single;
}
else
{
return lang.select2_selectiontoobig_plural.replace('{1}', limit);
}
},
formatLoadMore: function (pageNumber) {
return lang.select2_loadmore;
},
formatSearching: function () {
return lang.select2_searching;
}
});
}
}
};
var Cookie = {
get: function(name)
{
name = cookiePrefix + name;
return $.cookie(name);
},
set: function(name, value, expires)
{
name = cookiePrefix + name;
if(!expires)
{
expires = 315360000; // 10*365*24*60*60 => 10 years
}
expire = new Date();
expire.setTime(expire.getTime()+(expires*1000));
options = {
expires: expire,
path: cookiePath,
domain: cookieDomain,
secure: cookieSecureFlag == true,
};
return $.cookie(name, value, options);
},
unset: function(name)
{
name = cookiePrefix + name;
options = {
path: cookiePath,
domain: cookieDomain
};
return $.removeCookie(name, options);
}
};
var expandables = {
init: function()
{
var expanders = $(".expcolimage .expander");
if(expanders.length)
{
expanders.each(function()
{
var expander = $(this);
if(expander.attr("id") == false)
{
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");
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);
}
}
return true;
},
saveCollapsed: function(id, add)
{
var saved = [];
var newCollapsed = [];
var collapsed = Cookie.get('collapsed');
if(collapsed)
{
saved = collapsed.split("|");
$.each(saved, function(intIndex, objValue)
{
if(objValue != id && objValue != "")
{
newCollapsed[newCollapsed.length] = objValue;
}
});
}
if(add == 1)
{
newCollapsed[newCollapsed.length] = id;
}
Cookie.set('collapsed', newCollapsed.join("|"));
}
};
/* 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();
Help pls.
i get in inspect element
Uncaught ReferenceError: PopupMenu is not defined
at member.php?action=profile:367
onclick