Version 2.3.6

This commit is contained in:
Neo committed 2025-12-19 00:26:08 -08:00
1 parent a3bb603c96
commit 19b38c7c74
764 files changed
+143731 -118164

No files matched your search

@@ -0,0 +1 @@
<html>␍<head><title>Invision Power Board - Bulletin Board System</title></head>␍<body>␍<h1>403: Invision Power Board -> Forbidden</h1>␍<hr>␍You have reached this Page in error, please use␍your back button to return to Invision Board.␍<hr>␍<a href="http://anonym.to/http://www.invisionboard.com/">Invision Power Board</a>␍</body>␍</html>
@@ -0,0 +1,311 @@
//------------------------------------------------------------------------------
// IPS JS: Cell select
// (c) 2005 Invision Power Services, Inc.
// http://www.invisionpower.com
// Matt Mecham (29/11/05)
//------------------------------------------------------------------------------
var _cell_select;
/*-------------------------------------------------------------------------*/
// Initiate object
/*-------------------------------------------------------------------------*/
function cell_select()
{
/**
* CSS: Table cell row OFF
*
* @var INT
*/
this.css_row_off = 'tablerow1';
/**
* CSS: Table cell row ON
*
* @var string
*/
this.css_row_on = 'tablerow2selected';
/**
* String: TR row ID part
*
* @var string
*/
this.row_tr_id = 'arow';
/**
* String: Checkbox ID part
*
* @var string
*/
this.row_checkbox_id = 'acid';
/**
* String: ID name of toggle all box
*
* @var string
*/
this.toggle_all_name = 'cellselect-cball';
/**
* String: ID of toggle all box
*
* @var object
*/
this.toggle_all_id = '';
/**
* String: Flag to see if we have a toggle all box
*
* @var object
*/
this.toggle_all_flag = 0;
/**
* Array: Selected IDs array
*
* @var array
*/
this.selected_ids = new Array();
/**
* Array: Total possible cbs
*
* @var array
*/
this.total_ids = 0;
/**
* Store CSS rows for the original row
*/
this.store_css_row = new Array();
};
/*-------------------------------------------------------------------------*/
// Initiate object
/*-------------------------------------------------------------------------*/
cell_select.prototype.init = function()
{
//----------------------------------
// Check for toggle all box
//----------------------------------
try
{
this.toggle_all_id = document.getElementById( this.toggle_all_name );
this.toggle_all_flag = 1;
this.toggle_all_id.checked = false;
}
catch(error)
{
this.toggle_all_flag = 0;
}
//----------------------------------
// Check checked boxes
//----------------------------------
var checkboxes = document.getElementsByTagName('INPUT');
_cell_select = this;
//----------------------------------
// Sort through and grab links
//----------------------------------
for ( var i = 0 ; i < checkboxes.length ; i++ )
{
try
{
if ( ! checkboxes[i].id )
{
continue;
}
if ( checkboxes[i].getAttribute('type') != 'checkbox' )
{
continue;
}
}
catch(error)
{
continue;
}
var cbid = checkboxes[i].id;
var cbname = cbid.replace( /^(.*)-(\d+)$/, "$1" );
var cbnum = this.get_id_from_text( checkboxes[i].id );
//----------------------------------
// Work with it?
//----------------------------------
if ( cbname == this.row_checkbox_id )
{
if ( checkboxes[i].getAttribute('checked') || checkboxes[i].checked )
{
this.row_change_color( cbnum );
this.selected_ids[ cbnum ] = 1;
this.total_ids++;
}
else
{
this.selected_ids[ cbnum ] = 0;
this.total_ids++;
}
}
}
};
/*-------------------------------------------------------------------------*/
// Toggle all row has been clicked
/*-------------------------------------------------------------------------*/
cell_select.prototype.row_toggle_all = function()
{
//----------------------------------
// Using a toggle all?
//----------------------------------
if ( ! this.toggle_all_flag )
{
return;
}
//----------------------------------
// Grab initial state
//----------------------------------
var checkstate = this.toggle_all_id.checked;
//----------------------------------
// Spread the love
//----------------------------------
var checkboxes = document.getElementsByTagName('INPUT');
//----------------------------------
// Sort through and grab links
//----------------------------------
for ( var i = 0 ; i < checkboxes.length ; i++ )
{
try
{
if ( ! checkboxes[i].id )
{
continue;
}
if ( checkboxes[i].getAttribute('type') != 'checkbox' )
{
continue;
}
}
catch(error)
{
continue;
}
var cbid = checkboxes[i].id;
var cbname = cbid.replace( /^(.*)-(\d+)$/, "$1" );
var cbnum = this.get_id_from_text( checkboxes[i].id );
//----------------------------------
// Work with it?
//----------------------------------
if ( cbname == this.row_checkbox_id )
{
checkboxes[i].checked = checkstate;
this.selected_ids[ cbnum ] = checkstate ? 0 : 1;
this.row_change_color( cbnum );
this.selected_ids[ cbnum ] = checkstate ? 1 : 0;
}
}
};
/*-------------------------------------------------------------------------*/
// A row has been clicked
/*-------------------------------------------------------------------------*/
cell_select.prototype.row_clicked = function( row_id )
{
//----------------------------------
// Change color
//----------------------------------
this.row_change_color( row_id );
//----------------------------------
// Reset flag
//----------------------------------
this.selected_ids[ row_id ] = ( this.selected_ids[ row_id ] ) ? 0 : 1;
//----------------------------------
// Test toggle all box
//----------------------------------
if ( this.toggle_all_flag )
{
var c = 0;
for( var i in this.selected_ids )
{
if ( this.selected_ids[i] )
{
c++;
}
}
//----------------------------------
// Number of 'on' not equal to total?
//----------------------------------
if ( c != this.total_ids )
{
this.toggle_all_id.checked = false;
}
else
{
this.toggle_all_id.checked = true;
}
}
};
/*-------------------------------------------------------------------------*/
// Change color
/*-------------------------------------------------------------------------*/
cell_select.prototype.row_change_color = function( row_id )
{
//----------------------------------
// Get Row TDs...
//----------------------------------
var tds = document.getElementById( this.row_tr_id + '-' + row_id ).getElementsByTagName('TD');
//----------------------------------
// Sort through and grab links
//----------------------------------
var _cell = ( this.store_css_row[ row_id ] ) ? this.store_css_row[ row_id ] : this.css_row_off;
for ( var i = 0 ; i < tds.length ; i++ )
{
tds[i].className = ( this.selected_ids[ row_id ] ) ? _cell : this.css_row_on;
}
};
/*-------------------------------------------------------------------------*/
// Grab ID from string
/*-------------------------------------------------------------------------*/
cell_select.prototype.get_id_from_text = function( id )
{
return id.replace( /.*(?:\-|_)(\d+)/, "$1" );
};
@@ -0,0 +1,910 @@
//------------------------------------------------------------------------------
// IPS JS: Drag Move
// (c) 2005 Invision Power Services, Inc.
// http://www.invisionpower.com
// Matt Mecham (27/07/05)
//------------------------------------------------------------------------------
var drag_move = new dragmove();
/*-------------------------------------------------------------------------*/
// Initiate object
/*-------------------------------------------------------------------------*/
function dragmove()
{
/*
* Portion of ID name without "-{id}" for
* drag handles (object which initiates drag)
*
* @var string
*/
this.var_drag_handle_id_text = null;
/*
* URL to redirect to after change
*
* @var string
*/
this.var_bounce_url = null;
/*
* Portion of ID name without "-{id}" for
* hidden drag elements. These are HTML
* blobs which actually get made visible
* and are dragged.
*
* @var string
*/
this.var_drag_draggable_id_text = null;
/*
* Portion of ID name without "-{id}" for
* drag objects (the actual drag container)
*
* @var string
*/
this.var_drag_object_id_text = null;
/*
* Portion of ID name for the
* row which is altered when the drag is
* started AND a TARGET copy is created
* over it when dragging started
*
* @var string
*/
this.var_original_row_text = null;
/*
* Current dragged ID
*
* @var integer
*/
this.current_id = null;
/*
* Drag in progress
*
* @var integer
*/
this._drag_in_progress = null;
/**
* Target IDs (Populated in DHTML)
* Must be in the format as follows:
* <element id="{this.var_drag_target_id_text}-{id}"></element>
*
* @var array
*/
this.var_target_ids = new Array();
/**
* Parent IDs (Populated in DHTML)
* Must be in the format as follows:
* <element id="{this.var_drag_target_id_text}-{id}"></element>
*
* @var array
*/
this.var_parent_ids = new Array();
/**
* Process parent IDs?
* Turn off to not restrict actions
* based on parents
*
* @var boolean
*/
this.var_parent_process = 1;
/*
* CSS classname of layer that is
* drawn above the row when a move
* is started
*
* @var string
*/
this.var_hide_row_classname = 'dragmove-hide';
/*
* CSS classname of target mouseover
*
* @var string
*/
this.var_target_over_classname = 'tablerow3';
/*
* CSS classname of target mouseout
*
* @var string
*/
this.var_target_out_classname = 'tablerow2';
/*
* ID of target over
* set by mouseover. cleared by mouseout
*
* @var string
*/
this.var_target_over_id = null;
/*
* URL of Ajax request
*
* @var string
*/
this.var_ajax_url = null;
/*
* Array of FAKE TARGETS
*
* @var array
*/
this._TARGETS = new Array();
/*
* Array of FAKE TARGETS DImensions
*
* @var array
*/
this.dims = new Array();
/*
* Array of unmoveable objects
*
* @var array
*/
this.UNMOVEABLES = new Array();
/*
* ID of "Unmoveable" alert object
*
* @var array
*/
this.UNMOVEABLES_id = 'dragmove-unmoveable';
/*
* Array of ALL parent ids for a certain ID
* Traversing up the parent tree
*
* var @array
*/
this.parent_id_tree = new Array();
/*
* Array of ALL children ids for a certain ID
* Traversing up the parent tree
*
* var @array
*/
this.child_id_tree = new Array();
/*
* Array of ALL children ids / parent
* structure
*
* var @array
*/
this.child_id_array = new Array();
};
/*-------------------------------------------------------------------------*/
// Initiate draggable objects
/*-------------------------------------------------------------------------*/
dragmove.prototype.drag_init = function()
{
//----------------------------------
// Get page links...
// Gah.. another safari bug
//----------------------------------
var draghandles = document.getElementsByTagName('*');
//----------------------------------
// Sort through and grab topic links
//----------------------------------
for ( var i = 0 ; i <= draghandles.length ; i++ )
{
try
{
if ( ! draghandles[i].id )
{
continue;
}
}
catch(e)
{
continue;
}
var linkid = draghandles[i].id;
var linkname = linkid.replace( /^(.*)-(\d+)$/, "$1" );
var thisid = this.get_id_from_text( draghandles[i].id );
//----------------------------------
// SET UP DRAG HANDLES
//----------------------------------
if ( linkname == this.var_drag_handle_id_text )
{
var drag_main_obj = document.getElementById( this.var_drag_draggable_id_text + '-' + thisid );
var drag_handle_obj = document.getElementById( this.var_drag_handle_id_text + '-' + thisid );
draghandles[i].style.cursor = "move";
Drag.init( drag_handle_obj, drag_main_obj );
drag_main_obj.onDrag = function(x, y, e) { dragmove_events.prototype.event_drag_ging( x, y, e ); };
drag_main_obj.onDragStart = function(x, y, e) { dragmove_events.prototype.event_drag_start( x, y, e ); };
drag_main_obj.onDragEnd = function(x, y, e) { dragmove_events.prototype.event_drag_end( x, y, e ); };
//----------------------------------
// This has to be after Drag.init
// to replace mouseover handler
//----------------------------------
drag_handle_obj.onmouseover = dragmove_events.prototype.event_mouseover;
drag_handle_obj.onmouseout = dragmove_events.prototype.event_mouseout;
}
}
//----------------------------------
// Create child / parent structure
//----------------------------------
if ( this.var_parent_ids.length )
{
for( var i in this.var_parent_ids )
{
if ( ! this.child_id_array[ this.var_parent_ids[i] ] )
{
this.child_id_array[ this.var_parent_ids[i] ] = new Array();
}
this.child_id_array[ this.var_parent_ids[i] ][ this.child_id_array[ this.var_parent_ids[i] ].length ] = i;
}
}
};
/*-------------------------------------------------------------------------*/
// Add ID to UNMOVEABLES array
/*-------------------------------------------------------------------------*/
dragmove.prototype.get_parents_array = function( root_tid )
{
if ( this.var_parent_ids[ root_tid ] )
{
this.parent_id_tree[ this.parent_id_tree.length ] = this.var_parent_ids[ root_tid ];
this.get_parents_array( this.var_parent_ids[ root_tid ] );
}
};
/*-------------------------------------------------------------------------*/
// Add ID to UNMOVEABLES array
/*-------------------------------------------------------------------------*/
dragmove.prototype.get_children_array = function( root_tid )
{
if ( this.child_id_array[ root_tid ] )
{
for( var i in this.child_id_array[ root_tid ] )
{
this.child_id_tree[ this.child_id_tree.length ] = this.child_id_array[ root_tid ][i];
this.get_children_array( this.child_id_array[ root_tid ][i] );
}
}
};
/*-------------------------------------------------------------------------*/
// Add ID to UNMOVEABLES array
/*-------------------------------------------------------------------------*/
dragmove.prototype.add_id_to_unmoveables = function( tid )
{
this.UNMOVEABLES[ tid ] = tid;
};
/*-------------------------------------------------------------------------*/
// Add ID to target array
/*-------------------------------------------------------------------------*/
dragmove.prototype.add_id_to_targets = function( tid )
{
this.var_target_ids[ tid ] = 1;
};
/*-------------------------------------------------------------------------*/
// Add ID to target array
/*-------------------------------------------------------------------------*/
dragmove.prototype.add_id_to_parents = function( tid, parent_id )
{
this.var_parent_ids[ tid ] = parent_id == 'root' ? 0 : parseInt(parent_id);
};
/*--------------------------------------------*/
// Get TID from ID
/*--------------------------------------------*/
dragmove.prototype.get_id_from_text = function( id )
{
return id.replace( /.*\-(\d+)/, "$1" );
};
/*-------------------------------------------------------------------------*/
// Initiate events object
/*-------------------------------------------------------------------------*/
function dragmove_events()
{
};
/*-------------------------------------------------------------------------*/
// TARGET EVENT: Mouseover
/*-------------------------------------------------------------------------*/
dragmove_events.prototype.event_TARGET_mouseover = function(e)
{
//-------------------------------
// Already over a target
//-------------------------------
if ( drag_move.var_target_over_id )
{
return false;
}
//-------------------------------
// Not dragging?
//-------------------------------
if ( ! drag_move._drag_in_progress )
{
return false;
}
//-------------------------------
// No? Get one then
//-------------------------------
drag_move.var_target_over_id = drag_move.get_id_from_text( this.id );
//-------------------------------
// Can we actually mouse over this?
// Check parents to make sure we're not
// trying to move a child into its existing
// parent. Also don't allow to drop over
// oneself
//-------------------------------
if ( drag_move.var_parent_process && drag_move.current_id )
{
//-------------------------------
// Move into self
//-------------------------------
if ( drag_move.var_target_over_id == drag_move.current_id )
{
//-------------------------------
// Yeah.. so don't do anything
//-------------------------------
drag_move.var_target_over_id = null;
return false;
}
//-------------------------------
// Move into current parent
//-------------------------------
if ( drag_move.var_target_over_id == drag_move.var_parent_ids[ drag_move.current_id ] )
{
//-------------------------------
// Yeah.. so don't do anything
//-------------------------------
drag_move.var_target_over_id = null;
return false;
}
//-------------------------------
// Make sure we're not moving into
// own parents
//-------------------------------
drag_move.child_id_tree = new Array();
drag_move.get_children_array( drag_move.current_id );
// Add in current ID
drag_move.child_id_tree[ drag_move.child_id_tree.length ] = drag_move.current_id;
for( var i in drag_move.child_id_tree )
{
if ( drag_move.var_target_over_id == drag_move.child_id_tree[i] )
{
//-------------------------------
// Yeah.. so don't do anything
//-------------------------------
drag_move.var_target_over_id = null;
return false;
}
}
}
var target_obj = document.getElementById( drag_move.var_original_row_text + '-' + drag_move.var_target_over_id );
//-------------------------------
// Store old classname...
//-------------------------------
drag_move.var_target_out_classname = target_obj.className;
//-------------------------------
// Change classname...
//-------------------------------
target_obj.className = drag_move.var_target_over_classname;
};
/*-------------------------------------------------------------------------*/
// TARGET EVENT: Mouseout
/*-------------------------------------------------------------------------*/
dragmove_events.prototype.event_TARGET_mouseout = function(e)
{
//-------------------------------
// Not touched a target?
//-------------------------------
if ( ! drag_move.var_target_over_id )
{
return false;
}
//-------------------------------
// Not dragging?
//-------------------------------
if ( ! drag_move._drag_in_progress )
{
return false;
}
//-------------------------------
// Get obj
//-------------------------------
var target_obj = document.getElementById( drag_move.var_original_row_text + '-' + drag_move.var_target_over_id );
//-------------------------------
// Store old classname...
//-------------------------------
target_obj.className = drag_move.var_target_out_classname;
//-------------------------------
// Clear target ID
//-------------------------------
drag_move.var_target_over_id = null;
};
/*-------------------------------------------------------------------------*/
// MAIN EVENT: Mouseover
/*-------------------------------------------------------------------------*/
dragmove_events.prototype.event_mouseover = function(e)
{
//-------------------------------
// Already dragging?
//-------------------------------
if ( drag_move.current_id )
{
return false;
}
//-------------------------------
// Unmoveable?
//-------------------------------
var check_for_id = drag_move.UNMOVEABLES[ drag_move.get_id_from_text( this.id ) ];
if ( check_for_id )
{
var alert_object = null;
//-------------------------------
// Attempt to get DIV
//-------------------------------
try
{
alert_object = document.getElementById( drag_move.UNMOVEABLES_id );
}
catch(error)
{
drag_move.UNMOVEABLES_id = null;
}
//-------------------------------
// Yeah, so draw alert and return
//-------------------------------
if ( alert_object )
{
var drag_root_obj = document.getElementById( drag_move.var_drag_handle_id_text + '-' + check_for_id );
alert_object.style.top = ipsclass.get_obj_toppos( drag_root_obj ) - 4 + 'px';
alert_object.style.left = ipsclass.get_obj_leftpos( drag_root_obj ) + 22 + 'px';
alert_object.style.position = 'absolute';
alert_object.style.display = '';
}
return false;
}
//-------------------------------
// No? Get one then
//-------------------------------
drag_move.current_id = drag_move.get_id_from_text( this.id );
};
/*-------------------------------------------------------------------------*/
// MAIN EVENT: Mouseout
/*-------------------------------------------------------------------------*/
dragmove_events.prototype.event_mouseout = function(e)
{
//-------------------------------
// Unmoveable?
//-------------------------------
var check_for_id = drag_move.UNMOVEABLES[ drag_move.get_id_from_text( this.id ) ];
if ( check_for_id )
{
var alert_object = null;
//-------------------------------
// Attempt to get DIV
//-------------------------------
try
{
alert_object = document.getElementById( drag_move.UNMOVEABLES_id );
}
catch(error)
{
drag_move.UNMOVEABLES_id = null;
}
//-------------------------------
// Yeah, so draw alert and return
//-------------------------------
if ( alert_object )
{
alert_object.style.display = 'none';
}
return false;
}
//-------------------------------
// Release current drag ID
// only if a drag is not in
// progress
//-------------------------------
if ( ! drag_move._drag_in_progress )
{
drag_move.current_id = null;
}
};
/*-------------------------------------------------------------------------*/
// DRAG EVENT: DRAG IN PROGRESS (No, not men in dresses)
/*-------------------------------------------------------------------------*/
dragmove_events.prototype.event_drag_ging = function( x, y )
{
if ( is_ie )
{
var bingo = 0;
if ( drag_move.var_target_ids.length )
{
for ( var i in drag_move.var_target_ids )
{
if ( x >= drag_move.dims[ i ]['x1']
&& x <= drag_move.dims[ i ]['x2']
&& y >= drag_move.dims[ i ]['y1']
&& y <= drag_move.dims[ i ]['y2']
)
{
bingo = 1;
this.id = i;
dragmove_events.prototype.event_TARGET_mouseover();
break;
}
}
}
if ( ! bingo )
{
dragmove_events.prototype.event_TARGET_mouseout();
}
}
};
/*-------------------------------------------------------------------------*/
// DRAG START: Gentlemen, start your dresses!
/*-------------------------------------------------------------------------*/
dragmove_events.prototype.event_drag_start = function( x, y )
{
//-------------------------------
// Time for hidden div to make
// a showing...
//-------------------------------
if ( drag_move.current_id )
{
var drag_main_obj = document.getElementById( drag_move.var_drag_draggable_id_text + '-' + drag_move.current_id );
var drag_root_obj = document.getElementById( drag_move.var_drag_object_id_text + '-' + drag_move.current_id );
var drag_orig_obj = document.getElementById( drag_move.var_original_row_text + '-' + drag_move.current_id );
//-------------------------------
// For some reason, Safari wants
// to be relative..
//-------------------------------
if ( is_safari )
{
drag_root_obj.style.position = 'relative';
}
drag_main_obj.style.top = ipsclass.get_obj_toppos( drag_root_obj ) + 'px';
drag_main_obj.style.left = ipsclass.get_obj_leftpos( drag_root_obj ) + 'px';
drag_main_obj.style.position = 'absolute';
drag_main_obj.style.display = 'block';
drag_main_obj.style.zIndex = 1000;
//-------------------------------
// Set up TARGETS
//-------------------------------
if ( drag_move.var_target_ids.length )
{
for ( var i in drag_move.var_target_ids )
{
var main_obj = document.getElementById( drag_move.var_original_row_text + '-' + i );
//-------------------------------
// For some reason, Safari wants
// to be relative..
//-------------------------------
if ( is_safari )
{
main_obj.style.position = 'relative';
}
if ( is_ie )
{
//-------------------------------
// IE has problems with onmouseover
// and zIndex.. couldn't resolve it
// so cheated. slower, hence IE only
// Gen co-ord maps of targets
//-------------------------------
drag_move.dims[ i ] = new Array();
drag_move.dims[ i ]['x1'] = ipsclass.get_obj_leftpos(main_obj);
drag_move.dims[ i ]['x2'] = drag_move.dims[i]['x1'] + main_obj.offsetWidth;
drag_move.dims[ i ]['y1'] = ipsclass.get_obj_toppos(main_obj) - 20;
// We need to leave a gutter at the bottom / top of each target area to allow
// the mouse out event to fire otherwise two targets together will show as one
// big target
drag_move.dims[ i ]['y2'] = drag_move.dims[i]['y1'] + main_obj.offsetHeight - 5;
}
else
{
var targetobj = document.createElement('div');
targetobj.id = drag_move.var_original_row_text + '-TARGET-' + i;
targetobj.style.background = 'transparent';
targetobj.style.position = 'absolute';
targetobj.style.left = ipsclass.get_obj_leftpos(main_obj) + 'px';
targetobj.style.top = ipsclass.get_obj_toppos(main_obj) + 'px';
targetobj.style.width = main_obj.offsetWidth + 'px';
targetobj.style.height = main_obj.offsetHeight + 'px';
targetobj.style.zIndex = 1000;
document.body.appendChild(targetobj);
drag_move._TARGETS[ drag_move._TARGETS.length ] = targetobj;
targetobj.onmouseover = dragmove_events.prototype.event_TARGET_mouseover;
targetobj.onmouseout = dragmove_events.prototype.event_TARGET_mouseout;
}
}
}
//-------------------------------
// Alter original row
//-------------------------------
if ( ! document.getElementById( drag_move.var_original_row_text + '-HIDDEN-' + drag_move.current_id ) )
{
var newdiv = document.createElement('DIV');
newdiv.id = drag_move.var_original_row_text + '-HIDDEN-' + drag_move.current_id;
newdiv.className = (is_ie ) ? drag_move.var_hide_row_classname+'-ie' : drag_move.var_hide_row_classname+'-moz';
newdiv.style.position = 'absolute';
newdiv.style.top = ipsclass.get_obj_toppos( drag_root_obj ) + 'px';
newdiv.style.left = ipsclass.get_obj_leftpos( drag_root_obj ) + 'px';
newdiv.style.width = drag_orig_obj.offsetWidth + 'px';
newdiv.style.height = drag_orig_obj.offsetHeight + 'px';
document.body.appendChild(newdiv);
}
else
{
var newdiv = document.getElementById( drag_move.var_original_row_text + '-HIDDEN-' + drag_move.current_id );
newdiv.style.display = '';
}
//-------------------------------
// Set drag flag
//-------------------------------
drag_move._drag_in_progress = 1;
}
};
/*-------------------------------------------------------------------------*/
// DRAG START: Time to remove the makeup
/*-------------------------------------------------------------------------*/
dragmove_events.prototype.event_drag_end = function( x, y )
{
//-------------------------------
// Hide DIV
//-------------------------------
if ( drag_move.current_id )
{
var drag_main_obj = document.getElementById( drag_move.var_drag_draggable_id_text + '-' + drag_move.current_id );
var drag_root_obj = document.getElementById( drag_move.var_drag_object_id_text + '-' + drag_move.current_id );
var drag_orig_obj = document.getElementById( drag_move.var_original_row_text + '-' + drag_move.current_id );
//-------------------------------
// Hide draggable thing
//-------------------------------
drag_main_obj.style.display = 'none';
//-------------------------------
// Hide row cover
//-------------------------------
if ( document.getElementById( drag_move.var_original_row_text + '-HIDDEN-' + drag_move.current_id ) )
{
document.getElementById( drag_move.var_original_row_text + '-HIDDEN-' + drag_move.current_id ).style.display = 'none';
}
}
//-------------------------------
// CLEAR TARGETS
//-------------------------------
if ( drag_move._TARGETS )
{
for ( var i in drag_move._TARGETS )
{
document.body.removeChild( drag_move._TARGETS[i] );
}
drag_move._TARGETS = new Array();
}
//-------------------------------
// Did we drop on a target?
//-------------------------------
if ( drag_move.var_target_over_id )
{
var new_parent_id = drag_move.var_target_over_id;
var page_id = drag_move.current_id;
/*--------------------------------------------*/
// Main function to do on request
// Must be defined first!!
/*--------------------------------------------*/
do_request_function = function()
{
//----------------------------------
// Ignore unless we're ready to go
//----------------------------------
if ( ! xmlobj.readystate_ready_and_ok() )
{
xmlobj.show_loading( "Move in progress..." );
return;
}
xmlobj.hide_loading();
//----------------------------------
// INIT
//----------------------------------
var returned = xmlobj.xmlhandler.responseText;
if ( returned.match( /<null>(0|-|\=)<\/null>/ ) )
{
alert( "Error occured, move not completed " + returned );
}
else
{
window.location = drag_move.var_bounce_url;
}
};
//----------------------------------
// LOAD XML
//----------------------------------
xmlobj = new ajax_request();
xmlobj.onreadystatechange( do_request_function );
xmlobj.process( drag_move.var_ajax_url +'&pid='+page_id+'&new_parent_id='+new_parent_id );
}
//-------------------------------
// Release current drag ID
//-------------------------------
drag_move.current_id = null;
//-------------------------------
// Set drag flag
//-------------------------------
drag_move._drag_in_progress = null;
//-------------------------------
// Change colour back...
//-------------------------------
if ( drag_move.var_target_over_id )
{
//-------------------------------
// Get obj
//-------------------------------
var target_obj = document.getElementById( drag_move.var_original_row_text + '-' + drag_move.var_target_over_id );
//-------------------------------
// Store old classname...
//-------------------------------
target_obj.className = drag_move.var_target_out_classname;
}
//-------------------------------
// Clear target ID
//-------------------------------
drag_move.var_target_over_id = null;
};
@@ -0,0 +1,402 @@
//------------------------------------------------------------------------------
// IPS JS: Form Functions
// (c) 2005 Invision Power Services, Inc.
// http://www.invisionpower.com
// Matt Mecham (17/10/05)
//------------------------------------------------------------------------------
var _form_functions = null;
/*-------------------------------------------------------------------------*/
// Initiate object
/*-------------------------------------------------------------------------*/
function form_functions()
{
/**
* Name: Form
*
* @var string
*/
this.name_form = 'mainform';
/**
* ID: Form
*
* @var string
*/
this.obj_form = null;
/**
* ID: Form Edited
*
* @var INT
*/
this.form_edited = 1;
/**
* NAME: Edit hold
*
* @var string
*/
this.name_edit_hold = 'page-edit-hold';
/**
* ID: Edit hold
*
* @var string
*/
this.id_edit_hold = null;
/**
* Saved onsubmit handlers
*
* @var string
*/
this.form_onsubmit_saved = null;
/**
* Array of form BUTTON div id names
*
* @var array
*/
this.form_button_divs = new Array();
/**
* Array of form LINK div id names
*
* @var array
*/
this.form_link_divs = new Array();
/**
* Array of form EVAL div id names
*
* @var array
*/
this.form_eval_divs = new Array();
/**
* CSS styles: Button off
*
* @var string
*/
this.css_formbutton_off = 'formbutton-off';
/**
* CSS styles: Button on
*
* @var string
*/
this.css_formbutton_on = 'formbutton-on';
}
/*-------------------------------------------------------------------------*/
// Initiate object
/*-------------------------------------------------------------------------*/
form_functions.prototype.init = function()
{
//----------------------------------
// Get form object
//----------------------------------
this.obj_form = document.getElementById( this.name_form );
//----------------------------------
// Already got a submit handler?
//----------------------------------
if ( this.obj_form.onsubmit )
{
this.form_onsubmit_saved = this.obj_form.onsubmit;
}
//----------------------------------
// Got the hold box?
//----------------------------------
try
{
this.id_edit_hold = document.getElementById( this.name_edit_hold );
}
catch(error)
{
}
//----------------------------------
// Get page links...
// Gah.. another safari bug
//----------------------------------
var inputs = this.obj_form.getElementsByTagName('INPUT');
_form_functions = this;
//----------------------------------
// Sort through and grab links
//----------------------------------
for ( var i = 0 ; i <= inputs.length ; i++ )
{
try
{
if ( inputs[i].type == 'hidden' )
{
continue;
}
}
catch(error)
{
continue;
}
inputs[i].onchange = this.form_event_edited;
}
//----------------------------------
// Form check...
//----------------------------------
this.obj_form.onsubmit = this.form_submit;
};
/*-------------------------------------------------------------------------*/
// Initiate object
/*-------------------------------------------------------------------------*/
form_functions.prototype.add_submit_event = function( div_id, field_name, init_value, onsubmit_value )
{
var div_obj = null;
//----------------------------------
// Make sure we got one...
//----------------------------------
try
{
div_obj = document.getElementById( div_id );
}
catch( error )
{
alert( "Could not initialize field: " + div_id );
return false;
}
//----------------------------------
// Add hidden field to form...
//----------------------------------
if ( field_name )
{
var field = document.createElement('input');
field.type = 'hidden';
field.value = init_value;
field.name = field_name;
field.id = 'field--x--' + div_id;
this.obj_form.appendChild( field );
this.form_button_divs[ div_id ] = onsubmit_value;
}
//----------------------------------
// Add event handlers...
//----------------------------------
div_obj.onmouseover = this.form_button_mouseover;
div_obj.onmouseout = this.form_button_mouseout;
div_obj.onclick = this.form_button_submit;
div_obj.className = this.css_formbutton_off;
};
/*-------------------------------------------------------------------------*/
// Add EVAL event
/*-------------------------------------------------------------------------*/
form_functions.prototype.add_eval_event = function( div_id, eval_code )
{
var div_obj = null;
//----------------------------------
// Make sure we got one...
//----------------------------------
try
{
div_obj = document.getElementById( div_id );
}
catch( error )
{
alert( "Could not initialize event: " + div_id );
return false;
}
this.form_eval_divs[ div_id ] = eval_code;
//----------------------------------
// Add event handlers...
//----------------------------------
div_obj.onmouseover = this.form_button_mouseover;
div_obj.onmouseout = this.form_button_mouseout;
div_obj.onclick = this.form_button_eval_click;
div_obj.className = this.css_formbutton_off;
};
/*-------------------------------------------------------------------------*/
// Add LINK event
/*-------------------------------------------------------------------------*/
form_functions.prototype.add_link_event = function( div_id, link_url )
{
var div_obj = null;
//----------------------------------
// Make sure we got one...
//----------------------------------
try
{
div_obj = document.getElementById( div_id );
}
catch( error )
{
alert( "Could not initialize event: " + div_id );
return false;
}
this.form_link_divs[ div_id ] = link_url;
//----------------------------------
// Add event handlers...
//----------------------------------
div_obj.onmouseover = this.form_button_mouseover;
div_obj.onmouseout = this.form_button_mouseout;
div_obj.onclick = this.form_button_link_click;
div_obj.className = this.css_formbutton_off;
};
/*-------------------------------------------------------------------------*/
// Div EVAL has been clicked...
/*-------------------------------------------------------------------------*/
form_functions.prototype.form_button_eval_click = function()
{
try
{
eval( _form_functions.form_eval_divs[ this.id ] );
}
catch( error )
{
}
};
/*-------------------------------------------------------------------------*/
// Div Link has been clicked...
/*-------------------------------------------------------------------------*/
form_functions.prototype.form_button_link_click = function()
{
try
{
window.location = _form_functions.form_link_divs[ this.id ];
}
catch( error )
{
}
};
/*-------------------------------------------------------------------------*/
// The form has changed...
/*-------------------------------------------------------------------------*/
form_functions.prototype.form_button_submit = function()
{
try
{
var field_obj = document.getElementById( 'field--x--' + this.id );
field_obj.value = _form_functions.form_button_divs[ this.id ];
}
catch( error )
{
}
//----------------------------------
// Submit..
//----------------------------------
_form_functions.form_submit();
_form_functions.obj_form.submit();
};
/*-------------------------------------------------------------------------*/
// The form has changed...
/*-------------------------------------------------------------------------*/
form_functions.prototype.form_button_mouseover = function()
{
this.className = _form_functions.css_formbutton_on;
};
/*-------------------------------------------------------------------------*/
// The form has changed...
/*-------------------------------------------------------------------------*/
form_functions.prototype.form_button_mouseout = function()
{
this.className = _form_functions.css_formbutton_off;
};
/*-------------------------------------------------------------------------*/
// The form has changed...
/*-------------------------------------------------------------------------*/
form_functions.prototype.form_event_edited = function()
{
_form_functions.form_edited = 1;
};
/*-------------------------------------------------------------------------*/
// The form has changed...
/*-------------------------------------------------------------------------*/
form_functions.prototype.form_submit = function()
{
var retval = true;
if ( _form_functions.form_edited )
{
//alert ("Form edited" );
}
if ( _form_functions.form_onsubmit_saved )
{
eval( 'tmpsubmit = ' + _form_functions.form_onsubmit_saved );
retval = tmpsubmit();
}
return retval;
};
/*-------------------------------------------------------------------------*/
// The form has changed...
/*-------------------------------------------------------------------------*/
form_functions.prototype.document_onblur = function()
{
if ( _form_functions.form_edited )
{
//alert ("Form edited" );
}
};
@@ -0,0 +1,184 @@
//------------------------------------------------------------------------------
// IPS JS: Tabby Cat.
// (c) 2005 Invision Power Services, Inc.
// http://www.invisionpower.com
// Matt Mecham (02/11/05)
//------------------------------------------------------------------------------
var _tab_factory;
/*-------------------------------------------------------------------------*/
// Initiate object
/*-------------------------------------------------------------------------*/
function tab_factory()
{
/**
* ID: CSS: Tab off class
*
* @var INT
*/
this.css_tab_off = 'taboff';
/**
* ID: Form
*
* @var string
*/
this.css_tab_on = 'tabon';
/**
* String: Part tab set up
*
* @var string
*/
this.string_tab_id = 'tabtab';
/**
* String: Part tab pane
*
* @var string
*/
this.string_tab_pane = 'tabpane';
/**
* String: Tab array
*
* @var array
*/
this.stored_tabs = new Array();
/**
* String: Panes array
*
* @var array
*/
this.stored_panes = new Array();
}
/*-------------------------------------------------------------------------*/
// Initiate object
function tab_factory_init_tabs() { }
/*-------------------------------------------------------------------------*/
tab_factory.prototype.init_tabs = function()
{
//----------------------------------
// Get page divs...
//----------------------------------
var divs = document.getElementsByTagName('DIV');
var divcount = 0;
_tab_factory = this;
//----------------------------------
// Sort through and grab links
//----------------------------------
for ( var i = 0 ; i <= divs.length ; i++ )
{
try
{
if ( ! divs[i].id )
{
continue;
}
}
catch(error)
{
continue;
}
var divid = divs[i].id;
var divname = divid.replace( /^(.*)-(\d+)$/, "$1" );
var divnum = this.get_id_from_text( divs[i].id );
//----------------------------------
// Work with it?
//----------------------------------
if ( divname == this.string_tab_id )
{
this.stored_tabs[ divnum ] = divs[i];
divs[i].style.cursor = 'pointer';
divs[i].onclick = this.toggle_tabs;
//----------------------------------
// Set correct classes / display
//----------------------------------
this.stored_panes[ divnum ] = document.getElementById( this.string_tab_pane + '-' + divnum );
if ( divcount == 0 )
{
// First tab...
divs[i].className = this.css_tab_on;
divs[i].style.display = 'block';
this.stored_panes[ divnum ].style.display = 'block';
}
else
{
// Second tab
divs[i].className = this.css_tab_off;
divs[i].style.display = 'block';
this.stored_panes[ divnum ].style.display = 'none';
}
divcount++;
}
}
};
/*-------------------------------------------------------------------------*/
// The form has changed...
/*-------------------------------------------------------------------------*/
tab_factory.prototype.toggle_tabs = function(event)
{
//-------------------------------
// No? Get one then
//-------------------------------
var tabid = _tab_factory.get_id_from_text( this.id );
//-------------------------------
// Got it?
//-------------------------------
for ( var i in _tab_factory.stored_tabs )
{
if ( i == tabid )
{
_tab_factory.stored_tabs[ i ].style.display = 'block';
_tab_factory.stored_tabs[ i ].className = _tab_factory.css_tab_on;
_tab_factory.stored_panes[ i ].style.display = 'block';
}
else
{
_tab_factory.stored_tabs[ i ].style.display = 'block';
_tab_factory.stored_tabs[ i ].className = _tab_factory.css_tab_off;
_tab_factory.stored_panes[ i ].style.display = 'none';
}
}
// Stop scrolling to top of the page...
ipsclass.cancel_bubble( event );
return false;
};
/*-------------------------------------------------------------------------*/
// Grab ID from string
/*-------------------------------------------------------------------------*/
tab_factory.prototype.get_id_from_text = function( id )
{
return id.replace( /.*\-(\d+)/, "$1" );
};
@@ -0,0 +1,559 @@
//------------------------------------------------------------------------------
// IPS JS: Content Pages Functions
// (c) 2005 Invision Power Services, Inc.
// http://www.invisionpower.com
// Matt Mecham (27/07/05)
//------------------------------------------------------------------------------
var _this;
/*-------------------------------------------------------------------------*/
// Initiate object
/*-------------------------------------------------------------------------*/
function titleedit()
{
this.var_ajax_url = null;
// Click delay
this.var_click_delay = 1200;
this.var_link_id_text = 'pages-link';
this.var_span_id_text = 'pages-page';
this.var_div_main = 'pages-main';
// Language
this.lang_click_and_hold = null;
// Internal stuff
this._tid_timeout = null;
this._new_text = null;
this._tid_links_init = 0;
this._tid_date = new Array();
this._span_contents = new Array();
this._link_contents = new Array();
/**
* Array of uneditable IDs
*
*/
this.UNEDITABLES = new Array();
/**
* ID part of uneditable alert box
*
*/
this.uneditable_id_text = 'titleedit-uneditable';
// Set up divs
this.div_main_wrap = document.getElementById( this.var_div_main );
/**
* Type of edit box required
* Allowed: text, textarea
*/
this.edit_box = 'text';
this.edit_box_ta_rows = 5;
this.edit_box_ta_cols = 45;
/**
* Allows the use of a secret DIV
* to keep the content updated
* Leave blank to not use
*/
this.var_real_id_text = '';
}
/*-------------------------------------------------------------------------*/
// Initiate object
/*-------------------------------------------------------------------------*/
titleedit.prototype.init = function()
{
//----------------------------------
// Get page links...
// Gah.. another safari bug
//----------------------------------
var pagelinks = document.getElementsByTagName('*');
_this = this;
//----------------------------------
// Sort through and grab topic links
//----------------------------------
for ( var i = 0 ; i <= pagelinks.length ; i++ )
{
try
{
if ( ! pagelinks[i].id )
{
continue;
}
}
catch(e)
{
continue;
}
var linkid = pagelinks[i].id;
var linkname = linkid.replace( /^(.*)-(\d+)$/, "$1" );
var linknum = linkid.replace( /^(.*)-(\d+)$/, "$2" );
if ( linkname == this.var_link_id_text )
{
if ( this.UNEDITABLES[ linknum ] )
{
pagelinks[i].onmouseover = this.title_mouseover;
pagelinks[i].onmouseout = this.title_mouseout;
}
else
{
pagelinks[i].onmousedown = this.title_mousedown;
pagelinks[i].onmouseup = this.title_mouseup;
if ( ! this._tid_links_init )
{
pagelinks[i].title = pagelinks[i].title ? pagelinks[i].title + ". " + this.lang_click_and_hold : this.lang_click_and_hold;
}
}
}
}
this._tid_links_init = 1;
};
/*--------------------------------------------*/
// Mouseover: Show alert
/*--------------------------------------------*/
titleedit.prototype.title_mouseover = function( event )
{
//----------------------------------
// Prevent link loading
//----------------------------------
event = ipsclass.cancel_bubble( event, true );
//----------------------------------
// Get TID
//----------------------------------
var tid = _this.get_tid_from_id( this.id );
//-------------------------------
// Unmoveable?
//-------------------------------
var check_for_id = _this.UNEDITABLES[ tid ];
if ( check_for_id )
{
var alert_object = null;
//-------------------------------
// Attempt to get DIV
//-------------------------------
try
{
alert_object = document.getElementById( _this.uneditable_id_text );
}
catch(error)
{
}
//-------------------------------
// Yeah, so draw alert and return
//-------------------------------
if ( alert_object )
{
var root_obj = document.getElementById( _this.var_link_id_text + '-' + check_for_id );
//-------------------------------
// For some reason, Safari wants
// to be relative..
//-------------------------------
if ( is_safari )
{
root_obj.style.position = 'relative';
}
alert_object.style.top = ipsclass.get_obj_toppos( root_obj ) - 4 + 'px';
alert_object.style.left = ipsclass.get_obj_leftpos( root_obj ) + 5 + root_obj.offsetWidth + 'px';
alert_object.style.position = 'absolute';
alert_object.style.display = '';
}
return false;
}
};
/*--------------------------------------------*/
// Mouseout: Hide alert
/*--------------------------------------------*/
titleedit.prototype.title_mouseout = function( event )
{
//----------------------------------
// Prevent link loading
//----------------------------------
event = ipsclass.cancel_bubble( event, true );
//----------------------------------
// Get TID
//----------------------------------
var tid = _this.get_tid_from_id( this.id );
//-------------------------------
// Unmoveable?
//-------------------------------
var check_for_id = _this.UNEDITABLES[ tid ];
if ( check_for_id )
{
var alert_object = null;
//-------------------------------
// Attempt to get DIV
//-------------------------------
try
{
alert_object = document.getElementById( _this.uneditable_id_text );
}
catch(error)
{
}
//-------------------------------
// Yeah, so draw alert and return
//-------------------------------
if ( alert_object )
{
alert_object.style.display = 'none';
}
return false;
}
};
/*--------------------------------------------*/
// Mousedown, start timer
/*--------------------------------------------*/
titleedit.prototype.title_mousedown = function( event )
{
//----------------------------------
// Prevent link loading
//----------------------------------
event = ipsclass.cancel_bubble( event, true );
//----------------------------------
// Get TID
//----------------------------------
var tid = _this.get_tid_from_id( this.id );
//----------------------------------
// Start...
//----------------------------------
_this._tid_date[ tid ] = _this.get_time_now();
//----------------------------------
// Start loop
//----------------------------------
_this._tid_timeout = setTimeout( "_this.link_event_timer("+tid+")", 5 );
};
/*--------------------------------------------*/
// Event, loop
/*--------------------------------------------*/
titleedit.prototype.link_event_timer = function( tid )
{
//----------------------------------
// Get time now
//----------------------------------
var timenow = this.get_time_now();
//----------------------------------
// Click held for 1.5 s+?
//----------------------------------
if ( timenow > 0 && this._tid_date[tid] > 0 && ( (timenow - this._tid_date[tid] ) > this.var_click_delay ) )
{
//----------------------------------
// Yeah.. wipe tid time and convert
//----------------------------------
this._tid_date[tid] = 0;
this.span_to_input( tid );
return false;
}
//----------------------------------
// Not wiped? loop on!
//----------------------------------
if ( this._tid_date[tid] > 0 )
{
this._tid_timeout = setTimeout( "_this.link_event_timer("+tid+")", 5 );
}
else
{
return false;
}
};
/*--------------------------------------------*/
// Turn topic title into text input
/*--------------------------------------------*/
titleedit.prototype.span_to_input = function( tid )
{
//----------------------------------
// Using fancy js?
//----------------------------------
if ( ! use_enhanced_js )
{
return false;
}
this._span_contents[ tid ] = document.getElementById( this.var_span_id_text + '-' + tid ).innerHTML;
this._link_contents[ tid ] = document.getElementById( this.var_link_id_text + '-' + tid ).innerHTML;
var value = '';
//----------------------------------
// Using hidden div or not?
//----------------------------------
if ( this.var_real_id_text )
{
value = document.getElementById( this.var_real_id_text + '-' + tid ).innerHTML;
}
else
{
value = this._link_contents[ tid ];
}
//----------------------------------
// Show edit box
//----------------------------------
if ( this.edit_box == 'text' )
{
value = value.replace( /"/g, '&quot;');
document.getElementById(this.var_span_id_text + '-' + tid ).innerHTML = '<input id="edit-'+tid+'" class="dny-edit-title" type="text" size="30" onblur="_this.edit_blur(\''+tid+'\')" onkeypress="_this.edit_keypress(event, \''+tid+'\')" value="'+value+'" />';
}
else
{
value = value.replace( /<\/textarea>/g, '&lt;/textarea&gt;');
document.getElementById(this.var_span_id_text + '-' + tid ).innerHTML = '<textarea id="edit-'+tid+'" class="dny-edit-title" cols="'+this.edit_box_ta_cols+'" rows="'+this.edit_box_ta_rows+'" onblur="_this.edit_blur(\''+tid+'\')" onkeypress="_this.edit_keypress(event, \''+tid+'\')">'+value+'</textarea>';
}
document.getElementById( 'edit-' + tid ).focus();
return false;
};
/*--------------------------------------------*/
// Mouseup? Cancel timer to kill the loop
/*--------------------------------------------*/
titleedit.prototype.title_mouseup = function( event )
{
//----------------------------------
// Prevent link loading
//----------------------------------
event = ipsclass.cancel_bubble( event, true );
//----------------------------------
// Get TID
//----------------------------------
var tid = _this.get_tid_from_id( this.id );
//----------------------------------
// Reset timer
//----------------------------------
_this._tid_date[tid] = 0;
};
/*--------------------------------------------*/
// BLUR HANDLER
/*--------------------------------------------*/
titleedit.prototype.edit_blur = function( tid, type )
{
_this._new_text = document.getElementById( 'edit-' + tid ).value;
if ( _this._new_text != "" )
{
_this.title_save( tid, _this._new_text, type );
}
};
/*--------------------------------------------*/
// KEY PRESS HANDLER
/*--------------------------------------------*/
titleedit.prototype.edit_keypress = function( evt, tid, type )
{
evt = (evt) ? evt : window.event;
_this._new_text = document.getElementById( 'edit-' + tid ).value;
// Make sure we're not using a text area
if ( _this.edit_box == 'text' )
{
if ( ( evt.keyCode == 13 || evt.keyCode == 3 ) && _this._new_text != "" )
{
_this.title_save( tid, _this._new_text, type );
}
}
};
/*--------------------------------------------*/
// UDPATE DB
/*--------------------------------------------*/
titleedit.prototype.title_save = function( tid, new_text, type )
{
var donotedit = 0;
if ( new_text == _this._span_contents[ tid ] )
{
donotedit = 1;
}
document.getElementById( _this.var_span_id_text + '-' + tid ).innerHTML = _this._span_contents[ tid ];
document.getElementById( _this.var_link_id_text + '-' + tid ).innerHTML = new_text;
//----------------------------------
// Using hidden div or not?
//----------------------------------
if ( _this.var_real_id_text )
{
document.getElementById( _this.var_real_id_text + '-' + tid ).innerHTML = new_text;
}
//----------------------------------
// Re-check topic links
//----------------------------------
_this.init();
if ( donotedit )
{
return false;
}
var fields = new Array();
//----------------------------------
// Populate fields
//----------------------------------
fields['tid'] = tid;
fields['name'] = new_text;
fields['md5check'] = ipb_md5_check;
/*--------------------------------------------*/
// Main function to do on request
// Must be defined first!!
/*--------------------------------------------*/
do_request_function = function()
{
//----------------------------------
// Ignore unless we're ready to go
//----------------------------------
if ( ! xmlobj.readystate_ready_and_ok() )
{
xmlobj.show_loading("Saving...");
return;
}
xmlobj.hide_loading();
//----------------------------------
// INIT
//----------------------------------
var returned = xmlobj.xmlhandler.responseText;
if ( returned.match( /<null>(0|-|\=)<\/null>/ ) )
{
alert( "Error occured, not saved" );
}
};
//----------------------------------
// LOAD XML
//----------------------------------
xmlobj = new ajax_request();
xmlobj.onreadystatechange( do_request_function );
xmlobj.process( _this.var_ajax_url, 'POST', xmlobj.format_for_post(fields) );
return false;
};
/*--------------------------------------------*/
// Get time now
/*--------------------------------------------*/
titleedit.prototype.get_time_now = function()
{
var mydate = new Date();
return mydate.getTime();
};
/*--------------------------------------------*/
// Get TID from ID
/*--------------------------------------------*/
titleedit.prototype.get_tid_from_id = function( id )
{
return id.replace( /.*\-(\d+)/, "$1" );
};
/*-------------------------------------------------------------------------*/
// Add ID to UNMOVEABLES array
/*-------------------------------------------------------------------------*/
titleedit.prototype.add_id_to_uneditables = function( tid )
{
this.UNEDITABLES[ tid ] = tid;
};
@@ -0,0 +1,299 @@
/*-------------------------------------------------------------------------*/
// Title: Tigra Calendar
// URL: http://www.softcomplex.com/products/tigra_calendar/
// Version: 3.2 (American date format)
// Date: 10/14/2002 (mm/dd/yyyy)
// Note: Permission given to use this script in ANY kind of applications if
// header lines are left unchanged.
// Note: Script consists of two files: calendar?.js and calendar.html
/*-------------------------------------------------------------------------*/
/*--------------------------------------------*/
// if two digit year input dates after this year
// considered 20 century.
/*--------------------------------------------*/
var NUM_CENTYEAR = 30;
/*--------------------------------------------*/
// is time input control required by default
/*--------------------------------------------*/
var BUL_TIMECOMPONENT = false;
/*--------------------------------------------*/
// are year scrolling buttons required by default
/*--------------------------------------------*/
var BUL_YEARSCROLL = true;
var calendars = [];
var RE_NUM = /^\-?\d+$/;
/*--------------------------------------------*/
// Create object
/*--------------------------------------------*/
function calendar_us(obj_target)
{
//-------------------------------
// assigning methods
//-------------------------------
this.gen_date = cal_gen_date2;
this.gen_time = cal_gen_time2;
this.gen_tsmp = cal_gen_tsmp2;
this.prs_date = cal_prs_date2;
this.prs_time = cal_prs_time2;
this.prs_tsmp = cal_prs_tsmp2;
this.popup = cal_popup2;
//-------------------------------
// validate input parameters
//-------------------------------
if (!obj_target)
{
return cal_error("Error calling the calendar: no target control specified");
}
if (obj_target.value == null)
{
return cal_error("Error calling the calendar: parameter specified is not valid target control");
}
this.target = obj_target;
this.time_comp = BUL_TIMECOMPONENT;
this.year_scroll = BUL_YEARSCROLL;
//-------------------------------
// register in global collections
//-------------------------------
this.id = calendars.length;
calendars[this.id] = this;
}
/*--------------------------------------------*/
// POP-UP Calendar
/*--------------------------------------------*/
function cal_popup2 (str_datetime, already_opened)
{
this.dt_current = this.prs_tsmp(str_datetime ? str_datetime : this.target.value);
if (!this.dt_current)
{
return;
}
//-------------------------------
// If already open, don't load path...
//-------------------------------
if ( already_opened )
{
calendar_url = 'calendar.html';
}
else
{
calendar_url = ipb_skin_url + '/calendar.html';
}
var obj_calwindow = window.open(
calendar_url + '?datetime=' + this.dt_current.valueOf()+ '&id=' + this.id,
'Calendar', 'width=200,height='+(this.time_comp ? 215 : 190)+
',status=no,resizable=no,top=200,left=200,dependent=yes,alwaysRaised=yes'
);
obj_calwindow.opener = window;
obj_calwindow.focus();
}
/*--------------------------------------------*/
// timestamp generating function
/*--------------------------------------------*/
function cal_gen_tsmp2 (dt_datetime)
{
return(this.gen_date(dt_datetime) + ' ' + this.gen_time(dt_datetime));
}
/*--------------------------------------------*/
// date generating function
/*--------------------------------------------*/
function cal_gen_date2 (dt_datetime)
{
return (
(dt_datetime.getMonth() < 9 ? '0' : '') + (dt_datetime.getMonth() + 1) + "/"
+ (dt_datetime.getDate() < 10 ? '0' : '') + dt_datetime.getDate() + "/"
+ dt_datetime.getFullYear()
);
}
/*--------------------------------------------*/
// time generating function
/*--------------------------------------------*/
function cal_gen_time2 (dt_datetime)
{
return (
(dt_datetime.getHours() < 10 ? '0' : '') + dt_datetime.getHours() + ":"
+ (dt_datetime.getMinutes() < 10 ? '0' : '') + (dt_datetime.getMinutes()) + ":"
+ (dt_datetime.getSeconds() < 10 ? '0' : '') + (dt_datetime.getSeconds())
);
}
/*--------------------------------------------*/
// timestamp parsing function
/*--------------------------------------------*/
function cal_prs_tsmp2 (str_datetime)
{
//-------------------------------
// if no parameter specified return current timestamp
//-------------------------------
if (!str_datetime)
{
return (new Date());
}
//-------------------------------
// if positive integer treat as milliseconds from epoch
//-------------------------------
if (RE_NUM.exec(str_datetime))
{
return new Date(str_datetime);
}
//-------------------------------
// else treat as date in string format
//-------------------------------
var arr_datetime = str_datetime.split(' ');
return this.prs_time(arr_datetime[1], this.prs_date(arr_datetime[0]));
}
/*--------------------------------------------*/
// date parsing function
/*--------------------------------------------*/
function cal_prs_date2 (str_date)
{
var arr_date = str_date.split('/');
if (arr_date.length != 3) return alert ("Invalid date format: '" + str_date + "'.\nFormat accepted is dd-mm-yyyy.");
if (!arr_date[1]) return alert ("Invalid date format: '" + str_date + "'.\nNo day of month value can be found.");
if (!RE_NUM.exec(arr_date[1])) return alert ("Invalid day of month value: '" + arr_date[1] + "'.\nAllowed values are unsigned integers.");
if (!arr_date[0]) return alert ("Invalid date format: '" + str_date + "'.\nNo month value can be found.");
if (!RE_NUM.exec(arr_date[0])) return alert ("Invalid month value: '" + arr_date[0] + "'.\nAllowed values are unsigned integers.");
if (!arr_date[2]) return alert ("Invalid date format: '" + str_date + "'.\nNo year value can be found.");
if (!RE_NUM.exec(arr_date[2])) return alert ("Invalid year value: '" + arr_date[2] + "'.\nAllowed values are unsigned integers.");
var dt_date = new Date();
dt_date.setDate(1);
if (arr_date[0] < 1 || arr_date[0] > 12) return alert ("Invalid month value: '" + arr_date[0] + "'.\nAllowed range is 01-12.");
dt_date.setMonth(arr_date[0]-1);
if (arr_date[2] < 100) arr_date[2] = Number(arr_date[2]) + (arr_date[2] < NUM_CENTYEAR ? 2000 : 1900);
dt_date.setFullYear(arr_date[2]);
var dt_numdays = new Date(arr_date[2], arr_date[0], 0);
dt_date.setDate(arr_date[1]);
if (dt_date.getMonth() != (arr_date[0]-1)) return alert ("Invalid day of month value: '" + arr_date[1] + "'.\nAllowed range is 01-"+dt_numdays.getDate()+".");
return (dt_date)
}
/*--------------------------------------------*/
// time parsing function
/*--------------------------------------------*/
function cal_prs_time2 (str_time, dt_date)
{
if (!dt_date)
{
return null;
}
var arr_time = String(str_time ? str_time : '').split(':');
if (!arr_time[0])
{
dt_date.setHours(0);
}
else if (RE_NUM.exec(arr_time[0]))
{
if (arr_time[0] < 24)
{
dt_date.setHours(arr_time[0]);
}
else
{
return cal_error ("Invalid hours value: '" + arr_time[0] + "'.\nAllowed range is 00-23.");
}
}
else
{
return cal_error ("Invalid hours value: '" + arr_time[0] + "'.\nAllowed values are unsigned integers.");
}
if (!arr_time[1])
{
dt_date.setMinutes(0);
}
else if (RE_NUM.exec(arr_time[1]))
{
if (arr_time[1] < 60)
{
dt_date.setMinutes(arr_time[1]);
}
else
{
return cal_error ("Invalid minutes value: '" + arr_time[1] + "'.\nAllowed range is 00-59.");
}
}
else
{
return cal_error ("Invalid minutes value: '" + arr_time[1] + "'.\nAllowed values are unsigned integers.");
}
if (!arr_time[2])
{
dt_date.setSeconds(0);
}
else if (RE_NUM.exec(arr_time[2]))
{
if (arr_time[2] < 60)
{
dt_date.setSeconds(arr_time[2]);
}
else
{
return cal_error ("Invalid seconds value: '" + arr_time[2] + "'.\nAllowed range is 00-59.");
}
}
else
{
return cal_error ("Invalid seconds value: '" + arr_time[2] + "'.\nAllowed values are unsigned integers.");
}
dt_date.setMilliseconds(0);
return dt_date;
}
/*--------------------------------------------*/
// Error
/*--------------------------------------------*/
function cal_error (str_message)
{
alert (str_message);
return null;
}
@@ -0,0 +1,147 @@
//------------------------------------------------------------------------------
// IPS JS: HIERARCHICAL DISPLAY FUNCTIONS
// (c) 2005 Invision Power Services, Inc.
// http://www.invisionpower.com
// Matt Mecham (13/12/05)
//------------------------------------------------------------------------------
function hierarchical()
{
/**
* Class variables.
*
* @var string Cookie name
* @var string Refresh display URL
* @var string First part of the image ID title string
*/
this.cookie_name = '';
this.location_url = '';
this.toggle_image_id_name = 'hier-toggle';
/**
* INIT: Grabs IDs from the HTML and
* sets up the various functions
*/
this.init = function()
{
//-----------------------------------------
// Do DIVs
//-----------------------------------------
var divs = document.getElementsByTagName('IMG');
//----------------------------------
// Sort through and grab links
//----------------------------------
for ( var i = 0 ; i < divs.length ; i++ )
{
try
{
if ( ! divs[i].id )
{
continue;
}
}
catch(error)
{
continue;
}
var divid = divs[i].id;
var divname = ipsclass.get_name_from_text( divid );
var divnum = ipsclass.get_id_from_text( divid );
//----------------------------------
// Work with it?
//----------------------------------
if ( divname == this.toggle_image_id_name )
{
divs[i].style.cursor = 'pointer';
divs[i].toggle_image_id_name = this.toggle_image_id_name;
divs[i].location_url = this.location_url;
divs[i].cookie_name = this.cookie_name;
divs[i].toggle_id = divnum;
divs[i].onclick = hierarchical_events.prototype.toggle_folder;
}
}
};
}
/**
* Wrapper function
*/
function hierarchical_events()
{
}
/**
* Toggle Folder Action
* @param object Event Object
*/
hierarchical_events.prototype.toggle_folder = function( e )
{
//-----------------------------------------
// Check..
//-----------------------------------------
if ( ! this.cookie_name )
{
return false;
}
//-----------------------------------------
// Cancel event bubbling
//-----------------------------------------
e = ipsclass.cancel_bubble(e, true);
//-----------------------------------------
// Set up
//-----------------------------------------
var saved = new Array();
var clean = new Array();
var found_id = 0;
//-----------------------------------
// Get any saved info
//-----------------------------------
if ( tmp = ipsclass.my_getcookie( this.cookie_name ) )
{
saved = tmp.split(",");
}
//-----------------------------------
// Remove bit if exists
//-----------------------------------
for( i = 0 ; i < saved.length; i++ )
{
if ( saved[i] != this.toggle_id && saved[i] != "" )
{
clean[clean.length] = saved[i];
}
else if ( saved[i] == this.toggle_id )
{
found_id = 1;
}
}
//-----------------------------------
// Not found the ID, so add it
//-----------------------------------
if ( ! found_id )
{
clean[ clean.length ] = this.toggle_id;
}
ipsclass.my_setcookie( this.cookie_name, clean.join(','), 1 );
ipsclass.location_jump( this.location_url, true );
};