Version 3.3.4
This commit is contained in:
1 parent
78706903a2
commit
fb6b5baabc
2206 files changed
+409828
-382984
No files matched your search
+423
-96
@@ -289,7 +289,7 @@ IPBoard.prototype.delegate = {
|
||||
{
|
||||
document.observe('click', function(e){
|
||||
|
||||
if( Event.isLeftClick(e) || Prototype.Browser.IE ) // IE doesnt provide isLeftClick info for click event
|
||||
if( Event.isLeftClick(e) || Prototype.Browser.IE || ipb.vars['is_touch'] ) // IE doesnt provide isLeftClick info for click event, touch devices either
|
||||
{
|
||||
var elem = null;
|
||||
var handler = null;
|
||||
@@ -520,11 +520,17 @@ IPBoard.prototype.Autocomplete = Class.create( {
|
||||
},
|
||||
|
||||
eventKeypress: function(e)
|
||||
{
|
||||
{
|
||||
if( ![ Event.KEY_TAB, Event.KEY_UP, Event.KEY_DOWN, Event.KEY_LEFT, Event.KEY_RIGHT, Event.KEY_RETURN ].include( e.keyCode ) ){
|
||||
return; // Not interested in anything else
|
||||
}
|
||||
|
||||
// & and up key are both keycode 38. So if we're holding shift, ignore this
|
||||
console.log( e.shiftKey );
|
||||
if ( e.shiftKey === true ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if( $( this.list ).visible() )
|
||||
{
|
||||
switch( e.keyCode )
|
||||
@@ -586,6 +592,7 @@ IPBoard.prototype.Autocomplete = Class.create( {
|
||||
else
|
||||
{
|
||||
$( this.obj ).value = '';
|
||||
$( this.obj ).focus();
|
||||
}
|
||||
|
||||
$( this.obj ).value = $F( this.obj ) + value + ', ';
|
||||
@@ -593,12 +600,24 @@ IPBoard.prototype.Autocomplete = Class.create( {
|
||||
else
|
||||
{
|
||||
$( this.obj ).value = value;
|
||||
|
||||
var effect = new Effect.Fade( $(this.list), { duration: 0.3 } );
|
||||
//this.observing = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$( this.obj ).focus();
|
||||
|
||||
/* Stop cursor jumping back when adding input */
|
||||
if ( Prototype.Browser.IE )
|
||||
{
|
||||
if ( $( this.obj ).createTextRange )
|
||||
{
|
||||
var r = $( this.obj ).createTextRange();
|
||||
r.moveStart("character", $( this.obj ).value.length);
|
||||
r.select();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// MOUSE EVENT
|
||||
@@ -746,7 +765,7 @@ IPBoard.prototype.Autocomplete = Class.create( {
|
||||
|
||||
if( json == false ){
|
||||
// No results yet, get them
|
||||
var request = new Ajax.Request( this.options.url + encodeURIComponent( curValue ),
|
||||
var request = new Ajax.Request( this.options.url + escape( curValue ),
|
||||
{
|
||||
method: 'get',
|
||||
evalJSON: 'force',
|
||||
@@ -866,9 +885,6 @@ IPBoard.prototype.Autocomplete = Class.create( {
|
||||
return;
|
||||
}
|
||||
|
||||
var ul = this.options.templates.wrap.evaluate({ id: this.id + '_ac' });
|
||||
$$('body')[0].insert( {bottom: ul} );
|
||||
|
||||
var finalPos = {};
|
||||
|
||||
// Position menu to keep it on screen
|
||||
@@ -877,15 +893,38 @@ IPBoard.prototype.Autocomplete = Class.create( {
|
||||
var delta = [0,0];
|
||||
var parent = null;
|
||||
var screenScroll = document.viewport.getScrollOffsets();
|
||||
|
||||
var ul = this.options.templates.wrap.evaluate({ id: this.id + '_ac' });
|
||||
|
||||
if (Element.getStyle( $( this.id ), 'position') == 'absolute')
|
||||
/* In a modal pop up? */
|
||||
var test = $( this.id ).up('.popupWrapper');
|
||||
|
||||
if ( ! Object.isUndefined( test ) && test.getStyle('position') == 'fixed' )
|
||||
{
|
||||
parent = element.getOffsetParent();
|
||||
delta = parent.viewportOffset();
|
||||
}
|
||||
$(this.id).up().insert( {bottom: ul} );
|
||||
|
||||
parent = $( this.id ).getOffsetParent();
|
||||
delta = [ parseInt( parent.getStyle('left') / 2 ), parseInt( parent.getStyle('top') / 2 ) ];
|
||||
|
||||
finalPos['left'] = delta[0];
|
||||
finalPos['top'] = delta[1] + screenScroll.top;
|
||||
|
||||
/* Make it appear over */
|
||||
$( this.id + '_ac' ).setStyle( { 'zIndex': 10002 } );
|
||||
}
|
||||
else
|
||||
{
|
||||
$$('body')[0].insert( {bottom: ul} );
|
||||
|
||||
if ( Element.getStyle( $( this.id ), 'position') == 'absolute')
|
||||
{
|
||||
parent = $( this.id ).getOffsetParent();
|
||||
delta = [ parseInt( parent.getStyle('left') ), parseInt( parent.getStyle('top') ) ];
|
||||
}
|
||||
|
||||
finalPos['left'] = sourcePos[0] - delta[0];
|
||||
finalPos['top'] = sourcePos[1] - delta[1] + screenScroll.top;
|
||||
finalPos['left'] = sourcePos[0] - delta[0];
|
||||
finalPos['top'] = sourcePos[1] - delta[1] + screenScroll.top;
|
||||
}
|
||||
|
||||
// Now try and keep it on screen
|
||||
finalPos['top'] = finalPos['top'] + sourceDim.height;
|
||||
@@ -897,7 +936,7 @@ IPBoard.prototype.Autocomplete = Class.create( {
|
||||
},
|
||||
|
||||
updateList: function( json )
|
||||
{
|
||||
{
|
||||
if( !json || !$( this.list ) ){ return; }
|
||||
|
||||
var newitems ='';
|
||||
@@ -955,7 +994,7 @@ Object.extend( RegExp, {
|
||||
// Extend String with URL UTF-8 escape
|
||||
String.prototype.encodeUrl = function()
|
||||
{
|
||||
text = this;
|
||||
var text = this;
|
||||
var regcheck = text.match(/[\x90-\xFF]/g);
|
||||
|
||||
if ( regcheck )
|
||||
@@ -972,7 +1011,7 @@ String.prototype.encodeUrl = function()
|
||||
// Extend String with URL UTF-8 escape - duplicated so it can be changed from above
|
||||
String.prototype.encodeParam = function()
|
||||
{
|
||||
text = this;
|
||||
var text = this;
|
||||
var regcheck = text.match(/[\x90-\xFF]/g);
|
||||
|
||||
if ( regcheck )
|
||||
@@ -998,7 +1037,17 @@ Date.prototype.getDST = function()
|
||||
|
||||
if( difference != 0 )
|
||||
{
|
||||
return (difference == offset) ? 1 : 0;
|
||||
/* Hemisphere check */
|
||||
if ( difference < 0 )
|
||||
{
|
||||
/* Northern */
|
||||
return (difference == offset) ? 1 : 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Southern */
|
||||
return (difference != offset) ? 1 : 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1121,6 +1170,60 @@ Element.addMethods( {
|
||||
$(element).store('clickevent', click);
|
||||
},
|
||||
|
||||
confirmAction: function( element )
|
||||
{
|
||||
var _text = $( element ).readAttribute("data-confirmaction");
|
||||
var _ok = '';
|
||||
|
||||
if ( element.tagName == 'FORM' )
|
||||
{
|
||||
_ok = "$('" + element.id +"').submit()";
|
||||
}
|
||||
else
|
||||
{
|
||||
_ok = 'window.location=\'' + element.readAttribute( 'href' ) + '\'';
|
||||
}
|
||||
|
||||
if ( ! _text || _text == 'true' )
|
||||
{
|
||||
_text = ipb.lang['gbl_confirm_desc'];
|
||||
}
|
||||
|
||||
var _options = { type: 'pane',
|
||||
modal: true,
|
||||
/* Inline JS makes it easier even if it is uglier */
|
||||
initial: '<div><h3>' + ipb.lang['gbl_confirm_text'] + '</h3><div class="ipsPad ipsForm_center"><p>' + _text + '</p><br /><span onclick="ipb.global.popups[\'conact\'].hide()" class="clickable ipsButton_secondary important">' + ipb.lang['gbl_confirm_cancel'] + '</span> <span onclick="' + _ok + '" class="clickable ipsButton_secondary">' + ipb.lang['gbl_confirm_ok'] + '</span></div>',
|
||||
hideAtStart: false,
|
||||
w: '300px',
|
||||
h: 150 };
|
||||
|
||||
if ( element.tagName == 'FORM' )
|
||||
{
|
||||
/* Fire immediately */
|
||||
if ( ! Object.isUndefined( ipb.global.popups['conact'] ) )
|
||||
{
|
||||
ipb.global.popups['conact'].kill();
|
||||
}
|
||||
|
||||
ipb.global.popups['conact'] = new ipb.Popup( 'confirm', _options );
|
||||
}
|
||||
else
|
||||
{
|
||||
$(element).on( 'click', function(e)
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
if ( ! Object.isUndefined( ipb.global.popups['conact'] ) )
|
||||
{
|
||||
ipb.global.popups['conact'].kill();
|
||||
}
|
||||
|
||||
ipb.global.popups['conact'] = new ipb.Popup( 'confirm', _options );
|
||||
|
||||
} );
|
||||
}
|
||||
},
|
||||
|
||||
tooltip: function( element, options ){
|
||||
|
||||
options = Object.extend( {
|
||||
@@ -1137,6 +1240,11 @@ Element.addMethods( {
|
||||
return; // Action has been cancelled
|
||||
}
|
||||
|
||||
// Don't show if empty. Bug #36247 Tooltips
|
||||
if( ! options.content ){
|
||||
return;
|
||||
}
|
||||
|
||||
var id = $(element).identify();
|
||||
|
||||
if( !$( id + '_tooltip' ) ){
|
||||
@@ -1159,7 +1267,7 @@ Element.addMethods( {
|
||||
|
||||
// Detect best position for tooltip
|
||||
if( options.position == 'auto' ){
|
||||
if( position.left + (layout.get('width')/2) - (dims.width/2) < 0 ){
|
||||
if( position.left + (layout.get('padding-box-width')/2) - (dims.width/2) < 0 ){
|
||||
options.position = 'right';
|
||||
} else if( position.left + (dims.width/2) > docDim.get('width') ){
|
||||
options.position = 'left';
|
||||
@@ -1173,16 +1281,16 @@ Element.addMethods( {
|
||||
// And now position
|
||||
switch( options.position ){
|
||||
case 'top':
|
||||
$(tooltip).setStyle( { top: (position.top - dims.height - 1) + 'px', left: (position.left + (layout.get('width')/2) - (dims.width/2)) + 'px' } ).addClassName('top');
|
||||
$(tooltip).setStyle( { top: (position.top - dims.height - 1) + 'px', left: (position.left + (layout.get('padding-box-width')/2) - (dims.width/2)) + 'px' } ).addClassName('top');
|
||||
break;
|
||||
case 'bottom':
|
||||
$(tooltip).setStyle( { top: (position.top + layout.get('height') + 1) + 'px', left: (position.left + (layout.get('width')/2) - (dims.width/2)) + 'px' } ).addClassName('bottom');
|
||||
$(tooltip).setStyle( { top: (position.top + layout.get('padding-box-height') + 1) + 'px', left: (position.left + (layout.get('padding-box-width')/2) - (dims.width/2)) + 'px' } ).addClassName('bottom');
|
||||
break;
|
||||
case 'left':
|
||||
$(tooltip).setStyle( { top: (position.top - (layout.get('height') / 2)) + 'px', left: (position.left - dims.width - 3) + 'px' }).addClassName('left');
|
||||
$(tooltip).setStyle( { top: (position.top - (layout.get('padding-box-height') / 2)) + 'px', left: (position.left - dims.width - 3) + 'px' }).addClassName('left');
|
||||
break;
|
||||
case 'right':
|
||||
$(tooltip).setStyle( { top: (position.top - (layout.get('height') / 2)) + 'px', left: (position.left + layout.get('width') - 3) + 'px' }).addClassName('right');
|
||||
$(tooltip).setStyle( { top: (position.top - (layout.get('padding-box-height') / 2)) + 'px', left: (position.left + layout.get('padding-box-width') - 3) + 'px' }).addClassName('right');
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1332,6 +1440,9 @@ _global.prototype.global = {
|
||||
|
||||
// General click handlers
|
||||
$$("[data-clicklaunch]").invoke('clickLaunch');
|
||||
|
||||
// Confirm action used in delete, etc
|
||||
$$("[data-confirmaction]").invoke('confirmAction');
|
||||
|
||||
// Status updates
|
||||
if( $('statusUpdateGlobal') ){
|
||||
@@ -1339,8 +1450,82 @@ _global.prototype.global = {
|
||||
|
||||
$('statusSubmitGlobal').observe( 'click', ipb.global.statusUpdated );
|
||||
}
|
||||
|
||||
/* Attachments wrapped in URL @link http://community.invisionpower.com/tracker/issue-37113-linking-image-attachments-does-not-work/ */
|
||||
$$('a.resized_img').each( function( elem )
|
||||
{
|
||||
if ( $(elem).previous('a.bbc_url') )
|
||||
{
|
||||
var test = $(elem).previous('a.bbc_url');
|
||||
|
||||
if ( ! test.innerHTML.length )
|
||||
{
|
||||
$(elem).writeAttribute( 'href', test.href );
|
||||
$(elem).writeAttribute( 'rel', test.rel );
|
||||
|
||||
/* Remove empty href */
|
||||
test.remove();
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
/* Tag show more */
|
||||
if ( ! Object.isUndefined( ipb.hoverCard ) && ipb.vars['is_touch'] === false )
|
||||
{
|
||||
var ajaxUrl = ipb.vars['base_url'] + "app=core&module=ajax§ion=tags&do=getTagsAsPopUp&md5check="+ipb.vars['secure_hash'];
|
||||
|
||||
ipb.hoverCardRegister.initialize( 'tagsPopUp', { 'w': '500px', 'delay': 750, 'position': 'auto', 'ajaxUrl': ajaxUrl, 'getId': true, 'setIdParam': 'key' } );
|
||||
}
|
||||
},
|
||||
|
||||
/* Lightbox has been disabled */
|
||||
lightBoxIsOff: function()
|
||||
{
|
||||
$$('span[rel*="lightbox"]').each( function( elem )
|
||||
{
|
||||
if ( ! $(elem).down('a') )
|
||||
{
|
||||
$(elem).down('img').on( 'click', function(e, el) { window.open(el.src) } );
|
||||
}
|
||||
} );
|
||||
},
|
||||
|
||||
/* Stores default values of status share checkboxes */
|
||||
saveSocialShareDefaults: function( elem, e )
|
||||
{
|
||||
var services = {};
|
||||
|
||||
/* Gather elements */
|
||||
$$('._share_x_').each( function(elem){
|
||||
services[ elem.id.replace(/share_x_/, '' ) ] = ( elem.checked ) ? 1 : 0;
|
||||
} );
|
||||
|
||||
new Ajax.Request( ipb.vars['base_url'] + "app=core§ion=sharelinks&module=ajax&do=savePostPrefs&md5check=" + ipb.vars['secure_hash'],
|
||||
{
|
||||
method: 'post',
|
||||
evalJSON: 'force',
|
||||
parameters: services,
|
||||
onSuccess: function(t)
|
||||
{
|
||||
if ( Object.isUndefined( t.responseJSON ) )
|
||||
{
|
||||
alert( ipb.lang['action_failed'] );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ! Object.isUndefined( t.responseJSON['error'] ) )
|
||||
{
|
||||
alert( t.responseJSON['error'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Nothing to do */
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/*!! statusUpdated */
|
||||
/* Updates a status where ever you are on the page. Differs from the ipb.status version slightly */
|
||||
statusUpdated: function(e)
|
||||
{
|
||||
@@ -1351,16 +1536,18 @@ _global.prototype.global = {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Bug #34650: Commented this out so that board index updates
|
||||
// use the ajax function defined below instead of the main status function
|
||||
/* Main status library loaded? */
|
||||
if ( ! Object.isUndefined( ipb.status ) )
|
||||
/*if ( ! Object.isUndefined( ipb.status ) )
|
||||
{
|
||||
return ipb.status.updateSubmit( e, 'statusUpdateGlobal' );
|
||||
}
|
||||
}*/
|
||||
|
||||
var su_Twitter = $('su_TwitterGlobal') && $('su_TwitterGlobal').checked ? 1 : 0;
|
||||
var su_Facebook = $('su_FacebookGlobal') && $('su_FacebookGlobal').checked ? 1 : 0;
|
||||
|
||||
new Ajax.Request( ipb.vars['base_url'] + "app=members§ion=status&module=ajax&do=new&md5check=" + ipb.vars['secure_hash'] + "&return=json",
|
||||
new Ajax.Request( ipb.vars['base_url'] + "app=members§ion=status&module=ajax&do=new&md5check=" + ipb.vars['secure_hash'] + "&skin_group=boards&return=json&smallSpace=1",
|
||||
{
|
||||
method: 'post',
|
||||
evalJSON: 'force',
|
||||
@@ -1384,9 +1571,34 @@ _global.prototype.global = {
|
||||
else
|
||||
{
|
||||
try {
|
||||
if ( $('status_wrapper') )
|
||||
{
|
||||
var memberId = 0;
|
||||
|
||||
try
|
||||
{
|
||||
memberId = $('status_wrapper').readAttribute('data-member');
|
||||
}
|
||||
catch(err){ }
|
||||
|
||||
if ( ! memberId || ( memberId == ipb.vars['member_id'] ) )
|
||||
{
|
||||
$('status_wrapper').innerHTML = t.responseJSON['html'] + $('status_wrapper').innerHTML;
|
||||
|
||||
/* Showing latest only? */
|
||||
if ( ipb.status.myLatest )
|
||||
{
|
||||
if ( $('statusWrap-' + ipb.status.myLatest ) )
|
||||
{
|
||||
$('statusWrap-' + ipb.status.myLatest ).hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ipb.menus.closeAll(e,true);
|
||||
ipb.global.showInlineNotification( ipb.lang['status_updated'] );
|
||||
ipb.menus.closeAll(e);
|
||||
|
||||
}
|
||||
catch(err)
|
||||
{
|
||||
@@ -1397,6 +1609,42 @@ _global.prototype.global = {
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Changes the user's skin
|
||||
*/
|
||||
changeSkin: function(element, e)
|
||||
{
|
||||
Debug.dir( element );
|
||||
var skinId = $(element).readAttribute( 'data-skinid');
|
||||
|
||||
var url = ipb.vars['base_url'] + 'app=core&module=ajax§ion=skin&do=change&skinId=' + skinId + '&secure_key=' + ipb.vars['secure_hash'];
|
||||
Debug.write( url );
|
||||
new Ajax.Request( url,
|
||||
{
|
||||
method: 'get',
|
||||
onSuccess: function(t)
|
||||
{
|
||||
/*
|
||||
* Get an error?
|
||||
*/
|
||||
if( t.responseJSON['status'] == 'ok' )
|
||||
{
|
||||
window.location = window.location;
|
||||
window.location.reload(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
ipb.global.errorDialogue( ipb.lang['ajax_failure'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
Event.stop(e);
|
||||
return false;
|
||||
},
|
||||
|
||||
/**
|
||||
* Displays the inbox drop down in header
|
||||
*/
|
||||
@@ -1634,41 +1882,34 @@ _global.prototype.global = {
|
||||
return;
|
||||
}
|
||||
|
||||
var elem = Event.findElement(e);
|
||||
/* If we don't have the template bit.. */
|
||||
if ( ! $('inline_login_form') )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Event.stop(e);
|
||||
var url = ipb.vars['base_url'] + "app=core&module=ajax&section=templates&secure_key=" + ipb.vars['secure_hash'] + "&template_group=login&template_bit=inlineLogInForm&lang_module=login&lang_app=core";
|
||||
|
||||
if( ipb.global.loginRedirect )
|
||||
{
|
||||
window.location = ipb.global.loginRedirect;
|
||||
return;
|
||||
}
|
||||
|
||||
// Fetch template
|
||||
new Ajax.Request( url.replace(/&/g, '&'),
|
||||
{
|
||||
method: 'get',
|
||||
evalJSON: 'force',
|
||||
onSuccess: function(t)
|
||||
{
|
||||
if ( t.responseJSON['error'] )
|
||||
{
|
||||
window.location = elem.readAttribute('href');
|
||||
}
|
||||
else
|
||||
{
|
||||
new ipb.Popup( 'sign_in_popup', { type: 'pane',
|
||||
initial: t.responseJSON['html'],
|
||||
hideAtStart: false,
|
||||
hideClose: false,
|
||||
defer: false,
|
||||
modal: true,
|
||||
w: '600px' },
|
||||
{
|
||||
afterShow: function(pop){
|
||||
try {
|
||||
$('ips_username').focus();
|
||||
} catch(err){}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
new ipb.Popup( 'sign_in_popup', { type: 'pane',
|
||||
initial: $('inline_login_form').show(),
|
||||
hideAtStart: false,
|
||||
hideClose: false,
|
||||
defer: false,
|
||||
modal: true,
|
||||
w: '600px' },
|
||||
{
|
||||
afterShow: function(pop){
|
||||
try {
|
||||
$('ips_username').focus();
|
||||
} catch(err){}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
forumMarkRead: function(elem, e)
|
||||
@@ -1844,19 +2085,35 @@ _global.prototype.global = {
|
||||
activateMainMenu: function()
|
||||
{
|
||||
if( $("nav_other_apps") && $("community_app_menu") ){
|
||||
var start = totalW = $("nav_other_apps").getWidth();
|
||||
/* Image is 0 width inside hidden div, so we have to compensate manually...hardcoded for our useropts image 17px + 3px margin */
|
||||
/* Note that we are grabbing width of more menu tab, instead of 'margin-box-width' which accounts for margin. Cannot grab this
|
||||
value while the tab is hidden and we don't want to loop a second time unnecessarily to readjust after showing the menu */
|
||||
var start = totalW = $("nav_other_apps").getWidth() + 20;
|
||||
var menuWidth = $("community_app_menu").getWidth();
|
||||
|
||||
$("community_app_menu").select("li:not(#nav_other_apps)").each( function(elem){
|
||||
|
||||
/* Add up the widths of any menu items we won't be moving to the more menu */
|
||||
$("community_app_menu").select("li.skip_moremenu").each( function(elem){
|
||||
totalW += $(elem).measure('margin-box-width');
|
||||
|
||||
});
|
||||
|
||||
$("community_app_menu").select("li:not(#nav_other_apps,.submenu_li)").each( function(elem){
|
||||
/* These tabs should not be moved to the more menu */
|
||||
if( $(elem).hasClassName('skip_moremenu') )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
totalW += $(elem).measure('margin-box-width');
|
||||
|
||||
if( totalW >= menuWidth )
|
||||
{
|
||||
if( !$("more_apps_menucontent") ){
|
||||
$$("body")[0].insert("<ul class='ipbmenu_content' id='more_apps_menucontent'></ul>");
|
||||
$$("body")[0].insert("<div id='more_apps_menucontent' class='submenu_container clearfix boxShadow'><div class='left'><ul class='submenu_links' id='more_apps_menucontentul'></ul></div></div>");
|
||||
}
|
||||
|
||||
$(elem).addClassName('submenu_li').removeClassName('left');
|
||||
|
||||
$("more_apps_menucontent").insert( elem ); // Move item to menu
|
||||
$("more_apps_menucontentul").insert( elem ); // Move item to menu
|
||||
}
|
||||
});
|
||||
|
||||
@@ -2015,6 +2272,11 @@ _global.prototype.global = {
|
||||
{
|
||||
if( !$('search_options') && !$('search_options_menucontent') ){ return; }
|
||||
|
||||
if ( ! $('main_search') )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$('main_search').defaultize( ipb.lang['search_default_value'] );
|
||||
|
||||
// This removes the text for IE7
|
||||
@@ -2169,7 +2431,7 @@ _global.prototype.global = {
|
||||
sid = ipb.topic.start_id;
|
||||
}
|
||||
|
||||
window.location = ipb.vars['base_url'] + 'app=core&module=modcp§ion=editmember&do=setAsSpammer&member_id=' + memberId + '&t=' + tid + '&f=' + fid + '&st=' + sid + '&auth_key=' + ipb.vars['secure_hash'];
|
||||
window.location = ipb.vars['base_url'] + 'app=core&module=modcp&do=setAsSpammer&member_id=' + memberId + '&t=' + tid + '&f=' + fid + '&st=' + sid + '&auth_key=' + ipb.vars['secure_hash'];
|
||||
return false;
|
||||
}
|
||||
else
|
||||
@@ -2194,7 +2456,7 @@ _global.prototype.global = {
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
var returnvalue = $(button).up().down('.bbc_spoiler_wrapper').down('.bbc_spoiler_content').toggle();
|
||||
var returnvalue = $(button).up('.bbc_spoiler').down('.bbc_spoiler_wrapper').down('.bbc_spoiler_content').toggle();
|
||||
|
||||
if( returnvalue.visible() ){
|
||||
$(button).value = ipb.lang['spoiler_hide'];
|
||||
@@ -2518,7 +2780,7 @@ _global.prototype.global = {
|
||||
ipb.global.popups['likeMore'].kill();
|
||||
}
|
||||
|
||||
var popid = 'setfave_' + ipb.like.relid;
|
||||
var popid = 'setfave_' + id;
|
||||
var _url = ipb.vars['base_url'] + '&app=core&module=ajax§ion=reputation&do=more&secure_key=' + ipb.vars['secure_hash'] + '&f_app=' + app + '&f_type=' + type + '&f_id=' + id;
|
||||
Debug.write( _url );
|
||||
|
||||
@@ -2652,7 +2914,10 @@ _global.prototype.global = {
|
||||
}*/
|
||||
|
||||
if( ipb.vars['seo_enabled'] ){
|
||||
if( options.url.charAt( options.url.length - 1 ) == '=' ){
|
||||
// Bug #33897
|
||||
// Pagination broken in search results due to use of query string, so here we'll check
|
||||
// whether QS's are used with regex, and use old style pagination if that's the case.
|
||||
if( options.url.charAt( options.url.length - 1 ) == '=' || options.url.match(/(&|&)[\d\w]+=/gi) ){
|
||||
// Bug #31029
|
||||
// SEO URLs ending with = don't work. Use non-seo urls in this case.
|
||||
var url = options.url + '&' + options.stKey + '=' + pageNum;
|
||||
@@ -2990,14 +3255,15 @@ _menu.prototype.menus = {
|
||||
ipb.menus.closeAll( e );
|
||||
},
|
||||
|
||||
closeAll: function( except )
|
||||
{
|
||||
/*!! Close all menus (forceClose ignores clicked in menu area check) */
|
||||
closeAll: function( except, forceClose )
|
||||
{
|
||||
ipb.menus.registered.each( function(menu, force){
|
||||
|
||||
if( typeof( except ) == 'undefined' || ( except && menu.key != except ) )
|
||||
{
|
||||
try{
|
||||
if( !(except.target && $(except.target).descendantOf( menu.value.target )) && except != menu.key ){
|
||||
if( forceClose || ( !(except.target && $(except.target).descendantOf( menu.value.target )) && except != menu.key ) ){
|
||||
menu.value.doClose();
|
||||
}
|
||||
} catch(err) {
|
||||
@@ -3027,6 +3293,7 @@ _menu.prototype.Menu = Class.create({
|
||||
|
||||
this.options = Object.extend( {
|
||||
eventType: 'click',
|
||||
closeOnMouseout: false,
|
||||
stopClose: true,
|
||||
offsetX: 0,
|
||||
offsetY: 0
|
||||
@@ -3037,6 +3304,19 @@ _menu.prototype.Menu = Class.create({
|
||||
$( source ).observe( 'mouseover', this.eventOver.bindAsEventListener( this ) );
|
||||
$( target ).observe( 'click', this.targetClick.bindAsEventListener( this ) );
|
||||
|
||||
/* Close on mouse out too? */
|
||||
if( this.options['closeOnMouseout'] !== false )
|
||||
{
|
||||
$( this.options['closeOnMouseout'] ).observe( 'mouseleave', this.mouseOutClose.bindAsEventListener( this ) );
|
||||
}
|
||||
|
||||
/* Have an alt? */
|
||||
if ( $( $( source ).id + '_alt' ) )
|
||||
{
|
||||
$( $( source ).id + '_alt' ).observe( 'click', this.eventClick.bindAsEventListener( this, $( $( source ).id + '_alt' ) ) );
|
||||
$( $( source ).id + '_alt' ).observe( 'mouseover', this.eventOver.bindAsEventListener( this ) );
|
||||
}
|
||||
|
||||
// Set up target
|
||||
$( this.target ).setStyle( 'position: absolute;' ).hide().setStyle( { zIndex: 9999 } );
|
||||
$( this.target ).descendants().each( function( elem ){
|
||||
@@ -3051,13 +3331,18 @@ _menu.prototype.Menu = Class.create({
|
||||
}
|
||||
},
|
||||
|
||||
doOpen: function()
|
||||
doOpen: function(elem)
|
||||
{
|
||||
Debug.write("Menu open");
|
||||
var pos = {};
|
||||
|
||||
var _source = ( this.options.positionSource ) ? this.options.positionSource : this.source;
|
||||
|
||||
if ( ! Object.isUndefined( elem ) )
|
||||
{
|
||||
var _source = elem;
|
||||
}
|
||||
|
||||
// This is the positioned offset of the source element
|
||||
var sourcePos = $( _source ).positionedOffset();
|
||||
|
||||
@@ -3157,7 +3442,7 @@ _menu.prototype.Menu = Class.create({
|
||||
/* it would go off the top of the screen (i.e. < 0px ) Bug #18270 */
|
||||
if(
|
||||
( ( ( realSourcePos.top + sourceDim.height ) + menuDim.height ) > screenDim.height ) &&
|
||||
( sourcePos.top - menuDim.height + this.options.offsetY ) > 0 )
|
||||
( _sourcePos.top - menuDim.height + this.options.offsetY ) > 0 )
|
||||
{
|
||||
pos.top = _sourcePos.top - menuDim.height + this.options.offsetY;
|
||||
} else {
|
||||
@@ -3212,7 +3497,7 @@ _menu.prototype.Menu = Class.create({
|
||||
}.bind(this) } );
|
||||
|
||||
// Set key event so we can close on ESC
|
||||
Event.observe( document, 'keypress', this.checkKeyPress.bindAsEventListener( this ) );
|
||||
Event.observe( document, 'keypress', this.checkKeyPress.bindAsEventListener( this ) );
|
||||
},
|
||||
|
||||
checkKeyPress: function( e )
|
||||
@@ -3225,6 +3510,11 @@ _menu.prototype.Menu = Class.create({
|
||||
}
|
||||
},
|
||||
|
||||
mouseOutClose: function()
|
||||
{
|
||||
this.doClose();
|
||||
},
|
||||
|
||||
doClose: function()
|
||||
{
|
||||
new Effect.Fade( $( this.target ), { duration: 0.3, afterFinish: function(e){
|
||||
@@ -3264,33 +3554,49 @@ _menu.prototype.Menu = Class.create({
|
||||
}*/
|
||||
},
|
||||
|
||||
eventClick: function(e)
|
||||
eventClick: function(e, elem)
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
if( $( this.target ).visible() ){
|
||||
if( this.options['eventType'] == 'click' )
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
if( Object.isFunction( this.callbacks['beforeClose'] ) )
|
||||
{
|
||||
this.callbacks['beforeClose']( this );
|
||||
if( $( this.target ).visible() ){
|
||||
|
||||
if( Object.isFunction( this.callbacks['beforeClose'] ) )
|
||||
{
|
||||
this.callbacks['beforeClose']( this );
|
||||
}
|
||||
|
||||
this.doClose();
|
||||
} else {
|
||||
ipb.menus.closeAll( $(this.source).id );
|
||||
|
||||
if( Object.isFunction( this.callbacks['beforeOpen'] ) )
|
||||
{
|
||||
this.callbacks['beforeOpen']( this );
|
||||
}
|
||||
|
||||
this.doOpen(elem);
|
||||
}
|
||||
|
||||
this.doClose();
|
||||
} else {
|
||||
ipb.menus.closeAll( $(this.source).id );
|
||||
|
||||
if( Object.isFunction( this.callbacks['beforeOpen'] ) )
|
||||
{
|
||||
this.callbacks['beforeOpen']( this );
|
||||
}
|
||||
|
||||
this.doOpen();
|
||||
}
|
||||
},
|
||||
|
||||
eventOver: function()
|
||||
{
|
||||
|
||||
if( this.options['eventType'] == 'mouseover' )
|
||||
{
|
||||
if( !$( this.target ).visible() ){
|
||||
|
||||
ipb.menus.closeAll( $(this.source).id );
|
||||
|
||||
if( Object.isFunction( this.callbacks['beforeOpen'] ) )
|
||||
{
|
||||
this.callbacks['beforeOpen']( this );
|
||||
}
|
||||
|
||||
this.doOpen();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -3677,7 +3983,7 @@ _popup.prototype.Popup = Class.create({
|
||||
Event.stopObserving( $( this.wrapper ), 'mouseout', this._tmpEvent );
|
||||
this._tmpEvent = null;
|
||||
}
|
||||
|
||||
|
||||
if( this.options.modal == false ){
|
||||
new Effect.Fade( $( this.wrapper ), { duration: 0.3, afterFinish: function(){
|
||||
if( Object.isFunction( this.callbacks['afterHide'] ) )
|
||||
@@ -3710,11 +4016,11 @@ _popup.prototype.Popup = Class.create({
|
||||
|
||||
handleDocumentClick: function(e)
|
||||
{
|
||||
Debug.write( Event.element(e).id);
|
||||
Debug.write( 'document click: ' + Event.element(e).id);
|
||||
|
||||
if( !Event.element(e).descendantOf( this.wrapper ) && ( this.options.attach && ( Event.element(e).id != this.options.attach.target.id ) ) )
|
||||
{
|
||||
this._hide(e);
|
||||
this.hide(e);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -4064,6 +4370,13 @@ _popup.prototype.Popup = Class.create({
|
||||
var window_s = document.viewport.getDimensions();
|
||||
var window_offsets = document.viewport.getScrollOffsets();
|
||||
|
||||
if( ipb.vars['is_touch'] ){
|
||||
// #35826: On some skins, webkit will handle the document viewport sizes incorrectly.
|
||||
// To try and protect against this, we'll use the actual screen size for these
|
||||
// calculations.
|
||||
window_s = { width: window.innerWidth, height: window.innerHeight };
|
||||
}
|
||||
|
||||
if( isRTL )
|
||||
{
|
||||
var center = { right: ((window_s['width'] - elem_s['width']) / 2),
|
||||
@@ -4192,6 +4505,20 @@ _ticker.prototype.Ticker = Class.create({
|
||||
}
|
||||
});
|
||||
|
||||
function warningPopup( elem, id )
|
||||
{
|
||||
var _url = ipb.vars['base_url'] + '&app=members&module=ajax&secure_key=' + ipb.vars['secure_hash'] + '§ion=warnings&id=' + id;
|
||||
new ipb.Popup( 'warning' + id, {
|
||||
type: 'balloon',
|
||||
stem: true,
|
||||
attach: { target: elem, position: 'auto' },
|
||||
hideAtStart: false,
|
||||
ajaxURL: _url,
|
||||
w: '600px',
|
||||
h: 800
|
||||
});
|
||||
}
|
||||
|
||||
ipb = new IPBoard;
|
||||
ipb.global.init();
|
||||
ipb.menus.init();
|
||||
Reference in new issue
Block a user