Version 3.4.9

This commit is contained in:
Neo committed 2025-12-19 00:44:43 -08:00
1 parent c603205a25
commit f9e857d255
920 files changed
+28189 -6840

No files matched your search

+22 -11
View File
@@ -1673,16 +1673,19 @@ _global.prototype.global = {
if ( collapsed )
{
var wrapper = new Element( 'div', {'class': '_quote-wrapper' } ).update( el.innerHTML );
el.update( wrapper );
el.down('div._quote-wrapper').hide();
el.insert( new Element( 'p', { 'class': '___x clickable' } ).update( ipb.lang['quote_expand'] ) );
el.down('p.___x').on( 'click', function( e, elem )
// Hide this element
el.hide();
// Create a new blockquote that will be our 'clickable' area
var bq = new Element( 'blockquote', { 'class': 'ipsBlockquote built clickable' } ).update( ipb.lang['quote_expand'] );
bq.on( 'click', function( e, elem )
{
elem.up('blockquote').down('div._quote-wrapper').show();
elem.hide();
el.show();
bq.remove();
} );
el.insert( { before: bq } );
}
}
} );
@@ -4241,15 +4244,23 @@ _popup.prototype.Popup = Class.create({
update: function( content, evalScript )
{
var scripts = [];
if( Object.isElement( content ) ){
this.inner.insert( { bottom: content } );
} else {
// Get the scripts we'll need to execute
scripts = content.extractScripts();
content = content.stripScripts();
this.inner.update( content );
}
// Should this popup eval scripts? Default is YES
if( Object.isUndefined( evalScript ) || evalScript != false ){
this.inner.innerHTML.evalScripts();
if( ( Object.isUndefined( evalScript ) || evalScript != false ) && this.options.evalScript ){
scripts.map( function (script) {
eval( script );
});
}
},
+1 -1
View File
@@ -701,7 +701,7 @@ _attach.prototype.attachSWF = Class.create({
*/
_buildBox: function( file )
{
temp = this.template.gsub(/\[id\]/, this.id + '_' + file.index).gsub(/\[name\]/, file.name);
temp = this.template.gsub(/\[id\]/, this.id + '_' + file.index).gsub(/\[name\]/, file.name.replace( /</g, '-' ).replace( />/g, '-' ) );
this.boxes[ file.index ] = 'ali_' + this.id + '_' + file.index;
$( this.wrapper ).insert( temp );
+396
View File
@@ -0,0 +1,396 @@
/************************************************/
/* IPB3 Javascript */
/* -------------------------------------------- */
/* ips.calendar.js - Calendar code */
/* (c) IPS, Inc 2008 */
/* -------------------------------------------- */
/* Author: Rikki Tissier */
/************************************************/
var _cal = window.IPBoard;
_cal.prototype.calendar = {
inSection: '',
popup: null,
yearLimit: 6,
startYear: 0,
/* ------------------------------ */
/**
* Constructor
*/
init: function()
{
Debug.write("Initializing ips.calendar.js");
document.observe("dom:loaded", function(){
ipb.calendar.initEvents();
if( $('calendar_table') )
{
if( ipb.vars['is_touch'] === false )
{
$('calendar_table').on( "click", 'td:not(.blank):not(.col_cal_date)', ipb.calendar.selectCell );
$('calendar_table').on( "dblclick", 'td:not(.blank):not(.col_cal_date)', ipb.calendar.viewDay );
}
else
{
// http://community.invisionpower.com/resources/bugs.html/_/ip-calendar/viewing-calendar-events-from-ios-device-r41517
//$('calendar_table').on( "click", 'td:not(.blank):not(.col_cal_date)', ipb.calendar.viewDay );
}
}
if( $('view_month') ){
$('view_month').observe("click", ipb.calendar.viewMonth);
}
if( $('view_week') ){
$('view_week').observe("click", ipb.calendar.viewWeek);
}
if( $('view_day') ){
$('view_day').observe("click", ipb.calendar.viewDay);
}
ipb.delegate.register("#month_jump", ipb.calendar.showJump);
});
},
showJump: function(e, elem)
{
Event.stop(e);
if( ipb.calendar.popup ){
ipb.calendar.popup.show();
} else {
ipb.calendar.popup = new ipb.Popup( 'month_jump', { type: 'balloon',
initial: $('mini_calendar_jump').show(),
hideAtStart: false,
stem: true,
hideClose: true,
attach: { target: elem, position: 'auto' },
w: '240px'
} );
}
},
selectCell: function(e, elem)
{
$$("#calendar_table td.selected").invoke("removeClassName", "selected").invoke("writeAttribute", "unselectable", "off");
$( elem ).writeAttribute("unselectable", "on");
$( elem ).addClassName('selected');
if ( $('ips_addEventButton') )
{
url = $('ips_addEventButton').readAttribute('href');
url = url.replace( /\/add(.*)$/, '/add' );
bits = elem.id.split('-');
y = bits[1];
m = bits[2];
d = bits[3];
if ( y && m && d )
{
url = url + ipb.vars['seo_params']['varBlock']
+ 'd' + ipb.vars['seo_params']['varSep'] + d + ipb.vars['seo_params']['varSep']
+ 'm' + ipb.vars['seo_params']['varSep'] + m + ipb.vars['seo_params']['varSep']
+ 'y' + ipb.vars['seo_params']['varSep'] + y;
$('ips_addEventButton').writeAttribute('href', url);
}
}
},
addCalEvent: function(e, elem)
{
window.location = ipb.vars['add_event_url'];
},
viewDay: function(e)
{
if( ipb.calendar.currentView == 'day' )
{
return;
}
var active = ipb.calendar.findActive();
if( !active ){ return; }
Event.stop(e);
if( active.hasAttribute("data-furl") )
{
window.location = active.readAttribute("data-furl");
}
else
{
var date = $(active).id.match(/(\d+)/gi);
window.location = ipb.vars['day_url'] + "&y=" + date[0] + "&m=" + date[1] + "&d=" + date[2];
}
},
viewWeek: function(e)
{
if( ipb.calendar.currentView == 'day' ){
Event.stop(e);
window.location = ipb.vars['week_url'] + "&week=" + ipb.calendar.weekToJump;
return;
}
var active = ipb.calendar.findActive();
if( !active ){ return; }
// Find the active row
var timestamp = $( active ).up("tr").readAttribute("data-week");
if( !timestamp )
{
return;
}
Event.stop(e);
window.location = ipb.vars['week_url'] + "&week=" + timestamp;
},
viewMonth: function(e)
{
Event.stop(e);
if( ipb.calendar.currentView == 'day' )
{
window.location = ipb.vars['month_url'] + "&y=" + ipb.calendar.currentYear + "&m=" + ipb.calendar.currentMonth;
return;
}
var active = ipb.calendar.findActive();
if( !active ){ return; }
var date = $(active).id.match(/(\d+)/gi);
window.location = ipb.vars['month_url'] + "&y=" + date[0] + "&m=" + date[1];
},
findActive: function()
{
// Find active cell (Selected > Today > First of the month)
var active = ["td.selected","td.today","td:not(.blank):not(.col_cal_date)"].find( function(n){
return $("calendar_table").select( n ).size();
});
if( !active ){ return; }
active = $("calendar_table").select( active )[0];
return active;
},
/* ------------------------------ */
/**
* Set up page events
*/
initEvents: function()
{
ipb.delegate.register('.post_id a[rel~="bookmark"]', ipb.calendar.showLinkToEvent );
if( $('rsvp-button') )
{
$('rsvp-button').observe( 'click', ipb.calendar.rsvpEvent );
}
if( ipb.calendar.inSection == 'form' )
{
if( $('all_day') )
{
if( $F('all_day') == 1 )
{
$$('.time_setting').invoke('hide');
}
$('all_day').observe( 'click', function(e)
{
$$('.time_setting').invoke('toggle');
});
}
if( $('set_enddate') )
{
if( $F('set_enddate') != 1 )
{
$('end_date_fields').hide();
}
$('set_enddate').observe( 'click', function(e)
{
$('end_date_fields').toggle();
if( $F('set_recurfields') == 1 )
{
$('set_recurfields').checked = false;
$('recur_fields').toggle();
}
});
}
if( $('set_recurfields') )
{
if( $F('set_recurfields') != 1 )
{
$('recur_fields').hide();
}
$('set_recurfields').observe( 'click', function(e)
{
$('recur_fields').toggle();
if( $F('set_enddate') != 1 && $F('set_recurfields') == 1 )
{
$('set_enddate').checked = true;
$('end_date_fields').toggle();
}
});
}
var yearRange = new Array();
if( !ipb.calendar.startYear )
{
var _d = new Date();
ipb.calendar.startYear = _d.getFullYear();
}
yearRange.push( ipb.calendar.startYear );
if( ipb.calendar.yearLimit )
{
yearRange.push( ipb.calendar.startYear + ipb.calendar.yearLimit );
}
else
{
yearRange.push( ipb.calendar.startYear + 6 );
}
if( $('start_date') && $('start_date_icon') )
{
$('start_date_icon').observe('click', function(e){
ipb.calendar.calendar_start = new CalendarDateSelect( $('start_date'), { year_range: yearRange, time: false, close_on_click: true, format: 'american' } );
});
}
if( $('end_date') && $('end_date_icon') )
{
$('end_date_icon').observe('click', function(e){
ipb.calendar.calendar_start = new CalendarDateSelect( $('end_date'), { year_range: yearRange, time: false, close_on_click: true, format: 'american' } );
});
}
if( $('e_groups') )
{
$('e_type').observe( 'change', ipb.calendar.hideAdminOptions );
}
if( $('all_groups') )
{
$('all_groups').observe( 'click', ipb.calendar.checkAllGroups );
}
ipb.calendar.hideAdminOptions();
}
},
/* ------------------------------ */
/**
* RSVP for event
*
* @var {event} e The event
*/
rsvpEvent: function(e)
{
Event.stop(e);
var eventid = Event.findElement(e, 'a').rel.replace( /event_id_/, '' );
var url = ipb.vars['base_url'] + 'app=calendar&module=ajax&section=rsvp&do=add&event_id=' + eventid;
new Ajax.Request( url,
{
method: 'post',
evalJSON: 'force',
parameters: {
md5check: ipb.vars['secure_hash']
},
onSuccess: function(t)
{
if( t.responseJSON['error'] )
{
alert(t.responseJSON['error']);
}
else
{
if( $('no_attendees') ){
$('no_attendees').remove();
}
$('rsvp_button').hide();
//$('rsvp-button').each( function(elem) { $(elem).hide(); } );
$('attendee_list').insert( t.responseJSON['html'] );
}
}
}
);
return false;
},
/* ------------------------------ */
/**
* Checks all groups on the add event form
*
* @var {event} e The event
*/
checkAllGroups: function(e)
{
if( $F('all_groups') == '1' )
{
for( var i=0; i< $('e_groups').options.length; i++){
$('e_groups').options[i].selected = true;
}
$('e_groups').disable();
}
else
{
$('e_groups').enable();
for( var i=0; i< $('e_groups').options.length; i++){
$('e_groups').options[i].selected = false;
}
}
},
/* ------------------------------ */
/**
* Hides unused options on the add event form
*
* @var {event} e The event
*/
hideAdminOptions: function(e)
{
if( $('e_type') && $F('e_type') == 'public' )
{
$$('.type_setting').invoke('show');
}
else
{
$$('.type_setting').invoke('hide');
}
},
/* ------------------------------ */
/**
* Shows a prompt allowing user to copy the URL
*
* @var {event} e The event
*/
showLinkToEvent: function(e, elem)
{
_t = prompt( ipb.lang['copy_topic_link'], $( elem ).readAttribute('href') );
Event.stop(e);
}
};
ipb.calendar.init();
+13 -10
View File
@@ -418,9 +418,11 @@ _comments.prototype.comments = {
edit['pid'] = edit['button'].id.replace('edit_comment_', '');
edit['post'] = $( 'comment_id_' + edit['pid'] ).down('.comment_content');
edit['edit_post'] = new Element( 'div', { id: 'comment_id_edit_' + edit['pid'] } );
// Find post content
ipb.comments.commentCache[ edit['pid'] ] = edit['post'].innerHTML;
edit['post'].insert({
after: edit['edit_post']
});
url = ipb.comments.data['ajaxShowEditUrl'] ? ipb.comments.data['ajaxShowEditUrl'] : ipb.vars['base_url'] + 'app=core&module=ajax&section=comments&do=showEdit&parentId=' +ipb.comments.parentId + '&fromApp=' + ipb.comments.data['fromApp'];
@@ -457,7 +459,8 @@ _comments.prototype.comments = {
// Put it in
edit['button'].writeAttribute('_editing', '1');
edit['post'].update( t.responseText );
edit['post'].hide();
edit['edit_post'].show().update( t.responseText );
edit['pid'] = 'e' + edit['pid'];
@@ -532,7 +535,8 @@ _comments.prototype.comments = {
$('edit_comment_' + postid).writeAttribute('_editing', '0');
$( 'comment_id_' + postid ).down('.comment_content').update( t.responseJSON['successString'] );
$('comment_id_' + postid).down('.comment_content').show().update( t.responseJSON['successString'] );
$('comment_id_edit_' + postid).remove();
if ( Prototype.Browser.IE7 )
{
@@ -564,12 +568,11 @@ _comments.prototype.comments = {
var postid = elem.id.replace('edit_cancel_e', '');
if( !postid ){ return; }
if( ipb.comments.commentCache[ postid ] ){
$( 'comment_id_' + postid ).down('.comment_content').update( ipb.comments.commentCache[ postid ] );
$('edit_comment_' + postid).writeAttribute('_editing', '0');
ipb.textEditor.getEditor( 'edit-' + postid ).remove();
}
ipb.textEditor.getEditor( 'edit-' + postid ).remove();
$('comment_id_edit_' + postid).remove();
$('comment_id_' + postid).down('.comment_content').show();
$('edit_comment_' + postid).writeAttribute('_editing', '0');
return;
},
+25 -15
View File
@@ -14,7 +14,6 @@ _topic.prototype.topic = {
inSection: '',
topic_id: 0,
page_id: 0,
postcache: [],
poll: [],
pollPopups: [],
deletePerms: {},
@@ -45,7 +44,7 @@ _topic.prototype.topic = {
{
var pid = window.location.hash.substring(1).replace(/entry/, '');
if ( ipb.topic.redirectPost && pid && $$('a[data-entry-pid]').length && ! $$('a[data-entry-pid="' + pid + '"]').length )
if ( ipb.topic.redirectPost && pid && $$('a[data-entry-pid]').length && ( ! $$('a[data-entry-pid="' + pid + '"]').length && ! $( 'postsDelete_' + pid ) ) )
{
window.location = ipb.vars['board_url'] + '/index.php?app=forums&module=forums&section=findpost&pid=' + pid + '&t=' + ipb.topic.topic_id;
}
@@ -568,9 +567,11 @@ _topic.prototype.topic = {
edit['tid'] = ipb.topic.topic_id;
edit['fid'] = ipb.topic.forum_id;
edit['post'] = $( 'post_id_' + edit['pid'] ).down('.post');
// Find post content
ipb.topic.postcache[ edit['pid'] ] = edit['post'].innerHTML;
edit['edit_post'] = new Element( 'div', { id: 'post_id_edit_' + edit['pid'] } );
edit['post'].insert({
after: edit['edit_post']
});
url = ipb.vars['base_url'] + 'app=forums&module=ajax&section=topics&do=editBoxShow&p=' + edit['pid'] +'&t=' + edit['tid'] +'&f=' + edit['fid'];
@@ -605,7 +606,9 @@ _topic.prototype.topic = {
// Put it in
edit['button'].writeAttribute('_editing', '1');
edit['post'].update( t.responseText );
edit['post'].hide();
edit['edit_post'].show().update( t.responseText );
edit['pid'] = 'e' + edit['pid'];
@@ -893,7 +896,11 @@ _topic.prototype.topic = {
var url = ipb.vars['base_url'] + 'app=forums&module=ajax&section=topics&do=quote&t=' + ipb.topic.topic_id + '&p=' + pid + '&md5check=' + ipb.vars['secure_hash'] + '&isRte=' + ipb.textEditor.getEditor( ipb.topic.fastReplyId ).isRte();
Debug.write( url );
/* Make sure the editor is loaded for EDGE - #926867 */
editor = ipb.textEditor.getEditor( ipb.topic.fastReplyId );
editor.insert( '', 'always' );
new Ajax.Request( url,
{
method: 'get',
@@ -1004,7 +1011,8 @@ _topic.prototype.topic = {
ipb.textEditor.getEditor( 'edit-' + postid ).remove();
$('post_id_' + postid).down('.post').update( t.responseJSON['successString'] );
$('post_id_' + postid).down('.post').show().update( t.responseJSON['successString'] );
$('post_id_edit_' + postid).remove();
prettyPrint();
}
@@ -1030,14 +1038,12 @@ _topic.prototype.topic = {
var postid = elem.id.replace('edit_cancel_e', '');
if( !postid ){ return; }
if( ipb.topic.postcache[ postid ] )
{
ipb.textEditor.getEditor( 'edit-' + postid ).remove();
$('post_id_' + postid).down('.post').update( ipb.topic.postcache[ postid ] );
ipb.editors[ postid ] = null;
$('edit_post_' + postid).writeAttribute('_editing', '0');
}
$('post_id_edit_' + postid).remove();
$('post_id_' + postid).down('.post').show();
ipb.editors[ postid ] = null;
$('edit_post_' + postid).writeAttribute('_editing', '0');
return;
},
@@ -1405,7 +1411,11 @@ _topic.prototype.topic = {
var url = ipb.vars['base_url'] + 'app=forums&module=ajax&section=topics&do=mqquote&t=' + ipb.topic.topic_id;
Debug.write( url );
/* Make sure the editor is loaded for EDGE - #926867 */
editor = ipb.textEditor.getEditor( ipb.topic.fastReplyId );
editor.insert( '', 'always' );
new Ajax.Request( url,
{
method: 'post',